devchain-cli 0.24.1 → 0.24.2

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 (343) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +40 -10
  3. package/dist/host-install/devchain-host-bootstrap.tgz +0 -0
  4. package/dist/host-install/pins.json +31 -2
  5. package/dist/lib/exclusive-run.js +51 -3
  6. package/dist/lib/git-owner.js +284 -0
  7. package/dist/lib/host-install.js +19 -151
  8. package/dist/lib/local-api.js +175 -0
  9. package/dist/server/common/config/env.config.d.ts +3 -0
  10. package/dist/server/common/config/env.config.js +1 -0
  11. package/dist/server/common/config/env.config.js.map +1 -1
  12. package/dist/server/common/config/host-image.json +3 -3
  13. package/dist/server/common/constants/syncthing-markers.d.ts +1 -0
  14. package/dist/server/common/constants/syncthing-markers.js +6 -1
  15. package/dist/server/common/constants/syncthing-markers.js.map +1 -1
  16. package/dist/server/common/filesystem/vm-home-path.d.ts +11 -0
  17. package/dist/server/common/filesystem/vm-home-path.js +48 -0
  18. package/dist/server/common/filesystem/vm-home-path.js.map +1 -0
  19. package/dist/server/common/process-ids-env.d.ts +1 -0
  20. package/dist/server/common/process-ids-env.js +13 -0
  21. package/dist/server/common/process-ids-env.js.map +1 -0
  22. package/dist/server/common/test/api-test-app.d.ts +12 -0
  23. package/dist/server/common/test/api-test-app.js +76 -0
  24. package/dist/server/common/test/api-test-app.js.map +1 -0
  25. package/dist/server/common/test/app-bootstrap.helper.js +8 -1
  26. package/dist/server/common/test/app-bootstrap.helper.js.map +1 -1
  27. package/dist/server/common/test/fake-bootstrap.server.js +3 -2
  28. package/dist/server/common/test/fake-bootstrap.server.js.map +1 -1
  29. package/dist/server/common/test/fake-docker-engine.server.d.ts +17 -6
  30. package/dist/server/common/test/fake-docker-engine.server.js +77 -33
  31. package/dist/server/common/test/fake-docker-engine.server.js.map +1 -1
  32. package/dist/server/common/test/fake-proxmox.server.js +4 -4
  33. package/dist/server/common/test/fake-ssh.server.js +6 -6
  34. package/dist/server/common/test/fake-ssh.server.js.map +1 -1
  35. package/dist/server/common/test/test-database.helper.d.ts +6 -0
  36. package/dist/server/common/test/test-database.helper.js +29 -0
  37. package/dist/server/common/test/test-database.helper.js.map +1 -0
  38. package/dist/server/modules/core/controllers/docker-archive.js +1 -1
  39. package/dist/server/modules/core/controllers/docker-archive.js.map +1 -1
  40. package/dist/server/modules/core/controllers/docker-engine.client.d.ts +2 -1
  41. package/dist/server/modules/core/controllers/docker-engine.client.js +8 -4
  42. package/dist/server/modules/core/controllers/docker-engine.client.js.map +1 -1
  43. package/dist/server/modules/core/controllers/docker-image-metadata.d.ts +248 -0
  44. package/dist/server/modules/core/controllers/docker-image-metadata.js +161 -0
  45. package/dist/server/modules/core/controllers/docker-image-metadata.js.map +1 -0
  46. package/dist/server/modules/core/controllers/docker-settings.d.ts +13 -2
  47. package/dist/server/modules/core/controllers/docker-settings.js +49 -11
  48. package/dist/server/modules/core/controllers/docker-settings.js.map +1 -1
  49. package/dist/server/modules/core/controllers/host-user-identity.d.ts +34 -0
  50. package/dist/server/modules/core/controllers/host-user-identity.js +23 -0
  51. package/dist/server/modules/core/controllers/host-user-identity.js.map +1 -0
  52. package/dist/server/modules/core/controllers/runtime.controller.d.ts +11 -4
  53. package/dist/server/modules/core/controllers/runtime.controller.js +2 -0
  54. package/dist/server/modules/core/controllers/runtime.controller.js.map +1 -1
  55. package/dist/server/modules/file-sync/build-exclusion-suggestions.d.ts +15 -0
  56. package/dist/server/modules/file-sync/build-exclusion-suggestions.js +402 -0
  57. package/dist/server/modules/file-sync/build-exclusion-suggestions.js.map +1 -0
  58. package/dist/server/modules/file-sync/file-sync-auto-fix.dto.d.ts +102 -0
  59. package/dist/server/modules/file-sync/file-sync-auto-fix.dto.js +22 -0
  60. package/dist/server/modules/file-sync/file-sync-auto-fix.dto.js.map +1 -0
  61. package/dist/server/modules/file-sync/file-sync-auto-fix.store.d.ts +12 -0
  62. package/dist/server/modules/file-sync/file-sync-auto-fix.store.js +73 -0
  63. package/dist/server/modules/file-sync/file-sync-auto-fix.store.js.map +1 -0
  64. package/dist/server/modules/file-sync/file-sync-conflicts.d.ts +3 -0
  65. package/dist/server/modules/file-sync/file-sync-conflicts.js +191 -0
  66. package/dist/server/modules/file-sync/file-sync-conflicts.js.map +1 -0
  67. package/dist/server/modules/file-sync/file-sync-ignores.store.d.ts +5 -1
  68. package/dist/server/modules/file-sync/file-sync-ignores.store.js +39 -8
  69. package/dist/server/modules/file-sync/file-sync-ignores.store.js.map +1 -1
  70. package/dist/server/modules/file-sync/file-sync.controller.d.ts +1 -3
  71. package/dist/server/modules/file-sync/file-sync.controller.js +5 -14
  72. package/dist/server/modules/file-sync/file-sync.controller.js.map +1 -1
  73. package/dist/server/modules/file-sync/file-sync.dto.d.ts +220 -1
  74. package/dist/server/modules/file-sync/file-sync.dto.js +70 -4
  75. package/dist/server/modules/file-sync/file-sync.dto.js.map +1 -1
  76. package/dist/server/modules/file-sync/file-sync.module.js +16 -1
  77. package/dist/server/modules/file-sync/file-sync.module.js.map +1 -1
  78. package/dist/server/modules/file-sync/file-sync.service.d.ts +18 -4
  79. package/dist/server/modules/file-sync/file-sync.service.js +166 -34
  80. package/dist/server/modules/file-sync/file-sync.service.js.map +1 -1
  81. package/dist/server/modules/file-sync/git-guard.dto.d.ts +61 -0
  82. package/dist/server/modules/file-sync/git-guard.dto.js +26 -0
  83. package/dist/server/modules/file-sync/git-guard.dto.js.map +1 -0
  84. package/dist/server/modules/file-sync/home-git-guard.service.d.ts +4 -2
  85. package/dist/server/modules/file-sync/home-git-guard.service.js +50 -25
  86. package/dist/server/modules/file-sync/home-git-guard.service.js.map +1 -1
  87. package/dist/server/modules/file-sync/host-git-guard.controller.d.ts +10 -0
  88. package/dist/server/modules/file-sync/host-git-guard.controller.js +64 -0
  89. package/dist/server/modules/file-sync/host-git-guard.controller.js.map +1 -0
  90. package/dist/server/modules/file-sync/host-git-index.controller.d.ts +9 -0
  91. package/dist/server/modules/file-sync/host-git-index.controller.js +67 -0
  92. package/dist/server/modules/file-sync/host-git-index.controller.js.map +1 -0
  93. package/dist/server/modules/file-sync/host-sync.controller.d.ts +15 -2
  94. package/dist/server/modules/file-sync/host-sync.controller.js +122 -14
  95. package/dist/server/modules/file-sync/host-sync.controller.js.map +1 -1
  96. package/dist/server/modules/file-sync/ignore-pattern-matcher.d.ts +30 -0
  97. package/dist/server/modules/file-sync/ignore-pattern-matcher.js +183 -0
  98. package/dist/server/modules/file-sync/ignore-pattern-matcher.js.map +1 -0
  99. package/dist/server/modules/file-sync/project-repository.d.ts +2 -0
  100. package/dist/server/modules/file-sync/project-repository.js +20 -0
  101. package/dist/server/modules/file-sync/project-repository.js.map +1 -0
  102. package/dist/server/modules/file-sync/sync-chown.dto.d.ts +99 -0
  103. package/dist/server/modules/file-sync/sync-chown.dto.js +46 -0
  104. package/dist/server/modules/file-sync/sync-chown.dto.js.map +1 -0
  105. package/dist/server/modules/file-sync/sync-chown.service.d.ts +12 -0
  106. package/dist/server/modules/file-sync/sync-chown.service.js +230 -0
  107. package/dist/server/modules/file-sync/sync-chown.service.js.map +1 -0
  108. package/dist/server/modules/file-sync/sync-path-inspection.dto.d.ts +626 -0
  109. package/dist/server/modules/file-sync/sync-path-inspection.dto.js +108 -0
  110. package/dist/server/modules/file-sync/sync-path-inspection.dto.js.map +1 -0
  111. package/dist/server/modules/file-sync/sync-path-inspector.d.ts +12 -0
  112. package/dist/server/modules/file-sync/sync-path-inspector.js +413 -0
  113. package/dist/server/modules/file-sync/sync-path-inspector.js.map +1 -0
  114. package/dist/server/modules/file-sync/testing/fake-file-sync.service.d.ts +27 -4
  115. package/dist/server/modules/file-sync/testing/fake-file-sync.service.js +66 -4
  116. package/dist/server/modules/file-sync/testing/fake-file-sync.service.js.map +1 -1
  117. package/dist/server/modules/file-sync/translate-git-ignore-rule.d.ts +3 -0
  118. package/dist/server/modules/file-sync/translate-git-ignore-rule.js +30 -0
  119. package/dist/server/modules/file-sync/translate-git-ignore-rule.js.map +1 -0
  120. package/dist/server/modules/mcp/services/handlers/skill-tools.js +2 -2
  121. package/dist/server/modules/mcp/services/handlers/skill-tools.js.map +1 -1
  122. package/dist/server/modules/remotes/connect-choices.controller.d.ts +9 -0
  123. package/dist/server/modules/remotes/connect-choices.controller.js +54 -0
  124. package/dist/server/modules/remotes/connect-choices.controller.js.map +1 -0
  125. package/dist/server/modules/remotes/connect-choices.dto.d.ts +52 -0
  126. package/dist/server/modules/remotes/connect-choices.dto.js +19 -0
  127. package/dist/server/modules/remotes/connect-choices.dto.js.map +1 -0
  128. package/dist/server/modules/remotes/connect-choices.store.d.ts +12 -0
  129. package/dist/server/modules/remotes/connect-choices.store.js +95 -0
  130. package/dist/server/modules/remotes/connect-choices.store.js.map +1 -0
  131. package/dist/server/modules/remotes/controllers/remotes.controller.d.ts +3 -0
  132. package/dist/server/modules/remotes/controllers/remotes.controller.js +9 -1
  133. package/dist/server/modules/remotes/controllers/remotes.controller.js.map +1 -1
  134. package/dist/server/modules/remotes/docker/docker-copy-back.js +40 -16
  135. package/dist/server/modules/remotes/docker/docker-copy-back.js.map +1 -1
  136. package/dist/server/modules/remotes/docker/docker-handoff.d.ts +5 -3
  137. package/dist/server/modules/remotes/docker/docker-handoff.js +146 -42
  138. package/dist/server/modules/remotes/docker/docker-handoff.js.map +1 -1
  139. package/dist/server/modules/remotes/docker/docker-handoff.store.d.ts +3 -0
  140. package/dist/server/modules/remotes/docker/docker-handoff.store.js.map +1 -1
  141. package/dist/server/modules/remotes/docker/docker-plan-fit.d.ts +4 -1
  142. package/dist/server/modules/remotes/docker/docker-plan-fit.js +19 -6
  143. package/dist/server/modules/remotes/docker/docker-plan-fit.js.map +1 -1
  144. package/dist/server/modules/remotes/docker/docker-plan-policy.d.ts +6 -2
  145. package/dist/server/modules/remotes/docker/docker-plan-policy.js +191 -38
  146. package/dist/server/modules/remotes/docker/docker-plan-policy.js.map +1 -1
  147. package/dist/server/modules/remotes/docker/docker-plan-source.service.d.ts +52 -8
  148. package/dist/server/modules/remotes/docker/docker-plan-source.service.js +273 -50
  149. package/dist/server/modules/remotes/docker/docker-plan-source.service.js.map +1 -1
  150. package/dist/server/modules/remotes/docker/docker-plan.controller.d.ts +2 -1
  151. package/dist/server/modules/remotes/docker/docker-plan.controller.js +14 -0
  152. package/dist/server/modules/remotes/docker/docker-plan.controller.js.map +1 -1
  153. package/dist/server/modules/remotes/docker/docker-plan.dto.d.ts +46 -1
  154. package/dist/server/modules/remotes/docker/docker-plan.dto.js +1 -0
  155. package/dist/server/modules/remotes/docker/docker-plan.dto.js.map +1 -1
  156. package/dist/server/modules/remotes/docker/docker-plan.service.d.ts +13 -7
  157. package/dist/server/modules/remotes/docker/docker-plan.service.js +57 -13
  158. package/dist/server/modules/remotes/docker/docker-plan.service.js.map +1 -1
  159. package/dist/server/modules/remotes/docker/docker-project-compose.d.ts +7 -0
  160. package/dist/server/modules/remotes/docker/docker-project-compose.js +30 -0
  161. package/dist/server/modules/remotes/docker/docker-project-compose.js.map +1 -0
  162. package/dist/server/modules/remotes/dtos/remote.dto.d.ts +2 -0
  163. package/dist/server/modules/remotes/dtos/remote.dto.js.map +1 -1
  164. package/dist/server/modules/remotes/git-owner.store.d.ts +13 -0
  165. package/dist/server/modules/remotes/git-owner.store.js +69 -0
  166. package/dist/server/modules/remotes/git-owner.store.js.map +1 -0
  167. package/dist/server/modules/remotes/host/host-docker.controller.d.ts +8 -0
  168. package/dist/server/modules/remotes/host/host-docker.controller.js +22 -6
  169. package/dist/server/modules/remotes/host/host-docker.controller.js.map +1 -1
  170. package/dist/server/modules/remotes/host/host-docker.dto.d.ts +606 -0
  171. package/dist/server/modules/remotes/host/host-docker.dto.js +47 -7
  172. package/dist/server/modules/remotes/host/host-docker.dto.js.map +1 -1
  173. package/dist/server/modules/remotes/host/host-docker.service.d.ts +16 -4
  174. package/dist/server/modules/remotes/host/host-docker.service.js +157 -82
  175. package/dist/server/modules/remotes/host/host-docker.service.js.map +1 -1
  176. package/dist/server/modules/remotes/host/host-ipv4-routes.d.ts +4 -0
  177. package/dist/server/modules/remotes/host/host-ipv4-routes.js +43 -0
  178. package/dist/server/modules/remotes/host/host-ipv4-routes.js.map +1 -0
  179. package/dist/server/modules/remotes/host-image.d.ts +1 -1
  180. package/dist/server/modules/remotes/host-image.js +1 -1
  181. package/dist/server/modules/remotes/host-install/host-install-block.d.ts +1 -0
  182. package/dist/server/modules/remotes/host-install/host-install-block.js +76 -2
  183. package/dist/server/modules/remotes/host-install/host-install-block.js.map +1 -1
  184. package/dist/server/modules/remotes/host-install/host-install.service.d.ts +0 -1
  185. package/dist/server/modules/remotes/host-install/host-install.service.js +9 -26
  186. package/dist/server/modules/remotes/host-install/host-install.service.js.map +1 -1
  187. package/dist/server/modules/remotes/operations/attach.operation.d.ts +5 -1
  188. package/dist/server/modules/remotes/operations/attach.operation.js +40 -5
  189. package/dist/server/modules/remotes/operations/attach.operation.js.map +1 -1
  190. package/dist/server/modules/remotes/operations/claim.operation.d.ts +1 -0
  191. package/dist/server/modules/remotes/operations/claim.operation.js +6 -1
  192. package/dist/server/modules/remotes/operations/claim.operation.js.map +1 -1
  193. package/dist/server/modules/remotes/operations/detach.operation.d.ts +4 -1
  194. package/dist/server/modules/remotes/operations/detach.operation.js +10 -2
  195. package/dist/server/modules/remotes/operations/detach.operation.js.map +1 -1
  196. package/dist/server/modules/remotes/operations/docker-import-inventory.store.d.ts +4 -0
  197. package/dist/server/modules/remotes/operations/docker-import-inventory.store.js +11 -0
  198. package/dist/server/modules/remotes/operations/docker-import-inventory.store.js.map +1 -1
  199. package/dist/server/modules/remotes/operations/file-sync-handoff.d.ts +29 -3
  200. package/dist/server/modules/remotes/operations/file-sync-handoff.js +477 -50
  201. package/dist/server/modules/remotes/operations/file-sync-handoff.js.map +1 -1
  202. package/dist/server/modules/remotes/operations/force-sync.operation.d.ts +39 -0
  203. package/dist/server/modules/remotes/operations/force-sync.operation.js +177 -0
  204. package/dist/server/modules/remotes/operations/force-sync.operation.js.map +1 -0
  205. package/dist/server/modules/remotes/operations/git-owner.dto.d.ts +83 -0
  206. package/dist/server/modules/remotes/operations/git-owner.dto.js +25 -0
  207. package/dist/server/modules/remotes/operations/git-owner.dto.js.map +1 -0
  208. package/dist/server/modules/remotes/operations/git-owner.operation.d.ts +35 -0
  209. package/dist/server/modules/remotes/operations/git-owner.operation.js +216 -0
  210. package/dist/server/modules/remotes/operations/git-owner.operation.js.map +1 -0
  211. package/dist/server/modules/remotes/operations/remote-host.client.d.ts +71 -7
  212. package/dist/server/modules/remotes/operations/remote-host.client.js +141 -11
  213. package/dist/server/modules/remotes/operations/remote-host.client.js.map +1 -1
  214. package/dist/server/modules/remotes/operations/remote-operation.dto.d.ts +19 -0
  215. package/dist/server/modules/remotes/operations/remote-operation.dto.js +5 -1
  216. package/dist/server/modules/remotes/operations/remote-operation.dto.js.map +1 -1
  217. package/dist/server/modules/remotes/operations/remote-operation.runner.d.ts +3 -1
  218. package/dist/server/modules/remotes/operations/remote-operation.runner.js +52 -21
  219. package/dist/server/modules/remotes/operations/remote-operation.runner.js.map +1 -1
  220. package/dist/server/modules/remotes/operations/remote-operation.types.d.ts +4 -1
  221. package/dist/server/modules/remotes/operations/remote-operation.types.js.map +1 -1
  222. package/dist/server/modules/remotes/operations/remote-operations.controller.d.ts +5 -0
  223. package/dist/server/modules/remotes/operations/remote-operations.controller.js +56 -0
  224. package/dist/server/modules/remotes/operations/remote-operations.controller.js.map +1 -1
  225. package/dist/server/modules/remotes/operations/remote-operations.service.d.ts +16 -1
  226. package/dist/server/modules/remotes/operations/remote-operations.service.js +155 -5
  227. package/dist/server/modules/remotes/operations/remote-operations.service.js.map +1 -1
  228. package/dist/server/modules/remotes/operations/update-logins.operation.d.ts +1 -3
  229. package/dist/server/modules/remotes/operations/update-logins.operation.js +3 -18
  230. package/dist/server/modules/remotes/operations/update-logins.operation.js.map +1 -1
  231. package/dist/server/modules/remotes/ports/remote-health.port.d.ts +2 -0
  232. package/dist/server/modules/remotes/ports/remote-health.port.js.map +1 -1
  233. package/dist/server/modules/remotes/remotes.module.js +18 -0
  234. package/dist/server/modules/remotes/remotes.module.js.map +1 -1
  235. package/dist/server/modules/remotes/replica/__fixtures__/replica-seed.d.ts +2 -2
  236. package/dist/server/modules/remotes/replica/__fixtures__/replica-seed.js +2 -13
  237. package/dist/server/modules/remotes/replica/__fixtures__/replica-seed.js.map +1 -1
  238. package/dist/server/modules/remotes/services/remote-health.service.js +5 -0
  239. package/dist/server/modules/remotes/services/remote-health.service.js.map +1 -1
  240. package/dist/server/modules/remotes/sync/file-sync-failures.service.d.ts +18 -0
  241. package/dist/server/modules/remotes/sync/file-sync-failures.service.js +157 -0
  242. package/dist/server/modules/remotes/sync/file-sync-failures.service.js.map +1 -0
  243. package/dist/server/modules/remotes/sync/file-sync-pattern-preview.service.d.ts +14 -0
  244. package/dist/server/modules/remotes/sync/file-sync-pattern-preview.service.js +99 -0
  245. package/dist/server/modules/remotes/sync/file-sync-pattern-preview.service.js.map +1 -0
  246. package/dist/server/modules/remotes/sync/file-sync-suggestions.service.d.ts +15 -0
  247. package/dist/server/modules/remotes/sync/file-sync-suggestions.service.js +90 -0
  248. package/dist/server/modules/remotes/sync/file-sync-suggestions.service.js.map +1 -0
  249. package/dist/server/modules/remotes/sync/project-file-sync.controller.d.ts +29 -0
  250. package/dist/server/modules/remotes/sync/project-file-sync.controller.js +160 -0
  251. package/dist/server/modules/remotes/sync/project-file-sync.controller.js.map +1 -0
  252. package/dist/server/modules/remotes/sync/remote-file-sync.dto.d.ts +72 -0
  253. package/dist/server/modules/remotes/sync/remote-file-sync.dto.js +16 -0
  254. package/dist/server/modules/remotes/sync/remote-file-sync.dto.js.map +1 -0
  255. package/dist/server/modules/remotes/sync/remote-file-sync.service.d.ts +32 -1
  256. package/dist/server/modules/remotes/sync/remote-file-sync.service.js +499 -38
  257. package/dist/server/modules/remotes/sync/remote-file-sync.service.js.map +1 -1
  258. package/dist/server/modules/remotes/sync/remote-live-sync.service.d.ts +2 -0
  259. package/dist/server/modules/remotes/sync/remote-live-sync.service.js +26 -12
  260. package/dist/server/modules/remotes/sync/remote-live-sync.service.js.map +1 -1
  261. package/dist/server/modules/remotes/vm-user-identity.d.ts +29 -0
  262. package/dist/server/modules/remotes/vm-user-identity.js +45 -0
  263. package/dist/server/modules/remotes/vm-user-identity.js.map +1 -0
  264. package/dist/server/modules/runtime-context-capture/codex-plugin-profile-materializer.service.js +5 -1
  265. package/dist/server/modules/runtime-context-capture/codex-plugin-profile-materializer.service.js.map +1 -1
  266. package/dist/server/modules/session-reader/data/pricing.json +55 -7
  267. package/dist/server/modules/sessions/services/provider-launch-config/provider-launch-config.service.js +5 -0
  268. package/dist/server/modules/sessions/services/provider-launch-config/provider-launch-config.service.js.map +1 -1
  269. package/dist/server/modules/settings/local/delegates/skills-settings.delegate.d.ts +6 -0
  270. package/dist/server/modules/settings/local/delegates/skills-settings.delegate.js +26 -0
  271. package/dist/server/modules/settings/local/delegates/skills-settings.delegate.js.map +1 -1
  272. package/dist/server/modules/settings/services/settings.service.d.ts +3 -1
  273. package/dist/server/modules/settings/services/settings.service.js +6 -0
  274. package/dist/server/modules/settings/services/settings.service.js.map +1 -1
  275. package/dist/server/modules/skills/adapters/anthropic-skill-source.adapter.js +5 -5
  276. package/dist/server/modules/skills/adapters/anthropic-skill-source.adapter.js.map +1 -1
  277. package/dist/server/modules/skills/adapters/github-directory-skill-source.adapter.js +5 -5
  278. package/dist/server/modules/skills/adapters/github-directory-skill-source.adapter.js.map +1 -1
  279. package/dist/server/modules/skills/adapters/github-skill-source.base.js +4 -3
  280. package/dist/server/modules/skills/adapters/github-skill-source.base.js.map +1 -1
  281. package/dist/server/modules/skills/adapters/local-skill-source.adapter.js +5 -5
  282. package/dist/server/modules/skills/adapters/local-skill-source.adapter.js.map +1 -1
  283. package/dist/server/modules/skills/adapters/microsoft-skill-source.adapter.js +5 -5
  284. package/dist/server/modules/skills/adapters/microsoft-skill-source.adapter.js.map +1 -1
  285. package/dist/server/modules/skills/adapters/openai-skill-source.adapter.js +5 -5
  286. package/dist/server/modules/skills/adapters/openai-skill-source.adapter.js.map +1 -1
  287. package/dist/server/modules/skills/adapters/skill-source.adapter.d.ts +5 -0
  288. package/dist/server/modules/skills/adapters/skill-sync-temp-cleanup.d.ts +5 -0
  289. package/dist/server/modules/skills/adapters/skill-sync-temp-cleanup.js +75 -0
  290. package/dist/server/modules/skills/adapters/skill-sync-temp-cleanup.js.map +1 -0
  291. package/dist/server/modules/skills/adapters/trailofbits-skill-source.adapter.js +5 -5
  292. package/dist/server/modules/skills/adapters/trailofbits-skill-source.adapter.js.map +1 -1
  293. package/dist/server/modules/skills/adapters/vercel-skill-source.adapter.js +5 -5
  294. package/dist/server/modules/skills/adapters/vercel-skill-source.adapter.js.map +1 -1
  295. package/dist/server/modules/skills/controllers/skills.controller.js +2 -2
  296. package/dist/server/modules/skills/controllers/skills.controller.js.map +1 -1
  297. package/dist/server/modules/skills/services/skill-source-lifecycle.service.d.ts +3 -3
  298. package/dist/server/modules/skills/services/skill-source-lifecycle.service.js +9 -4
  299. package/dist/server/modules/skills/services/skill-source-lifecycle.service.js.map +1 -1
  300. package/dist/server/modules/skills/services/skill-sync.service.d.ts +3 -3
  301. package/dist/server/modules/skills/services/skill-sync.service.js +32 -6
  302. package/dist/server/modules/skills/services/skill-sync.service.js.map +1 -1
  303. package/dist/server/modules/skills/services/skill-sync.types.d.ts +3 -0
  304. package/dist/server/modules/storage/db/schema.d.ts +2 -2
  305. package/dist/server/modules/storage/db/schema.js +2 -0
  306. package/dist/server/modules/storage/db/schema.js.map +1 -1
  307. package/dist/server/modules/storage/models/domain.models.d.ts +1 -1
  308. package/dist/server/modules/storage/models/domain.models.js +2 -0
  309. package/dist/server/modules/storage/models/domain.models.js.map +1 -1
  310. package/dist/server/modules/terminal/gateways/terminal.gateway.d.ts +3 -1
  311. package/dist/server/modules/terminal/gateways/terminal.gateway.js +9 -4
  312. package/dist/server/modules/terminal/gateways/terminal.gateway.js.map +1 -1
  313. package/dist/server/modules/terminal/services/terminal-activity.service.d.ts +0 -1
  314. package/dist/server/modules/terminal/services/terminal-activity.service.js +0 -3
  315. package/dist/server/modules/terminal/services/terminal-activity.service.js.map +1 -1
  316. package/dist/server/modules/terminal/services/terminal-io/lifecycle.js +15 -3
  317. package/dist/server/modules/terminal/services/terminal-io/lifecycle.js.map +1 -1
  318. package/dist/server/modules/terminal/utils/ansi-sanitizer.d.ts +0 -1
  319. package/dist/server/modules/terminal/utils/ansi-sanitizer.js +0 -4
  320. package/dist/server/modules/terminal/utils/ansi-sanitizer.js.map +1 -1
  321. package/dist/server/templates/teams-dev.json +11 -11
  322. package/dist/server/test-setup-node.js +4 -3
  323. package/dist/server/test-setup-node.js.map +1 -1
  324. package/dist/server/test-setup.js +7 -0
  325. package/dist/server/test-setup.js.map +1 -1
  326. package/dist/server/tsconfig.tsbuildinfo +1 -1
  327. package/dist/server/ui/assets/{ExternalRichEditor-DtNvrV0F.js → ExternalRichEditor-CIZPhssf.js} +24 -24
  328. package/dist/server/ui/assets/ReviewDetailPage-winyLSQ7.js +6 -0
  329. package/dist/server/ui/assets/ReviewsPage-BYKBReMp.js +6 -0
  330. package/dist/server/ui/assets/index-CiDJX6Hn.js +1191 -0
  331. package/dist/server/ui/assets/index-f1WOAqXB.css +32 -0
  332. package/dist/server/ui/assets/useReviewSubscription-v3Cto0y4.js +69 -0
  333. package/dist/server/ui/index.html +2 -2
  334. package/dist/templates/teams-dev.json +11 -11
  335. package/package.json +8 -1
  336. package/dist/server/modules/reviews/utils/notification-formatter.d.ts +0 -12
  337. package/dist/server/modules/reviews/utils/notification-formatter.js +0 -60
  338. package/dist/server/modules/reviews/utils/notification-formatter.js.map +0 -1
  339. package/dist/server/ui/assets/ReviewDetailPage-DJzEoM0x.js +0 -6
  340. package/dist/server/ui/assets/ReviewsPage-z2O8MNEw.js +0 -6
  341. package/dist/server/ui/assets/index-CC4P3V8L.js +0 -994
  342. package/dist/server/ui/assets/index-LsJe1ZTS.css +0 -32
  343. package/dist/server/ui/assets/useReviewSubscription-B7AdJBO2.js +0 -69
