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
package/{src/cli/utils/config-schema.ts → framework-mcp/dist/src/cli/utils/config-schema.js}
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Standard Color Palette Schema
|
|
5
4
|
*/
|
|
@@ -8,7 +7,6 @@ export const ColorPaletteSchema = z.object({
|
|
|
8
7
|
secondary: z.string().regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/),
|
|
9
8
|
accent: z.string().regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/),
|
|
10
9
|
});
|
|
11
|
-
|
|
12
10
|
/**
|
|
13
11
|
* Agent Atabey config.json Schema
|
|
14
12
|
*/
|
|
@@ -32,7 +30,6 @@ export const ConfigSchema = z.object({
|
|
|
32
30
|
tests: "tests"
|
|
33
31
|
})
|
|
34
32
|
});
|
|
35
|
-
|
|
36
33
|
/**
|
|
37
34
|
* MCP mcp.json Schema
|
|
38
35
|
*/
|
|
@@ -43,6 +40,3 @@ export const McpConfigSchema = z.object({
|
|
|
43
40
|
env: z.record(z.string()).optional()
|
|
44
41
|
}))
|
|
45
42
|
});
|
|
46
|
-
|
|
47
|
-
export type AtabeyConfig = z.infer<typeof ConfigSchema>;
|
|
48
|
-
export type McpConfig = z.infer<typeof McpConfigSchema>;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import crypto from "crypto";
|
|
4
|
-
|
|
5
4
|
import { remapFrameworkContent } from "../adapters/index.js"; // Import from the new adapters.js
|
|
6
|
-
import type { AdapterId } from "../adapters/index.js";
|
|
7
5
|
import { ensureDir, writeTextFile, writeJsonFile, appendFile } from "../../shared/fs.js";
|
|
8
|
-
|
|
9
6
|
export { ensureDir, writeTextFile, writeJsonFile, appendFile };
|
|
10
|
-
|
|
11
|
-
export function updateGitIgnore(targetPath: string, frameworkDir = ".atabey", dryRun = false): void {
|
|
7
|
+
export function updateGitIgnore(targetPath, frameworkDir = ".atabey", dryRun = false) {
|
|
12
8
|
const IGNORE_LINES = [
|
|
13
9
|
"# Agent Atabey",
|
|
14
10
|
`${frameworkDir}/logs/*.json`,
|
|
@@ -17,60 +13,38 @@ export function updateGitIgnore(targetPath: string, frameworkDir = ".atabey", dr
|
|
|
17
13
|
".env",
|
|
18
14
|
".DS_Store",
|
|
19
15
|
];
|
|
20
|
-
|
|
21
16
|
let content = "";
|
|
22
17
|
if (fs.existsSync(targetPath)) {
|
|
23
18
|
content = fs.readFileSync(targetPath, "utf8");
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
const lines = content.split("\n").map((l) => l.trim());
|
|
27
21
|
let added = false;
|
|
28
|
-
|
|
29
22
|
for (const line of IGNORE_LINES) {
|
|
30
23
|
if (!lines.includes(line)) {
|
|
31
24
|
content += (content.endsWith("\n") || content === "" ? "" : "\n") + line + "\n";
|
|
32
25
|
added = true;
|
|
33
26
|
}
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
if (added) {
|
|
37
29
|
if (dryRun) {
|
|
38
30
|
console.warn(`[DRY RUN] Would update .gitignore at ${targetPath}`);
|
|
39
|
-
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
40
33
|
writeTextFile(targetPath, content);
|
|
41
|
-
console.warn("
|
|
34
|
+
console.warn("[OK] .gitignore updated.");
|
|
42
35
|
}
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
interface SanitizeJsonFunction {
|
|
48
|
-
(obj: unknown, targetScope?: string): unknown;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function copyDir(
|
|
52
|
-
src: string,
|
|
53
|
-
dest: string,
|
|
54
|
-
skipSet = new Set<string>(),
|
|
55
|
-
nonDestructive = false,
|
|
56
|
-
frameworkDir = ".gemini",
|
|
57
|
-
targetScope = "",
|
|
58
|
-
sanitizeJson: SanitizeJsonFunction,
|
|
59
|
-
adapterId: AdapterId = "gemini",
|
|
60
|
-
dryRun = false,
|
|
61
|
-
): void {
|
|
38
|
+
export function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, frameworkDir = ".gemini", targetScope = "", sanitizeJson, adapterId = "gemini", dryRun = false) {
|
|
62
39
|
const DEFAULT_SKIP = new Set(["node_modules", ".git", ".DS_Store", "package-lock.json"]);
|
|
63
40
|
const actualSkip = new Set([...DEFAULT_SKIP, ...skipSet]);
|
|
64
|
-
|
|
65
41
|
if (!fs.existsSync(dest) && !dryRun) {
|
|
66
42
|
fs.mkdirSync(dest, { recursive: true });
|
|
67
43
|
}
|
|
68
|
-
|
|
69
44
|
fs.readdirSync(src, { withFileTypes: true }).forEach((entry) => {
|
|
70
|
-
if (actualSkip.has(entry.name))
|
|
71
|
-
|
|
45
|
+
if (actualSkip.has(entry.name))
|
|
46
|
+
return;
|
|
72
47
|
const srcPath = path.join(src, entry.name);
|
|
73
|
-
|
|
74
48
|
// Physical folder remapping during copy.
|
|
75
49
|
// In unified mode (frameworkDir === ".atabey") folder names are always standard —
|
|
76
50
|
// agents/ stays agents/, knowledge/ stays knowledge/.
|
|
@@ -78,66 +52,60 @@ export function copyDir(
|
|
|
78
52
|
let effectiveEntryName = entry.name;
|
|
79
53
|
if (entry.isDirectory() && frameworkDir !== ".atabey") {
|
|
80
54
|
if (entry.name === "agents") {
|
|
81
|
-
if (adapterId === "antigravity-cli")
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
55
|
+
if (adapterId === "antigravity-cli")
|
|
56
|
+
effectiveEntryName = "skills";
|
|
57
|
+
else if (adapterId === "grok")
|
|
58
|
+
effectiveEntryName = "plugins";
|
|
59
|
+
}
|
|
60
|
+
else if (entry.name === "knowledge") {
|
|
61
|
+
if (adapterId === "antigravity-cli")
|
|
62
|
+
effectiveEntryName = "rules";
|
|
85
63
|
}
|
|
86
64
|
}
|
|
87
|
-
|
|
88
65
|
const destPath = path.join(dest, effectiveEntryName);
|
|
89
|
-
|
|
90
66
|
if (entry.isDirectory()) {
|
|
91
|
-
copyDir(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
skipSet,
|
|
95
|
-
nonDestructive,
|
|
96
|
-
frameworkDir,
|
|
97
|
-
targetScope,
|
|
98
|
-
sanitizeJson,
|
|
99
|
-
adapterId,
|
|
100
|
-
dryRun,
|
|
101
|
-
);
|
|
102
|
-
} else {
|
|
67
|
+
copyDir(srcPath, destPath, skipSet, nonDestructive, frameworkDir, targetScope, sanitizeJson, adapterId, dryRun);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
103
70
|
if (nonDestructive && fs.existsSync(destPath)) {
|
|
104
71
|
return;
|
|
105
72
|
}
|
|
106
|
-
|
|
107
73
|
const ext = path.extname(entry.name);
|
|
108
74
|
const textExtensions = [".md", ".json", ".js", ".ts", ".txt", ""];
|
|
109
|
-
|
|
110
75
|
if (textExtensions.includes(ext)) {
|
|
111
76
|
let content = fs.readFileSync(srcPath, "utf8");
|
|
112
77
|
content = remapFrameworkContent(content, frameworkDir, adapterId); // Use the new remap function
|
|
113
|
-
|
|
114
78
|
if (ext === ".json") {
|
|
115
79
|
try {
|
|
116
80
|
const json = JSON.parse(content);
|
|
117
81
|
writeJsonFile(destPath, sanitizeJson(json, targetScope), dryRun);
|
|
118
|
-
}
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
119
84
|
const fallback = content.replace(/workspace:[^"'\s]*/g, "*");
|
|
120
85
|
writeTextFile(destPath, fallback, dryRun);
|
|
121
86
|
}
|
|
122
|
-
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
123
89
|
content = content.replace(/workspace:[^"'\s]*/g, "*");
|
|
124
90
|
content = remapFrameworkContent(content, frameworkDir, adapterId); // Apply remap once to the final content
|
|
125
91
|
writeTextFile(destPath, content, dryRun);
|
|
126
92
|
}
|
|
127
|
-
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
128
95
|
if (dryRun) {
|
|
129
96
|
console.warn(`[DRY RUN] Would copy binary file: ${destPath}`);
|
|
130
|
-
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
131
99
|
fs.copyFileSync(srcPath, destPath);
|
|
132
100
|
}
|
|
133
101
|
}
|
|
134
102
|
}
|
|
135
103
|
});
|
|
136
104
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
105
|
+
export function collectFiles(dir, extensions) {
|
|
106
|
+
let results = [];
|
|
107
|
+
if (!fs.existsSync(dir))
|
|
108
|
+
return results;
|
|
141
109
|
const list = fs.readdirSync(dir);
|
|
142
110
|
list.forEach((file) => {
|
|
143
111
|
file = path.join(dir, file);
|
|
@@ -146,19 +114,18 @@ export function collectFiles(dir: string, extensions: string[]): string[] {
|
|
|
146
114
|
if (!file.includes("node_modules") && !file.includes(".git")) {
|
|
147
115
|
results = results.concat(collectFiles(file, extensions));
|
|
148
116
|
}
|
|
149
|
-
}
|
|
117
|
+
}
|
|
118
|
+
else if (extensions.includes(path.extname(file))) {
|
|
150
119
|
results.push(file);
|
|
151
120
|
}
|
|
152
121
|
});
|
|
153
122
|
return results;
|
|
154
123
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const walk = (d: string): string[] => fs.readdirSync(d, { withFileTypes: true }).flatMap((e) => {
|
|
124
|
+
export function computeTypesHash(projectRoot, sharedDir) {
|
|
125
|
+
const walk = (d) => fs.readdirSync(d, { withFileTypes: true }).flatMap((e) => {
|
|
158
126
|
const fullPath = path.join(d, e.name);
|
|
159
127
|
return e.isDirectory() ? walk(fullPath) : (e.name.endsWith(".ts") ? [fullPath] : []);
|
|
160
128
|
});
|
|
161
|
-
|
|
162
129
|
const hash = crypto.createHash("sha256");
|
|
163
130
|
for (const filePath of walk(sharedDir).sort()) {
|
|
164
131
|
hash.update(path.relative(projectRoot, filePath));
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
export interface Translations {
|
|
4
|
-
welcome: string;
|
|
5
|
-
select_backend: string;
|
|
6
|
-
select_language: string;
|
|
7
|
-
select_dirs: string;
|
|
8
|
-
select_agents: string;
|
|
9
|
-
select_palette: string;
|
|
10
|
-
init_success: string;
|
|
11
|
-
constitution_title: string;
|
|
12
|
-
status_title: string;
|
|
13
|
-
agent_ready: string;
|
|
14
|
-
next_steps: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const TRANSLATIONS: Record<SupportedLanguage, Translations> = {
|
|
1
|
+
export const TRANSLATIONS = {
|
|
18
2
|
tr: {
|
|
19
3
|
welcome: "Agent Atabey İnteraktif Kuruluma Hoş Geldiniz!",
|
|
20
4
|
select_backend: "Kurumsal Backend Dilini Seçin",
|
|
5
|
+
select_frontend: "Kurumsal Frontend Altyapısını Seçin",
|
|
21
6
|
select_language: "Framework İletişim Dilini Seçin",
|
|
22
7
|
select_dirs: "Dahil edilecek framework dizinlerini seçin (örn: 1,2,3) veya HEPSİ için Enter:",
|
|
23
8
|
select_agents: "Dahil edilecek çekirdek ajanları seçin (örn: 1,2) veya HEPSİ için Enter:",
|
|
@@ -31,6 +16,7 @@ export const TRANSLATIONS: Record<SupportedLanguage, Translations> = {
|
|
|
31
16
|
en: {
|
|
32
17
|
welcome: "Welcome to Agent Atabey Interactive Setup!",
|
|
33
18
|
select_backend: "Select Enterprise Backend Language",
|
|
19
|
+
select_frontend: "Select Enterprise Frontend Framework/Build Tool",
|
|
34
20
|
select_language: "Select Framework Communication Language",
|
|
35
21
|
select_dirs: "Enter directory numbers to include (e.g. 1,2,3) or Enter for ALL:",
|
|
36
22
|
select_agents: "Enter agent numbers to include (e.g. 1,2) or Enter for ALL:",
|
|
@@ -3,36 +3,29 @@ import os from "os";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { logger } from "../../shared/logger.js";
|
|
5
5
|
import { ensureDir, writeTextFile, writeJsonFile } from "../../shared/fs.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
FRAMEWORK,
|
|
10
|
-
FRAMEWORK_DIR_CANDIDATES,
|
|
11
|
-
MCP,
|
|
12
|
-
} from "../../shared/constants.js";
|
|
13
|
-
|
|
6
|
+
import { Storage } from "../../shared/storage.js";
|
|
7
|
+
import { FRAMEWORK, FRAMEWORK_DIR_CANDIDATES, MCP, } from "../../shared/constants.js";
|
|
14
8
|
export { generateULID } from "./time.js";
|
|
15
|
-
|
|
16
9
|
const CWD = process.cwd();
|
|
17
10
|
const HOME = os.homedir();
|
|
18
|
-
|
|
19
|
-
function findFrameworkDir(basePath: string): string | null {
|
|
11
|
+
function findFrameworkDir(basePath) {
|
|
20
12
|
try {
|
|
21
13
|
const pkgPath = path.join(basePath, "package.json");
|
|
22
14
|
if (fs.existsSync(pkgPath)) {
|
|
23
15
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
24
16
|
if (pkg.atabey && typeof pkg.atabey.frameworkDir === "string") {
|
|
25
17
|
const customDir = path.join(basePath, pkg.atabey.frameworkDir);
|
|
26
|
-
if (fs.existsSync(customDir))
|
|
18
|
+
if (fs.existsSync(customDir))
|
|
19
|
+
return customDir;
|
|
27
20
|
}
|
|
28
21
|
}
|
|
29
|
-
}
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
30
24
|
logger.debug("Failed to read package.json in findFrameworkDir", err);
|
|
31
25
|
}
|
|
32
26
|
return null;
|
|
33
27
|
}
|
|
34
|
-
|
|
35
|
-
export function isFrameworkDevelopmentRepo(): boolean {
|
|
28
|
+
export function isFrameworkDevelopmentRepo() {
|
|
36
29
|
try {
|
|
37
30
|
const pkgPath = path.join(CWD, "package.json");
|
|
38
31
|
if (fs.existsSync(pkgPath)) {
|
|
@@ -41,53 +34,48 @@ export function isFrameworkDevelopmentRepo(): boolean {
|
|
|
41
34
|
return true;
|
|
42
35
|
}
|
|
43
36
|
}
|
|
44
|
-
}
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
45
39
|
logger.debug("Failed to read package.json in isFrameworkDevelopmentRepo", err);
|
|
46
40
|
}
|
|
47
41
|
return false;
|
|
48
42
|
}
|
|
49
|
-
|
|
50
|
-
export function getLocalFrameworkDir(): string {
|
|
43
|
+
export function getLocalFrameworkDir() {
|
|
51
44
|
const localDir = findFrameworkDir(CWD);
|
|
52
45
|
return localDir || path.join(CWD, FRAMEWORK.CORE_DIR);
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
export function getConfigDir(): string {
|
|
47
|
+
export function getConfigDir() {
|
|
56
48
|
const localDir = findFrameworkDir(CWD);
|
|
57
|
-
if (localDir)
|
|
58
|
-
|
|
49
|
+
if (localDir)
|
|
50
|
+
return localDir;
|
|
59
51
|
// Check for standard local directories if package.json doesn't specify
|
|
60
|
-
const localCandidates = [...FRAMEWORK_DIR_CANDIDATES, ".agent"]
|
|
52
|
+
const localCandidates = [...FRAMEWORK_DIR_CANDIDATES, ".agent"];
|
|
61
53
|
for (const cand of localCandidates) {
|
|
62
54
|
const p = path.join(CWD, cand);
|
|
63
|
-
if (fs.existsSync(p))
|
|
55
|
+
if (fs.existsSync(p))
|
|
56
|
+
return p;
|
|
64
57
|
}
|
|
65
|
-
|
|
66
58
|
// In dev repo, don't fall back to global dir. Point to local default.
|
|
67
59
|
if (isFrameworkDevelopmentRepo()) {
|
|
68
60
|
return path.join(CWD, FRAMEWORK.CORE_DIR);
|
|
69
61
|
}
|
|
70
|
-
|
|
71
62
|
return path.join(HOME, FRAMEWORK.CORE_DIR);
|
|
72
63
|
}
|
|
73
|
-
|
|
74
|
-
export function getFrameworkDir(): string {
|
|
64
|
+
export function getFrameworkDir() {
|
|
75
65
|
const testDir = process.env[MCP.TEST_DIR_ENV];
|
|
76
|
-
if (testDir)
|
|
66
|
+
if (testDir)
|
|
67
|
+
return testDir;
|
|
77
68
|
return getConfigDir();
|
|
78
69
|
}
|
|
79
|
-
|
|
80
70
|
export function getDocumentStorePath() {
|
|
81
71
|
const frameworkDir = getFrameworkDir();
|
|
82
72
|
return path.join(frameworkDir, "memory");
|
|
83
73
|
}
|
|
84
|
-
|
|
85
|
-
export function initDocumentStore(frameworkDir?: string) {
|
|
74
|
+
export function initDocumentStore(frameworkDir) {
|
|
86
75
|
const storePath = frameworkDir ? path.join(frameworkDir, "memory") : getDocumentStorePath();
|
|
87
76
|
ensureDir(storePath);
|
|
88
77
|
ensureDir(path.join(storePath, "tasks"));
|
|
89
78
|
ensureDir(path.join(storePath, "history"));
|
|
90
|
-
|
|
91
79
|
const stateFile = path.join(storePath, "state.json");
|
|
92
80
|
if (!fs.existsSync(stateFile)) {
|
|
93
81
|
writeJsonFile(stateFile, { phase: "PHASE_0", traceId: "T-000", managerState: "ACTIVE" });
|
|
@@ -96,62 +84,59 @@ export function initDocumentStore(frameworkDir?: string) {
|
|
|
96
84
|
if (!fs.existsSync(statusFile)) {
|
|
97
85
|
writeJsonFile(statusFile, {});
|
|
98
86
|
}
|
|
99
|
-
|
|
87
|
+
// Initialize SQLite
|
|
88
|
+
Storage.setMetadata("phase", "PHASE_0");
|
|
89
|
+
Storage.setMetadata("traceId", "T-000");
|
|
90
|
+
Storage.setMetadata("managerState", "ACTIVE");
|
|
100
91
|
// Ensure the initial Markdown view is created
|
|
101
92
|
syncMarkdownMemory(frameworkDir);
|
|
102
93
|
}
|
|
103
|
-
|
|
104
94
|
export function readState() {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
const phase = Storage.getMetadata("phase") || "PHASE_0";
|
|
96
|
+
const traceId = Storage.getMetadata("traceId") || "T-000";
|
|
97
|
+
const managerState = Storage.getMetadata("managerState") || "ACTIVE";
|
|
98
|
+
return { phase, traceId, managerState };
|
|
108
99
|
}
|
|
109
|
-
|
|
110
100
|
export function readStatus() {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
101
|
+
const agents = Storage.getAllAgents();
|
|
102
|
+
const status = {};
|
|
103
|
+
agents.forEach((a) => {
|
|
104
|
+
const name = a.name.startsWith("@") ? a.name : `@${a.name}`;
|
|
105
|
+
status[name] = { state: a.state, task: a.task, lastUpdated: a.last_updated };
|
|
106
|
+
});
|
|
107
|
+
return status;
|
|
114
108
|
}
|
|
115
|
-
|
|
116
109
|
export function listTasks() {
|
|
117
|
-
|
|
118
|
-
if (!fs.existsSync(tasksPath)) return [];
|
|
119
|
-
|
|
120
|
-
return fs.readdirSync(tasksPath)
|
|
121
|
-
.filter(f => f.endsWith(".json"))
|
|
122
|
-
.map(f => JSON.parse(fs.readFileSync(path.join(tasksPath, f), "utf8")));
|
|
110
|
+
return Storage.getTasks();
|
|
123
111
|
}
|
|
124
|
-
|
|
125
|
-
export function getMemoryPath(): string {
|
|
112
|
+
export function getMemoryPath() {
|
|
126
113
|
return path.join(getDocumentStorePath(), "state.json");
|
|
127
114
|
}
|
|
128
|
-
|
|
129
|
-
export function readActiveTraceId(memoryContent: string): string | null {
|
|
115
|
+
export function readActiveTraceId(memoryContent) {
|
|
130
116
|
try {
|
|
131
117
|
const state = JSON.parse(memoryContent);
|
|
132
118
|
return state.traceId || null;
|
|
133
|
-
}
|
|
119
|
+
}
|
|
120
|
+
catch (_e) { /* ignore */
|
|
134
121
|
return null;
|
|
135
122
|
}
|
|
136
123
|
}
|
|
137
|
-
|
|
138
|
-
export function updateProjectMemory(section: string, content: string) {
|
|
124
|
+
export function updateProjectMemory(section, content) {
|
|
139
125
|
if (section === "HISTORY") {
|
|
140
126
|
updateDocumentStore("history", { content }, new Date().toISOString().replace(/[:.]/g, "-"));
|
|
141
|
-
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
142
129
|
const state = readState() || {};
|
|
143
130
|
state[section] = content;
|
|
144
131
|
updateDocumentStore("state", state);
|
|
145
132
|
}
|
|
146
133
|
}
|
|
147
|
-
|
|
148
|
-
export function initializeMemory(memoryPathOrBase: string, targetBaseOrDryRun?: string | boolean): void {
|
|
134
|
+
export function initializeMemory(memoryPathOrBase, targetBaseOrDryRun) {
|
|
149
135
|
const targetBase = typeof targetBaseOrDryRun === "string" ? targetBaseOrDryRun : memoryPathOrBase;
|
|
150
136
|
initDocumentStore(targetBase);
|
|
151
|
-
logger.info("
|
|
137
|
+
logger.info("[OK] Document store initialized.");
|
|
152
138
|
}
|
|
153
|
-
|
|
154
|
-
export function getConfiguredPaths(): { backend: string; frontend: string; mobile: string; docs: string; tests: string } {
|
|
139
|
+
export function getConfiguredPaths() {
|
|
155
140
|
const defaultPaths = { backend: "apps/backend", frontend: "apps/web", mobile: "apps/mobile", docs: "docs", tests: "tests" };
|
|
156
141
|
try {
|
|
157
142
|
const frameworkDir = getConfigDir();
|
|
@@ -160,65 +145,64 @@ export function getConfiguredPaths(): { backend: string; frontend: string; mobil
|
|
|
160
145
|
const rawConfig = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
161
146
|
return rawConfig.paths || defaultPaths;
|
|
162
147
|
}
|
|
163
|
-
}
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
164
150
|
logger.debug("Critical config read failure", err);
|
|
165
151
|
}
|
|
166
152
|
return defaultPaths;
|
|
167
153
|
}
|
|
168
|
-
|
|
169
|
-
export function updateDocumentStore(type: "state" | "task" | "history" | "status", data: unknown, id?: string | TraceID, frameworkDir?: string) {
|
|
154
|
+
export function updateDocumentStore(type, data, id, frameworkDir) {
|
|
170
155
|
const storePath = frameworkDir ? path.join(frameworkDir, "memory") : getDocumentStorePath();
|
|
171
156
|
ensureDir(storePath);
|
|
172
|
-
|
|
173
157
|
switch (type) {
|
|
174
158
|
case "state":
|
|
175
|
-
StateSchema.parse(data);
|
|
176
159
|
writeJsonFile(path.join(storePath, "state.json"), data);
|
|
177
160
|
break;
|
|
178
|
-
case "status":
|
|
179
|
-
|
|
180
|
-
|
|
161
|
+
case "status": {
|
|
162
|
+
const status = data;
|
|
163
|
+
for (const [agent, info] of Object.entries(status)) {
|
|
164
|
+
Storage.updateAgentStatus(agent, info.state, info.task, info.lastUpdated);
|
|
165
|
+
}
|
|
181
166
|
break;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
writeJsonFile(path.join(storePath, "tasks", `${id}.json`), data);
|
|
167
|
+
}
|
|
168
|
+
case "task": {
|
|
169
|
+
Storage.saveTask(data);
|
|
186
170
|
break;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
171
|
+
}
|
|
172
|
+
case "history": {
|
|
173
|
+
const db = Storage.getDB();
|
|
174
|
+
db.prepare(`
|
|
175
|
+
INSERT INTO logs (agent, action, summary)
|
|
176
|
+
VALUES (?, ?, ?)
|
|
177
|
+
`).run("@manager", "HISTORY_UPDATE", data.content);
|
|
190
178
|
break;
|
|
179
|
+
}
|
|
191
180
|
}
|
|
192
|
-
|
|
193
181
|
// Auto-sync Markdown view after any change
|
|
194
182
|
syncMarkdownMemory(frameworkDir);
|
|
195
183
|
}
|
|
196
|
-
|
|
197
184
|
/**
|
|
198
185
|
* Single Source of Truth Bridge: JSON -> Markdown
|
|
199
186
|
* Regenerates PROJECT_MEMORY.md from structured state.
|
|
200
187
|
*/
|
|
201
|
-
export function syncMarkdownMemory(fDir
|
|
188
|
+
export function syncMarkdownMemory(fDir) {
|
|
202
189
|
const frameworkDir = fDir || getFrameworkDir();
|
|
203
190
|
const storePath = path.join(frameworkDir, "memory");
|
|
204
191
|
const mdPath = path.join(storePath, "PROJECT_MEMORY.md");
|
|
205
|
-
|
|
206
192
|
try {
|
|
207
193
|
const state = readState();
|
|
208
194
|
const status = readStatus();
|
|
209
|
-
const tasks =
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
195
|
+
const tasks = Storage.getTasks();
|
|
196
|
+
if (!state)
|
|
197
|
+
return;
|
|
213
198
|
const lines = [
|
|
214
|
-
"#
|
|
199
|
+
"# [MEMORY] Agent Atabey — Project Memory",
|
|
215
200
|
"",
|
|
216
201
|
"## 📍 Current State",
|
|
217
202
|
`- **Phase:** ${state.phase || "PHASE_0"}`,
|
|
218
203
|
`- **Trace ID:** ${state.traceId || "N/A"}`,
|
|
219
204
|
`- **@manager state:** ${state.managerState || "ACTIVE"}`,
|
|
220
205
|
];
|
|
221
|
-
|
|
222
206
|
// Add custom sections from state
|
|
223
207
|
const internalFields = ["phase", "traceId", "managerState"];
|
|
224
208
|
Object.entries(state).forEach(([key, value]) => {
|
|
@@ -226,31 +210,21 @@ export function syncMarkdownMemory(fDir?: string) {
|
|
|
226
210
|
lines.push("", `## 📌 ${key}`, String(value));
|
|
227
211
|
}
|
|
228
212
|
});
|
|
229
|
-
|
|
230
|
-
lines.push(
|
|
231
|
-
"",
|
|
232
|
-
"## 📋 Active Tasks",
|
|
233
|
-
"| Trace ID | Task | Agent | Priority | Status |",
|
|
234
|
-
"| :--- | :--- | :--- | :--- | :--- |",
|
|
235
|
-
);
|
|
236
|
-
|
|
213
|
+
lines.push("", "## 📋 Active Tasks", "| Trace ID | Task | Agent | Priority | Status |", "| :--- | :--- | :--- | :--- | :--- |");
|
|
237
214
|
tasks.forEach(t => {
|
|
238
215
|
if (t.status !== "COMPLETED") {
|
|
239
216
|
lines.push(`| ${t.traceId} | ${t.description} | ${t.agent} | ${t.priority} | ${t.status} |`);
|
|
240
217
|
}
|
|
241
218
|
});
|
|
242
|
-
|
|
243
|
-
lines.push("", "## 🤖 Agent Statuses");
|
|
219
|
+
lines.push("", "## [AI] Agent Statuses");
|
|
244
220
|
lines.push("| Agent | State | Active Task | Last Updated |");
|
|
245
221
|
lines.push("| :--- | :--- | :--- | :--- |");
|
|
246
|
-
|
|
247
222
|
for (const [agent, info] of Object.entries(status)) {
|
|
248
|
-
const data = info
|
|
249
|
-
|
|
223
|
+
const data = info;
|
|
224
|
+
const displayAgent = agent.startsWith("@") ? agent : `@${agent}`;
|
|
225
|
+
lines.push(`| ${displayAgent} | ${data.state} | ${data.task} | ${data.lastUpdated || "-"} |`);
|
|
250
226
|
}
|
|
251
|
-
|
|
252
227
|
lines.push("", "## 📜 HISTORY");
|
|
253
|
-
|
|
254
228
|
// Add last 5 history items
|
|
255
229
|
const historyDir = path.join(storePath, "history");
|
|
256
230
|
if (fs.existsSync(historyDir)) {
|
|
@@ -259,7 +233,6 @@ export function syncMarkdownMemory(fDir?: string) {
|
|
|
259
233
|
.sort()
|
|
260
234
|
.reverse()
|
|
261
235
|
.slice(0, 10);
|
|
262
|
-
|
|
263
236
|
histFiles.forEach(f => {
|
|
264
237
|
const hist = JSON.parse(fs.readFileSync(path.join(historyDir, f), "utf8"));
|
|
265
238
|
lines.push(`### ${f.replace(".json", "")}`);
|
|
@@ -267,21 +240,20 @@ export function syncMarkdownMemory(fDir?: string) {
|
|
|
267
240
|
lines.push("");
|
|
268
241
|
});
|
|
269
242
|
}
|
|
270
|
-
|
|
271
243
|
writeTextFile(mdPath, lines.join("\n"));
|
|
272
244
|
logger.debug("Markdown memory synchronized.");
|
|
273
|
-
}
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
274
247
|
logger.debug("Markdown memory sync failed", err);
|
|
275
248
|
}
|
|
276
249
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
export function acquireMemoryLock(lockPath: string): boolean {
|
|
250
|
+
export function acquireMemoryLock(lockPath) {
|
|
280
251
|
try {
|
|
281
252
|
fs.writeFileSync(lockPath, String(Date.now()), { flag: "wx" });
|
|
282
253
|
return true;
|
|
283
|
-
}
|
|
284
|
-
|
|
254
|
+
}
|
|
255
|
+
catch (err) {
|
|
256
|
+
const error = err;
|
|
285
257
|
if (error.code === "EEXIST") {
|
|
286
258
|
try {
|
|
287
259
|
const stat = fs.statSync(lockPath);
|
|
@@ -290,14 +262,15 @@ export function acquireMemoryLock(lockPath: string): boolean {
|
|
|
290
262
|
fs.writeFileSync(lockPath, String(Date.now()), { flag: "wx" });
|
|
291
263
|
return true;
|
|
292
264
|
}
|
|
293
|
-
}
|
|
265
|
+
}
|
|
266
|
+
catch (_e) { /* ignore */
|
|
294
267
|
// Ignore
|
|
295
268
|
}
|
|
296
269
|
}
|
|
297
270
|
return false;
|
|
298
271
|
}
|
|
299
272
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
273
|
+
export function releaseMemoryLock(lockPath) {
|
|
274
|
+
if (fs.existsSync(lockPath))
|
|
275
|
+
fs.unlinkSync(lockPath);
|
|
303
276
|
}
|