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,17 +0,0 @@
|
|
|
1
|
-
declare module "@modelcontextprotocol/sdk/server/index.js" {
|
|
2
|
-
export class Server {
|
|
3
|
-
constructor(info: { name: string; version: string }, options: { capabilities: { tools: Record<string, never> } });
|
|
4
|
-
setRequestHandler(schema: unknown, handler: (request: unknown) => Promise<unknown>): void;
|
|
5
|
-
connect(transport: unknown): Promise<void>;
|
|
6
|
-
close(): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare module "@modelcontextprotocol/sdk/server/stdio.js" {
|
|
11
|
-
export class StdioServerTransport {}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare module "@modelcontextprotocol/sdk/types.js" {
|
|
15
|
-
export const ListToolsRequestSchema: unknown;
|
|
16
|
-
export const CallToolRequestSchema: unknown;
|
|
17
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export interface ToolDefinition {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
inputSchema: {
|
|
5
|
-
type: "object";
|
|
6
|
-
properties: Record<string, unknown>;
|
|
7
|
-
required?: string[];
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// ─── File System ────────────────────────────────────────────────
|
|
12
|
-
export interface ReadFileArgs { path: string; startLine?: number; endLine?: number; }
|
|
13
|
-
export interface WriteFileArgs { path: string; content: string; }
|
|
14
|
-
export interface ReplaceTextArgs { path: string; oldText: string; newText: string; allowMultiple?: boolean; }
|
|
15
|
-
export interface PatchFileArgs { path: string; startLine: number; endLine: number; newContent: string; }
|
|
16
|
-
export interface BatchSurgicalEditArgs {
|
|
17
|
-
edits: Array<{ path: string; oldText: string; newText: string; allowMultiple?: boolean; }>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// ─── Search & Discovery ──────────────────────────────────────────
|
|
21
|
-
export interface ListDirArgs { path?: string; }
|
|
22
|
-
export interface GrepSearchArgs { pattern: string; includePattern?: string; excludePattern?: string; }
|
|
23
|
-
export interface GetProjectMapArgs { maxDepth?: number; includeFiles?: boolean; }
|
|
24
|
-
export interface GetProjectGapsArgs { path?: string; }
|
|
25
|
-
|
|
26
|
-
// ─── Messaging (Hermes) ─────────────────────────────────────────
|
|
27
|
-
export interface SendAgentMessageArgs {
|
|
28
|
-
from: string;
|
|
29
|
-
to: string;
|
|
30
|
-
category: "ACTION" | "DELEGATION" | "SUBTASK" | "REPLY" | "ALERT";
|
|
31
|
-
content: string;
|
|
32
|
-
traceId: string;
|
|
33
|
-
parentId?: string;
|
|
34
|
-
priority?: "HIGH" | "NORMAL" | "LOW";
|
|
35
|
-
requiresApproval?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface LogAgentActionArgs {
|
|
38
|
-
agent: string;
|
|
39
|
-
action: string;
|
|
40
|
-
traceId: string;
|
|
41
|
-
status: "SUCCESS" | "FAILURE";
|
|
42
|
-
summary: string;
|
|
43
|
-
findings?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// ─── Control Plane ──────────────────────────────────────────────
|
|
47
|
-
export interface AcquireLockArgs { resource: string; agent: string; ttl?: number; }
|
|
48
|
-
export interface ReleaseLockArgs { resource: string; agent: string; }
|
|
49
|
-
export interface RegisterAgentArgs { agent: string; role: string; capability?: number; }
|
|
50
|
-
|
|
51
|
-
// ─── Observability & Utils ──────────────────────────────────────
|
|
52
|
-
export interface StartDashboardArgs { port?: number; }
|
|
53
|
-
export interface CheckActivePortsArgs { filter?: string; }
|
|
54
|
-
export interface RunTestsArgs { command?: string; timeout?: number; }
|
|
55
|
-
export interface UpdateProjectMemoryArgs { section: string; content: string; }
|
|
56
|
-
export interface GetStatusArgs { timeout?: number; }
|
|
57
|
-
export interface OrchestrateArgs { timeout?: number; }
|
|
58
|
-
export interface UpdateContractHashArgs { timeout?: number; }
|
|
59
|
-
export interface RunCommandArgs { command: string; }
|
|
60
|
-
|
|
61
|
-
export type ToolArgs =
|
|
62
|
-
| ReadFileArgs
|
|
63
|
-
| WriteFileArgs
|
|
64
|
-
| ReplaceTextArgs
|
|
65
|
-
| PatchFileArgs
|
|
66
|
-
| BatchSurgicalEditArgs
|
|
67
|
-
| ListDirArgs
|
|
68
|
-
| GrepSearchArgs
|
|
69
|
-
| GetProjectMapArgs
|
|
70
|
-
| GetProjectGapsArgs
|
|
71
|
-
| SendAgentMessageArgs
|
|
72
|
-
| LogAgentActionArgs
|
|
73
|
-
| AcquireLockArgs
|
|
74
|
-
| ReleaseLockArgs
|
|
75
|
-
| RegisterAgentArgs
|
|
76
|
-
| StartDashboardArgs
|
|
77
|
-
| CheckActivePortsArgs
|
|
78
|
-
| RunTestsArgs
|
|
79
|
-
| UpdateProjectMemoryArgs
|
|
80
|
-
| GetStatusArgs
|
|
81
|
-
| OrchestrateArgs
|
|
82
|
-
| UpdateContractHashArgs;
|
|
83
|
-
|
|
84
|
-
export interface ToolResult {
|
|
85
|
-
isError?: boolean;
|
|
86
|
-
content: Array<{ type: "text"; text: string }>;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export type ToolHandler = (projectRoot: string, args: unknown) => ToolResult | Promise<ToolResult>;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Enterprise Compliance Guardrail
|
|
5
|
-
* Checks content against corporate standards using AST analysis before allowing file mutations.
|
|
6
|
-
*/
|
|
7
|
-
export function verifyCorporateCompliance(content: string, filePath: string): void {
|
|
8
|
-
// Skip compliance checks for non-source files or specific ignored files
|
|
9
|
-
if (filePath.endsWith(".json") || filePath.endsWith(".md") || filePath.endsWith(".env.example")) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const sourceFile = ts.createSourceFile(
|
|
14
|
-
filePath,
|
|
15
|
-
content,
|
|
16
|
-
ts.ScriptTarget.Latest,
|
|
17
|
-
true
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const errors: string[] = [];
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Recursive AST Visitor
|
|
24
|
-
*/
|
|
25
|
-
function visit(node: ts.Node) {
|
|
26
|
-
// 1. Zero Console Policy
|
|
27
|
-
if (ts.isPropertyAccessExpression(node)) {
|
|
28
|
-
const expression = node.expression;
|
|
29
|
-
const name = node.name.text;
|
|
30
|
-
if (ts.isIdentifier(expression) && expression.text === "console") {
|
|
31
|
-
if (["log", "warn", "error"].includes(name)) {
|
|
32
|
-
// Check if file is exempt
|
|
33
|
-
if (!filePath.includes("logger.ts") && !filePath.includes("check.ts") && !filePath.includes("cli.ts")) {
|
|
34
|
-
errors.push(`❌ Corporate Compliance Breach: 'console.${name}' usage is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 2. No Explicit Any Policy
|
|
41
|
-
if (ts.isTypeReferenceNode(node)) {
|
|
42
|
-
if (ts.isIdentifier(node.typeName) && node.typeName.text === "any") {
|
|
43
|
-
if (!filePath.includes("definitions.ts") && !filePath.includes("types.ts")) {
|
|
44
|
-
errors.push(`❌ Corporate Compliance Breach: 'any' type is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 3. Zero UI Library Policy (No @chakra-ui, mui, @shadcn)
|
|
50
|
-
if (ts.isImportDeclaration(node)) {
|
|
51
|
-
const moduleSpecifier = node.moduleSpecifier;
|
|
52
|
-
if (ts.isStringLiteral(moduleSpecifier)) {
|
|
53
|
-
const forbiddenLibs = ["@chakra-ui", "mui", "@shadcn", "antd", "bootstrap"];
|
|
54
|
-
const lib = forbiddenLibs.find(l => moduleSpecifier.text.includes(l));
|
|
55
|
-
if (lib) {
|
|
56
|
-
errors.push(`❌ Corporate Compliance Breach: External UI library '${lib}' usage is FORBIDDEN at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}. Build atomic components manually instead.`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Handle 'any' as a keyword type (e.g., parameter: any)
|
|
62
|
-
if (node.kind === ts.SyntaxKind.AnyKeyword) {
|
|
63
|
-
if (!filePath.includes("definitions.ts") && !filePath.includes("types.ts")) {
|
|
64
|
-
errors.push(`❌ Corporate Compliance Breach: 'any' keyword is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
ts.forEachChild(node, visit);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
visit(sourceFile);
|
|
72
|
-
|
|
73
|
-
// 3. Hardcoded Secrets & PII Guard
|
|
74
|
-
const piiKeywords = [
|
|
75
|
-
{ regex: /API_KEY\s*=\s*['"][^'"]+['"]/i, msg: "Hardcoded API Key" },
|
|
76
|
-
{ regex: /SECRET\s*=\s*['"][^'"]+['"]/i, msg: "Hardcoded Secret" },
|
|
77
|
-
{ regex: /PASSWORD\s*=\s*['"][^'"]+['"]/i, msg: "Hardcoded Password" },
|
|
78
|
-
{ regex: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/, msg: "PII Detected: Email Address" },
|
|
79
|
-
{ regex: /\b\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}\b/, msg: "PII Detected: Credit Card Pattern" }
|
|
80
|
-
];
|
|
81
|
-
|
|
82
|
-
for (const { regex, msg } of piiKeywords) {
|
|
83
|
-
if (regex.test(content)) {
|
|
84
|
-
// Allow emails in specific files like README or package.json
|
|
85
|
-
if (msg.includes("Email") && (filePath.endsWith("README.md") || filePath.endsWith("package.json") || filePath.includes("CONTRIBUTING"))) {
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
errors.push(`❌ Corporate Compliance Breach: ${msg} detected.`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (errors.length > 0) {
|
|
93
|
-
throw new Error(errors.join("\n"));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { handleReplaceText } from "../../../src/tools/file_system/replace_text.js";
|
|
5
|
-
import { handlePatchFile } from "../../../src/tools/file_system/patch_file.js";
|
|
6
|
-
import { handleReadFile } from "../../../src/tools/file_system/read_file.js";
|
|
7
|
-
import { handleWriteFile } from "../../../src/tools/file_system/write_file.js";
|
|
8
|
-
import { ToolArgs } from "../../../src/tools/types.js";
|
|
9
|
-
|
|
10
|
-
import os from "os"; // Need to import os
|
|
11
|
-
|
|
12
|
-
let TEST_DIR: string; // Declare as let
|
|
13
|
-
let TEST_FILE: string;
|
|
14
|
-
let MEMORY_DIR: string;
|
|
15
|
-
let MEMORY_FILE: string;
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
TEST_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "fs-tools-test-")); // Unique temp dir
|
|
19
|
-
fs.mkdirSync(path.join(TEST_DIR, ".atabey"));
|
|
20
|
-
TEST_FILE = path.join(TEST_DIR, "test_file.txt");
|
|
21
|
-
MEMORY_DIR = path.join(TEST_DIR, ".atabey/memory");
|
|
22
|
-
MEMORY_FILE = path.join(MEMORY_DIR, "PROJECT_MEMORY.md");
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
afterEach(() => {
|
|
26
|
-
fs.rmSync(TEST_DIR, { recursive: true, force: true });
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe("File System Tools", () => {
|
|
30
|
-
|
|
31
|
-
describe("handleReplaceText", () => {
|
|
32
|
-
it("should replace a single occurrence of text", () => {
|
|
33
|
-
fs.writeFileSync(TEST_FILE, "hello world", "utf8");
|
|
34
|
-
const args: ToolArgs = {
|
|
35
|
-
path: TEST_FILE,
|
|
36
|
-
oldText: "world",
|
|
37
|
-
newText: "there",
|
|
38
|
-
};
|
|
39
|
-
const result = handleReplaceText(TEST_DIR, args as any);
|
|
40
|
-
expect(result.content[0].text).toContain("✅ Surgical edit successful in");
|
|
41
|
-
expect(fs.readFileSync(TEST_FILE, "utf8")).toBe("hello there\n");
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("should throw an error if text is not found", () => {
|
|
45
|
-
fs.writeFileSync(TEST_FILE, "hello world", "utf8");
|
|
46
|
-
const args: ToolArgs = {
|
|
47
|
-
path: TEST_FILE,
|
|
48
|
-
oldText: "missing",
|
|
49
|
-
newText: "found",
|
|
50
|
-
};
|
|
51
|
-
expect(() => handleReplaceText(TEST_DIR, args)).toThrowError("Text not found in file");
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it("should throw an error for ambiguous replacement if allowMultiple is false", () => {
|
|
55
|
-
fs.writeFileSync(TEST_FILE, "hello world world", "utf8");
|
|
56
|
-
const args: ToolArgs = {
|
|
57
|
-
path: TEST_FILE,
|
|
58
|
-
oldText: "world",
|
|
59
|
-
newText: "there",
|
|
60
|
-
allowMultiple: false,
|
|
61
|
-
};
|
|
62
|
-
expect(() => handleReplaceText(TEST_DIR, args)).toThrowError("Ambiguous replacement");
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it("should replace all occurrences of text if allowMultiple is true", () => {
|
|
66
|
-
fs.writeFileSync(TEST_FILE, "hello world world", "utf8");
|
|
67
|
-
const args: ToolArgs = {
|
|
68
|
-
path: TEST_FILE,
|
|
69
|
-
oldText: "world",
|
|
70
|
-
newText: "there",
|
|
71
|
-
allowMultiple: true,
|
|
72
|
-
};
|
|
73
|
-
const result = handleReplaceText(TEST_DIR, args as any);
|
|
74
|
-
expect(result.content[0].text).toContain("✅ Surgical edit successful in");
|
|
75
|
-
expect(fs.readFileSync(TEST_FILE, "utf8")).toBe("hello there there\n");
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("should log usage to metrics.json upon replace", () => {
|
|
79
|
-
fs.writeFileSync(TEST_FILE, "hello world", "utf8");
|
|
80
|
-
const args: ToolArgs = {
|
|
81
|
-
path: TEST_FILE,
|
|
82
|
-
oldText: "world",
|
|
83
|
-
newText: "there",
|
|
84
|
-
};
|
|
85
|
-
handleReplaceText(TEST_DIR, args);
|
|
86
|
-
const metricsPath = path.join(TEST_DIR, ".atabey/observability/metrics.json");
|
|
87
|
-
expect(fs.existsSync(metricsPath)).toBe(true);
|
|
88
|
-
const metrics = JSON.parse(fs.readFileSync(metricsPath, "utf8"));
|
|
89
|
-
expect(metrics[0].action).toContain("replace_text");
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
describe("handlePatchFile", () => {
|
|
94
|
-
it("should replace lines in specified range", () => {
|
|
95
|
-
fs.writeFileSync(TEST_FILE, "line1\nline2\nline3\nline4", "utf8");
|
|
96
|
-
const args: ToolArgs = {
|
|
97
|
-
path: TEST_FILE,
|
|
98
|
-
startLine: 2,
|
|
99
|
-
endLine: 3,
|
|
100
|
-
newContent: "patched2\npatched3",
|
|
101
|
-
};
|
|
102
|
-
const result = handlePatchFile(TEST_DIR, args);
|
|
103
|
-
expect(result.content[0].text).toContain("✅ File patched successfully");
|
|
104
|
-
expect(fs.readFileSync(TEST_FILE, "utf8")).toBe("line1\npatched2\npatched3\nline4");
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it("should throw an error for invalid start line", () => {
|
|
108
|
-
fs.writeFileSync(TEST_FILE, "line1\nline2", "utf8");
|
|
109
|
-
const args: ToolArgs = {
|
|
110
|
-
path: TEST_FILE,
|
|
111
|
-
startLine: 5,
|
|
112
|
-
endLine: 2,
|
|
113
|
-
newContent: "error",
|
|
114
|
-
};
|
|
115
|
-
expect(() => handlePatchFile(TEST_DIR, args)).toThrowError("Invalid start line");
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it("should throw an error for invalid end line", () => {
|
|
119
|
-
fs.writeFileSync(TEST_FILE, "line1\nline2", "utf8");
|
|
120
|
-
const args: ToolArgs = {
|
|
121
|
-
path: TEST_FILE,
|
|
122
|
-
startLine: 1,
|
|
123
|
-
endLine: 5,
|
|
124
|
-
newContent: "error",
|
|
125
|
-
};
|
|
126
|
-
expect(() => handlePatchFile(TEST_DIR, args)).toThrowError("Invalid end line");
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("should log usage to metrics.json upon patch", () => {
|
|
130
|
-
fs.writeFileSync(TEST_FILE, "line1\nline2\nline3\nline4", "utf8");
|
|
131
|
-
const args: ToolArgs = {
|
|
132
|
-
path: TEST_FILE,
|
|
133
|
-
startLine: 2,
|
|
134
|
-
endLine: 3,
|
|
135
|
-
newContent: "patched2\npatched3",
|
|
136
|
-
};
|
|
137
|
-
handlePatchFile(TEST_DIR, args as any);
|
|
138
|
-
const metricsPath = path.join(TEST_DIR, ".atabey/observability/metrics.json");
|
|
139
|
-
expect(fs.existsSync(metricsPath)).toBe(true);
|
|
140
|
-
const metrics = JSON.parse(fs.readFileSync(metricsPath, "utf8"));
|
|
141
|
-
expect(metrics[0].action).toContain("patch_file");
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
describe("handleReadFile", () => {
|
|
146
|
-
it("should read full file content", () => {
|
|
147
|
-
fs.writeFileSync(TEST_FILE, "hello world", "utf8");
|
|
148
|
-
const args: ToolArgs = { path: TEST_FILE };
|
|
149
|
-
const result = handleReadFile(TEST_DIR, args as any);
|
|
150
|
-
expect(result.content[0].text).toBe("hello world");
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it("should read sliced lines", () => {
|
|
154
|
-
fs.writeFileSync(TEST_FILE, "line1\nline2\nline3\nline4", "utf8");
|
|
155
|
-
const args: ToolArgs = {
|
|
156
|
-
path: TEST_FILE,
|
|
157
|
-
startLine: 2,
|
|
158
|
-
endLine: 3
|
|
159
|
-
};
|
|
160
|
-
const result = handleReadFile(TEST_DIR, args as any);
|
|
161
|
-
expect(result.content[0].text).toBe("line2\nline3");
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it("should truncate long files", () => {
|
|
165
|
-
const longContent = Array.from({ length: 1005 }, (_, i) => `line ${i + 1}`).join("\n");
|
|
166
|
-
fs.writeFileSync(TEST_FILE, longContent, "utf8");
|
|
167
|
-
const args: ToolArgs = { path: TEST_FILE };
|
|
168
|
-
const result = handleReadFile(TEST_DIR, args as any);
|
|
169
|
-
expect(result.content[0].text).toContain("TRUNCATED");
|
|
170
|
-
expect(result.content[0].text).toContain("line 1000");
|
|
171
|
-
expect(result.content[0].text).not.toContain("line 1001");
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
describe("handleWriteFile", () => {
|
|
176
|
-
it("should write new file and log usage", () => {
|
|
177
|
-
const args: ToolArgs = {
|
|
178
|
-
path: TEST_FILE,
|
|
179
|
-
content: "hello world"
|
|
180
|
-
};
|
|
181
|
-
const result = handleWriteFile(TEST_DIR, args);
|
|
182
|
-
expect(result.content[0].text).toContain("✅ File written:");
|
|
183
|
-
expect(fs.readFileSync(TEST_FILE, "utf8")).toBe("hello world\n");
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it("should write new file and log usage to metrics.json", () => {
|
|
187
|
-
const args: ToolArgs = {
|
|
188
|
-
path: TEST_FILE,
|
|
189
|
-
content: "hello world"
|
|
190
|
-
};
|
|
191
|
-
handleWriteFile(TEST_DIR, args);
|
|
192
|
-
const metricsPath = path.join(TEST_DIR, ".atabey/observability/metrics.json");
|
|
193
|
-
expect(fs.existsSync(metricsPath)).toBe(true);
|
|
194
|
-
const metrics = JSON.parse(fs.readFileSync(metricsPath, "utf8"));
|
|
195
|
-
expect(metrics[0].action).toContain("write_file");
|
|
196
|
-
expect(metrics[0].estimatedTokens).toBeGreaterThan(0);
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
it("should append update to PROJECT_MEMORY.md if it exists", () => {
|
|
200
|
-
fs.mkdirSync(MEMORY_DIR, { recursive: true });
|
|
201
|
-
fs.writeFileSync(MEMORY_FILE, "## CURRENT STATUS\n", "utf8");
|
|
202
|
-
const args: ToolArgs = {
|
|
203
|
-
path: TEST_FILE,
|
|
204
|
-
content: "hello world"
|
|
205
|
-
};
|
|
206
|
-
handleWriteFile(TEST_DIR, args);
|
|
207
|
-
const memoryContent = fs.readFileSync(MEMORY_FILE, "utf8");
|
|
208
|
-
expect(memoryContent).toContain("Auto-Update");
|
|
209
|
-
expect(memoryContent).toContain("wrote file");
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
});
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { handleSendAgentMessage } from "../../../src/tools/messaging/send_message.js";
|
|
5
|
-
import { ToolArgs } from "../../../src/tools/types.js";
|
|
6
|
-
|
|
7
|
-
const TEST_DIR = path.resolve(__dirname, "../../_temp_messaging_tests");
|
|
8
|
-
const MESSAGES_DIR = path.join(TEST_DIR, ".gemini/messages");
|
|
9
|
-
const BACKEND_LOCK_FILE = path.join(MESSAGES_DIR, "backend.lock");
|
|
10
|
-
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
fs.mkdirSync(TEST_DIR, { recursive: true });
|
|
13
|
-
// Write a dummy package.json to test directory to lock frameworkDir as .gemini
|
|
14
|
-
const dummyPkg = {
|
|
15
|
-
name: "test-pkg",
|
|
16
|
-
atabey: {
|
|
17
|
-
frameworkDir: ".gemini"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
fs.writeFileSync(path.join(TEST_DIR, "package.json"), JSON.stringify(dummyPkg, null, 2), "utf8");
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
afterEach(() => {
|
|
24
|
-
fs.rmSync(TEST_DIR, { recursive: true, force: true });
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
describe("Hermes Lock Protocol & Message sending", () => {
|
|
28
|
-
it("should successfully send message when lock is not present", async () => {
|
|
29
|
-
const args: ToolArgs = {
|
|
30
|
-
to: "@backend",
|
|
31
|
-
from: "@manager",
|
|
32
|
-
category: "ACTION",
|
|
33
|
-
content: "Build database models",
|
|
34
|
-
traceId: "T-123",
|
|
35
|
-
priority: "HIGH"
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
39
|
-
expect(result.content[0].text).toContain("✅ Message sent to @backend");
|
|
40
|
-
|
|
41
|
-
// Verify the message file contains the sent message
|
|
42
|
-
const messageFilePath = path.join(MESSAGES_DIR, "backend.json");
|
|
43
|
-
expect(fs.existsSync(messageFilePath)).toBe(true);
|
|
44
|
-
|
|
45
|
-
const content = fs.readFileSync(messageFilePath, "utf8");
|
|
46
|
-
const msg = JSON.parse(content.trim());
|
|
47
|
-
expect(msg.from).toBe("@manager");
|
|
48
|
-
expect(msg.to).toBe("@backend");
|
|
49
|
-
expect(msg.category).toBe("ACTION");
|
|
50
|
-
expect(msg.content).toBe("Build database models");
|
|
51
|
-
expect(msg.traceId).toBe("T-123");
|
|
52
|
-
expect(msg.priority).toBe("HIGH");
|
|
53
|
-
expect(msg.status).toBe("PENDING");
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("should retry and fail to send message if lock is kept busy", async () => {
|
|
57
|
-
// Prepare a busy lock file
|
|
58
|
-
fs.mkdirSync(MESSAGES_DIR, { recursive: true });
|
|
59
|
-
fs.writeFileSync(BACKEND_LOCK_FILE, "Locked by @test at " + new Date().toISOString(), "utf8");
|
|
60
|
-
|
|
61
|
-
const args: ToolArgs = {
|
|
62
|
-
to: "@backend",
|
|
63
|
-
from: "@manager",
|
|
64
|
-
category: "ACTION",
|
|
65
|
-
content: "Build database models",
|
|
66
|
-
traceId: "T-123"
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const startTime = Date.now();
|
|
70
|
-
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
71
|
-
const duration = Date.now() - startTime;
|
|
72
|
-
|
|
73
|
-
expect(result.isError).toBe(true);
|
|
74
|
-
expect(result.content[0].text).toContain("❌ Could not send message to @backend: Hermes lock is busy.");
|
|
75
|
-
// Retries takes 20 attempts with 500ms delay -> duration should be at least ~9000ms
|
|
76
|
-
expect(duration).toBeGreaterThanOrEqual(9000);
|
|
77
|
-
}, 15000);
|
|
78
|
-
|
|
79
|
-
it("should bypass and acquire lock if existing lock is stale (older than 10s)", async () => {
|
|
80
|
-
fs.mkdirSync(MESSAGES_DIR, { recursive: true });
|
|
81
|
-
// Set lock file mtime to 15 seconds ago
|
|
82
|
-
fs.writeFileSync(BACKEND_LOCK_FILE, "Locked by @test at " + new Date().toISOString(), "utf8");
|
|
83
|
-
const fifteenSecondsAgo = new Date(Date.now() - 15000);
|
|
84
|
-
fs.utimesSync(BACKEND_LOCK_FILE, fifteenSecondsAgo, fifteenSecondsAgo);
|
|
85
|
-
|
|
86
|
-
const args: ToolArgs = {
|
|
87
|
-
to: "@backend",
|
|
88
|
-
from: "@manager",
|
|
89
|
-
category: "ACTION",
|
|
90
|
-
content: "Build database models",
|
|
91
|
-
traceId: "T-123"
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
95
|
-
expect(result.content[0].text).toContain("✅ Message sent to @backend");
|
|
96
|
-
expect(fs.existsSync(BACKEND_LOCK_FILE)).toBe(false); // Lock should have been unlinked in finally
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it("should safely resolve concurrent messages and execute them in sequence", async () => {
|
|
100
|
-
const send1Promise = handleSendAgentMessage(TEST_DIR, {
|
|
101
|
-
to: "@backend",
|
|
102
|
-
from: "@manager",
|
|
103
|
-
category: "ACTION",
|
|
104
|
-
content: "Job 1",
|
|
105
|
-
traceId: "T-123"
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// Delay starting the second call slightly to make sure lock is acquired by Job 1 first
|
|
109
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
110
|
-
|
|
111
|
-
const send2Promise = handleSendAgentMessage(TEST_DIR, {
|
|
112
|
-
to: "@backend",
|
|
113
|
-
from: "@frontend",
|
|
114
|
-
category: "ACTION",
|
|
115
|
-
content: "Job 2",
|
|
116
|
-
traceId: "T-123"
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
const [res1, res2] = await Promise.all([send1Promise, send2Promise]);
|
|
120
|
-
|
|
121
|
-
expect(res1.isError).toBeFalsy();
|
|
122
|
-
expect(res2.isError).toBeFalsy();
|
|
123
|
-
expect(res1.content[0].text).toContain("✅ Message sent to @backend");
|
|
124
|
-
expect(res2.content[0].text).toContain("✅ Message sent to @backend");
|
|
125
|
-
|
|
126
|
-
// Verify both messages exist in order in the message log file
|
|
127
|
-
const messageFilePath = path.join(MESSAGES_DIR, "backend.json");
|
|
128
|
-
const lines = fs.readFileSync(messageFilePath, "utf8").trim().split("\n");
|
|
129
|
-
expect(lines.length).toBe(2);
|
|
130
|
-
|
|
131
|
-
const msg1 = JSON.parse(lines[0]);
|
|
132
|
-
const msg2 = JSON.parse(lines[1]);
|
|
133
|
-
expect(msg1.content).toBe("Job 1");
|
|
134
|
-
expect(msg2.content).toBe("Job 2");
|
|
135
|
-
});
|
|
136
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
-
import { handleCheckLint } from "../../../src/tools/quality/check_lint.js";
|
|
3
|
-
import { exec } from "child_process";
|
|
4
|
-
|
|
5
|
-
vi.mock("child_process");
|
|
6
|
-
|
|
7
|
-
describe("handleCheckLint", () => {
|
|
8
|
-
const projectRoot = "/fake/project";
|
|
9
|
-
|
|
10
|
-
afterEach(() => {
|
|
11
|
-
vi.clearAllMocks();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it("should execute the lint command and return output on success", async () => {
|
|
15
|
-
const args = {};
|
|
16
|
-
|
|
17
|
-
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
18
|
-
// @ts-expect-error: Mock implementation callback type is complex
|
|
19
|
-
callback(null, "All good!", "");
|
|
20
|
-
return {} as any;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const result = await handleCheckLint(projectRoot, args);
|
|
24
|
-
|
|
25
|
-
expect(exec).toHaveBeenCalledWith("npm run lint", { cwd: projectRoot, timeout: 60000 }, expect.any(Function));
|
|
26
|
-
expect(result.isError).toBeUndefined();
|
|
27
|
-
expect(result.content[0].text).toContain("All good!");
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("should execute the lint command and return output on failure (lint issues found)", async () => {
|
|
31
|
-
const args = {};
|
|
32
|
-
const lintErrorOutput = "Error: 2 problems (2 errors, 0 warnings)";
|
|
33
|
-
|
|
34
|
-
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
35
|
-
// @ts-expect-error: Mock implementation callback type is complex
|
|
36
|
-
callback({ code: 1, message: "Lint errors found" }, lintErrorOutput, "");
|
|
37
|
-
return {} as any;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const result = await handleCheckLint(projectRoot, args);
|
|
41
|
-
|
|
42
|
-
expect(exec).toHaveBeenCalledWith("npm run lint", { cwd: projectRoot, timeout: 60000 }, expect.any(Function));
|
|
43
|
-
expect(result.isError).toBe(true); // Implementation returns isError: true on failure
|
|
44
|
-
expect(result.content[0].text).toContain(lintErrorOutput);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
-
import { handleRunCommand } from "../../../src/tools/shell/run_command.js";
|
|
3
|
-
import { exec } from "child_process";
|
|
4
|
-
|
|
5
|
-
vi.mock("child_process");
|
|
6
|
-
|
|
7
|
-
describe("handleRunCommand", () => {
|
|
8
|
-
const projectRoot = "/fake/project";
|
|
9
|
-
|
|
10
|
-
afterEach(() => {
|
|
11
|
-
vi.clearAllMocks();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it("should execute an allowed command", async () => {
|
|
15
|
-
const args = { command: "git status" };
|
|
16
|
-
|
|
17
|
-
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
18
|
-
// @ts-expect-error: Mock implementation callback type is complex
|
|
19
|
-
callback(null, "On branch main", "");
|
|
20
|
-
return {} as any;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const result = await handleRunCommand(projectRoot, args);
|
|
24
|
-
|
|
25
|
-
expect(exec).toHaveBeenCalledWith("git status", { cwd: projectRoot, timeout: 30000 }, expect.any(Function));
|
|
26
|
-
expect(result.isError).toBeUndefined();
|
|
27
|
-
expect(result.content[0].text).toContain("On branch main");
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("should reject a disallowed command", async () => {
|
|
31
|
-
const args = { command: "rm -rf /" };
|
|
32
|
-
const result = await handleRunCommand(projectRoot, args);
|
|
33
|
-
|
|
34
|
-
expect(exec).not.toHaveBeenCalled();
|
|
35
|
-
expect(result.isError).toBe(true);
|
|
36
|
-
expect(result.content[0].text).toContain("Command not allowed");
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("should handle command failure", async () => {
|
|
40
|
-
const args = { command: "npm run build" };
|
|
41
|
-
|
|
42
|
-
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
43
|
-
// @ts-expect-error: Mock implementation callback type is complex
|
|
44
|
-
callback({ code: 1, message: "Build failed" }, "", "Error details");
|
|
45
|
-
return {} as any;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const result = await handleRunCommand(projectRoot, args);
|
|
49
|
-
|
|
50
|
-
expect(exec).toHaveBeenCalledWith("npm run build", { cwd: projectRoot, timeout: 30000 }, expect.any(Function));
|
|
51
|
-
expect(result.isError).toBe(true);
|
|
52
|
-
expect(result.content[0].text).toContain("Command failed with exit code 1");
|
|
53
|
-
expect(result.content[0].text).toContain("Error details");
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"rootDir": "src",
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"types": ["node"]
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*.ts"]
|
|
14
|
-
}
|