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,34 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { safePath } from "../../utils/security.js";
|
|
3
|
+
import { Metrics } from "../../utils/metrics.js";
|
|
4
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
5
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
6
|
+
export async function handlePatchFile(projectRoot, args) {
|
|
7
|
+
const filePath = safePath(projectRoot, args.path);
|
|
8
|
+
// ENFORCE PERMISSION MATRIX
|
|
9
|
+
verifyWritePermission(projectRoot, args.path);
|
|
10
|
+
const lines = fs.readFileSync(filePath, "utf8").split("\n");
|
|
11
|
+
const start = args.startLine - 1;
|
|
12
|
+
const end = args.endLine;
|
|
13
|
+
const newContent = args.newContent.split("\n");
|
|
14
|
+
if (start < 0 || start > lines.length) {
|
|
15
|
+
const err = `Invalid start line: ${start + 1}. File has ${lines.length} lines.`;
|
|
16
|
+
Metrics.logError(projectRoot, "@mcp", `patch_file:${args.path}`, err);
|
|
17
|
+
throw new Error(err);
|
|
18
|
+
}
|
|
19
|
+
if (end < start + 1 || end > lines.length) {
|
|
20
|
+
const err = `Invalid end line: ${end}. Must be between ${start + 1} and ${lines.length}.`;
|
|
21
|
+
Metrics.logError(projectRoot, "@mcp", `patch_file:${args.path}`, err);
|
|
22
|
+
throw new Error(err);
|
|
23
|
+
}
|
|
24
|
+
lines.splice(start, end - start, ...newContent);
|
|
25
|
+
const patchedContent = lines.join("\n");
|
|
26
|
+
// ENFORCE CORPORATE COMPLIANCE
|
|
27
|
+
verifyCorporateCompliance(patchedContent, args.path);
|
|
28
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
29
|
+
await verifyRiskAndAwaitApproval(projectRoot, patchedContent, args.path);
|
|
30
|
+
fs.writeFileSync(filePath, patchedContent);
|
|
31
|
+
const tokens = Metrics.estimateTokens(args.newContent);
|
|
32
|
+
Metrics.logUsage(projectRoot, "@mcp", `patch_file: ${args.path}`, tokens);
|
|
33
|
+
return { content: [{ type: "text", text: `[OK] File patched successfully: ${args.path}` }] };
|
|
34
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { safePath } from "../../utils/security.js";
|
|
3
|
+
import { Metrics } from "../../utils/metrics.js";
|
|
4
|
+
export function handleReadFile(projectRoot, args) {
|
|
5
|
+
if (!args.path) {
|
|
6
|
+
const err = "Missing 'path' argument.";
|
|
7
|
+
Metrics.logError(projectRoot, "@mcp", "read_file", err);
|
|
8
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
const filePath = safePath(projectRoot, args.path);
|
|
12
|
+
if (!fs.existsSync(filePath)) {
|
|
13
|
+
const err = `File not found: ${args.path}`;
|
|
14
|
+
Metrics.logError(projectRoot, "@mcp", "read_file", err);
|
|
15
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
16
|
+
}
|
|
17
|
+
const startLine = args.startLine;
|
|
18
|
+
const endLine = args.endLine;
|
|
19
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
20
|
+
const lines = content.split(/\r?\n/);
|
|
21
|
+
if (startLine !== undefined || endLine !== undefined) {
|
|
22
|
+
const start = startLine !== undefined ? Math.max(1, startLine) - 1 : 0;
|
|
23
|
+
const end = endLine !== undefined ? Math.min(lines.length, endLine) : lines.length;
|
|
24
|
+
const sliced = lines.slice(start, end).join("\n");
|
|
25
|
+
const tokens = Metrics.estimateTokens(sliced);
|
|
26
|
+
Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
|
|
27
|
+
return { content: [{ type: "text", text: sliced }] };
|
|
28
|
+
}
|
|
29
|
+
// ENFORCE TOKEN ECONOMY: Hard Limit for large files
|
|
30
|
+
const HARD_LIMIT_LINES = 300;
|
|
31
|
+
if (lines.length > HARD_LIMIT_LINES && (startLine === undefined || endLine === undefined)) {
|
|
32
|
+
const errMsg = `[TOKEN ECONOMY GUARD] File '${args.path}' is too large (${lines.length} lines). To prevent context overflow and token waste, you MUST provide both 'startLine' and 'endLine' parameters to read specific sections of this file.`;
|
|
33
|
+
Metrics.logError(projectRoot, "@mcp", `read_file: ${args.path} (blocked)`, errMsg);
|
|
34
|
+
return {
|
|
35
|
+
isError: true,
|
|
36
|
+
content: [{
|
|
37
|
+
type: "text",
|
|
38
|
+
text: `[ERROR] ${errMsg}`
|
|
39
|
+
}]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const tokens = Metrics.estimateTokens(content);
|
|
43
|
+
Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
|
|
44
|
+
return { content: [{ type: "text", text: content }] };
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
const err = `Failed to read file: ${String(e)}`;
|
|
48
|
+
Metrics.logError(projectRoot, "@mcp", `read_file:${args.path}`, err);
|
|
49
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { writeTextFile } from "../../utils/fs.js";
|
|
3
|
+
import { Metrics } from "../../utils/metrics.js";
|
|
4
|
+
import { safePath } from "../../utils/security.js";
|
|
5
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
6
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
7
|
+
export async function handleReplaceText(projectRoot, args) {
|
|
8
|
+
const filePath = safePath(projectRoot, args.path);
|
|
9
|
+
// ENFORCE PERMISSION MATRIX
|
|
10
|
+
verifyWritePermission(projectRoot, args.path);
|
|
11
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
12
|
+
const oldText = args.oldText;
|
|
13
|
+
const newText = args.newText;
|
|
14
|
+
const allowMultiple = args.allowMultiple || false; // Default to false
|
|
15
|
+
if (!content.includes(oldText)) {
|
|
16
|
+
const err = `Text not found in file: ${oldText.slice(0, 100)}...`;
|
|
17
|
+
Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
|
|
18
|
+
throw new Error(err);
|
|
19
|
+
}
|
|
20
|
+
// Surgical precision guard: reject ambiguous replacements unless allowMultiple is true.
|
|
21
|
+
if (!allowMultiple) {
|
|
22
|
+
const firstIndex = content.indexOf(oldText);
|
|
23
|
+
const lastIndex = content.lastIndexOf(oldText);
|
|
24
|
+
if (firstIndex !== lastIndex) {
|
|
25
|
+
const count = (content.match(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length;
|
|
26
|
+
const err = `Ambiguous replacement: "${oldText.slice(0, 80)}..." found ${count} times in ${args.path}. ` +
|
|
27
|
+
"Provide a longer, unique context string or set 'allow_multiple' to true.";
|
|
28
|
+
Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
|
|
29
|
+
throw new Error(err);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Perform replacement(s).
|
|
33
|
+
// Use a function replacer so special patterns ($&, $1, $$) inside newText
|
|
34
|
+
// are treated literally and never reinterpreted as regex backreferences.
|
|
35
|
+
let newContent;
|
|
36
|
+
if (allowMultiple) {
|
|
37
|
+
newContent = content.replace(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), () => newText);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
newContent = content.replace(oldText, () => newText);
|
|
41
|
+
}
|
|
42
|
+
// ENFORCE CORPORATE COMPLIANCE
|
|
43
|
+
verifyCorporateCompliance(newContent, args.path);
|
|
44
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
45
|
+
await verifyRiskAndAwaitApproval(projectRoot, newContent, args.path);
|
|
46
|
+
writeTextFile(filePath, newContent);
|
|
47
|
+
const tokens = Metrics.estimateTokens(newText);
|
|
48
|
+
Metrics.logUsage(projectRoot, "@mcp", `replace_text: ${args.path}`, tokens);
|
|
49
|
+
return { content: [{ type: "text", text: `[OK] Surgical edit successful in ${args.path}` }] };
|
|
50
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { appendFile, writeTextFile } from "../../utils/fs.js";
|
|
4
|
+
import { Metrics } from "../../utils/metrics.js";
|
|
5
|
+
import { resolveFrameworkDir, safePath } from "../../utils/security.js";
|
|
6
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
7
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
8
|
+
export async function handleWriteFile(projectRoot, args) {
|
|
9
|
+
if (!args.path || args.content === undefined) {
|
|
10
|
+
const err = "Missing 'path' or 'content' argument.";
|
|
11
|
+
Metrics.logError(projectRoot, "@mcp", "write_file", err);
|
|
12
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const filePath = safePath(projectRoot, args.path);
|
|
16
|
+
// ENFORCE TOKEN ECONOMY: Prevent full-file rewrites of existing files
|
|
17
|
+
if (fs.existsSync(filePath)) {
|
|
18
|
+
const errMsg = `[TOKEN ECONOMY GUARD] The file '${args.path}' already exists. Overwriting entire existing files is FORBIDDEN to save tokens and prevent context drift. You MUST use 'patch_file' or 'replace_text' tools to make surgical edits.`;
|
|
19
|
+
Metrics.logError(projectRoot, "@mcp", `write_file: ${args.path} (blocked)`, errMsg);
|
|
20
|
+
return {
|
|
21
|
+
isError: true,
|
|
22
|
+
content: [{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: `[ERROR] ${errMsg}`
|
|
25
|
+
}]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const content = args.content;
|
|
29
|
+
// ENFORCE PERMISSION MATRIX
|
|
30
|
+
verifyWritePermission(projectRoot, args.path);
|
|
31
|
+
// ENFORCE CORPORATE COMPLIANCE
|
|
32
|
+
verifyCorporateCompliance(content, args.path);
|
|
33
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
34
|
+
await verifyRiskAndAwaitApproval(projectRoot, content, args.path);
|
|
35
|
+
writeTextFile(filePath, content);
|
|
36
|
+
// AUTO-LOGGING & METRICS
|
|
37
|
+
const tokens = Metrics.estimateTokens(content);
|
|
38
|
+
Metrics.logUsage(projectRoot, "@mcp", `write_file: ${args.path}`, tokens);
|
|
39
|
+
try {
|
|
40
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
41
|
+
const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
|
|
42
|
+
if (fs.existsSync(memoryPath)) {
|
|
43
|
+
const entry = `\n### ${new Date().toISOString().split("T")[0]} — Auto-Update\n- **Action:** wrote file \`${args.path}\` (${tokens} tokens estimated).\n`;
|
|
44
|
+
appendFile(memoryPath, entry);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch { /* ignore memory logging errors */ }
|
|
48
|
+
return { content: [{ type: "text", text: `[OK] File written: ${args.path}` }] };
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
const err = `Failed to write file: ${String(e)}`;
|
|
52
|
+
Metrics.logError(projectRoot, "@mcp", `write_file:${args.path}`, err);
|
|
53
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
/**
|
|
4
|
+
* Audits package.json for unused or duplicate-like packages.
|
|
5
|
+
* Focuses on project health and cleanup.
|
|
6
|
+
*/
|
|
7
|
+
export function handleAuditDependencies(projectRoot, _args) {
|
|
8
|
+
const pkgPath = path.join(projectRoot, "package.json");
|
|
9
|
+
if (!fs.existsSync(pkgPath)) {
|
|
10
|
+
throw new Error("package.json not found.");
|
|
11
|
+
}
|
|
12
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
13
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
14
|
+
const depNames = Object.keys(deps);
|
|
15
|
+
const results = [];
|
|
16
|
+
// 1. Look for similar packages (potential duplicates)
|
|
17
|
+
const similarityGroups = {
|
|
18
|
+
"CSS/Styling": ["tailwind", "panda", "styled-components", "emotion", "sass"],
|
|
19
|
+
"Testing": ["vitest", "jest", "mocha", "jasmine"],
|
|
20
|
+
"Fetching": ["axios", "ky", "fetch"]
|
|
21
|
+
};
|
|
22
|
+
for (const [group, patterns] of Object.entries(similarityGroups)) {
|
|
23
|
+
const found = depNames.filter(d => patterns.some(p => d.includes(p)));
|
|
24
|
+
if (found.length > 1) {
|
|
25
|
+
results.push(`[WARN] Potential redundancy in [${group}]: Found ${found.join(", ")}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// 2. Scan for "any" usage in package names (bad practice markers)
|
|
29
|
+
const legacyDeps = depNames.filter(d => d.includes("legacy") || d.includes("compat"));
|
|
30
|
+
if (legacyDeps.length > 0) {
|
|
31
|
+
results.push(`[INFO] Legacy compatibility packages detected: ${legacyDeps.join(", ")}`);
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
content: [{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: results.length > 0
|
|
37
|
+
? `Dependency Audit Results:\n\n${results.join("\n")}`
|
|
38
|
+
: "[OK] Dependencies look clean and consolidated."
|
|
39
|
+
}]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { getBackendLanguage, getDefaultTestCommand } from "../../utils/cli.js";
|
|
3
|
+
/**
|
|
4
|
+
* Executes project tests and returns results for agent analysis.
|
|
5
|
+
*/
|
|
6
|
+
export function handleRunTests(projectRoot, args) {
|
|
7
|
+
const language = getBackendLanguage(projectRoot);
|
|
8
|
+
const testCommand = args.command || getDefaultTestCommand(language);
|
|
9
|
+
try {
|
|
10
|
+
const output = execSync(testCommand, { cwd: projectRoot, encoding: "utf8", stdio: "pipe" });
|
|
11
|
+
return {
|
|
12
|
+
content: [{ type: "text", text: `[OK] Tests passed successfully for ${language}!\n\n${output}` }]
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
const err = error;
|
|
17
|
+
const stderr = err.stderr?.toString() || "";
|
|
18
|
+
const stdout = err.stdout?.toString() || "";
|
|
19
|
+
return {
|
|
20
|
+
isError: true,
|
|
21
|
+
content: [{
|
|
22
|
+
type: "text",
|
|
23
|
+
text: `[ERROR] Tests FAILED for ${language}!\n\n--- STDOUT ---\n${stdout}\n\n--- STDERR ---\n${stderr}`
|
|
24
|
+
}]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { safeExec } from "../../utils/cli.js";
|
|
2
|
+
export function handleUpdateProjectMemory(projectRoot, args) {
|
|
3
|
+
const section = args.section;
|
|
4
|
+
const content = args.content;
|
|
5
|
+
// Using execFileSync with array args prevents command injection
|
|
6
|
+
safeExec("npx", ["atabey", "update_project_memory", section, content], projectRoot);
|
|
7
|
+
return { content: [{ type: "text", text: `[OK] Section ${section} updated.` }] };
|
|
8
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ATABEY MCP Tool — LLM Gateway Query
|
|
3
|
+
*
|
|
4
|
+
* Sends a chat completion request through the ATABEY LLM Gateway.
|
|
5
|
+
* The gateway automatically selects the best provider based on the
|
|
6
|
+
* configured load balancing strategy (failover, round-robin, cost-optimized, etc.)
|
|
7
|
+
*
|
|
8
|
+
* This tool allows ANY MCP-connected AI (Gemini CLI, Claude CLI, Cursor, Grok, etc.)
|
|
9
|
+
* to route LLM requests through the gateway to any supported provider.
|
|
10
|
+
*
|
|
11
|
+
* The gateway module is loaded dynamically from the project root at runtime,
|
|
12
|
+
* not at compile time (since it lives outside the MCP workspace).
|
|
13
|
+
*/
|
|
14
|
+
import path from "path";
|
|
15
|
+
/**
|
|
16
|
+
* Dynamically load the LLM Gateway from the project root.
|
|
17
|
+
* Falls back gracefully if the gateway module is not available.
|
|
18
|
+
*/
|
|
19
|
+
async function loadGateway(projectRoot) {
|
|
20
|
+
try {
|
|
21
|
+
const gatewayPath = path.join(projectRoot, "dist/src/modules/gateway/index.js");
|
|
22
|
+
const mod = await import(gatewayPath);
|
|
23
|
+
return mod.gateway;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
try {
|
|
27
|
+
// Fallback: try tsx resolution for development
|
|
28
|
+
const gatewayPath = path.join(projectRoot, "src/modules/gateway/index.ts");
|
|
29
|
+
const mod = await import(gatewayPath);
|
|
30
|
+
return mod.gateway;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handle llm_gateway_query tool call.
|
|
39
|
+
* Routes the request through the LLM Gateway with load balancing.
|
|
40
|
+
*/
|
|
41
|
+
export async function handleLLMGatewayQuery(projectRoot, args) {
|
|
42
|
+
const startTime = Date.now();
|
|
43
|
+
try {
|
|
44
|
+
// Load gateway dynamically
|
|
45
|
+
const gateway = await loadGateway(projectRoot);
|
|
46
|
+
if (!gateway) {
|
|
47
|
+
return {
|
|
48
|
+
isError: true,
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: "text",
|
|
52
|
+
text: JSON.stringify({
|
|
53
|
+
success: false,
|
|
54
|
+
error: "LLM Gateway is not initialized. The project may need to be built first. " +
|
|
55
|
+
"Run: npm run build:core",
|
|
56
|
+
solution: "Gateway module not found at dist/src/modules/gateway/index.js. " +
|
|
57
|
+
"Ensure the main package is built and ATABEY_PROJECT_ROOT is set correctly.",
|
|
58
|
+
}, null, 2),
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// Build gateway request
|
|
64
|
+
const gatewayRequest = {
|
|
65
|
+
messages: args.messages.map(m => ({
|
|
66
|
+
role: m.role,
|
|
67
|
+
content: m.content,
|
|
68
|
+
})),
|
|
69
|
+
system: args.system,
|
|
70
|
+
model: args.model,
|
|
71
|
+
temperature: args.temperature ?? 0.7,
|
|
72
|
+
maxTokens: args.maxTokens ?? 4096,
|
|
73
|
+
traceId: args.traceId || `MCP-${Date.now()}-${Math.random().toString(36).substring(2, 8)}`,
|
|
74
|
+
};
|
|
75
|
+
// Provider override
|
|
76
|
+
if (args.provider) {
|
|
77
|
+
gatewayRequest.provider = args.provider;
|
|
78
|
+
}
|
|
79
|
+
// Strategy override
|
|
80
|
+
if (args.strategy) {
|
|
81
|
+
gatewayRequest.strategy = args.strategy;
|
|
82
|
+
}
|
|
83
|
+
// Send through gateway
|
|
84
|
+
const response = await gateway.chat(gatewayRequest);
|
|
85
|
+
const elapsed = Date.now() - startTime;
|
|
86
|
+
if (response.success) {
|
|
87
|
+
return {
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: JSON.stringify({
|
|
92
|
+
success: true,
|
|
93
|
+
content: response.content,
|
|
94
|
+
provider: response.provider,
|
|
95
|
+
model: response.model,
|
|
96
|
+
usage: response.usage,
|
|
97
|
+
latencyMs: response.latencyMs,
|
|
98
|
+
cost: response.cost,
|
|
99
|
+
traceId: response.traceId,
|
|
100
|
+
elapsed,
|
|
101
|
+
}, null, 2),
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
isError: true,
|
|
108
|
+
content: [
|
|
109
|
+
{
|
|
110
|
+
type: "text",
|
|
111
|
+
text: JSON.stringify({
|
|
112
|
+
success: false,
|
|
113
|
+
error: response.content,
|
|
114
|
+
provider: response.provider,
|
|
115
|
+
traceId: response.traceId,
|
|
116
|
+
elapsed,
|
|
117
|
+
}, null, 2),
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
return {
|
|
124
|
+
isError: true,
|
|
125
|
+
content: [
|
|
126
|
+
{
|
|
127
|
+
type: "text",
|
|
128
|
+
text: JSON.stringify({
|
|
129
|
+
success: false,
|
|
130
|
+
error: `Gateway query failed: ${error.message}`,
|
|
131
|
+
elapsed: Date.now() - startTime,
|
|
132
|
+
}, null, 2),
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ATABEY MCP Tool — LLM Gateway Status
|
|
3
|
+
*
|
|
4
|
+
* Returns the current status of the LLM Gateway, including provider health,
|
|
5
|
+
* current load balancing strategy, usage statistics, and budget info.
|
|
6
|
+
*
|
|
7
|
+
* Useful for monitoring and debugging gateway behavior without CLI access.
|
|
8
|
+
*/
|
|
9
|
+
import path from "path";
|
|
10
|
+
/**
|
|
11
|
+
* Dynamically load the LLM Gateway from the project root.
|
|
12
|
+
*/
|
|
13
|
+
async function loadGateway(projectRoot) {
|
|
14
|
+
try {
|
|
15
|
+
const gatewayPath = path.join(projectRoot, "dist/src/modules/gateway/index.js");
|
|
16
|
+
const mod = await import(gatewayPath);
|
|
17
|
+
return mod.gateway;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
try {
|
|
21
|
+
const gatewayPath = path.join(projectRoot, "src/modules/gateway/index.ts");
|
|
22
|
+
const mod = await import(gatewayPath);
|
|
23
|
+
return mod.gateway;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Handle llm_gateway_status tool call.
|
|
32
|
+
*/
|
|
33
|
+
export async function handleLLMGatewayStatus(projectRoot, args) {
|
|
34
|
+
const detail = args.detail || "overview";
|
|
35
|
+
try {
|
|
36
|
+
const gateway = await loadGateway(projectRoot);
|
|
37
|
+
if (!gateway) {
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
text: JSON.stringify({
|
|
43
|
+
status: "unavailable",
|
|
44
|
+
message: "LLM Gateway is not initialized. " +
|
|
45
|
+
"Build the project first with: npm run build:core",
|
|
46
|
+
}, null, 2),
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const result = {
|
|
52
|
+
status: "active",
|
|
53
|
+
strategy: gateway.loadBalancer.getStrategy(),
|
|
54
|
+
};
|
|
55
|
+
if (detail === "providers" || detail === "overview") {
|
|
56
|
+
result.providers = gateway.getProviderHealth();
|
|
57
|
+
}
|
|
58
|
+
if (detail === "stats" || detail === "overview") {
|
|
59
|
+
result.stats = gateway.getStats();
|
|
60
|
+
}
|
|
61
|
+
if (detail === "overview" || detail === "stats") {
|
|
62
|
+
const budget = gateway.costTracker.getBudgetStatus();
|
|
63
|
+
if (budget) {
|
|
64
|
+
result.budget = budget;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: JSON.stringify(result, null, 2),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
return {
|
|
78
|
+
isError: true,
|
|
79
|
+
content: [
|
|
80
|
+
{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: JSON.stringify({
|
|
83
|
+
status: "error",
|
|
84
|
+
error: `Failed to get gateway status: ${error.message}`,
|
|
85
|
+
}, null, 2),
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { handleAcquireLock, handleReleaseLock } from "./control_plane/locking.js";
|
|
2
|
+
import { handleRegisterAgent } from "./control_plane/registry.js";
|
|
3
|
+
import { TOOLS } from "./definitions.js";
|
|
4
|
+
import { handleBatchSurgicalEdit } from "./file_system/batch_surgical_edit.js";
|
|
5
|
+
import { handlePatchFile } from "./file_system/patch_file.js";
|
|
6
|
+
import { handleReadFile } from "./file_system/read_file.js";
|
|
7
|
+
import { handleReplaceText } from "./file_system/replace_text.js";
|
|
8
|
+
import { handleWriteFile } from "./file_system/write_file.js";
|
|
9
|
+
import { handleAuditDependencies } from "./framework/audit_deps.js";
|
|
10
|
+
import { handleGetFrameworkStatus } from "./framework/get_status.js";
|
|
11
|
+
import { handleOrchestrateLoop } from "./framework/orchestrate.js";
|
|
12
|
+
import { handleRunTests } from "./framework/run_tests.js";
|
|
13
|
+
import { handleSubmitPlan } from "./framework/submit_plan.js";
|
|
14
|
+
import { handleUpdateContractHash } from "./framework/update_contract_hash.js";
|
|
15
|
+
import { handleUpdateProjectMemory } from "./framework/update_memory.js";
|
|
16
|
+
import { handleLLMGatewayQuery } from "./gateway/llm_gateway_query.js";
|
|
17
|
+
import { handleLLMGatewayStatus } from "./gateway/llm_gateway_status.js";
|
|
18
|
+
import { handleDeleteKnowledge } from "./memory/delete_knowledge.js";
|
|
19
|
+
import { handleGetMemoryInsights } from "./memory/get_insights.js";
|
|
20
|
+
import { handleReadProjectMemory } from "./memory/read_memory.js";
|
|
21
|
+
import { handleSearchKnowledge } from "./memory/search_knowledge.js";
|
|
22
|
+
import { handleStoreKnowledge } from "./memory/store_knowledge.js";
|
|
23
|
+
import { handleAskHuman } from "./messaging/ask_human.js";
|
|
24
|
+
import { handleLogAgentAction } from "./messaging/log_action.js";
|
|
25
|
+
import { handleSendAgentMessage } from "./messaging/send_message.js";
|
|
26
|
+
import { handleCheckPorts } from "./observability/check_ports.js";
|
|
27
|
+
import { handleGetSystemHealth } from "./observability/get_health.js";
|
|
28
|
+
import { handleAnalyzeCodeQuality } from "./quality/analyze_code_quality.js";
|
|
29
|
+
import { handleCheckArchitectureCompliance } from "./quality/check_architecture_compliance.js";
|
|
30
|
+
import { handleCheckLint } from "./quality/check_lint.js";
|
|
31
|
+
import * as schemas from "./schemas.js";
|
|
32
|
+
import { handleGetProjectGaps } from "./search/get_gaps.js";
|
|
33
|
+
import { handleGetProjectMap } from "./search/get_map.js";
|
|
34
|
+
import { handleGrepSearch } from "./search/grep_search.js";
|
|
35
|
+
import { handleListDir } from "./search/list_dir.js";
|
|
36
|
+
import { handleRunCommand } from "./shell/run_command.js";
|
|
37
|
+
// Map of tool names to their handler functions
|
|
38
|
+
const bind = (fn) => {
|
|
39
|
+
return (root, args) => fn(root, args);
|
|
40
|
+
};
|
|
41
|
+
export const toolHandlers = {
|
|
42
|
+
read_file: bind(handleReadFile),
|
|
43
|
+
view_file: bind(handleReadFile), // Alias
|
|
44
|
+
list_dir: bind(handleListDir),
|
|
45
|
+
grep_search: bind(handleGrepSearch),
|
|
46
|
+
get_project_map: bind(handleGetProjectMap),
|
|
47
|
+
get_project_gaps: bind(handleGetProjectGaps),
|
|
48
|
+
write_file: bind(handleWriteFile),
|
|
49
|
+
replace_text: bind(handleReplaceText),
|
|
50
|
+
batch_surgical_edit: bind(handleBatchSurgicalEdit),
|
|
51
|
+
patch_file: bind(handlePatchFile),
|
|
52
|
+
get_framework_status: bind(handleGetFrameworkStatus),
|
|
53
|
+
read_project_memory: bind(handleReadProjectMemory),
|
|
54
|
+
get_memory_insights: bind(handleGetMemoryInsights),
|
|
55
|
+
store_knowledge: bind(handleStoreKnowledge),
|
|
56
|
+
search_knowledge: bind(handleSearchKnowledge),
|
|
57
|
+
delete_knowledge: bind(handleDeleteKnowledge),
|
|
58
|
+
update_project_memory: bind(handleUpdateProjectMemory),
|
|
59
|
+
audit_dependencies: bind(handleAuditDependencies),
|
|
60
|
+
run_tests: bind(handleRunTests),
|
|
61
|
+
get_system_health: bind(handleGetSystemHealth),
|
|
62
|
+
check_active_ports: bind(handleCheckPorts),
|
|
63
|
+
orchestrate_loop: bind(handleOrchestrateLoop),
|
|
64
|
+
submit_plan: bind(handleSubmitPlan),
|
|
65
|
+
send_agent_message: bind(handleSendAgentMessage),
|
|
66
|
+
log_agent_action: bind(handleLogAgentAction),
|
|
67
|
+
ask_human: bind(handleAskHuman),
|
|
68
|
+
update_contract_hash: bind(handleUpdateContractHash),
|
|
69
|
+
acquire_lock: bind(handleAcquireLock),
|
|
70
|
+
release_lock: bind(handleReleaseLock),
|
|
71
|
+
register_agent: bind(handleRegisterAgent),
|
|
72
|
+
run_shell_command: bind(handleRunCommand),
|
|
73
|
+
check_lint: bind(handleCheckLint),
|
|
74
|
+
analyze_code_quality: bind(handleAnalyzeCodeQuality),
|
|
75
|
+
check_architecture_compliance: bind(handleCheckArchitectureCompliance),
|
|
76
|
+
// LLM Gateway
|
|
77
|
+
llm_gateway_query: bind(handleLLMGatewayQuery),
|
|
78
|
+
llm_gateway_status: bind(handleLLMGatewayStatus),
|
|
79
|
+
};
|
|
80
|
+
// Map of tool names to their Zod validation schemas
|
|
81
|
+
export const toolSchemas = {
|
|
82
|
+
// File System
|
|
83
|
+
read_file: schemas.ReadFileSchema,
|
|
84
|
+
view_file: schemas.ReadFileSchema,
|
|
85
|
+
write_file: schemas.WriteFileSchema,
|
|
86
|
+
replace_text: schemas.ReplaceTextSchema,
|
|
87
|
+
batch_surgical_edit: schemas.BatchSurgicalEditSchema,
|
|
88
|
+
patch_file: schemas.PatchFileSchema,
|
|
89
|
+
// Search & Exploration
|
|
90
|
+
list_dir: schemas.ListDirSchema,
|
|
91
|
+
grep_search: schemas.GrepSearchSchema,
|
|
92
|
+
get_project_map: schemas.GetProjectMapSchema,
|
|
93
|
+
get_project_gaps: schemas.GetProjectGapsSchema,
|
|
94
|
+
// Framework & System
|
|
95
|
+
run_shell_command: schemas.RunShellCommandSchema,
|
|
96
|
+
run_tests: schemas.RunTestsSchema,
|
|
97
|
+
get_system_health: schemas.GetSystemHealthSchema,
|
|
98
|
+
check_active_ports: schemas.CheckPortsSchema,
|
|
99
|
+
get_framework_status: schemas.GetFrameworkStatusSchema,
|
|
100
|
+
read_project_memory: schemas.ReadProjectMemorySchema,
|
|
101
|
+
get_memory_insights: schemas.GetMemoryInsightsSchema,
|
|
102
|
+
store_knowledge: schemas.StoreKnowledgeSchema,
|
|
103
|
+
search_knowledge: schemas.SearchKnowledgeSchema,
|
|
104
|
+
delete_knowledge: schemas.DeleteKnowledgeSchema,
|
|
105
|
+
update_project_memory: schemas.UpdateProjectMemorySchema,
|
|
106
|
+
orchestrate_loop: schemas.OrchestrateLoopSchema,
|
|
107
|
+
submit_plan: schemas.SubmitPlanSchema,
|
|
108
|
+
update_contract_hash: schemas.UpdateContractHashSchema,
|
|
109
|
+
audit_dependencies: schemas.AuditDependenciesSchema,
|
|
110
|
+
check_lint: schemas.CheckLintSchema,
|
|
111
|
+
// Control Plane
|
|
112
|
+
acquire_lock: schemas.AcquireLockSchema,
|
|
113
|
+
release_lock: schemas.ReleaseLockSchema,
|
|
114
|
+
register_agent: schemas.RegisterAgentSchema,
|
|
115
|
+
// Messaging (Hermes)
|
|
116
|
+
send_agent_message: schemas.SendAgentMessageSchema,
|
|
117
|
+
log_agent_action: schemas.LogAgentActionSchema,
|
|
118
|
+
ask_human: schemas.AskHumanSchema,
|
|
119
|
+
// Code Quality
|
|
120
|
+
analyze_code_quality: schemas.AnalyzeCodeQualitySchema,
|
|
121
|
+
check_architecture_compliance: schemas.CheckArchitectureComplianceSchema,
|
|
122
|
+
// LLM Gateway
|
|
123
|
+
llm_gateway_query: schemas.LLMGatewayQuerySchema,
|
|
124
|
+
llm_gateway_status: schemas.LLMGatewayStatusSchema,
|
|
125
|
+
};
|
|
126
|
+
export { TOOLS };
|