@knpkv/codecommit-core 0.7.1 → 0.8.0

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 (307) hide show
  1. package/dist/AwsClient/AwsClientGated.d.ts +1 -1
  2. package/dist/AwsClient/AwsClientGated.d.ts.map +1 -1
  3. package/dist/AwsClient/AwsClientGated.js +29 -16
  4. package/dist/AwsClient/AwsClientGated.js.map +1 -1
  5. package/dist/AwsClient/approvalRuleContent.d.ts +15 -0
  6. package/dist/AwsClient/approvalRuleContent.d.ts.map +1 -0
  7. package/dist/AwsClient/approvalRuleContent.js +39 -0
  8. package/dist/AwsClient/approvalRuleContent.js.map +1 -0
  9. package/dist/AwsClient/createApprovalRule.d.ts +1 -1
  10. package/dist/AwsClient/createApprovalRule.d.ts.map +1 -1
  11. package/dist/AwsClient/createPullRequest.d.ts +1 -1
  12. package/dist/AwsClient/createPullRequest.d.ts.map +1 -1
  13. package/dist/AwsClient/deleteApprovalRule.d.ts +1 -1
  14. package/dist/AwsClient/deleteApprovalRule.d.ts.map +1 -1
  15. package/dist/AwsClient/getCallerIdentity.d.ts +1 -1
  16. package/dist/AwsClient/getCallerIdentity.d.ts.map +1 -1
  17. package/dist/AwsClient/getCommentsForPullRequest.d.ts +1 -1
  18. package/dist/AwsClient/getCommentsForPullRequest.d.ts.map +1 -1
  19. package/dist/AwsClient/getCommentsForPullRequest.js +20 -20
  20. package/dist/AwsClient/getCommentsForPullRequest.js.map +1 -1
  21. package/dist/AwsClient/getDifferences.d.ts +1 -12
  22. package/dist/AwsClient/getDifferences.d.ts.map +1 -1
  23. package/dist/AwsClient/getDifferences.js.map +1 -1
  24. package/dist/AwsClient/getPullRequest.d.ts +2 -1
  25. package/dist/AwsClient/getPullRequest.d.ts.map +1 -1
  26. package/dist/AwsClient/getPullRequest.js +10 -10
  27. package/dist/AwsClient/getPullRequest.js.map +1 -1
  28. package/dist/AwsClient/getPullRequests.d.ts +10 -27
  29. package/dist/AwsClient/getPullRequests.d.ts.map +1 -1
  30. package/dist/AwsClient/getPullRequests.js +28 -92
  31. package/dist/AwsClient/getPullRequests.js.map +1 -1
  32. package/dist/AwsClient/index.d.ts +3 -3
  33. package/dist/AwsClient/index.d.ts.map +1 -1
  34. package/dist/AwsClient/index.js +14 -26
  35. package/dist/AwsClient/index.js.map +1 -1
  36. package/dist/AwsClient/internal.d.ts +36 -104
  37. package/dist/AwsClient/internal.d.ts.map +1 -1
  38. package/dist/AwsClient/internal.js +15 -14
  39. package/dist/AwsClient/internal.js.map +1 -1
  40. package/dist/AwsClient/listBranches.d.ts +1 -1
  41. package/dist/AwsClient/listBranches.d.ts.map +1 -1
  42. package/dist/AwsClient/listBranches.js +1 -1
  43. package/dist/AwsClient/listBranches.js.map +1 -1
  44. package/dist/AwsClient/updateApprovalRule.d.ts +1 -1
  45. package/dist/AwsClient/updateApprovalRule.d.ts.map +1 -1
  46. package/dist/AwsClient/updatePullRequestDescription.d.ts +1 -1
  47. package/dist/AwsClient/updatePullRequestDescription.d.ts.map +1 -1
  48. package/dist/AwsClient/updatePullRequestTitle.d.ts +1 -1
  49. package/dist/AwsClient/updatePullRequestTitle.d.ts.map +1 -1
  50. package/dist/AwsClientConfig.d.ts +7 -7
  51. package/dist/AwsClientConfig.d.ts.map +1 -1
  52. package/dist/AwsClientConfig.js +1 -1
  53. package/dist/AwsClientConfig.js.map +1 -1
  54. package/dist/CacheService/CacheError.d.ts +4 -6
  55. package/dist/CacheService/CacheError.d.ts.map +1 -1
  56. package/dist/CacheService/CacheError.js +2 -2
  57. package/dist/CacheService/CacheError.js.map +1 -1
  58. package/dist/CacheService/Database.d.ts +5 -5
  59. package/dist/CacheService/Database.d.ts.map +1 -1
  60. package/dist/CacheService/Database.js +3 -3
  61. package/dist/CacheService/Database.js.map +1 -1
  62. package/dist/CacheService/EventsHub.d.ts +44 -41
  63. package/dist/CacheService/EventsHub.d.ts.map +1 -1
  64. package/dist/CacheService/EventsHub.js +19 -19
  65. package/dist/CacheService/EventsHub.js.map +1 -1
  66. package/dist/CacheService/migrations/0001_initial.d.ts +2 -2
  67. package/dist/CacheService/migrations/0001_initial.d.ts.map +1 -1
  68. package/dist/CacheService/migrations/0001_initial.js +1 -1
  69. package/dist/CacheService/migrations/0001_initial.js.map +1 -1
  70. package/dist/CacheService/migrations/0002_indexes.d.ts +2 -2
  71. package/dist/CacheService/migrations/0002_indexes.d.ts.map +1 -1
  72. package/dist/CacheService/migrations/0002_indexes.js +1 -1
  73. package/dist/CacheService/migrations/0002_indexes.js.map +1 -1
  74. package/dist/CacheService/migrations/0003_add_health_score.d.ts +2 -2
  75. package/dist/CacheService/migrations/0003_add_health_score.d.ts.map +1 -1
  76. package/dist/CacheService/migrations/0003_add_health_score.js +2 -2
  77. package/dist/CacheService/migrations/0003_add_health_score.js.map +1 -1
  78. package/dist/CacheService/migrations/0004_unify_notifications.d.ts +2 -2
  79. package/dist/CacheService/migrations/0004_unify_notifications.d.ts.map +1 -1
  80. package/dist/CacheService/migrations/0004_unify_notifications.js +3 -3
  81. package/dist/CacheService/migrations/0004_unify_notifications.js.map +1 -1
  82. package/dist/CacheService/migrations/0005_add_sandboxes.d.ts +2 -2
  83. package/dist/CacheService/migrations/0005_add_sandboxes.d.ts.map +1 -1
  84. package/dist/CacheService/migrations/0005_add_sandboxes.js +1 -1
  85. package/dist/CacheService/migrations/0005_add_sandboxes.js.map +1 -1
  86. package/dist/CacheService/migrations/0006_sandbox_logs.d.ts +2 -2
  87. package/dist/CacheService/migrations/0006_sandbox_logs.d.ts.map +1 -1
  88. package/dist/CacheService/migrations/0006_sandbox_logs.js +1 -1
  89. package/dist/CacheService/migrations/0006_sandbox_logs.js.map +1 -1
  90. package/dist/CacheService/migrations/0007_stats_columns.d.ts +2 -2
  91. package/dist/CacheService/migrations/0007_stats_columns.d.ts.map +1 -1
  92. package/dist/CacheService/migrations/0007_stats_columns.js +5 -5
  93. package/dist/CacheService/migrations/0007_stats_columns.js.map +1 -1
  94. package/dist/CacheService/migrations/0008_merged_by.d.ts +2 -2
  95. package/dist/CacheService/migrations/0008_merged_by.d.ts.map +1 -1
  96. package/dist/CacheService/migrations/0008_merged_by.js +2 -2
  97. package/dist/CacheService/migrations/0008_merged_by.js.map +1 -1
  98. package/dist/CacheService/migrations/0009_approved_by.d.ts +2 -2
  99. package/dist/CacheService/migrations/0009_approved_by.d.ts.map +1 -1
  100. package/dist/CacheService/migrations/0009_approved_by.js +2 -2
  101. package/dist/CacheService/migrations/0009_approved_by.js.map +1 -1
  102. package/dist/CacheService/migrations/0010_commented_by.d.ts +2 -2
  103. package/dist/CacheService/migrations/0010_commented_by.d.ts.map +1 -1
  104. package/dist/CacheService/migrations/0010_commented_by.js +2 -2
  105. package/dist/CacheService/migrations/0010_commented_by.js.map +1 -1
  106. package/dist/CacheService/migrations/0011_audit_log.d.ts +2 -2
  107. package/dist/CacheService/migrations/0011_audit_log.d.ts.map +1 -1
  108. package/dist/CacheService/migrations/0011_audit_log.js +2 -2
  109. package/dist/CacheService/migrations/0011_audit_log.js.map +1 -1
  110. package/dist/CacheService/migrations/0012_audit_log_indexes.d.ts +2 -2
  111. package/dist/CacheService/migrations/0012_audit_log_indexes.d.ts.map +1 -1
  112. package/dist/CacheService/migrations/0012_audit_log_indexes.js +2 -2
  113. package/dist/CacheService/migrations/0012_audit_log_indexes.js.map +1 -1
  114. package/dist/CacheService/migrations/0013_approval_rules.d.ts +2 -2
  115. package/dist/CacheService/migrations/0013_approval_rules.d.ts.map +1 -1
  116. package/dist/CacheService/migrations/0013_approval_rules.js +2 -2
  117. package/dist/CacheService/migrations/0013_approval_rules.js.map +1 -1
  118. package/dist/CacheService/migrations/0014_approved_by_arns.d.ts +2 -2
  119. package/dist/CacheService/migrations/0014_approved_by_arns.d.ts.map +1 -1
  120. package/dist/CacheService/migrations/0014_approved_by_arns.js +2 -2
  121. package/dist/CacheService/migrations/0014_approved_by_arns.js.map +1 -1
  122. package/dist/CacheService/migrations/0015_repo_account_id.d.ts +2 -2
  123. package/dist/CacheService/migrations/0015_repo_account_id.d.ts.map +1 -1
  124. package/dist/CacheService/migrations/0015_repo_account_id.js +2 -2
  125. package/dist/CacheService/migrations/0015_repo_account_id.js.map +1 -1
  126. package/dist/CacheService/repos/CommentRepo.d.ts +11 -9
  127. package/dist/CacheService/repos/CommentRepo.d.ts.map +1 -1
  128. package/dist/CacheService/repos/CommentRepo.js +27 -29
  129. package/dist/CacheService/repos/CommentRepo.js.map +1 -1
  130. package/dist/CacheService/repos/NotificationRepo.d.ts +36 -34
  131. package/dist/CacheService/repos/NotificationRepo.d.ts.map +1 -1
  132. package/dist/CacheService/repos/NotificationRepo.js +92 -94
  133. package/dist/CacheService/repos/NotificationRepo.js.map +1 -1
  134. package/dist/CacheService/repos/PullRequestRepo/index.d.ts +129 -127
  135. package/dist/CacheService/repos/PullRequestRepo/index.d.ts.map +1 -1
  136. package/dist/CacheService/repos/PullRequestRepo/index.js +18 -19
  137. package/dist/CacheService/repos/PullRequestRepo/index.js.map +1 -1
  138. package/dist/CacheService/repos/PullRequestRepo/internal.d.ts +51 -54
  139. package/dist/CacheService/repos/PullRequestRepo/internal.d.ts.map +1 -1
  140. package/dist/CacheService/repos/PullRequestRepo/internal.js +22 -19
  141. package/dist/CacheService/repos/PullRequestRepo/internal.js.map +1 -1
  142. package/dist/CacheService/repos/PullRequestRepo/mutations.d.ts +1 -1
  143. package/dist/CacheService/repos/PullRequestRepo/mutations.d.ts.map +1 -1
  144. package/dist/CacheService/repos/PullRequestRepo/mutations.js +20 -4
  145. package/dist/CacheService/repos/PullRequestRepo/mutations.js.map +1 -1
  146. package/dist/CacheService/repos/PullRequestRepo/queries.d.ts +108 -108
  147. package/dist/CacheService/repos/PullRequestRepo/queries.d.ts.map +1 -1
  148. package/dist/CacheService/repos/PullRequestRepo/queries.js +11 -3
  149. package/dist/CacheService/repos/PullRequestRepo/queries.js.map +1 -1
  150. package/dist/CacheService/repos/SandboxRepo.d.ts +97 -95
  151. package/dist/CacheService/repos/SandboxRepo.d.ts.map +1 -1
  152. package/dist/CacheService/repos/SandboxRepo.js +47 -48
  153. package/dist/CacheService/repos/SandboxRepo.js.map +1 -1
  154. package/dist/CacheService/repos/StatsRepo/index.d.ts +65 -63
  155. package/dist/CacheService/repos/StatsRepo/index.d.ts.map +1 -1
  156. package/dist/CacheService/repos/StatsRepo/index.js +24 -25
  157. package/dist/CacheService/repos/StatsRepo/index.js.map +1 -1
  158. package/dist/CacheService/repos/StatsRepo/internal.d.ts +8 -13
  159. package/dist/CacheService/repos/StatsRepo/internal.d.ts.map +1 -1
  160. package/dist/CacheService/repos/StatsRepo/internal.js +11 -4
  161. package/dist/CacheService/repos/StatsRepo/internal.js.map +1 -1
  162. package/dist/CacheService/repos/StatsRepo/queries.d.ts +1 -1
  163. package/dist/CacheService/repos/StatsRepo/queries.d.ts.map +1 -1
  164. package/dist/CacheService/repos/StatsRepo/queries.js +8 -0
  165. package/dist/CacheService/repos/StatsRepo/queries.js.map +1 -1
  166. package/dist/CacheService/repos/StatsRepo/reviewerData.d.ts +1 -1
  167. package/dist/CacheService/repos/StatsRepo/reviewerData.d.ts.map +1 -1
  168. package/dist/CacheService/repos/StatsRepo/reviewerData.js +13 -3
  169. package/dist/CacheService/repos/StatsRepo/reviewerData.js.map +1 -1
  170. package/dist/CacheService/repos/SubscriptionRepo.d.ts +16 -14
  171. package/dist/CacheService/repos/SubscriptionRepo.d.ts.map +1 -1
  172. package/dist/CacheService/repos/SubscriptionRepo.js +36 -37
  173. package/dist/CacheService/repos/SubscriptionRepo.js.map +1 -1
  174. package/dist/CacheService/repos/SyncMetadataRepo.d.ts +11 -9
  175. package/dist/CacheService/repos/SyncMetadataRepo.d.ts.map +1 -1
  176. package/dist/CacheService/repos/SyncMetadataRepo.js +22 -23
  177. package/dist/CacheService/repos/SyncMetadataRepo.js.map +1 -1
  178. package/dist/CacheService/repos/commentLocations.d.ts +12 -0
  179. package/dist/CacheService/repos/commentLocations.d.ts.map +1 -0
  180. package/dist/CacheService/repos/commentLocations.js +7 -0
  181. package/dist/CacheService/repos/commentLocations.js.map +1 -0
  182. package/dist/ConfigService/backup.d.ts +1 -1
  183. package/dist/ConfigService/backup.d.ts.map +1 -1
  184. package/dist/ConfigService/backup.js +1 -1
  185. package/dist/ConfigService/backup.js.map +1 -1
  186. package/dist/ConfigService/detectProfiles.d.ts +2 -1
  187. package/dist/ConfigService/detectProfiles.d.ts.map +1 -1
  188. package/dist/ConfigService/detectProfiles.js +3 -2
  189. package/dist/ConfigService/detectProfiles.js.map +1 -1
  190. package/dist/ConfigService/index.d.ts +10 -11
  191. package/dist/ConfigService/index.d.ts.map +1 -1
  192. package/dist/ConfigService/index.js +13 -6
  193. package/dist/ConfigService/index.js.map +1 -1
  194. package/dist/ConfigService/internal.d.ts +41 -137
  195. package/dist/ConfigService/internal.d.ts.map +1 -1
  196. package/dist/ConfigService/internal.js +35 -20
  197. package/dist/ConfigService/internal.js.map +1 -1
  198. package/dist/ConfigService/load.d.ts +25 -28
  199. package/dist/ConfigService/load.d.ts.map +1 -1
  200. package/dist/ConfigService/load.js +11 -28
  201. package/dist/ConfigService/load.js.map +1 -1
  202. package/dist/ConfigService/reset.d.ts +26 -5
  203. package/dist/ConfigService/reset.d.ts.map +1 -1
  204. package/dist/ConfigService/reset.js +9 -16
  205. package/dist/ConfigService/reset.js.map +1 -1
  206. package/dist/ConfigService/save.d.ts +2 -1
  207. package/dist/ConfigService/save.d.ts.map +1 -1
  208. package/dist/ConfigService/save.js +2 -1
  209. package/dist/ConfigService/save.js.map +1 -1
  210. package/dist/ConfigService/validate.d.ts +6 -20
  211. package/dist/ConfigService/validate.d.ts.map +1 -1
  212. package/dist/ConfigService/validate.js +10 -11
  213. package/dist/ConfigService/validate.js.map +1 -1
  214. package/dist/Domain.d.ts +130 -324
  215. package/dist/Domain.d.ts.map +1 -1
  216. package/dist/Domain.js +77 -20
  217. package/dist/Domain.js.map +1 -1
  218. package/dist/Errors.d.ts +45 -65
  219. package/dist/Errors.d.ts.map +1 -1
  220. package/dist/Errors.js +20 -20
  221. package/dist/Errors.js.map +1 -1
  222. package/dist/PRService/index.d.ts +36 -33
  223. package/dist/PRService/index.d.ts.map +1 -1
  224. package/dist/PRService/index.js +44 -45
  225. package/dist/PRService/index.js.map +1 -1
  226. package/dist/PRService/internal.d.ts +86 -118
  227. package/dist/PRService/internal.d.ts.map +1 -1
  228. package/dist/PRService/internal.js +28 -25
  229. package/dist/PRService/internal.js.map +1 -1
  230. package/dist/PRService/refresh.d.ts +1 -1
  231. package/dist/PRService/refresh.d.ts.map +1 -1
  232. package/dist/PRService/refresh.js +4 -4
  233. package/dist/PRService/refresh.js.map +1 -1
  234. package/dist/PRService/refreshDiffs.d.ts +1 -1
  235. package/dist/PRService/refreshDiffs.d.ts.map +1 -1
  236. package/dist/PRService/refreshDiffs.js +3 -3
  237. package/dist/PRService/refreshDiffs.js.map +1 -1
  238. package/dist/PRService/refreshEnrich.d.ts +1 -5
  239. package/dist/PRService/refreshEnrich.d.ts.map +1 -1
  240. package/dist/PRService/refreshEnrich.js +9 -9
  241. package/dist/PRService/refreshEnrich.js.map +1 -1
  242. package/dist/PRService/refreshFetch.d.ts +1 -5
  243. package/dist/PRService/refreshFetch.d.ts.map +1 -1
  244. package/dist/PRService/refreshFetch.js +10 -10
  245. package/dist/PRService/refreshFetch.js.map +1 -1
  246. package/dist/PRService/refreshHistory.d.ts +1 -1
  247. package/dist/PRService/refreshHistory.d.ts.map +1 -1
  248. package/dist/PRService/refreshHistory.js +8 -8
  249. package/dist/PRService/refreshHistory.js.map +1 -1
  250. package/dist/PRService/refreshResolve.d.ts +6 -6
  251. package/dist/PRService/refreshResolve.d.ts.map +1 -1
  252. package/dist/PRService/refreshResolve.js +6 -6
  253. package/dist/PRService/refreshResolve.js.map +1 -1
  254. package/dist/PRService/refreshScore.d.ts +1 -2
  255. package/dist/PRService/refreshScore.d.ts.map +1 -1
  256. package/dist/PRService/refreshScore.js +5 -5
  257. package/dist/PRService/refreshScore.js.map +1 -1
  258. package/dist/PRService/refreshSinglePR.d.ts +4 -1
  259. package/dist/PRService/refreshSinglePR.d.ts.map +1 -1
  260. package/dist/PRService/refreshSinglePR.js +92 -82
  261. package/dist/PRService/refreshSinglePR.js.map +1 -1
  262. package/dist/PermissionService/AuditLog.d.ts +30 -32
  263. package/dist/PermissionService/AuditLog.d.ts.map +1 -1
  264. package/dist/PermissionService/AuditLog.js +89 -90
  265. package/dist/PermissionService/AuditLog.js.map +1 -1
  266. package/dist/PermissionService/PermissionGate.d.ts +8 -21
  267. package/dist/PermissionService/PermissionGate.d.ts.map +1 -1
  268. package/dist/PermissionService/PermissionGate.js +2 -2
  269. package/dist/PermissionService/PermissionGate.js.map +1 -1
  270. package/dist/PermissionService/PermissionGateLive.d.ts +7 -11
  271. package/dist/PermissionService/PermissionGateLive.d.ts.map +1 -1
  272. package/dist/PermissionService/PermissionGateLive.js +49 -49
  273. package/dist/PermissionService/PermissionGateLive.js.map +1 -1
  274. package/dist/PermissionService/index.d.ts +17 -17
  275. package/dist/PermissionService/index.d.ts.map +1 -1
  276. package/dist/PermissionService/index.js +50 -50
  277. package/dist/PermissionService/index.js.map +1 -1
  278. package/dist/SandboxService/DockerService.d.ts +22 -19
  279. package/dist/SandboxService/DockerService.d.ts.map +1 -1
  280. package/dist/SandboxService/DockerService.js +71 -70
  281. package/dist/SandboxService/DockerService.js.map +1 -1
  282. package/dist/SandboxService/PluginService.d.ts +11 -8
  283. package/dist/SandboxService/PluginService.d.ts.map +1 -1
  284. package/dist/SandboxService/PluginService.js +16 -16
  285. package/dist/SandboxService/PluginService.js.map +1 -1
  286. package/dist/SandboxService/SandboxService.d.ts +78 -76
  287. package/dist/SandboxService/SandboxService.d.ts.map +1 -1
  288. package/dist/SandboxService/SandboxService.js +235 -226
  289. package/dist/SandboxService/SandboxService.js.map +1 -1
  290. package/dist/SandboxService/index.d.ts +0 -1
  291. package/dist/SandboxService/index.d.ts.map +1 -1
  292. package/dist/SandboxService/index.js +0 -1
  293. package/dist/SandboxService/index.js.map +1 -1
  294. package/dist/StatsService/WeeklyStats.d.ts +112 -112
  295. package/dist/StatsService/index.d.ts +3 -8
  296. package/dist/StatsService/index.d.ts.map +1 -1
  297. package/dist/StatsService/index.js +113 -112
  298. package/dist/StatsService/index.js.map +1 -1
  299. package/dist/index.d.ts +1 -2
  300. package/dist/index.d.ts.map +1 -1
  301. package/dist/index.js +1 -2
  302. package/dist/index.js.map +1 -1
  303. package/package.json +6 -12
  304. package/dist/SandboxService/plugins/ClaudeCodePlugin.d.ts +0 -18
  305. package/dist/SandboxService/plugins/ClaudeCodePlugin.d.ts.map +0 -1
  306. package/dist/SandboxService/plugins/ClaudeCodePlugin.js +0 -24
  307. package/dist/SandboxService/plugins/ClaudeCodePlugin.js.map +0 -1
