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,136 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { handleSendAgentMessage } from "../../../src/tools/messaging/send_message.js";
|
|
5
|
+
import { ToolArgs } from "../../../src/tools/types.js";
|
|
6
|
+
|
|
7
|
+
const TEST_DIR = path.resolve(__dirname, "../../_temp_messaging_tests");
|
|
8
|
+
const MESSAGES_DIR = path.join(TEST_DIR, ".gemini/messages");
|
|
9
|
+
const BACKEND_LOCK_FILE = path.join(MESSAGES_DIR, "backend.lock");
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
fs.mkdirSync(TEST_DIR, { recursive: true });
|
|
13
|
+
// Write a dummy package.json to test directory to lock frameworkDir as .gemini
|
|
14
|
+
const dummyPkg = {
|
|
15
|
+
name: "test-pkg",
|
|
16
|
+
atabey: {
|
|
17
|
+
frameworkDir: ".gemini"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
fs.writeFileSync(path.join(TEST_DIR, "package.json"), JSON.stringify(dummyPkg, null, 2), "utf8");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
fs.rmSync(TEST_DIR, { recursive: true, force: true });
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe("Hermes Lock Protocol & Message sending", () => {
|
|
28
|
+
it("should successfully send message when lock is not present", async () => {
|
|
29
|
+
const args: ToolArgs = {
|
|
30
|
+
to: "@backend",
|
|
31
|
+
from: "@manager",
|
|
32
|
+
category: "ACTION",
|
|
33
|
+
content: "Build database models",
|
|
34
|
+
traceId: "T-123",
|
|
35
|
+
priority: "HIGH"
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
39
|
+
expect(result.content[0].text).toContain("✅ Message sent to @backend");
|
|
40
|
+
|
|
41
|
+
// Verify the message file contains the sent message
|
|
42
|
+
const messageFilePath = path.join(MESSAGES_DIR, "backend.json");
|
|
43
|
+
expect(fs.existsSync(messageFilePath)).toBe(true);
|
|
44
|
+
|
|
45
|
+
const content = fs.readFileSync(messageFilePath, "utf8");
|
|
46
|
+
const msg = JSON.parse(content.trim());
|
|
47
|
+
expect(msg.from).toBe("@manager");
|
|
48
|
+
expect(msg.to).toBe("@backend");
|
|
49
|
+
expect(msg.category).toBe("ACTION");
|
|
50
|
+
expect(msg.content).toBe("Build database models");
|
|
51
|
+
expect(msg.traceId).toBe("T-123");
|
|
52
|
+
expect(msg.priority).toBe("HIGH");
|
|
53
|
+
expect(msg.status).toBe("PENDING");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("should retry and fail to send message if lock is kept busy", async () => {
|
|
57
|
+
// Prepare a busy lock file
|
|
58
|
+
fs.mkdirSync(MESSAGES_DIR, { recursive: true });
|
|
59
|
+
fs.writeFileSync(BACKEND_LOCK_FILE, "Locked by @test at " + new Date().toISOString(), "utf8");
|
|
60
|
+
|
|
61
|
+
const args: ToolArgs = {
|
|
62
|
+
to: "@backend",
|
|
63
|
+
from: "@manager",
|
|
64
|
+
category: "ACTION",
|
|
65
|
+
content: "Build database models",
|
|
66
|
+
traceId: "T-123"
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const startTime = Date.now();
|
|
70
|
+
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
71
|
+
const duration = Date.now() - startTime;
|
|
72
|
+
|
|
73
|
+
expect(result.isError).toBe(true);
|
|
74
|
+
expect(result.content[0].text).toContain("❌ Could not send message to @backend: Hermes lock is busy.");
|
|
75
|
+
// Retries takes 20 attempts with 500ms delay -> duration should be at least ~9000ms
|
|
76
|
+
expect(duration).toBeGreaterThanOrEqual(9000);
|
|
77
|
+
}, 15000);
|
|
78
|
+
|
|
79
|
+
it("should bypass and acquire lock if existing lock is stale (older than 10s)", async () => {
|
|
80
|
+
fs.mkdirSync(MESSAGES_DIR, { recursive: true });
|
|
81
|
+
// Set lock file mtime to 15 seconds ago
|
|
82
|
+
fs.writeFileSync(BACKEND_LOCK_FILE, "Locked by @test at " + new Date().toISOString(), "utf8");
|
|
83
|
+
const fifteenSecondsAgo = new Date(Date.now() - 15000);
|
|
84
|
+
fs.utimesSync(BACKEND_LOCK_FILE, fifteenSecondsAgo, fifteenSecondsAgo);
|
|
85
|
+
|
|
86
|
+
const args: ToolArgs = {
|
|
87
|
+
to: "@backend",
|
|
88
|
+
from: "@manager",
|
|
89
|
+
category: "ACTION",
|
|
90
|
+
content: "Build database models",
|
|
91
|
+
traceId: "T-123"
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
95
|
+
expect(result.content[0].text).toContain("✅ Message sent to @backend");
|
|
96
|
+
expect(fs.existsSync(BACKEND_LOCK_FILE)).toBe(false); // Lock should have been unlinked in finally
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("should safely resolve concurrent messages and execute them in sequence", async () => {
|
|
100
|
+
const send1Promise = handleSendAgentMessage(TEST_DIR, {
|
|
101
|
+
to: "@backend",
|
|
102
|
+
from: "@manager",
|
|
103
|
+
category: "ACTION",
|
|
104
|
+
content: "Job 1",
|
|
105
|
+
traceId: "T-123"
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Delay starting the second call slightly to make sure lock is acquired by Job 1 first
|
|
109
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
110
|
+
|
|
111
|
+
const send2Promise = handleSendAgentMessage(TEST_DIR, {
|
|
112
|
+
to: "@backend",
|
|
113
|
+
from: "@frontend",
|
|
114
|
+
category: "ACTION",
|
|
115
|
+
content: "Job 2",
|
|
116
|
+
traceId: "T-123"
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const [res1, res2] = await Promise.all([send1Promise, send2Promise]);
|
|
120
|
+
|
|
121
|
+
expect(res1.isError).toBeFalsy();
|
|
122
|
+
expect(res2.isError).toBeFalsy();
|
|
123
|
+
expect(res1.content[0].text).toContain("✅ Message sent to @backend");
|
|
124
|
+
expect(res2.content[0].text).toContain("✅ Message sent to @backend");
|
|
125
|
+
|
|
126
|
+
// Verify both messages exist in order in the message log file
|
|
127
|
+
const messageFilePath = path.join(MESSAGES_DIR, "backend.json");
|
|
128
|
+
const lines = fs.readFileSync(messageFilePath, "utf8").trim().split("\n");
|
|
129
|
+
expect(lines.length).toBe(2);
|
|
130
|
+
|
|
131
|
+
const msg1 = JSON.parse(lines[0]);
|
|
132
|
+
const msg2 = JSON.parse(lines[1]);
|
|
133
|
+
expect(msg1.content).toBe("Job 1");
|
|
134
|
+
expect(msg2.content).toBe("Job 2");
|
|
135
|
+
});
|
|
136
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
+
import { handleCheckLint } from "../../../src/tools/quality/check_lint.js";
|
|
3
|
+
import { exec } from "child_process";
|
|
4
|
+
|
|
5
|
+
vi.mock("child_process");
|
|
6
|
+
|
|
7
|
+
describe("handleCheckLint", () => {
|
|
8
|
+
const projectRoot = "/fake/project";
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.clearAllMocks();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should execute the lint command and return output on success", async () => {
|
|
15
|
+
const args = {};
|
|
16
|
+
|
|
17
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
18
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
19
|
+
callback(null, "All good!", "");
|
|
20
|
+
return {} as any;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const result = await handleCheckLint(projectRoot, args);
|
|
24
|
+
|
|
25
|
+
expect(exec).toHaveBeenCalledWith("npm run lint", { cwd: projectRoot, timeout: 60000 }, expect.any(Function));
|
|
26
|
+
expect(result.isError).toBeUndefined();
|
|
27
|
+
expect(result.content[0].text).toContain("All good!");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should execute the lint command and return output on failure (lint issues found)", async () => {
|
|
31
|
+
const args = {};
|
|
32
|
+
const lintErrorOutput = "Error: 2 problems (2 errors, 0 warnings)";
|
|
33
|
+
|
|
34
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
35
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
36
|
+
callback({ code: 1, message: "Lint errors found" }, lintErrorOutput, "");
|
|
37
|
+
return {} as any;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const result = await handleCheckLint(projectRoot, args);
|
|
41
|
+
|
|
42
|
+
expect(exec).toHaveBeenCalledWith("npm run lint", { cwd: projectRoot, timeout: 60000 }, expect.any(Function));
|
|
43
|
+
expect(result.isError).toBe(true); // Implementation returns isError: true on failure
|
|
44
|
+
expect(result.content[0].text).toContain(lintErrorOutput);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
+
import { handleRunCommand } from "../../../src/tools/shell/run_command.js";
|
|
3
|
+
import { exec } from "child_process";
|
|
4
|
+
|
|
5
|
+
vi.mock("child_process");
|
|
6
|
+
|
|
7
|
+
describe("handleRunCommand", () => {
|
|
8
|
+
const projectRoot = "/fake/project";
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.clearAllMocks();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should execute an allowed command", async () => {
|
|
15
|
+
const args = { command: "git status" };
|
|
16
|
+
|
|
17
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
18
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
19
|
+
callback(null, "On branch main", "");
|
|
20
|
+
return {} as any;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const result = await handleRunCommand(projectRoot, args);
|
|
24
|
+
|
|
25
|
+
expect(exec).toHaveBeenCalledWith("git status", { cwd: projectRoot, timeout: 30000 }, expect.any(Function));
|
|
26
|
+
expect(result.isError).toBeUndefined();
|
|
27
|
+
expect(result.content[0].text).toContain("On branch main");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should reject a disallowed command", async () => {
|
|
31
|
+
const args = { command: "rm -rf /" };
|
|
32
|
+
const result = await handleRunCommand(projectRoot, args);
|
|
33
|
+
|
|
34
|
+
expect(exec).not.toHaveBeenCalled();
|
|
35
|
+
expect(result.isError).toBe(true);
|
|
36
|
+
expect(result.content[0].text).toContain("Command not allowed");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("should handle command failure", async () => {
|
|
40
|
+
const args = { command: "npm run build" };
|
|
41
|
+
|
|
42
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
43
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
44
|
+
callback({ code: 1, message: "Build failed" }, "", "Error details");
|
|
45
|
+
return {} as any;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const result = await handleRunCommand(projectRoot, args);
|
|
49
|
+
|
|
50
|
+
expect(exec).toHaveBeenCalledWith("npm run build", { cwd: projectRoot, timeout: 30000 }, expect.any(Function));
|
|
51
|
+
expect(result.isError).toBe(true);
|
|
52
|
+
expect(result.content[0].text).toContain("Command failed with exit code 1");
|
|
53
|
+
expect(result.content[0].text).toContain("Error details");
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"types": ["node"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*.ts"]
|
|
14
|
+
}
|
package/mcp.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "atabey",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "The Supreme AI Governance & Autonomous Orchestration Framework for Enterprise Development. Acts as a Corporate AI Management Assistant.",
|
|
5
|
+
"author": "Yusuf BEKAR",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"readme": "README.md",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/ysf-bkr/atabey.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/ysf-bkr/atabey#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/ysf-bkr/atabey/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"ai",
|
|
19
|
+
"governance",
|
|
20
|
+
"orchestration",
|
|
21
|
+
"agents",
|
|
22
|
+
"mcp",
|
|
23
|
+
"typescript",
|
|
24
|
+
"framework"
|
|
25
|
+
],
|
|
26
|
+
"workspaces": [
|
|
27
|
+
"framework-mcp",
|
|
28
|
+
"apps/*"
|
|
29
|
+
],
|
|
30
|
+
"bin": {
|
|
31
|
+
"atabey": "bin/cli.js"
|
|
32
|
+
},
|
|
33
|
+
"main": "dist/src/cli/index.js",
|
|
34
|
+
"files": [
|
|
35
|
+
"bin",
|
|
36
|
+
"dist",
|
|
37
|
+
"src",
|
|
38
|
+
"templates",
|
|
39
|
+
"framework-mcp",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE",
|
|
42
|
+
"mcp.json",
|
|
43
|
+
"ATABEY.md"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18.0.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsc && npm run build --prefix framework-mcp",
|
|
50
|
+
"atabey:build": "npm run build --prefix framework-mcp",
|
|
51
|
+
"atabey:test": "vitest run",
|
|
52
|
+
"atabey:test:watch": "vitest",
|
|
53
|
+
"atabey:status": "atabey status",
|
|
54
|
+
"atabey:trace": "atabey trace:new",
|
|
55
|
+
"atabey:verify": "atabey verify-contract",
|
|
56
|
+
"atabey:update-contract": "atabey update-contract",
|
|
57
|
+
"atabey:check": "atabey check",
|
|
58
|
+
"test:init": "node dist/src/cli/index.js init",
|
|
59
|
+
"atabey:lint": "eslint .",
|
|
60
|
+
"lint": "eslint .",
|
|
61
|
+
"prepublishOnly": "npm run build",
|
|
62
|
+
"clean": "rm -rf dist node_modules framework-mcp/node_modules framework-mcp/dist"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@eslint/js": "^10.0.1",
|
|
69
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
70
|
+
"@pandacss/dev": "^1.11.1",
|
|
71
|
+
"@types/node": "^25.9.1",
|
|
72
|
+
"eslint": "^10.4.0",
|
|
73
|
+
"globals": "^17.6.0",
|
|
74
|
+
"tsx": "^4.22.3",
|
|
75
|
+
"typescript": "^5.9.3",
|
|
76
|
+
"typescript-eslint": "^8.0.0",
|
|
77
|
+
"vitest": "^3.0.0"
|
|
78
|
+
},
|
|
79
|
+
"atabey": {
|
|
80
|
+
"version": "0.0.1",
|
|
81
|
+
"initializedAt": "2026-06-14T10:45:00.000Z",
|
|
82
|
+
"frameworkDir": ".atabey"
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"chalk": "^5.6.2",
|
|
86
|
+
"js-yaml": "^4.2.0",
|
|
87
|
+
"zod": "^3.24.2"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { writeJsonFile } from "../utils/fs.js";
|
|
4
|
+
import { getPackageRoot } from "../utils/pkg.js";
|
|
5
|
+
|
|
6
|
+
import { ADAPTER_CONFIGS, POST_INIT_HANDLERS } from "../../modules/adapters/definitions.js";
|
|
7
|
+
import type { AdapterConfig, AdapterId } from "../../modules/adapters/types.js";
|
|
8
|
+
|
|
9
|
+
export const ADAPTERS: Record<AdapterId, AdapterConfig> = ADAPTER_CONFIGS;
|
|
10
|
+
|
|
11
|
+
export const SHIM_FILES = (Object.keys(ADAPTERS) as AdapterId[]).map((id) => ADAPTERS[id].shimFile);
|
|
12
|
+
|
|
13
|
+
export const FRAMEWORK_DIR_CANDIDATES = [
|
|
14
|
+
".atabey",
|
|
15
|
+
".cursor",
|
|
16
|
+
".claude",
|
|
17
|
+
".github",
|
|
18
|
+
".grok",
|
|
19
|
+
".antigravity",
|
|
20
|
+
".agent",
|
|
21
|
+
".gemini/antigravity-cli",
|
|
22
|
+
".gemini",
|
|
23
|
+
".agents",
|
|
24
|
+
"antigravity-cli"
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
export function buildMcpServerEntry(projectRoot: string) {
|
|
28
|
+
const packageRoot = getPackageRoot();
|
|
29
|
+
|
|
30
|
+
// Check both local development workspace path and installed node_modules path
|
|
31
|
+
let mcpServerPath = path.join(packageRoot, "framework-mcp/dist/index.js");
|
|
32
|
+
if (!fs.existsSync(mcpServerPath)) {
|
|
33
|
+
mcpServerPath = path.join(packageRoot, "../@atabey/mcp/dist/index.js");
|
|
34
|
+
}
|
|
35
|
+
if (!fs.existsSync(mcpServerPath)) {
|
|
36
|
+
mcpServerPath = path.join(projectRoot, "node_modules/@atabey/mcp/dist/index.js");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!fs.existsSync(mcpServerPath)) {
|
|
40
|
+
console.warn("⚠️ MCP Server not found. Did you run 'npm run build' inside @atabey/mcp?");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const relativePath = path.relative(projectRoot, mcpServerPath) || mcpServerPath;
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
command: "node",
|
|
47
|
+
args: [relativePath],
|
|
48
|
+
env: {
|
|
49
|
+
ATABEY_PROJECT_ROOT: projectRoot,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function runAdapterPostInit(adapter: AdapterConfig, projectRoot: string): void {
|
|
55
|
+
const mcpEntry = buildMcpServerEntry(projectRoot);
|
|
56
|
+
const mcpBlock = { mcpServers: { "atabey": mcpEntry } };
|
|
57
|
+
|
|
58
|
+
const postInitFn = POST_INIT_HANDLERS[adapter.id];
|
|
59
|
+
if (postInitFn) {
|
|
60
|
+
postInitFn(projectRoot, mcpBlock);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const rootMcpPath = path.join(projectRoot, "mcp.json");
|
|
64
|
+
if (!fs.existsSync(rootMcpPath)) {
|
|
65
|
+
writeJsonFile(rootMcpPath, mcpBlock);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ADAPTER_IDS, type AdapterConfig, type AdapterId, type AdapterRole } from "../../modules/adapters/types.js";
|
|
2
|
+
export { ADAPTERS, FRAMEWORK_DIR_CANDIDATES, runAdapterPostInit, buildMcpServerEntry } from "./core.js";
|
|
3
|
+
export { resolveAdapter, isAdapterShimFile, remapFrameworkContent } from "./utils.js";
|
|
4
|
+
export { scaffoldAgents } from "./scaffold.js";
|
|
5
|
+
export { resolveAgentsDir, mirrorUnifiedAgentsToNative } from "./paths.js";
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import type { AdapterId } from "../../modules/adapters/types.js";
|
|
4
|
+
import { ADAPTER_IDS } from "../../modules/adapters/types.js";
|
|
5
|
+
import {
|
|
6
|
+
LEGACY_AGENT_LAYOUT_BASES,
|
|
7
|
+
UNIFIED_ADAPTER_SLUG,
|
|
8
|
+
UNIFIED_HUB_DIR,
|
|
9
|
+
pathJoin,
|
|
10
|
+
unifiedAdapterPath,
|
|
11
|
+
} from "../../shared/constants.js";
|
|
12
|
+
import { ADAPTERS } from "./core.js";
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
CORE_FRAMEWORK_DIR,
|
|
16
|
+
UNIFIED_HUB_DIR,
|
|
17
|
+
UNIFIED_ADAPTER_SLUG,
|
|
18
|
+
} from "../../shared/constants.js";
|
|
19
|
+
|
|
20
|
+
export interface AgentsDestination {
|
|
21
|
+
agentsDir: string;
|
|
22
|
+
agentsExt: string;
|
|
23
|
+
nestedAntigravity: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function unifiedAdapterRoot(aiToolDir: string, adapterId: AdapterId): string {
|
|
27
|
+
return pathJoin(aiToolDir, UNIFIED_ADAPTER_SLUG[adapterId]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function resolveAgentsDir(
|
|
31
|
+
adapterId: AdapterId,
|
|
32
|
+
isUnified: boolean,
|
|
33
|
+
aiToolDir: string = UNIFIED_HUB_DIR,
|
|
34
|
+
): AgentsDestination {
|
|
35
|
+
const adapter = ADAPTERS[adapterId];
|
|
36
|
+
|
|
37
|
+
if (!isUnified) {
|
|
38
|
+
return {
|
|
39
|
+
agentsDir: adapter.agentsDir ?? pathJoin(adapter.frameworkDir, "agents"),
|
|
40
|
+
agentsExt: adapter.agentsExt ?? ".md",
|
|
41
|
+
nestedAntigravity: adapterId === "antigravity-cli",
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const base = unifiedAdapterRoot(aiToolDir, adapterId);
|
|
46
|
+
|
|
47
|
+
switch (adapterId) {
|
|
48
|
+
case "cursor":
|
|
49
|
+
return { agentsDir: pathJoin(base, "rules"), agentsExt: ".mdc", nestedAntigravity: false };
|
|
50
|
+
case "codex":
|
|
51
|
+
return { agentsDir: pathJoin(base, "instructions"), agentsExt: ".md", nestedAntigravity: false };
|
|
52
|
+
case "antigravity-cli":
|
|
53
|
+
// Antigravity CLI expects workspace agents at .agents/agents/{agent_name}/agent.json
|
|
54
|
+
return { agentsDir: pathJoin(aiToolDir, "agents"), agentsExt: ".json", nestedAntigravity: true };
|
|
55
|
+
default:
|
|
56
|
+
return { agentsDir: pathJoin(base, "agents"), agentsExt: ".md", nestedAntigravity: false };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function getUnifiedAgentLayoutBases(aiToolDir: string = UNIFIED_HUB_DIR): string[] {
|
|
61
|
+
return ADAPTER_IDS.map((id) => resolveAgentsDir(id, true, aiToolDir).agentsDir);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const AGENT_INSTRUCTION_CANDIDATES: Array<(name: string) => string[]> = [
|
|
65
|
+
(n) => ADAPTER_IDS.flatMap((id) => {
|
|
66
|
+
const { agentsDir, nestedAntigravity, agentsExt } = resolveAgentsDir(id, true);
|
|
67
|
+
if (nestedAntigravity) {
|
|
68
|
+
return [pathJoin(agentsDir, n, "agent.json"), pathJoin(agentsDir, n, "agent.md")];
|
|
69
|
+
}
|
|
70
|
+
return [pathJoin(agentsDir, `${n}${agentsExt}`)];
|
|
71
|
+
}),
|
|
72
|
+
(n) => LEGACY_AGENT_LAYOUT_BASES.flatMap((base) => {
|
|
73
|
+
if (base.includes("antigravity")) {
|
|
74
|
+
return [pathJoin(base, n, "agent.json"), pathJoin(base, n, "agent.md")];
|
|
75
|
+
}
|
|
76
|
+
const ext = base.includes("rules") ? ".mdc" : ".md";
|
|
77
|
+
return [pathJoin(base, `${n}${ext}`)];
|
|
78
|
+
}),
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
export function findAgentInstruction(projectRoot: string, agentName: string): string | null {
|
|
82
|
+
for (const buildPaths of AGENT_INSTRUCTION_CANDIDATES) {
|
|
83
|
+
for (const rel of buildPaths(agentName)) {
|
|
84
|
+
const full = path.join(projectRoot, rel);
|
|
85
|
+
if (fs.existsSync(full)) return rel;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function detectActiveAgentLayouts(projectRoot: string): string[] {
|
|
92
|
+
const unified = getUnifiedAgentLayoutBases()
|
|
93
|
+
.filter((b) => fs.existsSync(path.join(projectRoot, b)));
|
|
94
|
+
|
|
95
|
+
const legacy = LEGACY_AGENT_LAYOUT_BASES
|
|
96
|
+
.filter((b) => fs.existsSync(path.join(projectRoot, b)));
|
|
97
|
+
|
|
98
|
+
return [...new Set([...unified, ...legacy])];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function copyDirectoryRecursive(src: string, dest: string): void {
|
|
102
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
103
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
104
|
+
const srcPath = path.join(src, entry.name);
|
|
105
|
+
const destPath = path.join(dest, entry.name);
|
|
106
|
+
if (entry.isDirectory()) {
|
|
107
|
+
copyDirectoryRecursive(srcPath, destPath);
|
|
108
|
+
} else {
|
|
109
|
+
fs.copyFileSync(srcPath, destPath);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function mirrorUnifiedAgentsToNative(projectRoot: string, adapterId: AdapterId): void {
|
|
115
|
+
const { agentsDir: unifiedDir } = resolveAgentsDir(adapterId, true);
|
|
116
|
+
const nativeRel = ADAPTERS[adapterId].agentsDir;
|
|
117
|
+
if (!nativeRel) return;
|
|
118
|
+
|
|
119
|
+
const src = path.join(projectRoot, unifiedDir);
|
|
120
|
+
const dest = path.join(projectRoot, nativeRel);
|
|
121
|
+
if (!fs.existsSync(src) || path.resolve(src) === path.resolve(dest)) return;
|
|
122
|
+
|
|
123
|
+
if (fs.existsSync(dest)) {
|
|
124
|
+
fs.rmSync(dest, { recursive: true, force: true });
|
|
125
|
+
}
|
|
126
|
+
copyDirectoryRecursive(src, dest);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Cursor global rule destinations (native + unified hub). */
|
|
130
|
+
export function getCursorGlobalRulePaths(projectRoot: string): string[] {
|
|
131
|
+
return [
|
|
132
|
+
path.join(projectRoot, ADAPTERS.cursor.frameworkDir, "rules", "global.mdc"),
|
|
133
|
+
path.join(projectRoot, unifiedAdapterPath(UNIFIED_ADAPTER_SLUG.cursor, "rules", "global.mdc")),
|
|
134
|
+
];
|
|
135
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { writeTextFile } from "../utils/fs.js";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import { getPackageRoot } from "../utils/pkg.js";
|
|
5
|
+
import {
|
|
6
|
+
ALL_AGENTS,
|
|
7
|
+
toClaudeCodeMd,
|
|
8
|
+
toGeminiCliMd,
|
|
9
|
+
toCodexMd,
|
|
10
|
+
toAntigravityJson,
|
|
11
|
+
toCursorMdc
|
|
12
|
+
} from "../../modules/agents/definitions.js";
|
|
13
|
+
|
|
14
|
+
import type { AdapterId } from "../../modules/adapters/types.js";
|
|
15
|
+
import { ADAPTERS } from "./core.js";
|
|
16
|
+
|
|
17
|
+
export function scaffoldAgents(
|
|
18
|
+
projectRoot: string,
|
|
19
|
+
adapterId: AdapterId,
|
|
20
|
+
dryRun: boolean,
|
|
21
|
+
agentsToScaffold?: string[],
|
|
22
|
+
explicitDestDir?: string,
|
|
23
|
+
explicitExt?: string,
|
|
24
|
+
paths?: Record<string, string>
|
|
25
|
+
): void {
|
|
26
|
+
const adapter = ADAPTERS[adapterId];
|
|
27
|
+
if (!adapter) return;
|
|
28
|
+
|
|
29
|
+
const allowedAgents = agentsToScaffold ? new Set(agentsToScaffold) : undefined;
|
|
30
|
+
const destAgentsDir = explicitDestDir ? path.join(projectRoot, explicitDestDir) : (adapter.agentsDir ? path.join(projectRoot, adapter.agentsDir) : null);
|
|
31
|
+
const extension = explicitExt || adapter.agentsExt || ".md";
|
|
32
|
+
|
|
33
|
+
if (!destAgentsDir) return;
|
|
34
|
+
|
|
35
|
+
const baseKnowledgeDir = path.join(getPackageRoot(), "templates/standards");
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
if (!dryRun) fs.mkdirSync(destAgentsDir, { recursive: true });
|
|
39
|
+
|
|
40
|
+
for (const agent of ALL_AGENTS) {
|
|
41
|
+
if (allowedAgents && !allowedAgents.has(agent.name)) continue;
|
|
42
|
+
|
|
43
|
+
let content = "";
|
|
44
|
+
let fileName = `${agent.name}${extension}`;
|
|
45
|
+
let secondaryContent: string | null = null;
|
|
46
|
+
let secondaryFileName: string | null = null;
|
|
47
|
+
|
|
48
|
+
switch (adapterId) {
|
|
49
|
+
case "gemini":
|
|
50
|
+
content = toGeminiCliMd(agent, baseKnowledgeDir, paths);
|
|
51
|
+
break;
|
|
52
|
+
case "grok":
|
|
53
|
+
// Grok uses same Gemini-compatible YAML format
|
|
54
|
+
content = toGeminiCliMd(agent, baseKnowledgeDir, paths);
|
|
55
|
+
break;
|
|
56
|
+
case "claude":
|
|
57
|
+
content = toClaudeCodeMd(agent, baseKnowledgeDir, paths);
|
|
58
|
+
break;
|
|
59
|
+
case "cursor":
|
|
60
|
+
content = toCursorMdc(agent, baseKnowledgeDir, paths);
|
|
61
|
+
break;
|
|
62
|
+
case "codex":
|
|
63
|
+
content = toCodexMd(agent, baseKnowledgeDir, paths);
|
|
64
|
+
break;
|
|
65
|
+
case "antigravity-cli": {
|
|
66
|
+
// Antigravity uses nested folders: agents/{name}/agent.json and agents/{name}/agent.md
|
|
67
|
+
const agentDir = path.join(destAgentsDir, agent.name);
|
|
68
|
+
if (!dryRun) fs.mkdirSync(agentDir, { recursive: true });
|
|
69
|
+
|
|
70
|
+
content = toAntigravityJson(agent, baseKnowledgeDir, paths);
|
|
71
|
+
fileName = path.join(agent.name, "agent.json");
|
|
72
|
+
|
|
73
|
+
secondaryContent = `# 🎖️ Agent Atabey — @${agent.name}\n\n${agent.instructions.identity}\n\n${agent.instructions.mission}`;
|
|
74
|
+
secondaryFileName = path.join(agent.name, "agent.md");
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
default:
|
|
78
|
+
// Fallback to Gemini format
|
|
79
|
+
content = toGeminiCliMd(agent, baseKnowledgeDir, paths);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (!dryRun) {
|
|
84
|
+
writeTextFile(path.join(destAgentsDir, fileName), content, dryRun);
|
|
85
|
+
if (secondaryContent && secondaryFileName) {
|
|
86
|
+
writeTextFile(path.join(destAgentsDir, secondaryFileName), secondaryContent, dryRun);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.warn(`⚠️ Failed to scaffold agents for ${adapterId}: ${e}`);
|
|
92
|
+
}
|
|
93
|
+
}
|