atabey 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATABEY.md +4 -4
- package/README.md +35 -33
- package/bin/cli.js +2 -2
- package/bin/validate-agent-army.js +6 -6
- package/dist/framework-mcp/src/constants.js +1 -1
- package/dist/framework-mcp/src/constants.js.map +1 -1
- package/dist/framework-mcp/src/index.d.ts +1 -0
- package/dist/framework-mcp/src/index.js +30 -5
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/resources/index.d.ts +10 -0
- package/dist/framework-mcp/src/resources/index.js +59 -0
- package/dist/framework-mcp/src/resources/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/control_plane/locking.js +3 -3
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.js +3 -2
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +33 -1
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.js +3 -3
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -5
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/audit_deps.js +2 -2
- package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.js +2 -2
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +10 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js +14 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.js +2 -0
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js +5 -5
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/check_lint.js +2 -2
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.js +3 -3
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/types.d.ts +1 -0
- package/dist/framework-mcp/src/utils/compliance.d.ts +6 -0
- package/dist/framework-mcp/src/utils/compliance.js +158 -5
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/framework-mcp/src/utils/permissions.d.ts +12 -0
- package/dist/framework-mcp/src/utils/permissions.js +72 -0
- package/dist/framework-mcp/src/utils/permissions.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js +84 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +31 -31
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js +92 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +5 -5
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/src/cli/adapters/core.js +1 -1
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.js +2 -2
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +5 -3
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/compliance.js +2 -2
- package/dist/src/cli/commands/compliance.js.map +1 -1
- package/dist/src/cli/commands/contract.js +2 -2
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/dashboard.d.ts +5 -0
- package/dist/src/cli/commands/dashboard.js +124 -0
- package/dist/src/cli/commands/dashboard.js.map +1 -0
- package/dist/src/cli/commands/explorer.js +3 -3
- package/dist/src/cli/commands/explorer.js.map +1 -1
- package/dist/src/cli/commands/git.js +3 -3
- package/dist/src/cli/commands/git.js.map +1 -1
- package/dist/src/cli/commands/init/create-agent.d.ts +4 -0
- package/dist/src/cli/commands/init/create-agent.js +59 -0
- package/dist/src/cli/commands/init/create-agent.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-core.js +11 -7
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-docs.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-docs.js +4 -6
- package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-ops.js +4 -4
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +10 -8
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +26 -10
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/knowledge.js +3 -3
- package/dist/src/cli/commands/knowledge.js.map +1 -1
- package/dist/src/cli/commands/lint.js +2 -2
- package/dist/src/cli/commands/lint.js.map +1 -1
- package/dist/src/cli/commands/log.js +6 -28
- package/dist/src/cli/commands/log.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +10 -17
- package/dist/src/cli/commands/orchestrate.js +92 -341
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +5 -0
- package/dist/src/cli/commands/plan.js +80 -59
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/commands/script.js +3 -3
- package/dist/src/cli/commands/script.js.map +1 -1
- package/dist/src/cli/commands/security.js +2 -2
- package/dist/src/cli/commands/security.js.map +1 -1
- package/dist/src/cli/commands/status.js +65 -8
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/commands/trace.d.ts +4 -0
- package/dist/src/cli/commands/trace.js +83 -2
- package/dist/src/cli/commands/trace.js.map +1 -1
- package/dist/src/cli/index.js +68 -18
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.js +14 -14
- package/dist/src/cli/utils/claude.js +1 -1
- package/dist/src/cli/utils/claude.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +7 -1
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/i18n.d.ts +1 -0
- package/dist/src/cli/utils/i18n.js +2 -0
- package/dist/src/cli/utils/i18n.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +12 -3
- package/dist/src/cli/utils/memory.js +39 -31
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.js +2 -2
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/cli/utils/schemas.d.ts +8 -8
- package/dist/src/cli/utils/ui.js +4 -4
- package/dist/src/cli/utils/ui.js.map +1 -1
- package/dist/src/contracts/tasks.d.ts +2 -2
- package/dist/src/dashboard/vite.config.d.ts +2 -0
- package/dist/src/dashboard/vite.config.js +16 -0
- package/dist/src/dashboard/vite.config.js.map +1 -0
- package/dist/src/modules/adapters/definitions.js +10 -10
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/adapters/shared.js +4 -4
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +19 -0
- package/dist/src/modules/agents/definitions.js +74 -21
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +8 -0
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +7 -0
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +6 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/frontend.js +8 -0
- package/dist/src/modules/agents/registry/frontend.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +6 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/modules/agents/types.d.ts +2 -0
- package/dist/src/modules/engines/evaluation-engine.d.ts +11 -0
- package/dist/src/modules/engines/evaluation-engine.js +103 -0
- package/dist/src/modules/engines/evaluation-engine.js.map +1 -0
- package/dist/src/modules/engines/health-engine.d.ts +16 -0
- package/dist/src/modules/engines/health-engine.js +50 -0
- package/dist/src/modules/engines/health-engine.js.map +1 -0
- package/dist/src/modules/engines/planning-engine.d.ts +25 -0
- package/dist/src/modules/engines/planning-engine.js +79 -0
- package/dist/src/modules/engines/planning-engine.js.map +1 -0
- package/dist/src/modules/engines/risk-engine.d.ts +18 -0
- package/dist/src/modules/engines/risk-engine.js +106 -0
- package/dist/src/modules/engines/risk-engine.js.map +1 -0
- package/dist/src/modules/engines/routing-engine.d.ts +11 -0
- package/dist/src/modules/engines/routing-engine.js +74 -0
- package/dist/src/modules/engines/routing-engine.js.map +1 -0
- package/dist/src/modules/engines/types.d.ts +47 -0
- package/dist/src/modules/engines/types.js +2 -0
- package/dist/src/modules/engines/types.js.map +1 -0
- package/dist/src/shared/constants.d.ts +5 -2
- package/dist/src/shared/constants.js +4 -1
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/src/shared/fs.d.ts +1 -0
- package/dist/src/shared/fs.js +4 -0
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/src/shared/storage.d.ts +60 -0
- package/dist/src/shared/storage.js +208 -0
- package/dist/src/shared/storage.js.map +1 -0
- package/dist/tests/agent-memory-v2.test.d.ts +1 -0
- package/dist/tests/agent-memory-v2.test.js +68 -0
- package/dist/tests/agent-memory-v2.test.js.map +1 -0
- package/dist/tests/agents-definitions.test.js +42 -0
- package/dist/tests/agents-definitions.test.js.map +1 -1
- package/dist/tests/integration/hermes_locking.test.js +7 -10
- package/dist/tests/integration/hermes_locking.test.js.map +1 -1
- package/dist/tests/orchestrate.test.js +5 -1
- package/dist/tests/orchestrate.test.js.map +1 -1
- package/dist/tests/orchestrator-dependencies.test.d.ts +1 -0
- package/dist/tests/orchestrator-dependencies.test.js +52 -0
- package/dist/tests/orchestrator-dependencies.test.js.map +1 -0
- package/dist/tests/plan.test.d.ts +1 -0
- package/dist/tests/plan.test.js +63 -0
- package/dist/tests/plan.test.js.map +1 -0
- package/dist/tests/planning-engine.test.d.ts +1 -0
- package/dist/tests/planning-engine.test.js +50 -0
- package/dist/tests/planning-engine.test.js.map +1 -0
- package/dist/tests/status-cost.test.d.ts +1 -0
- package/dist/tests/status-cost.test.js +54 -0
- package/dist/tests/status-cost.test.js.map +1 -0
- package/dist/tests/status.test.js +8 -7
- package/dist/tests/status.test.js.map +1 -1
- package/dist/tests/trace-replay.test.d.ts +1 -0
- package/dist/tests/trace-replay.test.js +65 -0
- package/dist/tests/trace-replay.test.js.map +1 -0
- package/dist/tests/trace.test.js +14 -7
- package/dist/tests/trace.test.js.map +1 -1
- package/dist/ui/assets/index-Bkt7APzu.css +1 -0
- package/dist/ui/assets/index-CeX-06mI.js +49 -0
- package/dist/ui/index.html +14 -0
- package/package.json +5 -4
- package/templates/prompts/contract-design-recipe.md +1 -1
- package/templates/prompts/db-management-recipe.md +3 -3
- package/templates/prompts/deployment-recipe.md +3 -3
- package/templates/prompts/performance-optimization-recipe.md +3 -3
- package/templates/prompts/pull-request-template.md +2 -2
- package/templates/prompts/security-audit-recipe.md +3 -3
- package/templates/standards/crud-governance.md +1 -1
- package/templates/standards/deployment-standards.md +1 -1
- package/templates/standards/governance-standards.md +1 -1
- package/templates/standards/llm-governance.md +1 -1
- package/templates/standards/nextjs-standards.md +13 -0
- package/templates/standards/observability-standards.md +1 -1
- package/templates/standards/security-audit-standards.md +1 -1
- package/templates/standards/security-standards.md +1 -1
- package/templates/standards/testing-standards.md +1 -1
- package/templates/standards/vite-standards.md +13 -0
- package/framework-mcp/dist/constants.js +0 -64
- package/framework-mcp/dist/index.js +0 -119
- package/framework-mcp/dist/tools/control_plane/locking.js +0 -82
- package/framework-mcp/dist/tools/control_plane/registry.js +0 -34
- package/framework-mcp/dist/tools/definitions.js +0 -290
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +0 -59
- package/framework-mcp/dist/tools/file_system/patch_file.js +0 -29
- package/framework-mcp/dist/tools/file_system/read_file.js +0 -51
- package/framework-mcp/dist/tools/file_system/replace_text.js +0 -45
- package/framework-mcp/dist/tools/file_system/write_file.js +0 -38
- package/framework-mcp/dist/tools/framework/audit_deps.js +0 -41
- package/framework-mcp/dist/tools/framework/get_status.js +0 -5
- package/framework-mcp/dist/tools/framework/orchestrate.js +0 -5
- package/framework-mcp/dist/tools/framework/run_tests.js +0 -27
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +0 -5
- package/framework-mcp/dist/tools/framework/update_memory.js +0 -8
- package/framework-mcp/dist/tools/index.js +0 -60
- package/framework-mcp/dist/tools/memory/get_insights.js +0 -34
- package/framework-mcp/dist/tools/memory/read_memory.js +0 -28
- package/framework-mcp/dist/tools/messaging/log_action.js +0 -22
- package/framework-mcp/dist/tools/messaging/send_message.js +0 -94
- package/framework-mcp/dist/tools/observability/check_ports.js +0 -26
- package/framework-mcp/dist/tools/observability/get_health.js +0 -19
- package/framework-mcp/dist/tools/quality/check_lint.js +0 -30
- package/framework-mcp/dist/tools/search/get_gaps.js +0 -48
- package/framework-mcp/dist/tools/search/get_map.js +0 -43
- package/framework-mcp/dist/tools/search/grep_search.js +0 -75
- package/framework-mcp/dist/tools/search/list_dir.js +0 -28
- package/framework-mcp/dist/tools/shell/run_command.js +0 -56
- package/framework-mcp/dist/utils/cli.js +0 -59
- package/framework-mcp/dist/utils/compliance.js +0 -78
- package/framework-mcp/dist/utils/fs.js +0 -44
- package/framework-mcp/dist/utils/metrics.js +0 -56
- package/framework-mcp/dist/utils/security.js +0 -60
- package/framework-mcp/package-lock.json +0 -1191
- package/framework-mcp/package.json +0 -26
- package/framework-mcp/src/constants.ts +0 -78
- package/framework-mcp/src/declarations.d.ts +0 -17
- package/framework-mcp/src/index.ts +0 -144
- package/framework-mcp/src/tools/control_plane/locking.ts +0 -89
- package/framework-mcp/src/tools/control_plane/registry.ts +0 -38
- package/framework-mcp/src/tools/definitions.ts +0 -292
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +0 -79
- package/framework-mcp/src/tools/file_system/patch_file.ts +0 -39
- package/framework-mcp/src/tools/file_system/read_file.ts +0 -58
- package/framework-mcp/src/tools/file_system/replace_text.ts +0 -54
- package/framework-mcp/src/tools/file_system/write_file.ts +0 -45
- package/framework-mcp/src/tools/framework/audit_deps.ts +0 -49
- package/framework-mcp/src/tools/framework/get_status.ts +0 -7
- package/framework-mcp/src/tools/framework/orchestrate.ts +0 -7
- package/framework-mcp/src/tools/framework/run_tests.ts +0 -30
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +0 -7
- package/framework-mcp/src/tools/framework/update_memory.ts +0 -10
- package/framework-mcp/src/tools/index.ts +0 -64
- package/framework-mcp/src/tools/memory/get_insights.ts +0 -41
- package/framework-mcp/src/tools/memory/read_memory.ts +0 -31
- package/framework-mcp/src/tools/messaging/log_action.ts +0 -28
- package/framework-mcp/src/tools/messaging/send_message.ts +0 -97
- package/framework-mcp/src/tools/observability/check_ports.ts +0 -30
- package/framework-mcp/src/tools/observability/get_health.ts +0 -24
- package/framework-mcp/src/tools/quality/check_lint.ts +0 -36
- package/framework-mcp/src/tools/search/get_gaps.ts +0 -54
- package/framework-mcp/src/tools/search/get_map.ts +0 -48
- package/framework-mcp/src/tools/search/grep_search.ts +0 -75
- package/framework-mcp/src/tools/search/list_dir.ts +0 -34
- package/framework-mcp/src/tools/shell/run_command.ts +0 -66
- package/framework-mcp/src/tools/types.ts +0 -89
- package/framework-mcp/src/utils/cli.ts +0 -53
- package/framework-mcp/src/utils/compliance.ts +0 -95
- package/framework-mcp/src/utils/fs.ts +0 -45
- package/framework-mcp/src/utils/metrics.ts +0 -73
- package/framework-mcp/src/utils/security.ts +0 -66
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +0 -212
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +0 -136
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +0 -46
- package/framework-mcp/tests/tools/shell/run_command.test.ts +0 -55
- package/framework-mcp/tsconfig.json +0 -14
- package/src/cli/adapters/core.ts +0 -91
- package/src/cli/adapters/index.ts +0 -5
- package/src/cli/adapters/paths.ts +0 -135
- package/src/cli/adapters/scaffold.ts +0 -95
- package/src/cli/adapters/utils.ts +0 -87
- package/src/cli/commands/approve.ts +0 -73
- package/src/cli/commands/check.ts +0 -188
- package/src/cli/commands/compliance.ts +0 -55
- package/src/cli/commands/contract.ts +0 -68
- package/src/cli/commands/explorer.ts +0 -45
- package/src/cli/commands/git.ts +0 -39
- package/src/cli/commands/init/scaffold-core.ts +0 -136
- package/src/cli/commands/init/scaffold-docs.ts +0 -44
- package/src/cli/commands/init/scaffold-ops.ts +0 -83
- package/src/cli/commands/init/scaffold-standards.ts +0 -67
- package/src/cli/commands/init.ts +0 -193
- package/src/cli/commands/knowledge.ts +0 -44
- package/src/cli/commands/lint.ts +0 -23
- package/src/cli/commands/log.ts +0 -37
- package/src/cli/commands/memory.ts +0 -6
- package/src/cli/commands/orchestrate.ts +0 -450
- package/src/cli/commands/plan.ts +0 -113
- package/src/cli/commands/script.ts +0 -20
- package/src/cli/commands/security.ts +0 -38
- package/src/cli/commands/status.ts +0 -44
- package/src/cli/commands/trace.ts +0 -31
- package/src/cli/index.ts +0 -322
- package/src/cli/shims.ts +0 -66
- package/src/cli/utils/claude.ts +0 -63
- package/src/cli/utils/compliance.ts +0 -191
- package/src/cli/utils/config-schema.ts +0 -48
- package/src/cli/utils/fs.ts +0 -170
- package/src/cli/utils/i18n.ts +0 -44
- package/src/cli/utils/memory.ts +0 -303
- package/src/cli/utils/pkg.ts +0 -317
- package/src/cli/utils/schemas.ts +0 -22
- package/src/cli/utils/string.ts +0 -55
- package/src/cli/utils/time.ts +0 -27
- package/src/cli/utils/ui.ts +0 -66
- package/src/contracts/index.ts +0 -1
- package/src/contracts/tasks.ts +0 -26
- package/src/modules/adapters/definitions.ts +0 -171
- package/src/modules/adapters/registry.ts +0 -27
- package/src/modules/adapters/shared.ts +0 -120
- package/src/modules/adapters/types.ts +0 -16
- package/src/modules/agents/definitions.ts +0 -460
- package/src/modules/agents/registry/analyst.ts +0 -44
- package/src/modules/agents/registry/architect.ts +0 -47
- package/src/modules/agents/registry/backend.ts +0 -46
- package/src/modules/agents/registry/database.ts +0 -43
- package/src/modules/agents/registry/devops.ts +0 -44
- package/src/modules/agents/registry/explorer.ts +0 -41
- package/src/modules/agents/registry/frontend.ts +0 -48
- package/src/modules/agents/registry/git.ts +0 -41
- package/src/modules/agents/registry/manager.ts +0 -58
- package/src/modules/agents/registry/mobile.ts +0 -44
- package/src/modules/agents/registry/native.ts +0 -44
- package/src/modules/agents/registry/quality.ts +0 -46
- package/src/modules/agents/registry/security.ts +0 -42
- package/src/modules/agents/types.ts +0 -37
- package/src/modules/skills/definitions.ts +0 -71
- package/src/schema/agent-lifecycle-schema.json +0 -59
- package/src/shared/constants.ts +0 -218
- package/src/shared/errors.ts +0 -75
- package/src/shared/fs.ts +0 -50
- package/src/shared/logger.ts +0 -139
- package/src/shared/types.ts +0 -20
- /package/{framework-mcp/dist/tools/types.js → dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts} +0 -0
package/src/cli/utils/pkg.ts
DELETED
|
@@ -1,317 +0,0 @@
|
|
|
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
|
-
}
|
package/src/cli/utils/schemas.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
});
|
package/src/cli/utils/string.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
}
|
package/src/cli/utils/time.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|
package/src/cli/utils/ui.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
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
|
-
};
|
package/src/contracts/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./tasks.js";
|
package/src/contracts/tasks.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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>;
|