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,317 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { writeJsonFile, writeTextFile } from "./fs.js";
|
|
4
|
+
|
|
5
|
+
export function getPackageVersion() {
|
|
6
|
+
const root = getPackageRoot();
|
|
7
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
|
|
8
|
+
return pkg.version;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getPackageManager() {
|
|
12
|
+
const override = process.env.AGENT_ATABEY_PACKAGE_MANAGER || process.env.AGENT_ATABEY_PM || process.env.AI_ATABEY_PACKAGE_MANAGER || process.env.AI_ATABEY_PM;
|
|
13
|
+
if (override) return override.toLowerCase();
|
|
14
|
+
|
|
15
|
+
const userAgent = process.env.npm_config_user_agent || "";
|
|
16
|
+
const npmExecPath = process.env.npm_execpath || "";
|
|
17
|
+
|
|
18
|
+
if (userAgent.includes("pnpm") || npmExecPath.includes("pnpm")) return "pnpm";
|
|
19
|
+
if (userAgent.includes("yarn") || npmExecPath.includes("yarn")) return "yarn";
|
|
20
|
+
|
|
21
|
+
// Check for lockfiles in target directory
|
|
22
|
+
if (fs.existsSync(path.join(process.cwd(), "pnpm-lock.yaml")) || fs.existsSync(path.join(process.cwd(), "pnpm-workspace.yaml"))) return "pnpm";
|
|
23
|
+
if (fs.existsSync(path.join(process.cwd(), "yarn.lock"))) return "yarn";
|
|
24
|
+
|
|
25
|
+
return "npm";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Robustly locates the atabey package root from the currently executing module (src via tsx or bin).
|
|
30
|
+
* Walks up from import.meta.url until it finds package.json with name === "atabey".
|
|
31
|
+
* This ensures getValidatorPath() and getPackageVersion() work correctly both in source tree
|
|
32
|
+
* AND when the package is consumed from node_modules after `npm install atabey` (global or local).
|
|
33
|
+
* Critical for AL validation (validate-agent-army) and cross-adapter inits to work from npm.
|
|
34
|
+
*/
|
|
35
|
+
function findAgentAtabeyPackageRoot(): string {
|
|
36
|
+
let current = path.dirname(new URL(import.meta.url).pathname);
|
|
37
|
+
const root = path.parse(current).root;
|
|
38
|
+
while (current !== root) {
|
|
39
|
+
if (path.basename(current) === "dist") {
|
|
40
|
+
current = path.dirname(current);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const pkgPath = path.join(current, "package.json");
|
|
44
|
+
if (fs.existsSync(pkgPath)) {
|
|
45
|
+
try {
|
|
46
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
47
|
+
if (pkg.name === "atabey") {
|
|
48
|
+
return current;
|
|
49
|
+
}
|
|
50
|
+
} catch {
|
|
51
|
+
// ignore parse errors on intermediate package.jsons (e.g. user's project), continue
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
current = path.dirname(current);
|
|
55
|
+
}
|
|
56
|
+
// Fallback maintains prior behavior for unusual layouts
|
|
57
|
+
const __filenameLocal = new URL(import.meta.url).pathname;
|
|
58
|
+
const __dirnameLocal = path.dirname(__filenameLocal);
|
|
59
|
+
return path.join(__dirnameLocal, "../../..");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function getPackageRoot(): string {
|
|
63
|
+
return findAgentAtabeyPackageRoot();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function getValidatorPath(): string {
|
|
67
|
+
return path.join(getPackageRoot(), "bin", "validate-agent-army.js");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function getDependencyVersions() {
|
|
71
|
+
const root = getPackageRoot();
|
|
72
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
|
|
73
|
+
const devDependencies = pkg.devDependencies || {};
|
|
74
|
+
const dependencies = pkg.dependencies || {};
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
// ── Backend Core ──────────────────────────────────────────
|
|
78
|
+
"fastify": dependencies["fastify"] || "^5.0.0",
|
|
79
|
+
"@fastify/cors": dependencies["@fastify/cors"] || "^11.0.0",
|
|
80
|
+
"@fastify/swagger": dependencies["@fastify/swagger"] || "^9.0.0",
|
|
81
|
+
"@fastify/swagger-ui": dependencies["@fastify/swagger-ui"] || "^5.0.0",
|
|
82
|
+
"@fastify/rate-limit": dependencies["@fastify/rate-limit"] || "^10.0.0",
|
|
83
|
+
"@fastify/static": dependencies["@fastify/static"] || "^8.0.0",
|
|
84
|
+
"zod": dependencies["zod"] || "^3.24.2",
|
|
85
|
+
|
|
86
|
+
// ── Database / ORM ────────────────────────────────────────
|
|
87
|
+
"kysely": dependencies["kysely"] || "^0.27.0",
|
|
88
|
+
"typeorm": dependencies["typeorm"] || "^0.3.0",
|
|
89
|
+
"reflect-metadata": dependencies["reflect-metadata"] || "^0.2.0",
|
|
90
|
+
"pg": dependencies["pg"] || "^8.13.0",
|
|
91
|
+
"better-sqlite3": dependencies["better-sqlite3"] || "^11.0.0",
|
|
92
|
+
|
|
93
|
+
// ── Authentication ────────────────────────────────────────
|
|
94
|
+
"bcrypt": dependencies["bcrypt"] || "^5.1.0",
|
|
95
|
+
"@types/bcrypt": devDependencies["@types/bcrypt"] || "^5.0.0",
|
|
96
|
+
"jsonwebtoken": dependencies["jsonwebtoken"] || "^9.0.0",
|
|
97
|
+
"@types/jsonwebtoken": devDependencies["@types/jsonwebtoken"] || "^9.0.0",
|
|
98
|
+
|
|
99
|
+
// ── Logging ───────────────────────────────────────────────
|
|
100
|
+
"pino": dependencies["pino"] || "^9.0.0",
|
|
101
|
+
"pino-pretty": devDependencies["pino-pretty"] || "^12.0.0",
|
|
102
|
+
|
|
103
|
+
// ── Validation ────────────────────────────────────────────
|
|
104
|
+
"@fastify/type-provider-typebox": dependencies["@fastify/type-provider-typebox"] || "^5.0.0",
|
|
105
|
+
|
|
106
|
+
// Backend devDependencies
|
|
107
|
+
"@types/node": devDependencies["@types/node"] || "^22.13.4",
|
|
108
|
+
"tsx": devDependencies["tsx"] || "^4.19.4",
|
|
109
|
+
"typescript": devDependencies["typescript"] || "^5.9.3",
|
|
110
|
+
"vitest-backend": devDependencies["vitest"] || "^3.0.5",
|
|
111
|
+
|
|
112
|
+
// ── Frontend Core ─────────────────────────────────────────
|
|
113
|
+
"@vitejs/plugin-react": dependencies["@vitejs/plugin-react"] || "^5.0.0",
|
|
114
|
+
"vite": dependencies["vite"] || "^7.0.0",
|
|
115
|
+
"react": dependencies["react"] || "^19.0.0",
|
|
116
|
+
"react-dom": dependencies["react-dom"] || "^19.0.0",
|
|
117
|
+
"lucide-react": dependencies["lucide-react"] || "^0.468.0",
|
|
118
|
+
"react-router-dom": dependencies["react-router-dom"] || "^7.0.0",
|
|
119
|
+
"@tanstack/react-query": dependencies["@tanstack/react-query"] || "^5.0.0",
|
|
120
|
+
|
|
121
|
+
// Frontend devDependencies
|
|
122
|
+
"@types/react": devDependencies["@types/react"] || "^19.0.0",
|
|
123
|
+
"@types/react-dom": devDependencies["@types/react-dom"] || "^19.0.0",
|
|
124
|
+
"vitest-frontend": devDependencies["vitest"] || "^3.0.5",
|
|
125
|
+
|
|
126
|
+
// ── Testing ───────────────────────────────────────────────
|
|
127
|
+
"@playwright/test": devDependencies["@playwright/test"] || "^1.50.0",
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface PackageJson {
|
|
132
|
+
name?: string;
|
|
133
|
+
version?: string;
|
|
134
|
+
type?: string;
|
|
135
|
+
workspaces?: string[];
|
|
136
|
+
dependencies?: Record<string, string>;
|
|
137
|
+
devDependencies?: Record<string, string>;
|
|
138
|
+
peerDependencies?: Record<string, string>;
|
|
139
|
+
optionalDependencies?: Record<string, string>;
|
|
140
|
+
scripts?: Record<string, string>;
|
|
141
|
+
atabey?: Record<string, unknown>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function mergePackageJson(targetPath: string, sourcePath: string): void {
|
|
145
|
+
let targetPkg: PackageJson = {};
|
|
146
|
+
if (fs.existsSync(targetPath)) {
|
|
147
|
+
try {
|
|
148
|
+
targetPkg = JSON.parse(fs.readFileSync(targetPath, "utf8"));
|
|
149
|
+
} catch {
|
|
150
|
+
console.warn("⚠️ Could not parse existing package.json, creating a new one.");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const sourcePkg: PackageJson = JSON.parse(fs.readFileSync(sourcePath, "utf8"));
|
|
155
|
+
|
|
156
|
+
type PackageMap = Record<string, string>;
|
|
157
|
+
const sanitizeDeps = (deps: PackageMap | Record<string, unknown> | undefined): Record<string, string> | undefined => {
|
|
158
|
+
if (!deps) return deps as undefined;
|
|
159
|
+
const cleaned: Record<string, string> = {};
|
|
160
|
+
for (const [name, version] of Object.entries(deps)) {
|
|
161
|
+
cleaned[name] = (typeof version === "string" && version.startsWith("workspace:")) ? "*" : String(version || "");
|
|
162
|
+
}
|
|
163
|
+
return cleaned;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const actualTargetScope = targetPkg.name && targetPkg.name.startsWith("@")
|
|
167
|
+
? targetPkg.name.split("/")[0]
|
|
168
|
+
: (targetPkg.name ? `@${targetPkg.name}` : "");
|
|
169
|
+
|
|
170
|
+
// Cleanup potential leftovers from previous bugged runs where atabey was renamed to target name
|
|
171
|
+
if (actualTargetScope) {
|
|
172
|
+
const scopeName = actualTargetScope.startsWith("@") ? actualTargetScope.slice(1) : actualTargetScope;
|
|
173
|
+
const cleanup = (obj: Record<string, string> | undefined): void => {
|
|
174
|
+
if (!obj) return;
|
|
175
|
+
delete obj[scopeName];
|
|
176
|
+
delete obj[actualTargetScope];
|
|
177
|
+
delete obj["atabey"]; // Will be re-added correctly
|
|
178
|
+
};
|
|
179
|
+
cleanup(targetPkg.devDependencies);
|
|
180
|
+
cleanup(targetPkg.dependencies);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
targetPkg.dependencies = sanitizeDeps({
|
|
184
|
+
...targetPkg.dependencies,
|
|
185
|
+
...sourcePkg.dependencies
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Merge scripts
|
|
189
|
+
const pkgMgr = getPackageManager();
|
|
190
|
+
const runCmd = pkgMgr === "yarn" ? "yarn" : (pkgMgr === "pnpm" ? "pnpm" : "npm run");
|
|
191
|
+
|
|
192
|
+
targetPkg.scripts = {
|
|
193
|
+
...targetPkg.scripts,
|
|
194
|
+
"atabey:status": "atabey status",
|
|
195
|
+
"atabey:trace": "atabey trace:new",
|
|
196
|
+
"atabey:verify": "atabey verify-contract",
|
|
197
|
+
"atabey:check": "atabey check",
|
|
198
|
+
"atabey:test": "vitest run",
|
|
199
|
+
"atabey:test:watch": "vitest",
|
|
200
|
+
"atabey:build": `${runCmd} build --prefix framework-mcp`,
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const sourceDevDeps = sourcePkg.devDependencies || {};
|
|
204
|
+
targetPkg.devDependencies = sanitizeDeps({
|
|
205
|
+
...targetPkg.devDependencies,
|
|
206
|
+
"atabey": `^${sourcePkg.version}`,
|
|
207
|
+
...(sourceDevDeps["@modelcontextprotocol/sdk"] ? {"@modelcontextprotocol/sdk": sourceDevDeps["@modelcontextprotocol/sdk"]} : {}),
|
|
208
|
+
...(sourceDevDeps["zod"] ? {"zod": sourceDevDeps["zod"]} : {}),
|
|
209
|
+
...(sourceDevDeps["ts-morph"] ? {"ts-morph": sourceDevDeps["ts-morph"]} : {}),
|
|
210
|
+
...(sourceDevDeps["typescript"] ? {"typescript": sourceDevDeps["typescript"]} : {}),
|
|
211
|
+
...(sourceDevDeps["@types/node"] ? {"@types/node": sourceDevDeps["@types/node"]} : {}),
|
|
212
|
+
...(sourceDevDeps["tsx"] ? {"tsx": sourceDevDeps["tsx"]} : {}),
|
|
213
|
+
...(sourceDevDeps["vitest"] ? {"vitest": sourceDevDeps["vitest"]} : {}),
|
|
214
|
+
"@pandacss/dev": sourceDevDeps["@pandacss/dev"] || "^1.11.1"
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
if (targetPkg.peerDependencies) {
|
|
218
|
+
targetPkg.peerDependencies = sanitizeDeps(targetPkg.peerDependencies);
|
|
219
|
+
}
|
|
220
|
+
if (targetPkg.optionalDependencies) {
|
|
221
|
+
targetPkg.optionalDependencies = sanitizeDeps(targetPkg.optionalDependencies);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Ensure basic fields
|
|
225
|
+
if (!targetPkg.name) targetPkg.name = path.basename(process.cwd());
|
|
226
|
+
if (!targetPkg.version) targetPkg.version = "0.1.0";
|
|
227
|
+
if (!targetPkg.type) targetPkg.type = "module";
|
|
228
|
+
if (!targetPkg.workspaces) targetPkg.workspaces = ["framework-mcp"];
|
|
229
|
+
|
|
230
|
+
// Add metadata
|
|
231
|
+
targetPkg.atabey = {
|
|
232
|
+
version: sourcePkg.version || "0.0.0",
|
|
233
|
+
initializedAt: new Date().toISOString(),
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
writeJsonFile(targetPath, targetPkg);
|
|
237
|
+
console.warn("✅ package.json updated with Atabey scripts and dependencies.");
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function sanitizeJson(obj: unknown, targetScope = ""): unknown {
|
|
241
|
+
if (typeof obj !== "object" || obj === null) return obj;
|
|
242
|
+
if (Array.isArray(obj)) return obj.map(item => sanitizeJson(item, targetScope));
|
|
243
|
+
const cleaned: Record<string, unknown> = {};
|
|
244
|
+
const record = obj as Record<string, unknown>;
|
|
245
|
+
for (const [key, value] of Object.entries(record)) {
|
|
246
|
+
let finalKey = key;
|
|
247
|
+
let finalValue = value;
|
|
248
|
+
|
|
249
|
+
// Remove UnoCSS related keys or values
|
|
250
|
+
if (typeof key === "string" && key.includes("unocss")) continue;
|
|
251
|
+
if (typeof value === "string" && value.includes("unocss")) {
|
|
252
|
+
continue; // Skip this script/field
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Replace scope if needed
|
|
256
|
+
if (targetScope) {
|
|
257
|
+
const scopeName = targetScope.startsWith("@") ? targetScope.slice(1) : targetScope;
|
|
258
|
+
|
|
259
|
+
// Handle scoped: @atabey/foo -> @target/foo
|
|
260
|
+
if (typeof key === "string" && key.startsWith("@atabey/")) {
|
|
261
|
+
finalKey = key.replace("@atabey/", `${targetScope}/`);
|
|
262
|
+
}
|
|
263
|
+
if (typeof value === "string" && value.startsWith("@atabey/")) {
|
|
264
|
+
finalValue = value.replace("@atabey/", `${targetScope}/`);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Handle unscoped: atabey-foo -> target-foo
|
|
268
|
+
if (typeof key === "string" && key.startsWith("atabey-")) {
|
|
269
|
+
finalKey = key.replace("atabey-", `${scopeName}-`);
|
|
270
|
+
}
|
|
271
|
+
if (typeof value === "string" && value.startsWith("atabey-")) {
|
|
272
|
+
finalValue = value.replace("atabey-", `${scopeName}-`);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Handle atabey -> target (ONLY for the package name)
|
|
276
|
+
if (key === "name" && value === "atabey") {
|
|
277
|
+
finalValue = scopeName;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Preserve atabey in dependencies and bin
|
|
281
|
+
// (No action needed as finalKey/finalValue default to original)
|
|
282
|
+
|
|
283
|
+
if (typeof value === "string" && value.startsWith("workspace:")) {
|
|
284
|
+
finalValue = "*";
|
|
285
|
+
}
|
|
286
|
+
} else if (typeof value === "string" && value.startsWith("workspace:")) {
|
|
287
|
+
finalValue = "*";
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
cleaned[finalKey] = (typeof finalValue === "object" && finalValue !== null) ? sanitizeJson(finalValue, targetScope) : finalValue;
|
|
291
|
+
}
|
|
292
|
+
return cleaned;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export function deepCleanProtocols(dir: string, targetScope = ""): void {
|
|
296
|
+
if (!fs.existsSync(dir)) return;
|
|
297
|
+
|
|
298
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
299
|
+
for (const entry of entries) {
|
|
300
|
+
const fullPath = path.join(dir, entry.name);
|
|
301
|
+
if (entry.isDirectory()) {
|
|
302
|
+
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
303
|
+
deepCleanProtocols(fullPath, targetScope);
|
|
304
|
+
} else if (entry.name === "package.json") {
|
|
305
|
+
try {
|
|
306
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
307
|
+
const json = JSON.parse(content);
|
|
308
|
+
const cleaned = JSON.stringify(sanitizeJson(json, targetScope), null, 2);
|
|
309
|
+
writeTextFile(fullPath, cleaned);
|
|
310
|
+
} catch {
|
|
311
|
+
// ignore malformed json
|
|
312
|
+
}
|
|
313
|
+
} else if (entry.name === "package-lock.json") {
|
|
314
|
+
fs.unlinkSync(fullPath);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const StateSchema = z.object({
|
|
4
|
+
phase: z.string(),
|
|
5
|
+
traceId: z.string(),
|
|
6
|
+
managerState: z.enum(["ACTIVE", "IDLE", "PAUSED"]),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const AgentStatusSchema = z.record(z.object({
|
|
10
|
+
state: z.enum(["READY", "EXECUTING", "BLOCKED", "TIMEOUT", "WAITING", "IDLE"]),
|
|
11
|
+
task: z.string(),
|
|
12
|
+
lastUpdated: z.string().optional(),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
export const TaskSchema = z.object({
|
|
16
|
+
traceId: z.string(),
|
|
17
|
+
description: z.string(),
|
|
18
|
+
agent: z.string(),
|
|
19
|
+
priority: z.enum(["P1", "P2", "P3", "HIGH", "NORMAL", "LOW"]),
|
|
20
|
+
status: z.enum(["PENDING", "IN_PROGRESS", "APPROVED", "COMPLETED"]),
|
|
21
|
+
createdAt: z.string(),
|
|
22
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function insertTaskRow(memoryContent: string, row: string): string | null {
|
|
2
|
+
const sectionHeader = "## ACTIVE TASKS";
|
|
3
|
+
const tableDivider = "| :--- | :--- | :--- | :--- | :--- |";
|
|
4
|
+
const sectionIndex = memoryContent.indexOf(sectionHeader);
|
|
5
|
+
if (sectionIndex === -1) return null;
|
|
6
|
+
const dividerIndex = memoryContent.indexOf(tableDivider, sectionIndex);
|
|
7
|
+
if (dividerIndex === -1) return null;
|
|
8
|
+
const dividerLineEnd = memoryContent.indexOf("\n", dividerIndex);
|
|
9
|
+
if (dividerLineEnd === -1) return null;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
memoryContent.slice(0, dividerLineEnd + 1) +
|
|
13
|
+
`${row}\n` +
|
|
14
|
+
memoryContent.slice(dividerLineEnd + 1)
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function sanitizeInput(input: string): string {
|
|
19
|
+
return String(input)
|
|
20
|
+
.replace(/\\/g, "\\\\")
|
|
21
|
+
.replace(/"/g, "\\\"")
|
|
22
|
+
.replace(/[\r\n]+/g, " ")
|
|
23
|
+
.replace(/<script\b[^>]*>([\s\S]*?)<\/script>/gim, "")
|
|
24
|
+
.replace(/--/g, "-")
|
|
25
|
+
.trim();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function sanitizeTableCell(value: unknown): string {
|
|
29
|
+
return sanitizeInput(String(value)).replace(/\|/g, "\\|");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function normalizeAgentName(agent?: unknown): string {
|
|
33
|
+
return String(agent || "manager").replace(/^@+/, "").trim() || "manager";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function normalizePriority(priority?: unknown): string {
|
|
37
|
+
const normalized = String(priority || "P2").toUpperCase().trim();
|
|
38
|
+
return /^P[0-3]$/.test(normalized) ? normalized : "P2";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function slugifyName(value: string): string {
|
|
42
|
+
const slug = String(value || "atabey-app")
|
|
43
|
+
.toLowerCase()
|
|
44
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
45
|
+
.replace(/^-+|-+$/g, "");
|
|
46
|
+
return slug || "atabey-app";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function titleCase(value: string): string {
|
|
50
|
+
return String(value || "Atabey App")
|
|
51
|
+
.replace(/[-_]+/g, " ")
|
|
52
|
+
.replace(/\s+/g, " ")
|
|
53
|
+
.trim()
|
|
54
|
+
.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
55
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function generateULID(seedTime = Date.now(), seed?: number) {
|
|
2
|
+
const ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
3
|
+
const ENCODING_LEN = ENCODING.length;
|
|
4
|
+
let time = seedTime;
|
|
5
|
+
const timeChars = new Array(10);
|
|
6
|
+
for (let i = 9; i >= 0; i--) {
|
|
7
|
+
timeChars[i] = ENCODING.charAt(time % ENCODING_LEN);
|
|
8
|
+
time = Math.floor(time / ENCODING_LEN);
|
|
9
|
+
}
|
|
10
|
+
const randomChars = new Array(16);
|
|
11
|
+
if (seed) {
|
|
12
|
+
let pseudoRandom = seed;
|
|
13
|
+
for (let i = 0; i < 16; i++) {
|
|
14
|
+
pseudoRandom = (pseudoRandom * 16807) % 2147483647;
|
|
15
|
+
randomChars[i] = ENCODING.charAt(pseudoRandom % ENCODING_LEN);
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
for (let i = 0; i < 16; i++) {
|
|
19
|
+
randomChars[i] = ENCODING.charAt(Math.floor(Math.random() * ENCODING_LEN));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return timeChars.join("") + randomChars.join("");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function sleep(ms: number): void {
|
|
26
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
27
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Professional UI Utilities for Agent Atabey CLI.
|
|
5
|
+
* Standardizes headers, status boxes, and strategic intent reporting.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const UI = {
|
|
9
|
+
/**
|
|
10
|
+
* Renders a strategic intent block similar to Gemini CLI's topic updates.
|
|
11
|
+
*/
|
|
12
|
+
intent: (title: string, intent: string) => {
|
|
13
|
+
process.stdout.write(`\n${chalk.bold.cyan(title)}:\n`);
|
|
14
|
+
process.stdout.write(`${chalk.italic.gray(` ${intent}`)}\n\n`);
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Renders a professional agent execution box.
|
|
19
|
+
*/
|
|
20
|
+
agentBox: (agentName: string, action: string, details?: string) => {
|
|
21
|
+
const width = process.stdout.columns || 80;
|
|
22
|
+
const line = "─".repeat(Math.max(0, width - 2));
|
|
23
|
+
|
|
24
|
+
process.stdout.write(chalk.gray(`╭${line}╮`) + "\n");
|
|
25
|
+
const padding = Math.max(0, width - agentName.length - 27);
|
|
26
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.bold.yellow("≡")} ${chalk.white(`Running Agent: ${chalk.bold.green(agentName)}...`)} ${chalk.gray("(ctrl+o to expand)".padStart(padding))} ${chalk.gray("│")}\n`);
|
|
27
|
+
if (action) {
|
|
28
|
+
const paddingAction = Math.max(0, width - action.length - 6);
|
|
29
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.blue("!")} ${chalk.cyan(action)} ${" ".repeat(paddingAction)} ${chalk.gray("│")}\n`);
|
|
30
|
+
}
|
|
31
|
+
if (details) {
|
|
32
|
+
const paddingDetails = Math.max(0, width - details.length - 7);
|
|
33
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.gray(details.slice(0, width - 10))} ${" ".repeat(paddingDetails)} ${chalk.gray("│")}\n`);
|
|
34
|
+
}
|
|
35
|
+
process.stdout.write(chalk.gray(`╰${line}╯`) + "\n");
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Renders a success status message.
|
|
40
|
+
*/
|
|
41
|
+
success: (msg: string) => {
|
|
42
|
+
process.stdout.write(`${chalk.bold.green("✅")} ${msg}\n`);
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Renders an error status message.
|
|
47
|
+
*/
|
|
48
|
+
error: (msg: string) => {
|
|
49
|
+
process.stderr.write(`${chalk.bold.red("❌")} ${chalk.red(msg)}\n`);
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Renders a warning status message.
|
|
54
|
+
*/
|
|
55
|
+
warning: (msg: string) => {
|
|
56
|
+
process.stdout.write(`${chalk.bold.yellow("⚠️")} ${chalk.yellow(msg)}\n`);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Renders an info/divider line.
|
|
61
|
+
*/
|
|
62
|
+
divider: () => {
|
|
63
|
+
const width = process.stdout.columns || 80;
|
|
64
|
+
process.stdout.write(chalk.gray("─".repeat(width)) + "\n");
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tasks.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Standard request contract sent to an agent.
|
|
5
|
+
*/
|
|
6
|
+
export const TaskRequestSchema = z.object({
|
|
7
|
+
traceId: z.string(),
|
|
8
|
+
task: z.string(),
|
|
9
|
+
priority: z.enum(["P1", "P2", "P3", "HIGH", "NORMAL", "LOW"]),
|
|
10
|
+
agent: z.string(),
|
|
11
|
+
context: z.record(z.unknown()).optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type TaskRequest = z.infer<typeof TaskRequestSchema>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Standard response contract sent back by an agent.
|
|
18
|
+
*/
|
|
19
|
+
export const TaskResponseSchema = z.object({
|
|
20
|
+
traceId: z.string(),
|
|
21
|
+
status: z.enum(["SUCCESS", "FAILED", "RETRY", "WAITING_FOR_APPROVAL"]),
|
|
22
|
+
message: z.string().optional(),
|
|
23
|
+
errorCode: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type TaskResponse = z.infer<typeof TaskResponseSchema>;
|