atabey 0.0.5 → 0.0.7
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.d.ts +1 -0
- package/dist/framework-mcp/src/index.js +30 -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.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 +1 -1
- 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 +5 -2
- package/dist/src/shared/constants.js +4 -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/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/package.json +5 -4
- 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/dist/constants.js +0 -64
- package/framework-mcp/dist/index.js +0 -119
- package/framework-mcp/dist/tools/control_plane/locking.js +0 -82
- package/framework-mcp/dist/tools/control_plane/registry.js +0 -34
- package/framework-mcp/dist/tools/definitions.js +0 -290
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +0 -59
- package/framework-mcp/dist/tools/file_system/patch_file.js +0 -29
- package/framework-mcp/dist/tools/file_system/read_file.js +0 -51
- package/framework-mcp/dist/tools/file_system/replace_text.js +0 -45
- package/framework-mcp/dist/tools/file_system/write_file.js +0 -38
- package/framework-mcp/dist/tools/framework/audit_deps.js +0 -41
- package/framework-mcp/dist/tools/framework/get_status.js +0 -5
- package/framework-mcp/dist/tools/framework/orchestrate.js +0 -5
- package/framework-mcp/dist/tools/framework/run_tests.js +0 -27
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +0 -5
- package/framework-mcp/dist/tools/framework/update_memory.js +0 -8
- package/framework-mcp/dist/tools/index.js +0 -60
- package/framework-mcp/dist/tools/memory/get_insights.js +0 -34
- package/framework-mcp/dist/tools/memory/read_memory.js +0 -28
- package/framework-mcp/dist/tools/messaging/log_action.js +0 -22
- package/framework-mcp/dist/tools/messaging/send_message.js +0 -94
- package/framework-mcp/dist/tools/observability/check_ports.js +0 -26
- package/framework-mcp/dist/tools/observability/get_health.js +0 -19
- package/framework-mcp/dist/tools/quality/check_lint.js +0 -30
- package/framework-mcp/dist/tools/search/get_gaps.js +0 -48
- package/framework-mcp/dist/tools/search/get_map.js +0 -43
- package/framework-mcp/dist/tools/search/grep_search.js +0 -75
- package/framework-mcp/dist/tools/search/list_dir.js +0 -28
- package/framework-mcp/dist/tools/shell/run_command.js +0 -56
- package/framework-mcp/dist/utils/cli.js +0 -59
- package/framework-mcp/dist/utils/compliance.js +0 -78
- package/framework-mcp/dist/utils/fs.js +0 -44
- package/framework-mcp/dist/utils/metrics.js +0 -56
- package/framework-mcp/dist/utils/security.js +0 -60
- package/framework-mcp/package-lock.json +0 -1191
- package/framework-mcp/package.json +0 -26
- package/framework-mcp/src/constants.ts +0 -78
- package/framework-mcp/src/declarations.d.ts +0 -17
- package/framework-mcp/src/index.ts +0 -144
- package/framework-mcp/src/tools/control_plane/locking.ts +0 -89
- package/framework-mcp/src/tools/control_plane/registry.ts +0 -38
- package/framework-mcp/src/tools/definitions.ts +0 -292
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +0 -79
- package/framework-mcp/src/tools/file_system/patch_file.ts +0 -39
- package/framework-mcp/src/tools/file_system/read_file.ts +0 -58
- package/framework-mcp/src/tools/file_system/replace_text.ts +0 -54
- package/framework-mcp/src/tools/file_system/write_file.ts +0 -45
- package/framework-mcp/src/tools/framework/audit_deps.ts +0 -49
- package/framework-mcp/src/tools/framework/get_status.ts +0 -7
- package/framework-mcp/src/tools/framework/orchestrate.ts +0 -7
- package/framework-mcp/src/tools/framework/run_tests.ts +0 -30
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +0 -7
- package/framework-mcp/src/tools/framework/update_memory.ts +0 -10
- package/framework-mcp/src/tools/index.ts +0 -64
- package/framework-mcp/src/tools/memory/get_insights.ts +0 -41
- package/framework-mcp/src/tools/memory/read_memory.ts +0 -31
- package/framework-mcp/src/tools/messaging/log_action.ts +0 -28
- package/framework-mcp/src/tools/messaging/send_message.ts +0 -97
- package/framework-mcp/src/tools/observability/check_ports.ts +0 -30
- package/framework-mcp/src/tools/observability/get_health.ts +0 -24
- package/framework-mcp/src/tools/quality/check_lint.ts +0 -36
- package/framework-mcp/src/tools/search/get_gaps.ts +0 -54
- package/framework-mcp/src/tools/search/get_map.ts +0 -48
- package/framework-mcp/src/tools/search/grep_search.ts +0 -75
- package/framework-mcp/src/tools/search/list_dir.ts +0 -34
- package/framework-mcp/src/tools/shell/run_command.ts +0 -66
- package/framework-mcp/src/tools/types.ts +0 -89
- package/framework-mcp/src/utils/cli.ts +0 -53
- package/framework-mcp/src/utils/compliance.ts +0 -95
- package/framework-mcp/src/utils/fs.ts +0 -45
- package/framework-mcp/src/utils/metrics.ts +0 -73
- package/framework-mcp/src/utils/security.ts +0 -66
- 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/adapters/core.ts +0 -91
- package/src/cli/adapters/index.ts +0 -5
- package/src/cli/adapters/paths.ts +0 -135
- package/src/cli/adapters/scaffold.ts +0 -95
- package/src/cli/adapters/utils.ts +0 -87
- package/src/cli/commands/approve.ts +0 -73
- package/src/cli/commands/check.ts +0 -188
- package/src/cli/commands/compliance.ts +0 -55
- package/src/cli/commands/contract.ts +0 -68
- package/src/cli/commands/explorer.ts +0 -45
- package/src/cli/commands/git.ts +0 -39
- package/src/cli/commands/init/scaffold-core.ts +0 -136
- package/src/cli/commands/init/scaffold-docs.ts +0 -44
- package/src/cli/commands/init/scaffold-ops.ts +0 -83
- package/src/cli/commands/init/scaffold-standards.ts +0 -67
- package/src/cli/commands/init.ts +0 -193
- package/src/cli/commands/knowledge.ts +0 -44
- package/src/cli/commands/lint.ts +0 -23
- package/src/cli/commands/log.ts +0 -37
- package/src/cli/commands/memory.ts +0 -6
- package/src/cli/commands/orchestrate.ts +0 -450
- package/src/cli/commands/plan.ts +0 -113
- package/src/cli/commands/script.ts +0 -20
- package/src/cli/commands/security.ts +0 -38
- package/src/cli/commands/status.ts +0 -44
- package/src/cli/commands/trace.ts +0 -31
- package/src/cli/index.ts +0 -322
- package/src/cli/shims.ts +0 -66
- package/src/cli/utils/claude.ts +0 -63
- package/src/cli/utils/compliance.ts +0 -191
- package/src/cli/utils/config-schema.ts +0 -48
- package/src/cli/utils/fs.ts +0 -170
- package/src/cli/utils/i18n.ts +0 -44
- package/src/cli/utils/memory.ts +0 -303
- package/src/cli/utils/pkg.ts +0 -317
- package/src/cli/utils/schemas.ts +0 -22
- package/src/cli/utils/string.ts +0 -55
- package/src/cli/utils/time.ts +0 -27
- package/src/cli/utils/ui.ts +0 -66
- package/src/contracts/index.ts +0 -1
- package/src/contracts/tasks.ts +0 -26
- package/src/modules/adapters/definitions.ts +0 -171
- package/src/modules/adapters/registry.ts +0 -27
- package/src/modules/adapters/shared.ts +0 -120
- package/src/modules/adapters/types.ts +0 -16
- package/src/modules/agents/definitions.ts +0 -460
- package/src/modules/agents/registry/analyst.ts +0 -44
- package/src/modules/agents/registry/architect.ts +0 -47
- package/src/modules/agents/registry/backend.ts +0 -46
- package/src/modules/agents/registry/database.ts +0 -43
- package/src/modules/agents/registry/devops.ts +0 -44
- package/src/modules/agents/registry/explorer.ts +0 -41
- package/src/modules/agents/registry/frontend.ts +0 -48
- package/src/modules/agents/registry/git.ts +0 -41
- package/src/modules/agents/registry/manager.ts +0 -58
- package/src/modules/agents/registry/mobile.ts +0 -44
- package/src/modules/agents/registry/native.ts +0 -44
- package/src/modules/agents/registry/quality.ts +0 -46
- package/src/modules/agents/registry/security.ts +0 -42
- package/src/modules/agents/types.ts +0 -37
- package/src/modules/skills/definitions.ts +0 -71
- package/src/schema/agent-lifecycle-schema.json +0 -59
- package/src/shared/constants.ts +0 -218
- package/src/shared/errors.ts +0 -75
- package/src/shared/fs.ts +0 -50
- package/src/shared/logger.ts +0 -139
- package/src/shared/types.ts +0 -20
- /package/{framework-mcp/dist/tools/types.js → dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts} +0 -0
package/src/shared/constants.ts
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Atabey — Single Source of Truth for framework constants.
|
|
3
|
-
* Import from here instead of hardcoding paths, phases, or directory names.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// ─── Framework identity ───────────────────────────────────────────────────────
|
|
7
|
-
|
|
8
|
-
export const FRAMEWORK = {
|
|
9
|
-
NAME: "Agent Atabey",
|
|
10
|
-
CORE_DIR: ".atabey",
|
|
11
|
-
UNIFIED_HUB_DIR: ".agents",
|
|
12
|
-
CONSTITUTION_FILE: "ATABEY.md",
|
|
13
|
-
DEFAULT_TRACE_ID: "T-000",
|
|
14
|
-
DEFAULT_PHASE: "PHASE_0",
|
|
15
|
-
DEFAULT_MANAGER_STATE: "ACTIVE",
|
|
16
|
-
} as const;
|
|
17
|
-
|
|
18
|
-
export const PROJECT_PHASES = [
|
|
19
|
-
"PHASE_0",
|
|
20
|
-
"PHASE_1",
|
|
21
|
-
"PHASE_2",
|
|
22
|
-
"PHASE_3",
|
|
23
|
-
"PHASE_4",
|
|
24
|
-
] as const;
|
|
25
|
-
|
|
26
|
-
// ─── Adapter platform directories (native / legacy) ───────────────────────────
|
|
27
|
-
|
|
28
|
-
export const ADAPTER_DIRS = {
|
|
29
|
-
GEMINI: ".gemini",
|
|
30
|
-
CLAUDE: ".claude",
|
|
31
|
-
GROK: ".grok",
|
|
32
|
-
CURSOR: ".cursor",
|
|
33
|
-
CODEX: ".agents",
|
|
34
|
-
ANTIGRAVITY: ".antigravity",
|
|
35
|
-
LOCAL: ".atabey",
|
|
36
|
-
LEGACY_AGENT: ".agent",
|
|
37
|
-
} as const;
|
|
38
|
-
|
|
39
|
-
/** Priority order for framework directory resolution (CLI + MCP). */
|
|
40
|
-
export const FRAMEWORK_DIR_CANDIDATES = [
|
|
41
|
-
FRAMEWORK.CORE_DIR,
|
|
42
|
-
ADAPTER_DIRS.CODEX,
|
|
43
|
-
ADAPTER_DIRS.CLAUDE,
|
|
44
|
-
ADAPTER_DIRS.GEMINI,
|
|
45
|
-
ADAPTER_DIRS.GROK,
|
|
46
|
-
ADAPTER_DIRS.CURSOR,
|
|
47
|
-
ADAPTER_DIRS.ANTIGRAVITY,
|
|
48
|
-
ADAPTER_DIRS.LOCAL,
|
|
49
|
-
] as const;
|
|
50
|
-
|
|
51
|
-
/** Slug under `.agents/{slug}/` for each adapter in unified mode. */
|
|
52
|
-
export const UNIFIED_ADAPTER_SLUG = {
|
|
53
|
-
gemini: "gemini",
|
|
54
|
-
claude: "claude",
|
|
55
|
-
grok: "grok",
|
|
56
|
-
cursor: "cursor",
|
|
57
|
-
codex: "codex",
|
|
58
|
-
local: "local",
|
|
59
|
-
"antigravity-cli": "antigravity",
|
|
60
|
-
} as const;
|
|
61
|
-
|
|
62
|
-
export type UnifiedAdapterSlug = keyof typeof UNIFIED_ADAPTER_SLUG;
|
|
63
|
-
|
|
64
|
-
// ─── Native agent instruction paths (legacy tool compatibility) ───────────────
|
|
65
|
-
|
|
66
|
-
export const NATIVE_AGENT_PATHS = {
|
|
67
|
-
gemini: pathJoin(ADAPTER_DIRS.GEMINI, "agents"),
|
|
68
|
-
claude: pathJoin(ADAPTER_DIRS.CLAUDE, "agents"),
|
|
69
|
-
grok: pathJoin(ADAPTER_DIRS.GROK, "agents"),
|
|
70
|
-
cursor: pathJoin(ADAPTER_DIRS.CURSOR, "rules"),
|
|
71
|
-
codex: pathJoin(ADAPTER_DIRS.CODEX, "instructions"),
|
|
72
|
-
local: pathJoin(ADAPTER_DIRS.LOCAL, "agents"),
|
|
73
|
-
"antigravity-cli": pathJoin(ADAPTER_DIRS.ANTIGRAVITY, "agents"),
|
|
74
|
-
} as const;
|
|
75
|
-
|
|
76
|
-
/** Legacy layout bases used by `check` and discovery (non-unified installs). */
|
|
77
|
-
export const LEGACY_AGENT_LAYOUT_BASES = [
|
|
78
|
-
NATIVE_AGENT_PATHS.gemini,
|
|
79
|
-
NATIVE_AGENT_PATHS.claude,
|
|
80
|
-
NATIVE_AGENT_PATHS.cursor,
|
|
81
|
-
NATIVE_AGENT_PATHS.grok,
|
|
82
|
-
NATIVE_AGENT_PATHS.codex,
|
|
83
|
-
NATIVE_AGENT_PATHS.local,
|
|
84
|
-
NATIVE_AGENT_PATHS["antigravity-cli"],
|
|
85
|
-
] as const;
|
|
86
|
-
|
|
87
|
-
// ─── Framework internal subdirectories (under `.atabey/`) ──────────────────
|
|
88
|
-
|
|
89
|
-
export const FRAMEWORK_SUBDIRS = {
|
|
90
|
-
AGENTS: "agents",
|
|
91
|
-
SKILLS: "skills",
|
|
92
|
-
KNOWLEDGE: "knowledge",
|
|
93
|
-
PROMPTS: "prompts",
|
|
94
|
-
MEMORY: "memory",
|
|
95
|
-
ROUTER: "router",
|
|
96
|
-
REGISTRY: "registry",
|
|
97
|
-
OBSERVABILITY: "observability",
|
|
98
|
-
RULES: "rules",
|
|
99
|
-
MESSAGES: "messages",
|
|
100
|
-
LOGS: "logs",
|
|
101
|
-
MEMORY_GRAPH: "memory-graph",
|
|
102
|
-
} as const;
|
|
103
|
-
|
|
104
|
-
export const CORE_SCAFFOLD_SUBDIRS = [
|
|
105
|
-
FRAMEWORK_SUBDIRS.KNOWLEDGE,
|
|
106
|
-
FRAMEWORK_SUBDIRS.PROMPTS,
|
|
107
|
-
FRAMEWORK_SUBDIRS.MEMORY,
|
|
108
|
-
FRAMEWORK_SUBDIRS.ROUTER,
|
|
109
|
-
FRAMEWORK_SUBDIRS.REGISTRY,
|
|
110
|
-
FRAMEWORK_SUBDIRS.OBSERVABILITY,
|
|
111
|
-
FRAMEWORK_SUBDIRS.RULES,
|
|
112
|
-
] as const;
|
|
113
|
-
|
|
114
|
-
export const RUNTIME_SUBDIRS = [
|
|
115
|
-
FRAMEWORK_SUBDIRS.MESSAGES,
|
|
116
|
-
FRAMEWORK_SUBDIRS.LOGS,
|
|
117
|
-
FRAMEWORK_SUBDIRS.MEMORY_GRAPH,
|
|
118
|
-
] as const;
|
|
119
|
-
|
|
120
|
-
export const MEMORY_SUBDIRS = {
|
|
121
|
-
TASKS: "tasks",
|
|
122
|
-
HISTORY: "history",
|
|
123
|
-
} as const;
|
|
124
|
-
|
|
125
|
-
export const MEMORY_FILES = {
|
|
126
|
-
STATE: "state.json",
|
|
127
|
-
STATUS: "status.json",
|
|
128
|
-
PROJECT_MEMORY: "PROJECT_MEMORY.md",
|
|
129
|
-
SHARED_FACTS: "shared-facts.json",
|
|
130
|
-
} as const;
|
|
131
|
-
|
|
132
|
-
// ─── Monorepo default paths ───────────────────────────────────────────────────
|
|
133
|
-
|
|
134
|
-
export const DEFAULT_MONOREPO_PATHS = {
|
|
135
|
-
backend: "apps/backend",
|
|
136
|
-
frontend: "apps/web",
|
|
137
|
-
mobile: "apps/mobile",
|
|
138
|
-
docs: "docs",
|
|
139
|
-
tests: "tests",
|
|
140
|
-
} as const;
|
|
141
|
-
|
|
142
|
-
/** Cursor rule globs per agent role (enterprise monorepo layout). */
|
|
143
|
-
export const CURSOR_AGENT_GLOBS: Record<string, string> = {
|
|
144
|
-
manager: "**/*",
|
|
145
|
-
security: "**/*",
|
|
146
|
-
architect: "**/*",
|
|
147
|
-
backend: `${DEFAULT_MONOREPO_PATHS.backend}/**/*`,
|
|
148
|
-
frontend: `${DEFAULT_MONOREPO_PATHS.frontend}/**/*`,
|
|
149
|
-
mobile: `${DEFAULT_MONOREPO_PATHS.mobile}/**/*`,
|
|
150
|
-
native: "apps/native/**/*",
|
|
151
|
-
database: `${DEFAULT_MONOREPO_PATHS.backend}/src/database/**/*`,
|
|
152
|
-
devops: "{.github,docker,infra,scripts,*.yml,*.yaml,Dockerfile*}",
|
|
153
|
-
quality: "**/*",
|
|
154
|
-
analyst: "{docs,specs,contracts}/**/*",
|
|
155
|
-
explorer: "**/*",
|
|
156
|
-
git: "**/*",
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
// ─── MCP & environment ──────────────────────────────────────────────────────
|
|
160
|
-
|
|
161
|
-
export const MCP = {
|
|
162
|
-
SERVER_NAME: "atabey",
|
|
163
|
-
ROOT_CONFIG_FILE: "mcp.json",
|
|
164
|
-
PROJECT_ROOT_ENV: "ATABEY_PROJECT_ROOT",
|
|
165
|
-
TEST_DIR_ENV: "ATABEY_TEST_DIR",
|
|
166
|
-
} as const;
|
|
167
|
-
|
|
168
|
-
export const ROOT_CONFIG_FILES = {
|
|
169
|
-
MCP: MCP.ROOT_CONFIG_FILE,
|
|
170
|
-
DOT_MCP: ".mcp.json",
|
|
171
|
-
ENV_EXAMPLE: ".env.example",
|
|
172
|
-
VSCODE_MCP: ".vscode/mcp.json",
|
|
173
|
-
} as const;
|
|
174
|
-
|
|
175
|
-
// ─── Shim template placeholders ───────────────────────────────────────────────
|
|
176
|
-
|
|
177
|
-
export const TEMPLATE_PLACEHOLDERS = {
|
|
178
|
-
FRAMEWORK_DIR: "{{FRAMEWORK_DIR}}",
|
|
179
|
-
ADAPTER: "{{ADAPTER}}",
|
|
180
|
-
BACKEND_DIR: "{{BACKEND_DIR}}",
|
|
181
|
-
FRONTEND_DIR: "{{FRONTEND_DIR}}",
|
|
182
|
-
DOCS_DIR: "{{DOCS_DIR}}",
|
|
183
|
-
TESTS_DIR: "{{TESTS_DIR}}",
|
|
184
|
-
} as const;
|
|
185
|
-
|
|
186
|
-
// ─── File extensions ─────────────────────────────────────────────────────────
|
|
187
|
-
|
|
188
|
-
export const AGENT_FILE_EXT = {
|
|
189
|
-
MARKDOWN: ".md",
|
|
190
|
-
CURSOR_RULE: ".mdc",
|
|
191
|
-
} as const;
|
|
192
|
-
|
|
193
|
-
// ─── Path helpers ─────────────────────────────────────────────────────────────
|
|
194
|
-
|
|
195
|
-
export function pathJoin(...segments: string[]): string {
|
|
196
|
-
return segments.filter(Boolean).join("/");
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export function corePath(...segments: string[]): string {
|
|
200
|
-
return pathJoin(FRAMEWORK.CORE_DIR, ...segments);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export function unifiedHubPath(...segments: string[]): string {
|
|
204
|
-
return pathJoin(FRAMEWORK.UNIFIED_HUB_DIR, ...segments);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export function unifiedAdapterPath(slug: string, ...segments: string[]): string {
|
|
208
|
-
return unifiedHubPath(slug, ...segments);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export function knowledgePath(filename: string): string {
|
|
212
|
-
return corePath(FRAMEWORK_SUBDIRS.KNOWLEDGE, filename);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/** Backward-compatible aliases */
|
|
216
|
-
export const CORE_FRAMEWORK_DIR = FRAMEWORK.CORE_DIR;
|
|
217
|
-
export const UNIFIED_HUB_DIR = FRAMEWORK.UNIFIED_HUB_DIR;
|
|
218
|
-
export const SKILLS_HUB_PATH = pathJoin(UNIFIED_HUB_DIR, FRAMEWORK_SUBDIRS.SKILLS);
|
package/src/shared/errors.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enterprise Base Error class for the Agent Atabey Framework.
|
|
3
|
-
*/
|
|
4
|
-
export class AtabeyBaseError extends Error {
|
|
5
|
-
public readonly code: string;
|
|
6
|
-
public readonly timestamp: Date;
|
|
7
|
-
public readonly details?: unknown;
|
|
8
|
-
public readonly solution?: string;
|
|
9
|
-
|
|
10
|
-
constructor(message: string, code = "ATABEY_INTERNAL_ERROR", details?: unknown, solution?: string) {
|
|
11
|
-
super(message);
|
|
12
|
-
this.name = this.constructor.name;
|
|
13
|
-
this.code = code;
|
|
14
|
-
this.timestamp = new Date();
|
|
15
|
-
this.details = details;
|
|
16
|
-
this.solution = solution;
|
|
17
|
-
|
|
18
|
-
// Ensure proper prototype chain and capture stack trace
|
|
19
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
20
|
-
if (Error.captureStackTrace) {
|
|
21
|
-
Error.captureStackTrace(this, this.constructor);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Converts the error into a structured JSON log format.
|
|
27
|
-
*/
|
|
28
|
-
public toJSON() {
|
|
29
|
-
return {
|
|
30
|
-
name: this.name,
|
|
31
|
-
message: this.message,
|
|
32
|
-
code: this.code,
|
|
33
|
-
timestamp: this.timestamp.toISOString(),
|
|
34
|
-
details: this.details,
|
|
35
|
-
solution: this.solution,
|
|
36
|
-
stack: this.stack,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Thrown when configuration loading or validation fails.
|
|
43
|
-
*/
|
|
44
|
-
export class ConfigurationError extends AtabeyBaseError {
|
|
45
|
-
constructor(message: string, details?: unknown, solution?: string) {
|
|
46
|
-
super(message, "CONFIGURATION_ERROR", details, solution);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Thrown when data schema or payload validation fails.
|
|
52
|
-
*/
|
|
53
|
-
export class ValidationError extends AtabeyBaseError {
|
|
54
|
-
constructor(message: string, details?: unknown, solution?: string) {
|
|
55
|
-
super(message, "VALIDATION_ERROR", details, solution);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Thrown when adapter initialization or execution fails.
|
|
61
|
-
*/
|
|
62
|
-
export class AdapterError extends AtabeyBaseError {
|
|
63
|
-
constructor(message: string, adapterId: string, details?: unknown, solution?: string) {
|
|
64
|
-
super(`Adapter '${adapterId}' failure: ${message}`, "ADAPTER_ERROR", details, solution);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Thrown when orchestration or agent communication fails.
|
|
70
|
-
*/
|
|
71
|
-
export class OrchestrationError extends AtabeyBaseError {
|
|
72
|
-
constructor(message: string, details?: unknown, solution?: string) {
|
|
73
|
-
super(message, "ORCHESTRATION_ERROR", details, solution);
|
|
74
|
-
}
|
|
75
|
-
}
|
package/src/shared/fs.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { logger } from "./logger.js";
|
|
4
|
-
|
|
5
|
-
export function ensureDir(dirPath: string, dryRun = false): void {
|
|
6
|
-
if (!fs.existsSync(dirPath)) {
|
|
7
|
-
if (dryRun) {
|
|
8
|
-
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
9
|
-
} else {
|
|
10
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Writes content to a file atomically by using a temporary file.
|
|
17
|
-
* This prevents data corruption during unexpected system failures.
|
|
18
|
-
*/
|
|
19
|
-
export function writeTextFile(filePath: string, content: string, dryRun = false): void {
|
|
20
|
-
if (dryRun) {
|
|
21
|
-
logger.info(`[DRY RUN] Would write file: ${filePath}`);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const dir = path.dirname(filePath);
|
|
25
|
-
ensureDir(dir);
|
|
26
|
-
|
|
27
|
-
const tempPath = `${filePath}.${Math.random().toString(36).slice(2, 9)}.tmp`;
|
|
28
|
-
const finalContent = content.endsWith("\n") ? content : `${content}\n`;
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
fs.writeFileSync(tempPath, finalContent, "utf8");
|
|
32
|
-
fs.renameSync(tempPath, filePath);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
if (fs.existsSync(tempPath)) fs.unlinkSync(tempPath);
|
|
35
|
-
throw err;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function appendFile(filePath: string, content: string, dryRun = false): void {
|
|
40
|
-
if (dryRun) {
|
|
41
|
-
logger.info(`[DRY RUN] Would append to file: ${filePath}`);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
ensureDir(path.dirname(filePath));
|
|
45
|
-
fs.appendFileSync(filePath, content, "utf8");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function writeJsonFile(filePath: string, value: unknown, dryRun = false): void {
|
|
49
|
-
writeTextFile(filePath, JSON.stringify(value, null, 2), dryRun);
|
|
50
|
-
}
|
package/src/shared/logger.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { ensureDir, appendFile } from "./fs.js";
|
|
4
|
-
|
|
5
|
-
export enum LogLevel {
|
|
6
|
-
DEBUG = 0,
|
|
7
|
-
INFO = 1,
|
|
8
|
-
WARN = 2,
|
|
9
|
-
ERROR = 3,
|
|
10
|
-
FATAL = 4,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface LoggerConfig {
|
|
14
|
-
minLevel: LogLevel;
|
|
15
|
-
enableColors: boolean;
|
|
16
|
-
jsonFormat: boolean;
|
|
17
|
-
logFile?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class EnterpriseLogger {
|
|
21
|
-
private config: LoggerConfig;
|
|
22
|
-
private static instance: EnterpriseLogger;
|
|
23
|
-
|
|
24
|
-
private constructor() {
|
|
25
|
-
const isProd = process.env.NODE_ENV === "production";
|
|
26
|
-
this.config = {
|
|
27
|
-
minLevel: isProd ? LogLevel.INFO : LogLevel.DEBUG,
|
|
28
|
-
enableColors: !isProd,
|
|
29
|
-
jsonFormat: isProd,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public static getInstance(): EnterpriseLogger {
|
|
34
|
-
if (!EnterpriseLogger.instance) {
|
|
35
|
-
EnterpriseLogger.instance = new EnterpriseLogger();
|
|
36
|
-
}
|
|
37
|
-
return EnterpriseLogger.instance;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public configure(config: Partial<LoggerConfig>): void {
|
|
41
|
-
this.config = { ...this.config, ...config };
|
|
42
|
-
|
|
43
|
-
if (this.config.logFile) {
|
|
44
|
-
try {
|
|
45
|
-
ensureDir(path.dirname(this.config.logFile));
|
|
46
|
-
} catch (err) {
|
|
47
|
-
// Directly write to stderr — using console here would be circular
|
|
48
|
-
process.stderr.write(`[Logger] Failed to create log directory: ${err}\n`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
private formatMessage(level: LogLevel, message: string, meta?: unknown): string {
|
|
54
|
-
const timestamp = new Date().toISOString();
|
|
55
|
-
const pid = process.pid;
|
|
56
|
-
|
|
57
|
-
if (this.config.jsonFormat) {
|
|
58
|
-
return JSON.stringify({
|
|
59
|
-
timestamp,
|
|
60
|
-
level: LogLevel[level],
|
|
61
|
-
pid,
|
|
62
|
-
message,
|
|
63
|
-
meta,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const levelName = LogLevel[level].padEnd(5);
|
|
68
|
-
let coloredLevel = levelName;
|
|
69
|
-
|
|
70
|
-
if (this.config.enableColors) {
|
|
71
|
-
switch (level) {
|
|
72
|
-
case LogLevel.DEBUG:
|
|
73
|
-
coloredLevel = chalk.blue(levelName);
|
|
74
|
-
break;
|
|
75
|
-
case LogLevel.INFO:
|
|
76
|
-
coloredLevel = chalk.green(levelName);
|
|
77
|
-
break;
|
|
78
|
-
case LogLevel.WARN:
|
|
79
|
-
coloredLevel = chalk.yellow(levelName);
|
|
80
|
-
break;
|
|
81
|
-
case LogLevel.ERROR:
|
|
82
|
-
coloredLevel = chalk.red(levelName);
|
|
83
|
-
break;
|
|
84
|
-
case LogLevel.FATAL:
|
|
85
|
-
coloredLevel = chalk.bgRed.white.bold(levelName);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const metaStr = meta ? ` | Meta: ${JSON.stringify(meta)}` : "";
|
|
91
|
-
return `[${timestamp}] [PID:${pid}] [${coloredLevel}]: ${message}${metaStr}`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
private log(level: LogLevel, message: string, meta?: unknown): void {
|
|
95
|
-
if (level < this.config.minLevel) return;
|
|
96
|
-
|
|
97
|
-
const formatted = this.formatMessage(level, message, meta);
|
|
98
|
-
|
|
99
|
-
// Route to stderr for ERROR/FATAL, stdout otherwise.
|
|
100
|
-
// Using process.write directly here is intentional — this IS the logger.
|
|
101
|
-
if (level >= LogLevel.ERROR) {
|
|
102
|
-
process.stderr.write(formatted + "\n");
|
|
103
|
-
} else {
|
|
104
|
-
process.stdout.write(formatted + "\n");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Output to file if configured
|
|
108
|
-
if (this.config.logFile) {
|
|
109
|
-
try {
|
|
110
|
-
appendFile(this.config.logFile, formatted + "\n");
|
|
111
|
-
} catch (err) {
|
|
112
|
-
// Directly write to stderr — using console here would be circular
|
|
113
|
-
process.stderr.write(`[Logger] Failed to write to log file: ${err}\n`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
public debug(message: string, meta?: unknown): void {
|
|
119
|
-
this.log(LogLevel.DEBUG, message, meta);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
public info(message: string, meta?: unknown): void {
|
|
123
|
-
this.log(LogLevel.INFO, message, meta);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
public warn(message: string, meta?: unknown): void {
|
|
127
|
-
this.log(LogLevel.WARN, message, meta);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
public error(message: string, meta?: unknown): void {
|
|
131
|
-
this.log(LogLevel.ERROR, message, meta);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
public fatal(message: string, meta?: unknown): void {
|
|
135
|
-
this.log(LogLevel.FATAL, message, meta);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export const logger = EnterpriseLogger.getInstance();
|
package/src/shared/types.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Atabey Framework — Internal Branded Types
|
|
3
|
-
* Used to enforce absolute type safety within the core orchestration logic.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type Brand<K, T> = K & { __brand: T };
|
|
7
|
-
|
|
8
|
-
export type TraceID = Brand<string, "TraceID">;
|
|
9
|
-
export type AgentID = Brand<string, "AgentID">;
|
|
10
|
-
export type PhaseID = Brand<string, "PhaseID">;
|
|
11
|
-
export type ProjectPath = Brand<string, "ProjectPath">;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Casts a raw string to a Branded Type.
|
|
15
|
-
* Use this only at the boundaries of the system.
|
|
16
|
-
*/
|
|
17
|
-
export function asTraceID(val: string): TraceID { return val as TraceID; }
|
|
18
|
-
export function asAgentID(val: string): AgentID { return val as AgentID; }
|
|
19
|
-
export function asPhaseID(val: string): PhaseID { return val as PhaseID; }
|
|
20
|
-
export function asProjectPath(val: string): ProjectPath { return val as ProjectPath; }
|
|
File without changes
|