@@ -0,0 +1,157 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.FileSyncFailuresService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const error_types_1 = require("../../../common/errors/error-types");
18
+ const logger_1 = require("../../../common/logging/logger");
19
+ const build_exclusion_suggestions_1 = require("../../file-sync/build-exclusion-suggestions");
20
+ const file_sync_managed_exclusions_store_1 = require("../../file-sync/file-sync-managed-exclusions.store");
21
+ const file_sync_dto_1 = require("../../file-sync/file-sync.dto");
22
+ const file_sync_service_1 = require("../../file-sync/file-sync.service");
23
+ const sync_path_inspector_1 = require("../../file-sync/sync-path-inspector");
24
+ const storage_interface_1 = require("../../storage/interfaces/storage.interface");
25
+ const remote_host_client_1 = require("../operations/remote-host.client");
26
+ const remote_bindings_service_1 = require("../services/remote-bindings.service");
27
+ const logger = (0, logger_1.createLogger)('FileSyncFailuresService');
28
+ let FileSyncFailuresService = class FileSyncFailuresService {
29
+ storage;
30
+ bindings;
31
+ files;
32
+ host;
33
+ inspector;
34
+ managed;
35
+ constructor(storage, bindings, files, host, inspector, managed) {
36
+ this.storage = storage;
37
+ this.bindings = bindings;
38
+ this.files = files;
39
+ this.host = host;
40
+ this.inspector = inspector;
41
+ this.managed = managed;
42
+ }
43
+ async failed(projectId) {
44
+ const binding = await this.bindings.get(projectId);
45
+ if (binding?.state !== 'remote')
46
+ throw new error_types_1.AppError('The project must be connected to read file sync failures.', 'FILE_SYNC_NOT_CONNECTED', 409);
47
+ const { rootPath } = await this.storage.getProject(projectId);
48
+ const codeId = (0, file_sync_service_1.projectFolderId)(projectId, 'code');
49
+ const managedExclusions = this.managed.get(projectId);
50
+ const reads = await Promise.allSettled([
51
+ this.files.status(codeId, undefined, { allErrors: true }),
52
+ this.host.syncStatus(binding.remoteId, codeId, undefined, { allErrors: true }),
53
+ ]);
54
+ const sides = ['home', 'vm'];
55
+ const result = {
56
+ ownerSide: 'vm',
57
+ installedPrefix: (0, file_sync_dto_1.codeIgnores)(managedExclusions, []),
58
+ home: { entries: [] },
59
+ vm: { entries: [] },
60
+ groups: [],
61
+ overLimit: false,
62
+ };
63
+ for (const [index, side] of sides.entries()) {
64
+ const read = reads[index];
65
+ if (read.status === 'rejected') {
66
+ result[side].readError =
67
+ side === 'home'
68
+ ? "DevChain could not read this PC's errors."
69
+ : "DevChain could not read the VM's errors.";
70
+ logger.warn({ error: read.reason, projectId, side }, 'File sync errors could not be read');
71
+ continue;
72
+ }
73
+ const unique = new Map();
74
+ for (const entry of read.value.fileErrors ?? [])
75
+ if (!entry.error.includes(file_sync_dto_1.TRANSIENT_SYNC_ERROR) && !unique.has(entry.path))
76
+ unique.set(entry.path, entry);
77
+ result[side].entries = [...unique.values()].map((entry) => ({
78
+ ...entry,
79
+ owner: null,
80
+ git: null,
81
+ }));
82
+ }
83
+ const paths = [
84
+ ...new Set(sides.flatMap((side) => result[side].entries.map((entry) => entry.path))),
85
+ ];
86
+ if (!paths.length)
87
+ return result;
88
+ const inspections = await Promise.allSettled([
89
+ this.inspector.inspect(rootPath, false, paths),
90
+ this.host.syncInspect(binding.remoteId, { path: rootPath, scan: false, paths }),
91
+ ]);
92
+ for (const [index, side] of sides.entries()) {
93
+ const read = inspections[index];
94
+ if (read.status === 'rejected') {
95
+ result[side].readError ??=
96
+ side === 'home'
97
+ ? "DevChain could not inspect this PC's failed files."
98
+ : "DevChain could not inspect the VM's failed files.";
99
+ logger.warn({ error: read.reason, projectId, side }, 'Failed file facts could not be read');
100
+ }
101
+ else
102
+ this.addFacts(result[side], read.value);
103
+ }
104
+ const [home, vm] = inspections;
105
+ if (vm.status === 'fulfilled')
106
+ result.vmUser = vm.value.vmUser ?? vm.value.projectOwner;
107
+ if (home.status === 'fulfilled') {
108
+ const input = {
109
+ ownerSide: 'vm',
110
+ home: home.value,
111
+ vm: vm.status === 'fulfilled' ? vm.value : 'unavailable',
112
+ userIgnores: this.files.getIgnores(projectId),
113
+ managedExclusions,
114
+ };
115
+ await (0, build_exclusion_suggestions_1.attachPatternChecks)(input, {
116
+ home: (patterns) => this.inspector.inspect(rootPath, false, [], patterns),
117
+ vm: (patterns) => this.host.syncInspect(binding.remoteId, {
118
+ path: rootPath,
119
+ scan: false,
120
+ paths: [],
121
+ patterns,
122
+ }),
123
+ });
124
+ Object.assign(result, (0, build_exclusion_suggestions_1.buildExclusionSuggestions)(input));
125
+ }
126
+ return result;
127
+ }
128
+ addFacts(side, inspection) {
129
+ const facts = new Map(inspection.entries.map((entry) => [entry.path, entry]));
130
+ for (const entry of side.entries) {
131
+ const fact = facts.get(entry.path);
132
+ if (!fact)
133
+ continue;
134
+ entry.owner = fact.owner;
135
+ const { ignored, ignoreRule, ignoredAncestor, tracked, trackedDescendants } = fact;
136
+ entry.git = {
137
+ state: inspection.gitState,
138
+ ignored,
139
+ ignoreRule,
140
+ ignoredAncestor,
141
+ tracked,
142
+ trackedDescendants,
143
+ };
144
+ }
145
+ }
146
+ };
147
+ exports.FileSyncFailuresService = FileSyncFailuresService;
148
+ exports.FileSyncFailuresService = FileSyncFailuresService = __decorate([
149
+ (0, common_1.Injectable)(),
150
+ __param(0, (0, common_1.Inject)(storage_interface_1.STORAGE_SERVICE)),
151
+ __metadata("design:paramtypes", [Object, remote_bindings_service_1.RemoteBindingsService,
152
+ file_sync_service_1.FileSyncService,
153
+ remote_host_client_1.RemoteHostClient,
154
+ sync_path_inspector_1.SyncPathInspector,
155
+ file_sync_managed_exclusions_store_1.FileSyncManagedExclusionsStore])
156
+ ], FileSyncFailuresService);
157
+ //# sourceMappingURL=file-sync-failures.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-sync-failures.service.js","sourceRoot":"","sources":["../../../../src/modules/remotes/sync/file-sync-failures.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,oEAA8D;AAC9D,2DAA8D;AAC9D,6FAIqD;AACrD,2GAAoG;AACpG,iEAAkF;AAClF,yEAAqF;AACrF,6EAAwE;AAExE,kFAAkG;AAClG,yEAAoE;AACpE,iFAA4E;AAG5E,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,yBAAyB,CAAC,CAAC;AAGhD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAEU;IACzB;IACA;IACA;IACA;IACA;IANnB,YAC4C,OAAuB,EAChD,QAA+B,EAC/B,KAAsB,EACtB,IAAsB,EACtB,SAA4B,EAC5B,OAAuC;QALd,YAAO,GAAP,OAAO,CAAgB;QAChD,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,UAAK,GAAL,KAAK,CAAiB;QACtB,SAAI,GAAJ,IAAI,CAAkB;QACtB,cAAS,GAAT,SAAS,CAAmB;QAC5B,YAAO,GAAP,OAAO,CAAgC;IACvD,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC5B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,OAAO,EAAE,KAAK,KAAK,QAAQ;YAC7B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BACP,kBAAkB;aACnB,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAlHY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,mCAAe,CAAC,CAAA;6CACG,+CAAqB;QACxB,mCAAe;QAChB,qCAAgB;QACX,uCAAiB;QACnB,mEAA8B;GAP/C,uBAAuB,CAkHnC"}
@@ -0,0 +1,14 @@
1
+ import { SyncPathInspector } from '../../file-sync/sync-path-inspector';
2
+ import { type ProjectStorage } from '../../storage/interfaces/storage.interface';
3
+ import { RemoteHostClient } from '../operations/remote-host.client';
4
+ import { RemoteBindingsService } from '../services/remote-bindings.service';
5
+ import type { ProjectPatternPreview } from './remote-file-sync.dto';
6
+ export declare class FileSyncPatternPreviewService {
7
+ private readonly storage;
8
+ private readonly bindings;
9
+ private readonly host;
10
+ private readonly inspector;
11
+ constructor(storage: ProjectStorage, bindings: RemoteBindingsService, host: RemoteHostClient, inspector: SyncPathInspector);
12
+ preview(projectId: string, pattern: string): Promise<ProjectPatternPreview>;
13
+ private summarize;
14
+ }
@@ -0,0 +1,99 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.FileSyncPatternPreviewService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const error_types_1 = require("../../../common/errors/error-types");
18
+ const logger_1 = require("../../../common/logging/logger");
19
+ const ignore_pattern_matcher_1 = require("../../file-sync/ignore-pattern-matcher");
20
+ const sync_path_inspector_1 = require("../../file-sync/sync-path-inspector");
21
+ const storage_interface_1 = require("../../storage/interfaces/storage.interface");
22
+ const remote_host_client_1 = require("../operations/remote-host.client");
23
+ const remote_bindings_service_1 = require("../services/remote-bindings.service");
24
+ const logger = (0, logger_1.createLogger)('FileSyncPatternPreviewService');
25
+ const PREVIEW_SAMPLE_MAX = 5;
26
+ let FileSyncPatternPreviewService = class FileSyncPatternPreviewService {
27
+ storage;
28
+ bindings;
29
+ host;
30
+ inspector;
31
+ constructor(storage, bindings, host, inspector) {
32
+ this.storage = storage;
33
+ this.bindings = bindings;
34
+ this.host = host;
35
+ this.inspector = inspector;
36
+ }
37
+ async preview(projectId, pattern) {
38
+ const compiled = (0, ignore_pattern_matcher_1.compileIgnorePattern)(pattern);
39
+ if (compiled.kind === 'error')
40
+ throw new error_types_1.ValidationError(compiled.error);
41
+ const binding = await this.bindings.get(projectId);
42
+ if (binding?.state !== 'remote') {
43
+ throw new error_types_1.AppError('The project must be connected to preview a file sync pattern.', 'FILE_SYNC_NOT_CONNECTED', 409);
44
+ }
45
+ const { rootPath } = await this.storage.getProject(projectId);
46
+ const [home, vm] = await Promise.allSettled([
47
+ this.inspector.inspect(rootPath, false, [], [pattern]),
48
+ this.host.syncInspect(binding.remoteId, {
49
+ path: rootPath,
50
+ scan: false,
51
+ paths: [],
52
+ patterns: [pattern],
53
+ }),
54
+ ]);
55
+ for (const [side, read] of [
56
+ ['home', home],
57
+ ['vm', vm],
58
+ ]) {
59
+ if (read.status === 'rejected') {
60
+ logger.warn({ error: read.reason, projectId, side }, 'File sync pattern preview unavailable');
61
+ }
62
+ }
63
+ return {
64
+ home: home.status === 'fulfilled'
65
+ ? this.summarize(home.value, pattern)
66
+ : { state: 'error', tracked: null, kept: null },
67
+ vm: vm.status === 'fulfilled'
68
+ ? this.summarize(vm.value, pattern)
69
+ : { state: 'unavailable', tracked: null, kept: null },
70
+ };
71
+ }
72
+ summarize(inspection, pattern) {
73
+ const checks = inspection.patternChecks;
74
+ if (!checks)
75
+ return { state: 'error', tracked: null, kept: null };
76
+ if (checks.state !== 'checked')
77
+ return { state: checks.state, tracked: null, kept: null };
78
+ const match = checks.results.find((result) => result.pattern === pattern);
79
+ if (!match)
80
+ return { state: 'error', tracked: null, kept: null };
81
+ return {
82
+ state: 'checked',
83
+ tracked: {
84
+ count: match.tracked.count,
85
+ sample: match.tracked.files.slice(0, PREVIEW_SAMPLE_MAX),
86
+ },
87
+ kept: { count: match.kept.count, sample: match.kept.sample.slice(0, PREVIEW_SAMPLE_MAX) },
88
+ };
89
+ }
90
+ };
91
+ exports.FileSyncPatternPreviewService = FileSyncPatternPreviewService;
92
+ exports.FileSyncPatternPreviewService = FileSyncPatternPreviewService = __decorate([
93
+ (0, common_1.Injectable)(),
94
+ __param(0, (0, common_1.Inject)(storage_interface_1.STORAGE_SERVICE)),
95
+ __metadata("design:paramtypes", [Object, remote_bindings_service_1.RemoteBindingsService,
96
+ remote_host_client_1.RemoteHostClient,
97
+ sync_path_inspector_1.SyncPathInspector])
98
+ ], FileSyncPatternPreviewService);
99
+ //# sourceMappingURL=file-sync-pattern-preview.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-sync-pattern-preview.service.js","sourceRoot":"","sources":["../../../../src/modules/remotes/sync/file-sync-pattern-preview.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,oEAA+E;AAC/E,2DAA8D;AAC9D,mFAA8E;AAC9E,6EAAwE;AAExE,kFAAkG;AAClG,yEAAoE;AACpE,iFAA4E;AAG5E,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,+BAA+B,CAAC,CA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MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;QAC1E,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACjE,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;gBAC1B,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC;aACzD;YACD,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,EAAE;SAC1F,CAAC;IACJ,CAAC;CACF,CAAA;AAnEY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,mCAAe,CAAC,CAAA;6CACG,+CAAqB;QACzB,qCAAgB;QACX,uCAAiB;GALpC,6BAA6B,CAmEzC"}
@@ -0,0 +1,15 @@
1
+ import { FileSyncManagedExclusionsStore } from '../../file-sync/file-sync-managed-exclusions.store';
2
+ import { FileSyncService } from '../../file-sync/file-sync.service';
3
+ import { SyncPathInspector } from '../../file-sync/sync-path-inspector';
4
+ import type { ProjectExclusionSuggestions } from '../../file-sync/sync-path-inspection.dto';
5
+ import { type StorageService } from '../../storage/interfaces/storage.interface';
6
+ import { RemoteHostClient } from '../operations/remote-host.client';
7
+ export declare class FileSyncSuggestionsService {
8
+ private readonly storage;
9
+ private readonly inspector;
10
+ private readonly host;
11
+ private readonly files;
12
+ private readonly managed;
13
+ constructor(storage: StorageService, inspector: SyncPathInspector, host: RemoteHostClient, files: FileSyncService, managed: FileSyncManagedExclusionsStore);
14
+ suggestions(projectId: string, remoteId: string): Promise<ProjectExclusionSuggestions>;
15
+ }
@@ -0,0 +1,90 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.FileSyncSuggestionsService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const logger_1 = require("../../../common/logging/logger");
18
+ const build_exclusion_suggestions_1 = require("../../file-sync/build-exclusion-suggestions");
19
+ const file_sync_managed_exclusions_store_1 = require("../../file-sync/file-sync-managed-exclusions.store");
20
+ const file_sync_service_1 = require("../../file-sync/file-sync.service");
21
+ const sync_path_inspector_1 = require("../../file-sync/sync-path-inspector");
22
+ const storage_interface_1 = require("../../storage/interfaces/storage.interface");
23
+ const remote_host_client_1 = require("../operations/remote-host.client");
24
+ const logger = (0, logger_1.createLogger)('FileSyncSuggestionsService');
25
+ let FileSyncSuggestionsService = class FileSyncSuggestionsService {
26
+ storage;
27
+ inspector;
28
+ host;
29
+ files;
30
+ managed;
31
+ constructor(storage, inspector, host, files, managed) {
32
+ this.storage = storage;
33
+ this.inspector = inspector;
34
+ this.host = host;
35
+ this.files = files;
36
+ this.managed = managed;
37
+ }
38
+ async suggestions(projectId, remoteId) {
39
+ const { rootPath } = await this.storage.getProject(projectId);
40
+ const scanned = await this.inspector.inspect(rootPath, true);
41
+ let vm;
42
+ try {
43
+ vm = await this.host.syncInspect(remoteId, {
44
+ path: rootPath,
45
+ scan: true,
46
+ paths: scanned.candidates,
47
+ });
48
+ }
49
+ catch (error) {
50
+ logger.warn({ error, projectId, remoteId }, 'VM file-sync inspection was unavailable');
51
+ vm = 'unavailable';
52
+ }
53
+ let home = scanned;
54
+ if (vm !== 'unavailable' && vm.candidates.length) {
55
+ const additional = await this.inspector.inspect(rootPath, false, vm.candidates);
56
+ home = {
57
+ ...additional,
58
+ candidates: scanned.candidates,
59
+ entries: [
60
+ ...new Map([...scanned.entries, ...additional.entries].map((entry) => [entry.path, entry])).values(),
61
+ ],
62
+ };
63
+ }
64
+ const input = {
65
+ ownerSide: 'home',
66
+ home,
67
+ vm,
68
+ userIgnores: this.files.getIgnores(projectId),
69
+ managedExclusions: this.managed.get(projectId),
70
+ };
71
+ await (0, build_exclusion_suggestions_1.attachPatternChecks)(input, {
72
+ home: (patterns) => this.inspector.inspect(rootPath, false, [], patterns),
73
+ vm: (patterns) => vm === 'unavailable'
74
+ ? Promise.resolve(null)
75
+ : this.host.syncInspect(remoteId, { path: rootPath, scan: false, paths: [], patterns }),
76
+ });
77
+ const result = (0, build_exclusion_suggestions_1.buildExclusionSuggestions)(input);
78
+ return { ownerSide: 'home', home, vm, ...result };
79
+ }
80
+ };
81
+ exports.FileSyncSuggestionsService = FileSyncSuggestionsService;
82
+ exports.FileSyncSuggestionsService = FileSyncSuggestionsService = __decorate([
83
+ (0, common_1.Injectable)(),
84
+ __param(0, (0, common_1.Inject)(storage_interface_1.STORAGE_SERVICE)),
85
+ __metadata("design:paramtypes", [Object, sync_path_inspector_1.SyncPathInspector,
86
+ remote_host_client_1.RemoteHostClient,
87
+ file_sync_service_1.FileSyncService,
88
+ file_sync_managed_exclusions_store_1.FileSyncManagedExclusionsStore])
89
+ ], FileSyncSuggestionsService);
90
+ //# sourceMappingURL=file-sync-suggestions.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-sync-suggestions.service.js","sourceRoot":"","sources":["../../../../src/modules/remotes/sync/file-sync-suggestions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,2DAA8D;AAC9D,6FAIqD;AACrD,2GAAoG;AACpG,yEAAoE;AACpE,6EAAwE;AAKxE,kFAAkG;AAClG,yEAAoE;AAEpE,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,4BAA4B,CAAC,CAAC;AAGnD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAEO;IACzB;IACA;IACA;IACA;IALnB,YAC4C,OAAuB,EAChD,SAA4B,EAC5B,IAAsB,EACtB,KAAsB,EACtB,OAAuC;QAJd,YAAO,GAAP,OAAO,CAAgB;QAChD,cAAS,GAAT,SAAS,CAAmB;QAC5B,SAAI,GAAJ,IAAI,CAAkB;QACtB,UAAK,GAAL,KAAK,CAAiB;QACtB,YAAO,GAAP,OAAO,CAAgC;IACvD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,SAAiB,EAAE,QAAgB;QACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC7D,IAAI,EAAsC,CAAC;QAC3C,IAAI,CAAC;YACH,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;gBACzC,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,OAAO,CAAC,UAAU;aAC1B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC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,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;SAC5F,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,uDAAyB,EAAC,KAAK,CAAC,CAAC;QAChD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;IACpD,CAAC;CACF,CAAA;AArDY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,mCAAe,CAAC,CAAA;6CACI,uCAAiB;QACtB,qCAAgB;QACf,mCAAe;QACb,mEAA8B;GAN/C,0BAA0B,CAqDtC"}
@@ -0,0 +1,29 @@
1
+ import { type FileSyncAutoFix } from '../../file-sync/file-sync-auto-fix.dto';
2
+ import type { SaveProjectIgnoresResult, ProjectFileSyncFailures } from './remote-file-sync.dto';
3
+ import { FileSyncFailuresService } from './file-sync-failures.service';
4
+ import { RemoteFileSyncService } from './remote-file-sync.service';
5
+ import { RemoteLiveSyncService } from './remote-live-sync.service';
6
+ import { type ProjectExclusionSuggestions } from '../../file-sync/sync-path-inspection.dto';
7
+ import { FileSyncSuggestionsService } from './file-sync-suggestions.service';
8
+ import { FileSyncPatternPreviewService } from './file-sync-pattern-preview.service';
9
+ import { type ProjectPatternPreview } from './remote-file-sync.dto';
10
+ import { type SyncChownResult } from '../../file-sync/sync-chown.dto';
11
+ export declare class ProjectFileSyncController {
12
+ private readonly live;
13
+ private readonly files;
14
+ private readonly suggestions;
15
+ private readonly failures;
16
+ private readonly previews;
17
+ constructor(live: RemoteLiveSyncService, files: RemoteFileSyncService, suggestions: FileSyncSuggestionsService, failures: FileSyncFailuresService, previews: FileSyncPatternPreviewService);
18
+ getIgnores(projectId: string): {
19
+ ignores: string[];
20
+ revision: number;
21
+ };
22
+ getAutoFix(projectId: string): FileSyncAutoFix;
23
+ setAutoFix(projectId: string, body: unknown): FileSyncAutoFix;
24
+ failedFiles(projectId: string): Promise<ProjectFileSyncFailures>;
25
+ giveOwnership(projectId: string, body: unknown): Promise<SyncChownResult>;
26
+ suggestionsForProject(projectId: string, body: unknown): Promise<ProjectExclusionSuggestions>;
27
+ patternPreview(projectId: string, body: unknown): Promise<ProjectPatternPreview>;
28
+ save(projectId: string, body: unknown): Promise<SaveProjectIgnoresResult>;
29
+ }
@@ -0,0 +1,160 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ProjectFileSyncController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const file_sync_dto_1 = require("../../file-sync/file-sync.dto");
19
+ const file_sync_auto_fix_dto_1 = require("../../file-sync/file-sync-auto-fix.dto");
20
+ const file_sync_failures_service_1 = require("./file-sync-failures.service");
21
+ const remote_file_sync_service_1 = require("./remote-file-sync.service");
22
+ const remote_live_sync_service_1 = require("./remote-live-sync.service");
23
+ const sync_path_inspection_dto_1 = require("../../file-sync/sync-path-inspection.dto");
24
+ const file_sync_suggestions_service_1 = require("./file-sync-suggestions.service");
25
+ const file_sync_pattern_preview_service_1 = require("./file-sync-pattern-preview.service");
26
+ const remote_file_sync_dto_1 = require("./remote-file-sync.dto");
27
+ const sync_chown_dto_1 = require("../../file-sync/sync-chown.dto");
28
+ let ProjectFileSyncController = class ProjectFileSyncController {
29
+ live;
30
+ files;
31
+ suggestions;
32
+ failures;
33
+ previews;
34
+ constructor(live, files, suggestions, failures, previews) {
35
+ this.live = live;
36
+ this.files = files;
37
+ this.suggestions = suggestions;
38
+ this.failures = failures;
39
+ this.previews = previews;
40
+ }
41
+ getIgnores(projectId) {
42
+ return this.files.getIgnores(projectId);
43
+ }
44
+ getAutoFix(projectId) {
45
+ return this.files.getAutoFix(projectId);
46
+ }
47
+ setAutoFix(projectId, body) {
48
+ return this.files.setAutoFix(projectId, file_sync_auto_fix_dto_1.AutoFixBodySchema.parse(body).enabled);
49
+ }
50
+ async failedFiles(projectId) {
51
+ const [failures, forceSync] = await Promise.all([
52
+ this.failures.failed(projectId),
53
+ this.files.forceSyncOffer(projectId),
54
+ ]);
55
+ return { ...failures, forceSync, ownershipNotes: this.files.ownershipNotes(projectId) };
56
+ }
57
+ giveOwnership(projectId, body) {
58
+ const { paths } = sync_chown_dto_1.GiveOwnershipRequestSchema.parse(body);
59
+ return this.live.runExclusive(projectId, (active) => this.files.giveOwnership(projectId, paths, active));
60
+ }
61
+ suggestionsForProject(projectId, body) {
62
+ const { remoteId } = sync_path_inspection_dto_1.SyncSuggestionsRequestSchema.parse(body);
63
+ return this.suggestions.suggestions(projectId, remoteId);
64
+ }
65
+ patternPreview(projectId, body) {
66
+ const { pattern } = remote_file_sync_dto_1.PatternPreviewRequestSchema.parse(body);
67
+ return this.previews.preview(projectId, pattern);
68
+ }
69
+ async save(projectId, body) {
70
+ await this.files.assertNoHold(projectId);
71
+ const { ignores, revision } = file_sync_dto_1.IgnoresBodySchema.parse(body);
72
+ return this.live.runExclusive(projectId, async (active) => {
73
+ await this.files.assertNoHold(projectId);
74
+ return this.files.saveIgnores(projectId, ignores, active, revision);
75
+ });
76
+ }
77
+ };
78
+ exports.ProjectFileSyncController = ProjectFileSyncController;
79
+ __decorate([
80
+ (0, common_1.Get)('ignores'),
81
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
82
+ __metadata("design:type", Function),
83
+ __metadata("design:paramtypes", [String]),
84
+ __metadata("design:returntype", Object)
85
+ ], ProjectFileSyncController.prototype, "getIgnores", null);
86
+ __decorate([
87
+ (0, common_1.Get)('auto-fix'),
88
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
89
+ __metadata("design:type", Function),
90
+ __metadata("design:paramtypes", [String]),
91
+ __metadata("design:returntype", Object)
92
+ ], ProjectFileSyncController.prototype, "getAutoFix", null);
93
+ __decorate([
94
+ (0, common_1.Put)('auto-fix'),
95
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
96
+ __param(1, (0, common_1.Body)()),
97
+ __metadata("design:type", Function),
98
+ __metadata("design:paramtypes", [String, Object]),
99
+ __metadata("design:returntype", Object)
100
+ ], ProjectFileSyncController.prototype, "setAutoFix", null);
101
+ __decorate([
102
+ (0, common_1.Get)('failed'),
103
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
104
+ __metadata("design:type", Function),
105
+ __metadata("design:paramtypes", [String]),
106
+ __metadata("design:returntype", Promise)
107
+ ], ProjectFileSyncController.prototype, "failedFiles", null);
108
+ __decorate([
109
+ (0, common_1.Post)('give-ownership'),
110
+ (0, common_1.HttpCode)(200),
111
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
112
+ __param(1, (0, common_1.Body)()),
113
+ __metadata("design:type", Function),
114
+ __metadata("design:paramtypes", [String, Object]),
115
+ __metadata("design:returntype", Promise)
116
+ ], ProjectFileSyncController.prototype, "giveOwnership", null);
117
+ __decorate([
118
+ (0, common_1.Post)('suggestions'),
119
+ (0, common_1.HttpCode)(200),
120
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
121
+ __param(1, (0, common_1.Body)()),
122
+ __metadata("design:type", Function),
123
+ __metadata("design:paramtypes", [String, Object]),
124
+ __metadata("design:returntype", Promise)
125
+ ], ProjectFileSyncController.prototype, "suggestionsForProject", null);
126
+ __decorate([
127
+ (0, common_1.Post)('pattern-preview'),
128
+ (0, common_1.HttpCode)(200),
129
+ (0, swagger_1.ApiOperation)({ summary: 'Preview tracked and Git-kept files excluded by a pattern' }),
130
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Match counts, samples and inspection states per side' }),
131
+ (0, swagger_1.ApiResponse)({ status: 400, description: 'Invalid project ID or pattern syntax' }),
132
+ (0, swagger_1.ApiResponse)({ status: 409, description: 'The project is not connected to a VM' }),
133
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
134
+ __param(1, (0, common_1.Body)()),
135
+ __metadata("design:type", Function),
136
+ __metadata("design:paramtypes", [String, Object]),
137
+ __metadata("design:returntype", Promise)
138
+ ], ProjectFileSyncController.prototype, "patternPreview", null);
139
+ __decorate([
140
+ (0, common_1.Put)('ignores'),
141
+ (0, swagger_1.ApiOperation)({ summary: 'Save project ignores and apply them to a connected VM and this PC' }),
142
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Desired list and whether both sides applied it' }),
143
+ (0, swagger_1.ApiResponse)({ status: 400, description: 'Invalid project ID or ignore list' }),
144
+ (0, swagger_1.ApiResponse)({ status: 409, description: 'Force sync holds file settings until it finishes' }),
145
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
146
+ __param(1, (0, common_1.Body)()),
147
+ __metadata("design:type", Function),
148
+ __metadata("design:paramtypes", [String, Object]),
149
+ __metadata("design:returntype", Promise)
150
+ ], ProjectFileSyncController.prototype, "save", null);
151
+ exports.ProjectFileSyncController = ProjectFileSyncController = __decorate([
152
+ (0, swagger_1.ApiTags)('file-sync'),
153
+ (0, common_1.Controller)('api/projects/:id/file-sync'),
154
+ __metadata("design:paramtypes", [remote_live_sync_service_1.RemoteLiveSyncService,
155
+ remote_file_sync_service_1.RemoteFileSyncService,
156
+ file_sync_suggestions_service_1.FileSyncSuggestionsService,
157
+ file_sync_failures_service_1.FileSyncFailuresService,
158
+ file_sync_pattern_preview_service_1.FileSyncPatternPreviewService])
159
+ ], ProjectFileSyncController);
160
+ //# sourceMappingURL=project-file-sync.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-file-sync.controller.js","sourceRoot":"","sources":["../../../../src/modules/remotes/sync/project-file-sync.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkG;AAClG,6CAAqE;AACrE,iEAAkE;AAClE,mFAAiG;AAEjG,6EAAuE;AACvE,yEAAmE;AACnE,yEAAmE;AACnE,uFAGkD;AAClD,mFAA6E;AAC7E,2FAAoF;AACpF,iEAAiG;AACjG,mEAAkG;AAI3F,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAEjB;IACA;IACA;IACA;IACA;IALnB,YACmB,IAA2B,EAC3B,KAA4B,EAC5B,WAAuC,EACvC,QAAiC,EACjC,QAAuC;QAJvC,SAAI,GAAJ,IAAI,CAAuB;QAC3B,UAAK,GAAL,KAAK,CAAuB;QAC5B,gBAAW,GAAX,WAAW,CAA4B;QACvC,aAAQ,GAAR,QAAQ,CAAyB;QACjC,aAAQ,GAAR,QAAQ,CAA+B;IACvD,CAAC;IAGJ,UAAU,CAA6B,SAAiB;QAItD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAGD,UAAU,CAA6B,SAAiB;QACtD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAGD,UAAU,CACoB,SAAiB,EACrC,IAAa;QAErB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,0CAAiB,CAAC,KAA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