atabey 0.0.1
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 +258 -0
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/bin/cli.js +26 -0
- package/bin/validate-agent-army.js +145 -0
- package/dist/framework-mcp/src/constants.d.ts +47 -0
- package/dist/framework-mcp/src/constants.js +65 -0
- package/dist/framework-mcp/src/constants.js.map +1 -0
- package/dist/framework-mcp/src/index.d.ts +1 -0
- package/dist/framework-mcp/src/index.js +120 -0
- package/dist/framework-mcp/src/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/control_plane/locking.d.ts +9 -0
- package/dist/framework-mcp/src/tools/control_plane/locking.js +83 -0
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -0
- package/dist/framework-mcp/src/tools/control_plane/registry.d.ts +6 -0
- package/dist/framework-mcp/src/tools/control_plane/registry.js +35 -0
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -0
- package/dist/framework-mcp/src/tools/definitions.d.ts +2 -0
- package/dist/framework-mcp/src/tools/definitions.js +291 -0
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +5 -0
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +60 -0
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +26 -0
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.js +52 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +46 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/write_file.js +39 -0
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/audit_deps.d.ts +6 -0
- package/dist/framework-mcp/src/tools/framework/audit_deps.js +42 -0
- package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/get_status.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/get_status.js +6 -0
- package/dist/framework-mcp/src/tools/framework/get_status.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/orchestrate.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/orchestrate.js +6 -0
- package/dist/framework-mcp/src/tools/framework/orchestrate.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/run_tests.d.ts +5 -0
- package/dist/framework-mcp/src/tools/framework/run_tests.js +26 -0
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.js +6 -0
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js +9 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -0
- package/dist/framework-mcp/src/tools/index.d.ts +4 -0
- package/dist/framework-mcp/src/tools/index.js +61 -0
- package/dist/framework-mcp/src/tools/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/memory/get_insights.d.ts +6 -0
- package/dist/framework-mcp/src/tools/memory/get_insights.js +35 -0
- package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -0
- package/dist/framework-mcp/src/tools/memory/read_memory.d.ts +6 -0
- package/dist/framework-mcp/src/tools/memory/read_memory.js +29 -0
- package/dist/framework-mcp/src/tools/memory/read_memory.js.map +1 -0
- package/dist/framework-mcp/src/tools/messaging/log_action.d.ts +2 -0
- package/dist/framework-mcp/src/tools/messaging/log_action.js +23 -0
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -0
- package/dist/framework-mcp/src/tools/messaging/send_message.d.ts +2 -0
- package/dist/framework-mcp/src/tools/messaging/send_message.js +95 -0
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -0
- package/dist/framework-mcp/src/tools/observability/check_ports.d.ts +5 -0
- package/dist/framework-mcp/src/tools/observability/check_ports.js +27 -0
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -0
- package/dist/framework-mcp/src/tools/observability/get_health.d.ts +5 -0
- package/dist/framework-mcp/src/tools/observability/get_health.js +20 -0
- package/dist/framework-mcp/src/tools/observability/get_health.js.map +1 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.d.ts +5 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js +29 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.d.ts +6 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.js +49 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_map.d.ts +6 -0
- package/dist/framework-mcp/src/tools/search/get_map.js +44 -0
- package/dist/framework-mcp/src/tools/search/get_map.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/grep_search.d.ts +5 -0
- package/dist/framework-mcp/src/tools/search/grep_search.js +76 -0
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/list_dir.d.ts +5 -0
- package/dist/framework-mcp/src/tools/search/list_dir.js +29 -0
- package/dist/framework-mcp/src/tools/search/list_dir.js.map +1 -0
- package/dist/framework-mcp/src/tools/shell/run_command.d.ts +2 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js +47 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -0
- package/dist/framework-mcp/src/tools/types.d.ts +120 -0
- package/dist/framework-mcp/src/tools/types.js +2 -0
- package/dist/framework-mcp/src/tools/types.js.map +1 -0
- package/dist/framework-mcp/src/utils/cli.d.ts +5 -0
- package/dist/framework-mcp/src/utils/cli.js +21 -0
- package/dist/framework-mcp/src/utils/cli.js.map +1 -0
- package/dist/framework-mcp/src/utils/compliance.d.ts +5 -0
- package/dist/framework-mcp/src/utils/compliance.js +79 -0
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -0
- package/dist/framework-mcp/src/utils/fs.d.ts +16 -0
- package/dist/framework-mcp/src/utils/fs.js +45 -0
- package/dist/framework-mcp/src/utils/fs.js.map +1 -0
- package/dist/framework-mcp/src/utils/metrics.d.ts +30 -0
- package/dist/framework-mcp/src/utils/metrics.js +57 -0
- package/dist/framework-mcp/src/utils/metrics.js.map +1 -0
- package/dist/framework-mcp/src/utils/security.d.ts +10 -0
- package/dist/framework-mcp/src/utils/security.js +61 -0
- package/dist/framework-mcp/src/utils/security.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +192 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +115 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js +36 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js +43 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js.map +1 -0
- package/dist/src/cli/adapters/core.d.ts +12 -0
- package/dist/src/cli/adapters/core.js +55 -0
- package/dist/src/cli/adapters/core.js.map +1 -0
- package/dist/src/cli/adapters/index.d.ts +5 -0
- package/dist/src/cli/adapters/index.js +6 -0
- package/dist/src/cli/adapters/index.js.map +1 -0
- package/dist/src/cli/adapters/paths.d.ts +15 -0
- package/dist/src/cli/adapters/paths.js +102 -0
- package/dist/src/cli/adapters/paths.js.map +1 -0
- package/dist/src/cli/adapters/scaffold.d.ts +2 -0
- package/dist/src/cli/adapters/scaffold.js +72 -0
- package/dist/src/cli/adapters/scaffold.js.map +1 -0
- package/dist/src/cli/adapters/utils.d.ts +4 -0
- package/dist/src/cli/adapters/utils.js +76 -0
- package/dist/src/cli/adapters/utils.js.map +1 -0
- package/dist/src/cli/commands/approve.d.ts +1 -0
- package/dist/src/cli/commands/approve.js +64 -0
- package/dist/src/cli/commands/approve.js.map +1 -0
- package/dist/src/cli/commands/check.d.ts +1 -0
- package/dist/src/cli/commands/check.js +180 -0
- package/dist/src/cli/commands/check.js.map +1 -0
- package/dist/src/cli/commands/compliance.d.ts +1 -0
- package/dist/src/cli/commands/compliance.js +51 -0
- package/dist/src/cli/commands/compliance.js.map +1 -0
- package/dist/src/cli/commands/contract.d.ts +10 -0
- package/dist/src/cli/commands/contract.js +51 -0
- package/dist/src/cli/commands/contract.js.map +1 -0
- package/dist/src/cli/commands/explorer.d.ts +2 -0
- package/dist/src/cli/commands/explorer.js +43 -0
- package/dist/src/cli/commands/explorer.js.map +1 -0
- package/dist/src/cli/commands/git.d.ts +2 -0
- package/dist/src/cli/commands/git.js +41 -0
- package/dist/src/cli/commands/git.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-core.d.ts +7 -0
- package/dist/src/cli/commands/init/scaffold-core.js +102 -0
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-ops.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-ops.js +81 -0
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-standards.d.ts +2 -0
- package/dist/src/cli/commands/init/scaffold-standards.js +66 -0
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts +5 -0
- package/dist/src/cli/commands/init.js +128 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/knowledge.d.ts +2 -0
- package/dist/src/cli/commands/knowledge.js +43 -0
- package/dist/src/cli/commands/knowledge.js.map +1 -0
- package/dist/src/cli/commands/lint.d.ts +4 -0
- package/dist/src/cli/commands/lint.js +23 -0
- package/dist/src/cli/commands/lint.js.map +1 -0
- package/dist/src/cli/commands/log.d.ts +10 -0
- package/dist/src/cli/commands/log.js +33 -0
- package/dist/src/cli/commands/log.js.map +1 -0
- package/dist/src/cli/commands/memory.d.ts +1 -0
- package/dist/src/cli/commands/memory.js +5 -0
- package/dist/src/cli/commands/memory.js.map +1 -0
- package/dist/src/cli/commands/orchestrate.d.ts +67 -0
- package/dist/src/cli/commands/orchestrate.js +414 -0
- package/dist/src/cli/commands/orchestrate.js.map +1 -0
- package/dist/src/cli/commands/plan.d.ts +6 -0
- package/dist/src/cli/commands/plan.js +97 -0
- package/dist/src/cli/commands/plan.js.map +1 -0
- package/dist/src/cli/commands/script.d.ts +1 -0
- package/dist/src/cli/commands/script.js +20 -0
- package/dist/src/cli/commands/script.js.map +1 -0
- package/dist/src/cli/commands/security.d.ts +1 -0
- package/dist/src/cli/commands/security.js +37 -0
- package/dist/src/cli/commands/security.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +4 -0
- package/dist/src/cli/commands/status.js +41 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/trace.d.ts +4 -0
- package/dist/src/cli/commands/trace.js +29 -0
- package/dist/src/cli/commands/trace.js.map +1 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/cli/index.js +289 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/shims.d.ts +1 -0
- package/dist/src/cli/shims.js +67 -0
- package/dist/src/cli/shims.js.map +1 -0
- package/dist/src/cli/utils/claude.d.ts +8 -0
- package/dist/src/cli/utils/claude.js +57 -0
- package/dist/src/cli/utils/claude.js.map +1 -0
- package/dist/src/cli/utils/compliance.d.ts +11 -0
- package/dist/src/cli/utils/compliance.js +168 -0
- package/dist/src/cli/utils/compliance.js.map +1 -0
- package/dist/src/cli/utils/config-schema.d.ts +139 -0
- package/dist/src/cli/utils/config-schema.js +43 -0
- package/dist/src/cli/utils/config-schema.js.map +1 -0
- package/dist/src/cli/utils/fs.d.ts +10 -0
- package/dist/src/cli/utils/fs.js +138 -0
- package/dist/src/cli/utils/fs.js.map +1 -0
- package/dist/src/cli/utils/memory.d.ts +30 -0
- package/dist/src/cli/utils/memory.js +269 -0
- package/dist/src/cli/utils/memory.js.map +1 -0
- package/dist/src/cli/utils/pkg.d.ts +43 -0
- package/dist/src/cli/utils/pkg.js +283 -0
- package/dist/src/cli/utils/pkg.js.map +1 -0
- package/dist/src/cli/utils/schemas.d.ts +49 -0
- package/dist/src/cli/utils/schemas.js +20 -0
- package/dist/src/cli/utils/schemas.js.map +1 -0
- package/dist/src/cli/utils/string.d.ts +7 -0
- package/dist/src/cli/utils/string.js +50 -0
- package/dist/src/cli/utils/string.js.map +1 -0
- package/dist/src/cli/utils/time.d.ts +2 -0
- package/dist/src/cli/utils/time.js +28 -0
- package/dist/src/cli/utils/time.js.map +1 -0
- package/dist/src/cli/utils/ui.d.ts +30 -0
- package/dist/src/cli/utils/ui.js +59 -0
- package/dist/src/cli/utils/ui.js.map +1 -0
- package/dist/src/contracts/index.d.ts +1 -0
- package/dist/src/contracts/index.js +2 -0
- package/dist/src/contracts/index.js.map +1 -0
- package/dist/src/contracts/tasks.d.ts +44 -0
- package/dist/src/contracts/tasks.js +21 -0
- package/dist/src/contracts/tasks.js.map +1 -0
- package/dist/src/modules/adapters/definitions.d.ts +9 -0
- package/dist/src/modules/adapters/definitions.js +141 -0
- package/dist/src/modules/adapters/definitions.js.map +1 -0
- package/dist/src/modules/adapters/registry.d.ts +12 -0
- package/dist/src/modules/adapters/registry.js +19 -0
- package/dist/src/modules/adapters/registry.js.map +1 -0
- package/dist/src/modules/adapters/shared.d.ts +1 -0
- package/dist/src/modules/adapters/shared.js +105 -0
- package/dist/src/modules/adapters/shared.js.map +1 -0
- package/dist/src/modules/adapters/types.d.ts +14 -0
- package/dist/src/modules/adapters/types.js +2 -0
- package/dist/src/modules/adapters/types.js.map +1 -0
- package/dist/src/modules/agents/definitions.d.ts +15 -0
- package/dist/src/modules/agents/definitions.js +401 -0
- package/dist/src/modules/agents/definitions.js.map +1 -0
- package/dist/src/modules/agents/registry/analyst.d.ts +2 -0
- package/dist/src/modules/agents/registry/analyst.js +40 -0
- package/dist/src/modules/agents/registry/analyst.js.map +1 -0
- package/dist/src/modules/agents/registry/architect.d.ts +2 -0
- package/dist/src/modules/agents/registry/architect.js +43 -0
- package/dist/src/modules/agents/registry/architect.js.map +1 -0
- package/dist/src/modules/agents/registry/backend.d.ts +2 -0
- package/dist/src/modules/agents/registry/backend.js +43 -0
- package/dist/src/modules/agents/registry/backend.js.map +1 -0
- package/dist/src/modules/agents/registry/database.d.ts +2 -0
- package/dist/src/modules/agents/registry/database.js +39 -0
- package/dist/src/modules/agents/registry/database.js.map +1 -0
- package/dist/src/modules/agents/registry/devops.d.ts +2 -0
- package/dist/src/modules/agents/registry/devops.js +40 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -0
- package/dist/src/modules/agents/registry/explorer.d.ts +2 -0
- package/dist/src/modules/agents/registry/explorer.js +37 -0
- package/dist/src/modules/agents/registry/explorer.js.map +1 -0
- package/dist/src/modules/agents/registry/frontend.d.ts +2 -0
- package/dist/src/modules/agents/registry/frontend.js +44 -0
- package/dist/src/modules/agents/registry/frontend.js.map +1 -0
- package/dist/src/modules/agents/registry/git.d.ts +2 -0
- package/dist/src/modules/agents/registry/git.js +37 -0
- package/dist/src/modules/agents/registry/git.js.map +1 -0
- package/dist/src/modules/agents/registry/manager.d.ts +2 -0
- package/dist/src/modules/agents/registry/manager.js +54 -0
- package/dist/src/modules/agents/registry/manager.js.map +1 -0
- package/dist/src/modules/agents/registry/mobile.d.ts +2 -0
- package/dist/src/modules/agents/registry/mobile.js +40 -0
- package/dist/src/modules/agents/registry/mobile.js.map +1 -0
- package/dist/src/modules/agents/registry/native.d.ts +2 -0
- package/dist/src/modules/agents/registry/native.js +40 -0
- package/dist/src/modules/agents/registry/native.js.map +1 -0
- package/dist/src/modules/agents/registry/quality.d.ts +2 -0
- package/dist/src/modules/agents/registry/quality.js +42 -0
- package/dist/src/modules/agents/registry/quality.js.map +1 -0
- package/dist/src/modules/agents/registry/security.d.ts +2 -0
- package/dist/src/modules/agents/registry/security.js +38 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -0
- package/dist/src/modules/agents/types.d.ts +31 -0
- package/dist/src/modules/agents/types.js +2 -0
- package/dist/src/modules/agents/types.js.map +1 -0
- package/dist/src/modules/skills/definitions.d.ts +48 -0
- package/dist/src/modules/skills/definitions.js +71 -0
- package/dist/src/modules/skills/definitions.js.map +1 -0
- package/dist/src/shared/constants.d.ts +116 -0
- package/dist/src/shared/constants.js +184 -0
- package/dist/src/shared/constants.js.map +1 -0
- package/dist/src/shared/errors.d.ts +46 -0
- package/dist/src/shared/errors.js +69 -0
- package/dist/src/shared/errors.js.map +1 -0
- package/dist/src/shared/fs.d.ts +8 -0
- package/dist/src/shared/fs.js +48 -0
- package/dist/src/shared/fs.js.map +1 -0
- package/dist/src/shared/logger.d.ts +28 -0
- package/dist/src/shared/logger.js +117 -0
- package/dist/src/shared/logger.js.map +1 -0
- package/dist/src/shared/types.d.ts +19 -0
- package/dist/src/shared/types.js +13 -0
- package/dist/src/shared/types.js.map +1 -0
- package/dist/tests/adapter.test.d.ts +1 -0
- package/dist/tests/adapter.test.js +128 -0
- package/dist/tests/adapter.test.js.map +1 -0
- package/dist/tests/adapters/paths.test.d.ts +1 -0
- package/dist/tests/adapters/paths.test.js +63 -0
- package/dist/tests/adapters/paths.test.js.map +1 -0
- package/dist/tests/agents-definitions.test.d.ts +1 -0
- package/dist/tests/agents-definitions.test.js +61 -0
- package/dist/tests/agents-definitions.test.js.map +1 -0
- package/dist/tests/approve.test.d.ts +1 -0
- package/dist/tests/approve.test.js +52 -0
- package/dist/tests/approve.test.js.map +1 -0
- package/dist/tests/cli/init/adapter_init.test.d.ts +1 -0
- package/dist/tests/cli/init/adapter_init.test.js +50 -0
- package/dist/tests/cli/init/adapter_init.test.js.map +1 -0
- package/dist/tests/cli/init/unified_init.test.d.ts +1 -0
- package/dist/tests/cli/init/unified_init.test.js +58 -0
- package/dist/tests/cli/init/unified_init.test.js.map +1 -0
- package/dist/tests/errors.test.d.ts +1 -0
- package/dist/tests/errors.test.js +64 -0
- package/dist/tests/errors.test.js.map +1 -0
- package/dist/tests/fs-utils.test.d.ts +1 -0
- package/dist/tests/fs-utils.test.js +101 -0
- package/dist/tests/fs-utils.test.js.map +1 -0
- package/dist/tests/integration/agent_flow.test.d.ts +1 -0
- package/dist/tests/integration/agent_flow.test.js +55 -0
- package/dist/tests/integration/agent_flow.test.js.map +1 -0
- package/dist/tests/integration/hermes_locking.test.d.ts +1 -0
- package/dist/tests/integration/hermes_locking.test.js +64 -0
- package/dist/tests/integration/hermes_locking.test.js.map +1 -0
- package/dist/tests/logger.test.d.ts +1 -0
- package/dist/tests/logger.test.js +81 -0
- package/dist/tests/logger.test.js.map +1 -0
- package/dist/tests/memory-utils.test.d.ts +1 -0
- package/dist/tests/memory-utils.test.js +59 -0
- package/dist/tests/memory-utils.test.js.map +1 -0
- package/dist/tests/modules/adapters/adapters.test.d.ts +1 -0
- package/dist/tests/modules/adapters/adapters.test.js +30 -0
- package/dist/tests/modules/adapters/adapters.test.js.map +1 -0
- package/dist/tests/orchestrate.test.d.ts +1 -0
- package/dist/tests/orchestrate.test.js +67 -0
- package/dist/tests/orchestrate.test.js.map +1 -0
- package/dist/tests/shared/constants.test.d.ts +1 -0
- package/dist/tests/shared/constants.test.js +17 -0
- package/dist/tests/shared/constants.test.js.map +1 -0
- package/dist/tests/skills-definitions.test.d.ts +1 -0
- package/dist/tests/skills-definitions.test.js +34 -0
- package/dist/tests/skills-definitions.test.js.map +1 -0
- package/dist/tests/status.test.d.ts +1 -0
- package/dist/tests/status.test.js +49 -0
- package/dist/tests/status.test.js.map +1 -0
- package/dist/tests/string.test.d.ts +1 -0
- package/dist/tests/string.test.js +89 -0
- package/dist/tests/string.test.js.map +1 -0
- package/dist/tests/time.test.d.ts +1 -0
- package/dist/tests/time.test.js +48 -0
- package/dist/tests/time.test.js.map +1 -0
- package/dist/tests/trace.test.d.ts +1 -0
- package/dist/tests/trace.test.js +28 -0
- package/dist/tests/trace.test.js.map +1 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +20 -0
- package/dist/vitest.config.js.map +1 -0
- package/framework-mcp/dist/constants.js +64 -0
- package/framework-mcp/dist/index.js +119 -0
- package/framework-mcp/dist/tools/control_plane/locking.js +82 -0
- package/framework-mcp/dist/tools/control_plane/registry.js +34 -0
- package/framework-mcp/dist/tools/definitions.js +290 -0
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +59 -0
- package/framework-mcp/dist/tools/file_system/patch_file.js +25 -0
- package/framework-mcp/dist/tools/file_system/read_file.js +51 -0
- package/framework-mcp/dist/tools/file_system/replace_text.js +45 -0
- package/framework-mcp/dist/tools/file_system/write_file.js +38 -0
- package/framework-mcp/dist/tools/framework/audit_deps.js +41 -0
- package/framework-mcp/dist/tools/framework/get_status.js +5 -0
- package/framework-mcp/dist/tools/framework/orchestrate.js +5 -0
- package/framework-mcp/dist/tools/framework/run_tests.js +25 -0
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +5 -0
- package/framework-mcp/dist/tools/framework/update_memory.js +8 -0
- package/framework-mcp/dist/tools/index.js +60 -0
- package/framework-mcp/dist/tools/memory/get_insights.js +34 -0
- package/framework-mcp/dist/tools/memory/read_memory.js +28 -0
- package/framework-mcp/dist/tools/messaging/log_action.js +22 -0
- package/framework-mcp/dist/tools/messaging/send_message.js +94 -0
- package/framework-mcp/dist/tools/observability/check_ports.js +26 -0
- package/framework-mcp/dist/tools/observability/get_health.js +19 -0
- package/framework-mcp/dist/tools/quality/check_lint.js +28 -0
- package/framework-mcp/dist/tools/search/get_gaps.js +48 -0
- package/framework-mcp/dist/tools/search/get_map.js +43 -0
- package/framework-mcp/dist/tools/search/grep_search.js +75 -0
- package/framework-mcp/dist/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/tools/shell/run_command.js +46 -0
- package/framework-mcp/dist/tools/types.js +1 -0
- package/framework-mcp/dist/utils/cli.js +20 -0
- package/framework-mcp/dist/utils/compliance.js +78 -0
- package/framework-mcp/dist/utils/fs.js +44 -0
- package/framework-mcp/dist/utils/metrics.js +56 -0
- package/framework-mcp/dist/utils/security.js +60 -0
- package/framework-mcp/package-lock.json +1191 -0
- package/framework-mcp/package.json +26 -0
- package/framework-mcp/src/constants.ts +78 -0
- package/framework-mcp/src/declarations.d.ts +17 -0
- package/framework-mcp/src/index.ts +144 -0
- package/framework-mcp/src/tools/control_plane/locking.ts +89 -0
- package/framework-mcp/src/tools/control_plane/registry.ts +38 -0
- package/framework-mcp/src/tools/definitions.ts +292 -0
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +79 -0
- package/framework-mcp/src/tools/file_system/patch_file.ts +33 -0
- package/framework-mcp/src/tools/file_system/read_file.ts +58 -0
- package/framework-mcp/src/tools/file_system/replace_text.ts +54 -0
- package/framework-mcp/src/tools/file_system/write_file.ts +45 -0
- package/framework-mcp/src/tools/framework/audit_deps.ts +49 -0
- package/framework-mcp/src/tools/framework/get_status.ts +7 -0
- package/framework-mcp/src/tools/framework/orchestrate.ts +7 -0
- package/framework-mcp/src/tools/framework/run_tests.ts +28 -0
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +7 -0
- package/framework-mcp/src/tools/framework/update_memory.ts +10 -0
- package/framework-mcp/src/tools/index.ts +64 -0
- package/framework-mcp/src/tools/memory/get_insights.ts +41 -0
- package/framework-mcp/src/tools/memory/read_memory.ts +31 -0
- package/framework-mcp/src/tools/messaging/log_action.ts +28 -0
- package/framework-mcp/src/tools/messaging/send_message.ts +97 -0
- package/framework-mcp/src/tools/observability/check_ports.ts +30 -0
- package/framework-mcp/src/tools/observability/get_health.ts +24 -0
- package/framework-mcp/src/tools/quality/check_lint.ts +33 -0
- package/framework-mcp/src/tools/search/get_gaps.ts +54 -0
- package/framework-mcp/src/tools/search/get_map.ts +48 -0
- package/framework-mcp/src/tools/search/grep_search.ts +75 -0
- package/framework-mcp/src/tools/search/list_dir.ts +34 -0
- package/framework-mcp/src/tools/shell/run_command.ts +56 -0
- package/framework-mcp/src/tools/types.ts +89 -0
- package/framework-mcp/src/utils/cli.ts +20 -0
- package/framework-mcp/src/utils/compliance.ts +95 -0
- package/framework-mcp/src/utils/fs.ts +45 -0
- package/framework-mcp/src/utils/metrics.ts +73 -0
- package/framework-mcp/src/utils/security.ts +66 -0
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +212 -0
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +136 -0
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +46 -0
- package/framework-mcp/tests/tools/shell/run_command.test.ts +55 -0
- package/framework-mcp/tsconfig.json +14 -0
- package/mcp.json +13 -0
- package/package.json +89 -0
- package/src/cli/adapters/core.ts +67 -0
- package/src/cli/adapters/index.ts +5 -0
- package/src/cli/adapters/paths.ts +135 -0
- package/src/cli/adapters/scaffold.ts +93 -0
- package/src/cli/adapters/utils.ts +87 -0
- package/src/cli/commands/approve.ts +73 -0
- package/src/cli/commands/check.ts +188 -0
- package/src/cli/commands/compliance.ts +55 -0
- package/src/cli/commands/contract.ts +68 -0
- package/src/cli/commands/explorer.ts +45 -0
- package/src/cli/commands/git.ts +39 -0
- package/src/cli/commands/init/scaffold-core.ts +128 -0
- package/src/cli/commands/init/scaffold-ops.ts +83 -0
- package/src/cli/commands/init/scaffold-standards.ts +67 -0
- package/src/cli/commands/init.ts +163 -0
- package/src/cli/commands/knowledge.ts +44 -0
- package/src/cli/commands/lint.ts +23 -0
- package/src/cli/commands/log.ts +37 -0
- package/src/cli/commands/memory.ts +6 -0
- package/src/cli/commands/orchestrate.ts +456 -0
- package/src/cli/commands/plan.ts +113 -0
- package/src/cli/commands/script.ts +20 -0
- package/src/cli/commands/security.ts +38 -0
- package/src/cli/commands/status.ts +44 -0
- package/src/cli/commands/trace.ts +31 -0
- package/src/cli/index.ts +322 -0
- package/src/cli/shims.ts +66 -0
- package/src/cli/utils/claude.ts +63 -0
- package/src/cli/utils/compliance.ts +191 -0
- package/src/cli/utils/config-schema.ts +48 -0
- package/src/cli/utils/fs.ts +170 -0
- package/src/cli/utils/memory.ts +303 -0
- package/src/cli/utils/pkg.ts +317 -0
- package/src/cli/utils/schemas.ts +22 -0
- package/src/cli/utils/string.ts +55 -0
- package/src/cli/utils/time.ts +27 -0
- package/src/cli/utils/ui.ts +66 -0
- package/src/contracts/index.ts +1 -0
- package/src/contracts/tasks.ts +26 -0
- package/src/modules/adapters/definitions.ts +171 -0
- package/src/modules/adapters/registry.ts +27 -0
- package/src/modules/adapters/shared.ts +120 -0
- package/src/modules/adapters/types.ts +16 -0
- package/src/modules/agents/definitions.ts +454 -0
- package/src/modules/agents/registry/analyst.ts +44 -0
- package/src/modules/agents/registry/architect.ts +47 -0
- package/src/modules/agents/registry/backend.ts +47 -0
- package/src/modules/agents/registry/database.ts +43 -0
- package/src/modules/agents/registry/devops.ts +44 -0
- package/src/modules/agents/registry/explorer.ts +41 -0
- package/src/modules/agents/registry/frontend.ts +48 -0
- package/src/modules/agents/registry/git.ts +41 -0
- package/src/modules/agents/registry/manager.ts +58 -0
- package/src/modules/agents/registry/mobile.ts +44 -0
- package/src/modules/agents/registry/native.ts +44 -0
- package/src/modules/agents/registry/quality.ts +46 -0
- package/src/modules/agents/registry/security.ts +42 -0
- package/src/modules/agents/types.ts +37 -0
- package/src/modules/skills/definitions.ts +71 -0
- package/src/schema/agent-lifecycle-schema.json +59 -0
- package/src/shared/constants.ts +218 -0
- package/src/shared/errors.ts +75 -0
- package/src/shared/fs.ts +50 -0
- package/src/shared/logger.ts +139 -0
- package/src/shared/types.ts +20 -0
- package/templates/prompts/bug-fix-recipe.md +20 -0
- package/templates/prompts/contract-design-recipe.md +21 -0
- package/templates/prompts/db-management-recipe.md +25 -0
- package/templates/prompts/deployment-recipe.md +23 -0
- package/templates/prompts/new-feature-recipe.md +19 -0
- package/templates/prompts/performance-optimization-recipe.md +23 -0
- package/templates/prompts/pull-request-template.md +21 -0
- package/templates/prompts/refactoring-recipe.md +21 -0
- package/templates/prompts/security-audit-recipe.md +20 -0
- package/templates/standards/architecture-standards.md +23 -0
- package/templates/standards/auth-standards.md +125 -0
- package/templates/standards/crud-governance.md +21 -0
- package/templates/standards/deployment-standards.md +21 -0
- package/templates/standards/frontend-standards.md +42 -0
- package/templates/standards/github-actions-standards.md +43 -0
- package/templates/standards/governance-standards.md +147 -0
- package/templates/standards/i18n-standards.md +29 -0
- package/templates/standards/kysely-standards.md +47 -0
- package/templates/standards/llm-governance.md +29 -0
- package/templates/standards/logging-and-secrets.md +34 -0
- package/templates/standards/mobile-standards.md +23 -0
- package/templates/standards/observability-standards.md +29 -0
- package/templates/standards/performance-standards.md +29 -0
- package/templates/standards/pino-standards.md +46 -0
- package/templates/standards/playwright-standards.md +54 -0
- package/templates/standards/quality-standards.md +32 -0
- package/templates/standards/react-query-standards.md +72 -0
- package/templates/standards/react-router-standards.md +62 -0
- package/templates/standards/security-audit-standards.md +33 -0
- package/templates/standards/security-standards.md +21 -0
- package/templates/standards/swagger-standards.md +50 -0
- package/templates/standards/tailwind-standards.md +29 -0
- package/templates/standards/testing-standards.md +31 -0
- package/templates/standards/token-economy.md +27 -0
- package/templates/standards/typeorm-standards.md +49 -0
- package/templates/standards/vitest-standards.md +110 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import {
|
|
4
|
+
remapFrameworkContent,
|
|
5
|
+
type AdapterConfig,
|
|
6
|
+
type AdapterId,
|
|
7
|
+
ADAPTERS
|
|
8
|
+
} from "../../adapters/index.js";
|
|
9
|
+
import { SHIM_TEMPLATES } from "../../shims.js";
|
|
10
|
+
import { writeJsonFile, writeTextFile } from "../../utils/fs.js";
|
|
11
|
+
import { getPackageRoot, getPackageVersion } from "../../utils/pkg.js";
|
|
12
|
+
import { ALL_AGENTS } from "../../../modules/agents/definitions.js";
|
|
13
|
+
|
|
14
|
+
const FRAMEWORK_NAME = "Agent Atabey";
|
|
15
|
+
|
|
16
|
+
const COLOR_PALETTES = {
|
|
17
|
+
"Modern Blue": { primary: "#0ea5e9", secondary: "#64748b", accent: "#f43f5e" },
|
|
18
|
+
"Enterprise Slate": { primary: "#334155", secondary: "#94a3b8", accent: "#10b981" },
|
|
19
|
+
"Deep Purple": { primary: "#8b5cf6", secondary: "#d8b4fe", accent: "#f59e0b" }
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function scaffoldConstitution(targetDir: string, frameworkDir: string, adapterId: AdapterId, dryRun: boolean) {
|
|
23
|
+
if (dryRun) return;
|
|
24
|
+
let content = `# šļø ${FRAMEWORK_NAME} ā Constitution\n\nDiscipline and Order.`;
|
|
25
|
+
let readSuccess = false;
|
|
26
|
+
try {
|
|
27
|
+
const templatePath = path.join(getPackageRoot(), "ATABEY.md");
|
|
28
|
+
if (fs.existsSync(templatePath)) {
|
|
29
|
+
content = fs.readFileSync(templatePath, "utf8");
|
|
30
|
+
readSuccess = true;
|
|
31
|
+
}
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.warn(`ā ļø Failed to read global constitution template: ${e}`);
|
|
34
|
+
}
|
|
35
|
+
content = remapFrameworkContent(content, frameworkDir, adapterId);
|
|
36
|
+
const destPath = path.join(targetDir, frameworkDir, "ATABEY.md");
|
|
37
|
+
writeTextFile(destPath, content);
|
|
38
|
+
|
|
39
|
+
console.warn(`ā
Constitution file created inside: ${frameworkDir}/ATABEY.md${readSuccess ? "" : " (default template)"}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function scaffoldFrameworkConfigs(
|
|
43
|
+
targetDir: string,
|
|
44
|
+
fDir: string,
|
|
45
|
+
adapter: AdapterConfig,
|
|
46
|
+
dryRun: boolean,
|
|
47
|
+
selectedPalette: string,
|
|
48
|
+
options?: { unified?: boolean; adapters?: string[] }
|
|
49
|
+
) {
|
|
50
|
+
if (dryRun) return;
|
|
51
|
+
const frameworkDir = path.join(targetDir, fDir);
|
|
52
|
+
const palette = COLOR_PALETTES[selectedPalette as keyof typeof COLOR_PALETTES] || COLOR_PALETTES["Modern Blue"];
|
|
53
|
+
|
|
54
|
+
const config = {
|
|
55
|
+
name: FRAMEWORK_NAME,
|
|
56
|
+
version: getPackageVersion(),
|
|
57
|
+
unified: options?.unified || false,
|
|
58
|
+
adapters: options?.adapters || [adapter.id],
|
|
59
|
+
theme: {
|
|
60
|
+
palette: selectedPalette,
|
|
61
|
+
colors: palette
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
writeJsonFile(path.join(frameworkDir, "config.json"), config, dryRun);
|
|
65
|
+
|
|
66
|
+
// Scaffold shared-facts.json in memory-graph
|
|
67
|
+
const graphDir = path.join(frameworkDir, "memory-graph");
|
|
68
|
+
if (!fs.existsSync(graphDir)) fs.mkdirSync(graphDir, { recursive: true });
|
|
69
|
+
const sharedFactsPath = path.join(graphDir, "shared-facts.json");
|
|
70
|
+
if (!fs.existsSync(sharedFactsPath)) {
|
|
71
|
+
writeJsonFile(sharedFactsPath, {
|
|
72
|
+
project: FRAMEWORK_NAME,
|
|
73
|
+
initializedAt: new Date().toISOString(),
|
|
74
|
+
stack: [],
|
|
75
|
+
policies: []
|
|
76
|
+
}, dryRun);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let statusContent = "# šļø Status\n\n| Agent | State | Active Task | Last Updated | Notes | Extra | Backup |\n|---|---|---|---|---|---|---|\n";
|
|
80
|
+
|
|
81
|
+
const activeAgents = ALL_AGENTS;
|
|
82
|
+
|
|
83
|
+
const initialStatusJson: Record<string, { state: string; task: string; lastUpdated: string }> = {};
|
|
84
|
+
const now = new Date().toISOString();
|
|
85
|
+
|
|
86
|
+
for (const ag of activeAgents) {
|
|
87
|
+
statusContent += "| @" + ag.name + " | READY | Idle | - | - | - | - |\n";
|
|
88
|
+
initialStatusJson[ag.name] = { state: "READY", task: "Idle", lastUpdated: now };
|
|
89
|
+
}
|
|
90
|
+
writeTextFile(path.join(frameworkDir, "STATUS.md"), statusContent);
|
|
91
|
+
|
|
92
|
+
// Populate initial status.json
|
|
93
|
+
const statusJsonPath = path.join(frameworkDir, "memory", "status.json");
|
|
94
|
+
if (!fs.existsSync(path.join(frameworkDir, "memory"))) fs.mkdirSync(path.join(frameworkDir, "memory"), { recursive: true });
|
|
95
|
+
writeJsonFile(statusJsonPath, initialStatusJson, dryRun);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function scaffoldShims(
|
|
99
|
+
projectRoot: string,
|
|
100
|
+
coreDir: string,
|
|
101
|
+
adapterId: AdapterId,
|
|
102
|
+
adapter: AdapterConfig,
|
|
103
|
+
dryRun: boolean,
|
|
104
|
+
unified: boolean = false
|
|
105
|
+
) {
|
|
106
|
+
for (const [name, content] of Object.entries(SHIM_TEMPLATES)) {
|
|
107
|
+
// Normalize: "antigravity-cli" template key needs exact match or prefix match
|
|
108
|
+
const isSelectedAdapter = name === adapterId ||
|
|
109
|
+
name.toLowerCase() === adapterId.split("-")[0].toLowerCase();
|
|
110
|
+
|
|
111
|
+
if (unified || isSelectedAdapter) {
|
|
112
|
+
const shimContent = remapFrameworkContent(content, coreDir, adapterId);
|
|
113
|
+
// In unified mode, each adapter writes its OWN shimFile name.
|
|
114
|
+
// In single-adapter mode, use selected adapter's shimFile.
|
|
115
|
+
const shimAdapter = ADAPTERS[name as AdapterId] || adapter;
|
|
116
|
+
const shimFileName = (unified && !isSelectedAdapter)
|
|
117
|
+
? (shimAdapter.shimFile || `${name.toUpperCase()}.md`) // each adapter's own file
|
|
118
|
+
: (adapter.shimFile || `${name.toUpperCase()}.md`); // selected adapter's file
|
|
119
|
+
|
|
120
|
+
if (!dryRun) writeTextFile(path.join(projectRoot, shimFileName), shimContent);
|
|
121
|
+
if (isSelectedAdapter) {
|
|
122
|
+
console.warn(`ā
Platform shim created: ${shimFileName}`);
|
|
123
|
+
} else if (unified) {
|
|
124
|
+
console.warn(`ā
Unified platform shim added: ${shimFileName}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { writeJsonFile, writeTextFile } from "../../utils/fs.js";
|
|
4
|
+
import { getPackageRoot } from "../../utils/pkg.js";
|
|
5
|
+
import { logger } from "../../../shared/logger.js";
|
|
6
|
+
|
|
7
|
+
export function scaffoldOps(frameworkDir: string, dryRun: boolean) {
|
|
8
|
+
if (dryRun) return;
|
|
9
|
+
|
|
10
|
+
// Scaffold Prompt Recipes
|
|
11
|
+
const promptsPath = path.join(frameworkDir, "prompts");
|
|
12
|
+
if (!fs.existsSync(promptsPath)) fs.mkdirSync(promptsPath, { recursive: true });
|
|
13
|
+
|
|
14
|
+
const recipes = [
|
|
15
|
+
{ file: "refactoring-recipe.md", template: "templates/prompts/refactoring-recipe.md" },
|
|
16
|
+
{ file: "bug-fix-recipe.md", template: "templates/prompts/bug-fix-recipe.md" },
|
|
17
|
+
{ file: "new-feature-recipe.md", template: "templates/prompts/new-feature-recipe.md" },
|
|
18
|
+
{ file: "security-audit-recipe.md", template: "templates/prompts/security-audit-recipe.md" },
|
|
19
|
+
{ file: "db-management-recipe.md", template: "templates/prompts/db-management-recipe.md" },
|
|
20
|
+
{ file: "performance-optimization-recipe.md", template: "templates/prompts/performance-optimization-recipe.md" },
|
|
21
|
+
{ file: "deployment-recipe.md", template: "templates/prompts/deployment-recipe.md" },
|
|
22
|
+
{ file: "contract-design-recipe.md", template: "templates/prompts/contract-design-recipe.md" }
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
for (const recipe of recipes) {
|
|
26
|
+
try {
|
|
27
|
+
const fullTemplatePath = path.join(getPackageRoot(), recipe.template);
|
|
28
|
+
if (fs.existsSync(fullTemplatePath)) {
|
|
29
|
+
const content = fs.readFileSync(fullTemplatePath, "utf8");
|
|
30
|
+
writeTextFile(path.join(promptsPath, recipe.file), content);
|
|
31
|
+
}
|
|
32
|
+
} catch (e) {
|
|
33
|
+
logger.debug(`Failed to scaffold prompt recipe: ${recipe.file}`, e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Scaffold cli-commands.json
|
|
38
|
+
const cliCommands = {
|
|
39
|
+
commands: {
|
|
40
|
+
init: { agent: "manager", description: "Initialize Agent Atabey structure and AI configuration." },
|
|
41
|
+
check: { agent: "quality", description: "Verify framework files and code quality discipline." },
|
|
42
|
+
status: { agent: "manager", description: "Show the current status of the active project phase." },
|
|
43
|
+
"trace:new": { agent: "manager", description: "Generate a new Trace ID to start a task sequence." },
|
|
44
|
+
orchestrate: { agent: "manager", description: "Execute the Hermes message broker loop." },
|
|
45
|
+
"verify-contract": { agent: "architect", description: "Validate type contracts between backend and frontend." },
|
|
46
|
+
"update-contract": { agent: "architect", description: "Update the contract signature hash." }
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
writeJsonFile(path.join(frameworkDir, "cli-commands.json"), cliCommands, dryRun);
|
|
50
|
+
|
|
51
|
+
// Scaffold router/routing_rules.md
|
|
52
|
+
const routerDir = path.join(frameworkDir, "router");
|
|
53
|
+
if (!fs.existsSync(routerDir)) fs.mkdirSync(routerDir, { recursive: true });
|
|
54
|
+
writeTextFile(path.join(routerDir, "routing_rules.md"), "# š” Agent Atabey ā Natural Language & Event Router\n\nRouting engine protocols defined here.");
|
|
55
|
+
|
|
56
|
+
// Scaffold registry/agent_registry.md
|
|
57
|
+
const registryDir = path.join(frameworkDir, "registry");
|
|
58
|
+
if (!fs.existsSync(registryDir)) fs.mkdirSync(registryDir, { recursive: true });
|
|
59
|
+
writeTextFile(path.join(registryDir, "agent_registry.md"), "# šļø Agent Atabey ā Army Registry\n\nList of active agents.");
|
|
60
|
+
|
|
61
|
+
// Scaffold observability files
|
|
62
|
+
const obsDir = path.join(frameworkDir, "observability");
|
|
63
|
+
if (!fs.existsSync(obsDir)) fs.mkdirSync(obsDir, { recursive: true });
|
|
64
|
+
writeTextFile(path.join(obsDir, "audit_log.md"), "# šļø Agent Atabey ā Audit Log\n\n| Timestamp | Agent | Action | Trace ID | Status |\n|---|---|---|---|---|\n");
|
|
65
|
+
writeJsonFile(path.join(obsDir, "metrics.json"), []);
|
|
66
|
+
|
|
67
|
+
// Scaffold .env.example
|
|
68
|
+
const envExamplePath = path.join(process.cwd(), ".env.example");
|
|
69
|
+
if (!fs.existsSync(envExamplePath)) {
|
|
70
|
+
writeTextFile(envExamplePath, "# Agent Atabey - Environment Variables\n\n# Core Settings\nPORT=5858\nNODE_ENV=development\n\n# AI Platform Keys (Fill these in your local .env)\nGEMINI_API_KEY=\nCLAUDE_API_KEY=\nGROK_API_KEY=\n");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Scaffold rules
|
|
74
|
+
const rulesDir = path.join(frameworkDir, "rules");
|
|
75
|
+
if (!fs.existsSync(rulesDir)) fs.mkdirSync(rulesDir, { recursive: true });
|
|
76
|
+
writeTextFile(path.join(rulesDir, "global_rules.mdc"), `---
|
|
77
|
+
description: Global Rules for Agent Atabey Army
|
|
78
|
+
globs: **/*
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
# šļø Agent Atabey ā Global Army Rules
|
|
82
|
+
`);
|
|
83
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { ensureDir, writeTextFile } from "../../utils/fs.js";
|
|
4
|
+
import { getPackageRoot } from "../../utils/pkg.js";
|
|
5
|
+
import { CORE_SKILLS } from "../../../modules/skills/definitions.js";
|
|
6
|
+
|
|
7
|
+
const FRAMEWORK_NAME = "Agent Atabey";
|
|
8
|
+
|
|
9
|
+
export function scaffoldSkills(skillsBaseDir: string, dryRun: boolean) {
|
|
10
|
+
if (dryRun) return;
|
|
11
|
+
ensureDir(skillsBaseDir, dryRun);
|
|
12
|
+
for (const [key, skill] of Object.entries(CORE_SKILLS)) {
|
|
13
|
+
const mdContent = `# š ļø ${FRAMEWORK_NAME} Skill ā ${skill.name}\n\n${skill.description}\n\n## š Associated Tools\n${skill.tools.map(t => `- \`${t}\``).join("\n")}\n\n## š”ļø Core Mandates\n${skill.mandates.join("\n")}\n`;
|
|
14
|
+
writeTextFile(path.join(skillsBaseDir, `${key.toLowerCase()}.md`), mdContent);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function scaffoldStandards(frameworkDir: string, dryRun: boolean) {
|
|
19
|
+
if (dryRun) return;
|
|
20
|
+
const knowledgePath = path.join(frameworkDir, "knowledge");
|
|
21
|
+
if (!fs.existsSync(knowledgePath)) fs.mkdirSync(knowledgePath, { recursive: true });
|
|
22
|
+
|
|
23
|
+
const eslintStandardsContent = `# šļø Agent Atabey ā ESLint Standards
|
|
24
|
+
|
|
25
|
+
This document outlines the strict ESLint coding standards for Agent Atabey projects.
|
|
26
|
+
|
|
27
|
+
## š Core Rules
|
|
28
|
+
- **Indentation:** 4 spaces (strict).
|
|
29
|
+
- **Quotes:** Double quotes (\`"\`) for strings.
|
|
30
|
+
- **Semicolons:** Always terminate statements with a semicolon (\`;\`).
|
|
31
|
+
- **No Explicit Any:** Avoid using \`any\`. Use strongly typed interfaces, generics, or \`unknown\` with type assertions.
|
|
32
|
+
- **Unused Variables:** Warning on unused variables unless prefixed with an underscore (\`_\`).
|
|
33
|
+
`;
|
|
34
|
+
writeTextFile(path.join(knowledgePath, "eslint-standards.md"), eslintStandardsContent);
|
|
35
|
+
|
|
36
|
+
const standards = [
|
|
37
|
+
// āā Supreme Governance (required by @manager, @security, @architect) āāāāāā
|
|
38
|
+
{ file: "governance-standards.md", template: "templates/standards/governance-standards.md", default: "# šļø Agent Atabey ā Governance & Nizam Standards" },
|
|
39
|
+
// āā Core Engineering Standards āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
40
|
+
{ file: "crud-governance.md", template: "templates/standards/crud-governance.md", default: "# šļø Corporate CRUD and Governance Standards" },
|
|
41
|
+
{ file: "architecture-standards.md", template: "templates/standards/architecture-standards.md", default: "# š Corporate Architecture Standards" },
|
|
42
|
+
{ file: "frontend-standards.md", template: "templates/standards/frontend-standards.md", default: "# šØ Corporate Frontend Standards" },
|
|
43
|
+
{ file: "tailwind-standards.md", template: "templates/standards/tailwind-standards.md", default: "# š Corporate Tailwind Standards" },
|
|
44
|
+
{ file: "mobile-standards.md", template: "templates/standards/mobile-standards.md", default: "# š± Corporate Mobile Standards" },
|
|
45
|
+
{ file: "security-standards.md", template: "templates/standards/security-standards.md", default: "# š”ļø Corporate Security Standards" },
|
|
46
|
+
{ file: "quality-standards.md", template: "templates/standards/quality-standards.md", default: "# āļø Corporate Code Quality Standards" },
|
|
47
|
+
{ file: "logging-and-secrets.md", template: "templates/standards/logging-and-secrets.md", default: "# šŖµ Corporate Logging Standards" },
|
|
48
|
+
{ file: "testing-standards.md", template: "templates/standards/testing-standards.md", default: "# š§Ŗ Corporate Testing Standards" },
|
|
49
|
+
{ file: "i18n-standards.md", template: "templates/standards/i18n-standards.md", default: "# š Corporate i18n Standards" },
|
|
50
|
+
{ file: "llm-governance.md", template: "templates/standards/llm-governance.md", default: "# š¤ LLM Governance Standards" },
|
|
51
|
+
{ file: "observability-standards.md", template: "templates/standards/observability-standards.md", default: "# š Corporate Observability Standards" },
|
|
52
|
+
{ file: "deployment-standards.md", template: "templates/standards/deployment-standards.md", default: "# š Corporate Deployment Standards" },
|
|
53
|
+
{ file: "performance-standards.md", template: "templates/standards/performance-standards.md", default: "# ā” Corporate Performance Standards" },
|
|
54
|
+
{ file: "security-audit-standards.md", template: "templates/standards/security-audit-standards.md", default: "# š Corporate Security Audit Standards" }
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
for (const std of standards) {
|
|
58
|
+
let content = std.default;
|
|
59
|
+
try {
|
|
60
|
+
const fullTemplatePath = path.join(getPackageRoot(), std.template);
|
|
61
|
+
if (fs.existsSync(fullTemplatePath)) {
|
|
62
|
+
content = fs.readFileSync(fullTemplatePath, "utf8");
|
|
63
|
+
}
|
|
64
|
+
} catch { /* fallback to default */ }
|
|
65
|
+
writeTextFile(path.join(knowledgePath, std.file), content);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import readline from "readline";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
resolveAdapter,
|
|
6
|
+
runAdapterPostInit,
|
|
7
|
+
scaffoldAgents,
|
|
8
|
+
resolveAgentsDir,
|
|
9
|
+
mirrorUnifiedAgentsToNative,
|
|
10
|
+
ADAPTER_IDS,
|
|
11
|
+
type AdapterId,
|
|
12
|
+
} from "../adapters/index.js";
|
|
13
|
+
import { ensureDir } from "../utils/fs.js";
|
|
14
|
+
import { initializeMemory, getConfiguredPaths } from "../utils/memory.js";
|
|
15
|
+
import { getPackageVersion } from "../utils/pkg.js";
|
|
16
|
+
import { UI } from "../utils/ui.js";
|
|
17
|
+
|
|
18
|
+
import { ALL_AGENTS } from "../../modules/agents/definitions.js";
|
|
19
|
+
import {
|
|
20
|
+
scaffoldConstitution,
|
|
21
|
+
scaffoldFrameworkConfigs,
|
|
22
|
+
scaffoldShims
|
|
23
|
+
} from "./init/scaffold-core.js";
|
|
24
|
+
import {
|
|
25
|
+
scaffoldSkills,
|
|
26
|
+
scaffoldStandards
|
|
27
|
+
} from "./init/scaffold-standards.js";
|
|
28
|
+
import { scaffoldOps } from "./init/scaffold-ops.js";
|
|
29
|
+
|
|
30
|
+
const FRAMEWORK_NAME = "Agent Atabey";
|
|
31
|
+
|
|
32
|
+
const FRAMEWORK_SUBDIRS = [
|
|
33
|
+
"agents",
|
|
34
|
+
"skills",
|
|
35
|
+
"knowledge",
|
|
36
|
+
"prompts",
|
|
37
|
+
"memory",
|
|
38
|
+
"router",
|
|
39
|
+
"registry",
|
|
40
|
+
"observability",
|
|
41
|
+
"rules",
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
async function runInteractiveInit(): Promise<{ selectedDirs: string[], selectedAgents: string[], selectedPalette: string }> {
|
|
45
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
46
|
+
const question = (query: string): Promise<string> => new Promise((resolve) => rl.question(query, resolve));
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
console.warn(`\nš Welcome to ${FRAMEWORK_NAME} Interactive Setup!`);
|
|
50
|
+
console.warn("\nAvailable Framework Directories:");
|
|
51
|
+
FRAMEWORK_SUBDIRS.forEach((d, i) => console.warn(`${i + 1}. ${d}`));
|
|
52
|
+
const dirInput = await question("\nEnter directory numbers to include (e.g. 1,2,3) or Enter for ALL: ");
|
|
53
|
+
const selectedDirs = dirInput ? dirInput.split(",").map(n => FRAMEWORK_SUBDIRS[parseInt(n.trim()) - 1]).filter(Boolean) : [...FRAMEWORK_SUBDIRS];
|
|
54
|
+
|
|
55
|
+
console.warn("\nAvailable Core Agents:");
|
|
56
|
+
ALL_AGENTS.forEach((a, i) => console.warn(`${i + 1}. ${a.name}`));
|
|
57
|
+
const agentInput = await question("\nEnter agent numbers to include (e.g. 1,2) or Enter for ALL: ");
|
|
58
|
+
const selectedAgents = agentInput ? agentInput.split(",").map(n => ALL_AGENTS[parseInt(n.trim()) - 1].name).filter(Boolean) : ALL_AGENTS.map(a => a.name);
|
|
59
|
+
|
|
60
|
+
console.warn("\nAvailable Color Palettes:");
|
|
61
|
+
const palettes = ["Modern Blue", "Enterprise Slate", "Deep Purple"];
|
|
62
|
+
palettes.forEach((p, i) => console.warn(`${i + 1}. ${p}`));
|
|
63
|
+
const palInput = await question("\nSelect palette (1-3) or Enter for 'Modern Blue': ");
|
|
64
|
+
const selectedPalette = palettes[parseInt(palInput.trim()) - 1] || "Modern Blue";
|
|
65
|
+
|
|
66
|
+
return { selectedDirs, selectedAgents, selectedPalette };
|
|
67
|
+
} finally { rl.close(); }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function initCommand(adapterName: string, options: { unified?: boolean, dryRun?: boolean, yes?: boolean }) {
|
|
71
|
+
const adapterId = (adapterName || "gemini") as AdapterId;
|
|
72
|
+
const adapter = resolveAdapter(adapterId);
|
|
73
|
+
|
|
74
|
+
if (!adapter) {
|
|
75
|
+
UI.error(`Unknown adapter: ${adapterId}`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const projectRoot = process.cwd();
|
|
80
|
+
const isUnified = options.unified || false;
|
|
81
|
+
|
|
82
|
+
// STRICT ISOLATION STRATEGY
|
|
83
|
+
const coreDir = ".atabey"; // Pure Memory & Knowledge
|
|
84
|
+
const aiToolDir = isUnified ? ".agents" : adapter.frameworkDir; // Pure Agents & Skills
|
|
85
|
+
|
|
86
|
+
const dryRun = options.dryRun || false;
|
|
87
|
+
const forceYes = options.yes || false;
|
|
88
|
+
|
|
89
|
+
UI.intent("Atabey Initialization", `Bootstrapping ${FRAMEWORK_NAME} (v${getPackageVersion()}) with ${adapterId} adapter...`);
|
|
90
|
+
|
|
91
|
+
let selectedDirs: string[];
|
|
92
|
+
let selectedAgents: string[];
|
|
93
|
+
let selectedPalette: string;
|
|
94
|
+
|
|
95
|
+
if (forceYes) {
|
|
96
|
+
selectedDirs = ["knowledge", "prompts", "memory", "router", "registry", "observability", "rules"];
|
|
97
|
+
selectedAgents = ALL_AGENTS.map(a => a.name);
|
|
98
|
+
selectedPalette = "Modern Blue";
|
|
99
|
+
UI.success(`Non-interactive mode: Using default configurations.`);
|
|
100
|
+
} else {
|
|
101
|
+
const result = await runInteractiveInit();
|
|
102
|
+
selectedDirs = result.selectedDirs.filter(d => d !== "agents" && d !== "skills");
|
|
103
|
+
selectedAgents = result.selectedAgents;
|
|
104
|
+
selectedPalette = result.selectedPalette;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
ensureDir(path.join(projectRoot, coreDir), dryRun);
|
|
108
|
+
selectedDirs.forEach(dir => {
|
|
109
|
+
ensureDir(path.join(projectRoot, coreDir, dir), dryRun);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
ensureDir(path.join(projectRoot, aiToolDir), dryRun);
|
|
113
|
+
if (adapter.nestedDirs) {
|
|
114
|
+
adapter.nestedDirs.forEach(dir => ensureDir(path.join(projectRoot, aiToolDir, dir), dryRun));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
scaffoldConstitution(projectRoot, coreDir, adapterId, dryRun);
|
|
118
|
+
scaffoldFrameworkConfigs(projectRoot, coreDir, adapter, dryRun, selectedPalette, {
|
|
119
|
+
unified: isUnified,
|
|
120
|
+
adapters: isUnified ? [...ADAPTER_IDS] : [adapterId]
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
scaffoldStandards(path.join(projectRoot, coreDir), dryRun);
|
|
124
|
+
|
|
125
|
+
const pathsMap = getConfiguredPaths();
|
|
126
|
+
|
|
127
|
+
if (isUnified) {
|
|
128
|
+
// Scaffold ALL agents for ALL adapters under unified hub
|
|
129
|
+
for (const id of ADAPTER_IDS) {
|
|
130
|
+
const dest = resolveAgentsDir(id, true, aiToolDir);
|
|
131
|
+
scaffoldAgents(projectRoot, id, dryRun, selectedAgents, dest.agentsDir, dest.agentsExt, pathsMap);
|
|
132
|
+
if (!dryRun) mirrorUnifiedAgentsToNative(projectRoot, id);
|
|
133
|
+
}
|
|
134
|
+
UI.success(`ā
Scaffolding complete for all adapters under ${aiToolDir}/ with native mirrors.`);
|
|
135
|
+
} else {
|
|
136
|
+
// Standard single-adapter scaffold
|
|
137
|
+
const dest = resolveAgentsDir(adapterId, false);
|
|
138
|
+
scaffoldAgents(projectRoot, adapterId, dryRun, selectedAgents, dest.agentsDir, dest.agentsExt, pathsMap);
|
|
139
|
+
UI.success(`ā
Generated agent definitions under ${dest.agentsDir}/`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const skillsBaseDir = path.join(projectRoot, aiToolDir, "skills");
|
|
143
|
+
scaffoldSkills(skillsBaseDir, dryRun);
|
|
144
|
+
scaffoldOps(path.join(projectRoot, coreDir), dryRun);
|
|
145
|
+
scaffoldShims(projectRoot, coreDir, adapterId, adapter, dryRun, isUnified);
|
|
146
|
+
|
|
147
|
+
// Initialize runtime directories
|
|
148
|
+
if (!dryRun) {
|
|
149
|
+
ensureDir(path.join(projectRoot, coreDir, "messages"));
|
|
150
|
+
ensureDir(path.join(projectRoot, coreDir, "logs"));
|
|
151
|
+
ensureDir(path.join(projectRoot, coreDir, "memory-graph"));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
initializeMemory(path.join(projectRoot, coreDir), dryRun);
|
|
155
|
+
runAdapterPostInit(adapter, projectRoot);
|
|
156
|
+
|
|
157
|
+
UI.success(`\nš ${FRAMEWORK_NAME} (v${getPackageVersion()}) initialized successfully!`);
|
|
158
|
+
console.warn(`\n- Brain & Memory Hub (Protected): ${coreDir}/`);
|
|
159
|
+
console.warn(`- AI Agent Commands (Active): ${aiToolDir}/`);
|
|
160
|
+
console.warn("\nNext Steps:");
|
|
161
|
+
console.warn(" 1. Run 'atabey status' to verify the environment.");
|
|
162
|
+
console.warn(` 2. Open ${adapterId === "claude" ? "Claude Desktop" : "your AI Assistant"} and start commanding the Army.`);
|
|
163
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { getFrameworkDir } from "../utils/memory.js";
|
|
5
|
+
|
|
6
|
+
import { writeTextFile } from "../utils/fs.js";
|
|
7
|
+
|
|
8
|
+
export async function updateKnowledgeBaseCommand(topic: string, content: string) {
|
|
9
|
+
if (!topic || !content) {
|
|
10
|
+
console.error("ā Usage: atabey update_knowledge_base <topic> <content>");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const frameworkDir = getFrameworkDir();
|
|
14
|
+
const kbDir = path.join(frameworkDir, "knowledge");
|
|
15
|
+
if (!fs.existsSync(kbDir)) fs.mkdirSync(kbDir, { recursive: true });
|
|
16
|
+
const fileName = topic.replace(/[^a-z0-9]/gi, "_").toLowerCase() + ".md";
|
|
17
|
+
writeTextFile(path.join(kbDir, fileName), content);
|
|
18
|
+
console.warn(`ā
Knowledge base updated: ${topic}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function searchKnowledgeBaseCommand(query: string) {
|
|
22
|
+
if (!query) {
|
|
23
|
+
console.error("ā Usage: atabey search_knowledge_base <query>");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const frameworkDir = getFrameworkDir();
|
|
27
|
+
const kbDir = path.join(frameworkDir, "knowledge");
|
|
28
|
+
if (!fs.existsSync(kbDir)) {
|
|
29
|
+
console.warn("ā¹ļø Knowledge base is empty.");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const files = fs.readdirSync(kbDir).filter(f => f.endsWith(".md"));
|
|
33
|
+
let found = false;
|
|
34
|
+
for (const file of files) {
|
|
35
|
+
const content = fs.readFileSync(path.join(kbDir, file), "utf-8");
|
|
36
|
+
if (content.toLowerCase().includes(query.toLowerCase()) || file.toLowerCase().includes(query.toLowerCase())) {
|
|
37
|
+
console.warn(`
|
|
38
|
+
### ${file.replace(".md", "")}
|
|
39
|
+
${content.slice(0, 300)}...`);
|
|
40
|
+
found = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!found) console.warn("ā¹ļø No matching entries found.");
|
|
44
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
|
|
3
|
+
import { getPackageVersion } from "../utils/pkg.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Run ESLint for the project (same as npm run lint).
|
|
7
|
+
*/
|
|
8
|
+
export async function lintCommand(): Promise<void> {
|
|
9
|
+
console.warn(`š Running ESLint (v${getPackageVersion()})...`);
|
|
10
|
+
const projectRoot = process.cwd();
|
|
11
|
+
try {
|
|
12
|
+
execSync("npm run lint", {
|
|
13
|
+
cwd: projectRoot,
|
|
14
|
+
stdio: "inherit",
|
|
15
|
+
env: process.env,
|
|
16
|
+
});
|
|
17
|
+
console.warn("\nā
ESLint passed with no errors.");
|
|
18
|
+
} catch {
|
|
19
|
+
console.warn("\nā ESLint reported errors. Fix violations before committing.");
|
|
20
|
+
console.warn(" Tip: npm run lint -- --fix");
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { getFrameworkDir } from "../utils/memory.js";
|
|
5
|
+
import { normalizeAgentName } from "../utils/string.js";
|
|
6
|
+
|
|
7
|
+
import { writeJsonFile } from "../utils/fs.js";
|
|
8
|
+
|
|
9
|
+
export async function logAgentActionCommand(data: { agent?: unknown; action?: string; requestId?: string; traceId?: string; status?: string; summary?: string; files?: string[]; details?: Record<string, unknown> }) {
|
|
10
|
+
const frameworkDir = getFrameworkDir();
|
|
11
|
+
const logsDir = path.join(frameworkDir, "logs");
|
|
12
|
+
if (!fs.existsSync(logsDir)) {
|
|
13
|
+
fs.mkdirSync(logsDir, { recursive: true });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const agent = normalizeAgentName(data.agent);
|
|
17
|
+
const logPath = path.join(logsDir, `${agent}.json`);
|
|
18
|
+
let logs: Record<string, unknown>[] = [];
|
|
19
|
+
|
|
20
|
+
if (fs.existsSync(logPath)) {
|
|
21
|
+
try {
|
|
22
|
+
logs = JSON.parse(fs.readFileSync(logPath, "utf8"));
|
|
23
|
+
if (!Array.isArray(logs)) logs = [];
|
|
24
|
+
} catch {
|
|
25
|
+
logs = [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const newEntry = {
|
|
30
|
+
timestamp: new Date().toISOString(),
|
|
31
|
+
...data,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
logs.push(newEntry);
|
|
35
|
+
writeJsonFile(logPath, logs);
|
|
36
|
+
console.warn(`ā
Logged action to ${frameworkDir}/logs/${agent}.json`);
|
|
37
|
+
}
|