@agentlang/agentmanager 0.0.3 → 0.0.4

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.
Files changed (815) hide show
  1. package/dist/apps/monolith/apps/agentcraft/src/agentcraft-core.module.d.ts +4 -0
  2. package/dist/apps/monolith/apps/agentcraft/src/agentcraft-core.module.js +49 -0
  3. package/dist/apps/monolith/apps/agentcraft/src/agentcraft-core.module.js.map +1 -0
  4. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.controller.d.ts +17 -0
  5. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.controller.js +87 -0
  6. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.controller.js.map +1 -0
  7. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.module.d.ts +2 -0
  8. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.module.js +24 -0
  9. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.module.js.map +1 -0
  10. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.service.d.ts +34 -0
  11. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.service.js +170 -0
  12. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.service.js.map +1 -0
  13. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.store.d.ts +25 -0
  14. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.store.js +50 -0
  15. package/dist/apps/monolith/apps/agentcraft/src/architect/architect.store.js.map +1 -0
  16. package/dist/apps/monolith/apps/agentcraft/src/architect/dto/ingest-signal.dto.d.ts +40 -0
  17. package/dist/apps/monolith/apps/agentcraft/src/architect/dto/ingest-signal.dto.js +24 -0
  18. package/dist/apps/monolith/apps/agentcraft/src/architect/dto/ingest-signal.dto.js.map +1 -0
  19. package/dist/apps/monolith/apps/agentcraft/src/architect/interfaces/architect.interfaces.d.ts +21 -0
  20. package/dist/apps/monolith/apps/agentcraft/src/architect/interfaces/architect.interfaces.js +3 -0
  21. package/dist/apps/monolith/apps/agentcraft/src/architect/interfaces/architect.interfaces.js.map +1 -0
  22. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.controller.d.ts +17 -0
  23. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.controller.js +117 -0
  24. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.controller.js.map +1 -0
  25. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.module.d.ts +2 -0
  26. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.module.js +22 -0
  27. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.module.js.map +1 -0
  28. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.service.d.ts +48 -0
  29. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.service.js +121 -0
  30. package/dist/apps/monolith/apps/agentcraft/src/autonomous/autonomous.service.js.map +1 -0
  31. package/dist/apps/monolith/apps/agentcraft/src/autonomous/dto/run-autonomous.dto.d.ts +26 -0
  32. package/dist/apps/monolith/apps/agentcraft/src/autonomous/dto/run-autonomous.dto.js +20 -0
  33. package/dist/apps/monolith/apps/agentcraft/src/autonomous/dto/run-autonomous.dto.js.map +1 -0
  34. package/dist/apps/monolith/apps/agentcraft/src/autonomous/dto/watch-kb.dto.d.ts +18 -0
  35. package/dist/apps/monolith/apps/agentcraft/src/autonomous/dto/watch-kb.dto.js +20 -0
  36. package/dist/apps/monolith/apps/agentcraft/src/autonomous/dto/watch-kb.dto.js.map +1 -0
  37. package/dist/apps/monolith/apps/agentcraft/src/health/health.controller.d.ts +7 -0
  38. package/dist/apps/monolith/apps/agentcraft/src/health/health.controller.js +41 -0
  39. package/dist/apps/monolith/apps/agentcraft/src/health/health.controller.js.map +1 -0
  40. package/dist/apps/monolith/apps/agentcraft/src/health/health.module.d.ts +2 -0
  41. package/dist/apps/monolith/apps/agentcraft/src/health/health.module.js +22 -0
  42. package/dist/apps/monolith/apps/agentcraft/src/health/health.module.js.map +1 -0
  43. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/create-resolver.dto.d.ts +22 -0
  44. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/create-resolver.dto.js +18 -0
  45. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/create-resolver.dto.js.map +1 -0
  46. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/install-registry.dto.d.ts +14 -0
  47. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/install-registry.dto.js +14 -0
  48. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/install-registry.dto.js.map +1 -0
  49. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/search-registry-query.dto.d.ts +10 -0
  50. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/search-registry-query.dto.js +12 -0
  51. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/search-registry-query.dto.js.map +1 -0
  52. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/submit-action.dto.d.ts +1 -0
  53. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/submit-action.dto.js +7 -0
  54. package/dist/apps/monolith/apps/agentcraft/src/resolver/dto/submit-action.dto.js.map +1 -0
  55. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver-session.store.d.ts +19 -0
  56. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver-session.store.js +39 -0
  57. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver-session.store.js.map +1 -0
  58. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.controller.d.ts +36 -0
  59. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.controller.js +121 -0
  60. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.controller.js.map +1 -0
  61. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.module.d.ts +2 -0
  62. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.module.js +23 -0
  63. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.module.js.map +1 -0
  64. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.service.d.ts +42 -0
  65. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.service.js +101 -0
  66. package/dist/apps/monolith/apps/agentcraft/src/resolver/resolver.service.js.map +1 -0
  67. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/create-session.dto.d.ts +18 -0
  68. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/create-session.dto.js +16 -0
  69. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/create-session.dto.js.map +1 -0
  70. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/submit-action.dto.d.ts +1 -0
  71. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/submit-action.dto.js +7 -0
  72. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/submit-action.dto.js.map +1 -0
  73. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/submit-idea.dto.d.ts +10 -0
  74. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/submit-idea.dto.js +12 -0
  75. package/dist/apps/monolith/apps/agentcraft/src/sessions/dto/submit-idea.dto.js.map +1 -0
  76. package/dist/apps/monolith/apps/agentcraft/src/sessions/session.store.d.ts +19 -0
  77. package/dist/apps/monolith/apps/agentcraft/src/sessions/session.store.js +39 -0
  78. package/dist/apps/monolith/apps/agentcraft/src/sessions/session.store.js.map +1 -0
  79. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.controller.d.ts +47 -0
  80. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.controller.js +139 -0
  81. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.controller.js.map +1 -0
  82. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.module.d.ts +2 -0
  83. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.module.js +23 -0
  84. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.module.js.map +1 -0
  85. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.service.d.ts +60 -0
  86. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.service.js +203 -0
  87. package/dist/apps/monolith/apps/agentcraft/src/sessions/sessions.service.js.map +1 -0
  88. package/dist/apps/monolith/apps/agentmanager/src/agentmanager-core.module.d.ts +4 -0
  89. package/dist/apps/monolith/apps/agentmanager/src/agentmanager-core.module.js +54 -0
  90. package/dist/apps/monolith/apps/agentmanager/src/agentmanager-core.module.js.map +1 -0
  91. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.controller.d.ts +9 -0
  92. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.controller.js +50 -0
  93. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.controller.js.map +1 -0
  94. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.module.d.ts +2 -0
  95. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.module.js +23 -0
  96. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.module.js.map +1 -0
  97. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.service.d.ts +17 -0
  98. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.service.js +169 -0
  99. package/dist/apps/monolith/apps/agentmanager/src/deployments/deployments.service.js.map +1 -0
  100. package/dist/apps/monolith/apps/agentmanager/src/deployments/errors/deployment.errors.d.ts +7 -0
  101. package/dist/apps/monolith/apps/agentmanager/src/deployments/errors/deployment.errors.js +17 -0
  102. package/dist/apps/monolith/apps/agentmanager/src/deployments/errors/deployment.errors.js.map +1 -0
  103. package/dist/apps/monolith/apps/agentmanager/src/deployments/interfaces/deployment.interfaces.d.ts +22 -0
  104. package/dist/apps/monolith/apps/agentmanager/src/deployments/interfaces/deployment.interfaces.js +3 -0
  105. package/dist/apps/monolith/apps/agentmanager/src/deployments/interfaces/deployment.interfaces.js.map +1 -0
  106. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.controller.d.ts +7 -0
  107. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.controller.js +41 -0
  108. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.controller.js.map +1 -0
  109. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.module.d.ts +2 -0
  110. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.module.js +41 -0
  111. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.module.js.map +1 -0
  112. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.service.d.ts +17 -0
  113. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.service.js +160 -0
  114. package/dist/apps/monolith/apps/agentmanager/src/discovery/discovery.service.js.map +1 -0
  115. package/dist/apps/monolith/apps/agentmanager/src/discovery/dto/discover.dto.d.ts +10 -0
  116. package/dist/apps/monolith/apps/agentmanager/src/discovery/dto/discover.dto.js +12 -0
  117. package/dist/apps/monolith/apps/agentmanager/src/discovery/dto/discover.dto.js.map +1 -0
  118. package/dist/apps/monolith/apps/agentmanager/src/discovery/interfaces/discovery.interfaces.d.ts +21 -0
  119. package/dist/apps/monolith/apps/agentmanager/src/discovery/interfaces/discovery.interfaces.js +3 -0
  120. package/dist/apps/monolith/apps/agentmanager/src/discovery/interfaces/discovery.interfaces.js.map +1 -0
  121. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/anthropic-llm.service.d.ts +8 -0
  122. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/anthropic-llm.service.js +67 -0
  123. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/anthropic-llm.service.js.map +1 -0
  124. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/llm-provider.interface.d.ts +14 -0
  125. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/llm-provider.interface.js +5 -0
  126. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/llm-provider.interface.js.map +1 -0
  127. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/llm.errors.d.ts +4 -0
  128. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/llm.errors.js +11 -0
  129. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/llm.errors.js.map +1 -0
  130. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/openai-llm.service.d.ts +8 -0
  131. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/openai-llm.service.js +69 -0
  132. package/dist/apps/monolith/apps/agentmanager/src/discovery/llm/openai-llm.service.js.map +1 -0
  133. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-config.dto.d.ts +10 -0
  134. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-config.dto.js +12 -0
  135. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-config.dto.js.map +1 -0
  136. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-module.dto.d.ts +10 -0
  137. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-module.dto.js +12 -0
  138. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-module.dto.js.map +1 -0
  139. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-package.dto.d.ts +16 -0
  140. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-package.dto.js +17 -0
  141. package/dist/apps/monolith/apps/agentmanager/src/employee-code/dto/put-package.dto.js.map +1 -0
  142. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.controller.d.ts +20 -0
  143. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.controller.js +130 -0
  144. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.controller.js.map +1 -0
  145. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.module.d.ts +2 -0
  146. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.module.js +23 -0
  147. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.module.js.map +1 -0
  148. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.service.d.ts +13 -0
  149. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.service.js +54 -0
  150. package/dist/apps/monolith/apps/agentmanager/src/employee-code/employee-code.service.js.map +1 -0
  151. package/dist/apps/monolith/apps/agentmanager/src/employees/dto/register-employee.dto.d.ts +12 -0
  152. package/dist/apps/monolith/apps/agentmanager/src/employees/dto/register-employee.dto.js +13 -0
  153. package/dist/apps/monolith/apps/agentmanager/src/employees/dto/register-employee.dto.js.map +1 -0
  154. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.controller.d.ts +12 -0
  155. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.controller.js +76 -0
  156. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.controller.js.map +1 -0
  157. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.module.d.ts +2 -0
  158. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.module.js +23 -0
  159. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.module.js.map +1 -0
  160. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.service.d.ts +9 -0
  161. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.service.js +42 -0
  162. package/dist/apps/monolith/apps/agentmanager/src/employees/employees.service.js.map +1 -0
  163. package/dist/apps/monolith/apps/agentmanager/src/health/health.controller.d.ts +7 -0
  164. package/dist/apps/monolith/apps/agentmanager/src/health/health.controller.js +41 -0
  165. package/dist/apps/monolith/apps/agentmanager/src/health/health.controller.js.map +1 -0
  166. package/dist/apps/monolith/apps/agentmanager/src/health/health.module.d.ts +2 -0
  167. package/dist/apps/monolith/apps/agentmanager/src/health/health.module.js +22 -0
  168. package/dist/apps/monolith/apps/agentmanager/src/health/health.module.js.map +1 -0
  169. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/list-messages-query.dto.d.ts +30 -0
  170. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/list-messages-query.dto.js +14 -0
  171. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/list-messages-query.dto.js.map +1 -0
  172. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/push-message.dto.d.ts +80 -0
  173. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/push-message.dto.js +49 -0
  174. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/push-message.dto.js.map +1 -0
  175. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/respond-message.dto.d.ts +12 -0
  176. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/respond-message.dto.js +13 -0
  177. package/dist/apps/monolith/apps/agentmanager/src/inbox/dto/respond-message.dto.js.map +1 -0
  178. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.controller.d.ts +15 -0
  179. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.controller.js +103 -0
  180. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.controller.js.map +1 -0
  181. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.module.d.ts +2 -0
  182. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.module.js +23 -0
  183. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.module.js.map +1 -0
  184. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.service.d.ts +16 -0
  185. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.service.js +173 -0
  186. package/dist/apps/monolith/apps/agentmanager/src/inbox/inbox.service.js.map +1 -0
  187. package/dist/apps/monolith/apps/agentmanager/src/projects/dto/create-project.dto.d.ts +14 -0
  188. package/dist/apps/monolith/apps/agentmanager/src/projects/dto/create-project.dto.js +14 -0
  189. package/dist/apps/monolith/apps/agentmanager/src/projects/dto/create-project.dto.js.map +1 -0
  190. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.controller.d.ts +17 -0
  191. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.controller.js +73 -0
  192. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.controller.js.map +1 -0
  193. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.module.d.ts +2 -0
  194. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.module.js +23 -0
  195. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.module.js.map +1 -0
  196. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.service.d.ts +11 -0
  197. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.service.js +39 -0
  198. package/dist/apps/monolith/apps/agentmanager/src/projects/projects.service.js.map +1 -0
  199. package/dist/apps/monolith/apps/fabric/src/ai-agent/ai-agent.module.d.ts +2 -0
  200. package/dist/apps/monolith/apps/fabric/src/ai-agent/ai-agent.module.js +82 -0
  201. package/dist/apps/monolith/apps/fabric/src/ai-agent/ai-agent.module.js.map +1 -0
  202. package/dist/apps/monolith/apps/fabric/src/ai-agent/ai-agent.service.d.ts +63 -0
  203. package/dist/apps/monolith/apps/fabric/src/ai-agent/ai-agent.service.js +295 -0
  204. package/dist/apps/monolith/apps/fabric/src/ai-agent/ai-agent.service.js.map +1 -0
  205. package/dist/apps/monolith/apps/fabric/src/ai-agent/probe-investigation.types.d.ts +19 -0
  206. package/dist/apps/monolith/apps/fabric/src/ai-agent/probe-investigation.types.js +3 -0
  207. package/dist/apps/monolith/apps/fabric/src/ai-agent/probe-investigation.types.js.map +1 -0
  208. package/dist/apps/monolith/apps/fabric/src/auth/current-user.decorator.d.ts +2 -0
  209. package/dist/apps/monolith/apps/fabric/src/auth/current-user.decorator.js +11 -0
  210. package/dist/apps/monolith/apps/fabric/src/auth/current-user.decorator.js.map +1 -0
  211. package/dist/apps/monolith/apps/fabric/src/auth/request-user.d.ts +4 -0
  212. package/dist/apps/monolith/apps/fabric/src/auth/request-user.js +3 -0
  213. package/dist/apps/monolith/apps/fabric/src/auth/request-user.js.map +1 -0
  214. package/dist/apps/monolith/apps/fabric/src/config/configuration.d.ts +57 -0
  215. package/dist/apps/monolith/apps/fabric/src/config/configuration.js +185 -0
  216. package/dist/apps/monolith/apps/fabric/src/config/configuration.js.map +1 -0
  217. package/dist/apps/monolith/apps/fabric/src/database/entities/deployment-event.entity.d.ts +11 -0
  218. package/dist/apps/monolith/apps/fabric/src/database/entities/deployment-event.entity.js +67 -0
  219. package/dist/apps/monolith/apps/fabric/src/database/entities/deployment-event.entity.js.map +1 -0
  220. package/dist/apps/monolith/apps/fabric/src/database/entities/environment.entity.d.ts +9 -0
  221. package/dist/apps/monolith/apps/fabric/src/database/entities/environment.entity.js +55 -0
  222. package/dist/apps/monolith/apps/fabric/src/database/entities/environment.entity.js.map +1 -0
  223. package/dist/apps/monolith/apps/fabric/src/database/entities/index.d.ts +8 -0
  224. package/dist/apps/monolith/apps/fabric/src/database/entities/index.js +24 -0
  225. package/dist/apps/monolith/apps/fabric/src/database/entities/index.js.map +1 -0
  226. package/dist/apps/monolith/apps/fabric/src/database/entities/project.entity.d.ts +9 -0
  227. package/dist/apps/monolith/apps/fabric/src/database/entities/project.entity.js +55 -0
  228. package/dist/apps/monolith/apps/fabric/src/database/entities/project.entity.js.map +1 -0
  229. package/dist/apps/monolith/apps/fabric/src/database/entities/runtime.entity.d.ts +19 -0
  230. package/dist/apps/monolith/apps/fabric/src/database/entities/runtime.entity.js +105 -0
  231. package/dist/apps/monolith/apps/fabric/src/database/entities/runtime.entity.js.map +1 -0
  232. package/dist/apps/monolith/apps/fabric/src/database/entities/user-config.entity.d.ts +8 -0
  233. package/dist/apps/monolith/apps/fabric/src/database/entities/user-config.entity.js +50 -0
  234. package/dist/apps/monolith/apps/fabric/src/database/entities/user-config.entity.js.map +1 -0
  235. package/dist/apps/monolith/apps/fabric/src/database/entities/version.entity.d.ts +8 -0
  236. package/dist/apps/monolith/apps/fabric/src/database/entities/version.entity.js +50 -0
  237. package/dist/apps/monolith/apps/fabric/src/database/entities/version.entity.js.map +1 -0
  238. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.controller.d.ts +8 -0
  239. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.controller.js +49 -0
  240. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.controller.js.map +1 -0
  241. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.module.d.ts +2 -0
  242. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.module.js +24 -0
  243. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.module.js.map +1 -0
  244. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.service.d.ts +25 -0
  245. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.service.js +50 -0
  246. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.service.js.map +1 -0
  247. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.store.d.ts +28 -0
  248. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.store.js +132 -0
  249. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.store.js.map +1 -0
  250. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.types.d.ts +12 -0
  251. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.types.js +3 -0
  252. package/dist/apps/monolith/apps/fabric/src/deployment-events/deployment-events.types.js.map +1 -0
  253. package/dist/apps/monolith/apps/fabric/src/employees/dto/deploy.dto.d.ts +124 -0
  254. package/dist/apps/monolith/apps/fabric/src/employees/dto/deploy.dto.js +62 -0
  255. package/dist/apps/monolith/apps/fabric/src/employees/dto/deploy.dto.js.map +1 -0
  256. package/dist/apps/monolith/apps/fabric/src/employees/employees.controller.d.ts +38 -0
  257. package/dist/apps/monolith/apps/fabric/src/employees/employees.controller.js +222 -0
  258. package/dist/apps/monolith/apps/fabric/src/employees/employees.controller.js.map +1 -0
  259. package/dist/apps/monolith/apps/fabric/src/employees/employees.module.d.ts +2 -0
  260. package/dist/apps/monolith/apps/fabric/src/employees/employees.module.js +45 -0
  261. package/dist/apps/monolith/apps/fabric/src/employees/employees.module.js.map +1 -0
  262. package/dist/apps/monolith/apps/fabric/src/employees/employees.service.d.ts +81 -0
  263. package/dist/apps/monolith/apps/fabric/src/employees/employees.service.js +952 -0
  264. package/dist/apps/monolith/apps/fabric/src/employees/employees.service.js.map +1 -0
  265. package/dist/apps/monolith/apps/fabric/src/employees/employees.types.d.ts +43 -0
  266. package/dist/apps/monolith/apps/fabric/src/employees/employees.types.js +12 -0
  267. package/dist/apps/monolith/apps/fabric/src/employees/employees.types.js.map +1 -0
  268. package/dist/apps/monolith/apps/fabric/src/employees/errors/employee-deployment.errors.d.ts +25 -0
  269. package/dist/apps/monolith/apps/fabric/src/employees/errors/employee-deployment.errors.js +54 -0
  270. package/dist/apps/monolith/apps/fabric/src/employees/errors/employee-deployment.errors.js.map +1 -0
  271. package/dist/apps/monolith/apps/fabric/src/employees/runtime.store.d.ts +52 -0
  272. package/dist/apps/monolith/apps/fabric/src/employees/runtime.store.js +222 -0
  273. package/dist/apps/monolith/apps/fabric/src/employees/runtime.store.js.map +1 -0
  274. package/dist/apps/monolith/apps/fabric/src/environments/dto/environment.dto.d.ts +48 -0
  275. package/dist/apps/monolith/apps/fabric/src/environments/dto/environment.dto.js +25 -0
  276. package/dist/apps/monolith/apps/fabric/src/environments/dto/environment.dto.js.map +1 -0
  277. package/dist/apps/monolith/apps/fabric/src/environments/environments.controller.d.ts +13 -0
  278. package/dist/apps/monolith/apps/fabric/src/environments/environments.controller.js +82 -0
  279. package/dist/apps/monolith/apps/fabric/src/environments/environments.controller.js.map +1 -0
  280. package/dist/apps/monolith/apps/fabric/src/environments/environments.module.d.ts +2 -0
  281. package/dist/apps/monolith/apps/fabric/src/environments/environments.module.js +24 -0
  282. package/dist/apps/monolith/apps/fabric/src/environments/environments.module.js.map +1 -0
  283. package/dist/apps/monolith/apps/fabric/src/environments/environments.service.d.ts +24 -0
  284. package/dist/apps/monolith/apps/fabric/src/environments/environments.service.js +82 -0
  285. package/dist/apps/monolith/apps/fabric/src/environments/environments.service.js.map +1 -0
  286. package/dist/apps/monolith/apps/fabric/src/environments/environments.store.d.ts +22 -0
  287. package/dist/apps/monolith/apps/fabric/src/environments/environments.store.js +131 -0
  288. package/dist/apps/monolith/apps/fabric/src/environments/environments.store.js.map +1 -0
  289. package/dist/apps/monolith/apps/fabric/src/environments/environments.types.d.ts +10 -0
  290. package/dist/apps/monolith/apps/fabric/src/environments/environments.types.js +3 -0
  291. package/dist/apps/monolith/apps/fabric/src/environments/environments.types.js.map +1 -0
  292. package/dist/apps/monolith/apps/fabric/src/environments/errors/environment.errors.d.ts +7 -0
  293. package/dist/apps/monolith/apps/fabric/src/environments/errors/environment.errors.js +18 -0
  294. package/dist/apps/monolith/apps/fabric/src/environments/errors/environment.errors.js.map +1 -0
  295. package/dist/apps/monolith/apps/fabric/src/fabric-core.module.d.ts +4 -0
  296. package/dist/apps/monolith/apps/fabric/src/fabric-core.module.js +57 -0
  297. package/dist/apps/monolith/apps/fabric/src/fabric-core.module.js.map +1 -0
  298. package/dist/apps/monolith/apps/fabric/src/health/health.controller.d.ts +8 -0
  299. package/dist/apps/monolith/apps/fabric/src/health/health.controller.js +42 -0
  300. package/dist/apps/monolith/apps/fabric/src/health/health.controller.js.map +1 -0
  301. package/dist/apps/monolith/apps/fabric/src/health/health.module.d.ts +2 -0
  302. package/dist/apps/monolith/apps/fabric/src/health/health.module.js +25 -0
  303. package/dist/apps/monolith/apps/fabric/src/health/health.module.js.map +1 -0
  304. package/dist/apps/monolith/apps/fabric/src/health/provider-health.indicator.d.ts +7 -0
  305. package/dist/apps/monolith/apps/fabric/src/health/provider-health.indicator.js +42 -0
  306. package/dist/apps/monolith/apps/fabric/src/health/provider-health.indicator.js.map +1 -0
  307. package/dist/apps/monolith/apps/fabric/src/healthcheck/healthcheck.module.d.ts +2 -0
  308. package/dist/apps/monolith/apps/fabric/src/healthcheck/healthcheck.module.js +37 -0
  309. package/dist/apps/monolith/apps/fabric/src/healthcheck/healthcheck.module.js.map +1 -0
  310. package/dist/apps/monolith/apps/fabric/src/healthcheck/healthcheck.service.d.ts +40 -0
  311. package/dist/apps/monolith/apps/fabric/src/healthcheck/healthcheck.service.js +392 -0
  312. package/dist/apps/monolith/apps/fabric/src/healthcheck/healthcheck.service.js.map +1 -0
  313. package/dist/apps/monolith/apps/fabric/src/logs/logs.module.d.ts +2 -0
  314. package/dist/apps/monolith/apps/fabric/src/logs/logs.module.js +23 -0
  315. package/dist/apps/monolith/apps/fabric/src/logs/logs.module.js.map +1 -0
  316. package/dist/apps/monolith/apps/fabric/src/logs/logs.service.d.ts +22 -0
  317. package/dist/apps/monolith/apps/fabric/src/logs/logs.service.js +167 -0
  318. package/dist/apps/monolith/apps/fabric/src/logs/logs.service.js.map +1 -0
  319. package/dist/apps/monolith/apps/fabric/src/notifications/notifications.module.d.ts +2 -0
  320. package/dist/apps/monolith/apps/fabric/src/notifications/notifications.module.js +70 -0
  321. package/dist/apps/monolith/apps/fabric/src/notifications/notifications.module.js.map +1 -0
  322. package/dist/apps/monolith/apps/fabric/src/notifications/notifications.service.d.ts +35 -0
  323. package/dist/apps/monolith/apps/fabric/src/notifications/notifications.service.js +122 -0
  324. package/dist/apps/monolith/apps/fabric/src/notifications/notifications.service.js.map +1 -0
  325. package/dist/apps/monolith/apps/fabric/src/project-source/errors/project-source.errors.d.ts +4 -0
  326. package/dist/apps/monolith/apps/fabric/src/project-source/errors/project-source.errors.js +12 -0
  327. package/dist/apps/monolith/apps/fabric/src/project-source/errors/project-source.errors.js.map +1 -0
  328. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.module.d.ts +2 -0
  329. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.module.js +21 -0
  330. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.module.js.map +1 -0
  331. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.service.d.ts +12 -0
  332. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.service.js +79 -0
  333. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.service.js.map +1 -0
  334. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.types.d.ts +10 -0
  335. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.types.js +3 -0
  336. package/dist/apps/monolith/apps/fabric/src/project-source/project-source.types.js.map +1 -0
  337. package/dist/apps/monolith/apps/fabric/src/projects/dto/project.dto.d.ts +40 -0
  338. package/dist/apps/monolith/apps/fabric/src/projects/dto/project.dto.js +28 -0
  339. package/dist/apps/monolith/apps/fabric/src/projects/dto/project.dto.js.map +1 -0
  340. package/dist/apps/monolith/apps/fabric/src/projects/errors/project.errors.d.ts +7 -0
  341. package/dist/apps/monolith/apps/fabric/src/projects/errors/project.errors.js +18 -0
  342. package/dist/apps/monolith/apps/fabric/src/projects/errors/project.errors.js.map +1 -0
  343. package/dist/apps/monolith/apps/fabric/src/projects/projects-data.service.d.ts +11 -0
  344. package/dist/apps/monolith/apps/fabric/src/projects/projects-data.service.js +73 -0
  345. package/dist/apps/monolith/apps/fabric/src/projects/projects-data.service.js.map +1 -0
  346. package/dist/apps/monolith/apps/fabric/src/projects/projects.controller.d.ts +23 -0
  347. package/dist/apps/monolith/apps/fabric/src/projects/projects.controller.js +130 -0
  348. package/dist/apps/monolith/apps/fabric/src/projects/projects.controller.js.map +1 -0
  349. package/dist/apps/monolith/apps/fabric/src/projects/projects.module.d.ts +2 -0
  350. package/dist/apps/monolith/apps/fabric/src/projects/projects.module.js +33 -0
  351. package/dist/apps/monolith/apps/fabric/src/projects/projects.module.js.map +1 -0
  352. package/dist/apps/monolith/apps/fabric/src/projects/projects.service.d.ts +39 -0
  353. package/dist/apps/monolith/apps/fabric/src/projects/projects.service.js +245 -0
  354. package/dist/apps/monolith/apps/fabric/src/projects/projects.service.js.map +1 -0
  355. package/dist/apps/monolith/apps/fabric/src/projects/projects.store.d.ts +22 -0
  356. package/dist/apps/monolith/apps/fabric/src/projects/projects.store.js +130 -0
  357. package/dist/apps/monolith/apps/fabric/src/projects/projects.store.js.map +1 -0
  358. package/dist/apps/monolith/apps/fabric/src/projects/projects.types.d.ts +9 -0
  359. package/dist/apps/monolith/apps/fabric/src/projects/projects.types.js +3 -0
  360. package/dist/apps/monolith/apps/fabric/src/projects/projects.types.js.map +1 -0
  361. package/dist/apps/monolith/apps/fabric/src/providers/docker-provider.d.ts +17 -0
  362. package/dist/apps/monolith/apps/fabric/src/providers/docker-provider.js +128 -0
  363. package/dist/apps/monolith/apps/fabric/src/providers/docker-provider.js.map +1 -0
  364. package/dist/apps/monolith/apps/fabric/src/providers/eks-provider.d.ts +24 -0
  365. package/dist/apps/monolith/apps/fabric/src/providers/eks-provider.js +236 -0
  366. package/dist/apps/monolith/apps/fabric/src/providers/eks-provider.js.map +1 -0
  367. package/dist/apps/monolith/apps/fabric/src/providers/pm2-provider.d.ts +22 -0
  368. package/dist/apps/monolith/apps/fabric/src/providers/pm2-provider.js +177 -0
  369. package/dist/apps/monolith/apps/fabric/src/providers/pm2-provider.js.map +1 -0
  370. package/dist/apps/monolith/apps/fabric/src/providers/port-allocator.d.ts +9 -0
  371. package/dist/apps/monolith/apps/fabric/src/providers/port-allocator.js +62 -0
  372. package/dist/apps/monolith/apps/fabric/src/providers/port-allocator.js.map +1 -0
  373. package/dist/apps/monolith/apps/fabric/src/providers/provider-factory.d.ts +10 -0
  374. package/dist/apps/monolith/apps/fabric/src/providers/provider-factory.js +42 -0
  375. package/dist/apps/monolith/apps/fabric/src/providers/provider-factory.js.map +1 -0
  376. package/dist/apps/monolith/apps/fabric/src/providers/provider.interface.d.ts +28 -0
  377. package/dist/apps/monolith/apps/fabric/src/providers/provider.interface.js +5 -0
  378. package/dist/apps/monolith/apps/fabric/src/providers/provider.interface.js.map +1 -0
  379. package/dist/apps/monolith/apps/fabric/src/providers/providers.module.d.ts +2 -0
  380. package/dist/apps/monolith/apps/fabric/src/providers/providers.module.js +35 -0
  381. package/dist/apps/monolith/apps/fabric/src/providers/providers.module.js.map +1 -0
  382. package/dist/apps/monolith/apps/fabric/src/provisioners/cognito-provisioner.service.d.ts +33 -0
  383. package/dist/apps/monolith/apps/fabric/src/provisioners/cognito-provisioner.service.js +129 -0
  384. package/dist/apps/monolith/apps/fabric/src/provisioners/cognito-provisioner.service.js.map +1 -0
  385. package/dist/apps/monolith/apps/fabric/src/provisioners/postgres-provisioner.service.d.ts +36 -0
  386. package/dist/apps/monolith/apps/fabric/src/provisioners/postgres-provisioner.service.js +107 -0
  387. package/dist/apps/monolith/apps/fabric/src/provisioners/postgres-provisioner.service.js.map +1 -0
  388. package/dist/apps/monolith/apps/fabric/src/provisioners/provisioners.module.d.ts +2 -0
  389. package/dist/apps/monolith/apps/fabric/src/provisioners/provisioners.module.js +82 -0
  390. package/dist/apps/monolith/apps/fabric/src/provisioners/provisioners.module.js.map +1 -0
  391. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.module.d.ts +2 -0
  392. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.module.js +22 -0
  393. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.module.js.map +1 -0
  394. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.service.d.ts +17 -0
  395. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.service.js +57 -0
  396. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.service.js.map +1 -0
  397. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.store.d.ts +19 -0
  398. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.store.js +115 -0
  399. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.store.js.map +1 -0
  400. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.types.d.ts +10 -0
  401. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.types.js +6 -0
  402. package/dist/apps/monolith/apps/fabric/src/user-config/user-config.types.js.map +1 -0
  403. package/dist/apps/monolith/apps/fabric/src/versions/versions.controller.d.ts +9 -0
  404. package/dist/apps/monolith/apps/fabric/src/versions/versions.controller.js +52 -0
  405. package/dist/apps/monolith/apps/fabric/src/versions/versions.controller.js.map +1 -0
  406. package/dist/apps/monolith/apps/fabric/src/versions/versions.module.d.ts +2 -0
  407. package/dist/apps/monolith/apps/fabric/src/versions/versions.module.js +24 -0
  408. package/dist/apps/monolith/apps/fabric/src/versions/versions.module.js.map +1 -0
  409. package/dist/apps/monolith/apps/fabric/src/versions/versions.service.d.ts +12 -0
  410. package/dist/apps/monolith/apps/fabric/src/versions/versions.service.js +62 -0
  411. package/dist/apps/monolith/apps/fabric/src/versions/versions.service.js.map +1 -0
  412. package/dist/apps/monolith/apps/fabric/src/versions/versions.store.d.ts +24 -0
  413. package/dist/apps/monolith/apps/fabric/src/versions/versions.store.js +133 -0
  414. package/dist/apps/monolith/apps/fabric/src/versions/versions.store.js.map +1 -0
  415. package/dist/apps/monolith/apps/fabric/src/versions/versions.types.d.ts +11 -0
  416. package/dist/apps/monolith/apps/fabric/src/versions/versions.types.js +3 -0
  417. package/dist/apps/monolith/apps/fabric/src/versions/versions.types.js.map +1 -0
  418. package/dist/apps/monolith/apps/fabric/src/watcher/deployment-watcher.module.d.ts +2 -0
  419. package/dist/apps/monolith/apps/fabric/src/watcher/deployment-watcher.module.js +35 -0
  420. package/dist/apps/monolith/apps/fabric/src/watcher/deployment-watcher.module.js.map +1 -0
  421. package/dist/apps/monolith/apps/fabric/src/watcher/deployment-watcher.service.d.ts +18 -0
  422. package/dist/apps/monolith/apps/fabric/src/watcher/deployment-watcher.service.js +84 -0
  423. package/dist/apps/monolith/apps/fabric/src/watcher/deployment-watcher.service.js.map +1 -0
  424. package/dist/apps/monolith/apps/fabric/src/watcher/pod-probe.service.d.ts +28 -0
  425. package/dist/apps/monolith/apps/fabric/src/watcher/pod-probe.service.js +211 -0
  426. package/dist/apps/monolith/apps/fabric/src/watcher/pod-probe.service.js.map +1 -0
  427. package/dist/apps/monolith/apps/integrations/src/config/configuration.d.ts +27 -0
  428. package/dist/apps/monolith/apps/integrations/src/config/configuration.js +85 -0
  429. package/dist/apps/monolith/apps/integrations/src/config/configuration.js.map +1 -0
  430. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/client.d.ts +9 -0
  431. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/client.js +46 -0
  432. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/client.js.map +1 -0
  433. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/commonInputTypes.d.ts +246 -0
  434. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/commonInputTypes.js +3 -0
  435. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/commonInputTypes.js.map +1 -0
  436. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/enums.d.ts +1 -0
  437. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/enums.js +3 -0
  438. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/enums.js.map +1 -0
  439. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/internal/class.d.ts +35 -0
  440. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/internal/class.js +75 -0
  441. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/internal/class.js.map +1 -0
  442. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/internal/prismaNamespace.d.ts +374 -0
  443. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/internal/prismaNamespace.js +103 -0
  444. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/internal/prismaNamespace.js.map +1 -0
  445. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/models/IntegrationEntity.d.ts +521 -0
  446. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/models/IntegrationEntity.js +3 -0
  447. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/models/IntegrationEntity.js.map +1 -0
  448. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/models.d.ts +2 -0
  449. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/models.js +3 -0
  450. package/dist/apps/monolith/apps/integrations/src/generated/prisma-postgres/models.js.map +1 -0
  451. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/client.d.ts +9 -0
  452. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/client.js +46 -0
  453. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/client.js.map +1 -0
  454. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/commonInputTypes.d.ts +227 -0
  455. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/commonInputTypes.js +3 -0
  456. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/commonInputTypes.js.map +1 -0
  457. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/enums.d.ts +1 -0
  458. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/enums.js +3 -0
  459. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/enums.js.map +1 -0
  460. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/internal/class.d.ts +35 -0
  461. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/internal/class.js +75 -0
  462. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/internal/class.js.map +1 -0
  463. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/internal/prismaNamespace.d.ts +368 -0
  464. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/internal/prismaNamespace.js +100 -0
  465. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/internal/prismaNamespace.js.map +1 -0
  466. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/models/IntegrationEntity.d.ts +519 -0
  467. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/models/IntegrationEntity.js +3 -0
  468. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/models/IntegrationEntity.js.map +1 -0
  469. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/models.d.ts +2 -0
  470. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/models.js +3 -0
  471. package/dist/apps/monolith/apps/integrations/src/generated/prisma-sqlite/models.js.map +1 -0
  472. package/dist/apps/monolith/apps/integrations/src/integrations-core.module.d.ts +4 -0
  473. package/dist/apps/monolith/apps/integrations/src/integrations-core.module.js +61 -0
  474. package/dist/apps/monolith/apps/integrations/src/integrations-core.module.js.map +1 -0
  475. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/auth-flow.module.d.ts +2 -0
  476. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/auth-flow.module.js +34 -0
  477. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/auth-flow.module.js.map +1 -0
  478. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/auth-flow.service.d.ts +52 -0
  479. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/auth-flow.service.js +185 -0
  480. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/auth-flow.service.js.map +1 -0
  481. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/scheduler.service.d.ts +14 -0
  482. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/scheduler.service.js +69 -0
  483. package/dist/apps/monolith/apps/integrations/src/modules/auth-flow/scheduler.service.js.map +1 -0
  484. package/dist/apps/monolith/apps/integrations/src/modules/connections/connections.module.d.ts +2 -0
  485. package/dist/apps/monolith/apps/integrations/src/modules/connections/connections.module.js +24 -0
  486. package/dist/apps/monolith/apps/integrations/src/modules/connections/connections.module.js.map +1 -0
  487. package/dist/apps/monolith/apps/integrations/src/modules/connections/connections.service.d.ts +31 -0
  488. package/dist/apps/monolith/apps/integrations/src/modules/connections/connections.service.js +91 -0
  489. package/dist/apps/monolith/apps/integrations/src/modules/connections/connections.service.js.map +1 -0
  490. package/dist/apps/monolith/apps/integrations/src/modules/credentials/credentials.module.d.ts +2 -0
  491. package/dist/apps/monolith/apps/integrations/src/modules/credentials/credentials.module.js +24 -0
  492. package/dist/apps/monolith/apps/integrations/src/modules/credentials/credentials.module.js.map +1 -0
  493. package/dist/apps/monolith/apps/integrations/src/modules/credentials/encryption.service.d.ts +14 -0
  494. package/dist/apps/monolith/apps/integrations/src/modules/credentials/encryption.service.js +62 -0
  495. package/dist/apps/monolith/apps/integrations/src/modules/credentials/encryption.service.js.map +1 -0
  496. package/dist/apps/monolith/apps/integrations/src/modules/credentials/token-store.service.d.ts +12 -0
  497. package/dist/apps/monolith/apps/integrations/src/modules/credentials/token-store.service.js +70 -0
  498. package/dist/apps/monolith/apps/integrations/src/modules/credentials/token-store.service.js.map +1 -0
  499. package/dist/apps/monolith/apps/integrations/src/modules/discovery/discovery.module.d.ts +2 -0
  500. package/dist/apps/monolith/apps/integrations/src/modules/discovery/discovery.module.js +21 -0
  501. package/dist/apps/monolith/apps/integrations/src/modules/discovery/discovery.module.js.map +1 -0
  502. package/dist/apps/monolith/apps/integrations/src/modules/discovery/oidc-discovery.service.d.ts +25 -0
  503. package/dist/apps/monolith/apps/integrations/src/modules/discovery/oidc-discovery.service.js +83 -0
  504. package/dist/apps/monolith/apps/integrations/src/modules/discovery/oidc-discovery.service.js.map +1 -0
  505. package/dist/apps/monolith/apps/integrations/src/modules/platform/metadata-store.service.d.ts +31 -0
  506. package/dist/apps/monolith/apps/integrations/src/modules/platform/metadata-store.service.js +278 -0
  507. package/dist/apps/monolith/apps/integrations/src/modules/platform/metadata-store.service.js.map +1 -0
  508. package/dist/apps/monolith/apps/integrations/src/modules/platform/platform.module.d.ts +2 -0
  509. package/dist/apps/monolith/apps/integrations/src/modules/platform/platform.module.js +21 -0
  510. package/dist/apps/monolith/apps/integrations/src/modules/platform/platform.module.js.map +1 -0
  511. package/dist/apps/monolith/apps/integrations/src/modules/platform/platform.types.d.ts +9 -0
  512. package/dist/apps/monolith/apps/integrations/src/modules/platform/platform.types.js +3 -0
  513. package/dist/apps/monolith/apps/integrations/src/modules/platform/platform.types.js.map +1 -0
  514. package/dist/apps/monolith/apps/integrations/src/modules/platform/resilient-fetch.d.ts +6 -0
  515. package/dist/apps/monolith/apps/integrations/src/modules/platform/resilient-fetch.js +38 -0
  516. package/dist/apps/monolith/apps/integrations/src/modules/platform/resilient-fetch.js.map +1 -0
  517. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/api-key.provider.d.ts +9 -0
  518. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/api-key.provider.js +34 -0
  519. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/api-key.provider.js.map +1 -0
  520. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/basic-auth.provider.d.ts +9 -0
  521. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/basic-auth.provider.js +35 -0
  522. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/basic-auth.provider.js.map +1 -0
  523. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/oauth2.provider.d.ts +13 -0
  524. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/oauth2.provider.js +162 -0
  525. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/oauth2.provider.js.map +1 -0
  526. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/oidc.provider.d.ts +14 -0
  527. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/oidc.provider.js +55 -0
  528. package/dist/apps/monolith/apps/integrations/src/modules/providers/base/oidc.provider.js.map +1 -0
  529. package/dist/apps/monolith/apps/integrations/src/modules/providers/builtin/google-drive.provider.d.ts +3 -0
  530. package/dist/apps/monolith/apps/integrations/src/modules/providers/builtin/google-drive.provider.js +39 -0
  531. package/dist/apps/monolith/apps/integrations/src/modules/providers/builtin/google-drive.provider.js.map +1 -0
  532. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.factory.d.ts +11 -0
  533. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.factory.js +70 -0
  534. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.factory.js.map +1 -0
  535. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.registry.d.ts +20 -0
  536. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.registry.js +114 -0
  537. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.registry.js.map +1 -0
  538. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.types.d.ts +160 -0
  539. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.types.js +20 -0
  540. package/dist/apps/monolith/apps/integrations/src/modules/providers/provider.types.js.map +1 -0
  541. package/dist/apps/monolith/apps/integrations/src/modules/providers/providers.module.d.ts +2 -0
  542. package/dist/apps/monolith/apps/integrations/src/modules/providers/providers.module.js +46 -0
  543. package/dist/apps/monolith/apps/integrations/src/modules/providers/providers.module.js.map +1 -0
  544. package/dist/apps/monolith/apps/integrations/src/modules/tenant-config/tenant-config.module.d.ts +2 -0
  545. package/dist/apps/monolith/apps/integrations/src/modules/tenant-config/tenant-config.module.js +24 -0
  546. package/dist/apps/monolith/apps/integrations/src/modules/tenant-config/tenant-config.module.js.map +1 -0
  547. package/dist/apps/monolith/apps/integrations/src/modules/tenant-config/tenant-config.service.d.ts +48 -0
  548. package/dist/apps/monolith/apps/integrations/src/modules/tenant-config/tenant-config.service.js +136 -0
  549. package/dist/apps/monolith/apps/integrations/src/modules/tenant-config/tenant-config.service.js.map +1 -0
  550. package/dist/apps/monolith/apps/monolith/src/app.module.d.ts +2 -0
  551. package/dist/apps/monolith/apps/monolith/src/app.module.js +73 -0
  552. package/dist/apps/monolith/apps/monolith/src/app.module.js.map +1 -0
  553. package/dist/apps/monolith/apps/monolith/src/config/configuration.d.ts +26 -0
  554. package/dist/apps/monolith/apps/monolith/src/config/configuration.js +82 -0
  555. package/dist/apps/monolith/apps/monolith/src/config/configuration.js.map +1 -0
  556. package/dist/apps/monolith/apps/monolith/src/health/health.controller.d.ts +7 -0
  557. package/dist/apps/monolith/apps/monolith/src/health/health.controller.js +41 -0
  558. package/dist/apps/monolith/apps/monolith/src/health/health.controller.js.map +1 -0
  559. package/dist/apps/monolith/apps/monolith/src/health/health.module.d.ts +2 -0
  560. package/dist/apps/monolith/apps/monolith/src/health/health.module.js +22 -0
  561. package/dist/apps/monolith/apps/monolith/src/health/health.module.js.map +1 -0
  562. package/dist/apps/monolith/apps/monolith/src/main.d.ts +1 -0
  563. package/dist/apps/monolith/apps/monolith/src/main.js +46 -0
  564. package/dist/apps/monolith/apps/monolith/src/main.js.map +1 -0
  565. package/dist/apps/monolith/libs/agentcraft/src/agentcraft.module.d.ts +13 -0
  566. package/dist/apps/monolith/libs/agentcraft/src/agentcraft.module.js +137 -0
  567. package/dist/apps/monolith/libs/agentcraft/src/agentcraft.module.js.map +1 -0
  568. package/dist/apps/monolith/libs/agentcraft/src/constants.d.ts +2 -0
  569. package/dist/apps/monolith/libs/agentcraft/src/constants.js +6 -0
  570. package/dist/apps/monolith/libs/agentcraft/src/constants.js.map +1 -0
  571. package/dist/apps/monolith/libs/agentcraft/src/dto/submit-action.dto.d.ts +32 -0
  572. package/dist/apps/monolith/libs/agentcraft/src/dto/submit-action.dto.js +23 -0
  573. package/dist/apps/monolith/libs/agentcraft/src/dto/submit-action.dto.js.map +1 -0
  574. package/dist/apps/monolith/libs/agentcraft/src/errors/domain.error.d.ts +8 -0
  575. package/dist/apps/monolith/libs/agentcraft/src/errors/domain.error.js +19 -0
  576. package/dist/apps/monolith/libs/agentcraft/src/errors/domain.error.js.map +1 -0
  577. package/dist/apps/monolith/libs/agentcraft/src/errors/llm.errors.d.ts +10 -0
  578. package/dist/apps/monolith/libs/agentcraft/src/errors/llm.errors.js +23 -0
  579. package/dist/apps/monolith/libs/agentcraft/src/errors/llm.errors.js.map +1 -0
  580. package/dist/apps/monolith/libs/agentcraft/src/index.d.ts +44 -0
  581. package/dist/apps/monolith/libs/agentcraft/src/index.js +91 -0
  582. package/dist/apps/monolith/libs/agentcraft/src/index.js.map +1 -0
  583. package/dist/apps/monolith/libs/agentcraft/src/instructions/step6-data-model.d.ts +1 -0
  584. package/dist/apps/monolith/libs/agentcraft/src/instructions/step6-data-model.js +185 -0
  585. package/dist/apps/monolith/libs/agentcraft/src/instructions/step6-data-model.js.map +1 -0
  586. package/dist/apps/monolith/libs/agentcraft/src/instructions/step7-workflows.d.ts +1 -0
  587. package/dist/apps/monolith/libs/agentcraft/src/instructions/step7-workflows.js +548 -0
  588. package/dist/apps/monolith/libs/agentcraft/src/instructions/step7-workflows.js.map +1 -0
  589. package/dist/apps/monolith/libs/agentcraft/src/instructions/step8-agents.d.ts +1 -0
  590. package/dist/apps/monolith/libs/agentcraft/src/instructions/step8-agents.js +118 -0
  591. package/dist/apps/monolith/libs/agentcraft/src/instructions/step8-agents.js.map +1 -0
  592. package/dist/apps/monolith/libs/agentcraft/src/interfaces/llm-provider.interface.d.ts +8 -0
  593. package/dist/apps/monolith/libs/agentcraft/src/interfaces/llm-provider.interface.js +3 -0
  594. package/dist/apps/monolith/libs/agentcraft/src/interfaces/llm-provider.interface.js.map +1 -0
  595. package/dist/apps/monolith/libs/agentcraft/src/prompts/assembly.prompt.d.ts +1 -0
  596. package/dist/apps/monolith/libs/agentcraft/src/prompts/assembly.prompt.js +103 -0
  597. package/dist/apps/monolith/libs/agentcraft/src/prompts/assembly.prompt.js.map +1 -0
  598. package/dist/apps/monolith/libs/agentcraft/src/prompts/codegen.prompt.d.ts +2 -0
  599. package/dist/apps/monolith/libs/agentcraft/src/prompts/codegen.prompt.js +80 -0
  600. package/dist/apps/monolith/libs/agentcraft/src/prompts/codegen.prompt.js.map +1 -0
  601. package/dist/apps/monolith/libs/agentcraft/src/prompts/decomposition.prompt.d.ts +1 -0
  602. package/dist/apps/monolith/libs/agentcraft/src/prompts/decomposition.prompt.js +36 -0
  603. package/dist/apps/monolith/libs/agentcraft/src/prompts/decomposition.prompt.js.map +1 -0
  604. package/dist/apps/monolith/libs/agentcraft/src/prompts/examples-provider.d.ts +6 -0
  605. package/dist/apps/monolith/libs/agentcraft/src/prompts/examples-provider.js +50 -0
  606. package/dist/apps/monolith/libs/agentcraft/src/prompts/examples-provider.js.map +1 -0
  607. package/dist/apps/monolith/libs/agentcraft/src/prompts/planning.prompt.d.ts +1 -0
  608. package/dist/apps/monolith/libs/agentcraft/src/prompts/planning.prompt.js +56 -0
  609. package/dist/apps/monolith/libs/agentcraft/src/prompts/planning.prompt.js.map +1 -0
  610. package/dist/apps/monolith/libs/agentcraft/src/prompts/resolver.prompt.d.ts +9 -0
  611. package/dist/apps/monolith/libs/agentcraft/src/prompts/resolver.prompt.js +320 -0
  612. package/dist/apps/monolith/libs/agentcraft/src/prompts/resolver.prompt.js.map +1 -0
  613. package/dist/apps/monolith/libs/agentcraft/src/prompts/semantics-guide.d.ts +1 -0
  614. package/dist/apps/monolith/libs/agentcraft/src/prompts/semantics-guide.js +130 -0
  615. package/dist/apps/monolith/libs/agentcraft/src/prompts/semantics-guide.js.map +1 -0
  616. package/dist/apps/monolith/libs/agentcraft/src/services/anthropic-craft-llm.service.d.ts +13 -0
  617. package/dist/apps/monolith/libs/agentcraft/src/services/anthropic-craft-llm.service.js +167 -0
  618. package/dist/apps/monolith/libs/agentcraft/src/services/anthropic-craft-llm.service.js.map +1 -0
  619. package/dist/apps/monolith/libs/agentcraft/src/services/anthropic-llm.service.d.ts +9 -0
  620. package/dist/apps/monolith/libs/agentcraft/src/services/anthropic-llm.service.js +67 -0
  621. package/dist/apps/monolith/libs/agentcraft/src/services/anthropic-llm.service.js.map +1 -0
  622. package/dist/apps/monolith/libs/agentcraft/src/services/api-adapter.service.d.ts +43 -0
  623. package/dist/apps/monolith/libs/agentcraft/src/services/api-adapter.service.js +154 -0
  624. package/dist/apps/monolith/libs/agentcraft/src/services/api-adapter.service.js.map +1 -0
  625. package/dist/apps/monolith/libs/agentcraft/src/services/architect-loop.service.d.ts +36 -0
  626. package/dist/apps/monolith/libs/agentcraft/src/services/architect-loop.service.js +282 -0
  627. package/dist/apps/monolith/libs/agentcraft/src/services/architect-loop.service.js.map +1 -0
  628. package/dist/apps/monolith/libs/agentcraft/src/services/autonomous-runner.service.d.ts +16 -0
  629. package/dist/apps/monolith/libs/agentcraft/src/services/autonomous-runner.service.js +135 -0
  630. package/dist/apps/monolith/libs/agentcraft/src/services/autonomous-runner.service.js.map +1 -0
  631. package/dist/apps/monolith/libs/agentcraft/src/services/craft-config.service.d.ts +11 -0
  632. package/dist/apps/monolith/libs/agentcraft/src/services/craft-config.service.js +91 -0
  633. package/dist/apps/monolith/libs/agentcraft/src/services/craft-config.service.js.map +1 -0
  634. package/dist/apps/monolith/libs/agentcraft/src/services/craft-llm-adapter.service.d.ts +9 -0
  635. package/dist/apps/monolith/libs/agentcraft/src/services/craft-llm-adapter.service.js +57 -0
  636. package/dist/apps/monolith/libs/agentcraft/src/services/craft-llm-adapter.service.js.map +1 -0
  637. package/dist/apps/monolith/libs/agentcraft/src/services/decomposer.service.d.ts +9 -0
  638. package/dist/apps/monolith/libs/agentcraft/src/services/decomposer.service.js +100 -0
  639. package/dist/apps/monolith/libs/agentcraft/src/services/decomposer.service.js.map +1 -0
  640. package/dist/apps/monolith/libs/agentcraft/src/services/design-generator.service.d.ts +14 -0
  641. package/dist/apps/monolith/libs/agentcraft/src/services/design-generator.service.js +544 -0
  642. package/dist/apps/monolith/libs/agentcraft/src/services/design-generator.service.js.map +1 -0
  643. package/dist/apps/monolith/libs/agentcraft/src/services/executor.service.d.ts +17 -0
  644. package/dist/apps/monolith/libs/agentcraft/src/services/executor.service.js +347 -0
  645. package/dist/apps/monolith/libs/agentcraft/src/services/executor.service.js.map +1 -0
  646. package/dist/apps/monolith/libs/agentcraft/src/services/kb-watcher.service.d.ts +12 -0
  647. package/dist/apps/monolith/libs/agentcraft/src/services/kb-watcher.service.js +141 -0
  648. package/dist/apps/monolith/libs/agentcraft/src/services/kb-watcher.service.js.map +1 -0
  649. package/dist/apps/monolith/libs/agentcraft/src/services/openai-llm.service.d.ts +9 -0
  650. package/dist/apps/monolith/libs/agentcraft/src/services/openai-llm.service.js +69 -0
  651. package/dist/apps/monolith/libs/agentcraft/src/services/openai-llm.service.js.map +1 -0
  652. package/dist/apps/monolith/libs/agentcraft/src/services/output-parser.service.d.ts +9 -0
  653. package/dist/apps/monolith/libs/agentcraft/src/services/output-parser.service.js +68 -0
  654. package/dist/apps/monolith/libs/agentcraft/src/services/output-parser.service.js.map +1 -0
  655. package/dist/apps/monolith/libs/agentcraft/src/services/pipeline-state.service.d.ts +15 -0
  656. package/dist/apps/monolith/libs/agentcraft/src/services/pipeline-state.service.js +106 -0
  657. package/dist/apps/monolith/libs/agentcraft/src/services/pipeline-state.service.js.map +1 -0
  658. package/dist/apps/monolith/libs/agentcraft/src/services/pipeline-steps.service.d.ts +10 -0
  659. package/dist/apps/monolith/libs/agentcraft/src/services/pipeline-steps.service.js +134 -0
  660. package/dist/apps/monolith/libs/agentcraft/src/services/pipeline-steps.service.js.map +1 -0
  661. package/dist/apps/monolith/libs/agentcraft/src/services/planner.service.d.ts +13 -0
  662. package/dist/apps/monolith/libs/agentcraft/src/services/planner.service.js +165 -0
  663. package/dist/apps/monolith/libs/agentcraft/src/services/planner.service.js.map +1 -0
  664. package/dist/apps/monolith/libs/agentcraft/src/services/readme-generator.service.d.ts +10 -0
  665. package/dist/apps/monolith/libs/agentcraft/src/services/readme-generator.service.js +195 -0
  666. package/dist/apps/monolith/libs/agentcraft/src/services/readme-generator.service.js.map +1 -0
  667. package/dist/apps/monolith/libs/agentcraft/src/services/registry-client.service.d.ts +14 -0
  668. package/dist/apps/monolith/libs/agentcraft/src/services/registry-client.service.js +130 -0
  669. package/dist/apps/monolith/libs/agentcraft/src/services/registry-client.service.js.map +1 -0
  670. package/dist/apps/monolith/libs/agentcraft/src/services/requirements-generator.service.d.ts +12 -0
  671. package/dist/apps/monolith/libs/agentcraft/src/services/requirements-generator.service.js +198 -0
  672. package/dist/apps/monolith/libs/agentcraft/src/services/requirements-generator.service.js.map +1 -0
  673. package/dist/apps/monolith/libs/agentcraft/src/services/spec-fetcher.service.d.ts +3 -0
  674. package/dist/apps/monolith/libs/agentcraft/src/services/spec-fetcher.service.js +30 -0
  675. package/dist/apps/monolith/libs/agentcraft/src/services/spec-fetcher.service.js.map +1 -0
  676. package/dist/apps/monolith/libs/agentcraft/src/services/ui-blueprint-generator.service.d.ts +14 -0
  677. package/dist/apps/monolith/libs/agentcraft/src/services/ui-blueprint-generator.service.js +346 -0
  678. package/dist/apps/monolith/libs/agentcraft/src/services/ui-blueprint-generator.service.js.map +1 -0
  679. package/dist/apps/monolith/libs/agentcraft/src/types/architect.types.d.ts +122 -0
  680. package/dist/apps/monolith/libs/agentcraft/src/types/architect.types.js +3 -0
  681. package/dist/apps/monolith/libs/agentcraft/src/types/architect.types.js.map +1 -0
  682. package/dist/apps/monolith/libs/agentcraft/src/types/autonomous.types.d.ts +56 -0
  683. package/dist/apps/monolith/libs/agentcraft/src/types/autonomous.types.js +3 -0
  684. package/dist/apps/monolith/libs/agentcraft/src/types/autonomous.types.js.map +1 -0
  685. package/dist/apps/monolith/libs/agentcraft/src/types/llm.types.d.ts +55 -0
  686. package/dist/apps/monolith/libs/agentcraft/src/types/llm.types.js +3 -0
  687. package/dist/apps/monolith/libs/agentcraft/src/types/llm.types.js.map +1 -0
  688. package/dist/apps/monolith/libs/agentcraft/src/types/pipeline.types.d.ts +55 -0
  689. package/dist/apps/monolith/libs/agentcraft/src/types/pipeline.types.js +34 -0
  690. package/dist/apps/monolith/libs/agentcraft/src/types/pipeline.types.js.map +1 -0
  691. package/dist/apps/monolith/libs/agentcraft/src/types/resolver.types.d.ts +27 -0
  692. package/dist/apps/monolith/libs/agentcraft/src/types/resolver.types.js +3 -0
  693. package/dist/apps/monolith/libs/agentcraft/src/types/resolver.types.js.map +1 -0
  694. package/dist/apps/monolith/libs/agentcraft/src/types/signal.types.d.ts +11 -0
  695. package/dist/apps/monolith/libs/agentcraft/src/types/signal.types.js +3 -0
  696. package/dist/apps/monolith/libs/agentcraft/src/types/signal.types.js.map +1 -0
  697. package/dist/apps/monolith/libs/agentcraft/src/utils/kb-loader.d.ts +1 -0
  698. package/dist/apps/monolith/libs/agentcraft/src/utils/kb-loader.js +61 -0
  699. package/dist/apps/monolith/libs/agentcraft/src/utils/kb-loader.js.map +1 -0
  700. package/dist/apps/monolith/libs/agentcraft/src/utils/output-writer.d.ts +6 -0
  701. package/dist/apps/monolith/libs/agentcraft/src/utils/output-writer.js +57 -0
  702. package/dist/apps/monolith/libs/agentcraft/src/utils/output-writer.js.map +1 -0
  703. package/dist/apps/monolith/libs/agentcraft/src/utils/spec-fetcher.d.ts +1 -0
  704. package/dist/apps/monolith/libs/agentcraft/src/utils/spec-fetcher.js +20 -0
  705. package/dist/apps/monolith/libs/agentcraft/src/utils/spec-fetcher.js.map +1 -0
  706. package/dist/apps/monolith/libs/agentcraft/src/utils/spec-trimmer.d.ts +9 -0
  707. package/dist/apps/monolith/libs/agentcraft/src/utils/spec-trimmer.js +235 -0
  708. package/dist/apps/monolith/libs/agentcraft/src/utils/spec-trimmer.js.map +1 -0
  709. package/dist/apps/monolith/libs/agentcraft/src/utils/text-utils.d.ts +5 -0
  710. package/dist/apps/monolith/libs/agentcraft/src/utils/text-utils.js +36 -0
  711. package/dist/apps/monolith/libs/agentcraft/src/utils/text-utils.js.map +1 -0
  712. package/dist/apps/monolith/libs/agentcraft/src/utils/validator.d.ts +8 -0
  713. package/dist/apps/monolith/libs/agentcraft/src/utils/validator.js +187 -0
  714. package/dist/apps/monolith/libs/agentcraft/src/utils/validator.js.map +1 -0
  715. package/dist/apps/monolith/libs/common/src/database/data-source.service.d.ts +15 -0
  716. package/dist/apps/monolith/libs/common/src/database/data-source.service.js +77 -0
  717. package/dist/apps/monolith/libs/common/src/database/data-source.service.js.map +1 -0
  718. package/dist/apps/monolith/libs/common/src/database/database-connection.holder.d.ts +15 -0
  719. package/dist/apps/monolith/libs/common/src/database/database-connection.holder.js +47 -0
  720. package/dist/apps/monolith/libs/common/src/database/database-connection.holder.js.map +1 -0
  721. package/dist/apps/monolith/libs/common/src/database/database.config.d.ts +13 -0
  722. package/dist/apps/monolith/libs/common/src/database/database.config.js +5 -0
  723. package/dist/apps/monolith/libs/common/src/database/database.config.js.map +1 -0
  724. package/dist/apps/monolith/libs/common/src/database/database.module.d.ts +9 -0
  725. package/dist/apps/monolith/libs/common/src/database/database.module.js +48 -0
  726. package/dist/apps/monolith/libs/common/src/database/database.module.js.map +1 -0
  727. package/dist/apps/monolith/libs/common/src/database/embedded-database.service.d.ts +12 -0
  728. package/dist/apps/monolith/libs/common/src/database/embedded-database.service.js +108 -0
  729. package/dist/apps/monolith/libs/common/src/database/embedded-database.service.js.map +1 -0
  730. package/dist/apps/monolith/libs/common/src/database/file-store.d.ts +10 -0
  731. package/dist/apps/monolith/libs/common/src/database/file-store.factory.d.ts +8 -0
  732. package/dist/apps/monolith/libs/common/src/database/file-store.factory.js +37 -0
  733. package/dist/apps/monolith/libs/common/src/database/file-store.factory.js.map +1 -0
  734. package/dist/apps/monolith/libs/common/src/database/file-store.js +52 -0
  735. package/dist/apps/monolith/libs/common/src/database/file-store.js.map +1 -0
  736. package/dist/apps/monolith/libs/common/src/errors/domain.error.d.ts +4 -0
  737. package/dist/apps/monolith/libs/common/src/errors/domain.error.js +12 -0
  738. package/dist/apps/monolith/libs/common/src/errors/domain.error.js.map +1 -0
  739. package/dist/apps/monolith/libs/common/src/filters/domain-exception.filter.d.ts +8 -0
  740. package/dist/apps/monolith/libs/common/src/filters/domain-exception.filter.js +46 -0
  741. package/dist/apps/monolith/libs/common/src/filters/domain-exception.filter.js.map +1 -0
  742. package/dist/apps/monolith/libs/common/src/index.d.ts +13 -0
  743. package/dist/apps/monolith/libs/common/src/index.js +24 -0
  744. package/dist/apps/monolith/libs/common/src/index.js.map +1 -0
  745. package/dist/apps/monolith/libs/common/src/interceptors/logging.interceptor.d.ts +6 -0
  746. package/dist/apps/monolith/libs/common/src/interceptors/logging.interceptor.js +56 -0
  747. package/dist/apps/monolith/libs/common/src/interceptors/logging.interceptor.js.map +1 -0
  748. package/dist/apps/monolith/libs/project-provider/src/constants.d.ts +7 -0
  749. package/dist/apps/monolith/libs/project-provider/src/constants.js +11 -0
  750. package/dist/apps/monolith/libs/project-provider/src/constants.js.map +1 -0
  751. package/dist/apps/monolith/libs/project-provider/src/errors/domain.error.d.ts +1 -0
  752. package/dist/apps/monolith/libs/project-provider/src/errors/domain.error.js +6 -0
  753. package/dist/apps/monolith/libs/project-provider/src/errors/domain.error.js.map +1 -0
  754. package/dist/apps/monolith/libs/project-provider/src/errors/employee-code.errors.d.ts +13 -0
  755. package/dist/apps/monolith/libs/project-provider/src/errors/employee-code.errors.js +29 -0
  756. package/dist/apps/monolith/libs/project-provider/src/errors/employee-code.errors.js.map +1 -0
  757. package/dist/apps/monolith/libs/project-provider/src/errors/inbox.errors.d.ts +13 -0
  758. package/dist/apps/monolith/libs/project-provider/src/errors/inbox.errors.js +29 -0
  759. package/dist/apps/monolith/libs/project-provider/src/errors/inbox.errors.js.map +1 -0
  760. package/dist/apps/monolith/libs/project-provider/src/errors/registry.errors.d.ts +16 -0
  761. package/dist/apps/monolith/libs/project-provider/src/errors/registry.errors.js +35 -0
  762. package/dist/apps/monolith/libs/project-provider/src/errors/registry.errors.js.map +1 -0
  763. package/dist/apps/monolith/libs/project-provider/src/index.d.ts +23 -0
  764. package/dist/apps/monolith/libs/project-provider/src/index.js +50 -0
  765. package/dist/apps/monolith/libs/project-provider/src/index.js.map +1 -0
  766. package/dist/apps/monolith/libs/project-provider/src/interfaces/employee-code-provider.interface.d.ts +11 -0
  767. package/dist/apps/monolith/libs/project-provider/src/interfaces/employee-code-provider.interface.js +3 -0
  768. package/dist/apps/monolith/libs/project-provider/src/interfaces/employee-code-provider.interface.js.map +1 -0
  769. package/dist/apps/monolith/libs/project-provider/src/interfaces/inbox-client.interface.d.ts +3 -0
  770. package/dist/apps/monolith/libs/project-provider/src/interfaces/inbox-client.interface.js +3 -0
  771. package/dist/apps/monolith/libs/project-provider/src/interfaces/inbox-client.interface.js.map +1 -0
  772. package/dist/apps/monolith/libs/project-provider/src/interfaces/inbox-handler.interface.d.ts +5 -0
  773. package/dist/apps/monolith/libs/project-provider/src/interfaces/inbox-handler.interface.js +5 -0
  774. package/dist/apps/monolith/libs/project-provider/src/interfaces/inbox-handler.interface.js.map +1 -0
  775. package/dist/apps/monolith/libs/project-provider/src/interfaces/knowledge-base.interface.d.ts +5 -0
  776. package/dist/apps/monolith/libs/project-provider/src/interfaces/knowledge-base.interface.js +3 -0
  777. package/dist/apps/monolith/libs/project-provider/src/interfaces/knowledge-base.interface.js.map +1 -0
  778. package/dist/apps/monolith/libs/project-provider/src/interfaces/registry-provider.interface.d.ts +18 -0
  779. package/dist/apps/monolith/libs/project-provider/src/interfaces/registry-provider.interface.js +3 -0
  780. package/dist/apps/monolith/libs/project-provider/src/interfaces/registry-provider.interface.js.map +1 -0
  781. package/dist/apps/monolith/libs/project-provider/src/project-provider.module.d.ts +10 -0
  782. package/dist/apps/monolith/libs/project-provider/src/project-provider.module.js +115 -0
  783. package/dist/apps/monolith/libs/project-provider/src/project-provider.module.js.map +1 -0
  784. package/dist/apps/monolith/libs/project-provider/src/services/al-parser.service.d.ts +6 -0
  785. package/dist/apps/monolith/libs/project-provider/src/services/al-parser.service.js +94 -0
  786. package/dist/apps/monolith/libs/project-provider/src/services/al-parser.service.js.map +1 -0
  787. package/dist/apps/monolith/libs/project-provider/src/services/direct-inbox-client.service.d.ts +8 -0
  788. package/dist/apps/monolith/libs/project-provider/src/services/direct-inbox-client.service.js +42 -0
  789. package/dist/apps/monolith/libs/project-provider/src/services/direct-inbox-client.service.js.map +1 -0
  790. package/dist/apps/monolith/libs/project-provider/src/services/file-knowledge-base.service.d.ts +8 -0
  791. package/dist/apps/monolith/libs/project-provider/src/services/file-knowledge-base.service.js +126 -0
  792. package/dist/apps/monolith/libs/project-provider/src/services/file-knowledge-base.service.js.map +1 -0
  793. package/dist/apps/monolith/libs/project-provider/src/services/filesystem-employee-code.service.d.ts +24 -0
  794. package/dist/apps/monolith/libs/project-provider/src/services/filesystem-employee-code.service.js +163 -0
  795. package/dist/apps/monolith/libs/project-provider/src/services/filesystem-employee-code.service.js.map +1 -0
  796. package/dist/apps/monolith/libs/project-provider/src/services/filesystem-registry.service.d.ts +27 -0
  797. package/dist/apps/monolith/libs/project-provider/src/services/filesystem-registry.service.js +223 -0
  798. package/dist/apps/monolith/libs/project-provider/src/services/filesystem-registry.service.js.map +1 -0
  799. package/dist/apps/monolith/libs/project-provider/src/services/http-inbox-client.service.d.ts +7 -0
  800. package/dist/apps/monolith/libs/project-provider/src/services/http-inbox-client.service.js +46 -0
  801. package/dist/apps/monolith/libs/project-provider/src/services/http-inbox-client.service.js.map +1 -0
  802. package/dist/apps/monolith/libs/project-provider/src/services/noop-inbox-client.service.d.ts +4 -0
  803. package/dist/apps/monolith/libs/project-provider/src/services/noop-inbox-client.service.js +19 -0
  804. package/dist/apps/monolith/libs/project-provider/src/services/noop-inbox-client.service.js.map +1 -0
  805. package/dist/apps/monolith/libs/project-provider/src/types/messaging.types.d.ts +45 -0
  806. package/dist/apps/monolith/libs/project-provider/src/types/messaging.types.js +11 -0
  807. package/dist/apps/monolith/libs/project-provider/src/types/messaging.types.js.map +1 -0
  808. package/dist/apps/monolith/libs/project-provider/src/types/project.types.d.ts +47 -0
  809. package/dist/apps/monolith/libs/project-provider/src/types/project.types.js +3 -0
  810. package/dist/apps/monolith/libs/project-provider/src/types/project.types.js.map +1 -0
  811. package/dist/apps/monolith/tsconfig.app.tsbuildinfo +1 -0
  812. package/package.json +3 -1
  813. package/scripts/agentmanager.mjs +22 -2
  814. package/scripts/monolith-daemon-run.mjs +3 -1
  815. package/scripts/monolith-daemon-run.sh +1 -1
