atabey 0.0.11 → 0.0.13
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 +52 -249
- package/PRIVACY.md +161 -0
- package/README.md +355 -140
- package/bin/completion.sh +30 -0
- package/bin/{validate-agent-army.js → validate-al-registry.js} +6 -6
- package/dist/framework-mcp/src/index.js +14 -2
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/resources/index.js +5 -5
- package/dist/framework-mcp/src/resources/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/locking.d.ts +1 -1
- package/dist/framework-mcp/src/tools/control_plane/locking.js +11 -9
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.d.ts +5 -0
- package/dist/framework-mcp/src/tools/definitions.js +116 -241
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +4 -4
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.js +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +3 -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 +4 -4
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/audit_deps.js +1 -1
- package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +4 -3
- package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -1
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.d.ts +19 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js +138 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js.map +1 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.d.ts +8 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js +91 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js.map +1 -0
- package/dist/framework-mcp/src/tools/index.d.ts +2 -0
- package/dist/framework-mcp/src/tools/index.js +81 -17
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/memory/delete_knowledge.d.ts +8 -0
- package/dist/framework-mcp/src/tools/memory/delete_knowledge.js +29 -0
- package/dist/framework-mcp/src/tools/memory/delete_knowledge.js.map +1 -0
- package/dist/framework-mcp/src/tools/memory/read_memory.js +1 -1
- package/dist/framework-mcp/src/tools/memory/read_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/memory/search_knowledge.d.ts +8 -0
- package/dist/framework-mcp/src/tools/memory/search_knowledge.js +49 -0
- package/dist/framework-mcp/src/tools/memory/search_knowledge.js.map +1 -0
- package/dist/framework-mcp/src/tools/memory/store_knowledge.d.ts +10 -0
- package/dist/framework-mcp/src/tools/memory/store_knowledge.js +31 -0
- package/dist/framework-mcp/src/tools/memory/store_knowledge.js.map +1 -0
- package/dist/framework-mcp/src/tools/messaging/ask_human.d.ts +6 -0
- package/dist/framework-mcp/src/tools/messaging/ask_human.js +31 -0
- package/dist/framework-mcp/src/tools/messaging/ask_human.js.map +1 -0
- 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/observability/get_health.js +1 -1
- package/dist/framework-mcp/src/tools/quality/analyze_code_quality.d.ts +11 -0
- package/dist/framework-mcp/src/tools/quality/analyze_code_quality.js +166 -0
- package/dist/framework-mcp/src/tools/quality/analyze_code_quality.js.map +1 -0
- package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.d.ts +11 -0
- package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js +135 -0
- package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js.map +1 -0
- package/dist/framework-mcp/src/tools/schemas.d.ts +439 -0
- package/dist/framework-mcp/src/tools/schemas.js +183 -0
- package/dist/framework-mcp/src/tools/schemas.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_map.js +2 -2
- package/dist/framework-mcp/src/tools/search/get_map.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.js +10 -7
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/shell/run_command.js +72 -7
- package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -1
- package/dist/framework-mcp/src/tools/types.d.ts +10 -9
- package/dist/framework-mcp/src/utils/compliance.d.ts +10 -0
- package/dist/framework-mcp/src/utils/compliance.js +102 -41
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/framework-mcp/src/utils/fs.d.ts +10 -7
- package/dist/framework-mcp/src/utils/fs.js +10 -7
- package/dist/framework-mcp/src/utils/fs.js.map +1 -1
- package/dist/framework-mcp/src/utils/types.d.ts +8 -0
- package/dist/framework-mcp/src/utils/types.js +4 -0
- package/dist/framework-mcp/src/utils/types.js.map +1 -1
- package/dist/framework-mcp/src/utils/zod-to-mcp.d.ts +10 -0
- package/dist/framework-mcp/src/utils/zod-to-mcp.js +80 -0
- package/dist/framework-mcp/src/utils/zod-to-mcp.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +4 -4
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +17 -16
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/src/cli/adapters/core.js +2 -1
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.js +2 -1
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +17 -17
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/compliance.d.ts +5 -1
- package/dist/src/cli/commands/compliance.js +34 -42
- package/dist/src/cli/commands/compliance.js.map +1 -1
- package/dist/src/cli/commands/contract.js +6 -5
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/coverage.d.ts +1 -0
- package/dist/src/cli/commands/coverage.js +121 -0
- package/dist/src/cli/commands/coverage.js.map +1 -0
- package/dist/src/cli/commands/dashboard.d.ts +1 -1
- package/dist/src/cli/commands/dashboard.js +479 -39
- package/dist/src/cli/commands/dashboard.js.map +1 -1
- package/dist/src/cli/commands/explorer.js +8 -7
- package/dist/src/cli/commands/explorer.js.map +1 -1
- package/dist/src/cli/commands/gateway.d.ts +1 -0
- package/dist/src/cli/commands/gateway.js +172 -0
- package/dist/src/cli/commands/gateway.js.map +1 -0
- package/dist/src/cli/commands/git.js +8 -9
- package/dist/src/cli/commands/git.js.map +1 -1
- package/dist/src/cli/commands/index-codebase.d.ts +4 -0
- package/dist/src/cli/commands/index-codebase.js +52 -0
- package/dist/src/cli/commands/index-codebase.js.map +1 -0
- package/dist/src/cli/commands/init/create-agent.js +3 -3
- package/dist/src/cli/commands/init/create-agent.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -1
- package/dist/src/cli/commands/init/scaffold-core.js +7 -6
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-docs.js +4 -3
- package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-ops.js +3 -3
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +11 -7
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts +2 -0
- package/dist/src/cli/commands/init.js +127 -45
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/knowledge.js +5 -32
- package/dist/src/cli/commands/knowledge.js.map +1 -1
- package/dist/src/cli/commands/lint.js +5 -4
- package/dist/src/cli/commands/lint.js.map +1 -1
- package/dist/src/cli/commands/mcp.d.ts +11 -0
- package/dist/src/cli/commands/mcp.js +130 -0
- package/dist/src/cli/commands/mcp.js.map +1 -0
- package/dist/src/cli/commands/orchestrate.d.ts +10 -9
- package/dist/src/cli/commands/orchestrate.js +132 -66
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.js +16 -14
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/commands/quickstart.d.ts +9 -0
- package/dist/src/cli/commands/quickstart.js +72 -0
- package/dist/src/cli/commands/quickstart.js.map +1 -0
- package/dist/src/cli/commands/script.js +6 -5
- package/dist/src/cli/commands/script.js.map +1 -1
- package/dist/src/cli/commands/security.js +5 -8
- package/dist/src/cli/commands/security.js.map +1 -1
- package/dist/src/cli/commands/status.js +23 -19
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/commands/trace.d.ts +2 -0
- package/dist/src/cli/commands/trace.js +59 -61
- package/dist/src/cli/commands/trace.js.map +1 -1
- package/dist/src/cli/index.js +236 -294
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/platforms/core.d.ts +12 -0
- package/dist/src/cli/platforms/core.js +73 -0
- package/dist/src/cli/platforms/core.js.map +1 -0
- package/dist/src/cli/platforms/index.d.ts +5 -0
- package/dist/src/cli/platforms/index.js +6 -0
- package/dist/src/cli/platforms/index.js.map +1 -0
- package/dist/src/cli/platforms/paths.d.ts +15 -0
- package/dist/src/cli/platforms/paths.js +102 -0
- package/dist/src/cli/platforms/paths.js.map +1 -0
- package/dist/src/cli/platforms/scaffold.d.ts +2 -0
- package/dist/src/cli/platforms/scaffold.js +73 -0
- package/dist/src/cli/platforms/scaffold.js.map +1 -0
- package/dist/src/cli/platforms/utils.d.ts +4 -0
- package/dist/src/cli/platforms/utils.js +76 -0
- package/dist/src/cli/platforms/utils.js.map +1 -0
- package/dist/src/cli/shims.js +5 -5
- package/dist/src/cli/utils/claude.js +2 -1
- package/dist/src/cli/utils/claude.js.map +1 -1
- package/dist/src/cli/utils/compliance.d.ts +10 -9
- package/dist/src/cli/utils/compliance.js +10 -171
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/fs.d.ts +3 -3
- package/dist/src/cli/utils/fs.js +8 -7
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/i18n.d.ts +5 -0
- package/dist/src/cli/utils/i18n.js +5 -0
- package/dist/src/cli/utils/i18n.js.map +1 -1
- package/dist/src/cli/utils/memory.js +9 -6
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.js +8 -7
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/cli/utils/schemas.d.ts +4 -4
- package/dist/src/cli/utils/ui.d.ts +23 -0
- package/dist/src/cli/utils/ui.js +42 -0
- package/dist/src/cli/utils/ui.js.map +1 -1
- package/dist/src/contracts/tasks.d.ts +4 -4
- package/dist/src/dashboard/src/hooks/useApi.d.ts +18 -0
- package/dist/src/dashboard/src/hooks/useApi.js +47 -0
- package/dist/src/dashboard/src/hooks/useApi.js.map +1 -0
- package/dist/src/dashboard/src/hooks/useSSE.d.ts +12 -0
- package/dist/src/dashboard/src/hooks/useSSE.js +60 -0
- package/dist/src/dashboard/src/hooks/useSSE.js.map +1 -0
- package/dist/src/modules/adapters/shared.js +3 -3
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +5 -13
- package/dist/src/modules/agents/definitions.js +179 -78
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/analyst.js +2 -1
- package/dist/src/modules/agents/registry/analyst.js.map +1 -1
- package/dist/src/modules/agents/registry/architect.js +1 -0
- package/dist/src/modules/agents/registry/architect.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +8 -6
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/explorer.js +2 -0
- package/dist/src/modules/agents/registry/explorer.js.map +1 -1
- package/dist/src/modules/agents/registry/frontend.js +8 -6
- package/dist/src/modules/agents/registry/frontend.js.map +1 -1
- package/dist/src/modules/agents/registry/git.js.map +1 -1
- package/dist/src/modules/agents/registry/manager.js +11 -4
- package/dist/src/modules/agents/registry/manager.js.map +1 -1
- package/dist/src/modules/agents/registry/mobile.js +7 -5
- package/dist/src/modules/agents/registry/mobile.js.map +1 -1
- package/dist/src/modules/agents/registry/native.js +7 -5
- package/dist/src/modules/agents/registry/native.js.map +1 -1
- package/dist/src/modules/agents/registry/quality.js +11 -8
- package/dist/src/modules/agents/registry/quality.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/modules/contracts/api.d.ts +178 -0
- package/dist/src/modules/contracts/api.js +56 -0
- package/dist/src/modules/contracts/api.js.map +1 -0
- package/dist/src/modules/contracts/index.d.ts +5 -0
- package/dist/src/modules/contracts/index.js +6 -0
- package/dist/src/modules/contracts/index.js.map +1 -0
- package/dist/src/modules/engines/agent-executor.d.ts +50 -0
- package/dist/src/modules/engines/agent-executor.js +188 -0
- package/dist/src/modules/engines/agent-executor.js.map +1 -0
- package/dist/src/modules/engines/health-engine.d.ts +7 -1
- package/dist/src/modules/engines/health-engine.js +85 -8
- package/dist/src/modules/engines/health-engine.js.map +1 -1
- package/dist/src/modules/engines/planning-engine.d.ts +1 -1
- package/dist/src/modules/engines/planning-engine.js +5 -4
- package/dist/src/modules/engines/planning-engine.js.map +1 -1
- package/dist/src/modules/engines/quality-gate.d.ts +23 -0
- package/dist/src/modules/engines/quality-gate.js +85 -0
- package/dist/src/modules/engines/quality-gate.js.map +1 -0
- package/dist/src/modules/engines/risk-engine.js +6 -6
- package/dist/src/modules/engines/risk-engine.js.map +1 -1
- package/dist/src/modules/engines/routing-engine.d.ts +59 -1
- package/dist/src/modules/engines/routing-engine.js +353 -25
- package/dist/src/modules/engines/routing-engine.js.map +1 -1
- package/dist/src/modules/engines/types.d.ts +7 -3
- package/dist/src/modules/gateway/circuit-breaker.d.ts +40 -0
- package/dist/src/modules/gateway/circuit-breaker.js +163 -0
- package/dist/src/modules/gateway/circuit-breaker.js.map +1 -0
- package/dist/src/modules/gateway/cost-tracker.d.ts +55 -0
- package/dist/src/modules/gateway/cost-tracker.js +127 -0
- package/dist/src/modules/gateway/cost-tracker.js.map +1 -0
- package/dist/src/modules/gateway/gateway.d.ts +68 -0
- package/dist/src/modules/gateway/gateway.js +235 -0
- package/dist/src/modules/gateway/gateway.js.map +1 -0
- package/dist/src/modules/gateway/index.d.ts +19 -0
- package/dist/src/modules/gateway/index.js +19 -0
- package/dist/src/modules/gateway/index.js.map +1 -0
- package/dist/src/modules/gateway/load-balancer.d.ts +86 -0
- package/dist/src/modules/gateway/load-balancer.js +230 -0
- package/dist/src/modules/gateway/load-balancer.js.map +1 -0
- package/dist/src/modules/gateway/providers/anthropic.d.ts +14 -0
- package/dist/src/modules/gateway/providers/anthropic.js +169 -0
- package/dist/src/modules/gateway/providers/anthropic.js.map +1 -0
- package/dist/src/modules/gateway/providers/base.d.ts +38 -0
- package/dist/src/modules/gateway/providers/base.js +42 -0
- package/dist/src/modules/gateway/providers/base.js.map +1 -0
- package/dist/src/modules/gateway/providers/google.d.ts +18 -0
- package/dist/src/modules/gateway/providers/google.js +176 -0
- package/dist/src/modules/gateway/providers/google.js.map +1 -0
- package/dist/src/modules/gateway/providers/grok.d.ts +14 -0
- package/dist/src/modules/gateway/providers/grok.js +166 -0
- package/dist/src/modules/gateway/providers/grok.js.map +1 -0
- package/dist/src/modules/gateway/providers/index.d.ts +21 -0
- package/dist/src/modules/gateway/providers/index.js +38 -0
- package/dist/src/modules/gateway/providers/index.js.map +1 -0
- package/dist/src/modules/gateway/providers/ollama.d.ts +23 -0
- package/dist/src/modules/gateway/providers/ollama.js +187 -0
- package/dist/src/modules/gateway/providers/ollama.js.map +1 -0
- package/dist/src/modules/gateway/providers/openai.d.ts +14 -0
- package/dist/src/modules/gateway/providers/openai.js +170 -0
- package/dist/src/modules/gateway/providers/openai.js.map +1 -0
- package/dist/src/modules/gateway/rate-limiter.d.ts +41 -0
- package/dist/src/modules/gateway/rate-limiter.js +119 -0
- package/dist/src/modules/gateway/rate-limiter.js.map +1 -0
- package/dist/src/modules/gateway/types.d.ts +114 -0
- package/dist/src/modules/gateway/types.js +8 -0
- package/dist/src/modules/gateway/types.js.map +1 -0
- package/dist/src/modules/memory/core.d.ts +42 -0
- package/dist/src/modules/memory/core.js +100 -0
- package/dist/src/modules/memory/core.js.map +1 -0
- package/dist/src/modules/memory/embedding.d.ts +28 -0
- package/dist/src/modules/memory/embedding.js +131 -0
- package/dist/src/modules/memory/embedding.js.map +1 -0
- package/dist/src/modules/memory/types.d.ts +18 -0
- package/dist/src/modules/memory/types.js +2 -0
- package/dist/src/modules/memory/types.js.map +1 -0
- package/dist/src/modules/memory/vector-store.d.ts +13 -0
- package/dist/src/modules/memory/vector-store.js +75 -0
- package/dist/src/modules/memory/vector-store.js.map +1 -0
- package/dist/src/modules/providers/definitions.d.ts +9 -0
- package/dist/src/modules/providers/definitions.js +141 -0
- package/dist/src/modules/providers/definitions.js.map +1 -0
- package/dist/src/modules/providers/registry.d.ts +12 -0
- package/dist/src/modules/providers/registry.js +19 -0
- package/dist/src/modules/providers/registry.js.map +1 -0
- package/dist/src/modules/providers/shared.d.ts +1 -0
- package/dist/src/modules/providers/shared.js +105 -0
- package/dist/src/modules/providers/shared.js.map +1 -0
- package/dist/src/modules/providers/types.d.ts +14 -0
- package/dist/src/modules/providers/types.js +2 -0
- package/dist/src/modules/providers/types.js.map +1 -0
- package/dist/src/modules/skills/adapter-skills.d.ts +68 -0
- package/dist/src/modules/skills/adapter-skills.js +450 -0
- package/dist/src/modules/skills/adapter-skills.js.map +1 -0
- package/dist/src/shared/audit.d.ts +105 -0
- package/dist/src/shared/audit.js +220 -0
- package/dist/src/shared/audit.js.map +1 -0
- package/dist/src/shared/constants.d.ts +11 -11
- package/dist/src/shared/constants.js +3 -3
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/src/shared/fs.js +4 -2
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/src/shared/lock.d.ts +82 -0
- package/dist/src/shared/lock.js +160 -0
- package/dist/src/shared/lock.js.map +1 -0
- package/dist/src/shared/logger.d.ts +2 -0
- package/dist/src/shared/logger.js +15 -5
- package/dist/src/shared/logger.js.map +1 -1
- package/dist/src/shared/pii.d.ts +37 -0
- package/dist/src/shared/pii.js +122 -0
- package/dist/src/shared/pii.js.map +1 -0
- package/dist/src/shared/retention.d.ts +63 -0
- package/dist/src/shared/retention.js +171 -0
- package/dist/src/shared/retention.js.map +1 -0
- package/dist/src/shared/storage.d.ts +13 -11
- package/dist/src/shared/storage.js +18 -14
- package/dist/src/shared/storage.js.map +1 -1
- package/dist/src/shared/string.d.ts +1 -0
- package/dist/src/shared/string.js +30 -0
- package/dist/src/shared/string.js.map +1 -0
- package/dist/src/shared/types.d.ts +8 -0
- package/dist/src/shared/types.js +4 -0
- package/dist/src/shared/types.js.map +1 -1
- package/dist/tests/adapter.test.js +3 -2
- package/dist/tests/adapter.test.js.map +1 -1
- package/dist/tests/adapters/paths.test.js +4 -4
- package/dist/tests/adapters/paths.test.js.map +1 -1
- package/dist/tests/cli/commands/check.test.d.ts +1 -0
- package/dist/tests/cli/commands/check.test.js +9 -0
- package/dist/tests/cli/commands/check.test.js.map +1 -0
- package/dist/tests/cli/commands/coverage.test.d.ts +1 -0
- package/dist/tests/cli/commands/coverage.test.js +9 -0
- package/dist/tests/cli/commands/coverage.test.js.map +1 -0
- package/dist/tests/cli/commands/dashboard-coverage.test.d.ts +1 -0
- package/dist/tests/cli/commands/dashboard-coverage.test.js +88 -0
- package/dist/tests/cli/commands/dashboard-coverage.test.js.map +1 -0
- package/dist/tests/cli/commands/exports.test.d.ts +1 -0
- package/dist/tests/cli/commands/exports.test.js +61 -0
- package/dist/tests/cli/commands/exports.test.js.map +1 -0
- package/dist/tests/cli/commands/lint.test.d.ts +1 -0
- package/dist/tests/cli/commands/lint.test.js +9 -0
- package/dist/tests/cli/commands/lint.test.js.map +1 -0
- package/dist/tests/cli/init/adapter_init.test.js +4 -5
- package/dist/tests/cli/init/adapter_init.test.js.map +1 -1
- package/dist/tests/cli/init/unified_init.test.js +5 -7
- package/dist/tests/cli/init/unified_init.test.js.map +1 -1
- package/dist/tests/core-memory.test.d.ts +1 -0
- package/dist/tests/core-memory.test.js +78 -0
- package/dist/tests/core-memory.test.js.map +1 -0
- package/dist/tests/dashboard.test.d.ts +1 -0
- package/dist/tests/dashboard.test.js +116 -0
- package/dist/tests/dashboard.test.js.map +1 -0
- package/dist/tests/fs-utils.test.js +5 -5
- package/dist/tests/fs-utils.test.js.map +1 -1
- package/dist/tests/integration/agent_flow.test.js +24 -10
- package/dist/tests/integration/agent_flow.test.js.map +1 -1
- package/dist/tests/modules/adapters/adapters.test.js +2 -2
- package/dist/tests/modules/adapters/adapters.test.js.map +1 -1
- package/dist/tests/modules/contracts/contracts.test.d.ts +1 -0
- package/dist/tests/modules/contracts/contracts.test.js +73 -0
- package/dist/tests/modules/contracts/contracts.test.js.map +1 -0
- package/dist/tests/modules/engines/agent-executor.test.d.ts +1 -0
- package/dist/tests/modules/engines/agent-executor.test.js +61 -0
- package/dist/tests/modules/engines/agent-executor.test.js.map +1 -0
- package/dist/tests/modules/engines/evaluation-engine.test.d.ts +1 -0
- package/dist/tests/modules/engines/evaluation-engine.test.js +45 -0
- package/dist/tests/modules/engines/evaluation-engine.test.js.map +1 -0
- package/dist/tests/modules/engines/health-engine.test.d.ts +1 -0
- package/dist/tests/modules/engines/health-engine.test.js +56 -0
- package/dist/tests/modules/engines/health-engine.test.js.map +1 -0
- package/dist/tests/modules/engines/planning-engine.test.d.ts +1 -0
- package/dist/tests/modules/engines/planning-engine.test.js +75 -0
- package/dist/tests/modules/engines/planning-engine.test.js.map +1 -0
- package/dist/tests/modules/engines/risk-engine.test.d.ts +1 -0
- package/dist/tests/modules/engines/risk-engine.test.js +61 -0
- package/dist/tests/modules/engines/risk-engine.test.js.map +1 -0
- package/dist/tests/modules/engines/routing-engine.test.d.ts +1 -0
- package/dist/tests/modules/engines/routing-engine.test.js +56 -0
- package/dist/tests/modules/engines/routing-engine.test.js.map +1 -0
- package/dist/tests/modules/gateway/circuit-breaker.test.d.ts +1 -0
- package/dist/tests/modules/gateway/circuit-breaker.test.js +124 -0
- package/dist/tests/modules/gateway/circuit-breaker.test.js.map +1 -0
- package/dist/tests/modules/gateway/cost-tracker.test.d.ts +1 -0
- package/dist/tests/modules/gateway/cost-tracker.test.js +74 -0
- package/dist/tests/modules/gateway/cost-tracker.test.js.map +1 -0
- package/dist/tests/modules/gateway/load-balancer.test.d.ts +1 -0
- package/dist/tests/modules/gateway/load-balancer.test.js +70 -0
- package/dist/tests/modules/gateway/load-balancer.test.js.map +1 -0
- package/dist/tests/modules/gateway/rate-limiter.test.d.ts +1 -0
- package/dist/tests/modules/gateway/rate-limiter.test.js +62 -0
- package/dist/tests/modules/gateway/rate-limiter.test.js.map +1 -0
- package/dist/tests/modules/memory/vector-store.test.d.ts +1 -0
- package/dist/tests/modules/memory/vector-store.test.js +109 -0
- package/dist/tests/modules/memory/vector-store.test.js.map +1 -0
- package/dist/tests/orchestrator-dependencies.test.js +40 -22
- package/dist/tests/orchestrator-dependencies.test.js.map +1 -1
- package/dist/tests/planning-engine.test.js +9 -8
- package/dist/tests/planning-engine.test.js.map +1 -1
- package/dist/tests/risk-engine.test.d.ts +1 -0
- package/dist/tests/risk-engine.test.js +44 -0
- package/dist/tests/risk-engine.test.js.map +1 -0
- package/dist/tests/shared/audit.test.d.ts +1 -0
- package/dist/tests/shared/audit.test.js +53 -0
- package/dist/tests/shared/audit.test.js.map +1 -0
- package/dist/tests/status-cost.test.js +15 -24
- package/dist/tests/status-cost.test.js.map +1 -1
- package/dist/tests/status.test.js +16 -17
- package/dist/tests/status.test.js.map +1 -1
- package/dist/tests/storage-operations.test.d.ts +1 -0
- package/dist/tests/storage-operations.test.js +116 -0
- package/dist/tests/storage-operations.test.js.map +1 -0
- package/dist/tests/trace-replay.test.js +34 -40
- package/dist/tests/trace-replay.test.js.map +1 -1
- package/dist/ui/assets/index-B-d2ejS8.js +519 -0
- package/dist/ui/assets/index-CyXywq5G.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/vitest.config.js +5 -5
- package/dist/vitest.config.js.map +1 -1
- package/framework-mcp/README.md +339 -25
- package/framework-mcp/dist/dashboard/assets/index-BAPGLiWE.js +267 -0
- package/framework-mcp/dist/dashboard/index.html +15 -0
- package/framework-mcp/dist/framework-mcp/src/constants.js +64 -0
- package/framework-mcp/dist/framework-mcp/src/index.js +156 -0
- package/framework-mcp/dist/framework-mcp/src/resources/index.js +58 -0
- package/framework-mcp/dist/framework-mcp/src/tools/control_plane/locking.js +84 -0
- package/framework-mcp/dist/framework-mcp/src/tools/control_plane/registry.js +35 -0
- package/framework-mcp/dist/framework-mcp/src/tools/definitions.js +197 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +64 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/patch_file.js +34 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/read_file.js +51 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/replace_text.js +50 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/write_file.js +55 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/audit_deps.js +41 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/get_status.js +5 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/orchestrate.js +5 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/run_tests.js +27 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +13 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/update_contract_hash.js +5 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/update_memory.js +8 -0
- package/framework-mcp/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js +137 -0
- package/framework-mcp/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js +90 -0
- package/framework-mcp/dist/framework-mcp/src/tools/index.js +126 -0
- package/framework-mcp/dist/framework-mcp/src/tools/memory/delete_knowledge.js +28 -0
- package/framework-mcp/dist/framework-mcp/src/tools/memory/get_insights.js +22 -0
- package/framework-mcp/dist/framework-mcp/src/tools/memory/read_memory.js +28 -0
- package/framework-mcp/dist/framework-mcp/src/tools/memory/search_knowledge.js +48 -0
- package/framework-mcp/dist/framework-mcp/src/tools/memory/store_knowledge.js +30 -0
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/ask_human.js +30 -0
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/log_action.js +22 -0
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/send_message.js +94 -0
- package/framework-mcp/dist/framework-mcp/src/tools/observability/check_ports.js +26 -0
- package/framework-mcp/dist/framework-mcp/src/tools/observability/get_health.js +19 -0
- package/framework-mcp/dist/framework-mcp/src/tools/quality/analyze_code_quality.js +165 -0
- package/framework-mcp/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js +134 -0
- package/framework-mcp/dist/framework-mcp/src/tools/quality/check_lint.js +30 -0
- package/framework-mcp/dist/framework-mcp/src/tools/schemas.js +182 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/get_gaps.js +48 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/get_map.js +43 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/grep_search.js +78 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/framework-mcp/src/tools/shell/run_command.js +121 -0
- package/framework-mcp/dist/framework-mcp/src/tools/types.js +1 -0
- package/framework-mcp/dist/framework-mcp/src/utils/cli.js +59 -0
- package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +292 -0
- package/framework-mcp/dist/framework-mcp/src/utils/errors.js +68 -0
- package/framework-mcp/dist/framework-mcp/src/utils/fs.js +47 -0
- package/framework-mcp/dist/framework-mcp/src/utils/memory.js +74 -0
- package/framework-mcp/dist/framework-mcp/src/utils/metrics.js +56 -0
- package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +71 -0
- package/framework-mcp/dist/framework-mcp/src/utils/security.js +60 -0
- package/framework-mcp/dist/framework-mcp/src/utils/storage.js +207 -0
- package/framework-mcp/dist/framework-mcp/src/utils/types.js +16 -0
- package/framework-mcp/dist/framework-mcp/src/utils/zod-to-mcp.js +79 -0
- package/framework-mcp/dist/index.js +14 -2
- package/framework-mcp/dist/src/cli/utils/memory.js +279 -0
- package/framework-mcp/dist/src/cli/utils/time.js +27 -0
- package/framework-mcp/dist/src/cli/utils/ui.js +100 -0
- package/framework-mcp/dist/src/modules/memory/core.js +99 -0
- package/framework-mcp/dist/src/modules/memory/embedding.js +130 -0
- package/framework-mcp/dist/src/modules/memory/types.js +1 -0
- package/framework-mcp/dist/src/modules/memory/vector-store.js +74 -0
- package/framework-mcp/dist/src/shared/constants.js +187 -0
- package/framework-mcp/dist/src/shared/fs.js +53 -0
- package/framework-mcp/dist/src/shared/logger.js +126 -0
- package/framework-mcp/dist/src/shared/pii.js +121 -0
- package/framework-mcp/dist/src/shared/storage.js +211 -0
- package/framework-mcp/dist/src/shared/types.js +16 -0
- package/framework-mcp/dist/tools/definitions.js +79 -247
- package/framework-mcp/dist/tools/index.js +37 -0
- package/framework-mcp/dist/tools/schemas.js +133 -0
- package/framework-mcp/dist/utils/types.js +4 -0
- package/framework-mcp/dist/utils/zod-to-mcp.js +77 -0
- package/framework-mcp/package.json +2 -2
- package/mcp.json +5 -4
- package/package.json +19 -17
- package/templates/full/ATABEY_FULL.md +515 -0
- package/templates/standards/crud-governance.md +1 -1
- package/templates/standards/logging-and-secrets.md +1 -1
- package/templates/standards/performance-standards.md +2 -2
- package/templates/standards/quality-standards.md +1 -1
- package/dist/ui/assets/index-Bkt7APzu.css +0 -1
- package/dist/ui/assets/index-CeX-06mI.js +0 -49
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Storage } from "../../../../src/shared/storage.js";
|
|
2
|
+
export async function handleDeleteKnowledge(root, args) {
|
|
3
|
+
try {
|
|
4
|
+
const db = Storage.getDB();
|
|
5
|
+
if (args.id) {
|
|
6
|
+
const info = db.prepare("DELETE FROM vector_memory WHERE id = ?").run(args.id);
|
|
7
|
+
if (info.changes > 0) {
|
|
8
|
+
return { content: [{ type: "text", text: `[SUCCESS] Knowledge entry '${args.id}' deleted from Core Memory.` }] };
|
|
9
|
+
}
|
|
10
|
+
return { content: [{ type: "text", text: `[INFO] No entry found with ID '${args.id}'.` }] };
|
|
11
|
+
}
|
|
12
|
+
if (args.category) {
|
|
13
|
+
const info = db.prepare("DELETE FROM vector_memory WHERE category = ?").run(args.category);
|
|
14
|
+
return { content: [{ type: "text", text: `[SUCCESS] Purged ${info.changes} entries from category '${args.category}'.` }] };
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
isError: true,
|
|
18
|
+
content: [{ type: "text", text: "[ERROR] You must provide either an 'id' or a 'category' to delete knowledge." }]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
23
|
+
return {
|
|
24
|
+
isError: true,
|
|
25
|
+
content: [{ type: "text", text: `[ERROR] Failed to delete knowledge: ${message}` }]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Storage } from "../../utils/storage.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts key insights from the SQLite database to minimize token usage.
|
|
4
|
+
* Returns only the active phase, trace, and the last 5 decisions/tasks.
|
|
5
|
+
*/
|
|
6
|
+
export function handleGetMemoryInsights(_projectRoot, _args) {
|
|
7
|
+
try {
|
|
8
|
+
const activePhase = Storage.getMetadata("phase") || "PHASE_0";
|
|
9
|
+
const activeTrace = Storage.getMetadata("traceId") || "None";
|
|
10
|
+
// Get the last 5 logs from SQLite
|
|
11
|
+
const recentLogs = Storage.getLogs().slice(0, 5);
|
|
12
|
+
let recentHistory = "No history found.";
|
|
13
|
+
if (recentLogs.length > 0) {
|
|
14
|
+
recentHistory = recentLogs.map(log => `- [${log.agent}] ${log.action}: ${log.summary}`).join("\n");
|
|
15
|
+
}
|
|
16
|
+
const insights = `[MEMORY] **Memory Insights**\n- **Phase:** ${activePhase}\n- **Trace:** ${activeTrace}\n\n**Recent Actions:**\n${recentHistory}`;
|
|
17
|
+
return { content: [{ type: "text", text: insights }] };
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
return { isError: true, content: [{ type: "text", text: `Failed to extract insights: ${String(e)}` }] };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
+
/**
|
|
5
|
+
* Reads the project's central memory (PROJECT_MEMORY.md).
|
|
6
|
+
* This is the "brain" of the project.
|
|
7
|
+
*/
|
|
8
|
+
export function handleReadProjectMemory(projectRoot, _args) {
|
|
9
|
+
try {
|
|
10
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
11
|
+
const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
|
|
12
|
+
if (!fs.existsSync(memoryPath)) {
|
|
13
|
+
return {
|
|
14
|
+
content: [{ type: "text", text: "[INFO] Project memory file not found. It might be a new project." }]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const content = fs.readFileSync(memoryPath, "utf8");
|
|
18
|
+
return {
|
|
19
|
+
content: [{ type: "text", text: content }]
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
return {
|
|
24
|
+
isError: true,
|
|
25
|
+
content: [{ type: "text", text: `Failed to read project memory: ${String(e)}` }]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CoreMemory } from "../../../../src/modules/memory/core.js";
|
|
2
|
+
export async function handleSearchKnowledge(root, args) {
|
|
3
|
+
try {
|
|
4
|
+
await CoreMemory.init();
|
|
5
|
+
const results = await CoreMemory.recall(args.query, {
|
|
6
|
+
category: args.category,
|
|
7
|
+
limit: args.limit
|
|
8
|
+
});
|
|
9
|
+
if (results.length === 0) {
|
|
10
|
+
return {
|
|
11
|
+
content: [{
|
|
12
|
+
type: "text",
|
|
13
|
+
text: "[INFO] No relevant knowledge found."
|
|
14
|
+
}]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const output = results.map(r => {
|
|
18
|
+
const meta = r.entry.metadata;
|
|
19
|
+
return `---
|
|
20
|
+
ID: ${r.entry.id}
|
|
21
|
+
Score: ${r.score.toFixed(4)}
|
|
22
|
+
Category: ${meta.category}
|
|
23
|
+
Tags: ${meta.tags.join(", ") || "none"}
|
|
24
|
+
File: ${meta.filePath || "N/A"}
|
|
25
|
+
Trace: ${meta.traceId || "N/A"}
|
|
26
|
+
|
|
27
|
+
Content:
|
|
28
|
+
${r.entry.content}
|
|
29
|
+
`;
|
|
30
|
+
}).join("\n");
|
|
31
|
+
return {
|
|
32
|
+
content: [{
|
|
33
|
+
type: "text",
|
|
34
|
+
text: `[SUCCESS] Found ${results.length} relevant entries:\n\n${output}`
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
40
|
+
return {
|
|
41
|
+
isError: true,
|
|
42
|
+
content: [{
|
|
43
|
+
type: "text",
|
|
44
|
+
text: `[ERROR] Search failed: ${message}`
|
|
45
|
+
}]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CoreMemory } from "../../../../src/modules/memory/core.js";
|
|
2
|
+
import { asTraceID } from "../../../../src/shared/types.js";
|
|
3
|
+
export async function handleStoreKnowledge(root, args) {
|
|
4
|
+
try {
|
|
5
|
+
await CoreMemory.init();
|
|
6
|
+
const id = await CoreMemory.remember({
|
|
7
|
+
content: args.content,
|
|
8
|
+
category: args.category,
|
|
9
|
+
tags: args.tags,
|
|
10
|
+
filePath: args.filePath,
|
|
11
|
+
traceId: args.traceId ? asTraceID(args.traceId) : undefined
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
content: [{
|
|
15
|
+
type: "text",
|
|
16
|
+
text: `[SUCCESS] Knowledge stored with ID: ${id}`
|
|
17
|
+
}]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
22
|
+
return {
|
|
23
|
+
isError: true,
|
|
24
|
+
content: [{
|
|
25
|
+
type: "text",
|
|
26
|
+
text: `[ERROR] Failed to store knowledge: ${message}`
|
|
27
|
+
}]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
export async function handleAskHuman(root, args) {
|
|
3
|
+
if (process.env.ATABEY_TEST_DIR || !process.stdin.isTTY) {
|
|
4
|
+
return { content: [{ type: "text", text: "[SKIPPED] Non-interactive environment. Cannot ask human." }] };
|
|
5
|
+
}
|
|
6
|
+
try {
|
|
7
|
+
const readline = await import("readline");
|
|
8
|
+
const rl = readline.createInterface({
|
|
9
|
+
input: process.stdin,
|
|
10
|
+
output: process.stdout
|
|
11
|
+
});
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
process.stdout.write("\n" + chalk.bgMagenta.white.bold(" [HUMAN-IN-THE-LOOP REQUIRED] ") + "\n");
|
|
14
|
+
process.stdout.write(chalk.magenta("An agent has paused execution to ask you a question:\n"));
|
|
15
|
+
rl.question(`\n${chalk.bold(args.question)}\n${chalk.gray("> ")}`, (answer) => {
|
|
16
|
+
rl.close();
|
|
17
|
+
resolve({
|
|
18
|
+
content: [{ type: "text", text: `[HUMAN RESPONSE] ${answer}` }]
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
25
|
+
return {
|
|
26
|
+
isError: true,
|
|
27
|
+
content: [{ type: "text", text: `[ERROR] Failed to ask human: ${message}` }]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
+
export function handleLogAgentAction(projectRoot, args) {
|
|
5
|
+
const { agent, action, traceId, status, summary } = args;
|
|
6
|
+
const findings = args.findings ? args.findings.split(",").map(f => f.trim()) : [];
|
|
7
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
8
|
+
const agentName = agent.replace("@", "");
|
|
9
|
+
const logPath = path.join(projectRoot, frameworkDir, "logs", `${agentName}.json`);
|
|
10
|
+
const logEntry = {
|
|
11
|
+
timestamp: new Date().toISOString(),
|
|
12
|
+
agent,
|
|
13
|
+
action,
|
|
14
|
+
requestId: traceId,
|
|
15
|
+
status,
|
|
16
|
+
summary,
|
|
17
|
+
findings
|
|
18
|
+
};
|
|
19
|
+
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
20
|
+
fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
|
|
21
|
+
return { content: [{ type: "text", text: `[OK] Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
|
|
22
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
+
import { Metrics } from "../../utils/metrics.js";
|
|
5
|
+
export async function handleSendAgentMessage(projectRoot, args) {
|
|
6
|
+
const { to, category, content, traceId, parentId, requiresApproval } = args;
|
|
7
|
+
const from = args.from || "@mcp";
|
|
8
|
+
if (!to || !category || !content || !traceId) {
|
|
9
|
+
const err = "Missing required messaging arguments (to, category, content, or traceId).";
|
|
10
|
+
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
11
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
12
|
+
}
|
|
13
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
14
|
+
const messagesDir = path.join(projectRoot, frameworkDir, "messages");
|
|
15
|
+
const agentName = to.replace("@", "");
|
|
16
|
+
const messagePath = path.join(messagesDir, `${agentName}.json`);
|
|
17
|
+
const lockPath = path.join(messagesDir, `${agentName}.lock`);
|
|
18
|
+
// Hermes Lock Protocol: Retry 20 times with 500ms delay
|
|
19
|
+
let retries = 20;
|
|
20
|
+
let acquired = false;
|
|
21
|
+
while (retries > 0) {
|
|
22
|
+
try {
|
|
23
|
+
if (fs.existsSync(lockPath)) {
|
|
24
|
+
try {
|
|
25
|
+
const stats = fs.statSync(lockPath);
|
|
26
|
+
if (Date.now() - stats.mtimeMs > 10000) {
|
|
27
|
+
const tempLockPath = `${lockPath}.${Math.random().toString(36).substring(2)}.old`;
|
|
28
|
+
fs.renameSync(lockPath, tempLockPath);
|
|
29
|
+
fs.unlinkSync(tempLockPath);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// ignore if concurrently unlinked or renamed
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
fs.mkdirSync(messagesDir, { recursive: true });
|
|
37
|
+
fs.writeFileSync(lockPath, `Locked by ${from} at ${new Date().toISOString()}`, { flag: "wx" });
|
|
38
|
+
acquired = true;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
const error = err;
|
|
43
|
+
if (error.code === "EEXIST") {
|
|
44
|
+
retries--;
|
|
45
|
+
if (retries > 0) {
|
|
46
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return { content: [{ type: "text", text: `[ERROR] Unexpected lock acquisition error: ${error.message || String(err)}` }], isError: true };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (!acquired) {
|
|
55
|
+
const err = `Could not send message to ${to}: Hermes lock is busy.`;
|
|
56
|
+
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
57
|
+
return { content: [{ type: "text", text: `[ERROR] ${err}` }], isError: true };
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const defaultPriority = (category === "ALERT" || category === "ACTION") ? "HIGH" : "NORMAL";
|
|
61
|
+
const finalRequiresApproval = requiresApproval !== undefined
|
|
62
|
+
? requiresApproval
|
|
63
|
+
: category === "ALERT";
|
|
64
|
+
const message = {
|
|
65
|
+
timestamp: new Date().toISOString(),
|
|
66
|
+
from,
|
|
67
|
+
to,
|
|
68
|
+
category,
|
|
69
|
+
traceId,
|
|
70
|
+
parentId,
|
|
71
|
+
content,
|
|
72
|
+
priority: args.priority || defaultPriority,
|
|
73
|
+
status: "PENDING",
|
|
74
|
+
requiresApproval: finalRequiresApproval
|
|
75
|
+
};
|
|
76
|
+
fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
|
|
77
|
+
return { content: [{ type: "text", text: `[OK] Message sent to ${to} (from: ${from})` }] };
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
const err = `Failed to write message: ${String(e)}`;
|
|
81
|
+
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
82
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
if (acquired && fs.existsSync(lockPath)) {
|
|
86
|
+
try {
|
|
87
|
+
fs.unlinkSync(lockPath);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// ignore
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
/**
|
|
3
|
+
* Checks for active network ports and their status.
|
|
4
|
+
*/
|
|
5
|
+
export function handleCheckPorts(projectRoot, args) {
|
|
6
|
+
const filter = args.filter || ""; // Optional filter (e.g., ":3000")
|
|
7
|
+
try {
|
|
8
|
+
// Using 'lsof -i -P -n' to list open files and network connections
|
|
9
|
+
// Note: may require permissions or behave differently on non-Unix systems
|
|
10
|
+
const command = process.platform === "win32"
|
|
11
|
+
? `netstat -ano | findstr LISTENING ${filter ? `| findstr ${filter}` : ""}`
|
|
12
|
+
: `lsof -i -P -n | grep LISTEN ${filter ? `| grep ${filter}` : ""}`;
|
|
13
|
+
const output = execSync(command, { encoding: "utf8" });
|
|
14
|
+
return {
|
|
15
|
+
content: [{
|
|
16
|
+
type: "text",
|
|
17
|
+
text: `[SIGNAL] **Active Listening Ports:**\n\n${output || "No active listening ports found matching filter."}`
|
|
18
|
+
}]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (_e) {
|
|
22
|
+
return {
|
|
23
|
+
content: [{ type: "text", text: "[INFO] No active ports found or command failed (this is normal if nothing is listening)." }]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import os from "os";
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves system health metrics including CPU load and memory usage.
|
|
4
|
+
*/
|
|
5
|
+
export function handleGetSystemHealth(_projectRoot, _args) {
|
|
6
|
+
const totalMem = os.totalmem();
|
|
7
|
+
const freeMem = os.freemem();
|
|
8
|
+
const usedMem = totalMem - freeMem;
|
|
9
|
+
const memUsagePercent = ((usedMem / totalMem) * 100).toFixed(2);
|
|
10
|
+
const loadAvg = os.loadavg(); // [1, 5, 15] minute averages
|
|
11
|
+
const healthReport = `[SERVER] **System Health Report**
|
|
12
|
+
- **Memory:** ${memUsagePercent}% used (${(usedMem / 1024 / 1024 / 1024).toFixed(2)} GB / ${(totalMem / 1024 / 1024 / 1024).toFixed(2)} GB)
|
|
13
|
+
- **CPU Load (1m, 5m, 15m):** ${loadAvg.map(l => l.toFixed(2)).join(", ")}
|
|
14
|
+
- **Platform:** ${os.platform()} (${os.release()})
|
|
15
|
+
- **Uptime:** ${(os.uptime() / 3600).toFixed(2)} hours`;
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: "text", text: healthReport }]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
/**
|
|
5
|
+
* Code quality analysis tool for Atabey MCP.
|
|
6
|
+
*
|
|
7
|
+
* Performs three checks on the provided source code:
|
|
8
|
+
* - TypeScript type checking (checkTypes)
|
|
9
|
+
* - Lint checking (checkLint)
|
|
10
|
+
* - Code complexity analysis (checkComplexity)
|
|
11
|
+
*/
|
|
12
|
+
export function handleAnalyzeCodeQuality(projectRoot, args) {
|
|
13
|
+
const targetPath = path.resolve(projectRoot, args.path);
|
|
14
|
+
if (!fs.existsSync(targetPath)) {
|
|
15
|
+
return {
|
|
16
|
+
isError: true,
|
|
17
|
+
content: [{ type: "text", text: `[ERROR] Path does not exist: ${args.path}` }]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const results = ["# Code Quality Analysis Report", "", `**Target:** ${args.path}`, `**Timestamp:** ${new Date().toISOString()}`, ""];
|
|
21
|
+
let hasErrors = false;
|
|
22
|
+
// 1. TypeScript Type Check
|
|
23
|
+
if (args.checkTypes !== false) {
|
|
24
|
+
try {
|
|
25
|
+
execSync("npx tsc --noEmit", {
|
|
26
|
+
cwd: projectRoot,
|
|
27
|
+
stdio: "pipe",
|
|
28
|
+
timeout: 30000,
|
|
29
|
+
encoding: "utf8"
|
|
30
|
+
});
|
|
31
|
+
results.push("## ✅ TypeScript Check: PASSED");
|
|
32
|
+
results.push("No type errors found.");
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
hasErrors = true;
|
|
36
|
+
const error = err;
|
|
37
|
+
const stderr = error.stderr || error.stdout || error.message || "Unknown error";
|
|
38
|
+
results.push("## ❌ TypeScript Check: FAILED");
|
|
39
|
+
results.push("```");
|
|
40
|
+
results.push(stderr.substring(0, 2000));
|
|
41
|
+
results.push("```");
|
|
42
|
+
}
|
|
43
|
+
results.push("");
|
|
44
|
+
}
|
|
45
|
+
// 2. Lint Check
|
|
46
|
+
if (args.checkLint !== false) {
|
|
47
|
+
try {
|
|
48
|
+
const lintOutput = execSync("npx eslint --format compact " + args.path, {
|
|
49
|
+
cwd: projectRoot,
|
|
50
|
+
stdio: "pipe",
|
|
51
|
+
timeout: 30000,
|
|
52
|
+
encoding: "utf8"
|
|
53
|
+
});
|
|
54
|
+
const lintStr = lintOutput.trim();
|
|
55
|
+
if (lintStr) {
|
|
56
|
+
results.push("## ⚠️ Lint Check: ISSUES FOUND");
|
|
57
|
+
results.push("```");
|
|
58
|
+
results.push(lintStr.substring(0, 2000));
|
|
59
|
+
results.push("```");
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
results.push("## ✅ Lint Check: PASSED");
|
|
63
|
+
results.push("No lint issues found.");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const error = err;
|
|
68
|
+
const stderr = error.stderr || error.stdout || error.message || "Unknown error";
|
|
69
|
+
// ESLint returns non-zero exit code when issues are found
|
|
70
|
+
if (stderr.includes("ESLint")) {
|
|
71
|
+
results.push("## ❌ Lint Check: FAILED");
|
|
72
|
+
results.push("```");
|
|
73
|
+
results.push(stderr.substring(0, 2000));
|
|
74
|
+
results.push("```");
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
results.push("## ✅ Lint Check: PASSED (no ESLint config)");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
results.push("");
|
|
81
|
+
}
|
|
82
|
+
// 3. Code Complexity Check (basic heuristic)
|
|
83
|
+
if (args.checkComplexity !== false) {
|
|
84
|
+
const complexityIssues = [];
|
|
85
|
+
function scanDirectory(dir) {
|
|
86
|
+
if (!fs.existsSync(dir))
|
|
87
|
+
return;
|
|
88
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
89
|
+
for (const entry of entries) {
|
|
90
|
+
const fullPath = path.join(dir, entry.name);
|
|
91
|
+
if (entry.isDirectory() && !entry.name.startsWith("node_modules") && !entry.name.startsWith(".")) {
|
|
92
|
+
scanDirectory(fullPath);
|
|
93
|
+
}
|
|
94
|
+
else if (entry.isFile() && (entry.name.endsWith(".ts") || entry.name.endsWith(".tsx"))) {
|
|
95
|
+
try {
|
|
96
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
97
|
+
const lines = content.split("\n");
|
|
98
|
+
// Check for long functions (>50 lines)
|
|
99
|
+
let inFunction = false;
|
|
100
|
+
let funcLines = 0;
|
|
101
|
+
let funcName = "";
|
|
102
|
+
const relativePath = path.relative(projectRoot, fullPath);
|
|
103
|
+
for (let i = 0; i < lines.length; i++) {
|
|
104
|
+
const line = lines[i];
|
|
105
|
+
// Detect function start
|
|
106
|
+
const funcMatch = line.match(/(?:public|private|protected|static\s+)?(?:async\s+)?(?:function\s+)?(\w+)\s*\([^)]*\)\s*{/);
|
|
107
|
+
if (funcMatch) {
|
|
108
|
+
inFunction = true;
|
|
109
|
+
funcLines = 1;
|
|
110
|
+
funcName = funcMatch[1];
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
// Detect method in class
|
|
114
|
+
const methodMatch = line.match(/^\s*(?:public|private|protected|static\s+)?(\w+)\s*\([^)]*\)\s*{/);
|
|
115
|
+
if (methodMatch && !line.includes("function")) {
|
|
116
|
+
inFunction = true;
|
|
117
|
+
funcLines = 1;
|
|
118
|
+
funcName = methodMatch[1];
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (inFunction) {
|
|
122
|
+
if (line.includes("}")) {
|
|
123
|
+
if (funcLines > 50) {
|
|
124
|
+
complexityIssues.push(`- ${relativePath}:${i + 1} — Function \`${funcName}\` is ${funcLines} lines long (max: 50)`);
|
|
125
|
+
}
|
|
126
|
+
inFunction = false;
|
|
127
|
+
}
|
|
128
|
+
funcLines++;
|
|
129
|
+
}
|
|
130
|
+
// Check nesting depth (>4 levels)
|
|
131
|
+
const indentMatch = line.match(/^(?:\s{2}){5,}/);
|
|
132
|
+
if (indentMatch && !line.trim().startsWith("//") && !line.trim().startsWith("*")) {
|
|
133
|
+
const depth = Math.floor(indentMatch[0].length / 2);
|
|
134
|
+
if (depth > 4) {
|
|
135
|
+
complexityIssues.push(`- ${relativePath}:${i + 1} — Nesting depth ${depth} (max: 4)`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// Skip files that can't be read
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
scanDirectory(targetPath);
|
|
147
|
+
if (complexityIssues.length > 0) {
|
|
148
|
+
hasErrors = true;
|
|
149
|
+
results.push(`## ⚠️ Code Complexity Issues (${complexityIssues.length})`);
|
|
150
|
+
results.push(...complexityIssues);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
results.push("## ✅ Code Complexity: OK");
|
|
154
|
+
results.push("No complexity issues found.");
|
|
155
|
+
}
|
|
156
|
+
results.push("");
|
|
157
|
+
}
|
|
158
|
+
// Summary
|
|
159
|
+
results.push("---");
|
|
160
|
+
results.push(`**Overall Status:** ${hasErrors ? "⚠️ Issues Found" : "✅ All Checks Passed"}`);
|
|
161
|
+
return {
|
|
162
|
+
content: [{ type: "text", text: results.join("\n") }],
|
|
163
|
+
isError: hasErrors
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
/**
|
|
4
|
+
* [TOOL] check_architecture_compliance
|
|
5
|
+
*
|
|
6
|
+
* Checks architectural compliance for code at the specified path:
|
|
7
|
+
* - Controller/Service/Repository layer separation
|
|
8
|
+
* - Import rules (controller → service → repository)
|
|
9
|
+
* - Circular dependencies
|
|
10
|
+
*/
|
|
11
|
+
export function handleCheckArchitectureCompliance(projectRoot, args) {
|
|
12
|
+
const targetPath = path.resolve(projectRoot, args.path);
|
|
13
|
+
if (!fs.existsSync(targetPath)) {
|
|
14
|
+
return {
|
|
15
|
+
isError: true,
|
|
16
|
+
content: [{ type: "text", text: `[ERROR] Path does not exist: ${args.path}` }]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const results = [
|
|
20
|
+
"# Architecture Compliance Report",
|
|
21
|
+
"",
|
|
22
|
+
`**Target:** ${args.path}`,
|
|
23
|
+
`**Timestamp:** ${new Date().toISOString()}`,
|
|
24
|
+
""
|
|
25
|
+
];
|
|
26
|
+
const violations = [];
|
|
27
|
+
const allFiles = [];
|
|
28
|
+
// Collect all relevant files
|
|
29
|
+
function collectFiles(dir) {
|
|
30
|
+
if (!fs.existsSync(dir))
|
|
31
|
+
return;
|
|
32
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
const fullPath = path.join(dir, entry.name);
|
|
35
|
+
if (entry.isDirectory() && !entry.name.startsWith("node_modules") && !entry.name.startsWith(".")) {
|
|
36
|
+
collectFiles(fullPath);
|
|
37
|
+
}
|
|
38
|
+
else if (entry.isFile() && (entry.name.endsWith(".ts") || entry.name.endsWith(".tsx"))) {
|
|
39
|
+
allFiles.push(fullPath);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
collectFiles(targetPath);
|
|
44
|
+
// Analyze each file for architectural violations
|
|
45
|
+
for (const file of allFiles) {
|
|
46
|
+
const relativePath = path.relative(projectRoot, file);
|
|
47
|
+
const content = fs.readFileSync(file, "utf8");
|
|
48
|
+
const lines = content.split("\n");
|
|
49
|
+
const fileName = path.basename(file, path.extname(file));
|
|
50
|
+
const fileDir = path.dirname(file);
|
|
51
|
+
// 1. Layer naming convention check
|
|
52
|
+
const isController = fileName.endsWith(".controller") || fileName.endsWith("Controller");
|
|
53
|
+
const isService = fileName.endsWith(".service") || fileName.endsWith("Service");
|
|
54
|
+
const isRepository = fileName.endsWith(".repository") || fileName.endsWith("Repository");
|
|
55
|
+
const isModel = fileName.endsWith(".model") || fileName.endsWith("Model");
|
|
56
|
+
// 2. Controller → Service → Repository dependency direction
|
|
57
|
+
for (const line of lines) {
|
|
58
|
+
const importMatch = line.match(/import\s+.*\s+from\s+['"](.+)['"]/);
|
|
59
|
+
if (!importMatch)
|
|
60
|
+
continue;
|
|
61
|
+
const importPath = importMatch[1];
|
|
62
|
+
const importedFileName = path.basename(importPath, path.extname(importPath));
|
|
63
|
+
// Controller importing Repository directly (should go through Service)
|
|
64
|
+
if (isController && (importedFileName.endsWith(".repository") || importedFileName.endsWith("Repository"))) {
|
|
65
|
+
violations.push(`- ${relativePath}: Controller \`${fileName}\` directly imports Repository \`${importedFileName}\`. ` +
|
|
66
|
+
"Use Service layer instead.");
|
|
67
|
+
}
|
|
68
|
+
// Repository importing Controller
|
|
69
|
+
if (isRepository && (importedFileName.endsWith(".controller") || importedFileName.endsWith("Controller"))) {
|
|
70
|
+
violations.push(`- ${relativePath}: Repository \`${fileName}\` imports Controller \`${importedFileName}\`. ` +
|
|
71
|
+
"Reverse dependency detected.");
|
|
72
|
+
}
|
|
73
|
+
// Service importing Controller
|
|
74
|
+
if (isService && (importedFileName.endsWith(".controller") || importedFileName.endsWith("Controller"))) {
|
|
75
|
+
violations.push(`- ${relativePath}: Service \`${fileName}\` imports Controller \`${importedFileName}\`. ` +
|
|
76
|
+
"Service should not depend on Controller.");
|
|
77
|
+
}
|
|
78
|
+
// Model importing Controller/Service/Repository
|
|
79
|
+
if (isModel && (importedFileName.endsWith("Controller") || importedFileName.endsWith("Service") || importedFileName.endsWith("Repository"))) {
|
|
80
|
+
violations.push(`- ${relativePath}: Model \`${fileName}\` imports \`${importedFileName}\`. ` +
|
|
81
|
+
"Models should not depend on other layers.");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// 3. Check for barrel index imports that might cause circular dependencies
|
|
85
|
+
if (fileName === "index" && fileDir.includes("modules")) {
|
|
86
|
+
const indexContent = fs.readFileSync(file, "utf8");
|
|
87
|
+
const exports = indexContent.match(/export\s+\*?\s*from\s+['"].+['"]/g) || [];
|
|
88
|
+
if (exports.length > 10) {
|
|
89
|
+
violations.push(`- ${relativePath}: Barrel file exports ${exports.length} modules. ` +
|
|
90
|
+
"Consider splitting into smaller barrels to prevent circular dependencies.");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// 4. Strict mode check
|
|
95
|
+
let hasStrictMode = false;
|
|
96
|
+
const tsConfigPath = path.join(projectRoot, "tsconfig.json");
|
|
97
|
+
if (fs.existsSync(tsConfigPath)) {
|
|
98
|
+
try {
|
|
99
|
+
const tsConfig = JSON.parse(fs.readFileSync(tsConfigPath, "utf8"));
|
|
100
|
+
if (tsConfig.compilerOptions?.strict) {
|
|
101
|
+
hasStrictMode = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Ignore parse errors
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!hasStrictMode) {
|
|
109
|
+
violations.push("- tsconfig.json: `strict` mode is not enabled. Atabey requires strict type checking.");
|
|
110
|
+
}
|
|
111
|
+
// Report
|
|
112
|
+
if (violations.length > 0) {
|
|
113
|
+
results.push(`## ❌ Architecture Violations (${violations.length})`);
|
|
114
|
+
results.push("");
|
|
115
|
+
results.push(...violations);
|
|
116
|
+
results.push("");
|
|
117
|
+
results.push("---");
|
|
118
|
+
results.push(`**Status:** ❌ FAILED — ${violations.length} architectural violations found.`);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
results.push("## ✅ Architecture Compliance: PASSED");
|
|
122
|
+
results.push("");
|
|
123
|
+
results.push("- All layer dependencies are correctly oriented.");
|
|
124
|
+
results.push("- No circular dependencies detected.");
|
|
125
|
+
results.push("- Strict mode is enabled.");
|
|
126
|
+
results.push("");
|
|
127
|
+
results.push("---");
|
|
128
|
+
results.push("**Status:** ✅ All architecture checks passed.");
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
content: [{ type: "text", text: results.join("\n") }],
|
|
132
|
+
isError: violations.length > 0
|
|
133
|
+
};
|
|
134
|
+
}
|