@@ -5,79 +5,80 @@
5
5
  *
6
6
  * @module
7
7
  */
8
- import { Command, CommandExecutor } from "@effect/platform";
9
- import { Effect } from "effect";
8
+ import { Context, Effect, Layer } from "effect";
9
+ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
10
10
  import { DockerError } from "../Errors.js";
11
- const dockerError = (operation) => (effect) => effect.pipe(Effect.mapError((cause) => new DockerError({ operation, cause })), Effect.withSpan(`DockerService.${operation}`, { captureStackTrace: false }));
11
+ const dockerError = (operation) => (effect) => effect.pipe(Effect.mapError((cause) => new DockerError({ operation, cause })), Effect.withSpan(`DockerService.${operation}`));
12
12
  const shellEscape = (s) => `'${s.replace(/'/g, "'\\''")}'`;
13
- const run = (...args) => Command.make("sh", "-c", `docker ${args.map(shellEscape).join(" ")} 2>&1`).pipe(Command.string);
14
- export class DockerService extends Effect.Service()("DockerService", {
15
- effect: Effect.gen(function* () {
16
- const executor = yield* CommandExecutor.CommandExecutor;
17
- const docker = (...args) => run(...args).pipe(Effect.provideService(CommandExecutor.CommandExecutor, executor));
18
- return {
19
- isAvailable: () => docker("info").pipe(Effect.map(() => true), Effect.catchAll(() => Effect.succeed(false))),
20
- pullImage: (image) => docker("pull", image).pipe(Effect.asVoid, dockerError("pullImage")),
21
- createContainer: (config) => {
22
- const args = ["create"];
23
- // Port bindings
24
- for (const [containerPort, bindings] of Object.entries(config.HostConfig.PortBindings)) {
25
- for (const b of bindings) {
26
- args.push("-p", `${b.HostPort}:${containerPort.replace("/tcp", "")}`);
27
- }
13
+ const makeDockerService = Effect.gen(function* () {
14
+ const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
15
+ const docker = (...args) => spawner.string(ChildProcess.make("sh", ["-c", `docker ${args.map(shellEscape).join(" ")} 2>&1`]));
16
+ return {
17
+ isAvailable: () => docker("info").pipe(Effect.map(() => true), Effect.catchIf(() => true, () => Effect.succeed(false))),
18
+ pullImage: (image) => docker("pull", image).pipe(Effect.asVoid, dockerError("pullImage")),
19
+ createContainer: (config) => {
20
+ const args = ["create"];
21
+ // Port bindings
22
+ for (const [containerPort, bindings] of Object.entries(config.HostConfig.PortBindings)) {
23
+ for (const b of bindings) {
24
+ args.push("-p", `${b.HostPort}:${containerPort.replace("/tcp", "")}`);
28
25
  }
29
- // Volume binds
30
- for (const bind of config.HostConfig.Binds) {
31
- args.push("-v", bind);
32
- }
33
- // Network mode
34
- if (config.HostConfig.NetworkMode) {
35
- args.push("--network", config.HostConfig.NetworkMode);
36
- }
37
- // Env vars
38
- for (const env of config.Env ?? []) {
39
- args.push("-e", env);
40
- }
41
- // Labels
42
- for (const [k, v] of Object.entries(config.Labels ?? {})) {
43
- args.push("-l", `${k}=${v}`);
44
- }
45
- // Image + command
46
- args.push(config.Image);
47
- for (const c of config.Cmd)
48
- args.push(c);
49
- return docker(...args).pipe(dockerError("createContainer"));
26
+ }
27
+ // Volume binds
28
+ for (const bind of config.HostConfig.Binds) {
29
+ args.push("-v", bind);
30
+ }
31
+ // Network mode
32
+ if (config.HostConfig.NetworkMode) {
33
+ args.push("--network", config.HostConfig.NetworkMode);
34
+ }
35
+ // Env vars
36
+ for (const env of config.Env ?? []) {
37
+ args.push("-e", env);
38
+ }
39
+ // Labels
40
+ for (const [k, v] of Object.entries(config.Labels ?? {})) {
41
+ args.push("-l", `${k}=${v}`);
42
+ }
43
+ // Image + command
44
+ args.push(config.Image);
45
+ for (const c of config.Cmd)
46
+ args.push(c);
47
+ return docker(...args).pipe(dockerError("createContainer"));
48
+ },
49
+ startContainer: (containerId) => docker("start", containerId).pipe(Effect.asVoid, dockerError("startContainer")),
50
+ stopContainer: (containerId, timeout = 10) => docker("stop", "-t", String(timeout), containerId).pipe(Effect.asVoid, dockerError("stopContainer")),
51
+ removeContainer: (containerId) => docker("rm", "-f", containerId).pipe(Effect.asVoid, dockerError("removeContainer")),
52
+ inspectContainer: (containerId) => docker("inspect", containerId).pipe(dockerError("inspectContainer"), Effect.flatMap((output) => Effect.try({
53
+ try: () => {
54
+ const arr = JSON.parse(output);
55
+ if (arr.length === 0)
56
+ return undefined;
57
+ return arr[0];
58
+ },
59
+ catch: (cause) => new DockerError({ operation: "inspectContainer", cause })
60
+ })), Effect.flatMap((containerInfo) => containerInfo === undefined
61
+ ? Effect.fail(new DockerError({ operation: "inspectContainer", cause: "Empty inspect result" }))
62
+ : Effect.succeed(containerInfo))),
63
+ exec: (containerId, cmd) => docker("exec", containerId, ...cmd).pipe(dockerError("exec")),
64
+ listContainersByLabel: (label, value) => docker("ps", "-a", "--filter", `label=${label}=${value}`, "--format", "{{json .}}").pipe(dockerError("listContainersByLabel"), Effect.flatMap((output) => Effect.try({
65
+ try: () => {
66
+ if (!output)
67
+ return [];
68
+ return output.split("\n").map((line) => {
69
+ const obj = JSON.parse(line);
70
+ return {
71
+ Id: obj.ID,
72
+ State: obj.State,
73
+ Labels: Object.fromEntries(obj.Labels.split(",").map((l) => l.split("=")))
74
+ };
75
+ });
50
76
  },
51
- startContainer: (containerId) => docker("start", containerId).pipe(Effect.asVoid, dockerError("startContainer")),
52
- stopContainer: (containerId, timeout = 10) => docker("stop", "-t", String(timeout), containerId).pipe(Effect.asVoid, dockerError("stopContainer")),
53
- removeContainer: (containerId) => docker("rm", "-f", containerId).pipe(Effect.asVoid, dockerError("removeContainer")),
54
- inspectContainer: (containerId) => docker("inspect", containerId).pipe(Effect.flatMap((output) => Effect.try({
55
- try: () => {
56
- const arr = JSON.parse(output);
57
- if (arr.length === 0)
58
- throw new Error("Empty inspect result");
59
- return arr[0];
60
- },
61
- catch: (e) => e
62
- })), dockerError("inspectContainer")),
63
- exec: (containerId, cmd) => docker("exec", containerId, ...cmd).pipe(dockerError("exec")),
64
- listContainersByLabel: (label, value) => docker("ps", "-a", "--filter", `label=${label}=${value}`, "--format", "{{json .}}").pipe(Effect.flatMap((output) => Effect.try({
65
- try: () => {
66
- if (!output)
67
- return [];
68
- return output.split("\n").map((line) => {
69
- const obj = JSON.parse(line);
70
- return {
71
- Id: obj.ID,
72
- State: obj.State,
73
- Labels: Object.fromEntries(obj.Labels.split(",").map((l) => l.split("=")))
74
- };
75
- });
76
- },
77
- catch: (e) => e
78
- })), dockerError("listContainersByLabel"))
79
- };
80
- })
81
- }) {
77
+ catch: (cause) => new DockerError({ operation: "listContainersByLabel", cause })
78
+ })))
79
+ };
80
+ });
81
+ export class DockerService extends Context.Service()("DockerService") {
82
+ static Default = Layer.effect(DockerService, makeDockerService);
82
83
  }
83
84
  //# sourceMappingURL=DockerService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DockerService.js","sourceRoot":"","sources":["../../src/SandboxService/DockerService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AA0B1C,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAU,MAA8B,EAAE,EAAE,CACrF,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,I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;YACT,GAAG,EAAE,GAAG,EAAE;gBACR,IAAI,CAAC,MAAM;oBAAE,OAAO,EAA0E,CAAA;gBAC9F,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBACrC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAkD,CAAA;oBAC7E,OAAO;wBACL,EAAE,EAAE,GAAG,CAAC,EAAE;wBACV,KAAK,EAAE,GAAG,CAAC,KAAK;wBAChB,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;qBAC3E,CAAA;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;YACD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC;SACjF,CAAC,CACH,CACF;KACK,CAAA;AACZ,CAAC,CAAC,CAAA;AAIF,MAAM,OAAO,aAAc,SAAQ,OAAO,CAAC,OAAO,EAG/C,CAAC,eAAe,CAAC;IAClB,MAAM,CAAU,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAA"}
@@ -6,7 +6,8 @@
6
6
  *
7
7
  * @module
8
8
  */
9
- import { Effect } from "effect";
9
+ import { Context, Effect, Layer } from "effect";
10
+ import type { Success } from "effect/Effect";
10
11
  import type { PullRequestId, RepositoryName, SandboxId } from "../Domain.js";
11
12
  export interface SandboxContext {
12
13
  readonly sandboxId: SandboxId;
@@ -25,14 +26,16 @@ export interface SandboxPlugin {
25
26
  readonly onSandboxReady?: (ctx: SandboxContext) => Effect.Effect<void>;
26
27
  readonly onSandboxDestroy?: (ctx: SandboxContext) => Effect.Effect<void>;
27
28
  }
28
- declare const PluginService_base: Effect.Service.Class<PluginService, "PluginService", {
29
- readonly effect: Effect.Effect<{
30
- readonly register: (plugin: SandboxPlugin) => Effect.Effect<void, never, never>;
31
- readonly executeHook: (hook: "onSandboxCreate" | "onSandboxReady" | "onSandboxDestroy", ctx: SandboxContext) => Effect.Effect<void, never, never>;
32
- readonly listPlugins: () => Effect.Effect<string[], never, never>;
33
- }, never, never>;
34
- }>;
29
+ declare const makePluginService: Effect.Effect<{
30
+ readonly register: (plugin: SandboxPlugin) => Effect.Effect<void, never, never>;
31
+ readonly executeHook: (hook: "onSandboxCreate" | "onSandboxReady" | "onSandboxDestroy", ctx: SandboxContext) => Effect.Effect<void, never, never>;
32
+ readonly listPlugins: () => Effect.Effect<string[], never, never>;
33
+ }, never, never>;
34
+ export interface PluginServiceShape extends Success<typeof makePluginService> {
35
+ }
36
+ declare const PluginService_base: Context.ServiceClass<PluginService, "PluginService", PluginServiceShape>;
35
37
  export declare class PluginService extends PluginService_base {
38
+ static readonly Default: Layer.Layer<PluginService, never, never>;
36
39
  }
37
40
  export {};
38
41
  //# sourceMappingURL=PluginService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PluginService.d.ts","sourceRoot":"","sources":["../../src/SandboxService/PluginService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAO,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE5E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,EAAE;QACX,QAAQ,CAAC,EAAE,EAAE,aAAa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AAQ,CAAC,cAAc,EAAE,cAAc,CAAA;QACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;KAC9B,CAAA;CACF;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACtE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CACzE;AAED,QAAA,MAAM,iBAAiB;gCAIA,aAAa;iCAKZ,iBAAiB,GAAG,gBAAgB,GAAG,kBAAkB,OAAO,cAAc;;gBAgBpG,CAAA;AAEF,MAAM,WAAW,kBAAmB,SAAQ,OAAO,CAAC,OAAO,iBAAiB,CAAC;CAAG;;AAEhF,qBAAa,aAAc,SAAQ,kBAGf;IAClB,MAAM,CAAC,QAAQ,CAAC,OAAO,2CAAiD;CACzE"}
@@ -6,21 +6,21 @@
6
6
  *
7
7
  * @module
8
8
  */
9
- import { Effect, Ref } from "effect";
10
- export class PluginService extends Effect.Service()("PluginService", {
11
- effect: Effect.gen(function* () {
12
- const plugins = yield* Ref.make([]);
13
- return {
14
- register: (plugin) => Ref.update(plugins, (ps) => [...ps, plugin]).pipe(Effect.tap(() => Effect.logInfo(`Plugin registered: ${plugin.name}`))),
15
- executeHook: (hook, ctx) => Ref.get(plugins).pipe(Effect.flatMap((ps) => Effect.forEach(ps, (p) => {
16
- const fn = p[hook];
17
- if (!fn)
18
- return Effect.void;
19
- return fn(ctx).pipe(Effect.catchAllCause((cause) => Effect.logWarning(`Plugin ${p.name} ${hook} failed`, cause)));
20
- }, { discard: true })), Effect.withSpan(`PluginService.${hook}`, { captureStackTrace: false })),
21
- listPlugins: () => Ref.get(plugins).pipe(Effect.map((ps) => ps.map((p) => p.name)))
22
- };
23
- })
24
- }) {
9
+ import { Context, Effect, Layer, Ref } from "effect";
10
+ const makePluginService = Effect.gen(function* () {
11
+ const plugins = yield* Ref.make([]);
12
+ return {
13
+ register: (plugin) => Ref.update(plugins, (ps) => [...ps, plugin]).pipe(Effect.tap(() => Effect.logInfo(`Plugin registered: ${plugin.name}`))),
14
+ executeHook: (hook, ctx) => Ref.get(plugins).pipe(Effect.flatMap((ps) => Effect.forEach(ps, (p) => {
15
+ const fn = p[hook];
16
+ if (!fn)
17
+ return Effect.void;
18
+ return fn(ctx).pipe(Effect.catchCause((cause) => Effect.logWarning(`Plugin ${p.name} ${hook} failed`, cause)));
19
+ }, { discard: true })), Effect.withSpan(`PluginService.${hook}`)),
20
+ listPlugins: () => Ref.get(plugins).pipe(Effect.map((ps) => ps.map((p) => p.name)))
21
+ };
22
+ });
23
+ export class PluginService extends Context.Service()("PluginService") {
24
+ static Default = Layer.effect(PluginService, makePluginService);
25
25
  }
26
26
  //# sourceMappingURL=PluginService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PluginService.js","sourceRoot":"","sources":["../../src/SandboxService/PluginService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAsBpC,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,OAAO,EAAiB,CAAC,eAAe,EAAE;IAClF,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAA+B,EAAE,CAAC,CAAA;QAEjE,OAAO;YACL,QAAQ,EAAE,CAAC,MAAqB,EAAE,EAAE,CAClC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,EAA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CAAC,QAAQ,CAAC,iBAAiB,IAAI,EAAE,CAAC,CACzC;QAEH,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;KAC3E,CAAA;AACZ,CAAC,CAAC,CAAA;AAIF,MAAM,OAAO,aAAc,SAAQ,OAAO,CAAC,OAAO,EAG/C,CAAC,eAAe,CAAC;IAClB,MAAM,CAAU,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAA"}
@@ -6,8 +6,9 @@
6
6
  *
7
7
  * @module
8
8
  */
9
- import { FileSystem } from "@effect/platform";
10
- import { Duration, Effect } from "effect";
9
+ import { Config, Context, Duration, Effect, Layer } from "effect";
10
+ import type { Success } from "effect/Effect";
11
+ import * as FileSystem from "effect/FileSystem";
11
12
  import { SandboxRepo } from "../CacheService/repos/SandboxRepo.js";
12
13
  import { ConfigService } from "../ConfigService/index.js";
13
14
  import { SandboxId } from "../Domain.js";
@@ -22,81 +23,82 @@ export interface CreateSandboxParams {
22
23
  readonly profile: string;
23
24
  readonly region: string;
24
25
  }
25
- declare const SandboxService_base: Effect.Service.Class<SandboxService, "SandboxService", {
26
- readonly dependencies: readonly [import("effect/Layer").Layer<SandboxRepo, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError, FileSystem.FileSystem>, import("effect/Layer").Layer<DockerService, never, import("@effect/platform/CommandExecutor").CommandExecutor>, import("effect/Layer").Layer<PluginService, never, never>];
27
- readonly effect: Effect.Effect<{
28
- readonly create: (params: CreateSandboxParams) => Effect.Effect<{
29
- readonly error: string | null;
30
- readonly awsAccountId: string;
31
- readonly id: string;
32
- readonly repositoryName: string;
33
- readonly status: string;
34
- readonly sourceBranch: string;
35
- readonly pullRequestId: string;
36
- readonly workspacePath: string;
37
- readonly createdAt: string;
38
- readonly lastActivityAt: string;
39
- readonly containerId: string | null;
40
- readonly port: number | null;
41
- readonly statusDetail: string | null;
42
- readonly logs: string | null;
43
- }, SandboxError, FileSystem.FileSystem | import("effect/Scope").Scope | import("@effect/platform/CommandExecutor").CommandExecutor>;
44
- readonly get: (id: SandboxId) => Effect.Effect<{
45
- readonly error: string | null;
46
- readonly awsAccountId: string;
47
- readonly id: string;
48
- readonly repositoryName: string;
49
- readonly status: string;
50
- readonly sourceBranch: string;
51
- readonly pullRequestId: string;
52
- readonly workspacePath: string;
53
- readonly createdAt: string;
54
- readonly lastActivityAt: string;
55
- readonly containerId: string | null;
56
- readonly port: number | null;
57
- readonly statusDetail: string | null;
58
- readonly logs: string | null;
59
- }, SandboxError, never>;
60
- readonly list: () => Effect.Effect<readonly {
61
- readonly error: string | null;
62
- readonly awsAccountId: string;
63
- readonly id: string;
64
- readonly repositoryName: string;
65
- readonly status: string;
66
- readonly sourceBranch: string;
67
- readonly pullRequestId: string;
68
- readonly workspacePath: string;
69
- readonly createdAt: string;
70
- readonly lastActivityAt: string;
71
- readonly containerId: string | null;
72
- readonly port: number | null;
73
- readonly statusDetail: string | null;
74
- readonly logs: string | null;
75
- }[], import("../CacheService/CacheError.ts").CacheError, never>;
76
- readonly listAll: () => Effect.Effect<readonly {
77
- readonly error: string | null;
78
- readonly awsAccountId: string;
79
- readonly id: string;
80
- readonly repositoryName: string;
81
- readonly status: string;
82
- readonly sourceBranch: string;
83
- readonly pullRequestId: string;
84
- readonly workspacePath: string;
85
- readonly createdAt: string;
86
- readonly lastActivityAt: string;
87
- readonly containerId: string | null;
88
- readonly port: number | null;
89
- readonly statusDetail: string | null;
90
- readonly logs: string | null;
91
- }[], import("../CacheService/CacheError.ts").CacheError, never>;
92
- readonly stop: (id: SandboxId) => Effect.Effect<void, SandboxError, never>;
93
- readonly restart: (id: SandboxId) => Effect.Effect<undefined, SandboxError, never>;
94
- readonly cleanup: (id: SandboxId) => Effect.Effect<void, SandboxError, FileSystem.FileSystem>;
95
- readonly reconcile: () => Effect.Effect<void, never, never>;
96
- readonly gcIdle: (idleTimeout?: Duration.Duration, cleanupDelay?: Duration.Duration) => Effect.Effect<void, never, FileSystem.FileSystem>;
97
- }, never, SandboxRepo | ConfigService | DockerService | PluginService>;
98
- }>;
26
+ declare const makeSandboxService: Effect.Effect<{
27
+ readonly create: (params: CreateSandboxParams) => Effect.Effect<import("effect/Schema").Struct.ReadonlySide<{
28
+ readonly id: import("effect/Schema").String;
29
+ readonly pullRequestId: import("effect/Schema").String;
30
+ readonly awsAccountId: import("effect/Schema").String;
31
+ readonly repositoryName: import("effect/Schema").String;
32
+ readonly sourceBranch: import("effect/Schema").String;
33
+ readonly containerId: import("effect/Schema").NullOr<import("effect/Schema").String>;
34
+ readonly port: import("effect/Schema").NullOr<import("effect/Schema").Number>;
35
+ readonly workspacePath: import("effect/Schema").String;
36
+ readonly status: import("effect/Schema").String;
37
+ readonly statusDetail: import("effect/Schema").NullOr<import("effect/Schema").String>;
38
+ readonly logs: import("effect/Schema").NullOr<import("effect/Schema").String>;
39
+ readonly error: import("effect/Schema").NullOr<import("effect/Schema").String>;
40
+ readonly createdAt: import("effect/Schema").String;
41
+ readonly lastActivityAt: import("effect/Schema").String;
42
+ }, "Type">, SandboxError, FileSystem.FileSystem | import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner>;
43
+ readonly get: (id: SandboxId) => Effect.Effect<import("effect/Schema").Struct.ReadonlySide<{
44
+ readonly id: import("effect/Schema").String;
45
+ readonly pullRequestId: import("effect/Schema").String;
46
+ readonly awsAccountId: import("effect/Schema").String;
47
+ readonly repositoryName: import("effect/Schema").String;
48
+ readonly sourceBranch: import("effect/Schema").String;
49
+ readonly containerId: import("effect/Schema").NullOr<import("effect/Schema").String>;
50
+ readonly port: import("effect/Schema").NullOr<import("effect/Schema").Number>;
51
+ readonly workspacePath: import("effect/Schema").String;
52
+ readonly status: import("effect/Schema").String;
53
+ readonly statusDetail: import("effect/Schema").NullOr<import("effect/Schema").String>;
54
+ readonly logs: import("effect/Schema").NullOr<import("effect/Schema").String>;
55
+ readonly error: import("effect/Schema").NullOr<import("effect/Schema").String>;
56
+ readonly createdAt: import("effect/Schema").String;
57
+ readonly lastActivityAt: import("effect/Schema").String;
58
+ }, "Type">, SandboxError, never>;
59
+ readonly list: () => Effect.Effect<import("effect/Schema").Struct.ReadonlySide<{
60
+ readonly id: import("effect/Schema").String;
61
+ readonly pullRequestId: import("effect/Schema").String;
62
+ readonly awsAccountId: import("effect/Schema").String;
63
+ readonly repositoryName: import("effect/Schema").String;
64
+ readonly sourceBranch: import("effect/Schema").String;
65
+ readonly containerId: import("effect/Schema").NullOr<import("effect/Schema").String>;
66
+ readonly port: import("effect/Schema").NullOr<import("effect/Schema").Number>;
67
+ readonly workspacePath: import("effect/Schema").String;
68
+ readonly status: import("effect/Schema").String;
69
+ readonly statusDetail: import("effect/Schema").NullOr<import("effect/Schema").String>;
70
+ readonly logs: import("effect/Schema").NullOr<import("effect/Schema").String>;
71
+ readonly error: import("effect/Schema").NullOr<import("effect/Schema").String>;
72
+ readonly createdAt: import("effect/Schema").String;
73
+ readonly lastActivityAt: import("effect/Schema").String;
74
+ }, "Type">[], import("../CacheService/CacheError.ts").CacheError, never>;
75
+ readonly listAll: () => Effect.Effect<import("effect/Schema").Struct.ReadonlySide<{
76
+ readonly id: import("effect/Schema").String;
77
+ readonly pullRequestId: import("effect/Schema").String;
78
+ readonly awsAccountId: import("effect/Schema").String;
79
+ readonly repositoryName: import("effect/Schema").String;
80
+ readonly sourceBranch: import("effect/Schema").String;
81
+ readonly containerId: import("effect/Schema").NullOr<import("effect/Schema").String>;
82
+ readonly port: import("effect/Schema").NullOr<import("effect/Schema").Number>;
83
+ readonly workspacePath: import("effect/Schema").String;
84
+ readonly status: import("effect/Schema").String;
85
+ readonly statusDetail: import("effect/Schema").NullOr<import("effect/Schema").String>;
86
+ readonly logs: import("effect/Schema").NullOr<import("effect/Schema").String>;
87
+ readonly error: import("effect/Schema").NullOr<import("effect/Schema").String>;
88
+ readonly createdAt: import("effect/Schema").String;
89
+ readonly lastActivityAt: import("effect/Schema").String;
90
+ }, "Type">[], import("../CacheService/CacheError.ts").CacheError, never>;
91
+ readonly stop: (id: SandboxId) => Effect.Effect<void, SandboxError, never>;
92
+ readonly restart: (id: SandboxId) => Effect.Effect<undefined, SandboxError, never>;
93
+ readonly cleanup: (id: SandboxId) => Effect.Effect<void, SandboxError, FileSystem.FileSystem>;
94
+ readonly reconcile: () => Effect.Effect<void, never, never>;
95
+ readonly gcIdle: (idleTimeout?: Duration.Duration, cleanupDelay?: Duration.Duration) => Effect.Effect<void, never, FileSystem.FileSystem>;
96
+ }, never, SandboxRepo | ConfigService | DockerService | PluginService>;
97
+ export interface SandboxServiceShape extends Success<typeof makeSandboxService> {
98
+ }
99
+ declare const SandboxService_base: Context.ServiceClass<SandboxService, "SandboxService", SandboxServiceShape>;
99
100
  export declare class SandboxService extends SandboxService_base {
101
+ static readonly Default: Layer.Layer<SandboxService, import("effect/PlatformError").PlatformError | import("effect/unstable/sql/SqlError").SqlError | Config.ConfigError | import("@effect/sql-libsql/LibsqlMigrator").MigrationError, FileSystem.FileSystem | ConfigService | import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner>;
100
102
  }
101
103
  export {};
102
104
  //# sourceMappingURL=SandboxService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxService.d.ts","sourceRoot":"","sources":["../../src/SandboxService/SandboxService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAW,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAwB,QAAQ,EAAE,MAAM,EAAoC,MAAM,QAAQ,CAAA;AACjG,OAAO,EAAE,WAAW,EAAmB,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAAE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