@@ -0,0 +1,952 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ var EmployeesService_1;
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.EmployeesService = void 0;
20
+ const common_1 = require("@nestjs/common");
21
+ const node_path_1 = require("node:path");
22
+ const configuration_1 = __importDefault(require("../config/configuration"));
23
+ const runtime_store_1 = require("./runtime.store");
24
+ const versions_service_1 = require("../versions/versions.service");
25
+ const provider_interface_1 = require("../providers/provider.interface");
26
+ const project_provider_1 = require("../../../../libs/project-provider/src");
27
+ const provider_factory_1 = require("../providers/provider-factory");
28
+ const port_allocator_1 = require("../providers/port-allocator");
29
+ const environments_service_1 = require("../environments/environments.service");
30
+ const project_source_service_1 = require("../project-source/project-source.service");
31
+ const deployment_events_service_1 = require("../deployment-events/deployment-events.service");
32
+ const logs_service_1 = require("../logs/logs.service");
33
+ const notifications_service_1 = require("../notifications/notifications.service");
34
+ const postgres_provisioner_service_1 = require("../provisioners/postgres-provisioner.service");
35
+ const cognito_provisioner_service_1 = require("../provisioners/cognito-provisioner.service");
36
+ const projects_data_service_1 = require("../projects/projects-data.service");
37
+ const employee_deployment_errors_1 = require("./errors/employee-deployment.errors");
38
+ const employees_types_1 = require("./employees.types");
39
+ let EmployeesService = EmployeesService_1 = class EmployeesService {
40
+ runtimeStore;
41
+ versionsService;
42
+ provider;
43
+ providerFactory;
44
+ portAllocator;
45
+ environmentsService;
46
+ projectSource;
47
+ eventsService;
48
+ logsService;
49
+ notificationsService;
50
+ postgresProvisioner;
51
+ cognitoProvisioner;
52
+ config;
53
+ projectsDataService;
54
+ registry;
55
+ registryPath;
56
+ logger = new common_1.Logger(EmployeesService_1.name);
57
+ deploying = new Set();
58
+ constructor(runtimeStore, versionsService, provider, providerFactory, portAllocator, environmentsService, projectSource, eventsService, logsService, notificationsService, postgresProvisioner, cognitoProvisioner, config, projectsDataService, registry, registryPath) {
59
+ this.runtimeStore = runtimeStore;
60
+ this.versionsService = versionsService;
61
+ this.provider = provider;
62
+ this.providerFactory = providerFactory;
63
+ this.portAllocator = portAllocator;
64
+ this.environmentsService = environmentsService;
65
+ this.projectSource = projectSource;
66
+ this.eventsService = eventsService;
67
+ this.logsService = logsService;
68
+ this.notificationsService = notificationsService;
69
+ this.postgresProvisioner = postgresProvisioner;
70
+ this.cognitoProvisioner = cognitoProvisioner;
71
+ this.config = config;
72
+ this.projectsDataService = projectsDataService;
73
+ this.registry = registry;
74
+ this.registryPath = registryPath;
75
+ }
76
+ async onModuleDestroy() {
77
+ const entries = [...this.runtimeStore.listAll()];
78
+ const running = entries.filter((e) => e.entry.containerId &&
79
+ (e.entry.runtime === 'running' || e.entry.runtime === 'paused'));
80
+ if (running.length === 0)
81
+ return;
82
+ this.logger.log(`Graceful shutdown: stopping ${running.length} running process(es)`);
83
+ await Promise.allSettled(running.map(async (e) => {
84
+ try {
85
+ const resolved = this.resolveEnvironment(e.entry.environmentId ?? undefined);
86
+ if (e.entry.projectPath) {
87
+ await this.logsService.saveStdoutLogsBeforeStop(e.entry.containerId, e.entry.projectPath, resolved.providerType);
88
+ }
89
+ await resolved.provider.stop(e.entry.containerId);
90
+ this.logger.log(`Stopped ${e.projectId}/${e.employeeId} (${e.env})`);
91
+ }
92
+ catch (err) {
93
+ this.logger.warn(`Failed to stop ${e.projectId}/${e.employeeId} (${e.env}): ${err}`);
94
+ }
95
+ }));
96
+ }
97
+ processName(projectId, employeeId, env) {
98
+ return `fabric-${projectId}-${employeeId}-${env}`;
99
+ }
100
+ resolveEnvironment(environmentId) {
101
+ if (!environmentId) {
102
+ return {
103
+ provider: this.provider,
104
+ providerType: this.config.provider,
105
+ envVars: {},
106
+ jsonConfig: {},
107
+ environmentId: null,
108
+ };
109
+ }
110
+ const env = this.environmentsService.get(environmentId);
111
+ return {
112
+ provider: this.providerFactory.get(env.providerType),
113
+ providerType: env.providerType,
114
+ envVars: env.envVars,
115
+ jsonConfig: env.jsonConfig,
116
+ environmentId: env.id,
117
+ };
118
+ }
119
+ async deploy(projectId, employeeId, env, environmentId, source, userId) {
120
+ const deployKey = `${projectId}/${employeeId}/${env}`;
121
+ if (this.deploying.has(deployKey)) {
122
+ throw new employee_deployment_errors_1.AlreadyInStateError(employeeId, env, 'deploying');
123
+ }
124
+ const now = new Date().toISOString();
125
+ let versionId;
126
+ if (env === 'live') {
127
+ const latest = this.versionsService.getLatest(projectId, employeeId);
128
+ if (!latest) {
129
+ throw new employee_deployment_errors_1.NoLiveVersionError(projectId, employeeId);
130
+ }
131
+ versionId = latest.versionId;
132
+ }
133
+ let projectPath;
134
+ let storedSource = source ?? null;
135
+ if (source) {
136
+ projectPath = await this.projectSource.resolve(source);
137
+ }
138
+ else {
139
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
140
+ if (existing?.projectPath) {
141
+ projectPath = existing.projectPath;
142
+ storedSource = existing.source;
143
+ }
144
+ else {
145
+ const otherEnv = env === 'draft' ? 'live' : 'draft';
146
+ const other = this.runtimeStore.get(projectId, employeeId, otherEnv);
147
+ if (other?.projectPath) {
148
+ projectPath = other.projectPath;
149
+ storedSource = other.source;
150
+ }
151
+ else if (this.registry && this.registryPath) {
152
+ try {
153
+ await this.registry.getEmployee(projectId, employeeId);
154
+ projectPath = (0, node_path_1.join)(this.registryPath, projectId, employeeId);
155
+ storedSource = { type: 'local', path: projectPath };
156
+ }
157
+ catch {
158
+ throw new employee_deployment_errors_1.EmployeeNotFoundError(projectId, employeeId);
159
+ }
160
+ }
161
+ else {
162
+ throw new employee_deployment_errors_1.EmployeeNotFoundError(projectId, employeeId);
163
+ }
164
+ }
165
+ }
166
+ let resolvedEnvironmentId = environmentId;
167
+ if (!resolvedEnvironmentId) {
168
+ const project = await this.projectsDataService.get(projectId);
169
+ if (project) {
170
+ resolvedEnvironmentId = project.environmentId;
171
+ }
172
+ }
173
+ const resolved = this.resolveEnvironment(resolvedEnvironmentId);
174
+ const port = await this.portAllocator.allocateVerified();
175
+ const resolvedUserId = userId ?? null;
176
+ this.runtimeStore.set(projectId, employeeId, env, {
177
+ userId: resolvedUserId,
178
+ runtime: 'pending',
179
+ deployedAt: now,
180
+ lastError: null,
181
+ versionId: versionId ?? null,
182
+ publishedAt: versionId ? now : null,
183
+ moduleCount: 0,
184
+ containerId: null,
185
+ port,
186
+ environmentId: resolved.environmentId,
187
+ projectPath,
188
+ source: storedSource,
189
+ healthcheckRetryCount: 0,
190
+ envVars: null,
191
+ });
192
+ this.runDeploy(projectId, employeeId, env, projectPath, port, versionId, storedSource, resolved, resolvedUserId).catch((err) => {
193
+ this.logger.error(`Unexpected error in runDeploy for ${deployKey}: ${err}`);
194
+ });
195
+ return {
196
+ projectId,
197
+ employeeId,
198
+ env,
199
+ runtime: 'pending',
200
+ deployedAt: now,
201
+ versionId,
202
+ port,
203
+ environmentId: resolved.environmentId ?? undefined,
204
+ };
205
+ }
206
+ async runDeploy(projectId, employeeId, env, projectPath, port, versionId, storedSource, resolved, userId) {
207
+ const deployKey = `${projectId}/${employeeId}/${env}`;
208
+ this.deploying.add(deployKey);
209
+ const now = new Date().toISOString();
210
+ const name = this.processName(projectId, employeeId, env);
211
+ try {
212
+ this.runtimeStore.updateField(projectId, employeeId, env, {
213
+ runtime: 'cloning',
214
+ });
215
+ this.runtimeStore.updateField(projectId, employeeId, env, {
216
+ runtime: 'building',
217
+ });
218
+ const baseAppConfig = { service: { port } };
219
+ let mergedConfig = {
220
+ ...resolved.jsonConfig,
221
+ ...baseAppConfig,
222
+ };
223
+ const envVars = {
224
+ ...resolved.envVars,
225
+ PORT: String(port),
226
+ };
227
+ const storeConfig = mergedConfig.store;
228
+ if (storeConfig?.type === 'postgres') {
229
+ try {
230
+ let creds;
231
+ try {
232
+ const project = await this.projectsDataService.get(projectId);
233
+ if (project?.dbName) {
234
+ creds = this.postgresProvisioner.getCredentialsForExistingDb(project.dbName);
235
+ }
236
+ }
237
+ catch {
238
+ }
239
+ if (!creds) {
240
+ creds = await this.postgresProvisioner.createDatabase(`${projectId}_${employeeId}_${env}`);
241
+ }
242
+ mergedConfig = {
243
+ ...mergedConfig,
244
+ store: {
245
+ ...storeConfig,
246
+ type: 'postgres',
247
+ dbname: creds.dbname,
248
+ host: creds.host,
249
+ port: creds.port,
250
+ username: creds.username,
251
+ password: creds.password,
252
+ },
253
+ };
254
+ }
255
+ catch (err) {
256
+ this.logger.warn(`Postgres provisioning failed: ${err}`);
257
+ }
258
+ }
259
+ const authConfig = mergedConfig.auth;
260
+ if (authConfig?.enabled === true) {
261
+ try {
262
+ const cognito = await this.cognitoProvisioner.provision(`${projectId}-${employeeId}-${env}`, '', '');
263
+ envVars.COGNITO_USER_POOL_ID = cognito.userPoolId;
264
+ envVars.COGNITO_CLIENT_ID = cognito.clientId;
265
+ envVars.AWS_REGION = cognito.region;
266
+ envVars.COGNITO_DEFAULT_USER_PASSWORD = cognito.defaultPassword;
267
+ const awsKey = this.config.aws.accessKeyId;
268
+ const awsSecret = this.config.aws.secretAccessKey;
269
+ if (awsKey)
270
+ envVars.AWS_ACCESS_KEY_ID = awsKey;
271
+ if (awsSecret)
272
+ envVars.AWS_SECRET_ACCESS_KEY = awsSecret;
273
+ }
274
+ catch (err) {
275
+ this.logger.warn(`Cognito provisioning failed: ${err}`);
276
+ }
277
+ }
278
+ envVars.APP_CONFIG = JSON.stringify(mergedConfig);
279
+ this.runtimeStore.updateField(projectId, employeeId, env, {
280
+ runtime: 'deploying',
281
+ envVars,
282
+ });
283
+ const result = await resolved.provider.deploy(name, projectPath, envVars, port, { projectId, employeeId });
284
+ if (!result.success) {
285
+ const errMsg = result.error ?? 'Deploy failed';
286
+ this.runtimeStore.set(projectId, employeeId, env, {
287
+ userId,
288
+ runtime: 'failed',
289
+ deployedAt: now,
290
+ lastError: errMsg,
291
+ versionId: versionId ?? null,
292
+ publishedAt: versionId ? now : null,
293
+ moduleCount: 0,
294
+ containerId: null,
295
+ port: null,
296
+ environmentId: resolved.environmentId,
297
+ projectPath,
298
+ source: storedSource,
299
+ healthcheckRetryCount: 0,
300
+ envVars,
301
+ });
302
+ this.logger.error(`Failed to deploy ${projectId}/${employeeId} (${env}): ${errMsg}`);
303
+ this.eventsService.create({
304
+ userId,
305
+ projectId,
306
+ employeeId,
307
+ env,
308
+ type: 'error',
309
+ message: errMsg,
310
+ });
311
+ this.notificationsService
312
+ .notifyOnFailure(userId ?? '__anonymous__', {
313
+ projectId,
314
+ employeeId,
315
+ env,
316
+ type: 'error',
317
+ message: errMsg,
318
+ })
319
+ .catch((notifyErr) => {
320
+ this.logger.warn(`Failed to send failure notification: ${notifyErr}`);
321
+ });
322
+ return;
323
+ }
324
+ this.runtimeStore.set(projectId, employeeId, env, {
325
+ userId,
326
+ runtime: 'running',
327
+ deployedAt: now,
328
+ lastError: null,
329
+ versionId: versionId ?? null,
330
+ publishedAt: versionId ? now : null,
331
+ moduleCount: 0,
332
+ containerId: result.containerId ?? null,
333
+ port,
334
+ environmentId: resolved.environmentId,
335
+ projectPath,
336
+ source: storedSource,
337
+ healthcheckRetryCount: 0,
338
+ envVars,
339
+ });
340
+ this.logger.log(`Deployed ${projectId}/${employeeId} (${env}) → ${result.containerId} on port ${port}`);
341
+ this.eventsService.create({
342
+ userId,
343
+ projectId,
344
+ employeeId,
345
+ env,
346
+ type: 'start',
347
+ message: 'Deployment started successfully',
348
+ });
349
+ }
350
+ catch (err) {
351
+ const errMsg = err instanceof Error ? err.message : String(err);
352
+ this.runtimeStore.updateField(projectId, employeeId, env, {
353
+ runtime: 'failed',
354
+ lastError: errMsg,
355
+ });
356
+ this.eventsService.create({
357
+ userId,
358
+ projectId,
359
+ employeeId,
360
+ env,
361
+ type: 'error',
362
+ message: errMsg,
363
+ });
364
+ this.notificationsService
365
+ .notifyOnFailure(userId ?? '__anonymous__', {
366
+ projectId,
367
+ employeeId,
368
+ env,
369
+ type: 'error',
370
+ message: errMsg,
371
+ })
372
+ .catch((notifyErr) => {
373
+ this.logger.warn(`Failed to send failure notification: ${notifyErr}`);
374
+ });
375
+ }
376
+ finally {
377
+ this.deploying.delete(deployKey);
378
+ }
379
+ }
380
+ async stop(projectId, employeeId, env) {
381
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
382
+ if (existing?.runtime === 'stopped') {
383
+ throw new employee_deployment_errors_1.AlreadyInStateError(employeeId, env, 'stopped');
384
+ }
385
+ if (existing?.containerId) {
386
+ const resolved = this.resolveEnvironment(existing.environmentId ?? undefined);
387
+ if (existing.projectPath) {
388
+ await this.logsService.saveStdoutLogsBeforeStop(existing.containerId, existing.projectPath, resolved.providerType);
389
+ }
390
+ await resolved.provider.stop(existing.containerId);
391
+ if (existing.envVars?.COGNITO_USER_POOL_ID) {
392
+ try {
393
+ await this.cognitoProvisioner.deletePool(existing.envVars.COGNITO_USER_POOL_ID);
394
+ }
395
+ catch (err) {
396
+ this.logger.error(`Failed to delete Cognito pool: ${err}`);
397
+ }
398
+ }
399
+ const appConfigStr = existing.envVars?.APP_CONFIG;
400
+ if (appConfigStr) {
401
+ try {
402
+ const appConfig = JSON.parse(appConfigStr);
403
+ const storeConfig = appConfig.store;
404
+ const dbname = storeConfig?.dbname;
405
+ if (storeConfig?.type === 'postgres' && dbname) {
406
+ let isSharedDb = false;
407
+ try {
408
+ const project = await this.projectsDataService.get(projectId);
409
+ isSharedDb = project?.dbName === dbname;
410
+ }
411
+ catch {
412
+ }
413
+ if (!isSharedDb) {
414
+ await this.postgresProvisioner.dropDatabase(dbname);
415
+ }
416
+ }
417
+ }
418
+ catch (err) {
419
+ this.logger.error(`Failed to drop database: ${err}`);
420
+ }
421
+ }
422
+ }
423
+ this.runtimeStore.set(projectId, employeeId, env, {
424
+ userId: existing?.userId ?? null,
425
+ runtime: 'stopped',
426
+ deployedAt: existing?.deployedAt ?? null,
427
+ lastError: null,
428
+ versionId: existing?.versionId ?? null,
429
+ publishedAt: existing?.publishedAt ?? null,
430
+ moduleCount: existing?.moduleCount ?? 0,
431
+ containerId: null,
432
+ port: null,
433
+ environmentId: existing?.environmentId ?? null,
434
+ projectPath: existing?.projectPath ?? null,
435
+ source: existing?.source ?? null,
436
+ healthcheckRetryCount: 0,
437
+ envVars: existing?.envVars ?? null,
438
+ });
439
+ this.logger.log(`Stopped ${projectId}/${employeeId} (${env})`);
440
+ this.eventsService.create({
441
+ userId: existing?.userId,
442
+ projectId,
443
+ employeeId,
444
+ env,
445
+ type: 'stop',
446
+ message: 'Deployment stopped',
447
+ });
448
+ return {
449
+ projectId,
450
+ employeeId,
451
+ env,
452
+ runtime: 'stopped',
453
+ deployedAt: existing?.deployedAt ?? new Date().toISOString(),
454
+ };
455
+ }
456
+ async pause(projectId, employeeId, env) {
457
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
458
+ if (!existing || existing.runtime !== 'running') {
459
+ throw new employee_deployment_errors_1.InvalidStateTransitionError(employeeId, env, existing?.runtime ?? 'unknown', 'paused');
460
+ }
461
+ if (existing.containerId) {
462
+ const resolved = this.resolveEnvironment(existing.environmentId ?? undefined);
463
+ if (existing.projectPath) {
464
+ await this.logsService.saveStdoutLogsBeforeStop(existing.containerId, existing.projectPath, resolved.providerType);
465
+ }
466
+ await resolved.provider.stop(existing.containerId);
467
+ }
468
+ this.runtimeStore.set(projectId, employeeId, env, {
469
+ ...existing,
470
+ runtime: 'paused',
471
+ lastError: null,
472
+ containerId: null,
473
+ });
474
+ this.logger.log(`Paused ${projectId}/${employeeId} (${env})`);
475
+ this.eventsService.create({
476
+ userId: existing.userId,
477
+ projectId,
478
+ employeeId,
479
+ env,
480
+ type: 'stop',
481
+ message: 'Deployment paused',
482
+ });
483
+ return {
484
+ projectId,
485
+ employeeId,
486
+ env,
487
+ runtime: 'paused',
488
+ deployedAt: existing.deployedAt ?? new Date().toISOString(),
489
+ versionId: existing.versionId ?? undefined,
490
+ containerId: existing.containerId ?? undefined,
491
+ port: existing.port ?? undefined,
492
+ };
493
+ }
494
+ async resume(projectId, employeeId, env) {
495
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
496
+ if (!existing ||
497
+ (existing.runtime !== 'paused' && existing.runtime !== 'stopped')) {
498
+ throw new employee_deployment_errors_1.InvalidStateTransitionError(employeeId, env, existing?.runtime ?? 'unknown', 'running');
499
+ }
500
+ if (existing.runtime === 'stopped') {
501
+ return this.deploy(projectId, employeeId, env, existing.environmentId ?? undefined);
502
+ }
503
+ const resolved = this.resolveEnvironment(existing.environmentId ?? undefined);
504
+ const name = this.processName(projectId, employeeId, env);
505
+ const projectPath = existing.projectPath;
506
+ const port = existing.port ?? this.portAllocator.allocate();
507
+ const now = new Date().toISOString();
508
+ const envVars = existing.envVars ?? resolved.envVars;
509
+ const result = await resolved.provider.deploy(name, projectPath, envVars, port, { projectId, employeeId });
510
+ if (!result.success) {
511
+ this.runtimeStore.set(projectId, employeeId, env, {
512
+ ...existing,
513
+ runtime: 'crashed',
514
+ lastError: result.error ?? 'Resume failed',
515
+ });
516
+ this.logger.error(`Failed to resume ${projectId}/${employeeId} (${env}): ${result.error}`);
517
+ this.eventsService.create({
518
+ userId: existing.userId,
519
+ projectId,
520
+ employeeId,
521
+ env,
522
+ type: 'error',
523
+ message: result.error ?? 'Resume failed',
524
+ });
525
+ return {
526
+ projectId,
527
+ employeeId,
528
+ env,
529
+ runtime: 'crashed',
530
+ deployedAt: existing.deployedAt ?? now,
531
+ versionId: existing.versionId ?? undefined,
532
+ };
533
+ }
534
+ this.runtimeStore.set(projectId, employeeId, env, {
535
+ ...existing,
536
+ runtime: 'running',
537
+ deployedAt: now,
538
+ lastError: null,
539
+ containerId: result.containerId ?? existing.containerId,
540
+ port,
541
+ });
542
+ this.logger.log(`Resumed ${projectId}/${employeeId} (${env})`);
543
+ this.eventsService.create({
544
+ userId: existing.userId,
545
+ projectId,
546
+ employeeId,
547
+ env,
548
+ type: 'start',
549
+ message: 'Deployment resumed',
550
+ });
551
+ return {
552
+ projectId,
553
+ employeeId,
554
+ env,
555
+ runtime: 'running',
556
+ deployedAt: now,
557
+ versionId: existing.versionId ?? undefined,
558
+ containerId: result.containerId ?? existing.containerId ?? undefined,
559
+ port,
560
+ environmentId: existing.environmentId ?? undefined,
561
+ };
562
+ }
563
+ async restart(projectId, employeeId, env) {
564
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
565
+ if (!existing?.containerId) {
566
+ throw new employee_deployment_errors_1.EmployeeNotFoundError(projectId, employeeId);
567
+ }
568
+ const resolved = this.resolveEnvironment(existing.environmentId ?? undefined);
569
+ await resolved.provider.restart(existing.containerId);
570
+ const now = new Date().toISOString();
571
+ this.runtimeStore.set(projectId, employeeId, env, {
572
+ ...existing,
573
+ runtime: 'running',
574
+ deployedAt: now,
575
+ lastError: null,
576
+ });
577
+ this.logger.log(`Restarted ${projectId}/${employeeId} (${env})`);
578
+ this.eventsService.create({
579
+ userId: existing.userId,
580
+ projectId,
581
+ employeeId,
582
+ env,
583
+ type: 'restart',
584
+ message: 'Deployment restarted',
585
+ });
586
+ return {
587
+ projectId,
588
+ employeeId,
589
+ env,
590
+ runtime: 'running',
591
+ deployedAt: now,
592
+ versionId: existing.versionId ?? undefined,
593
+ containerId: existing.containerId,
594
+ port: existing.port ?? undefined,
595
+ };
596
+ }
597
+ async publish(projectId, employeeId) {
598
+ const version = this.versionsService.create(projectId, employeeId);
599
+ this.logger.log(`Published ${projectId}/${employeeId} as ${version.versionId}`);
600
+ const existing = this.runtimeStore.get(projectId, employeeId, 'live');
601
+ return this.deploy(projectId, employeeId, 'live', existing?.environmentId ?? undefined);
602
+ }
603
+ async unpublish(projectId, employeeId) {
604
+ const result = await this.stop(projectId, employeeId, 'live');
605
+ this.runtimeStore.delete(projectId, employeeId, 'live');
606
+ this.logger.log(`Unpublished ${projectId}/${employeeId}`);
607
+ return result;
608
+ }
609
+ async rollback(projectId, employeeId, versionId) {
610
+ const version = versionId
611
+ ? this.versionsService.get(projectId, employeeId, versionId)
612
+ : this.versionsService.getPrevious(projectId, employeeId);
613
+ if (!version) {
614
+ throw new employee_deployment_errors_1.NoLiveVersionError(projectId, employeeId);
615
+ }
616
+ const existing = this.runtimeStore.get(projectId, employeeId, 'live');
617
+ if (existing?.containerId) {
618
+ try {
619
+ const resolved = this.resolveEnvironment(existing.environmentId ?? undefined);
620
+ await resolved.provider.stop(existing.containerId);
621
+ }
622
+ catch (err) {
623
+ this.logger.warn(`Best-effort stop before rollback failed for ${projectId}/${employeeId}: ${err instanceof Error ? err.message : err}`);
624
+ }
625
+ }
626
+ return this.deploy(projectId, employeeId, 'live', existing?.environmentId ?? undefined);
627
+ }
628
+ getStatus(projectId, employeeId) {
629
+ const draft = this.runtimeStore.get(projectId, employeeId, 'draft');
630
+ const live = this.runtimeStore.get(projectId, employeeId, 'live');
631
+ return {
632
+ projectId,
633
+ employeeId,
634
+ draft: this.runtimeStore.toDraftInfo(draft),
635
+ live: this.runtimeStore.toLiveInfo(live),
636
+ draftAheadOfLive: !!draft?.deployedAt &&
637
+ (!live?.deployedAt || draft.deployedAt > live.deployedAt),
638
+ };
639
+ }
640
+ getBulkStatus(projectId) {
641
+ const entries = this.runtimeStore.listByProject(projectId);
642
+ const employeeIds = [...new Set(entries.map((e) => e.employeeId))];
643
+ return employeeIds.map((id) => this.getStatus(projectId, id));
644
+ }
645
+ resolve(projectId, employeeId, env) {
646
+ const entry = this.runtimeStore.get(projectId, employeeId, env);
647
+ return {
648
+ projectId,
649
+ employeeId,
650
+ env,
651
+ runtime: entry?.runtime ?? 'stopped',
652
+ endpoint: entry?.runtime === 'running' && entry.port
653
+ ? `http://localhost:${entry.port}`
654
+ : null,
655
+ port: entry?.port ?? null,
656
+ containerId: entry?.containerId ?? null,
657
+ capabilities: [],
658
+ };
659
+ }
660
+ async recoverIfProcessMissing(projectId, employeeId, env) {
661
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
662
+ if (!existing || existing.runtime !== 'running' || !existing.containerId) {
663
+ return;
664
+ }
665
+ const deployKey = `${projectId}/${employeeId}/${env}`;
666
+ if (this.deploying.has(deployKey)) {
667
+ return;
668
+ }
669
+ const resolved = this.resolveEnvironment(existing.environmentId ?? undefined);
670
+ const provider = resolved.provider;
671
+ let status;
672
+ try {
673
+ status = await provider.getStatus(existing.containerId);
674
+ }
675
+ catch (err) {
676
+ this.logger.warn(`Deployment watcher: getStatus failed for ${projectId}/${employeeId} (${env}): ${err instanceof Error ? err.message : err}`);
677
+ return;
678
+ }
679
+ if (status === 'running') {
680
+ return;
681
+ }
682
+ this.logger.warn(`Deployment watcher: ${projectId}/${employeeId} (${env}) provider status is "${status}" but Fabric state is running — recovering`);
683
+ if (status === 'stopped') {
684
+ try {
685
+ await provider.restart(existing.containerId);
686
+ const after = await provider.getStatus(existing.containerId);
687
+ if (after === 'running') {
688
+ this.eventsService.create({
689
+ userId: existing.userId,
690
+ projectId,
691
+ employeeId,
692
+ env,
693
+ type: 'watcher_recover',
694
+ message: 'Process was stopped externally; provider restart succeeded.',
695
+ });
696
+ return;
697
+ }
698
+ }
699
+ catch (err) {
700
+ this.logger.warn(`Deployment watcher: restart failed for ${projectId}/${employeeId} (${env}): ${err instanceof Error ? err.message : err}`);
701
+ }
702
+ }
703
+ try {
704
+ await this.deploy(projectId, employeeId, env, existing.environmentId ?? undefined, undefined, existing.userId);
705
+ this.eventsService.create({
706
+ userId: existing.userId,
707
+ projectId,
708
+ employeeId,
709
+ env,
710
+ type: 'watcher_recover',
711
+ message: status === 'not_found'
712
+ ? 'Process no longer present in provider; redeploy started.'
713
+ : 'Restart failed or process still down; redeploy started.',
714
+ });
715
+ }
716
+ catch (err) {
717
+ if (err instanceof employee_deployment_errors_1.AlreadyInStateError) {
718
+ return;
719
+ }
720
+ this.logger.error(`Deployment watcher: redeploy failed for ${projectId}/${employeeId} (${env}): ${err instanceof Error ? err.message : err}`);
721
+ }
722
+ }
723
+ async getLogs(projectId, employeeId, env, options) {
724
+ const entry = this.runtimeStore.get(projectId, employeeId, env);
725
+ const providerType = entry?.environmentId
726
+ ? this.resolveEnvironment(entry.environmentId).providerType
727
+ : null;
728
+ return this.logsService.getDeploymentLogs(entry?.containerId ?? null, entry?.projectPath ?? null, providerType, {
729
+ type: options?.type ?? 'stdout',
730
+ date: options?.date,
731
+ tail: options?.tail,
732
+ });
733
+ }
734
+ async undeploy(projectId, employeeId, track, fabricEnvironmentId) {
735
+ const existing = this.runtimeStore.get(projectId, employeeId, track);
736
+ if (!existing) {
737
+ throw new employee_deployment_errors_1.EmployeeNotFoundError(projectId, employeeId);
738
+ }
739
+ const project = await this.projectsDataService.get(projectId);
740
+ const expectedEnvId = existing.environmentId ?? project?.environmentId ?? null;
741
+ const resolvedFabricEnvId = fabricEnvironmentId ?? (expectedEnvId || undefined);
742
+ if (!resolvedFabricEnvId) {
743
+ throw new employee_deployment_errors_1.UndeployEnvironmentUnresolvedError(projectId, employeeId, track);
744
+ }
745
+ if (expectedEnvId && resolvedFabricEnvId !== expectedEnvId) {
746
+ throw new employee_deployment_errors_1.DeploymentEnvironmentMismatchError(projectId, employeeId, track, expectedEnvId, resolvedFabricEnvId);
747
+ }
748
+ if (!expectedEnvId) {
749
+ this.environmentsService.get(resolvedFabricEnvId);
750
+ }
751
+ if (employees_types_1.ACTIVE_DEPLOYMENT_STATUSES.includes(existing.runtime)) {
752
+ await this.stop(projectId, employeeId, track);
753
+ }
754
+ const { removed } = await this.remove(projectId, employeeId, track);
755
+ return { removed, projectId, employeeId, env: track };
756
+ }
757
+ async remove(projectId, employeeId, env) {
758
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
759
+ if (!existing) {
760
+ throw new employee_deployment_errors_1.EmployeeNotFoundError(projectId, employeeId);
761
+ }
762
+ if (existing.runtime !== 'stopped' &&
763
+ existing.runtime !== 'failed' &&
764
+ existing.runtime !== 'crashed') {
765
+ throw new employee_deployment_errors_1.CannotRemoveError(employeeId, env, existing.runtime);
766
+ }
767
+ this.runtimeStore.delete(projectId, employeeId, env);
768
+ this.logger.log(`Removed ${projectId}/${employeeId} (${env})`);
769
+ this.eventsService.create({
770
+ userId: existing.userId,
771
+ projectId,
772
+ employeeId,
773
+ env,
774
+ type: 'remove',
775
+ message: 'Deployment removed',
776
+ });
777
+ await Promise.resolve();
778
+ return { removed: true };
779
+ }
780
+ async reconfigureDbAndRedeploy(projectId, employeeId, env) {
781
+ const existing = this.runtimeStore.get(projectId, employeeId, env);
782
+ if (!existing?.projectPath || !existing.envVars)
783
+ return null;
784
+ const appConfigStr = existing.envVars.APP_CONFIG ?? '{}';
785
+ let appConfig;
786
+ try {
787
+ appConfig = JSON.parse(appConfigStr);
788
+ }
789
+ catch {
790
+ return null;
791
+ }
792
+ const storeConfig = appConfig.store;
793
+ if (storeConfig?.type !== 'postgres')
794
+ return null;
795
+ const resolved = this.resolveEnvironment(existing.environmentId ?? undefined);
796
+ const name = this.processName(projectId, employeeId, env);
797
+ try {
798
+ const creds = await this.postgresProvisioner.createNewDatabase(`${projectId}_${employeeId}_${env}`);
799
+ const newStoreConfig = {
800
+ ...storeConfig,
801
+ dbname: creds.dbname,
802
+ host: creds.host,
803
+ port: creds.port,
804
+ username: creds.username,
805
+ password: creds.password,
806
+ };
807
+ const newAppConfig = { ...appConfig, store: newStoreConfig };
808
+ const newEnvVars = {
809
+ ...existing.envVars,
810
+ APP_CONFIG: JSON.stringify(newAppConfig),
811
+ };
812
+ if (existing.containerId) {
813
+ if (existing.projectPath) {
814
+ await this.logsService.saveStdoutLogsBeforeStop(existing.containerId, existing.projectPath, resolved.providerType);
815
+ }
816
+ await resolved.provider.stop(existing.containerId);
817
+ }
818
+ const now = new Date().toISOString();
819
+ this.runtimeStore.set(projectId, employeeId, env, {
820
+ ...existing,
821
+ envVars: newEnvVars,
822
+ containerId: null,
823
+ runtime: 'deploying',
824
+ lastError: null,
825
+ healthcheckRetryCount: 0,
826
+ });
827
+ const result = await resolved.provider.deploy(name, existing.projectPath, newEnvVars, existing.port, { projectId, employeeId });
828
+ if (!result.success) {
829
+ this.runtimeStore.updateField(projectId, employeeId, env, {
830
+ runtime: 'failed',
831
+ lastError: result.error ?? 'Reconfigure deploy failed',
832
+ });
833
+ this.eventsService.create({
834
+ userId: existing.userId,
835
+ projectId,
836
+ employeeId,
837
+ env,
838
+ type: 'error',
839
+ message: result.error ?? 'Reconfigure deploy failed',
840
+ });
841
+ return {
842
+ projectId,
843
+ employeeId,
844
+ env,
845
+ runtime: 'failed',
846
+ deployedAt: existing.deployedAt ?? now,
847
+ };
848
+ }
849
+ this.runtimeStore.set(projectId, employeeId, env, {
850
+ ...existing,
851
+ runtime: 'running',
852
+ containerId: result.containerId ?? null,
853
+ envVars: newEnvVars,
854
+ lastError: null,
855
+ healthcheckRetryCount: 0,
856
+ });
857
+ this.eventsService.create({
858
+ userId: existing.userId,
859
+ projectId,
860
+ employeeId,
861
+ env,
862
+ type: 'restart',
863
+ message: 'Database reconfigured and deployment redeployed',
864
+ });
865
+ this.logger.log(`Reconfigured DB and redeployed ${projectId}/${employeeId} (${env})`);
866
+ return {
867
+ projectId,
868
+ employeeId,
869
+ env,
870
+ runtime: 'running',
871
+ deployedAt: now,
872
+ containerId: result.containerId ?? undefined,
873
+ port: existing.port ?? undefined,
874
+ };
875
+ }
876
+ catch (err) {
877
+ const errMsg = err instanceof Error ? err.message : String(err);
878
+ this.runtimeStore.updateField(projectId, employeeId, env, {
879
+ runtime: 'failed',
880
+ lastError: errMsg,
881
+ });
882
+ this.eventsService.create({
883
+ userId: existing.userId,
884
+ projectId,
885
+ employeeId,
886
+ env,
887
+ type: 'error',
888
+ message: errMsg,
889
+ });
890
+ return null;
891
+ }
892
+ }
893
+ async checkHealth(projectId, employeeId, env) {
894
+ const entry = this.runtimeStore.get(projectId, employeeId, env);
895
+ if (!entry?.port || entry.runtime !== 'running') {
896
+ return { ok: false, error: 'Deployment not running' };
897
+ }
898
+ const url = `http://localhost:${entry.port}/health`;
899
+ try {
900
+ const controller = new AbortController();
901
+ const timeout = setTimeout(() => controller.abort(), 5000);
902
+ const res = await fetch(url, {
903
+ method: 'GET',
904
+ signal: controller.signal,
905
+ });
906
+ clearTimeout(timeout);
907
+ let healthData;
908
+ try {
909
+ const text = await res.text();
910
+ healthData = text
911
+ ? JSON.parse(text)
912
+ : undefined;
913
+ }
914
+ catch {
915
+ }
916
+ if (res.ok) {
917
+ return { ok: true, status: res.status, healthData };
918
+ }
919
+ return {
920
+ ok: false,
921
+ status: res.status,
922
+ error: `HTTP ${res.status}`,
923
+ healthData,
924
+ };
925
+ }
926
+ catch (err) {
927
+ const error = err instanceof Error ? err.message : String(err);
928
+ return { ok: false, error };
929
+ }
930
+ }
931
+ };
932
+ exports.EmployeesService = EmployeesService;
933
+ exports.EmployeesService = EmployeesService = EmployeesService_1 = __decorate([
934
+ (0, common_1.Injectable)(),
935
+ __param(2, (0, common_1.Inject)(provider_interface_1.DEPLOYMENT_PROVIDER)),
936
+ __param(12, (0, common_1.Inject)(configuration_1.default.KEY)),
937
+ __param(14, (0, common_1.Optional)()),
938
+ __param(14, (0, common_1.Inject)(project_provider_1.REGISTRY_PROVIDER)),
939
+ __param(15, (0, common_1.Optional)()),
940
+ __param(15, (0, common_1.Inject)(project_provider_1.REGISTRY_PATH)),
941
+ __metadata("design:paramtypes", [runtime_store_1.RuntimeStore,
942
+ versions_service_1.VersionsService, Object, provider_factory_1.ProviderFactory,
943
+ port_allocator_1.PortAllocator,
944
+ environments_service_1.EnvironmentsService,
945
+ project_source_service_1.ProjectSourceService,
946
+ deployment_events_service_1.DeploymentEventsService,
947
+ logs_service_1.LogsService,
948
+ notifications_service_1.NotificationsService,
949
+ postgres_provisioner_service_1.PostgresProvisionerService,
950
+ cognito_provisioner_service_1.CognitoProvisionerService, void 0, projects_data_service_1.ProjectsDataService, Object, Object])
951
+ ], EmployeesService);
952
+ //# sourceMappingURL=employees.service.js.map