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,29 +1,23 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { safePath } from "../../utils/security.js";
|
|
3
|
-
import { ReadFileArgs, ToolResult } from "../types.js";
|
|
4
3
|
import { Metrics } from "../../utils/metrics.js";
|
|
5
|
-
|
|
6
|
-
export function handleReadFile(projectRoot: string, args: ReadFileArgs): ToolResult {
|
|
4
|
+
export function handleReadFile(projectRoot, args) {
|
|
7
5
|
if (!args.path) {
|
|
8
6
|
const err = "Missing 'path' argument.";
|
|
9
7
|
Metrics.logError(projectRoot, "@mcp", "read_file", err);
|
|
10
|
-
return { isError: true, content: [{ type: "text", text:
|
|
8
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
try {
|
|
14
11
|
const filePath = safePath(projectRoot, args.path);
|
|
15
12
|
if (!fs.existsSync(filePath)) {
|
|
16
13
|
const err = `File not found: ${args.path}`;
|
|
17
14
|
Metrics.logError(projectRoot, "@mcp", "read_file", err);
|
|
18
|
-
return { isError: true, content: [{ type: "text", text:
|
|
15
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
const startLine = args.startLine;
|
|
22
18
|
const endLine = args.endLine;
|
|
23
|
-
|
|
24
19
|
const content = fs.readFileSync(filePath, "utf8");
|
|
25
20
|
const lines = content.split(/\r?\n/);
|
|
26
|
-
|
|
27
21
|
if (startLine !== undefined || endLine !== undefined) {
|
|
28
22
|
const start = startLine !== undefined ? Math.max(1, startLine) - 1 : 0;
|
|
29
23
|
const end = endLine !== undefined ? Math.min(lines.length, endLine) : lines.length;
|
|
@@ -32,7 +26,6 @@ export function handleReadFile(projectRoot: string, args: ReadFileArgs): ToolRes
|
|
|
32
26
|
Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
|
|
33
27
|
return { content: [{ type: "text", text: sliced }] };
|
|
34
28
|
}
|
|
35
|
-
|
|
36
29
|
// Default protection limit: 1000 lines
|
|
37
30
|
const DEFAULT_MAX_LINES = 1000;
|
|
38
31
|
if (lines.length > DEFAULT_MAX_LINES) {
|
|
@@ -41,18 +34,18 @@ export function handleReadFile(projectRoot: string, args: ReadFileArgs): ToolRes
|
|
|
41
34
|
Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path} (truncated)`, tokens);
|
|
42
35
|
return {
|
|
43
36
|
content: [{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
type: "text",
|
|
38
|
+
text: `${sliced}\n\n... [TRUNCATED - File is too long (${lines.length} lines). Only the first ${DEFAULT_MAX_LINES} lines are shown. Use startLine and endLine parameters to read other parts of the file.]`
|
|
39
|
+
}]
|
|
47
40
|
};
|
|
48
41
|
}
|
|
49
|
-
|
|
50
42
|
const tokens = Metrics.estimateTokens(content);
|
|
51
43
|
Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
|
|
52
44
|
return { content: [{ type: "text", text: content }] };
|
|
53
|
-
}
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
54
47
|
const err = `Failed to read file: ${String(e)}`;
|
|
55
48
|
Metrics.logError(projectRoot, "@mcp", `read_file:${args.path}`, err);
|
|
56
|
-
return { isError: true, content: [{ type: "text", text:
|
|
49
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
57
50
|
}
|
|
58
51
|
}
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { safePath } from "../../utils/security.js";
|
|
3
3
|
import { writeTextFileAtomic } from "../../utils/fs.js";
|
|
4
|
-
import { ReplaceTextArgs, ToolResult } from "../types.js";
|
|
5
4
|
import { Metrics } from "../../utils/metrics.js";
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export function handleReplaceText(projectRoot: string, args: ReplaceTextArgs): ToolResult {
|
|
5
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
6
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
7
|
+
export async function handleReplaceText(projectRoot, args) {
|
|
10
8
|
const filePath = safePath(projectRoot, args.path);
|
|
9
|
+
// ENFORCE PERMISSION MATRIX
|
|
10
|
+
verifyWritePermission(projectRoot, args.path);
|
|
11
11
|
const content = fs.readFileSync(filePath, "utf8");
|
|
12
12
|
const oldText = args.oldText;
|
|
13
13
|
const newText = args.newText;
|
|
14
14
|
const allowMultiple = args.allowMultiple || false; // Default to false
|
|
15
|
-
|
|
16
15
|
if (!content.includes(oldText)) {
|
|
17
16
|
const err = `Text not found in file: ${oldText.slice(0, 100)}...`;
|
|
18
17
|
Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
|
|
19
18
|
throw new Error(err);
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
// Surgical precision guard: reject ambiguous replacements unless allowMultiple is true.
|
|
23
21
|
if (!allowMultiple) {
|
|
24
22
|
const firstIndex = content.indexOf(oldText);
|
|
@@ -26,29 +24,27 @@ export function handleReplaceText(projectRoot: string, args: ReplaceTextArgs): T
|
|
|
26
24
|
if (firstIndex !== lastIndex) {
|
|
27
25
|
const count = (content.match(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length;
|
|
28
26
|
const err = `Ambiguous replacement: "${oldText.slice(0, 80)}..." found ${count} times in ${args.path}. ` +
|
|
29
|
-
|
|
27
|
+
"Provide a longer, unique context string or set 'allow_multiple' to true.";
|
|
30
28
|
Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
|
|
31
29
|
throw new Error(err);
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
|
|
35
32
|
// Perform replacement(s).
|
|
36
33
|
// Use a function replacer so special patterns ($&, $1, $$) inside newText
|
|
37
34
|
// are treated literally and never reinterpreted as regex backreferences.
|
|
38
|
-
let newContent
|
|
35
|
+
let newContent;
|
|
39
36
|
if (allowMultiple) {
|
|
40
37
|
newContent = content.replace(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), () => newText);
|
|
41
|
-
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
42
40
|
newContent = content.replace(oldText, () => newText);
|
|
43
41
|
}
|
|
44
|
-
|
|
45
42
|
// ENFORCE CORPORATE COMPLIANCE
|
|
46
|
-
verifyCorporateCompliance(newContent, args.path
|
|
47
|
-
|
|
43
|
+
verifyCorporateCompliance(newContent, args.path);
|
|
44
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
45
|
+
await verifyRiskAndAwaitApproval(projectRoot, newContent, args.path);
|
|
48
46
|
writeTextFileAtomic(filePath, newContent);
|
|
49
|
-
|
|
50
47
|
const tokens = Metrics.estimateTokens(newText);
|
|
51
48
|
Metrics.logUsage(projectRoot, "@mcp", `replace_text: ${args.path}`, tokens);
|
|
52
|
-
|
|
53
|
-
return { content: [{ type: "text", text: `✅ Surgical edit successful in ${args.path}` }] };
|
|
49
|
+
return { content: [{ type: "text", text: `[OK] Surgical edit successful in ${args.path}` }] };
|
|
54
50
|
}
|
|
@@ -3,30 +3,27 @@ import path from "path";
|
|
|
3
3
|
import { safePath, resolveFrameworkDir } from "../../utils/security.js";
|
|
4
4
|
import { writeTextFileAtomic, appendFileSafe } from "../../utils/fs.js";
|
|
5
5
|
import { Metrics } from "../../utils/metrics.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export function handleWriteFile(projectRoot: string, args: WriteFileArgs): ToolResult {
|
|
6
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
7
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
8
|
+
export async function handleWriteFile(projectRoot, args) {
|
|
11
9
|
if (!args.path || args.content === undefined) {
|
|
12
10
|
const err = "Missing 'path' or 'content' argument.";
|
|
13
11
|
Metrics.logError(projectRoot, "@mcp", "write_file", err);
|
|
14
|
-
return { isError: true, content: [{ type: "text", text:
|
|
12
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
try {
|
|
18
15
|
const filePath = safePath(projectRoot, args.path);
|
|
19
16
|
const content = args.content;
|
|
20
|
-
|
|
17
|
+
// ENFORCE PERMISSION MATRIX
|
|
18
|
+
verifyWritePermission(projectRoot, args.path);
|
|
21
19
|
// ENFORCE CORPORATE COMPLIANCE
|
|
22
20
|
verifyCorporateCompliance(content, args.path);
|
|
23
|
-
|
|
21
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
22
|
+
await verifyRiskAndAwaitApproval(projectRoot, content, args.path);
|
|
24
23
|
writeTextFileAtomic(filePath, content);
|
|
25
|
-
|
|
26
24
|
// AUTO-LOGGING & METRICS
|
|
27
25
|
const tokens = Metrics.estimateTokens(content);
|
|
28
26
|
Metrics.logUsage(projectRoot, "@mcp", `write_file: ${args.path}`, tokens);
|
|
29
|
-
|
|
30
27
|
try {
|
|
31
28
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
32
29
|
const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
|
|
@@ -34,12 +31,13 @@ export function handleWriteFile(projectRoot: string, args: WriteFileArgs): ToolR
|
|
|
34
31
|
const entry = `\n### ${new Date().toISOString().split("T")[0]} — Auto-Update\n- **Action:** wrote file \`${args.path}\` (${tokens} tokens estimated).\n`;
|
|
35
32
|
appendFileSafe(memoryPath, entry);
|
|
36
33
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return { content: [{ type: "text", text:
|
|
40
|
-
}
|
|
34
|
+
}
|
|
35
|
+
catch { /* ignore memory logging errors */ }
|
|
36
|
+
return { content: [{ type: "text", text: `[OK] File written: ${args.path}` }] };
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
41
39
|
const err = `Failed to write file: ${String(e)}`;
|
|
42
40
|
Metrics.logError(projectRoot, "@mcp", `write_file:${args.path}`, err);
|
|
43
|
-
return { isError: true, content: [{ type: "text", text:
|
|
41
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
44
42
|
}
|
|
45
43
|
}
|
|
@@ -1,49 +1,41 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { ToolArgs, ToolResult } from "../types.js";
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Audits package.json for unused or duplicate-like packages.
|
|
7
5
|
* Focuses on project health and cleanup.
|
|
8
6
|
*/
|
|
9
|
-
export function handleAuditDependencies(projectRoot
|
|
7
|
+
export function handleAuditDependencies(projectRoot, _args) {
|
|
10
8
|
const pkgPath = path.join(projectRoot, "package.json");
|
|
11
9
|
if (!fs.existsSync(pkgPath)) {
|
|
12
10
|
throw new Error("package.json not found.");
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
16
13
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
17
14
|
const depNames = Object.keys(deps);
|
|
18
|
-
|
|
19
|
-
const results: string[] = [];
|
|
20
|
-
|
|
15
|
+
const results = [];
|
|
21
16
|
// 1. Look for similar packages (potential duplicates)
|
|
22
|
-
const similarityGroups
|
|
17
|
+
const similarityGroups = {
|
|
23
18
|
"CSS/Styling": ["tailwind", "panda", "styled-components", "emotion", "sass"],
|
|
24
19
|
"Testing": ["vitest", "jest", "mocha", "jasmine"],
|
|
25
20
|
"Fetching": ["axios", "ky", "fetch"]
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
for (const [group, patterns] of Object.entries(similarityGroups)) {
|
|
29
23
|
const found = depNames.filter(d => patterns.some(p => d.includes(p)));
|
|
30
24
|
if (found.length > 1) {
|
|
31
|
-
results.push(
|
|
25
|
+
results.push(`[WARN] Potential redundancy in [${group}]: Found ${found.join(", ")}`);
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
// 2. Scan for "any" usage in package names (bad practice markers)
|
|
36
29
|
const legacyDeps = depNames.filter(d => d.includes("legacy") || d.includes("compat"));
|
|
37
30
|
if (legacyDeps.length > 0) {
|
|
38
31
|
results.push(`ℹ️ Legacy compatibility packages detected: ${legacyDeps.join(", ")}`);
|
|
39
32
|
}
|
|
40
|
-
|
|
41
33
|
return {
|
|
42
34
|
content: [{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
+
}]
|
|
48
40
|
};
|
|
49
41
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { safeExec } from "../../utils/cli.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export function handleGetFrameworkStatus(projectRoot: string, args: GetStatusArgs): ToolResult {
|
|
2
|
+
export function handleGetFrameworkStatus(projectRoot, args) {
|
|
5
3
|
const output = safeExec("npx", ["atabey", "status"], projectRoot, args.timeout);
|
|
6
4
|
return { content: [{ type: "text", text: output }] };
|
|
7
5
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { safeExec } from "../../utils/cli.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export function handleOrchestrateLoop(projectRoot: string, args: OrchestrateArgs): ToolResult {
|
|
2
|
+
export function handleOrchestrateLoop(projectRoot, args) {
|
|
5
3
|
const output = safeExec("npx", ["atabey", "orchestrate"], projectRoot, args.timeout);
|
|
6
4
|
return { content: [{ type: "text", text: output }] };
|
|
7
5
|
}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
|
-
import { RunTestsArgs, ToolResult } from "../types.js";
|
|
3
2
|
import { getBackendLanguage, getDefaultTestCommand } from "../../utils/cli.js";
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Executes project tests and returns results for agent analysis.
|
|
7
5
|
*/
|
|
8
|
-
export function handleRunTests(projectRoot
|
|
6
|
+
export function handleRunTests(projectRoot, args) {
|
|
9
7
|
const language = getBackendLanguage(projectRoot);
|
|
10
8
|
const testCommand = args.command || getDefaultTestCommand(language);
|
|
11
|
-
|
|
12
9
|
try {
|
|
13
10
|
const output = execSync(testCommand, { cwd: projectRoot, encoding: "utf8", stdio: "pipe" });
|
|
14
11
|
return {
|
|
15
|
-
content: [{ type: "text", text:
|
|
12
|
+
content: [{ type: "text", text: `[OK] Tests passed successfully for ${language}!\n\n${output}` }]
|
|
16
13
|
};
|
|
17
|
-
}
|
|
18
|
-
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
const err = error;
|
|
19
17
|
const stderr = err.stderr?.toString() || "";
|
|
20
18
|
const stdout = err.stdout?.toString() || "";
|
|
21
|
-
|
|
22
19
|
return {
|
|
23
20
|
isError: true,
|
|
24
|
-
content: [{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
content: [{
|
|
22
|
+
type: "text",
|
|
23
|
+
text: `[ERROR] Tests FAILED for ${language}!\n\n--- STDOUT ---\n${stdout}\n\n--- STDERR ---\n${stderr}`
|
|
24
|
+
}]
|
|
28
25
|
};
|
|
29
26
|
}
|
|
30
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
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { safeExec } from "../../utils/cli.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export function handleUpdateContractHash(projectRoot: string, args: UpdateContractHashArgs): ToolResult {
|
|
2
|
+
export function handleUpdateContractHash(projectRoot, args) {
|
|
5
3
|
const output = safeExec("npx", ["atabey", "update-contract"], projectRoot, args.timeout);
|
|
6
4
|
return { content: [{ type: "text", text: output }] };
|
|
7
5
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { safeExec } from "../../utils/cli.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export function handleUpdateProjectMemory(projectRoot: string, args: UpdateProjectMemoryArgs): ToolResult {
|
|
2
|
+
export function handleUpdateProjectMemory(projectRoot, args) {
|
|
5
3
|
const section = args.section;
|
|
6
4
|
const content = args.content;
|
|
7
5
|
// Using execFileSync with array args prevents command injection
|
|
8
6
|
safeExec("npx", ["atabey", "update_project_memory", section, content], projectRoot);
|
|
9
|
-
return { content: [{ type: "text", text:
|
|
7
|
+
return { content: [{ type: "text", text: `[OK] Section ${section} updated.` }] };
|
|
10
8
|
}
|
|
@@ -15,6 +15,7 @@ import { handleRunTests } from "./framework/run_tests.js";
|
|
|
15
15
|
import { handleGetSystemHealth } from "./observability/get_health.js";
|
|
16
16
|
import { handleCheckPorts } from "./observability/check_ports.js";
|
|
17
17
|
import { handleOrchestrateLoop } from "./framework/orchestrate.js";
|
|
18
|
+
import { handleSubmitPlan } from "./framework/submit_plan.js";
|
|
18
19
|
import { handleUpdateContractHash } from "./framework/update_contract_hash.js";
|
|
19
20
|
import { handleReadProjectMemory } from "./memory/read_memory.js";
|
|
20
21
|
import { handleGetMemoryInsights } from "./memory/get_insights.js";
|
|
@@ -24,14 +25,11 @@ import { handleAcquireLock, handleReleaseLock } from "./control_plane/locking.js
|
|
|
24
25
|
import { handleRegisterAgent } from "./control_plane/registry.js";
|
|
25
26
|
import { handleRunCommand } from "./shell/run_command.js";
|
|
26
27
|
import { handleCheckLint } from "./quality/check_lint.js";
|
|
27
|
-
import { ToolHandler, ToolResult } from "./types.js";
|
|
28
|
-
|
|
29
28
|
// Map of tool names to their handler functions
|
|
30
|
-
const bind =
|
|
31
|
-
return (root
|
|
29
|
+
const bind = (fn) => {
|
|
30
|
+
return (root, args) => fn(root, args);
|
|
32
31
|
};
|
|
33
|
-
|
|
34
|
-
export const toolHandlers: Record<string, ToolHandler> = {
|
|
32
|
+
export const toolHandlers = {
|
|
35
33
|
read_file: bind(handleReadFile),
|
|
36
34
|
view_file: bind(handleReadFile), // Alias
|
|
37
35
|
list_dir: bind(handleListDir),
|
|
@@ -51,6 +49,7 @@ export const toolHandlers: Record<string, ToolHandler> = {
|
|
|
51
49
|
get_system_health: bind(handleGetSystemHealth),
|
|
52
50
|
check_active_ports: bind(handleCheckPorts),
|
|
53
51
|
orchestrate_loop: bind(handleOrchestrateLoop),
|
|
52
|
+
submit_plan: bind(handleSubmitPlan),
|
|
54
53
|
send_agent_message: bind(handleSendAgentMessage),
|
|
55
54
|
log_agent_action: bind(handleLogAgentAction),
|
|
56
55
|
update_contract_hash: bind(handleUpdateContractHash),
|
|
@@ -60,5 +59,4 @@ export const toolHandlers: Record<string, ToolHandler> = {
|
|
|
60
59
|
run_shell_command: bind(handleRunCommand),
|
|
61
60
|
check_lint: bind(handleCheckLint),
|
|
62
61
|
};
|
|
63
|
-
|
|
64
62
|
export { TOOLS };
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
-
import { ToolArgs, ToolResult } from "../types.js";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Extracts key insights from the project memory to minimize token usage.
|
|
8
6
|
* Returns only the active phase, trace, and the last 5 decisions/tasks.
|
|
9
7
|
*/
|
|
10
|
-
export function handleGetMemoryInsights(projectRoot
|
|
8
|
+
export function handleGetMemoryInsights(projectRoot, _args) {
|
|
11
9
|
try {
|
|
12
10
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
13
11
|
const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
|
|
14
|
-
|
|
15
12
|
if (!fs.existsSync(memoryPath)) {
|
|
16
13
|
return { content: [{ type: "text", text: "New project: No history available." }] };
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
const content = fs.readFileSync(memoryPath, "utf8");
|
|
20
16
|
const lines = content.split("\n");
|
|
21
|
-
|
|
22
17
|
const activePhase = lines.find(l => l.includes("**Phase:**"))?.split("**Phase:**")[1]?.trim() || "Unknown";
|
|
23
18
|
const activeTrace = lines.find(l => l.includes("**Trace ID:**"))?.split("**Trace ID:**")[1]?.trim() || "None";
|
|
24
|
-
|
|
25
19
|
// Find the last 5 history items (heuristic)
|
|
26
20
|
const historyStartIndex = lines.findIndex(l => l.toUpperCase().includes("HISTORY"));
|
|
27
21
|
let recentHistory = "No history found.";
|
|
@@ -31,11 +25,10 @@ export function handleGetMemoryInsights(projectRoot: string, _args: ToolArgs): T
|
|
|
31
25
|
.slice(-5)
|
|
32
26
|
.join("\n");
|
|
33
27
|
}
|
|
34
|
-
|
|
35
|
-
const insights = `🧠 **Memory Insights**\n- **Phase:** ${activePhase}\n- **Trace:** ${activeTrace}\n\n**Recent Actions:**\n${recentHistory}`;
|
|
36
|
-
|
|
28
|
+
const insights = `[MEMORY] **Memory Insights**\n- **Phase:** ${activePhase}\n- **Trace:** ${activeTrace}\n\n**Recent Actions:**\n${recentHistory}`;
|
|
37
29
|
return { content: [{ type: "text", text: insights }] };
|
|
38
|
-
}
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
39
32
|
return { isError: true, content: [{ type: "text", text: `Failed to extract insights: ${String(e)}` }] };
|
|
40
33
|
}
|
|
41
34
|
}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
-
import { ToolArgs, ToolResult } from "../types.js";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Reads the project's central memory (PROJECT_MEMORY.md).
|
|
8
6
|
* This is the "brain" of the project.
|
|
9
7
|
*/
|
|
10
|
-
export function handleReadProjectMemory(projectRoot
|
|
8
|
+
export function handleReadProjectMemory(projectRoot, _args) {
|
|
11
9
|
try {
|
|
12
10
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
13
11
|
const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
|
|
14
|
-
|
|
15
12
|
if (!fs.existsSync(memoryPath)) {
|
|
16
13
|
return {
|
|
17
14
|
content: [{ type: "text", text: "ℹ️ Project memory file not found. It might be a new project." }]
|
|
18
15
|
};
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
const content = fs.readFileSync(memoryPath, "utf8");
|
|
22
18
|
return {
|
|
23
19
|
content: [{ type: "text", text: content }]
|
|
24
20
|
};
|
|
25
|
-
}
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
26
23
|
return {
|
|
27
24
|
isError: true,
|
|
28
25
|
content: [{ type: "text", text: `Failed to read project memory: ${String(e)}` }]
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function handleLogAgentAction(projectRoot: string, args: LogAgentActionArgs): ToolResult {
|
|
4
|
+
export function handleLogAgentAction(projectRoot, args) {
|
|
7
5
|
const { agent, action, traceId, status, summary } = args;
|
|
8
6
|
const findings = args.findings ? args.findings.split(",").map(f => f.trim()) : [];
|
|
9
|
-
|
|
10
7
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
11
8
|
const agentName = agent.replace("@", "");
|
|
12
9
|
const logPath = path.join(projectRoot, frameworkDir, "logs", `${agentName}.json`);
|
|
13
|
-
|
|
14
10
|
const logEntry = {
|
|
15
11
|
timestamp: new Date().toISOString(),
|
|
16
12
|
agent,
|
|
@@ -20,9 +16,7 @@ export function handleLogAgentAction(projectRoot: string, args: LogAgentActionAr
|
|
|
20
16
|
summary,
|
|
21
17
|
findings
|
|
22
18
|
};
|
|
23
|
-
|
|
24
19
|
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
25
20
|
fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
|
|
26
|
-
|
|
27
|
-
return { content: [{ type: "text", text: `✅ Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
|
|
21
|
+
return { content: [{ type: "text", text: `[OK] Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
|
|
28
22
|
}
|
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
-
import { SendAgentMessageArgs, ToolResult } from "../types.js";
|
|
5
4
|
import { Metrics } from "../../utils/metrics.js";
|
|
6
|
-
|
|
7
|
-
export async function handleSendAgentMessage(projectRoot: string, args: SendAgentMessageArgs): Promise<ToolResult> {
|
|
5
|
+
export async function handleSendAgentMessage(projectRoot, args) {
|
|
8
6
|
const { to, category, content, traceId, parentId, requiresApproval } = args;
|
|
9
7
|
const from = args.from || "@mcp";
|
|
10
|
-
|
|
11
8
|
if (!to || !category || !content || !traceId) {
|
|
12
9
|
const err = "Missing required messaging arguments (to, category, content, or traceId).";
|
|
13
10
|
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
14
|
-
return { isError: true, content: [{ type: "text", text:
|
|
11
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
18
14
|
const messagesDir = path.join(projectRoot, frameworkDir, "messages");
|
|
19
15
|
const agentName = to.replace("@", "");
|
|
20
16
|
const messagePath = path.join(messagesDir, `${agentName}.json`);
|
|
21
17
|
const lockPath = path.join(messagesDir, `${agentName}.lock`);
|
|
22
|
-
|
|
23
18
|
// Hermes Lock Protocol: Retry 20 times with 500ms delay
|
|
24
19
|
let retries = 20;
|
|
25
20
|
let acquired = false;
|
|
@@ -33,7 +28,8 @@ export async function handleSendAgentMessage(projectRoot: string, args: SendAgen
|
|
|
33
28
|
fs.renameSync(lockPath, tempLockPath);
|
|
34
29
|
fs.unlinkSync(tempLockPath);
|
|
35
30
|
}
|
|
36
|
-
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
37
33
|
// ignore if concurrently unlinked or renamed
|
|
38
34
|
}
|
|
39
35
|
}
|
|
@@ -41,31 +37,30 @@ export async function handleSendAgentMessage(projectRoot: string, args: SendAgen
|
|
|
41
37
|
fs.writeFileSync(lockPath, `Locked by ${from} at ${new Date().toISOString()}`, { flag: "wx" });
|
|
42
38
|
acquired = true;
|
|
43
39
|
break;
|
|
44
|
-
}
|
|
45
|
-
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
const error = err;
|
|
46
43
|
if (error.code === "EEXIST") {
|
|
47
44
|
retries--;
|
|
48
45
|
if (retries > 0) {
|
|
49
46
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
50
47
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return { content: [{ type: "text", text: `[ERROR] Unexpected lock acquisition error: ${error.message || String(err)}` }], isError: true };
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
|
-
|
|
57
54
|
if (!acquired) {
|
|
58
55
|
const err = `Could not send message to ${to}: Hermes lock is busy.`;
|
|
59
56
|
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
60
|
-
return { content: [{ type: "text", text:
|
|
57
|
+
return { content: [{ type: "text", text: `[ERROR] ${err}` }], isError: true };
|
|
61
58
|
}
|
|
62
|
-
|
|
63
59
|
try {
|
|
64
60
|
const defaultPriority = (category === "ALERT" || category === "ACTION") ? "HIGH" : "NORMAL";
|
|
65
61
|
const finalRequiresApproval = requiresApproval !== undefined
|
|
66
62
|
? requiresApproval
|
|
67
63
|
: category === "ALERT";
|
|
68
|
-
|
|
69
64
|
const message = {
|
|
70
65
|
timestamp: new Date().toISOString(),
|
|
71
66
|
from,
|
|
@@ -78,18 +73,20 @@ export async function handleSendAgentMessage(projectRoot: string, args: SendAgen
|
|
|
78
73
|
status: "PENDING",
|
|
79
74
|
requiresApproval: finalRequiresApproval
|
|
80
75
|
};
|
|
81
|
-
|
|
82
76
|
fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
|
|
83
|
-
return { content: [{ type: "text", text:
|
|
84
|
-
}
|
|
77
|
+
return { content: [{ type: "text", text: `[OK] Message sent to ${to} (from: ${from})` }] };
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
85
80
|
const err = `Failed to write message: ${String(e)}`;
|
|
86
81
|
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
87
|
-
return { isError: true, content: [{ type: "text", text:
|
|
88
|
-
}
|
|
82
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
89
85
|
if (acquired && fs.existsSync(lockPath)) {
|
|
90
86
|
try {
|
|
91
87
|
fs.unlinkSync(lockPath);
|
|
92
|
-
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
93
90
|
// ignore
|
|
94
91
|
}
|
|
95
92
|
}
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
|
-
import { CheckActivePortsArgs, ToolResult } from "../types.js";
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Checks for active network ports and their status.
|
|
6
4
|
*/
|
|
7
|
-
export function handleCheckPorts(projectRoot
|
|
5
|
+
export function handleCheckPorts(projectRoot, args) {
|
|
8
6
|
const filter = args.filter || ""; // Optional filter (e.g., ":3000")
|
|
9
|
-
|
|
10
7
|
try {
|
|
11
8
|
// Using 'lsof -i -P -n' to list open files and network connections
|
|
12
9
|
// Note: may require permissions or behave differently on non-Unix systems
|
|
13
10
|
const command = process.platform === "win32"
|
|
14
11
|
? `netstat -ano | findstr LISTENING ${filter ? `| findstr ${filter}` : ""}`
|
|
15
12
|
: `lsof -i -P -n | grep LISTEN ${filter ? `| grep ${filter}` : ""}`;
|
|
16
|
-
|
|
17
13
|
const output = execSync(command, { encoding: "utf8" });
|
|
18
|
-
|
|
19
14
|
return {
|
|
20
15
|
content: [{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
type: "text",
|
|
17
|
+
text: `[SIGNAL] **Active Listening Ports:**\n\n${output || "No active listening ports found matching filter."}`
|
|
18
|
+
}]
|
|
24
19
|
};
|
|
25
|
-
}
|
|
20
|
+
}
|
|
21
|
+
catch (_e) {
|
|
26
22
|
return {
|
|
27
23
|
content: [{ type: "text", text: "ℹ️ No active ports found or command failed (this is normal if nothing is listening)." }]
|
|
28
24
|
};
|