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,7 +1,6 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
|
-
|
|
5
4
|
import { getFrameworkDir, getMemoryPath, getConfiguredPaths, isFrameworkDevelopmentRepo, readState } from "../utils/memory.js";
|
|
6
5
|
import { getPackageVersion, getValidatorPath } from "../utils/pkg.js";
|
|
7
6
|
import { UI } from "../utils/ui.js";
|
|
@@ -9,25 +8,19 @@ import { logger } from "../../shared/logger.js";
|
|
|
9
8
|
import { scanProjectCompliance } from "../utils/compliance.js";
|
|
10
9
|
import { ALL_AGENTS } from "../../modules/agents/definitions.js";
|
|
11
10
|
import { detectActiveAgentLayouts, findAgentInstruction } from "../adapters/paths.js";
|
|
12
|
-
|
|
13
11
|
import { verifyApiContractCommand } from "./contract.js";
|
|
14
|
-
|
|
15
12
|
export async function checkCommand() {
|
|
16
13
|
UI.intent("Agent Atabey Health Check", `Checking system health and discipline rules (v${getPackageVersion()})...`);
|
|
17
14
|
let issues = 0;
|
|
18
|
-
|
|
19
15
|
const state = readState();
|
|
20
16
|
if (!state) {
|
|
21
17
|
UI.error("Memory state not found. Run 'init' first.");
|
|
22
18
|
return;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
const frameworkDir = getFrameworkDir();
|
|
26
21
|
const memoryPath = getMemoryPath();
|
|
27
22
|
const pathsMap = getConfiguredPaths();
|
|
28
|
-
|
|
29
23
|
UI.success(`Using framework dir: ${frameworkDir}`);
|
|
30
|
-
|
|
31
24
|
// --- Contract Gate (Phase 2+ Discipline) ---
|
|
32
25
|
if (["PHASE_2", "PHASE_3", "PHASE_4"].includes(state.phase)) {
|
|
33
26
|
console.warn("\n📝 Validating API Contracts (Phase 2+ Required)...");
|
|
@@ -36,30 +29,27 @@ export async function checkCommand() {
|
|
|
36
29
|
if (!contractOk) {
|
|
37
30
|
UI.error("Contract verification FAILED! You cannot be in Phase 2+ with unverified contracts.");
|
|
38
31
|
issues++;
|
|
39
|
-
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
40
34
|
UI.success("API Contracts verified and sealed.");
|
|
41
35
|
}
|
|
42
|
-
}
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
43
38
|
UI.error("Error during contract verification.");
|
|
44
39
|
issues++;
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
let knowledgeDir = "knowledge";
|
|
49
|
-
if (frameworkDir === ".github")
|
|
50
|
-
|
|
43
|
+
if (frameworkDir === ".github")
|
|
44
|
+
knowledgeDir = "instructions";
|
|
51
45
|
const constitutionPath = fs.existsSync(path.join(process.cwd(), "ATABEY.md")) ? "ATABEY.md" : path.join(frameworkDir, "ATABEY.md");
|
|
52
|
-
|
|
53
46
|
const rootPandaPath = path.join(process.cwd(), "panda.config.ts");
|
|
54
47
|
const appPandaPath = path.join(pathsMap.frontend, "panda.config.ts");
|
|
55
|
-
|
|
56
48
|
if (fs.existsSync(rootPandaPath)) {
|
|
57
49
|
UI.error(`Panda CSS config must NOT be at the root directory! Move it to '${pathsMap.frontend}/panda.config.ts'.`);
|
|
58
50
|
issues++;
|
|
59
51
|
}
|
|
60
|
-
|
|
61
52
|
const isFrameworkDevelopment = isFrameworkDevelopmentRepo();
|
|
62
|
-
|
|
63
53
|
const checks = [
|
|
64
54
|
{ name: "Constitution (ATABEY.md)", path: constitutionPath },
|
|
65
55
|
{ name: "Memory (PROJECT_MEMORY.md)", path: path.relative(process.cwd(), memoryPath) },
|
|
@@ -72,6 +62,8 @@ export async function checkCommand() {
|
|
|
72
62
|
{ name: "CRUD Governance Standards", path: path.join(frameworkDir, `${knowledgeDir}/crud-governance.md`) },
|
|
73
63
|
{ name: "Architecture Standards", path: path.join(frameworkDir, `${knowledgeDir}/architecture-standards.md`) },
|
|
74
64
|
{ name: "Frontend Standards", path: path.join(frameworkDir, `${knowledgeDir}/frontend-standards.md`) },
|
|
65
|
+
{ name: "Vite Standards", path: path.join(frameworkDir, `${knowledgeDir}/vite-standards.md`), optional: true },
|
|
66
|
+
{ name: "Next.js Standards", path: path.join(frameworkDir, `${knowledgeDir}/nextjs-standards.md`), optional: true },
|
|
75
67
|
{ name: "Tailwind Standards", path: path.join(frameworkDir, `${knowledgeDir}/tailwind-standards.md`), optional: true },
|
|
76
68
|
{ name: "Mobile Standards", path: path.join(frameworkDir, `${knowledgeDir}/mobile-standards.md`) },
|
|
77
69
|
{ name: "Security Standards", path: path.join(frameworkDir, `${knowledgeDir}/security-standards.md`) },
|
|
@@ -83,56 +75,56 @@ export async function checkCommand() {
|
|
|
83
75
|
...(isFrameworkDevelopment ? [{ name: "MCP Server", path: "framework-mcp/package.json" }] : []),
|
|
84
76
|
{ name: "Panda CSS Config", path: appPandaPath, optional: true },
|
|
85
77
|
];
|
|
86
|
-
|
|
87
78
|
for (const check of checks) {
|
|
88
79
|
const fullPath = path.isAbsolute(check.path) ? check.path : path.join(process.cwd(), check.path);
|
|
89
80
|
if (fs.existsSync(fullPath)) {
|
|
90
81
|
UI.success(`${check.name} found.`);
|
|
91
|
-
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
92
84
|
if (check.optional) {
|
|
93
85
|
UI.warning(`${check.name} MISSING! (${check.path}) [Optional]`);
|
|
94
|
-
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
95
88
|
UI.error(`${check.name} MISSING! (${check.path})`);
|
|
96
89
|
issues++;
|
|
97
90
|
}
|
|
98
91
|
}
|
|
99
92
|
}
|
|
100
|
-
|
|
101
93
|
// Agent Army Check
|
|
102
|
-
console.warn("\n
|
|
94
|
+
console.warn("\n[SECURITY] Running Agent Army Compliance...");
|
|
103
95
|
try {
|
|
104
96
|
const validatorScript = getValidatorPath();
|
|
105
97
|
execSync(`node "${validatorScript}"`, { stdio: "pipe" });
|
|
106
98
|
UI.success("Agent Army AL validation PASSED.");
|
|
107
|
-
}
|
|
108
|
-
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
const err = error;
|
|
109
102
|
UI.error(`Agent Army AL validation FAILED: ${err.message}`);
|
|
110
|
-
if (err.stderr)
|
|
103
|
+
if (err.stderr)
|
|
104
|
+
console.error(err.stderr.toString());
|
|
111
105
|
issues++;
|
|
112
106
|
}
|
|
113
|
-
|
|
114
107
|
// Agent Documentation Check (Live Integrity)
|
|
115
108
|
console.warn("\n📚 Checking Agent Integrity (Instructions)...");
|
|
116
|
-
|
|
117
109
|
const projectRoot = process.cwd();
|
|
118
110
|
const activeLayouts = detectActiveAgentLayouts(projectRoot);
|
|
119
|
-
|
|
120
111
|
if (activeLayouts.length > 0) {
|
|
121
112
|
UI.success(`Active agent layout(s): ${activeLayouts.join(", ")}`);
|
|
122
113
|
ALL_AGENTS.forEach((agent) => {
|
|
123
114
|
const found = findAgentInstruction(projectRoot, agent.name);
|
|
124
115
|
if (found) {
|
|
125
116
|
UI.success(`Instructions for @${agent.name} found at ${found}`);
|
|
126
|
-
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
127
119
|
UI.error(`Instructions for @${agent.name} MISSING! Run 'atabey init' to scaffold.`);
|
|
128
120
|
issues++;
|
|
129
121
|
}
|
|
130
122
|
});
|
|
131
|
-
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
132
125
|
UI.warning("No active agent instruction directory detected. Run 'atabey init [adapter]' first.");
|
|
133
126
|
issues++;
|
|
134
127
|
}
|
|
135
|
-
|
|
136
128
|
// Code Quality - Using the new Compliance Scanner
|
|
137
129
|
console.warn("\n⚖️ Checking Discipline (Code Quality)...");
|
|
138
130
|
const complianceIssues = scanProjectCompliance();
|
|
@@ -141,37 +133,37 @@ export async function checkCommand() {
|
|
|
141
133
|
UI.error(`${issue.rule} in ${issue.file}:${issue.line}`);
|
|
142
134
|
});
|
|
143
135
|
issues += complianceIssues.length;
|
|
144
|
-
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
145
138
|
UI.success("No compliance issues detected.");
|
|
146
139
|
}
|
|
147
|
-
|
|
148
140
|
const rootTestFiles = checkRootTestFiles();
|
|
149
141
|
if (rootTestFiles.length > 0) {
|
|
150
142
|
UI.warning(`Test files found in the root directory: ${rootTestFiles.join(", ")}. It is recommended to place all test files under the 'tests/' folder or application-specific directories.`);
|
|
151
143
|
}
|
|
152
|
-
|
|
153
144
|
try {
|
|
154
145
|
UI.intent("Type Check", "Running 'npx tsc --noEmit' (this may take a few seconds)...");
|
|
155
146
|
execSync("npx tsc --noEmit", { stdio: "pipe" });
|
|
156
147
|
UI.success("TypeScript type check PASSED.");
|
|
157
|
-
}
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
158
150
|
UI.warning("TypeScript type check FAILED or 'tsc' not found. This is a non-blocking warning for lightweight checks.");
|
|
159
151
|
logger.debug("npx tsc --noEmit check failed", err);
|
|
160
152
|
}
|
|
161
|
-
|
|
162
153
|
if (issues === 0) {
|
|
163
|
-
UI.success("\n
|
|
164
|
-
}
|
|
165
|
-
|
|
154
|
+
UI.success("\n[START] All systems green! Agent Atabey is ready.");
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
UI.error(`\n[WARN] Found ${issues} issues. Please fix them.`);
|
|
166
158
|
process.exit(1);
|
|
167
159
|
}
|
|
168
160
|
}
|
|
169
|
-
|
|
170
|
-
function checkRootTestFiles(): string[] {
|
|
161
|
+
function checkRootTestFiles() {
|
|
171
162
|
const rootDir = process.cwd();
|
|
172
|
-
if (!fs.existsSync(rootDir))
|
|
163
|
+
if (!fs.existsSync(rootDir))
|
|
164
|
+
return [];
|
|
173
165
|
const files = fs.readdirSync(rootDir);
|
|
174
|
-
const testFiles
|
|
166
|
+
const testFiles = [];
|
|
175
167
|
for (const file of files) {
|
|
176
168
|
const fullPath = path.join(rootDir, file);
|
|
177
169
|
try {
|
|
@@ -180,7 +172,8 @@ function checkRootTestFiles(): string[] {
|
|
|
180
172
|
testFiles.push(file);
|
|
181
173
|
}
|
|
182
174
|
}
|
|
183
|
-
}
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
184
177
|
logger.debug(`Failed to stat file ${fullPath} in checkRootTestFiles`, err);
|
|
185
178
|
}
|
|
186
179
|
}
|
package/{src/cli/commands/compliance.ts → framework-mcp/dist/src/cli/commands/compliance.js}
RENAMED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
|
|
4
3
|
import { collectFiles } from "../utils/fs.js";
|
|
5
|
-
|
|
6
4
|
const targetDir = process.cwd(); // Assuming targetDir is process.cwd() in the CLI context
|
|
7
|
-
|
|
8
|
-
export async function complianceCheckCommand(targetPath: string) {
|
|
5
|
+
export async function complianceCheckCommand(targetPath) {
|
|
9
6
|
console.warn(`📜 Checking Constitution Compliance: ${targetPath}...`);
|
|
10
|
-
const violations
|
|
7
|
+
const violations = [];
|
|
11
8
|
const forbidden = ["@shadcn", "mui", "@chakra-ui", "tailwindcss"];
|
|
12
|
-
|
|
13
9
|
// 1. package.json scan (Blind Spot 5)
|
|
14
10
|
const pkgJsonPath = path.join(targetDir, "package.json");
|
|
15
11
|
if (fs.existsSync(pkgJsonPath)) {
|
|
@@ -21,21 +17,20 @@ export async function complianceCheckCommand(targetPath: string) {
|
|
|
21
17
|
violations.push(`package.json: Forbidden library dependency '${lib}' found in package.json.`);
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
|
-
}
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
25
22
|
// ignore
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
// 2. Source files scan
|
|
30
26
|
const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx", ".js", ".jsx", ".md"]);
|
|
31
27
|
files.forEach(f => {
|
|
32
28
|
const isTypesFile = f.includes("brands.ts") || f.includes("brands.js") || f.includes("brands.tsx") || f.includes("src/types/brands");
|
|
33
|
-
|
|
34
29
|
const content = fs.readFileSync(f, "utf8");
|
|
35
30
|
forbidden.forEach(lib => {
|
|
36
|
-
if (content.includes(lib))
|
|
31
|
+
if (content.includes(lib))
|
|
32
|
+
violations.push(`${path.relative(targetDir, f)}: Forbidden library '${lib}' found.`);
|
|
37
33
|
});
|
|
38
|
-
|
|
39
34
|
// Robust Branded Types validation (Blind Spot 4)
|
|
40
35
|
if ((f.endsWith(".ts") || f.endsWith(".tsx")) && !isTypesFile && content.includes("interface")) {
|
|
41
36
|
const plainIdMatches = content.match(/\b\w*(?:id|Id|ID)\??\s*:\s*(?:string|number)\b/g);
|
|
@@ -46,10 +41,10 @@ export async function complianceCheckCommand(targetPath: string) {
|
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
43
|
});
|
|
49
|
-
|
|
50
44
|
if (violations.length === 0) {
|
|
51
|
-
console.warn("
|
|
52
|
-
}
|
|
53
|
-
|
|
45
|
+
console.warn("[OK] All systems compliant with ATABEY.md.");
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
violations.forEach(v => console.warn(`[ERROR] ${v}`));
|
|
54
49
|
}
|
|
55
50
|
}
|
|
@@ -3,41 +3,32 @@ import fs from "fs";
|
|
|
3
3
|
import { getConfiguredPaths } from "../utils/memory.js";
|
|
4
4
|
import { computeTypesHash, writeJsonFile } from "../utils/fs.js";
|
|
5
5
|
import { ValidationError } from "../../shared/errors.js";
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* Verify type safety between backend and frontend contracts.
|
|
9
8
|
*/
|
|
10
|
-
export async function verifyApiContractCommand(options
|
|
9
|
+
export async function verifyApiContractCommand(options = {}) {
|
|
11
10
|
const projectRoot = process.cwd();
|
|
12
11
|
const pathsMap = getConfiguredPaths();
|
|
13
12
|
const sharedDir = path.join(projectRoot, pathsMap.backend, "src/types");
|
|
14
13
|
const contractPath = path.join(projectRoot, pathsMap.backend, "contract.version.json");
|
|
15
|
-
|
|
16
14
|
if (!fs.existsSync(sharedDir) || !fs.existsSync(contractPath)) {
|
|
17
|
-
if (options.silent)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
null,
|
|
21
|
-
"Ensure you have initialized the project and the backend directory is correctly configured in config.json."
|
|
22
|
-
);
|
|
15
|
+
if (options.silent)
|
|
16
|
+
return false;
|
|
17
|
+
throw new ValidationError("API types or contract version file missing.", null, "Ensure you have initialized the project and the backend directory is correctly configured in config.json.");
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
const currentHash = computeTypesHash(projectRoot, sharedDir);
|
|
26
20
|
const contract = JSON.parse(fs.readFileSync(contractPath, "utf8"));
|
|
27
|
-
|
|
28
21
|
if (contract.contract_hash === currentHash) {
|
|
29
|
-
if (!options.silent)
|
|
22
|
+
if (!options.silent)
|
|
23
|
+
console.warn("[OK] Contract is valid and synchronized.");
|
|
30
24
|
return true;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"Run 'npx atabey update-contract' to re-synchronize the API contracts."
|
|
37
|
-
);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
if (options.silent)
|
|
28
|
+
return false;
|
|
29
|
+
throw new ValidationError("Contract drift detected!", { stored: contract.contract_hash, actual: currentHash }, "Run 'npx atabey update-contract' to re-synchronize the API contracts.");
|
|
38
30
|
}
|
|
39
31
|
}
|
|
40
|
-
|
|
41
32
|
/**
|
|
42
33
|
* Update and synchronize type safety between backend and frontend contracts.
|
|
43
34
|
*/
|
|
@@ -46,23 +37,14 @@ export async function updateApiContractCommand() {
|
|
|
46
37
|
const pathsMap = getConfiguredPaths();
|
|
47
38
|
const sharedDir = path.join(projectRoot, pathsMap.backend, "src/types");
|
|
48
39
|
const contractPath = path.join(projectRoot, pathsMap.backend, "contract.version.json");
|
|
49
|
-
|
|
50
40
|
if (!fs.existsSync(sharedDir)) {
|
|
51
|
-
throw new ValidationError(
|
|
52
|
-
"API types directory missing.",
|
|
53
|
-
null,
|
|
54
|
-
"The directory specified for backend types does not exist. Check your framework configuration."
|
|
55
|
-
);
|
|
41
|
+
throw new ValidationError("API types directory missing.", null, "The directory specified for backend types does not exist. Check your framework configuration.");
|
|
56
42
|
}
|
|
57
|
-
|
|
58
43
|
const currentHash = computeTypesHash(projectRoot, sharedDir);
|
|
59
|
-
|
|
60
44
|
const contractData = {
|
|
61
45
|
contract_hash: currentHash,
|
|
62
46
|
last_updated: new Date().toISOString()
|
|
63
47
|
};
|
|
64
|
-
|
|
65
48
|
writeJsonFile(contractPath, contractData);
|
|
66
|
-
console.warn(
|
|
49
|
+
console.warn(`[OK] Contract successfully synchronized. New hash: ${currentHash}`);
|
|
67
50
|
}
|
|
68
|
-
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import http from "http";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { getFrameworkDir } from "../utils/memory.js";
|
|
6
|
+
import { UI } from "../utils/ui.js";
|
|
7
|
+
import { FRAMEWORK } from "../../shared/constants.js";
|
|
8
|
+
/**
|
|
9
|
+
* Serves a JSON file.
|
|
10
|
+
*/
|
|
11
|
+
function serveJson(res, filePath) {
|
|
12
|
+
if (fs.existsSync(filePath)) {
|
|
13
|
+
try {
|
|
14
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
15
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
16
|
+
res.end(content);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
res.writeHead(500);
|
|
20
|
+
res.end(JSON.stringify({ error: "Read Error", message: e.message }));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
res.writeHead(404);
|
|
25
|
+
res.end(JSON.stringify({ error: "Not Found", path: filePath }));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Serves a file with specific content type.
|
|
30
|
+
*/
|
|
31
|
+
function serveFile(res, filePath, contentType) {
|
|
32
|
+
if (fs.existsSync(filePath)) {
|
|
33
|
+
try {
|
|
34
|
+
const content = fs.readFileSync(filePath);
|
|
35
|
+
res.writeHead(200, { "Content-Type": contentType });
|
|
36
|
+
res.end(content);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
res.writeHead(500);
|
|
40
|
+
res.end(e.message);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
res.writeHead(404);
|
|
45
|
+
res.end("Not Found");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 🖥️ Hermes Visual Control Plane (Dashboard Server)
|
|
50
|
+
* Serves the framework state as a JSON API and the bundled Web UI.
|
|
51
|
+
*/
|
|
52
|
+
export async function dashboardCommand(port = FRAMEWORK.DASHBOARD_PORT) {
|
|
53
|
+
const frameworkDir = getFrameworkDir();
|
|
54
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
55
|
+
const projectRoot = path.resolve(__dirname, "../../../");
|
|
56
|
+
const uiDistPath = path.join(projectRoot, "dist/ui");
|
|
57
|
+
const server = http.createServer((req, res) => {
|
|
58
|
+
// CORS Headers
|
|
59
|
+
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
60
|
+
res.setHeader("Access-Control-Allow-Methods", "GET, OPTIONS");
|
|
61
|
+
res.setHeader("Access-Control-Allow-Headers", "Content-Type");
|
|
62
|
+
if (req.method === "OPTIONS") {
|
|
63
|
+
res.writeHead(204);
|
|
64
|
+
res.end();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const url = req.url || "/";
|
|
68
|
+
// API Routes
|
|
69
|
+
if (url === "/api/status") {
|
|
70
|
+
const statusPath = path.join(frameworkDir, "memory", "status.json");
|
|
71
|
+
serveJson(res, statusPath);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (url === "/api/memory") {
|
|
75
|
+
const memoryPath = path.join(frameworkDir, "memory", "PROJECT_MEMORY.md");
|
|
76
|
+
serveFile(res, memoryPath, "text/markdown");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (url.startsWith("/api/logs/")) {
|
|
80
|
+
const agent = url.replace("/api/logs/", "");
|
|
81
|
+
const logPath = path.join(frameworkDir, "logs", `${agent}.json`);
|
|
82
|
+
serveJson(res, logPath);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (url === "/api/health") {
|
|
86
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
87
|
+
res.end(JSON.stringify({ status: "healthy", version: "0.0.6", frameworkDir }));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// Static UI Serving
|
|
91
|
+
let filePath = path.join(uiDistPath, url === "/" ? "index.html" : url);
|
|
92
|
+
// Fallback to index.html for SPA routing if file not found
|
|
93
|
+
if (!fs.existsSync(filePath) && !url.startsWith("/api")) {
|
|
94
|
+
filePath = path.join(uiDistPath, "index.html");
|
|
95
|
+
}
|
|
96
|
+
if (fs.existsSync(filePath) && !fs.statSync(filePath).isDirectory()) {
|
|
97
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
98
|
+
const mimeTypes = {
|
|
99
|
+
".html": "text/html",
|
|
100
|
+
".js": "application/javascript",
|
|
101
|
+
".css": "text/css",
|
|
102
|
+
".json": "application/json",
|
|
103
|
+
".png": "image/png",
|
|
104
|
+
".jpg": "image/jpg",
|
|
105
|
+
".gif": "image/gif",
|
|
106
|
+
".svg": "image/svg+xml",
|
|
107
|
+
".ico": "image/x-icon",
|
|
108
|
+
};
|
|
109
|
+
const contentType = mimeTypes[ext] || "application/octet-stream";
|
|
110
|
+
serveFile(res, filePath, contentType);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
114
|
+
res.end(JSON.stringify({ error: "Not Found", message: "Route not found" }));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
server.listen(port, () => {
|
|
118
|
+
UI.success("\n[START] Hermes Visual Control Plane is running!");
|
|
119
|
+
UI.success(`[INFO] Web UI: http://localhost:${port}`);
|
|
120
|
+
UI.success(`[DATA] API Base: http://localhost:${port}/api`);
|
|
121
|
+
UI.warning("\n(Press Ctrl+C to stop the server)\n");
|
|
122
|
+
});
|
|
123
|
+
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
|
|
4
3
|
import { collectFiles } from "../utils/fs.js";
|
|
5
|
-
|
|
6
4
|
const targetDir = process.cwd();
|
|
7
|
-
|
|
8
|
-
export async function explorerGraphCommand(targetPath: string) {
|
|
5
|
+
export async function explorerGraphCommand(targetPath) {
|
|
9
6
|
console.warn(`🗺️ Generating Dependency Graph for: ${targetPath}...`);
|
|
10
7
|
const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
|
|
11
|
-
const edges
|
|
8
|
+
const edges = [];
|
|
12
9
|
files.forEach((f) => {
|
|
13
10
|
const content = fs.readFileSync(f, "utf8");
|
|
14
11
|
const name = path.basename(f, path.extname(f));
|
|
@@ -20,26 +17,26 @@ export async function explorerGraphCommand(targetPath: string) {
|
|
|
20
17
|
});
|
|
21
18
|
if (edges.length === 0) {
|
|
22
19
|
console.warn("ℹ️ No internal dependencies found.");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.warn("```mermaid\ngraph TD\n" + Array.from(new Set(edges)).join("\n") + "\n```");
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
console.warn(`🧠 Codebase Intelligence Scan: ${targetPath}...`);
|
|
25
|
+
export async function explorerAuditCommand(targetPath) {
|
|
26
|
+
console.warn(`[MEMORY] Codebase Intelligence Scan: ${targetPath}...`);
|
|
32
27
|
const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
|
|
33
|
-
const complexity
|
|
28
|
+
const complexity = [];
|
|
34
29
|
files.forEach((f) => {
|
|
35
30
|
const content = fs.readFileSync(f, "utf8");
|
|
36
31
|
const lines = content.split("\n").length;
|
|
37
|
-
if (lines > 300)
|
|
32
|
+
if (lines > 300)
|
|
33
|
+
complexity.push(`${path.relative(targetDir, f)} (${lines} lines)`);
|
|
38
34
|
});
|
|
39
35
|
if (complexity.length > 0) {
|
|
40
|
-
console.warn("\n
|
|
36
|
+
console.warn("\n[WARN] Complexity Spikes:");
|
|
41
37
|
complexity.forEach((c) => console.warn(`- ${c}`));
|
|
42
|
-
}
|
|
43
|
-
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.warn("[OK] Codebase structure looks clean.");
|
|
44
41
|
}
|
|
45
42
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import cp from "child_process";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { getConfiguredPaths } from "../utils/memory.js";
|
|
4
|
-
|
|
5
|
-
export async function gitCommitCommand(traceId: string) {
|
|
4
|
+
export async function gitCommitCommand(traceId) {
|
|
6
5
|
try {
|
|
7
6
|
const diff = cp.execSync("git diff --staged", { encoding: "utf8" });
|
|
8
7
|
if (!diff) {
|
|
@@ -16,24 +15,26 @@ export async function gitCommitCommand(traceId: string) {
|
|
|
16
15
|
const backendTypesPath = path.join(pathsMap.backend, "src/types");
|
|
17
16
|
let type = "feat";
|
|
18
17
|
const scope = "code";
|
|
19
|
-
if (files.some((f) => f.includes(".md")))
|
|
20
|
-
|
|
21
|
-
else if (files.some((f) => f.includes(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
if (files.some((f) => f.includes(".md")))
|
|
19
|
+
type = "docs";
|
|
20
|
+
else if (files.some((f) => f.includes(backendTypesPath)))
|
|
21
|
+
type = "arch";
|
|
22
|
+
else if (files.some((f) => f.includes("bin/cli.js")))
|
|
23
|
+
type = "fix";
|
|
24
|
+
const summary = files.length === 1 ? `update ${path.basename(files[0])}` : `update ${files.length} files`;
|
|
25
25
|
console.warn(`\n### SUGGESTED COMMIT MESSAGE ###\n\n[${traceId}] ${type}(${scope}): ${summary}\n`);
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
console.warn("[ERROR] Git command failed.");
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
|
|
31
31
|
export async function gitSyncCommand() {
|
|
32
32
|
console.warn("🔄 Syncing with remote repository...");
|
|
33
33
|
try {
|
|
34
34
|
cp.execSync("git pull origin main --rebase", { stdio: "inherit" });
|
|
35
|
-
console.warn("
|
|
36
|
-
}
|
|
37
|
-
|
|
35
|
+
console.warn("[OK] Successfully synced and rebased.");
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
console.warn("[ERROR] Sync failed. Please resolve conflicts manually.");
|
|
38
39
|
}
|
|
39
40
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { UI } from "../../utils/ui.js";
|
|
4
|
+
import { writeTextFile } from "../../../shared/fs.js";
|
|
5
|
+
/**
|
|
6
|
+
* Plugin SDK: Creates a new custom agent template.
|
|
7
|
+
*/
|
|
8
|
+
export async function createAgentCommand(name) {
|
|
9
|
+
const projectRoot = process.cwd();
|
|
10
|
+
const agentsDir = path.join(projectRoot, "src/modules/agents/registry");
|
|
11
|
+
if (!fs.existsSync(agentsDir)) {
|
|
12
|
+
UI.error("Ajan kayıt dizini bulunamadı. Lütfen Atabey geliştirme ortamında olduğunuzdan emin olun.");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const filePath = path.join(agentsDir, `${name}.ts`);
|
|
16
|
+
if (fs.existsSync(filePath)) {
|
|
17
|
+
UI.error(`Ajan '${name}' zaten mevcut.`);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const template = `import { AgentDefinition } from "../types.js";
|
|
21
|
+
|
|
22
|
+
const STATE_MACHINE = "../schema/agent-lifecycle-schema.json" as const;
|
|
23
|
+
|
|
24
|
+
export const ${name}: AgentDefinition = {
|
|
25
|
+
name: "${name}",
|
|
26
|
+
displayName: "${name.charAt(0).toUpperCase() + name.slice(1)} Specialist",
|
|
27
|
+
role: "Custom Specialty",
|
|
28
|
+
description: "Automatically generated custom agent for specific project needs.",
|
|
29
|
+
capability: 7,
|
|
30
|
+
tier: "core",
|
|
31
|
+
tags: ["custom"],
|
|
32
|
+
stateMachine: STATE_MACHINE,
|
|
33
|
+
tools: [
|
|
34
|
+
"read_file",
|
|
35
|
+
"write_file",
|
|
36
|
+
"replace_text",
|
|
37
|
+
"grep_search",
|
|
38
|
+
"send_agent_message",
|
|
39
|
+
],
|
|
40
|
+
instructions: {
|
|
41
|
+
identity: "${name.toUpperCase()} Domain Expert",
|
|
42
|
+
mission: "Execute tasks related to ${name} with high precision and following Atabey standards.",
|
|
43
|
+
chainOfThought: "1. Analyze Task\\n2. Plan Steps\\n3. Execute\\n4. Verify",
|
|
44
|
+
rules: [
|
|
45
|
+
"Always maintain type safety.",
|
|
46
|
+
"Log all critical actions.",
|
|
47
|
+
],
|
|
48
|
+
knowledgeFiles: [],
|
|
49
|
+
},
|
|
50
|
+
specialties: {
|
|
51
|
+
${name}: 10,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
`;
|
|
55
|
+
writeTextFile(filePath, template);
|
|
56
|
+
UI.success(`[OK] New agent '${name}' created at src/modules/agents/registry/${name}.ts`);
|
|
57
|
+
UI.warning("[INFO] Don't forget to register the agent in src/modules/agents/definitions.ts");
|
|
58
|
+
}
|