@bpinhosilva/agent-orchestrator 1.0.0-alpha.2 → 1.0.0-alpha.21
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/CHANGELOG.md +147 -0
- package/dist/agents/agents.controller.d.ts +8 -0
- package/dist/agents/agents.controller.js +74 -1
- package/dist/agents/agents.controller.js.map +1 -1
- package/dist/agents/agents.module.js +6 -1
- package/dist/agents/agents.module.js.map +1 -1
- package/dist/agents/agents.service.d.ts +20 -7
- package/dist/agents/agents.service.js +171 -11
- package/dist/agents/agents.service.js.map +1 -1
- package/dist/agents/dto/agent-request.dto.d.ts +1 -0
- package/dist/agents/dto/agent-request.dto.js +12 -0
- package/dist/agents/dto/agent-request.dto.js.map +1 -1
- package/dist/agents/dto/create-agent.dto.d.ts +9 -0
- package/dist/agents/dto/create-agent.dto.js +63 -0
- package/dist/agents/dto/create-agent.dto.js.map +1 -0
- package/dist/agents/dto/update-agent.dto.d.ts +5 -0
- package/dist/agents/dto/update-agent.dto.js +13 -0
- package/dist/agents/dto/update-agent.dto.js.map +1 -0
- package/dist/agents/entities/agent.entity.d.ts +14 -0
- package/dist/agents/entities/agent.entity.js +87 -0
- package/dist/agents/entities/agent.entity.js.map +1 -0
- package/dist/agents/enums/provider.enum.d.ts +4 -0
- package/dist/agents/enums/provider.enum.js +9 -0
- package/dist/agents/enums/provider.enum.js.map +1 -0
- package/dist/agents/implementations/claude.agent.d.ts +27 -0
- package/dist/agents/implementations/claude.agent.js +148 -0
- package/dist/agents/implementations/claude.agent.js.map +1 -0
- package/dist/agents/implementations/gemini.agent.d.ts +23 -1
- package/dist/agents/implementations/gemini.agent.js +156 -21
- package/dist/agents/implementations/gemini.agent.js.map +1 -1
- package/dist/agents/interfaces/agent.interface.d.ts +8 -0
- package/dist/agents/interfaces/agent.interface.js +1 -0
- package/dist/agents/registry/agent.registry.d.ts +5 -0
- package/dist/agents/registry/agent.registry.js +15 -0
- package/dist/agents/registry/agent.registry.js.map +1 -0
- package/dist/app.controller.js +4 -0
- package/dist/app.controller.js.map +1 -1
- package/dist/app.module.js +71 -3
- package/dist/app.module.js.map +1 -1
- package/dist/app.service.js +1 -0
- package/dist/auth/auth.controller.d.ts +21 -0
- package/dist/auth/auth.controller.js +150 -0
- package/dist/auth/auth.controller.js.map +1 -0
- package/dist/auth/auth.module.d.ts +2 -0
- package/dist/auth/auth.module.js +43 -0
- package/dist/auth/auth.module.js.map +1 -0
- package/dist/auth/auth.service.d.ts +45 -0
- package/dist/auth/auth.service.js +239 -0
- package/dist/auth/auth.service.js.map +1 -0
- package/dist/auth/decorators/public.decorator.d.ts +2 -0
- package/dist/auth/decorators/public.decorator.js +8 -0
- package/dist/auth/decorators/public.decorator.js.map +1 -0
- package/dist/auth/dto/login.dto.d.ts +4 -0
- package/dist/auth/dto/login.dto.js +34 -0
- package/dist/auth/dto/login.dto.js.map +1 -0
- package/dist/auth/dto/register.dto.d.ts +5 -0
- package/dist/auth/dto/register.dto.js +41 -0
- package/dist/auth/dto/register.dto.js.map +1 -0
- package/dist/auth/entities/refresh-token.entity.d.ts +12 -0
- package/dist/auth/entities/refresh-token.entity.js +72 -0
- package/dist/auth/entities/refresh-token.entity.js.map +1 -0
- package/dist/auth/guards/jwt-auth.guard.d.ts +9 -0
- package/dist/auth/guards/jwt-auth.guard.js +39 -0
- package/dist/auth/guards/jwt-auth.guard.js.map +1 -0
- package/dist/auth/strategies/jwt.strategy.d.ts +16 -0
- package/dist/auth/strategies/jwt.strategy.js +45 -0
- package/dist/auth/strategies/jwt.strategy.js.map +1 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.js +487 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/common/common.module.d.ts +2 -0
- package/dist/common/common.module.js +22 -0
- package/dist/common/common.module.js.map +1 -0
- package/dist/common/entities/artifact.entity.d.ts +7 -0
- package/dist/common/entities/artifact.entity.js +49 -0
- package/dist/common/entities/artifact.entity.js.map +1 -0
- package/dist/common/filters/http-exception.filter.d.ts +4 -0
- package/dist/common/filters/http-exception.filter.js +49 -0
- package/dist/common/filters/http-exception.filter.js.map +1 -0
- package/dist/common/storage.service.d.ts +21 -0
- package/dist/common/storage.service.js +105 -0
- package/dist/common/storage.service.js.map +1 -0
- package/dist/config/env.validation.d.ts +2 -0
- package/dist/config/env.validation.js +49 -0
- package/dist/config/env.validation.js.map +1 -0
- package/dist/config/typeorm.d.ts +6 -0
- package/dist/config/typeorm.js +53 -0
- package/dist/config/typeorm.js.map +1 -0
- package/dist/main.js +54 -2
- package/dist/main.js.map +1 -1
- package/dist/migrations/1774746981348-InitialSchemaAndSeed.d.ts +6 -0
- package/dist/migrations/1774746981348-InitialSchemaAndSeed.js +57 -0
- package/dist/migrations/1774746981348-InitialSchemaAndSeed.js.map +1 -0
- package/dist/migrations/1774850116434-CreateRefreshTokens.d.ts +6 -0
- package/dist/migrations/1774850116434-CreateRefreshTokens.js +68 -0
- package/dist/migrations/1774850116434-CreateRefreshTokens.js.map +1 -0
- package/dist/models/dto/create-model.dto.d.ts +4 -0
- package/dist/models/dto/create-model.dto.js +33 -0
- package/dist/models/dto/create-model.dto.js.map +1 -0
- package/dist/models/dto/update-model.dto.d.ts +5 -0
- package/dist/models/dto/update-model.dto.js +13 -0
- package/dist/models/dto/update-model.dto.js.map +1 -0
- package/dist/models/entities/model.entity.d.ts +10 -0
- package/dist/models/entities/model.entity.js +61 -0
- package/dist/models/entities/model.entity.js.map +1 -0
- package/dist/models/models.controller.d.ts +13 -0
- package/dist/models/models.controller.js +98 -0
- package/dist/models/models.controller.js.map +1 -0
- package/dist/models/models.module.d.ts +2 -0
- package/dist/models/models.module.js +26 -0
- package/dist/models/models.module.js.map +1 -0
- package/dist/models/models.service.d.ts +14 -0
- package/dist/models/models.service.js +78 -0
- package/dist/models/models.service.js.map +1 -0
- package/dist/projects/dto/create-project.dto.d.ts +7 -0
- package/dist/projects/dto/create-project.dto.js +46 -0
- package/dist/projects/dto/create-project.dto.js.map +1 -0
- package/dist/projects/dto/update-project.dto.d.ts +6 -0
- package/dist/projects/dto/update-project.dto.js +29 -0
- package/dist/projects/dto/update-project.dto.js.map +1 -0
- package/dist/projects/entities/project.entity.d.ts +17 -0
- package/dist/projects/entities/project.entity.js +77 -0
- package/dist/projects/entities/project.entity.js.map +1 -0
- package/dist/projects/projects.controller.d.ts +12 -0
- package/dist/projects/projects.controller.js +87 -0
- package/dist/projects/projects.controller.js.map +1 -0
- package/dist/projects/projects.module.d.ts +2 -0
- package/dist/projects/projects.module.js +27 -0
- package/dist/projects/projects.module.js.map +1 -0
- package/dist/projects/projects.service.d.ts +13 -0
- package/dist/projects/projects.service.js +79 -0
- package/dist/projects/projects.service.js.map +1 -0
- package/dist/providers/dto/create-provider.dto.d.ts +4 -0
- package/dist/providers/dto/create-provider.dto.js +33 -0
- package/dist/providers/dto/create-provider.dto.js.map +1 -0
- package/dist/providers/dto/update-provider.dto.d.ts +5 -0
- package/dist/providers/dto/update-provider.dto.js +13 -0
- package/dist/providers/dto/update-provider.dto.js.map +1 -0
- package/dist/providers/entities/provider.entity.d.ts +9 -0
- package/dist/providers/entities/provider.entity.js +55 -0
- package/dist/providers/entities/provider.entity.js.map +1 -0
- package/dist/providers/providers.controller.d.ts +13 -0
- package/dist/providers/providers.controller.js +98 -0
- package/dist/providers/providers.controller.js.map +1 -0
- package/dist/providers/providers.module.d.ts +2 -0
- package/dist/providers/providers.module.js +26 -0
- package/dist/providers/providers.module.js.map +1 -0
- package/dist/providers/providers.service.d.ts +14 -0
- package/dist/providers/providers.service.js +73 -0
- package/dist/providers/providers.service.js.map +1 -0
- package/dist/tasks/comments.controller.d.ts +12 -0
- package/dist/tasks/comments.controller.js +92 -0
- package/dist/tasks/comments.controller.js.map +1 -0
- package/dist/tasks/comments.service.d.ts +22 -0
- package/dist/tasks/comments.service.js +210 -0
- package/dist/tasks/comments.service.js.map +1 -0
- package/dist/tasks/dto/create-comment.dto.d.ts +13 -0
- package/dist/tasks/dto/create-comment.dto.js +52 -0
- package/dist/tasks/dto/create-comment.dto.js.map +1 -0
- package/dist/tasks/dto/create-recurrent-task.dto.d.ts +10 -0
- package/dist/tasks/dto/create-recurrent-task.dto.js +63 -0
- package/dist/tasks/dto/create-recurrent-task.dto.js.map +1 -0
- package/dist/tasks/dto/create-task.dto.d.ts +9 -0
- package/dist/tasks/dto/create-task.dto.js +62 -0
- package/dist/tasks/dto/create-task.dto.js.map +1 -0
- package/dist/tasks/dto/update-comment.dto.d.ts +9 -0
- package/dist/tasks/dto/update-comment.dto.js +32 -0
- package/dist/tasks/dto/update-comment.dto.js.map +1 -0
- package/dist/tasks/dto/update-recurrent-task.dto.d.ts +5 -0
- package/dist/tasks/dto/update-recurrent-task.dto.js +13 -0
- package/dist/tasks/dto/update-recurrent-task.dto.js.map +1 -0
- package/dist/tasks/dto/update-task.dto.d.ts +5 -0
- package/dist/tasks/dto/update-task.dto.js +13 -0
- package/dist/tasks/dto/update-task.dto.js.map +1 -0
- package/dist/tasks/entities/comment.entity.d.ts +23 -0
- package/dist/tasks/entities/comment.entity.js +94 -0
- package/dist/tasks/entities/comment.entity.js.map +1 -0
- package/dist/tasks/entities/recurrent-task-exec.entity.d.ts +16 -0
- package/dist/tasks/entities/recurrent-task-exec.entity.js +74 -0
- package/dist/tasks/entities/recurrent-task-exec.entity.js.map +1 -0
- package/dist/tasks/entities/recurrent-task.entity.d.ts +20 -0
- package/dist/tasks/entities/recurrent-task.entity.js +95 -0
- package/dist/tasks/entities/recurrent-task.entity.js.map +1 -0
- package/dist/tasks/entities/task.entity.d.ts +31 -0
- package/dist/tasks/entities/task.entity.js +126 -0
- package/dist/tasks/entities/task.entity.js.map +1 -0
- package/dist/tasks/recurrent-task-scheduler.service.d.ts +21 -0
- package/dist/tasks/recurrent-task-scheduler.service.js +170 -0
- package/dist/tasks/recurrent-task-scheduler.service.js.map +1 -0
- package/dist/tasks/recurrent-tasks.controller.d.ts +12 -0
- package/dist/tasks/recurrent-tasks.controller.js +89 -0
- package/dist/tasks/recurrent-tasks.controller.js.map +1 -0
- package/dist/tasks/recurrent-tasks.service.d.ts +16 -0
- package/dist/tasks/recurrent-tasks.service.js +137 -0
- package/dist/tasks/recurrent-tasks.service.js.map +1 -0
- package/dist/tasks/task-scheduler.service.d.ts +23 -0
- package/dist/tasks/task-scheduler.service.js +259 -0
- package/dist/tasks/task-scheduler.service.js.map +1 -0
- package/dist/tasks/tasks.controller.d.ts +24 -0
- package/dist/tasks/tasks.controller.js +107 -0
- package/dist/tasks/tasks.controller.js.map +1 -0
- package/dist/tasks/tasks.module.d.ts +2 -0
- package/dist/tasks/tasks.module.js +57 -0
- package/dist/tasks/tasks.module.js.map +1 -0
- package/dist/tasks/tasks.service.d.ts +34 -0
- package/dist/tasks/tasks.service.js +172 -0
- package/dist/tasks/tasks.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/ui/assets/AgentFleet-CQIXvils.js +6 -0
- package/dist/ui/assets/ConfirmDialog-nQ8F6FEz.js +1 -0
- package/dist/ui/assets/MarkdownField-BvkVHJZh.js +29 -0
- package/dist/ui/assets/ProjectDetail-CZ-tFtQo.js +1 -0
- package/dist/ui/assets/Providers-C61nXOPZ.js +1 -0
- package/dist/ui/assets/Scheduler-BwWeFfsh.js +1 -0
- package/dist/ui/assets/TaskDetail-BKQ3Vgnu.js +1 -0
- package/dist/ui/assets/TaskManager-CCOnj4Gq.js +16 -0
- package/dist/ui/assets/activity-CYFCUKYz.js +1 -0
- package/dist/ui/assets/brain-D1LPqnhA.js +1 -0
- package/dist/ui/assets/check-BZcW41Vk.js +1 -0
- package/dist/ui/assets/clock-vIUNSAVw.js +1 -0
- package/dist/ui/assets/eye-DSoNYXlu.js +1 -0
- package/dist/ui/assets/file-text-DyBkf5PF.js +1 -0
- package/dist/ui/assets/index-BX3YIi49.css +1 -0
- package/dist/ui/assets/index-Ctbpa_Ei.js +20 -0
- package/dist/ui/assets/inter-cyrillic-300-normal-BnqRxXuy.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-300-normal-LR1W_oT8.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-300-normal-CgCALhwJ.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-300-normal-RId2JxDB.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
- package/dist/ui/assets/inter-greek-300-normal-BrhSP0vQ.woff +0 -0
- package/dist/ui/assets/inter-greek-300-normal-DmGD3g_f.woff2 +0 -0
- package/dist/ui/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- package/dist/ui/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- package/dist/ui/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- package/dist/ui/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- package/dist/ui/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
- package/dist/ui/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-300-normal-DLbbeei1.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-300-normal-l2DDyC6M.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
- package/dist/ui/assets/inter-latin-300-normal-BVlfKGgI.woff2 +0 -0
- package/dist/ui/assets/inter-latin-300-normal-i8F0SvXL.woff +0 -0
- package/dist/ui/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/dist/ui/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/dist/ui/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/dist/ui/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/dist/ui/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/dist/ui/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-300-normal-CPgO9Ksf.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-300-normal-Dp1L8vcn.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-300-normal-Bdr24Bqb.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-300-normal-DDGmYYdT.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
- package/dist/ui/assets/layers-BQR0gbW3.js +1 -0
- package/dist/ui/assets/manrope-cyrillic-400-normal-BMzJvInZ.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-400-normal-Dvx59UGC.woff +0 -0
- package/dist/ui/assets/manrope-cyrillic-600-normal-DvRl3Mj-.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-600-normal-It4mZcQk.woff +0 -0
- package/dist/ui/assets/manrope-cyrillic-700-normal-7JNVKxyl.woff +0 -0
- package/dist/ui/assets/manrope-cyrillic-700-normal-Dw_fZAg2.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-800-normal-AvdZ5mAV.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-800-normal-BuEMjQU-.woff +0 -0
- package/dist/ui/assets/manrope-greek-400-normal-CM4qok81.woff2 +0 -0
- package/dist/ui/assets/manrope-greek-400-normal-DuX9RsAR.woff +0 -0
- package/dist/ui/assets/manrope-greek-600-normal-BoRV6lzK.woff2 +0 -0
- package/dist/ui/assets/manrope-greek-600-normal-CF2i9ZRY.woff +0 -0
- package/dist/ui/assets/manrope-greek-700-normal-CHUG9PD8.woff2 +0 -0
- package/dist/ui/assets/manrope-greek-700-normal-DyfsrCpP.woff +0 -0
- package/dist/ui/assets/manrope-greek-800-normal-Bw-67qu9.woff +0 -0
- package/dist/ui/assets/manrope-greek-800-normal-CDvU698_.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-400-normal-8tf8FM3T.woff +0 -0
- package/dist/ui/assets/manrope-latin-400-normal-PaqtzbVb.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-600-normal-4f0koTD-.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-600-normal-BqgrALkZ.woff +0 -0
- package/dist/ui/assets/manrope-latin-700-normal-BZp_XxE4.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-700-normal-DGRFkw-m.woff +0 -0
- package/dist/ui/assets/manrope-latin-800-normal-BfWYOv1c.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-800-normal-uHUdIJgA.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-400-normal-C-X6QNXX.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-400-normal-CMDvPJRp.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-ext-600-normal-_gBojHdJ.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-ext-600-normal-u5Pl7hTU.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-700-normal-DYOwVNan.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-ext-700-normal-eVCcYqtJ.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-800-normal-BQAQsuQc.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-800-normal-DdFx7KEb.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-400-normal-D7E_mLGF.woff +0 -0
- package/dist/ui/assets/manrope-vietnamese-400-normal-DHb3EETF.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-600-normal-C1J5PCl_.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-600-normal-lA7a_7Ok.woff +0 -0
- package/dist/ui/assets/manrope-vietnamese-700-normal-CUqMx5-1.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-700-normal-pt65Fn2Z.woff +0 -0
- package/dist/ui/assets/manrope-vietnamese-800-normal-ClPWri-A.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-800-normal-bvg7iBCV.woff +0 -0
- package/dist/ui/assets/providers-C3SQm75E.js +1 -0
- package/dist/ui/assets/send-Cgv_rLex.js +1 -0
- package/dist/ui/assets/shield-check-02qtz3Au.js +1 -0
- package/dist/ui/assets/sparkles-cO3r5TCU.js +1 -0
- package/dist/ui/assets/tasks-BZ0wO0e9.js +1 -0
- package/dist/ui/assets/trash-2-7e8TY3SJ.js +1 -0
- package/dist/ui/assets/trending-up-Dh3I3BnW.js +1 -0
- package/dist/ui/assets/useNotification-nXJIHD_q.js +6 -0
- package/dist/ui/assets/user-sikuVJBW.js +1 -0
- package/dist/ui/assets/zap-CFqyHdPJ.js +1 -0
- package/dist/ui/favicon.svg +1 -0
- package/dist/ui/icons.svg +24 -0
- package/dist/ui/index.html +17 -0
- package/dist/uploads/uploads.controller.d.ts +8 -0
- package/dist/uploads/uploads.controller.js +105 -0
- package/dist/uploads/uploads.controller.js.map +1 -0
- package/dist/uploads/uploads.module.d.ts +2 -0
- package/dist/uploads/uploads.module.js +20 -0
- package/dist/uploads/uploads.module.js.map +1 -0
- package/dist/users/dto/create-user.dto.d.ts +5 -0
- package/dist/users/dto/create-user.dto.js +41 -0
- package/dist/users/dto/create-user.dto.js.map +1 -0
- package/dist/users/dto/update-user.dto.d.ts +5 -0
- package/dist/users/dto/update-user.dto.js +13 -0
- package/dist/users/dto/update-user.dto.js.map +1 -0
- package/dist/users/entities/user.entity.d.ts +8 -0
- package/dist/users/entities/user.entity.js +43 -0
- package/dist/users/entities/user.entity.js.map +1 -0
- package/dist/users/users.controller.d.ts +12 -0
- package/dist/users/users.controller.js +89 -0
- package/dist/users/users.controller.js.map +1 -0
- package/dist/users/users.module.d.ts +2 -0
- package/dist/users/users.module.js +26 -0
- package/dist/users/users.module.js.map +1 -0
- package/dist/users/users.service.d.ts +14 -0
- package/dist/users/users.service.js +64 -0
- package/dist/users/users.service.js.map +1 -0
- package/package.json +75 -15
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -21
- package/dist/cli.js.map +0 -1
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.PACKAGE_ROOT = exports.ENV_PATH = exports.LOG_FILE = exports.PID_FILE = exports.PID_DIR = void 0;
|
|
38
|
+
exports.checkIfRunning = checkIfRunning;
|
|
39
|
+
exports.checkPendingMigrations = checkPendingMigrations;
|
|
40
|
+
exports.runMigrations = runMigrations;
|
|
41
|
+
exports.setupAdminUser = setupAdminUser;
|
|
42
|
+
exports.defineCommands = defineCommands;
|
|
43
|
+
exports.runCli = runCli;
|
|
44
|
+
const os = __importStar(require("os"));
|
|
45
|
+
const path = __importStar(require("path"));
|
|
46
|
+
process.env.NODE_ENV = 'production';
|
|
47
|
+
process.env.DOTENV_CONFIG_QUIET = 'true';
|
|
48
|
+
process.env.AGENT_ORCHESTRATOR_HOME =
|
|
49
|
+
process.env.AGENT_ORCHESTRATOR_HOME ||
|
|
50
|
+
path.join(os.homedir(), '.agent-orchestrator');
|
|
51
|
+
const commander_1 = require("commander");
|
|
52
|
+
const enquirer = __importStar(require("enquirer"));
|
|
53
|
+
const fs = __importStar(require("fs"));
|
|
54
|
+
const crypto = __importStar(require("crypto"));
|
|
55
|
+
const child_process_1 = require("child_process");
|
|
56
|
+
const bcrypt = __importStar(require("bcrypt"));
|
|
57
|
+
const typeorm_1 = require("../config/typeorm");
|
|
58
|
+
const user_entity_1 = require("../users/entities/user.entity");
|
|
59
|
+
let program = new commander_1.Command();
|
|
60
|
+
exports.PID_DIR = process.env.AGENT_ORCHESTRATOR_HOME;
|
|
61
|
+
exports.PID_FILE = path.join(exports.PID_DIR, 'pid');
|
|
62
|
+
exports.LOG_FILE = path.join(exports.PID_DIR, 'server.log');
|
|
63
|
+
exports.ENV_PATH = path.join(exports.PID_DIR, '.env');
|
|
64
|
+
// Determine the package root directory (where package.json is)
|
|
65
|
+
// When running from dist/cli/index.js, it's two levels up.
|
|
66
|
+
exports.PACKAGE_ROOT = path.resolve(__dirname, '..', '..');
|
|
67
|
+
// Ensure PID_DIR exists
|
|
68
|
+
if (!fs.existsSync(exports.PID_DIR)) {
|
|
69
|
+
fs.mkdirSync(exports.PID_DIR, { recursive: true });
|
|
70
|
+
}
|
|
71
|
+
function checkIfRunning() {
|
|
72
|
+
if (fs.existsSync(exports.PID_FILE)) {
|
|
73
|
+
const pid = parseInt(fs.readFileSync(exports.PID_FILE, 'utf8').trim(), 10);
|
|
74
|
+
try {
|
|
75
|
+
process.kill(pid, 0);
|
|
76
|
+
return pid;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Process doesn't exist, cleanup stale pid file
|
|
80
|
+
fs.unlinkSync(exports.PID_FILE);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
async function checkPendingMigrations() {
|
|
86
|
+
const dataSource = (0, typeorm_1.createDataSource)();
|
|
87
|
+
try {
|
|
88
|
+
await dataSource.initialize();
|
|
89
|
+
const hasPending = await dataSource.showMigrations();
|
|
90
|
+
// Check if any tables exist (other than the migrations table itself)
|
|
91
|
+
const tables = await dataSource.query(dataSource.options.type === 'sqlite'
|
|
92
|
+
? "SELECT name FROM sqlite_master WHERE type='table' AND name NOT IN ('migrations', 'sqlite_sequence')"
|
|
93
|
+
: "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name != 'migrations'");
|
|
94
|
+
const isEmpty = tables.length === 0;
|
|
95
|
+
await dataSource.destroy();
|
|
96
|
+
return { hasPending, isEmpty };
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
if (dataSource.isInitialized) {
|
|
100
|
+
await dataSource.destroy();
|
|
101
|
+
}
|
|
102
|
+
// If it fails, assume it's new/empty and needs migrations
|
|
103
|
+
return { hasPending: true, isEmpty: true };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function runMigrations(force = false) {
|
|
107
|
+
const dataSource = (0, typeorm_1.createDataSource)();
|
|
108
|
+
try {
|
|
109
|
+
await dataSource.initialize();
|
|
110
|
+
if (force) {
|
|
111
|
+
console.log('Dropping database schema...');
|
|
112
|
+
await dataSource.dropDatabase();
|
|
113
|
+
console.log('Schema dropped successfully.');
|
|
114
|
+
}
|
|
115
|
+
console.log('Running database migrations...');
|
|
116
|
+
const result = await dataSource.runMigrations();
|
|
117
|
+
if (result.length > 0) {
|
|
118
|
+
console.log(`Successfully executed ${result.length} migrations.`);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
console.log('No pending migrations found.');
|
|
122
|
+
}
|
|
123
|
+
await dataSource.destroy();
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
if (dataSource.isInitialized) {
|
|
127
|
+
await dataSource.destroy();
|
|
128
|
+
}
|
|
129
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
130
|
+
throw new Error(`Migration execution failed: ${errorMessage}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async function setupAdminUser() {
|
|
134
|
+
console.log('\n--- Admin User Setup ---');
|
|
135
|
+
const response = await enquirer.prompt([
|
|
136
|
+
{
|
|
137
|
+
type: 'input',
|
|
138
|
+
name: 'name',
|
|
139
|
+
message: 'Admin name:',
|
|
140
|
+
initial: 'admin',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'input',
|
|
144
|
+
name: 'email',
|
|
145
|
+
message: 'Admin email:',
|
|
146
|
+
initial: 'admin@agent-orchestrator.local',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: 'password',
|
|
150
|
+
name: 'password',
|
|
151
|
+
message: 'Admin password (min 8 characters):',
|
|
152
|
+
validate: (value) => value.length >= 8 || 'Password must be at least 8 characters long',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: 'password',
|
|
156
|
+
name: 'confirm',
|
|
157
|
+
message: 'Confirm admin password:',
|
|
158
|
+
validate: (value, state) => value === state?.answers?.password || 'Passwords do not match',
|
|
159
|
+
},
|
|
160
|
+
]);
|
|
161
|
+
console.log('Creating admin user...');
|
|
162
|
+
const dataSource = (0, typeorm_1.createDataSource)();
|
|
163
|
+
try {
|
|
164
|
+
await dataSource.initialize();
|
|
165
|
+
const userRepository = dataSource.getRepository(user_entity_1.User);
|
|
166
|
+
const existing = await userRepository.findOne({
|
|
167
|
+
where: { email: response.email },
|
|
168
|
+
});
|
|
169
|
+
if (existing) {
|
|
170
|
+
console.log(`User with email ${response.email} already exists. Skipping creation.`);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const hashedPassword = await bcrypt.hash(response.password, 10);
|
|
174
|
+
const user = userRepository.create({
|
|
175
|
+
name: response.name,
|
|
176
|
+
email: response.email,
|
|
177
|
+
password: hashedPassword,
|
|
178
|
+
});
|
|
179
|
+
await userRepository.save(user);
|
|
180
|
+
console.log('Admin user created successfully!');
|
|
181
|
+
}
|
|
182
|
+
await dataSource.destroy();
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
if (dataSource.isInitialized) {
|
|
186
|
+
await dataSource.destroy();
|
|
187
|
+
}
|
|
188
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
189
|
+
console.error(`Failed to create admin user: ${errorMessage}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function defineCommands() {
|
|
193
|
+
program
|
|
194
|
+
.name('agent-orchestrator')
|
|
195
|
+
.description('An open-source AI agent orchestrator platform')
|
|
196
|
+
.version('0.0.1');
|
|
197
|
+
program
|
|
198
|
+
.command('setup')
|
|
199
|
+
.description('Run the interactive setup configuration')
|
|
200
|
+
.action(async () => {
|
|
201
|
+
console.log('Starting interactive setup...');
|
|
202
|
+
try {
|
|
203
|
+
const basicResponse = await enquirer.prompt([
|
|
204
|
+
{
|
|
205
|
+
type: 'input',
|
|
206
|
+
name: 'port',
|
|
207
|
+
message: 'What port should the orchestrator run on?',
|
|
208
|
+
initial: '15789',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: 'select',
|
|
212
|
+
name: 'dbType',
|
|
213
|
+
message: 'Which database type do you want to use?',
|
|
214
|
+
choices: ['postgres', 'sqlite'],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'confirm',
|
|
218
|
+
name: 'dbLogging',
|
|
219
|
+
message: 'Enable database query logging?',
|
|
220
|
+
initial: false,
|
|
221
|
+
},
|
|
222
|
+
]);
|
|
223
|
+
let databaseUrl = '';
|
|
224
|
+
if (basicResponse.dbType === 'postgres') {
|
|
225
|
+
const dbResponse = await enquirer.prompt([
|
|
226
|
+
{
|
|
227
|
+
type: 'input',
|
|
228
|
+
name: 'databaseUrl',
|
|
229
|
+
message: 'Enter your PostgreSQL connection string (e.g., postgres://user:password@localhost:5432/dbname):',
|
|
230
|
+
validate: (value) => value.startsWith('postgres://') || 'Invalid PostgreSQL URL',
|
|
231
|
+
},
|
|
232
|
+
]);
|
|
233
|
+
databaseUrl = dbResponse.databaseUrl;
|
|
234
|
+
}
|
|
235
|
+
const providerResponse = await enquirer.prompt([
|
|
236
|
+
{
|
|
237
|
+
type: 'multiselect',
|
|
238
|
+
name: 'providers',
|
|
239
|
+
message: 'Which AI providers do you want to configure? (Space to select, Enter to confirm)',
|
|
240
|
+
choices: ['gemini', 'anthropic'],
|
|
241
|
+
},
|
|
242
|
+
]);
|
|
243
|
+
let geminiKey = '';
|
|
244
|
+
let anthropicKey = '';
|
|
245
|
+
const selectedProviders = providerResponse.providers;
|
|
246
|
+
if (selectedProviders.includes('gemini')) {
|
|
247
|
+
const keyRes = await enquirer.prompt([
|
|
248
|
+
{
|
|
249
|
+
type: 'input',
|
|
250
|
+
name: 'key',
|
|
251
|
+
message: 'Enter your Google Gemini API Key:',
|
|
252
|
+
},
|
|
253
|
+
]);
|
|
254
|
+
geminiKey = keyRes.key;
|
|
255
|
+
}
|
|
256
|
+
if (selectedProviders.includes('anthropic')) {
|
|
257
|
+
const keyRes = await enquirer.prompt([
|
|
258
|
+
{
|
|
259
|
+
type: 'input',
|
|
260
|
+
name: 'key',
|
|
261
|
+
message: 'Enter your Anthropic Claude API Key:',
|
|
262
|
+
},
|
|
263
|
+
]);
|
|
264
|
+
anthropicKey = keyRes.key;
|
|
265
|
+
}
|
|
266
|
+
let jwtSecret = '';
|
|
267
|
+
if (fs.existsSync(exports.ENV_PATH)) {
|
|
268
|
+
const existingEnv = fs.readFileSync(exports.ENV_PATH, 'utf8');
|
|
269
|
+
const jwtMatch = existingEnv.match(/^JWT_SECRET=(.*)$/m);
|
|
270
|
+
if (jwtMatch) {
|
|
271
|
+
const { overwriteJwt } = await enquirer.prompt({
|
|
272
|
+
type: 'confirm',
|
|
273
|
+
name: 'overwriteJwt',
|
|
274
|
+
message: 'A JWT_SECRET already exists. Do you want to generate a new one?',
|
|
275
|
+
initial: false,
|
|
276
|
+
});
|
|
277
|
+
if (overwriteJwt) {
|
|
278
|
+
jwtSecret = crypto.randomBytes(32).toString('hex');
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
jwtSecret = jwtMatch[1];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
jwtSecret = crypto.randomBytes(32).toString('hex');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
jwtSecret = crypto.randomBytes(32).toString('hex');
|
|
290
|
+
}
|
|
291
|
+
console.log('Generating configuration...');
|
|
292
|
+
let envContent = `NODE_ENV=production\nPORT=${basicResponse.port}\nDB_TYPE=${basicResponse.dbType}\nDB_LOGGING=${basicResponse.dbLogging}\n`;
|
|
293
|
+
if (databaseUrl) {
|
|
294
|
+
envContent += `DATABASE_URL=${databaseUrl}\n`;
|
|
295
|
+
}
|
|
296
|
+
if (geminiKey) {
|
|
297
|
+
envContent += `GEMINI_API_KEY=${geminiKey}\n`;
|
|
298
|
+
}
|
|
299
|
+
if (anthropicKey) {
|
|
300
|
+
envContent += `ANTHROPIC_API_KEY=${anthropicKey}\n`;
|
|
301
|
+
}
|
|
302
|
+
if (jwtSecret) {
|
|
303
|
+
envContent += `JWT_SECRET=${jwtSecret}\n`;
|
|
304
|
+
}
|
|
305
|
+
fs.writeFileSync(exports.ENV_PATH, envContent);
|
|
306
|
+
console.log('Configuration saved to .env file successfully!');
|
|
307
|
+
const { hasPending, isEmpty } = await checkPendingMigrations();
|
|
308
|
+
if (isEmpty) {
|
|
309
|
+
console.log('Database is empty. Initializing...');
|
|
310
|
+
try {
|
|
311
|
+
await runMigrations();
|
|
312
|
+
await setupAdminUser();
|
|
313
|
+
}
|
|
314
|
+
catch (err) {
|
|
315
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
316
|
+
console.error(`Initialization failed: ${errorMessage}`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else if (hasPending) {
|
|
320
|
+
const { confirmMigration } = await enquirer.prompt({
|
|
321
|
+
type: 'confirm',
|
|
322
|
+
name: 'confirmMigration',
|
|
323
|
+
message: 'Pending migrations detected on an existing database. Do you want to run them?',
|
|
324
|
+
initial: false,
|
|
325
|
+
});
|
|
326
|
+
if (confirmMigration) {
|
|
327
|
+
try {
|
|
328
|
+
await runMigrations();
|
|
329
|
+
await setupAdminUser();
|
|
330
|
+
}
|
|
331
|
+
catch (err) {
|
|
332
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
333
|
+
console.error(`Migration failed: ${errorMessage}`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
console.log('Database migration skipped.');
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
console.log('Database is already up to date.');
|
|
342
|
+
const { forceMigration } = await enquirer.prompt({
|
|
343
|
+
type: 'confirm',
|
|
344
|
+
name: 'forceMigration',
|
|
345
|
+
message: 'Do you want to force migration anyway? (This will DROP ALL DATA and re-initialize the database)',
|
|
346
|
+
initial: false,
|
|
347
|
+
});
|
|
348
|
+
if (forceMigration) {
|
|
349
|
+
try {
|
|
350
|
+
await enquirer.prompt({
|
|
351
|
+
type: 'input',
|
|
352
|
+
name: 'continue',
|
|
353
|
+
message: 'Press Enter to confirm and start the destructive initialization...',
|
|
354
|
+
});
|
|
355
|
+
await runMigrations(true);
|
|
356
|
+
await setupAdminUser();
|
|
357
|
+
}
|
|
358
|
+
catch (err) {
|
|
359
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
360
|
+
console.error(`Migration failed: ${errorMessage}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
// Check if we should still offer admin setup if not forcing migration
|
|
365
|
+
await setupAdminUser();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
console.error('Setup cancelled or failed.');
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
program
|
|
374
|
+
.command('run')
|
|
375
|
+
.description('Start the orchestrator server (detached)')
|
|
376
|
+
.action(() => {
|
|
377
|
+
const existingPid = checkIfRunning();
|
|
378
|
+
if (existingPid) {
|
|
379
|
+
console.log(`Orchestrator is already running with PID: ${existingPid}`);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
console.log('Starting Agent Orchestrator in background...');
|
|
383
|
+
if (!fs.existsSync(exports.PID_DIR)) {
|
|
384
|
+
fs.mkdirSync(exports.PID_DIR, { recursive: true });
|
|
385
|
+
}
|
|
386
|
+
const logStream = fs.openSync(exports.LOG_FILE, 'a');
|
|
387
|
+
// We point to the main.js entry point in dist
|
|
388
|
+
const mainPath = path.join(exports.PACKAGE_ROOT, 'dist/main.js');
|
|
389
|
+
const child = (0, child_process_1.spawn)('node', [mainPath], {
|
|
390
|
+
detached: true,
|
|
391
|
+
stdio: ['ignore', logStream, logStream],
|
|
392
|
+
cwd: exports.PACKAGE_ROOT,
|
|
393
|
+
env: process.env,
|
|
394
|
+
});
|
|
395
|
+
fs.writeFileSync(exports.PID_FILE, child.pid?.toString() || '');
|
|
396
|
+
child.unref();
|
|
397
|
+
console.log(`Orchestrator started in background with PID: ${child.pid}`);
|
|
398
|
+
console.log(`Logs are available at: ${exports.LOG_FILE}`);
|
|
399
|
+
});
|
|
400
|
+
program
|
|
401
|
+
.command('stop')
|
|
402
|
+
.description('Stop the orchestrator server')
|
|
403
|
+
.action(() => {
|
|
404
|
+
const pid = checkIfRunning();
|
|
405
|
+
if (!pid) {
|
|
406
|
+
console.log('Orchestrator is not running.');
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
console.log(`Stopping Orchestrator (PID: ${pid})...`);
|
|
410
|
+
try {
|
|
411
|
+
process.kill(pid, 'SIGTERM');
|
|
412
|
+
console.log('Orchestrator stopped.');
|
|
413
|
+
}
|
|
414
|
+
catch (e) {
|
|
415
|
+
console.error(`Failed to stop process ${pid}:`, e);
|
|
416
|
+
}
|
|
417
|
+
if (fs.existsSync(exports.PID_FILE)) {
|
|
418
|
+
fs.unlinkSync(exports.PID_FILE);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
program
|
|
422
|
+
.command('migrate')
|
|
423
|
+
.description('Run pending database migrations')
|
|
424
|
+
.option('-f, --force', 'Force re-initialization (DROP ALL DATA)')
|
|
425
|
+
.action(async (options) => {
|
|
426
|
+
try {
|
|
427
|
+
if (options.force) {
|
|
428
|
+
const { confirmForce } = await enquirer.prompt({
|
|
429
|
+
type: 'confirm',
|
|
430
|
+
name: 'confirmForce',
|
|
431
|
+
message: 'Are you absolutely sure you want to DROP ALL DATA and re-initialize?',
|
|
432
|
+
initial: false,
|
|
433
|
+
});
|
|
434
|
+
if (confirmForce) {
|
|
435
|
+
await enquirer.prompt({
|
|
436
|
+
type: 'input',
|
|
437
|
+
name: 'continue',
|
|
438
|
+
message: 'Press Enter to confirm and start the destructive initialization...',
|
|
439
|
+
});
|
|
440
|
+
await runMigrations(true);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
console.log('Force migration cancelled.');
|
|
444
|
+
}
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
const { hasPending, isEmpty } = await checkPendingMigrations();
|
|
448
|
+
if (isEmpty) {
|
|
449
|
+
console.log('Database is empty. Initializing...');
|
|
450
|
+
await runMigrations();
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (!hasPending) {
|
|
454
|
+
console.log('Database is already up to date.');
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
const { confirmMigration } = await enquirer.prompt({
|
|
458
|
+
type: 'confirm',
|
|
459
|
+
name: 'confirmMigration',
|
|
460
|
+
message: 'Pending migrations detected. Do you want to run them?',
|
|
461
|
+
initial: false,
|
|
462
|
+
});
|
|
463
|
+
if (confirmMigration) {
|
|
464
|
+
await runMigrations();
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
console.log('Migration cancelled.');
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
catch (err) {
|
|
471
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
472
|
+
console.error(`Migration failed: ${errorMessage}`);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
async function runCli(argv = process.argv) {
|
|
477
|
+
program = new commander_1.Command();
|
|
478
|
+
defineCommands();
|
|
479
|
+
await program.parseAsync(argv);
|
|
480
|
+
}
|
|
481
|
+
if (require.main === module) {
|
|
482
|
+
runCli().catch((err) => {
|
|
483
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
484
|
+
console.error(`CLI execution failed: ${errorMessage}`);
|
|
485
|
+
process.exit(1);
|
|
486
|
+
});
|
|
487
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,wCAYC;AAED,wDA2BC;AAED,sCA4BC;AAED,wCAsEC;AAED,wCAkUC;AAED,wBAIC;AA7gBD,uCAAyB;AACzB,2CAA6B;AAE7B,OAAO,CAAC,GAA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C,UAAU,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACrB,MAAM,YAAY,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtE,OAAO,CAAC,KAAK,CAAC,yBAAyB,YAAY,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CommonModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const storage_service_1 = require("./storage.service");
|
|
12
|
+
let CommonModule = class CommonModule {
|
|
13
|
+
};
|
|
14
|
+
exports.CommonModule = CommonModule;
|
|
15
|
+
exports.CommonModule = CommonModule = __decorate([
|
|
16
|
+
(0, common_1.Global)(),
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
providers: [storage_service_1.StorageService],
|
|
19
|
+
exports: [storage_service_1.StorageService],
|
|
20
|
+
})
|
|
21
|
+
], CommonModule);
|
|
22
|
+
//# sourceMappingURL=common.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.module.js","sourceRoot":"","sources":["../../src/common/common.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,uDAAmD;AAO5C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IALxB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KAC1B,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Artifact = void 0;
|
|
13
|
+
const openapi = require("@nestjs/swagger");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let Artifact = class Artifact {
|
|
16
|
+
id;
|
|
17
|
+
originalName;
|
|
18
|
+
mimeType;
|
|
19
|
+
filePath;
|
|
20
|
+
metadata;
|
|
21
|
+
static _OPENAPI_METADATA_FACTORY() {
|
|
22
|
+
return { id: { required: true, type: () => String }, originalName: { required: true, type: () => String }, mimeType: { required: true, type: () => String }, filePath: { required: true, type: () => String }, metadata: { required: false, type: () => Object } };
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.Artifact = Artifact;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], Artifact.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], Artifact.prototype, "originalName", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Artifact.prototype, "mimeType", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Artifact.prototype, "filePath", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], Artifact.prototype, "metadata", void 0);
|
|
46
|
+
exports.Artifact = Artifact = __decorate([
|
|
47
|
+
(0, typeorm_1.Entity)('artifacts')
|
|
48
|
+
], Artifact);
|
|
49
|
+
//# sourceMappingURL=artifact.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact.entity.js","sourceRoot":"","sources":["../../../src/common/entities/artifact.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAEnB,EAAE,CAAS;IAGX,YAAY,CAAS;IAGrB,QAAQ,CAAS;IAGjB,QAAQ,CAAS;IAGjB,QAAQ,CAAuB;;;;CAChC,CAAA;AAfY,4BAAQ;AAEnB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;oCACpB;AAGX;IADC,IAAA,gBAAM,GAAE;;8CACY;AAGrB;IADC,IAAA,gBAAM,GAAE;;0CACQ;AAGjB;IADC,IAAA,gBAAM,GAAE;;0CACQ;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACjB;mBAdpB,QAAQ;IADpB,IAAA,gBAAM,EAAC,WAAW,CAAC;GACP,QAAQ,CAepB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.HttpExceptionFilter = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let HttpExceptionFilter = class HttpExceptionFilter {
|
|
12
|
+
catch(exception, host) {
|
|
13
|
+
const ctx = host.switchToHttp();
|
|
14
|
+
const response = ctx.getResponse();
|
|
15
|
+
const request = ctx.getRequest();
|
|
16
|
+
let status = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
17
|
+
let message = 'Internal server error';
|
|
18
|
+
let errors = [];
|
|
19
|
+
if (exception instanceof common_1.HttpException) {
|
|
20
|
+
status = exception.getStatus();
|
|
21
|
+
const exceptionResponse = exception.getResponse();
|
|
22
|
+
if (typeof exceptionResponse === 'string') {
|
|
23
|
+
message = exceptionResponse;
|
|
24
|
+
}
|
|
25
|
+
else if (typeof exceptionResponse === 'object' &&
|
|
26
|
+
exceptionResponse !== null) {
|
|
27
|
+
const resObj = exceptionResponse;
|
|
28
|
+
message =
|
|
29
|
+
typeof resObj.message === 'string' ? resObj.message : 'Http Error';
|
|
30
|
+
if (Array.isArray(resObj.message)) {
|
|
31
|
+
errors = resObj.message;
|
|
32
|
+
message = 'Validation failed';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
response.status(status).json({
|
|
37
|
+
statusCode: status,
|
|
38
|
+
message,
|
|
39
|
+
...(errors.length > 0 ? { errors } : {}),
|
|
40
|
+
timestamp: new Date().toISOString(),
|
|
41
|
+
path: request.url,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.HttpExceptionFilter = HttpExceptionFilter;
|
|
46
|
+
exports.HttpExceptionFilter = HttpExceptionFilter = __decorate([
|
|
47
|
+
(0, common_1.Catch)()
|
|
48
|
+
], HttpExceptionFilter);
|
|
49
|
+
//# sourceMappingURL=http-exception.filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../../src/common/filters/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAMwB;AAIjB,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,KAAK,CAAC,SAAkB,EAAE,IAAmB;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,EAAW,CAAC;QAE1C,IAAI,MAAM,GAAG,mBAAU,CAAC,qBAAqB,CAAC;QAC9C,IAAI,OAAO,GAAsB,uBAAuB,CAAC;QACzD,IAAI,MAAM,GAAa,EAAE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