atabey 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATABEY.md +4 -4
- package/README.md +35 -33
- package/bin/cli.js +2 -2
- package/bin/validate-agent-army.js +6 -6
- package/dist/framework-mcp/src/constants.js +1 -1
- package/dist/framework-mcp/src/constants.js.map +1 -1
- package/dist/framework-mcp/src/index.js +29 -5
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/resources/index.d.ts +10 -0
- package/dist/framework-mcp/src/resources/index.js +59 -0
- package/dist/framework-mcp/src/resources/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/control_plane/locking.js +3 -3
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.js +3 -2
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +33 -1
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.js +3 -3
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -5
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/audit_deps.js +2 -2
- package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.js +2 -2
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +10 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js +14 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.js +2 -0
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js +5 -5
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/check_lint.js +2 -2
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.js +3 -3
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/types.d.ts +1 -0
- package/dist/framework-mcp/src/utils/compliance.d.ts +6 -0
- package/dist/framework-mcp/src/utils/compliance.js +158 -5
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/framework-mcp/src/utils/permissions.d.ts +12 -0
- package/dist/framework-mcp/src/utils/permissions.js +72 -0
- package/dist/framework-mcp/src/utils/permissions.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js +84 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +31 -31
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js +92 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +5 -5
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/src/cli/adapters/core.js +13 -20
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.js +2 -2
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +5 -3
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/compliance.js +2 -2
- package/dist/src/cli/commands/compliance.js.map +1 -1
- package/dist/src/cli/commands/contract.js +2 -2
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/dashboard.d.ts +5 -0
- package/dist/src/cli/commands/dashboard.js +124 -0
- package/dist/src/cli/commands/dashboard.js.map +1 -0
- package/dist/src/cli/commands/explorer.js +3 -3
- package/dist/src/cli/commands/explorer.js.map +1 -1
- package/dist/src/cli/commands/git.js +3 -3
- package/dist/src/cli/commands/git.js.map +1 -1
- package/dist/src/cli/commands/init/create-agent.d.ts +4 -0
- package/dist/src/cli/commands/init/create-agent.js +59 -0
- package/dist/src/cli/commands/init/create-agent.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-core.js +11 -7
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-docs.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-docs.js +4 -6
- package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-ops.js +4 -4
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +10 -8
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +26 -10
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/knowledge.js +3 -3
- package/dist/src/cli/commands/knowledge.js.map +1 -1
- package/dist/src/cli/commands/lint.js +2 -2
- package/dist/src/cli/commands/lint.js.map +1 -1
- package/dist/src/cli/commands/log.js +6 -28
- package/dist/src/cli/commands/log.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +10 -17
- package/dist/src/cli/commands/orchestrate.js +92 -341
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +5 -0
- package/dist/src/cli/commands/plan.js +80 -59
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/commands/script.js +3 -3
- package/dist/src/cli/commands/script.js.map +1 -1
- package/dist/src/cli/commands/security.js +2 -2
- package/dist/src/cli/commands/security.js.map +1 -1
- package/dist/src/cli/commands/status.js +65 -8
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/commands/trace.d.ts +4 -0
- package/dist/src/cli/commands/trace.js +83 -2
- package/dist/src/cli/commands/trace.js.map +1 -1
- package/dist/src/cli/index.js +68 -18
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.js +14 -14
- package/dist/src/cli/utils/claude.js +1 -1
- package/dist/src/cli/utils/claude.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +7 -1
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/i18n.d.ts +1 -0
- package/dist/src/cli/utils/i18n.js +2 -0
- package/dist/src/cli/utils/i18n.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +12 -3
- package/dist/src/cli/utils/memory.js +39 -31
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.js +2 -2
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/cli/utils/schemas.d.ts +8 -8
- package/dist/src/cli/utils/ui.js +4 -4
- package/dist/src/cli/utils/ui.js.map +1 -1
- package/dist/src/contracts/tasks.d.ts +2 -2
- package/dist/src/dashboard/vite.config.d.ts +2 -0
- package/dist/src/dashboard/vite.config.js +16 -0
- package/dist/src/dashboard/vite.config.js.map +1 -0
- package/dist/src/modules/adapters/definitions.js +10 -10
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/adapters/shared.js +4 -4
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +19 -0
- package/dist/src/modules/agents/definitions.js +74 -21
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +8 -0
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +7 -0
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +6 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/frontend.js +8 -0
- package/dist/src/modules/agents/registry/frontend.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +6 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/modules/agents/types.d.ts +2 -0
- package/dist/src/modules/engines/evaluation-engine.d.ts +11 -0
- package/dist/src/modules/engines/evaluation-engine.js +103 -0
- package/dist/src/modules/engines/evaluation-engine.js.map +1 -0
- package/dist/src/modules/engines/health-engine.d.ts +16 -0
- package/dist/src/modules/engines/health-engine.js +50 -0
- package/dist/src/modules/engines/health-engine.js.map +1 -0
- package/dist/src/modules/engines/planning-engine.d.ts +25 -0
- package/dist/src/modules/engines/planning-engine.js +79 -0
- package/dist/src/modules/engines/planning-engine.js.map +1 -0
- package/dist/src/modules/engines/risk-engine.d.ts +18 -0
- package/dist/src/modules/engines/risk-engine.js +106 -0
- package/dist/src/modules/engines/risk-engine.js.map +1 -0
- package/dist/src/modules/engines/routing-engine.d.ts +11 -0
- package/dist/src/modules/engines/routing-engine.js +74 -0
- package/dist/src/modules/engines/routing-engine.js.map +1 -0
- package/dist/src/modules/engines/types.d.ts +47 -0
- package/dist/src/modules/engines/types.js +2 -0
- package/dist/src/modules/engines/types.js.map +1 -0
- package/dist/src/shared/constants.d.ts +6 -2
- package/dist/src/shared/constants.js +5 -1
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/src/shared/fs.d.ts +1 -0
- package/dist/src/shared/fs.js +4 -0
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/src/shared/storage.d.ts +60 -0
- package/dist/src/shared/storage.js +208 -0
- package/dist/src/shared/storage.js.map +1 -0
- package/dist/tests/adapter.test.js +3 -2
- package/dist/tests/adapter.test.js.map +1 -1
- package/dist/tests/agent-memory-v2.test.d.ts +1 -0
- package/dist/tests/agent-memory-v2.test.js +68 -0
- package/dist/tests/agent-memory-v2.test.js.map +1 -0
- package/dist/tests/agents-definitions.test.js +42 -0
- package/dist/tests/agents-definitions.test.js.map +1 -1
- package/dist/tests/integration/hermes_locking.test.js +7 -10
- package/dist/tests/integration/hermes_locking.test.js.map +1 -1
- package/dist/tests/orchestrate.test.js +5 -1
- package/dist/tests/orchestrate.test.js.map +1 -1
- package/dist/tests/orchestrator-dependencies.test.d.ts +1 -0
- package/dist/tests/orchestrator-dependencies.test.js +52 -0
- package/dist/tests/orchestrator-dependencies.test.js.map +1 -0
- package/dist/tests/plan.test.d.ts +1 -0
- package/dist/tests/plan.test.js +63 -0
- package/dist/tests/plan.test.js.map +1 -0
- package/dist/tests/planning-engine.test.d.ts +1 -0
- package/dist/tests/planning-engine.test.js +50 -0
- package/dist/tests/planning-engine.test.js.map +1 -0
- package/dist/tests/status-cost.test.d.ts +1 -0
- package/dist/tests/status-cost.test.js +54 -0
- package/dist/tests/status-cost.test.js.map +1 -0
- package/dist/tests/status.test.js +8 -7
- package/dist/tests/status.test.js.map +1 -1
- package/dist/tests/trace-replay.test.d.ts +1 -0
- package/dist/tests/trace-replay.test.js +65 -0
- package/dist/tests/trace-replay.test.js.map +1 -0
- package/dist/tests/trace.test.js +14 -7
- package/dist/tests/trace.test.js.map +1 -1
- package/dist/ui/assets/index-Bkt7APzu.css +1 -0
- package/dist/ui/assets/index-CeX-06mI.js +49 -0
- package/dist/ui/index.html +14 -0
- package/framework-mcp/dist/constants.js +1 -1
- package/framework-mcp/{src/constants.ts → dist/framework-mcp/src/constants.js} +4 -18
- package/framework-mcp/{src/index.ts → dist/framework-mcp/src/index.js} +52 -53
- package/framework-mcp/dist/framework-mcp/src/resources/index.js +58 -0
- package/framework-mcp/{src/tools/control_plane/locking.ts → dist/framework-mcp/src/tools/control_plane/locking.js} +14 -21
- package/framework-mcp/{src/tools/control_plane/registry.ts → dist/framework-mcp/src/tools/control_plane/registry.js} +8 -11
- package/framework-mcp/{src/tools/definitions.ts → dist/framework-mcp/src/tools/definitions.js} +35 -5
- package/framework-mcp/{src/tools/file_system/batch_surgical_edit.ts → dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js} +16 -31
- package/framework-mcp/{src/tools/file_system/patch_file.ts → dist/framework-mcp/src/tools/file_system/patch_file.js} +9 -14
- package/framework-mcp/{src/tools/file_system/read_file.ts → dist/framework-mcp/src/tools/file_system/read_file.js} +9 -16
- package/framework-mcp/{src/tools/file_system/replace_text.ts → dist/framework-mcp/src/tools/file_system/replace_text.js} +13 -17
- package/framework-mcp/{src/tools/file_system/write_file.ts → dist/framework-mcp/src/tools/file_system/write_file.js} +14 -16
- package/framework-mcp/{src/tools/framework/audit_deps.ts → dist/framework-mcp/src/tools/framework/audit_deps.js} +9 -17
- package/framework-mcp/{src/tools/framework/get_status.ts → dist/framework-mcp/src/tools/framework/get_status.js} +1 -3
- package/framework-mcp/{src/tools/framework/orchestrate.ts → dist/framework-mcp/src/tools/framework/orchestrate.js} +1 -3
- package/framework-mcp/{src/tools/framework/run_tests.ts → dist/framework-mcp/src/tools/framework/run_tests.js} +9 -12
- package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +13 -0
- package/framework-mcp/{src/tools/framework/update_contract_hash.ts → dist/framework-mcp/src/tools/framework/update_contract_hash.js} +1 -3
- package/framework-mcp/{src/tools/framework/update_memory.ts → dist/framework-mcp/src/tools/framework/update_memory.js} +2 -4
- package/framework-mcp/{src/tools/index.ts → dist/framework-mcp/src/tools/index.js} +5 -7
- package/framework-mcp/{src/tools/memory/get_insights.ts → dist/framework-mcp/src/tools/memory/get_insights.js} +4 -11
- package/framework-mcp/{src/tools/memory/read_memory.ts → dist/framework-mcp/src/tools/memory/read_memory.js} +3 -6
- package/framework-mcp/{src/tools/messaging/log_action.ts → dist/framework-mcp/src/tools/messaging/log_action.js} +2 -8
- package/framework-mcp/{src/tools/messaging/send_message.ts → dist/framework-mcp/src/tools/messaging/send_message.js} +19 -22
- package/framework-mcp/{src/tools/observability/check_ports.ts → dist/framework-mcp/src/tools/observability/check_ports.js} +6 -10
- package/framework-mcp/{src/tools/observability/get_health.ts → dist/framework-mcp/src/tools/observability/get_health.js} +1 -6
- package/framework-mcp/{src/tools/quality/check_lint.ts → dist/framework-mcp/src/tools/quality/check_lint.js} +3 -9
- package/framework-mcp/{src/tools/search/get_gaps.ts → dist/framework-mcp/src/tools/search/get_gaps.js} +12 -18
- package/framework-mcp/{src/tools/search/get_map.ts → dist/framework-mcp/src/tools/search/get_map.js} +14 -19
- package/framework-mcp/{src/tools/search/grep_search.ts → dist/framework-mcp/src/tools/search/grep_search.js} +26 -26
- package/framework-mcp/{src/tools/search/list_dir.ts → dist/framework-mcp/src/tools/search/list_dir.js} +4 -10
- package/framework-mcp/{src/tools/shell/run_command.ts → dist/framework-mcp/src/tools/shell/run_command.js} +1 -11
- package/framework-mcp/dist/framework-mcp/src/tools/types.js +1 -0
- package/framework-mcp/{src/utils/cli.ts → dist/framework-mcp/src/utils/cli.js} +25 -19
- package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +231 -0
- package/framework-mcp/{src/utils/fs.ts → dist/framework-mcp/src/utils/fs.js} +9 -10
- package/framework-mcp/{src/utils/metrics.ts → dist/framework-mcp/src/utils/metrics.js} +11 -28
- package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +71 -0
- package/framework-mcp/{src/utils/security.ts → dist/framework-mcp/src/utils/security.js} +9 -15
- package/framework-mcp/dist/index.js +29 -5
- package/framework-mcp/dist/resources/index.js +58 -0
- package/{src/cli/adapters/core.ts → framework-mcp/dist/src/cli/adapters/core.js} +21 -41
- package/{src/cli/adapters/index.ts → framework-mcp/dist/src/cli/adapters/index.js} +1 -1
- package/{src/cli/adapters/paths.ts → framework-mcp/dist/src/cli/adapters/paths.js} +19 -53
- package/{src/cli/adapters/scaffold.ts → framework-mcp/dist/src/cli/adapters/scaffold.js} +18 -42
- package/{src/cli/adapters/utils.ts → framework-mcp/dist/src/cli/adapters/utils.js} +19 -31
- package/{src/cli/commands/approve.ts → framework-mcp/dist/src/cli/commands/approve.js} +15 -25
- package/{src/cli/commands/check.ts → framework-mcp/dist/src/cli/commands/check.js} +36 -43
- package/{src/cli/commands/compliance.ts → framework-mcp/dist/src/cli/commands/compliance.js} +10 -15
- package/{src/cli/commands/contract.ts → framework-mcp/dist/src/cli/commands/contract.js} +13 -31
- package/framework-mcp/dist/src/cli/commands/dashboard.js +123 -0
- package/{src/cli/commands/explorer.ts → framework-mcp/dist/src/cli/commands/explorer.js} +14 -17
- package/{src/cli/commands/git.ts → framework-mcp/dist/src/cli/commands/git.js} +15 -14
- package/framework-mcp/dist/src/cli/commands/init/create-agent.js +58 -0
- package/{src/cli/commands/init/scaffold-core.ts → framework-mcp/dist/src/cli/commands/init/scaffold-core.js} +35 -59
- package/framework-mcp/dist/src/cli/commands/init/scaffold-docs.js +34 -0
- package/{src/cli/commands/init/scaffold-ops.ts → framework-mcp/dist/src/cli/commands/init/scaffold-ops.js} +19 -22
- package/{src/cli/commands/init/scaffold-standards.ts → framework-mcp/dist/src/cli/commands/init/scaffold-standards.js} +20 -20
- package/{src/cli/commands/init.ts → framework-mcp/dist/src/cli/commands/init.js} +51 -77
- package/{src/cli/commands/knowledge.ts → framework-mcp/dist/src/cli/commands/knowledge.js} +9 -11
- package/{src/cli/commands/lint.ts → framework-mcp/dist/src/cli/commands/lint.js} +5 -6
- package/framework-mcp/dist/src/cli/commands/log.js +10 -0
- package/{src/cli/commands/memory.ts → framework-mcp/dist/src/cli/commands/memory.js} +1 -3
- package/framework-mcp/dist/src/cli/commands/orchestrate.js +159 -0
- package/framework-mcp/dist/src/cli/commands/plan.js +117 -0
- package/{src/cli/commands/script.ts → framework-mcp/dist/src/cli/commands/script.js} +6 -7
- package/{src/cli/commands/security.ts → framework-mcp/dist/src/cli/commands/security.js} +6 -8
- package/framework-mcp/dist/src/cli/commands/status.js +97 -0
- package/framework-mcp/dist/src/cli/commands/trace.js +109 -0
- package/{src/cli/index.ts → framework-mcp/dist/src/cli/index.js} +80 -64
- package/{src/cli/shims.ts → framework-mcp/dist/src/cli/shims.js} +15 -15
- package/{src/cli/utils/claude.ts → framework-mcp/dist/src/cli/utils/claude.js} +8 -15
- package/{src/cli/utils/compliance.ts → framework-mcp/dist/src/cli/utils/compliance.js} +18 -36
- package/{src/cli/utils/config-schema.ts → framework-mcp/dist/src/cli/utils/config-schema.js} +0 -6
- package/{src/cli/utils/fs.ts → framework-mcp/dist/src/cli/utils/fs.js} +34 -67
- package/{src/cli/utils/i18n.ts → framework-mcp/dist/src/cli/utils/i18n.js} +3 -17
- package/{src/cli/utils/memory.ts → framework-mcp/dist/src/cli/utils/memory.js} +87 -114
- package/{src/cli/utils/pkg.ts → framework-mcp/dist/src/cli/utils/pkg.js} +120 -155
- package/{src/cli/utils/schemas.ts → framework-mcp/dist/src/cli/utils/schemas.js} +0 -3
- package/{src/cli/utils/string.ts → framework-mcp/dist/src/cli/utils/string.js} +18 -24
- package/{src/cli/utils/time.ts → framework-mcp/dist/src/cli/utils/time.js} +4 -4
- package/{src/cli/utils/ui.ts → framework-mcp/dist/src/cli/utils/ui.js} +9 -17
- package/{src/contracts/tasks.ts → framework-mcp/dist/src/contracts/tasks.js} +0 -6
- package/framework-mcp/dist/src/dashboard/vite.config.js +15 -0
- package/framework-mcp/dist/src/modules/adapters/definitions.js +140 -0
- package/framework-mcp/dist/src/modules/adapters/registry.js +18 -0
- package/{src/modules/adapters/shared.ts → framework-mcp/dist/src/modules/adapters/shared.js} +9 -25
- package/framework-mcp/dist/src/modules/adapters/types.js +1 -0
- package/{src/modules/agents/definitions.ts → framework-mcp/dist/src/modules/agents/definitions.js} +158 -161
- package/{src/modules/agents/registry/analyst.ts → framework-mcp/dist/src/modules/agents/registry/analyst.js} +9 -14
- package/{src/modules/agents/registry/architect.ts → framework-mcp/dist/src/modules/agents/registry/architect.js} +9 -14
- package/{src/modules/agents/registry/backend.ts → framework-mcp/dist/src/modules/agents/registry/backend.js} +16 -13
- package/{src/modules/agents/registry/database.ts → framework-mcp/dist/src/modules/agents/registry/database.js} +16 -14
- package/{src/modules/agents/registry/devops.ts → framework-mcp/dist/src/modules/agents/registry/devops.js} +15 -14
- package/{src/modules/agents/registry/explorer.ts → framework-mcp/dist/src/modules/agents/registry/explorer.js} +9 -14
- package/{src/modules/agents/registry/frontend.ts → framework-mcp/dist/src/modules/agents/registry/frontend.js} +17 -14
- package/{src/modules/agents/registry/git.ts → framework-mcp/dist/src/modules/agents/registry/git.js} +9 -14
- package/{src/modules/agents/registry/manager.ts → framework-mcp/dist/src/modules/agents/registry/manager.js} +10 -15
- package/{src/modules/agents/registry/mobile.ts → framework-mcp/dist/src/modules/agents/registry/mobile.js} +9 -14
- package/{src/modules/agents/registry/native.ts → framework-mcp/dist/src/modules/agents/registry/native.js} +9 -14
- package/{src/modules/agents/registry/quality.ts → framework-mcp/dist/src/modules/agents/registry/quality.js} +9 -14
- package/{src/modules/agents/registry/security.ts → framework-mcp/dist/src/modules/agents/registry/security.js} +15 -14
- package/framework-mcp/dist/src/modules/agents/types.js +1 -0
- package/framework-mcp/dist/src/modules/engines/evaluation-engine.js +102 -0
- package/framework-mcp/dist/src/modules/engines/health-engine.js +49 -0
- package/framework-mcp/dist/src/modules/engines/planning-engine.js +78 -0
- package/framework-mcp/dist/src/modules/engines/risk-engine.js +105 -0
- package/framework-mcp/dist/src/modules/engines/routing-engine.js +73 -0
- package/framework-mcp/dist/src/modules/engines/types.js +1 -0
- package/{src/modules/skills/definitions.ts → framework-mcp/dist/src/modules/skills/definitions.js} +0 -1
- package/{src/shared/constants.ts → framework-mcp/dist/src/shared/constants.js} +40 -71
- package/{src/shared/errors.ts → framework-mcp/dist/src/shared/errors.js} +10 -17
- package/{src/shared/fs.ts → framework-mcp/dist/src/shared/fs.js} +14 -13
- package/{src/shared/logger.ts → framework-mcp/dist/src/shared/logger.js} +28 -51
- package/framework-mcp/dist/src/shared/storage.js +207 -0
- package/framework-mcp/dist/src/shared/types.js +12 -0
- package/framework-mcp/dist/tools/control_plane/locking.js +3 -3
- package/framework-mcp/dist/tools/control_plane/registry.js +3 -2
- package/framework-mcp/dist/tools/definitions.js +33 -1
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +8 -3
- package/framework-mcp/dist/tools/file_system/patch_file.js +8 -3
- package/framework-mcp/dist/tools/file_system/read_file.js +3 -3
- package/framework-mcp/dist/tools/file_system/replace_text.js +8 -3
- package/framework-mcp/dist/tools/file_system/write_file.js +10 -5
- package/framework-mcp/dist/tools/framework/audit_deps.js +2 -2
- package/framework-mcp/dist/tools/framework/run_tests.js +2 -2
- package/framework-mcp/dist/tools/framework/submit_plan.js +13 -0
- package/framework-mcp/dist/tools/framework/update_memory.js +1 -1
- package/framework-mcp/dist/tools/index.js +2 -0
- package/framework-mcp/dist/tools/memory/get_insights.js +1 -1
- package/framework-mcp/dist/tools/messaging/log_action.js +1 -1
- package/framework-mcp/dist/tools/messaging/send_message.js +5 -5
- package/framework-mcp/dist/tools/observability/check_ports.js +1 -1
- package/framework-mcp/dist/tools/quality/check_lint.js +2 -2
- package/framework-mcp/dist/tools/search/get_gaps.js +1 -1
- package/framework-mcp/dist/tools/search/grep_search.js +3 -3
- package/framework-mcp/dist/utils/compliance.js +158 -5
- package/framework-mcp/dist/utils/permissions.js +71 -0
- package/framework-mcp/package.json +7 -1
- package/mcp.json +1 -1
- package/package.json +10 -6
- package/templates/prompts/contract-design-recipe.md +1 -1
- package/templates/prompts/db-management-recipe.md +3 -3
- package/templates/prompts/deployment-recipe.md +3 -3
- package/templates/prompts/performance-optimization-recipe.md +3 -3
- package/templates/prompts/pull-request-template.md +2 -2
- package/templates/prompts/security-audit-recipe.md +3 -3
- package/templates/standards/crud-governance.md +1 -1
- package/templates/standards/deployment-standards.md +1 -1
- package/templates/standards/governance-standards.md +1 -1
- package/templates/standards/llm-governance.md +1 -1
- package/templates/standards/nextjs-standards.md +13 -0
- package/templates/standards/observability-standards.md +1 -1
- package/templates/standards/security-audit-standards.md +1 -1
- package/templates/standards/security-standards.md +1 -1
- package/templates/standards/testing-standards.md +1 -1
- package/templates/standards/vite-standards.md +13 -0
- package/framework-mcp/package-lock.json +0 -1191
- package/framework-mcp/src/declarations.d.ts +0 -17
- package/framework-mcp/src/tools/types.ts +0 -89
- package/framework-mcp/src/utils/compliance.ts +0 -95
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +0 -212
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +0 -136
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +0 -46
- package/framework-mcp/tests/tools/shell/run_command.test.ts +0 -55
- package/framework-mcp/tsconfig.json +0 -14
- package/src/cli/commands/init/scaffold-docs.ts +0 -44
- package/src/cli/commands/log.ts +0 -37
- package/src/cli/commands/orchestrate.ts +0 -450
- package/src/cli/commands/plan.ts +0 -113
- package/src/cli/commands/status.ts +0 -44
- package/src/cli/commands/trace.ts +0 -31
- package/src/modules/adapters/definitions.ts +0 -171
- package/src/modules/adapters/registry.ts +0 -27
- package/src/modules/adapters/types.ts +0 -16
- package/src/modules/agents/types.ts +0 -37
- package/src/schema/agent-lifecycle-schema.json +0 -59
- package/src/shared/types.ts +0 -20
- /package/{src/contracts/index.ts → framework-mcp/dist/src/contracts/index.js} +0 -0
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import os from "os";
|
|
2
|
-
import { ToolArgs, ToolResult } from "../types.js";
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Retrieves system health metrics including CPU load and memory usage.
|
|
6
4
|
*/
|
|
7
|
-
export function handleGetSystemHealth(_projectRoot
|
|
5
|
+
export function handleGetSystemHealth(_projectRoot, _args) {
|
|
8
6
|
const totalMem = os.totalmem();
|
|
9
7
|
const freeMem = os.freemem();
|
|
10
8
|
const usedMem = totalMem - freeMem;
|
|
11
9
|
const memUsagePercent = ((usedMem / totalMem) * 100).toFixed(2);
|
|
12
|
-
|
|
13
10
|
const loadAvg = os.loadavg(); // [1, 5, 15] minute averages
|
|
14
|
-
|
|
15
11
|
const healthReport = `🖥️ **System Health Report**
|
|
16
12
|
- **Memory:** ${memUsagePercent}% used (${(usedMem / 1024 / 1024 / 1024).toFixed(2)} GB / ${(totalMem / 1024 / 1024 / 1024).toFixed(2)} GB)
|
|
17
13
|
- **CPU Load (1m, 5m, 15m):** ${loadAvg.map(l => l.toFixed(2)).join(", ")}
|
|
18
14
|
- **Platform:** ${os.platform()} (${os.release()})
|
|
19
15
|
- **Uptime:** ${(os.uptime() / 3600).toFixed(2)} hours`;
|
|
20
|
-
|
|
21
16
|
return {
|
|
22
17
|
content: [{ type: "text", text: healthReport }]
|
|
23
18
|
};
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
import { exec } from "child_process";
|
|
2
|
-
import { ToolArgs, ToolResult } from "../types.js";
|
|
3
2
|
import { Metrics } from "../../utils/metrics.js";
|
|
4
3
|
import { getBackendLanguage, getDefaultLintCommand } from "../../utils/cli.js";
|
|
5
|
-
|
|
6
4
|
const TIMEOUT = 60000; // 60 seconds
|
|
7
|
-
|
|
8
5
|
/**
|
|
9
6
|
* Handles running the project's linter.
|
|
10
7
|
*/
|
|
11
|
-
export function handleCheckLint(projectRoot
|
|
8
|
+
export function handleCheckLint(projectRoot, _args) {
|
|
12
9
|
const language = getBackendLanguage(projectRoot);
|
|
13
10
|
const lintCommand = getDefaultLintCommand(language);
|
|
14
|
-
|
|
15
11
|
return new Promise((resolve) => {
|
|
16
12
|
exec(lintCommand, { cwd: projectRoot, timeout: TIMEOUT }, (error, stdout, stderr) => {
|
|
17
13
|
const output = stdout + stderr;
|
|
18
14
|
const tokens = Metrics.estimateTokens(output);
|
|
19
|
-
|
|
20
15
|
if (error) {
|
|
21
16
|
const err = `Linting failed for ${language} with command: ${lintCommand}. ${error.message}`;
|
|
22
17
|
Metrics.logError(projectRoot, "@mcp", "check_lint", err);
|
|
23
18
|
resolve({
|
|
24
19
|
isError: true,
|
|
25
|
-
content: [{ type: "text", text:
|
|
20
|
+
content: [{ type: "text", text: `[ERROR] Lint Errors Found (${language}):\n\n${output}` }]
|
|
26
21
|
});
|
|
27
22
|
return;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
24
|
Metrics.logUsage(projectRoot, "@mcp", "check_lint", tokens);
|
|
31
25
|
resolve({
|
|
32
|
-
content: [{ type: "text", text:
|
|
26
|
+
content: [{ type: "text", text: `[OK] Lint check passed successfully for ${language}:\n\n${output}` }]
|
|
33
27
|
});
|
|
34
28
|
});
|
|
35
29
|
});
|
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { safePath } from "../../utils/security.js";
|
|
4
|
-
import { GetProjectGapsArgs, ToolResult } from "../types.js";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Scans the codebase for TODOs, FIXMEs, and empty function bodies.
|
|
8
6
|
* Helps identify what's left and where the agent might have skipped logic.
|
|
9
7
|
*/
|
|
10
|
-
export function handleGetProjectGaps(projectRoot
|
|
8
|
+
export function handleGetProjectGaps(projectRoot, args) {
|
|
11
9
|
const srcDir = safePath(projectRoot, args.path || "src");
|
|
12
|
-
const results
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const results = [];
|
|
11
|
+
const walk = (dir) => {
|
|
12
|
+
if (!fs.existsSync(dir))
|
|
13
|
+
return;
|
|
16
14
|
const files = fs.readdirSync(dir);
|
|
17
15
|
for (const file of files) {
|
|
18
16
|
const fullPath = path.join(dir, file);
|
|
19
17
|
const relativePath = path.relative(projectRoot, fullPath);
|
|
20
|
-
|
|
21
18
|
if (fs.statSync(fullPath).isDirectory()) {
|
|
22
19
|
if (file !== "node_modules" && file !== "dist" && !file.startsWith(".")) {
|
|
23
20
|
walk(fullPath);
|
|
24
21
|
}
|
|
25
|
-
}
|
|
22
|
+
}
|
|
23
|
+
else if (file.endsWith(".ts") || file.endsWith(".tsx")) {
|
|
26
24
|
const content = fs.readFileSync(fullPath, "utf8");
|
|
27
25
|
const lines = content.split("\n");
|
|
28
|
-
|
|
29
26
|
lines.forEach((line, index) => {
|
|
30
27
|
// 1. Scan for markers
|
|
31
28
|
if (line.includes("TODO") || line.includes("FIXME") || line.includes("!!!")) {
|
|
32
29
|
results.push(`[${relativePath}:${index + 1}] Marker found: ${line.trim()}`);
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
// 2. Scan for empty function placeholders (heuristic)
|
|
36
32
|
if (line.includes("throw new Error(\"Not implemented") || line.includes("// ... rest of code")) {
|
|
37
33
|
results.push(`[${relativePath}:${index + 1}] Gap found: ${line.trim()}`);
|
|
@@ -40,15 +36,13 @@ export function handleGetProjectGaps(projectRoot: string, args: GetProjectGapsAr
|
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
38
|
};
|
|
43
|
-
|
|
44
39
|
walk(srcDir);
|
|
45
|
-
|
|
46
40
|
return {
|
|
47
41
|
content: [{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
type: "text",
|
|
43
|
+
text: results.length > 0
|
|
44
|
+
? `Found ${results.length} gaps/todos:\n\n${results.join("\n")}`
|
|
45
|
+
: "[OK] No major gaps or TODOs found in the scanned directory."
|
|
46
|
+
}]
|
|
53
47
|
};
|
|
54
48
|
}
|
package/framework-mcp/{src/tools/search/get_map.ts → dist/framework-mcp/src/tools/search/get_map.js}
RENAMED
|
@@ -1,48 +1,43 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { GetProjectMapArgs, ToolResult } from "../types.js";
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Generates a tree-view map of the project structure.
|
|
7
5
|
* Helps agents visualize the entire project layout quickly.
|
|
8
6
|
*/
|
|
9
|
-
export function handleGetProjectMap(projectRoot
|
|
7
|
+
export function handleGetProjectMap(projectRoot, args) {
|
|
10
8
|
const maxDepth = args.maxDepth || 3;
|
|
11
9
|
const includeFiles = args.includeFiles !== false;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const results: string[] = [];
|
|
10
|
+
const buildTree = (dir, depth) => {
|
|
11
|
+
if (depth > maxDepth)
|
|
12
|
+
return [];
|
|
13
|
+
const results = [];
|
|
17
14
|
const files = fs.readdirSync(dir);
|
|
18
|
-
|
|
19
15
|
files.forEach(file => {
|
|
20
|
-
if (file === "node_modules" || file === ".git" || file === "dist" || file.startsWith("."))
|
|
21
|
-
|
|
16
|
+
if (file === "node_modules" || file === ".git" || file === "dist" || file.startsWith("."))
|
|
17
|
+
return;
|
|
22
18
|
const fullPath = path.join(dir, file);
|
|
23
19
|
const stat = fs.statSync(fullPath);
|
|
24
20
|
const indent = " ".repeat(depth);
|
|
25
|
-
|
|
26
21
|
if (stat.isDirectory()) {
|
|
27
22
|
results.push(`${indent}📁 ${file}/`);
|
|
28
23
|
results.push(...buildTree(fullPath, depth + 1));
|
|
29
|
-
}
|
|
24
|
+
}
|
|
25
|
+
else if (includeFiles) {
|
|
30
26
|
results.push(`${indent}📄 ${file}`);
|
|
31
27
|
}
|
|
32
28
|
});
|
|
33
|
-
|
|
34
29
|
return results;
|
|
35
30
|
};
|
|
36
|
-
|
|
37
31
|
try {
|
|
38
32
|
const tree = buildTree(projectRoot, 0);
|
|
39
33
|
return {
|
|
40
34
|
content: [{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
type: "text",
|
|
36
|
+
text: `🗺️ **Project Map (Depth: ${maxDepth})**\n\n${tree.join("\n")}`
|
|
37
|
+
}]
|
|
44
38
|
};
|
|
45
|
-
}
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
46
41
|
return { isError: true, content: [{ type: "text", text: `Failed to map project: ${String(e)}` }] };
|
|
47
42
|
}
|
|
48
43
|
}
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { GrepSearchArgs, ToolResult } from "../types.js";
|
|
4
3
|
import { Metrics } from "../../utils/metrics.js";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Searches for a regex pattern within files in the project.
|
|
8
6
|
*/
|
|
9
|
-
export function handleGrepSearch(projectRoot
|
|
10
|
-
const pattern = args.pattern
|
|
11
|
-
const includePattern = args.includePattern
|
|
12
|
-
const excludePattern = args.excludePattern
|
|
13
|
-
|
|
7
|
+
export function handleGrepSearch(projectRoot, args) {
|
|
8
|
+
const pattern = args.pattern;
|
|
9
|
+
const includePattern = args.includePattern || ""; // e.g., ".ts"
|
|
10
|
+
const excludePattern = args.excludePattern || "node_modules";
|
|
14
11
|
if (!pattern) {
|
|
15
12
|
const err = "Search pattern is required.";
|
|
16
13
|
Metrics.logError(projectRoot, "@mcp", "grep_search", err);
|
|
17
|
-
return { isError: true, content: [{ type: "text", text:
|
|
14
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
const results: string[] = [];
|
|
16
|
+
const results = [];
|
|
21
17
|
try {
|
|
22
18
|
new RegExp(pattern);
|
|
23
|
-
}
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
24
21
|
const err = `Invalid regex pattern: ${String(e)}`;
|
|
25
22
|
Metrics.logError(projectRoot, "@mcp", "grep_search", err);
|
|
26
|
-
return { isError: true, content: [{ type: "text", text:
|
|
23
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
const walk = (dir) => {
|
|
26
|
+
if (results.length > 100)
|
|
27
|
+
return;
|
|
31
28
|
try {
|
|
32
29
|
const files = fs.readdirSync(dir);
|
|
33
30
|
for (const file of files) {
|
|
34
|
-
if (results.length > 100)
|
|
31
|
+
if (results.length > 100)
|
|
32
|
+
return;
|
|
35
33
|
const filePath = path.join(dir, file);
|
|
36
34
|
if (excludePattern && filePath.includes(excludePattern)) {
|
|
37
35
|
continue;
|
|
@@ -39,7 +37,8 @@ export function handleGrepSearch(projectRoot: string, args: GrepSearchArgs): Too
|
|
|
39
37
|
const stat = fs.statSync(filePath);
|
|
40
38
|
if (stat.isDirectory()) {
|
|
41
39
|
walk(filePath);
|
|
42
|
-
}
|
|
40
|
+
}
|
|
41
|
+
else if (stat.isFile()) {
|
|
43
42
|
if (includePattern && !filePath.endsWith(includePattern)) {
|
|
44
43
|
continue;
|
|
45
44
|
}
|
|
@@ -52,24 +51,25 @@ export function handleGrepSearch(projectRoot: string, args: GrepSearchArgs): Too
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
}
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
56
|
// Ignore directories that cannot be read
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
try {
|
|
60
60
|
walk(projectRoot);
|
|
61
|
-
}
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
62
63
|
const err = `Search failed: ${String(e)}`;
|
|
63
64
|
Metrics.logError(projectRoot, "@mcp", "grep_search", err);
|
|
64
|
-
return { isError: true, content: [{ type: "text", text:
|
|
65
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
65
66
|
}
|
|
66
|
-
|
|
67
67
|
return {
|
|
68
68
|
content: [{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
type: "text",
|
|
70
|
+
text: results.length > 0
|
|
71
|
+
? `Found ${results.length} matches:\n\n${results.join("\n")}`
|
|
72
|
+
: "No matches found."
|
|
73
|
+
}]
|
|
74
74
|
};
|
|
75
75
|
}
|
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { safePath } from "../../utils/security.js";
|
|
4
|
-
import { ListDirArgs, ToolResult } from "../types.js";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Lists the contents of a directory.
|
|
8
6
|
*/
|
|
9
|
-
export function handleListDir(projectRoot
|
|
7
|
+
export function handleListDir(projectRoot, args) {
|
|
10
8
|
const dirPath = safePath(projectRoot, args.path || ".");
|
|
11
|
-
|
|
12
9
|
if (!fs.existsSync(dirPath)) {
|
|
13
10
|
throw new Error(`Directory not found: ${args.path}`);
|
|
14
11
|
}
|
|
15
|
-
|
|
16
12
|
const stats = fs.statSync(dirPath);
|
|
17
13
|
if (!stats.isDirectory()) {
|
|
18
14
|
throw new Error(`Path is not a directory: ${args.path}`);
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
const files = fs.readdirSync(dirPath);
|
|
22
17
|
const results = files.map(file => {
|
|
23
18
|
const fullPath = path.join(dirPath, file);
|
|
24
19
|
const isDir = fs.statSync(fullPath).isDirectory();
|
|
25
20
|
return `${isDir ? "[DIR] " : " "}${file}`;
|
|
26
21
|
});
|
|
27
|
-
|
|
28
22
|
return {
|
|
29
23
|
content: [{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
type: "text",
|
|
25
|
+
text: `Directory listing for ${args.path || "."}:\n\n${results.join("\n")}`
|
|
26
|
+
}]
|
|
33
27
|
};
|
|
34
28
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { exec } from "child_process";
|
|
2
|
-
import { RunCommandArgs, ToolResult } from "../types.js";
|
|
3
2
|
import { Metrics } from "../../utils/metrics.js";
|
|
4
|
-
|
|
5
3
|
const COMMAND_ALLOW_LIST = [
|
|
6
4
|
"npm test",
|
|
7
5
|
"npm run lint",
|
|
@@ -20,14 +18,10 @@ const COMMAND_ALLOW_LIST = [
|
|
|
20
18
|
"./gradlew",
|
|
21
19
|
"mvn",
|
|
22
20
|
];
|
|
23
|
-
|
|
24
21
|
const TIMEOUT = 30000; // 30 seconds
|
|
25
|
-
|
|
26
|
-
export function handleRunCommand(projectRoot: string, args: RunCommandArgs): Promise<ToolResult> {
|
|
22
|
+
export function handleRunCommand(projectRoot, args) {
|
|
27
23
|
const command = args.command;
|
|
28
|
-
|
|
29
24
|
const isAllowed = COMMAND_ALLOW_LIST.some(allowedCmd => command.startsWith(allowedCmd));
|
|
30
|
-
|
|
31
25
|
if (!isAllowed) {
|
|
32
26
|
const errorMsg = `Command not allowed: "${command}". Only commands starting with the following are allowed: ${COMMAND_ALLOW_LIST.join(", ")}`;
|
|
33
27
|
Metrics.logError(projectRoot, "@mcp", `run_shell_command: ${command} (denied)`, errorMsg);
|
|
@@ -36,13 +30,11 @@ export function handleRunCommand(projectRoot: string, args: RunCommandArgs): Pro
|
|
|
36
30
|
isError: true,
|
|
37
31
|
});
|
|
38
32
|
}
|
|
39
|
-
|
|
40
33
|
return new Promise((resolve) => {
|
|
41
34
|
exec(command, { cwd: projectRoot, timeout: TIMEOUT }, (error, stdout, stderr) => {
|
|
42
35
|
const output = stdout + stderr;
|
|
43
36
|
const tokens = Metrics.estimateTokens(output);
|
|
44
37
|
Metrics.logUsage(projectRoot, "@mcp", `run_shell_command: ${command}`, tokens);
|
|
45
|
-
|
|
46
38
|
if (error) {
|
|
47
39
|
const errorMsg = `Command failed with exit code ${error.code}: ${error.message}.`;
|
|
48
40
|
Metrics.logError(projectRoot, "@mcp", `run_shell_command: ${command}`, errorMsg);
|
|
@@ -52,14 +44,12 @@ export function handleRunCommand(projectRoot: string, args: RunCommandArgs): Pro
|
|
|
52
44
|
});
|
|
53
45
|
return;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
// Truncate long outputs
|
|
57
48
|
const MAX_OUTPUT_LENGTH = 5000;
|
|
58
49
|
let truncatedOutput = output;
|
|
59
50
|
if (output.length > MAX_OUTPUT_LENGTH) {
|
|
60
51
|
truncatedOutput = output.substring(0, MAX_OUTPUT_LENGTH) + "... [TRUNCATED] ..."; // Simplified
|
|
61
52
|
}
|
|
62
|
-
|
|
63
53
|
resolve({ content: [{ type: "text", text: truncatedOutput }] });
|
|
64
54
|
});
|
|
65
55
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,53 +1,59 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { execFileSync } from "child_process";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Executes a command safely and returns the output.
|
|
7
6
|
*/
|
|
8
|
-
export function safeExec(cmd
|
|
7
|
+
export function safeExec(cmd, args, cwd, timeout = 30000) {
|
|
9
8
|
try {
|
|
10
9
|
return execFileSync(cmd, args, { cwd, timeout, encoding: "utf8", stdio: "pipe" });
|
|
11
|
-
}
|
|
12
|
-
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
const error = err;
|
|
13
13
|
return error.stdout?.toString() || error.stderr?.toString() || error.message || String(err);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
|
|
17
16
|
/**
|
|
18
17
|
* Detects the backend language from the framework configuration.
|
|
19
18
|
*/
|
|
20
|
-
export function getBackendLanguage(projectRoot
|
|
19
|
+
export function getBackendLanguage(projectRoot) {
|
|
21
20
|
try {
|
|
22
21
|
const configPath = path.join(projectRoot, ".atabey", "config.json");
|
|
23
22
|
if (fs.existsSync(configPath)) {
|
|
24
23
|
const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
25
24
|
return config.backendLanguage || "Node.js (TypeScript)";
|
|
26
25
|
}
|
|
27
|
-
}
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
28
|
// Fallback to default
|
|
29
29
|
}
|
|
30
30
|
return "Node.js (TypeScript)";
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
/**
|
|
34
33
|
* Returns the default lint command for the given language.
|
|
35
34
|
*/
|
|
36
|
-
export function getDefaultLintCommand(language
|
|
37
|
-
if (language.includes("Go"))
|
|
38
|
-
|
|
39
|
-
if (language.includes("
|
|
40
|
-
|
|
35
|
+
export function getDefaultLintCommand(language) {
|
|
36
|
+
if (language.includes("Go"))
|
|
37
|
+
return "go fmt ./...";
|
|
38
|
+
if (language.includes("Java"))
|
|
39
|
+
return "./gradlew check"; // or mvn check
|
|
40
|
+
if (language.includes("Python"))
|
|
41
|
+
return "ruff check .";
|
|
42
|
+
if (language.includes(".NET"))
|
|
43
|
+
return "dotnet format";
|
|
41
44
|
return "npm run lint";
|
|
42
45
|
}
|
|
43
|
-
|
|
44
46
|
/**
|
|
45
47
|
* Returns the default test command for the given language.
|
|
46
48
|
*/
|
|
47
|
-
export function getDefaultTestCommand(language
|
|
48
|
-
if (language.includes("Go"))
|
|
49
|
-
|
|
50
|
-
if (language.includes("
|
|
51
|
-
|
|
49
|
+
export function getDefaultTestCommand(language) {
|
|
50
|
+
if (language.includes("Go"))
|
|
51
|
+
return "go test ./...";
|
|
52
|
+
if (language.includes("Java"))
|
|
53
|
+
return "./gradlew test"; // or mvn test
|
|
54
|
+
if (language.includes("Python"))
|
|
55
|
+
return "pytest";
|
|
56
|
+
if (language.includes(".NET"))
|
|
57
|
+
return "dotnet test";
|
|
52
58
|
return "npm test";
|
|
53
59
|
}
|