atabey 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATABEY.md +4 -4
- package/README.md +35 -33
- package/bin/cli.js +2 -2
- package/bin/validate-agent-army.js +6 -6
- package/dist/framework-mcp/src/constants.js +1 -1
- package/dist/framework-mcp/src/constants.js.map +1 -1
- package/dist/framework-mcp/src/index.d.ts +1 -0
- package/dist/framework-mcp/src/index.js +30 -5
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/resources/index.d.ts +10 -0
- package/dist/framework-mcp/src/resources/index.js +59 -0
- package/dist/framework-mcp/src/resources/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/control_plane/locking.js +3 -3
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.js +3 -2
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +33 -1
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.js +3 -3
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -5
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/audit_deps.js +2 -2
- package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.js +2 -2
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +10 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js +14 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.js +2 -0
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js +5 -5
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/check_lint.js +2 -2
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.js +3 -3
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/types.d.ts +1 -0
- package/dist/framework-mcp/src/utils/compliance.d.ts +6 -0
- package/dist/framework-mcp/src/utils/compliance.js +158 -5
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/framework-mcp/src/utils/permissions.d.ts +12 -0
- package/dist/framework-mcp/src/utils/permissions.js +72 -0
- package/dist/framework-mcp/src/utils/permissions.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js +84 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +31 -31
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js +92 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +5 -5
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/src/cli/adapters/core.js +1 -1
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.js +2 -2
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +5 -3
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/compliance.js +2 -2
- package/dist/src/cli/commands/compliance.js.map +1 -1
- package/dist/src/cli/commands/contract.js +2 -2
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/dashboard.d.ts +5 -0
- package/dist/src/cli/commands/dashboard.js +124 -0
- package/dist/src/cli/commands/dashboard.js.map +1 -0
- package/dist/src/cli/commands/explorer.js +3 -3
- package/dist/src/cli/commands/explorer.js.map +1 -1
- package/dist/src/cli/commands/git.js +3 -3
- package/dist/src/cli/commands/git.js.map +1 -1
- package/dist/src/cli/commands/init/create-agent.d.ts +4 -0
- package/dist/src/cli/commands/init/create-agent.js +59 -0
- package/dist/src/cli/commands/init/create-agent.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-core.js +11 -7
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-docs.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-docs.js +4 -6
- package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-ops.js +4 -4
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +10 -8
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +26 -10
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/knowledge.js +3 -3
- package/dist/src/cli/commands/knowledge.js.map +1 -1
- package/dist/src/cli/commands/lint.js +2 -2
- package/dist/src/cli/commands/lint.js.map +1 -1
- package/dist/src/cli/commands/log.js +6 -28
- package/dist/src/cli/commands/log.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +10 -17
- package/dist/src/cli/commands/orchestrate.js +92 -341
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +5 -0
- package/dist/src/cli/commands/plan.js +80 -59
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/commands/script.js +3 -3
- package/dist/src/cli/commands/script.js.map +1 -1
- package/dist/src/cli/commands/security.js +2 -2
- package/dist/src/cli/commands/security.js.map +1 -1
- package/dist/src/cli/commands/status.js +65 -8
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/commands/trace.d.ts +4 -0
- package/dist/src/cli/commands/trace.js +83 -2
- package/dist/src/cli/commands/trace.js.map +1 -1
- package/dist/src/cli/index.js +68 -18
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.js +14 -14
- package/dist/src/cli/utils/claude.js +1 -1
- package/dist/src/cli/utils/claude.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +7 -1
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/i18n.d.ts +1 -0
- package/dist/src/cli/utils/i18n.js +2 -0
- package/dist/src/cli/utils/i18n.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +12 -3
- package/dist/src/cli/utils/memory.js +39 -31
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.js +2 -2
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/cli/utils/schemas.d.ts +8 -8
- package/dist/src/cli/utils/ui.js +4 -4
- package/dist/src/cli/utils/ui.js.map +1 -1
- package/dist/src/contracts/tasks.d.ts +2 -2
- package/dist/src/dashboard/vite.config.d.ts +2 -0
- package/dist/src/dashboard/vite.config.js +16 -0
- package/dist/src/dashboard/vite.config.js.map +1 -0
- package/dist/src/modules/adapters/definitions.js +10 -10
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/adapters/shared.js +4 -4
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +19 -0
- package/dist/src/modules/agents/definitions.js +74 -21
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +8 -0
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +7 -0
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +6 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/frontend.js +8 -0
- package/dist/src/modules/agents/registry/frontend.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +6 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/modules/agents/types.d.ts +2 -0
- package/dist/src/modules/engines/evaluation-engine.d.ts +11 -0
- package/dist/src/modules/engines/evaluation-engine.js +103 -0
- package/dist/src/modules/engines/evaluation-engine.js.map +1 -0
- package/dist/src/modules/engines/health-engine.d.ts +16 -0
- package/dist/src/modules/engines/health-engine.js +50 -0
- package/dist/src/modules/engines/health-engine.js.map +1 -0
- package/dist/src/modules/engines/planning-engine.d.ts +25 -0
- package/dist/src/modules/engines/planning-engine.js +79 -0
- package/dist/src/modules/engines/planning-engine.js.map +1 -0
- package/dist/src/modules/engines/risk-engine.d.ts +18 -0
- package/dist/src/modules/engines/risk-engine.js +106 -0
- package/dist/src/modules/engines/risk-engine.js.map +1 -0
- package/dist/src/modules/engines/routing-engine.d.ts +11 -0
- package/dist/src/modules/engines/routing-engine.js +74 -0
- package/dist/src/modules/engines/routing-engine.js.map +1 -0
- package/dist/src/modules/engines/types.d.ts +47 -0
- package/dist/src/modules/engines/types.js +2 -0
- package/dist/src/modules/engines/types.js.map +1 -0
- package/dist/src/shared/constants.d.ts +5 -2
- package/dist/src/shared/constants.js +4 -1
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/src/shared/fs.d.ts +1 -0
- package/dist/src/shared/fs.js +4 -0
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/src/shared/storage.d.ts +60 -0
- package/dist/src/shared/storage.js +208 -0
- package/dist/src/shared/storage.js.map +1 -0
- package/dist/tests/agent-memory-v2.test.d.ts +1 -0
- package/dist/tests/agent-memory-v2.test.js +68 -0
- package/dist/tests/agent-memory-v2.test.js.map +1 -0
- package/dist/tests/agents-definitions.test.js +42 -0
- package/dist/tests/agents-definitions.test.js.map +1 -1
- package/dist/tests/integration/hermes_locking.test.js +7 -10
- package/dist/tests/integration/hermes_locking.test.js.map +1 -1
- package/dist/tests/orchestrate.test.js +5 -1
- package/dist/tests/orchestrate.test.js.map +1 -1
- package/dist/tests/orchestrator-dependencies.test.d.ts +1 -0
- package/dist/tests/orchestrator-dependencies.test.js +52 -0
- package/dist/tests/orchestrator-dependencies.test.js.map +1 -0
- package/dist/tests/plan.test.d.ts +1 -0
- package/dist/tests/plan.test.js +63 -0
- package/dist/tests/plan.test.js.map +1 -0
- package/dist/tests/planning-engine.test.d.ts +1 -0
- package/dist/tests/planning-engine.test.js +50 -0
- package/dist/tests/planning-engine.test.js.map +1 -0
- package/dist/tests/status-cost.test.d.ts +1 -0
- package/dist/tests/status-cost.test.js +54 -0
- package/dist/tests/status-cost.test.js.map +1 -0
- package/dist/tests/status.test.js +8 -7
- package/dist/tests/status.test.js.map +1 -1
- package/dist/tests/trace-replay.test.d.ts +1 -0
- package/dist/tests/trace-replay.test.js +65 -0
- package/dist/tests/trace-replay.test.js.map +1 -0
- package/dist/tests/trace.test.js +14 -7
- package/dist/tests/trace.test.js.map +1 -1
- package/dist/ui/assets/index-Bkt7APzu.css +1 -0
- package/dist/ui/assets/index-CeX-06mI.js +49 -0
- package/dist/ui/index.html +14 -0
- package/package.json +5 -4
- package/templates/prompts/contract-design-recipe.md +1 -1
- package/templates/prompts/db-management-recipe.md +3 -3
- package/templates/prompts/deployment-recipe.md +3 -3
- package/templates/prompts/performance-optimization-recipe.md +3 -3
- package/templates/prompts/pull-request-template.md +2 -2
- package/templates/prompts/security-audit-recipe.md +3 -3
- package/templates/standards/crud-governance.md +1 -1
- package/templates/standards/deployment-standards.md +1 -1
- package/templates/standards/governance-standards.md +1 -1
- package/templates/standards/llm-governance.md +1 -1
- package/templates/standards/nextjs-standards.md +13 -0
- package/templates/standards/observability-standards.md +1 -1
- package/templates/standards/security-audit-standards.md +1 -1
- package/templates/standards/security-standards.md +1 -1
- package/templates/standards/testing-standards.md +1 -1
- package/templates/standards/vite-standards.md +13 -0
- package/framework-mcp/dist/constants.js +0 -64
- package/framework-mcp/dist/index.js +0 -119
- package/framework-mcp/dist/tools/control_plane/locking.js +0 -82
- package/framework-mcp/dist/tools/control_plane/registry.js +0 -34
- package/framework-mcp/dist/tools/definitions.js +0 -290
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +0 -59
- package/framework-mcp/dist/tools/file_system/patch_file.js +0 -29
- package/framework-mcp/dist/tools/file_system/read_file.js +0 -51
- package/framework-mcp/dist/tools/file_system/replace_text.js +0 -45
- package/framework-mcp/dist/tools/file_system/write_file.js +0 -38
- package/framework-mcp/dist/tools/framework/audit_deps.js +0 -41
- package/framework-mcp/dist/tools/framework/get_status.js +0 -5
- package/framework-mcp/dist/tools/framework/orchestrate.js +0 -5
- package/framework-mcp/dist/tools/framework/run_tests.js +0 -27
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +0 -5
- package/framework-mcp/dist/tools/framework/update_memory.js +0 -8
- package/framework-mcp/dist/tools/index.js +0 -60
- package/framework-mcp/dist/tools/memory/get_insights.js +0 -34
- package/framework-mcp/dist/tools/memory/read_memory.js +0 -28
- package/framework-mcp/dist/tools/messaging/log_action.js +0 -22
- package/framework-mcp/dist/tools/messaging/send_message.js +0 -94
- package/framework-mcp/dist/tools/observability/check_ports.js +0 -26
- package/framework-mcp/dist/tools/observability/get_health.js +0 -19
- package/framework-mcp/dist/tools/quality/check_lint.js +0 -30
- package/framework-mcp/dist/tools/search/get_gaps.js +0 -48
- package/framework-mcp/dist/tools/search/get_map.js +0 -43
- package/framework-mcp/dist/tools/search/grep_search.js +0 -75
- package/framework-mcp/dist/tools/search/list_dir.js +0 -28
- package/framework-mcp/dist/tools/shell/run_command.js +0 -56
- package/framework-mcp/dist/utils/cli.js +0 -59
- package/framework-mcp/dist/utils/compliance.js +0 -78
- package/framework-mcp/dist/utils/fs.js +0 -44
- package/framework-mcp/dist/utils/metrics.js +0 -56
- package/framework-mcp/dist/utils/security.js +0 -60
- package/framework-mcp/package-lock.json +0 -1191
- package/framework-mcp/package.json +0 -26
- package/framework-mcp/src/constants.ts +0 -78
- package/framework-mcp/src/declarations.d.ts +0 -17
- package/framework-mcp/src/index.ts +0 -144
- package/framework-mcp/src/tools/control_plane/locking.ts +0 -89
- package/framework-mcp/src/tools/control_plane/registry.ts +0 -38
- package/framework-mcp/src/tools/definitions.ts +0 -292
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +0 -79
- package/framework-mcp/src/tools/file_system/patch_file.ts +0 -39
- package/framework-mcp/src/tools/file_system/read_file.ts +0 -58
- package/framework-mcp/src/tools/file_system/replace_text.ts +0 -54
- package/framework-mcp/src/tools/file_system/write_file.ts +0 -45
- package/framework-mcp/src/tools/framework/audit_deps.ts +0 -49
- package/framework-mcp/src/tools/framework/get_status.ts +0 -7
- package/framework-mcp/src/tools/framework/orchestrate.ts +0 -7
- package/framework-mcp/src/tools/framework/run_tests.ts +0 -30
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +0 -7
- package/framework-mcp/src/tools/framework/update_memory.ts +0 -10
- package/framework-mcp/src/tools/index.ts +0 -64
- package/framework-mcp/src/tools/memory/get_insights.ts +0 -41
- package/framework-mcp/src/tools/memory/read_memory.ts +0 -31
- package/framework-mcp/src/tools/messaging/log_action.ts +0 -28
- package/framework-mcp/src/tools/messaging/send_message.ts +0 -97
- package/framework-mcp/src/tools/observability/check_ports.ts +0 -30
- package/framework-mcp/src/tools/observability/get_health.ts +0 -24
- package/framework-mcp/src/tools/quality/check_lint.ts +0 -36
- package/framework-mcp/src/tools/search/get_gaps.ts +0 -54
- package/framework-mcp/src/tools/search/get_map.ts +0 -48
- package/framework-mcp/src/tools/search/grep_search.ts +0 -75
- package/framework-mcp/src/tools/search/list_dir.ts +0 -34
- package/framework-mcp/src/tools/shell/run_command.ts +0 -66
- package/framework-mcp/src/tools/types.ts +0 -89
- package/framework-mcp/src/utils/cli.ts +0 -53
- package/framework-mcp/src/utils/compliance.ts +0 -95
- package/framework-mcp/src/utils/fs.ts +0 -45
- package/framework-mcp/src/utils/metrics.ts +0 -73
- package/framework-mcp/src/utils/security.ts +0 -66
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +0 -212
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +0 -136
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +0 -46
- package/framework-mcp/tests/tools/shell/run_command.test.ts +0 -55
- package/framework-mcp/tsconfig.json +0 -14
- package/src/cli/adapters/core.ts +0 -91
- package/src/cli/adapters/index.ts +0 -5
- package/src/cli/adapters/paths.ts +0 -135
- package/src/cli/adapters/scaffold.ts +0 -95
- package/src/cli/adapters/utils.ts +0 -87
- package/src/cli/commands/approve.ts +0 -73
- package/src/cli/commands/check.ts +0 -188
- package/src/cli/commands/compliance.ts +0 -55
- package/src/cli/commands/contract.ts +0 -68
- package/src/cli/commands/explorer.ts +0 -45
- package/src/cli/commands/git.ts +0 -39
- package/src/cli/commands/init/scaffold-core.ts +0 -136
- package/src/cli/commands/init/scaffold-docs.ts +0 -44
- package/src/cli/commands/init/scaffold-ops.ts +0 -83
- package/src/cli/commands/init/scaffold-standards.ts +0 -67
- package/src/cli/commands/init.ts +0 -193
- package/src/cli/commands/knowledge.ts +0 -44
- package/src/cli/commands/lint.ts +0 -23
- package/src/cli/commands/log.ts +0 -37
- package/src/cli/commands/memory.ts +0 -6
- package/src/cli/commands/orchestrate.ts +0 -450
- package/src/cli/commands/plan.ts +0 -113
- package/src/cli/commands/script.ts +0 -20
- package/src/cli/commands/security.ts +0 -38
- package/src/cli/commands/status.ts +0 -44
- package/src/cli/commands/trace.ts +0 -31
- package/src/cli/index.ts +0 -322
- package/src/cli/shims.ts +0 -66
- package/src/cli/utils/claude.ts +0 -63
- package/src/cli/utils/compliance.ts +0 -191
- package/src/cli/utils/config-schema.ts +0 -48
- package/src/cli/utils/fs.ts +0 -170
- package/src/cli/utils/i18n.ts +0 -44
- package/src/cli/utils/memory.ts +0 -303
- package/src/cli/utils/pkg.ts +0 -317
- package/src/cli/utils/schemas.ts +0 -22
- package/src/cli/utils/string.ts +0 -55
- package/src/cli/utils/time.ts +0 -27
- package/src/cli/utils/ui.ts +0 -66
- package/src/contracts/index.ts +0 -1
- package/src/contracts/tasks.ts +0 -26
- package/src/modules/adapters/definitions.ts +0 -171
- package/src/modules/adapters/registry.ts +0 -27
- package/src/modules/adapters/shared.ts +0 -120
- package/src/modules/adapters/types.ts +0 -16
- package/src/modules/agents/definitions.ts +0 -460
- package/src/modules/agents/registry/analyst.ts +0 -44
- package/src/modules/agents/registry/architect.ts +0 -47
- package/src/modules/agents/registry/backend.ts +0 -46
- package/src/modules/agents/registry/database.ts +0 -43
- package/src/modules/agents/registry/devops.ts +0 -44
- package/src/modules/agents/registry/explorer.ts +0 -41
- package/src/modules/agents/registry/frontend.ts +0 -48
- package/src/modules/agents/registry/git.ts +0 -41
- package/src/modules/agents/registry/manager.ts +0 -58
- package/src/modules/agents/registry/mobile.ts +0 -44
- package/src/modules/agents/registry/native.ts +0 -44
- package/src/modules/agents/registry/quality.ts +0 -46
- package/src/modules/agents/registry/security.ts +0 -42
- package/src/modules/agents/types.ts +0 -37
- package/src/modules/skills/definitions.ts +0 -71
- package/src/schema/agent-lifecycle-schema.json +0 -59
- package/src/shared/constants.ts +0 -218
- package/src/shared/errors.ts +0 -75
- package/src/shared/fs.ts +0 -50
- package/src/shared/logger.ts +0 -139
- package/src/shared/types.ts +0 -20
- /package/{framework-mcp/dist/tools/types.js → dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts} +0 -0
|
@@ -1,136 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
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/src/cli/adapters/core.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
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 if we are running in the framework local development repository itself
|
|
31
|
-
const isLocalFrameworkDev = path.resolve(packageRoot) === path.resolve(projectRoot);
|
|
32
|
-
|
|
33
|
-
let relativePath: string;
|
|
34
|
-
|
|
35
|
-
if (isLocalFrameworkDev) {
|
|
36
|
-
// In local framework dev, always use the build path directly relative to project root
|
|
37
|
-
let mcpServerPath = path.join(packageRoot, "framework-mcp/dist/index.js");
|
|
38
|
-
if (!fs.existsSync(mcpServerPath)) {
|
|
39
|
-
mcpServerPath = path.join(packageRoot, "../atabey-mcp/dist/index.js");
|
|
40
|
-
}
|
|
41
|
-
if (!fs.existsSync(mcpServerPath)) {
|
|
42
|
-
mcpServerPath = path.join(projectRoot, "node_modules/atabey-mcp/dist/index.js");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (!fs.existsSync(mcpServerPath)) {
|
|
46
|
-
console.warn("⚠️ MCP Server not found. Did you run 'npm run build' inside atabey-mcp?");
|
|
47
|
-
}
|
|
48
|
-
relativePath = path.relative(projectRoot, mcpServerPath) || mcpServerPath;
|
|
49
|
-
} else {
|
|
50
|
-
// If we are initializing in a user's project:
|
|
51
|
-
// We want to target the local node_modules of the user's project.
|
|
52
|
-
// Even if node_modules is not populated yet (e.g. running via npx before npm install),
|
|
53
|
-
// we should write the local node_modules path so that it will work once installed.
|
|
54
|
-
|
|
55
|
-
const localAtabeyPath = path.join(projectRoot, "node_modules/atabey/framework-mcp/dist/index.js");
|
|
56
|
-
const localScopedPath = path.join(projectRoot, "node_modules/atabey-mcp/dist/index.js");
|
|
57
|
-
|
|
58
|
-
if (fs.existsSync(localScopedPath)) {
|
|
59
|
-
relativePath = path.relative(projectRoot, localScopedPath);
|
|
60
|
-
} else if (fs.existsSync(localAtabeyPath)) {
|
|
61
|
-
relativePath = path.relative(projectRoot, localAtabeyPath);
|
|
62
|
-
} else {
|
|
63
|
-
// Default to the standard relative local path in node_modules/atabey
|
|
64
|
-
// This is clean and portable across machines/developers.
|
|
65
|
-
relativePath = "node_modules/atabey/framework-mcp/dist/index.js";
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
command: "node",
|
|
71
|
-
args: [relativePath],
|
|
72
|
-
env: {
|
|
73
|
-
ATABEY_PROJECT_ROOT: projectRoot,
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function runAdapterPostInit(adapter: AdapterConfig, projectRoot: string): void {
|
|
79
|
-
const mcpEntry = buildMcpServerEntry(projectRoot);
|
|
80
|
-
const mcpBlock = { mcpServers: { "atabey": mcpEntry } };
|
|
81
|
-
|
|
82
|
-
const postInitFn = POST_INIT_HANDLERS[adapter.id];
|
|
83
|
-
if (postInitFn) {
|
|
84
|
-
postInitFn(projectRoot, mcpBlock);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const rootMcpPath = path.join(projectRoot, "mcp.json");
|
|
88
|
-
if (!fs.existsSync(rootMcpPath)) {
|
|
89
|
-
writeJsonFile(rootMcpPath, mcpBlock);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
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";
|
|
@@ -1,135 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
backendLanguage?: string,
|
|
26
|
-
_language?: string
|
|
27
|
-
): void {
|
|
28
|
-
const adapter = ADAPTERS[adapterId];
|
|
29
|
-
if (!adapter) return;
|
|
30
|
-
|
|
31
|
-
const allowedAgents = agentsToScaffold ? new Set(agentsToScaffold) : undefined;
|
|
32
|
-
const destAgentsDir = explicitDestDir ? path.join(projectRoot, explicitDestDir) : (adapter.agentsDir ? path.join(projectRoot, adapter.agentsDir) : null);
|
|
33
|
-
const extension = explicitExt || adapter.agentsExt || ".md";
|
|
34
|
-
|
|
35
|
-
if (!destAgentsDir) return;
|
|
36
|
-
|
|
37
|
-
const baseKnowledgeDir = path.join(getPackageRoot(), "templates/standards");
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
if (!dryRun) fs.mkdirSync(destAgentsDir, { recursive: true });
|
|
41
|
-
|
|
42
|
-
for (const agent of ALL_AGENTS) {
|
|
43
|
-
if (allowedAgents && !allowedAgents.has(agent.name)) continue;
|
|
44
|
-
|
|
45
|
-
let content = "";
|
|
46
|
-
let fileName = `${agent.name}${extension}`;
|
|
47
|
-
let secondaryContent: string | null = null;
|
|
48
|
-
let secondaryFileName: string | null = null;
|
|
49
|
-
|
|
50
|
-
switch (adapterId) {
|
|
51
|
-
case "gemini":
|
|
52
|
-
content = toGeminiCliMd(agent, baseKnowledgeDir, paths, backendLanguage);
|
|
53
|
-
break;
|
|
54
|
-
case "grok":
|
|
55
|
-
// Grok uses same Gemini-compatible YAML format
|
|
56
|
-
content = toGeminiCliMd(agent, baseKnowledgeDir, paths, backendLanguage);
|
|
57
|
-
break;
|
|
58
|
-
case "claude":
|
|
59
|
-
content = toClaudeCodeMd(agent, baseKnowledgeDir, paths, backendLanguage);
|
|
60
|
-
break;
|
|
61
|
-
case "cursor":
|
|
62
|
-
content = toCursorMdc(agent, baseKnowledgeDir, paths, backendLanguage);
|
|
63
|
-
break;
|
|
64
|
-
case "codex":
|
|
65
|
-
content = toCodexMd(agent, baseKnowledgeDir, paths, backendLanguage);
|
|
66
|
-
break;
|
|
67
|
-
case "antigravity-cli": {
|
|
68
|
-
// Antigravity uses nested folders: agents/{name}/agent.json and agents/{name}/agent.md
|
|
69
|
-
const agentDir = path.join(destAgentsDir, agent.name);
|
|
70
|
-
if (!dryRun) fs.mkdirSync(agentDir, { recursive: true });
|
|
71
|
-
|
|
72
|
-
content = toAntigravityJson(agent, baseKnowledgeDir, paths, backendLanguage);
|
|
73
|
-
fileName = path.join(agent.name, "agent.json");
|
|
74
|
-
|
|
75
|
-
secondaryContent = `# 🎖️ Agent Atabey — @${agent.name}\n\n${agent.instructions.identity}\n\n${agent.instructions.mission}`;
|
|
76
|
-
secondaryFileName = path.join(agent.name, "agent.md");
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
default:
|
|
80
|
-
// Fallback to Gemini format
|
|
81
|
-
content = toGeminiCliMd(agent, baseKnowledgeDir, paths, backendLanguage);
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (!dryRun) {
|
|
86
|
-
writeTextFile(path.join(destAgentsDir, fileName), content, dryRun);
|
|
87
|
-
if (secondaryContent && secondaryFileName) {
|
|
88
|
-
writeTextFile(path.join(destAgentsDir, secondaryFileName), secondaryContent, dryRun);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
} catch (e) {
|
|
93
|
-
console.warn(`⚠️ Failed to scaffold agents for ${adapterId}: ${e}`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { logger } from "../../shared/logger.js";
|
|
4
|
-
import { UI } from "../utils/ui.js";
|
|
5
|
-
|
|
6
|
-
import type { AdapterConfig, AdapterId } from "../../modules/adapters/types.js";
|
|
7
|
-
import { ADAPTERS, SHIM_FILES } from "./core.js";
|
|
8
|
-
|
|
9
|
-
export function resolveAdapter(input?: string): AdapterConfig {
|
|
10
|
-
let normalized = (input || "gemini").toLowerCase();
|
|
11
|
-
if (normalized === "antigravity") {
|
|
12
|
-
normalized = "antigravity-cli";
|
|
13
|
-
} else if (normalized === "copilot" || normalized === "github") {
|
|
14
|
-
normalized = "codex";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let config: AdapterConfig;
|
|
18
|
-
if (normalized in ADAPTERS) {
|
|
19
|
-
config = { ...ADAPTERS[normalized as AdapterId] };
|
|
20
|
-
} else {
|
|
21
|
-
UI.warning(`Unknown adapter "${input}". Falling back to gemini.`);
|
|
22
|
-
config = { ...ADAPTERS.gemini };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return config;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function isAdapterShimFile(fileName: string): boolean {
|
|
29
|
-
return SHIM_FILES.includes(fileName);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function remapFrameworkContent(
|
|
33
|
-
content: string,
|
|
34
|
-
frameworkDir: string,
|
|
35
|
-
adapterId: AdapterId,
|
|
36
|
-
): string {
|
|
37
|
-
let result = content;
|
|
38
|
-
|
|
39
|
-
result = result.replace(/\{\{FRAMEWORK_DIR\}\}/g, frameworkDir);
|
|
40
|
-
result = result.replace(/\{\{ADAPTER\}\}/g, adapterId);
|
|
41
|
-
|
|
42
|
-
let agentFolder = "agents";
|
|
43
|
-
let knowledgeFolder = "knowledge";
|
|
44
|
-
|
|
45
|
-
if (frameworkDir !== ".atabey") {
|
|
46
|
-
if (adapterId === "antigravity-cli") {
|
|
47
|
-
agentFolder = "agents";
|
|
48
|
-
knowledgeFolder = "rules";
|
|
49
|
-
}
|
|
50
|
-
// Note: Grok uses the same directory structure as Gemini (".grok/agents").
|
|
51
|
-
// No override needed — default agentFolder = "agents" is correct.
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const frameworkPattern = ".atabey/";
|
|
55
|
-
result = result.replace(new RegExp(frameworkPattern + "agents/", "g"), `${frameworkDir}/${agentFolder}/`);
|
|
56
|
-
result = result.replace(new RegExp(frameworkPattern + "knowledge/", "g"), `${frameworkDir}/${knowledgeFolder}/`);
|
|
57
|
-
|
|
58
|
-
result = result.replace(/\.atabey\//g, `${frameworkDir}/`);
|
|
59
|
-
result = result.replace(/`\.atabey`/g, `\`${frameworkDir}\``);
|
|
60
|
-
result = result.replace(/\.atabey(?![\w/-])/g, frameworkDir);
|
|
61
|
-
|
|
62
|
-
let backend = "apps/backend";
|
|
63
|
-
let frontend = "apps/web";
|
|
64
|
-
let docs = "docs";
|
|
65
|
-
let tests = "tests";
|
|
66
|
-
try {
|
|
67
|
-
const configPath = path.join(process.cwd(), frameworkDir, "config.json");
|
|
68
|
-
if (fs.existsSync(configPath)) {
|
|
69
|
-
const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
70
|
-
if (config.paths) {
|
|
71
|
-
if (config.paths.backend) backend = config.paths.backend;
|
|
72
|
-
if (config.paths.frontend) frontend = config.paths.frontend;
|
|
73
|
-
if (config.paths.docs) docs = config.paths.docs;
|
|
74
|
-
if (config.paths.tests) tests = config.paths.tests;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
} catch (err) {
|
|
78
|
-
logger.debug("Failed to read config.json in remapFrameworkContent", err);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
result = result.replace(/\{\{BACKEND_DIR\}\}/g, backend);
|
|
82
|
-
result = result.replace(/\{\{FRONTEND_DIR\}\}/g, frontend);
|
|
83
|
-
result = result.replace(/\{\{DOCS_DIR\}\}/g, docs);
|
|
84
|
-
result = result.replace(/\{\{TESTS_DIR\}\}/g, tests);
|
|
85
|
-
|
|
86
|
-
return result;
|
|
87
|
-
}
|