@elie-laloum/outpost 3.0.0 → 4.1.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 (411) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -3
  3. package/SECURITY.md +3 -1
  4. package/dist/adapters/agents/codex-adapter.js +2 -0
  5. package/dist/adapters/agents/codex-adapter.js.map +1 -1
  6. package/dist/adapters/agents/codex-provider.d.ts +2 -0
  7. package/dist/adapters/agents/codex-provider.js +32 -0
  8. package/dist/adapters/agents/codex-provider.js.map +1 -0
  9. package/dist/adapters/agents/codex-request.js +2 -1
  10. package/dist/adapters/agents/codex-request.js.map +1 -1
  11. package/dist/adapters/agents/gemini-adapter.d.ts +3 -0
  12. package/dist/adapters/agents/gemini-adapter.js +15 -0
  13. package/dist/adapters/agents/gemini-adapter.js.map +1 -0
  14. package/dist/adapters/agents/gemini-diagnostics.d.ts +2 -0
  15. package/dist/adapters/agents/gemini-diagnostics.js +15 -0
  16. package/dist/adapters/agents/gemini-diagnostics.js.map +1 -0
  17. package/dist/adapters/agents/gemini-events.d.ts +2 -0
  18. package/dist/adapters/agents/gemini-events.js +50 -0
  19. package/dist/adapters/agents/gemini-events.js.map +1 -0
  20. package/dist/adapters/agents/gemini-request.d.ts +4 -0
  21. package/dist/adapters/agents/gemini-request.js +23 -0
  22. package/dist/adapters/agents/gemini-request.js.map +1 -0
  23. package/dist/adapters/agents/gemini.types.d.ts +6 -0
  24. package/dist/adapters/agents/gemini.types.js +2 -0
  25. package/dist/adapters/agents/gemini.types.js.map +1 -0
  26. package/dist/adapters/agents/protocol-fixtures.constants.d.ts +1 -1
  27. package/dist/adapters/agents/protocol-fixtures.constants.js +37 -0
  28. package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -1
  29. package/dist/adapters/agents/settings.types.d.ts +5 -0
  30. package/dist/adapters/agents/settings.types.js.map +1 -1
  31. package/dist/application/agent-bootstrap.constants.d.ts +1 -0
  32. package/dist/application/agent-bootstrap.constants.js +1 -0
  33. package/dist/application/agent-bootstrap.constants.js.map +1 -1
  34. package/dist/application/agent-bootstrap.js +6 -2
  35. package/dist/application/agent-bootstrap.js.map +1 -1
  36. package/dist/application/agent-output.js +9 -2
  37. package/dist/application/agent-output.js.map +1 -1
  38. package/dist/application/artifact-tasks.d.ts +5 -0
  39. package/dist/application/artifact-tasks.js +31 -0
  40. package/dist/application/artifact-tasks.js.map +1 -0
  41. package/dist/application/artifact-tasks.types.d.ts +8 -0
  42. package/dist/application/artifact-tasks.types.js +2 -0
  43. package/dist/application/artifact-tasks.types.js.map +1 -0
  44. package/dist/application/dispatch-validation.js +2 -0
  45. package/dist/application/dispatch-validation.js.map +1 -1
  46. package/dist/application/doctor-agent.constants.d.ts +2 -0
  47. package/dist/application/doctor-agent.constants.js +2 -0
  48. package/dist/application/doctor-agent.constants.js.map +1 -1
  49. package/dist/application/doctor-agent.js +1 -1
  50. package/dist/application/doctor-agent.js.map +1 -1
  51. package/dist/application/doctor-protocol.js +2 -1
  52. package/dist/application/doctor-protocol.js.map +1 -1
  53. package/dist/application/doctor.constants.js +1 -1
  54. package/dist/application/doctor.constants.js.map +1 -1
  55. package/dist/application/doctor.types.d.ts +1 -1
  56. package/dist/application/doctor.types.js.map +1 -1
  57. package/dist/application/outpost.types.d.ts +2 -0
  58. package/dist/application/outpost.types.js.map +1 -1
  59. package/dist/application/queue-worker.d.ts +2 -0
  60. package/dist/application/queue-worker.js +75 -0
  61. package/dist/application/queue-worker.js.map +1 -0
  62. package/dist/application/queue-worker.types.d.ts +15 -0
  63. package/dist/application/queue-worker.types.js +2 -0
  64. package/dist/application/queue-worker.types.js.map +1 -0
  65. package/dist/application/queued-task.d.ts +3 -0
  66. package/dist/application/queued-task.js +56 -0
  67. package/dist/application/queued-task.js.map +1 -0
  68. package/dist/application/queued-task.types.d.ts +11 -0
  69. package/dist/application/queued-task.types.js +2 -0
  70. package/dist/application/queued-task.types.js.map +1 -0
  71. package/dist/application/recovery-inspection.js +5 -0
  72. package/dist/application/recovery-inspection.js.map +1 -1
  73. package/dist/application/recovery-inspection.types.d.ts +3 -0
  74. package/dist/application/recovery-inspection.types.js.map +1 -1
  75. package/dist/application/recovery-restore-snapshot.d.ts +2 -0
  76. package/dist/application/recovery-restore-snapshot.js +57 -0
  77. package/dist/application/recovery-restore-snapshot.js.map +1 -0
  78. package/dist/application/recovery-restore.d.ts +3 -0
  79. package/dist/application/recovery-restore.js +161 -0
  80. package/dist/application/recovery-restore.js.map +1 -0
  81. package/dist/application/recovery-restore.types.d.ts +28 -0
  82. package/dist/application/recovery-restore.types.js +2 -0
  83. package/dist/application/recovery-restore.types.js.map +1 -0
  84. package/dist/application/recovery-retention.js +5 -0
  85. package/dist/application/recovery-retention.js.map +1 -1
  86. package/dist/application/recovery-verification.d.ts +2 -1
  87. package/dist/application/recovery-verification.js +1 -1
  88. package/dist/application/recovery-verification.js.map +1 -1
  89. package/dist/application/remote-apply.js +6 -0
  90. package/dist/application/remote-apply.js.map +1 -1
  91. package/dist/application/remote-download.js +2 -2
  92. package/dist/application/remote-download.js.map +1 -1
  93. package/dist/application/remote-history.d.ts +6 -0
  94. package/dist/application/remote-history.js +114 -0
  95. package/dist/application/remote-history.js.map +1 -0
  96. package/dist/application/remote-upload.d.ts +2 -0
  97. package/dist/application/remote-upload.js +17 -0
  98. package/dist/application/remote-upload.js.map +1 -0
  99. package/dist/application/remote-validation.js +20 -28
  100. package/dist/application/remote-validation.js.map +1 -1
  101. package/dist/application/remote-workspace.js +4 -10
  102. package/dist/application/remote-workspace.js.map +1 -1
  103. package/dist/application/sandbox-activity.d.ts +3 -0
  104. package/dist/application/sandbox-activity.js +25 -0
  105. package/dist/application/sandbox-activity.js.map +1 -0
  106. package/dist/application/sandbox-provision.js +55 -10
  107. package/dist/application/sandbox-provision.js.map +1 -1
  108. package/dist/application/sandbox-session.types.d.ts +2 -0
  109. package/dist/application/sandbox-session.types.js.map +1 -1
  110. package/dist/application/sandbox.js +23 -11
  111. package/dist/application/sandbox.js.map +1 -1
  112. package/dist/application/speculation-host.d.ts +2 -0
  113. package/dist/application/speculation-host.js +30 -0
  114. package/dist/application/speculation-host.js.map +1 -0
  115. package/dist/application/speculation.constants.d.ts +4 -0
  116. package/dist/application/speculation.constants.js +2 -0
  117. package/dist/application/speculation.constants.js.map +1 -0
  118. package/dist/application/speculation.d.ts +2 -0
  119. package/dist/application/speculation.js +166 -0
  120. package/dist/application/speculation.js.map +1 -0
  121. package/dist/application/speculation.types.d.ts +56 -0
  122. package/dist/application/speculation.types.js +2 -0
  123. package/dist/application/speculation.types.js.map +1 -0
  124. package/dist/application/storage-reservation.d.ts +3 -0
  125. package/dist/application/storage-reservation.js +10 -0
  126. package/dist/application/storage-reservation.js.map +1 -0
  127. package/dist/application/storage-reservation.types.d.ts +4 -0
  128. package/dist/application/storage-reservation.types.js +2 -0
  129. package/dist/application/storage-reservation.types.js.map +1 -0
  130. package/dist/application/task-usage.d.ts +1 -1
  131. package/dist/application/task-usage.js.map +1 -1
  132. package/dist/application/tasks.js +1 -1
  133. package/dist/application/tasks.js.map +1 -1
  134. package/dist/application/tasks.types.d.ts +4 -3
  135. package/dist/application/tasks.types.js.map +1 -1
  136. package/dist/application/workspace-allocation.d.ts +3 -0
  137. package/dist/application/workspace-allocation.js +34 -0
  138. package/dist/application/workspace-allocation.js.map +1 -0
  139. package/dist/application/workspace.js +2 -2
  140. package/dist/application/workspace.js.map +1 -1
  141. package/dist/cli/commands.js +55 -18
  142. package/dist/cli/commands.js.map +1 -1
  143. package/dist/cli/doctor-command.js +1 -1
  144. package/dist/cli/doctor-command.js.map +1 -1
  145. package/dist/cli/init-authentication.constants.d.ts +13 -0
  146. package/dist/cli/init-authentication.constants.js +10 -0
  147. package/dist/cli/init-authentication.constants.js.map +1 -0
  148. package/dist/cli/init-authentication.d.ts +4 -0
  149. package/dist/cli/init-authentication.js +43 -0
  150. package/dist/cli/init-authentication.js.map +1 -0
  151. package/dist/cli/init-command.js +74 -15
  152. package/dist/cli/init-command.js.map +1 -1
  153. package/dist/cli/main.constants.d.ts +111 -2
  154. package/dist/cli/main.constants.js +148 -42
  155. package/dist/cli/main.constants.js.map +1 -1
  156. package/dist/cli/recovery-command.js +28 -4
  157. package/dist/cli/recovery-command.js.map +1 -1
  158. package/dist/cli/recovery-restore-command.d.ts +2 -0
  159. package/dist/cli/recovery-restore-command.js +34 -0
  160. package/dist/cli/recovery-restore-command.js.map +1 -0
  161. package/dist/cli/scaffold-files.js +3 -2
  162. package/dist/cli/scaffold-files.js.map +1 -1
  163. package/dist/cli/scaffold-validation.js +20 -1
  164. package/dist/cli/scaffold-validation.js.map +1 -1
  165. package/dist/cli/scaffold.constants.js +2 -2
  166. package/dist/cli/scaffold.constants.js.map +1 -1
  167. package/dist/cli/scaffold.js +13 -0
  168. package/dist/cli/scaffold.js.map +1 -1
  169. package/dist/cli/scaffold.types.d.ts +4 -1
  170. package/dist/cli/scaffold.types.js.map +1 -1
  171. package/dist/cli/starters.js +9 -2
  172. package/dist/cli/starters.js.map +1 -1
  173. package/dist/domain/agent.types.d.ts +2 -0
  174. package/dist/domain/agent.types.js.map +1 -1
  175. package/dist/domain/artifact-reference.d.ts +4 -0
  176. package/dist/domain/artifact-reference.js +90 -0
  177. package/dist/domain/artifact-reference.js.map +1 -0
  178. package/dist/domain/artifact.constants.d.ts +2 -0
  179. package/dist/domain/artifact.constants.js +3 -0
  180. package/dist/domain/artifact.constants.js.map +1 -0
  181. package/dist/domain/artifact.d.ts +7 -0
  182. package/dist/domain/artifact.js +104 -0
  183. package/dist/domain/artifact.js.map +1 -0
  184. package/dist/domain/artifact.types.d.ts +44 -0
  185. package/dist/domain/artifact.types.js +2 -0
  186. package/dist/domain/artifact.types.js.map +1 -0
  187. package/dist/domain/egress.constants.d.ts +1 -0
  188. package/dist/domain/egress.constants.js +7 -0
  189. package/dist/domain/egress.constants.js.map +1 -0
  190. package/dist/domain/egress.d.ts +2 -0
  191. package/dist/domain/egress.js +48 -0
  192. package/dist/domain/egress.js.map +1 -0
  193. package/dist/domain/egress.types.d.ts +8 -0
  194. package/dist/domain/egress.types.js +2 -0
  195. package/dist/domain/egress.types.js.map +1 -0
  196. package/dist/domain/sandbox.types.d.ts +1 -0
  197. package/dist/domain/sandbox.types.js.map +1 -1
  198. package/dist/domain/task-queue.constants.d.ts +8 -0
  199. package/dist/domain/task-queue.constants.js +9 -0
  200. package/dist/domain/task-queue.constants.js.map +1 -0
  201. package/dist/domain/task-queue.d.ts +11 -0
  202. package/dist/domain/task-queue.js +105 -0
  203. package/dist/domain/task-queue.js.map +1 -0
  204. package/dist/domain/task-queue.types.d.ts +41 -0
  205. package/dist/domain/task-queue.types.js +2 -0
  206. package/dist/domain/task-queue.types.js.map +1 -0
  207. package/dist/domain/workflow/budget.d.ts +2 -2
  208. package/dist/domain/workflow/budget.js +5 -3
  209. package/dist/domain/workflow/budget.js.map +1 -1
  210. package/dist/domain/workflow/checkpoint-validation.d.ts +3 -0
  211. package/dist/domain/workflow/checkpoint-validation.js +81 -0
  212. package/dist/domain/workflow/checkpoint-validation.js.map +1 -0
  213. package/dist/domain/workflow/checkpoint-value.d.ts +2 -0
  214. package/dist/domain/workflow/checkpoint-value.js +49 -0
  215. package/dist/domain/workflow/checkpoint-value.js.map +1 -0
  216. package/dist/domain/workflow/checkpoint.d.ts +3 -0
  217. package/dist/domain/workflow/checkpoint.js +70 -0
  218. package/dist/domain/workflow/checkpoint.js.map +1 -0
  219. package/dist/domain/workflow/checkpoint.types.d.ts +40 -0
  220. package/dist/domain/workflow/checkpoint.types.js +2 -0
  221. package/dist/domain/workflow/checkpoint.types.js.map +1 -0
  222. package/dist/domain/workflow/gate-validation.d.ts +4 -0
  223. package/dist/domain/workflow/gate-validation.js +71 -0
  224. package/dist/domain/workflow/gate-validation.js.map +1 -0
  225. package/dist/domain/workflow/gates.constants.d.ts +4 -0
  226. package/dist/domain/workflow/gates.constants.js +5 -0
  227. package/dist/domain/workflow/gates.constants.js.map +1 -0
  228. package/dist/domain/workflow/gates.d.ts +7 -0
  229. package/dist/domain/workflow/gates.js +85 -0
  230. package/dist/domain/workflow/gates.js.map +1 -0
  231. package/dist/domain/workflow/gates.types.d.ts +27 -0
  232. package/dist/domain/workflow/gates.types.js +2 -0
  233. package/dist/domain/workflow/gates.types.js.map +1 -0
  234. package/dist/domain/workflow/task-runner.js +14 -2
  235. package/dist/domain/workflow/task-runner.js.map +1 -1
  236. package/dist/domain/workflow/usage-receipt.constants.d.ts +2 -0
  237. package/dist/domain/workflow/usage-receipt.constants.js +3 -0
  238. package/dist/domain/workflow/usage-receipt.constants.js.map +1 -0
  239. package/dist/domain/workflow/usage-receipt.d.ts +2 -0
  240. package/dist/domain/workflow/usage-receipt.js +18 -0
  241. package/dist/domain/workflow/usage-receipt.js.map +1 -0
  242. package/dist/domain/workflow/validation.js +6 -0
  243. package/dist/domain/workflow/validation.js.map +1 -1
  244. package/dist/domain/workflow/workflow-scheduler.js +65 -32
  245. package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
  246. package/dist/domain/workflow/workflow-state.d.ts +2 -1
  247. package/dist/domain/workflow/workflow-state.js +91 -16
  248. package/dist/domain/workflow/workflow-state.js.map +1 -1
  249. package/dist/domain/workflow.types.d.ts +13 -2
  250. package/dist/domain/workflow.types.js.map +1 -1
  251. package/dist/index.d.ts +32 -2
  252. package/dist/index.js +14 -1
  253. package/dist/index.js.map +1 -1
  254. package/dist/infrastructure/artifact-store.constants.d.ts +1 -0
  255. package/dist/infrastructure/artifact-store.constants.js +2 -0
  256. package/dist/infrastructure/artifact-store.constants.js.map +1 -0
  257. package/dist/infrastructure/artifact-store.d.ts +3 -0
  258. package/dist/infrastructure/artifact-store.js +100 -0
  259. package/dist/infrastructure/artifact-store.js.map +1 -0
  260. package/dist/infrastructure/artifact-store.types.d.ts +4 -0
  261. package/dist/infrastructure/artifact-store.types.js +2 -0
  262. package/dist/infrastructure/artifact-store.types.js.map +1 -0
  263. package/dist/infrastructure/file-manifest.d.ts +1 -1
  264. package/dist/infrastructure/file-manifest.js +3 -2
  265. package/dist/infrastructure/file-manifest.js.map +1 -1
  266. package/dist/infrastructure/git/verification-command.d.ts +1 -1
  267. package/dist/infrastructure/git/verification-command.js +3 -2
  268. package/dist/infrastructure/git/verification-command.js.map +1 -1
  269. package/dist/infrastructure/opentelemetry.js +1 -1
  270. package/dist/infrastructure/opentelemetry.js.map +1 -1
  271. package/dist/infrastructure/resource-activity-inspection.d.ts +2 -0
  272. package/dist/infrastructure/resource-activity-inspection.js +152 -0
  273. package/dist/infrastructure/resource-activity-inspection.js.map +1 -0
  274. package/dist/infrastructure/resource-activity.constants.d.ts +8 -0
  275. package/dist/infrastructure/resource-activity.constants.js +26 -0
  276. package/dist/infrastructure/resource-activity.constants.js.map +1 -0
  277. package/dist/infrastructure/resource-activity.d.ts +2 -0
  278. package/dist/infrastructure/resource-activity.js +166 -0
  279. package/dist/infrastructure/resource-activity.js.map +1 -0
  280. package/dist/infrastructure/resource-activity.types.d.ts +53 -0
  281. package/dist/infrastructure/resource-activity.types.js +2 -0
  282. package/dist/infrastructure/resource-activity.types.js.map +1 -0
  283. package/dist/infrastructure/storage-mutation-lock.constants.d.ts +5 -0
  284. package/dist/infrastructure/storage-mutation-lock.constants.js +6 -0
  285. package/dist/infrastructure/storage-mutation-lock.constants.js.map +1 -0
  286. package/dist/infrastructure/storage-mutation-lock.d.ts +1 -0
  287. package/dist/infrastructure/storage-mutation-lock.js +21 -0
  288. package/dist/infrastructure/storage-mutation-lock.js.map +1 -0
  289. package/dist/infrastructure/storage-reservations.constants.d.ts +4 -0
  290. package/dist/infrastructure/storage-reservations.constants.js +5 -0
  291. package/dist/infrastructure/storage-reservations.constants.js.map +1 -0
  292. package/dist/infrastructure/storage-reservations.d.ts +2 -0
  293. package/dist/infrastructure/storage-reservations.js +150 -0
  294. package/dist/infrastructure/storage-reservations.js.map +1 -0
  295. package/dist/infrastructure/storage-reservations.types.d.ts +21 -0
  296. package/dist/infrastructure/storage-reservations.types.js +2 -0
  297. package/dist/infrastructure/storage-reservations.types.js.map +1 -0
  298. package/dist/infrastructure/task-queue-http.constants.d.ts +2 -0
  299. package/dist/infrastructure/task-queue-http.constants.js +3 -0
  300. package/dist/infrastructure/task-queue-http.constants.js.map +1 -0
  301. package/dist/infrastructure/task-queue-http.d.ts +4 -0
  302. package/dist/infrastructure/task-queue-http.js +158 -0
  303. package/dist/infrastructure/task-queue-http.js.map +1 -0
  304. package/dist/infrastructure/task-queue-http.types.d.ts +16 -0
  305. package/dist/infrastructure/task-queue-http.types.js +2 -0
  306. package/dist/infrastructure/task-queue-http.types.js.map +1 -0
  307. package/dist/infrastructure/task-queue.d.ts +2 -0
  308. package/dist/infrastructure/task-queue.js +134 -0
  309. package/dist/infrastructure/task-queue.js.map +1 -0
  310. package/dist/infrastructure/transfer.js +5 -0
  311. package/dist/infrastructure/transfer.js.map +1 -1
  312. package/dist/infrastructure/workflow-checkpoint.constants.d.ts +1 -0
  313. package/dist/infrastructure/workflow-checkpoint.constants.js +2 -0
  314. package/dist/infrastructure/workflow-checkpoint.constants.js.map +1 -0
  315. package/dist/infrastructure/workflow-checkpoint.d.ts +3 -0
  316. package/dist/infrastructure/workflow-checkpoint.js +77 -0
  317. package/dist/infrastructure/workflow-checkpoint.js.map +1 -0
  318. package/dist/infrastructure/workflow-checkpoint.types.d.ts +4 -0
  319. package/dist/infrastructure/workflow-checkpoint.types.js +2 -0
  320. package/dist/infrastructure/workflow-checkpoint.types.js.map +1 -0
  321. package/dist/providers/agents.d.ts +3 -1
  322. package/dist/providers/agents.js +1 -0
  323. package/dist/providers/agents.js.map +1 -1
  324. package/dist/providers/container-isolation.d.ts +2 -0
  325. package/dist/providers/container-isolation.js +29 -0
  326. package/dist/providers/container-isolation.js.map +1 -0
  327. package/dist/providers/container-mounts.js +7 -2
  328. package/dist/providers/container-mounts.js.map +1 -1
  329. package/dist/providers/container-network.d.ts +2 -0
  330. package/dist/providers/container-network.js +14 -0
  331. package/dist/providers/container-network.js.map +1 -0
  332. package/dist/providers/container-plan.js +4 -2
  333. package/dist/providers/container-plan.js.map +1 -1
  334. package/dist/providers/container.constants.d.ts +1 -0
  335. package/dist/providers/container.constants.js +1 -0
  336. package/dist/providers/container.constants.js.map +1 -1
  337. package/dist/providers/container.js +19 -2
  338. package/dist/providers/container.js.map +1 -1
  339. package/dist/providers/container.types.d.ts +3 -0
  340. package/dist/providers/container.types.js.map +1 -1
  341. package/dist/providers/daytona-command.constants.d.ts +2 -0
  342. package/dist/providers/daytona-command.constants.js +13 -0
  343. package/dist/providers/daytona-command.constants.js.map +1 -0
  344. package/dist/providers/daytona-command.js +12 -5
  345. package/dist/providers/daytona-command.js.map +1 -1
  346. package/dist/providers/daytona-output.d.ts +4 -0
  347. package/dist/providers/daytona-output.js +37 -0
  348. package/dist/providers/daytona-output.js.map +1 -0
  349. package/dist/providers/daytona-terminal.d.ts +3 -0
  350. package/dist/providers/daytona-terminal.js +130 -0
  351. package/dist/providers/daytona-terminal.js.map +1 -0
  352. package/dist/providers/daytona.js +2 -0
  353. package/dist/providers/daytona.js.map +1 -1
  354. package/dist/providers/docker.d.ts +1 -0
  355. package/dist/providers/docker.js.map +1 -1
  356. package/dist/providers/file-batches.d.ts +1 -1
  357. package/dist/providers/file-batches.js +9 -0
  358. package/dist/providers/file-batches.js.map +1 -1
  359. package/dist/providers/file-upload.constants.d.ts +1 -0
  360. package/dist/providers/file-upload.constants.js +68 -0
  361. package/dist/providers/file-upload.constants.js.map +1 -0
  362. package/dist/providers/file-upload.d.ts +2 -0
  363. package/dist/providers/file-upload.js +146 -0
  364. package/dist/providers/file-upload.js.map +1 -0
  365. package/dist/providers/firecracker-command.d.ts +5 -0
  366. package/dist/providers/firecracker-command.js +114 -0
  367. package/dist/providers/firecracker-command.js.map +1 -0
  368. package/dist/providers/firecracker-files.constants.d.ts +1 -0
  369. package/dist/providers/firecracker-files.constants.js +21 -0
  370. package/dist/providers/firecracker-files.constants.js.map +1 -0
  371. package/dist/providers/firecracker-files.d.ts +3 -0
  372. package/dist/providers/firecracker-files.js +110 -0
  373. package/dist/providers/firecracker-files.js.map +1 -0
  374. package/dist/providers/firecracker-machine.d.ts +3 -0
  375. package/dist/providers/firecracker-machine.js +155 -0
  376. package/dist/providers/firecracker-machine.js.map +1 -0
  377. package/dist/providers/firecracker.constants.d.ts +10 -0
  378. package/dist/providers/firecracker.constants.js +11 -0
  379. package/dist/providers/firecracker.constants.js.map +1 -0
  380. package/dist/providers/firecracker.d.ts +4 -0
  381. package/dist/providers/firecracker.js +103 -0
  382. package/dist/providers/firecracker.js.map +1 -0
  383. package/dist/providers/firecracker.types.d.ts +36 -0
  384. package/dist/providers/firecracker.types.js +2 -0
  385. package/dist/providers/firecracker.types.js.map +1 -0
  386. package/dist/providers/local.js +2 -1
  387. package/dist/providers/local.js.map +1 -1
  388. package/dist/providers/podman.d.ts +1 -0
  389. package/dist/providers/podman.js.map +1 -1
  390. package/dist/providers/terminal-bridge.d.ts +14 -0
  391. package/dist/providers/terminal-bridge.js +100 -0
  392. package/dist/providers/terminal-bridge.js.map +1 -0
  393. package/dist/providers/vercel-command.js +2 -2
  394. package/dist/providers/vercel-command.js.map +1 -1
  395. package/dist/providers/vercel-directory.d.ts +2 -0
  396. package/dist/providers/vercel-directory.js +7 -0
  397. package/dist/providers/vercel-directory.js.map +1 -0
  398. package/dist/providers/vercel-files.js +3 -2
  399. package/dist/providers/vercel-files.js.map +1 -1
  400. package/dist/providers/vercel-network.d.ts +2 -0
  401. package/dist/providers/vercel-network.js +18 -0
  402. package/dist/providers/vercel-network.js.map +1 -0
  403. package/dist/providers/vercel.d.ts +1 -0
  404. package/dist/providers/vercel.js +5 -1
  405. package/dist/providers/vercel.js.map +1 -1
  406. package/dist/providers/vercel.types.d.ts +2 -0
  407. package/dist/providers/vercel.types.js.map +1 -1
  408. package/dist/providers/versions.constants.d.ts +1 -0
  409. package/dist/providers/versions.constants.js +1 -0
  410. package/dist/providers/versions.constants.js.map +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YAAY,SAAS,EAAE,EAAE;gBAC3C,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACzB,eAAe,EAAE;oBACf,sBAAsB,EAAE,IAAI,QAAQ,CAAC,OAAO,EAAE;oBAC9C,GAAG,MAAM,CAAC,WAAW,CACnB,gBAAgB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;wBACvC,IAAI;wBACJ,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;qBAChC,CAAC,CACH;iBACF;aACF,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { imageRecipe, providerPackages } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\nimport { starter } from \"./starters.ts\";\n\nexport async function scaffoldFiles(\n options: InitOptions,\n hasPackage: boolean,\n extension: \"ts\" | \"mts\",\n): Promise<Record<string, string>> {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n const files: Record<string, string> = {\n [`run.${extension}`]: starter(options),\n \"brief.md\":\n \"Objective: {{OBJECTIVE}}\\n\\nWork on {{WORK_BRANCH}} from {{BASE_BRANCH}}. Inspect the repository, implement the objective, run relevant tests and commit your changes. When finished, write <outpost>done</outpost>.\\n\",\n \".env.example\":\n agent === \"codex\" ? \"OPENAI_API_KEY=\\n\" : \"ANTHROPIC_API_KEY=\\n\",\n \".gitignore\":\n \"node_modules/\\n.env\\n.outpost/workspaces/\\n.outpost/locks/\\n.outpost/recovery/\\n.outpost/logs/\\n\",\n };\n if (provider === \"docker\" || provider === \"podman\")\n files[provider === \"docker\" ? \"Dockerfile\" : \"Containerfile\"] = imageRecipe;\n\n if (!hasPackage) {\n const manifest = JSON.parse(\n await readFile(new URL(\"../../package.json\", import.meta.url), \"utf8\"),\n );\n files[\"package.json\"] =\n JSON.stringify(\n {\n private: true,\n type: \"module\",\n scripts: { start: `node run.${extension}` },\n engines: { node: \">=24\" },\n devDependencies: {\n \"@elie-laloum/outpost\": `^${manifest.version}`,\n ...Object.fromEntries(\n providerPackages[provider].map((name) => [\n name,\n manifest.peerDependencies[name],\n ]),\n ),\n },\n },\n null,\n 2,\n ) + \"\\n\";\n }\n return files;\n}\n"]}
1
+ {"version":3,"file":"scaffold-files.js","sourceRoot":"","sources":["../../src/cli/scaffold-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAoB,EACpB,UAAmB,EACnB,SAAuB;IAEvB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC9C,MAAM,KAAK,GAA2B;QACpC,CAAC,OAAO,SAAS,EAAE,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;QACtC,UAAU,EACR,wNAAwN;QAC1N,cAAc,EAAE,yBAAyB,CAAC,OAAO,CAAC;QAClD,YAAY,EACV,kGAAkG;KACrG,CAAC;IACF,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ;QAChD,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,WAAW,CAAC;IAE9E,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CACzB,MAAM,QAAQ,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CACvE,CAAC;QACF,KAAK,CAAC,cAAc,CAAC;YACnB,IAAI,CAAC,SAAS,CACZ;gBACE,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,SAAS,EAAE,EAAE;gBAC3C,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACzB,eAAe,EAAE;oBACf,sBAAsB,EAAE,IAAI,QAAQ,CAAC,OAAO,EAAE;oBAC9C,GAAG,MAAM,CAAC,WAAW,CACnB,gBAAgB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;wBACvC,IAAI;wBACJ,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;qBAChC,CAAC,CACH;iBACF;aACF,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { imageRecipe, providerPackages } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\nimport { authenticationEnvironment } from \"./init-authentication.ts\";\nimport { starter } from \"./starters.ts\";\n\nexport async function scaffoldFiles(\n options: InitOptions,\n hasPackage: boolean,\n extension: \"ts\" | \"mts\",\n): Promise<Record<string, string>> {\n const provider = options.provider ?? \"docker\";\n const files: Record<string, string> = {\n [`run.${extension}`]: starter(options),\n \"brief.md\":\n \"Objective: {{OBJECTIVE}}\\n\\nWork on {{WORK_BRANCH}} from {{BASE_BRANCH}}. Inspect the repository, implement the objective, run relevant tests and commit your changes. When finished, write <outpost>done</outpost>.\\n\",\n \".env.example\": authenticationEnvironment(options),\n \".gitignore\":\n \"node_modules/\\n.env\\n.outpost/workspaces/\\n.outpost/locks/\\n.outpost/recovery/\\n.outpost/logs/\\n\",\n };\n if (provider === \"docker\" || provider === \"podman\")\n files[provider === \"docker\" ? \"Dockerfile\" : \"Containerfile\"] = imageRecipe;\n\n if (!hasPackage) {\n const manifest = JSON.parse(\n await readFile(new URL(\"../../package.json\", import.meta.url), \"utf8\"),\n );\n files[\"package.json\"] =\n JSON.stringify(\n {\n private: true,\n type: \"module\",\n scripts: { start: `node run.${extension}` },\n engines: { node: \">=24\" },\n devDependencies: {\n \"@elie-laloum/outpost\": `^${manifest.version}`,\n ...Object.fromEntries(\n providerPackages[provider].map((name) => [\n name,\n manifest.peerDependencies[name],\n ]),\n ),\n },\n },\n null,\n 2,\n ) + \"\\n\";\n }\n return files;\n}\n"]}
@@ -1,8 +1,27 @@
1
+ import { codex } from "../adapters/agents/codex-adapter.js";
1
2
  import { invariant } from "../domain/errors.js";
2
3
  import { supportedAgents, supportedProviders } from "./scaffold.constants.js";
3
4
  export function validateInitialization(options) {
4
5
  const agent = options.agent ?? "codex", provider = options.provider ?? "docker";
5
- invariant(supportedAgents.includes(agent), "Choose codex or claude");
6
+ invariant(supportedAgents.includes(agent), "Choose codex, claude or gemini");
6
7
  invariant(supportedProviders.includes(provider), "Unknown sandbox provider");
8
+ invariant(!options.apiKeyEnvironment || options.baseUrl, "--api-key-env requires --base-url");
9
+ if (options.baseUrl) {
10
+ invariant(agent === "codex" &&
11
+ (!options.authentication || options.authentication === "api-key"), "Custom Responses providers require Codex and api-key authentication");
12
+ codex({
13
+ ...(options.model ? { model: options.model } : {}),
14
+ modelProvider: {
15
+ baseUrl: options.baseUrl,
16
+ ...(options.apiKeyEnvironment
17
+ ? { apiKeyEnvironment: options.apiKeyEnvironment }
18
+ : {}),
19
+ },
20
+ });
21
+ }
22
+ const authentication = options.authentication ?? "api-key";
23
+ invariant(authentication === "api-key" ||
24
+ (authentication === "oauth-token" && agent === "claude") ||
25
+ (authentication === "login" && agent === "codex"), "Authentication must be api-key, oauth-token for Claude, or login for Codex");
7
26
  }
8
27
  //# sourceMappingURL=scaffold-validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold-validation.js","sourceRoot":"","sources":["../../src/cli/scaffold-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG9E,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC1C,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,wBAAwB,CAAC,CAAC;IACrE,SAAS,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,0BAA0B,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { invariant } from \"../domain/errors.ts\";\nimport { supportedAgents, supportedProviders } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport function validateInitialization(options: InitOptions): void {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n invariant(supportedAgents.includes(agent), \"Choose codex or claude\");\n invariant(supportedProviders.includes(provider), \"Unknown sandbox provider\");\n}\n"]}
1
+ {"version":3,"file":"scaffold-validation.js","sourceRoot":"","sources":["../../src/cli/scaffold-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG9E,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC1C,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,gCAAgC,CAAC,CAAC;IAC7E,SAAS,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,0BAA0B,CAAC,CAAC;IAC7E,SAAS,CACP,CAAC,OAAO,CAAC,iBAAiB,IAAI,OAAO,CAAC,OAAO,EAC7C,mCAAmC,CACpC,CAAC;IACF,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,SAAS,CACP,KAAK,KAAK,OAAO;YACf,CAAC,CAAC,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,CAAC,EACnE,qEAAqE,CACtE,CAAC;QACF,KAAK,CAAC;YACJ,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,aAAa,EAAE;gBACb,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,GAAG,CAAC,OAAO,CAAC,iBAAiB;oBAC3B,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,EAAE;oBAClD,CAAC,CAAC,EAAE,CAAC;aACR;SACF,CAAC,CAAC;IACL,CAAC;IACD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,SAAS,CAAC;IAC3D,SAAS,CACP,cAAc,KAAK,SAAS;QAC1B,CAAC,cAAc,KAAK,aAAa,IAAI,KAAK,KAAK,QAAQ,CAAC;QACxD,CAAC,cAAc,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,CAAC,EACnD,4EAA4E,CAC7E,CAAC;AACJ,CAAC","sourcesContent":["import { codex } from \"../adapters/agents/codex-adapter.ts\";\nimport { invariant } from \"../domain/errors.ts\";\nimport { supportedAgents, supportedProviders } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport function validateInitialization(options: InitOptions): void {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n invariant(supportedAgents.includes(agent), \"Choose codex, claude or gemini\");\n invariant(supportedProviders.includes(provider), \"Unknown sandbox provider\");\n invariant(\n !options.apiKeyEnvironment || options.baseUrl,\n \"--api-key-env requires --base-url\",\n );\n if (options.baseUrl) {\n invariant(\n agent === \"codex\" &&\n (!options.authentication || options.authentication === \"api-key\"),\n \"Custom Responses providers require Codex and api-key authentication\",\n );\n codex({\n ...(options.model ? { model: options.model } : {}),\n modelProvider: {\n baseUrl: options.baseUrl,\n ...(options.apiKeyEnvironment\n ? { apiKeyEnvironment: options.apiKeyEnvironment }\n : {}),\n },\n });\n }\n const authentication = options.authentication ?? \"api-key\";\n invariant(\n authentication === \"api-key\" ||\n (authentication === \"oauth-token\" && agent === \"claude\") ||\n (authentication === \"login\" && agent === \"codex\"),\n \"Authentication must be api-key, oauth-token for Claude, or login for Codex\",\n );\n}\n"]}
@@ -3,14 +3,14 @@ export const imageRecipe = `FROM node:24-bookworm-slim
3
3
  ARG AGENT_UID=1000
4
4
  ARG AGENT_GID=1000
5
5
  RUN apt-get update && apt-get install -y --no-install-recommends git openssh-client ca-certificates curl procps util-linux python3 && rm -rf /var/lib/apt/lists/*
6
- RUN npm install -g --allow-scripts=@anthropic-ai/claude-code @openai/codex@${agentVersions.codex} @anthropic-ai/claude-code@${agentVersions.claude}
6
+ RUN npm install -g --allow-scripts=@anthropic-ai/claude-code @openai/codex@${agentVersions.codex} @anthropic-ai/claude-code@${agentVersions.claude} @google/gemini-cli@${agentVersions.gemini}
7
7
  RUN groupmod -o -g "$AGENT_GID" node && usermod -o -u "$AGENT_UID" -g "$AGENT_GID" node
8
8
  RUN mkdir -p /home/agent && chown "$AGENT_UID:$AGENT_GID" /home/agent && chmod 700 /home/agent
9
9
  ENV HOME=/home/agent
10
10
  USER $AGENT_UID:$AGENT_GID
11
11
  WORKDIR /workspace
12
12
  `;
13
- export const supportedAgents = ["codex", "claude"];
13
+ export const supportedAgents = ["codex", "claude", "gemini"];
14
14
  export const supportedProviders = [
15
15
  "docker",
16
16
  "podman",
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.constants.js","sourceRoot":"","sources":["../../src/cli/scaffold.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,WAAW,GAAG;;;;6EAIkD,aAAa,CAAC,KAAK,8BAA8B,aAAa,CAAC,MAAM;;;;;;CAMjJ,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;CACR,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;CACN,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC1B,CAAC,WAAW,EAAE,MAAM,CAAC;IACrB,CAAC,UAAU,EAAE,KAAK,CAAC;IACnB,CAAC,WAAW,EAAE,KAAK,CAAC;CACZ,CAAC;AACX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,CAAC,iBAAiB,CAAC;IAC3B,OAAO,EAAE,CAAC,cAAc,CAAC;CACjB,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const imageRecipe = `FROM node:24-bookworm-slim\nARG AGENT_UID=1000\nARG AGENT_GID=1000\nRUN apt-get update && apt-get install -y --no-install-recommends git openssh-client ca-certificates curl procps util-linux python3 && rm -rf /var/lib/apt/lists/*\nRUN npm install -g --allow-scripts=@anthropic-ai/claude-code @openai/codex@${agentVersions.codex} @anthropic-ai/claude-code@${agentVersions.claude}\nRUN groupmod -o -g \"$AGENT_GID\" node && usermod -o -u \"$AGENT_UID\" -g \"$AGENT_GID\" node\nRUN mkdir -p /home/agent && chown \"$AGENT_UID:$AGENT_GID\" /home/agent && chmod 700 /home/agent\nENV HOME=/home/agent\nUSER $AGENT_UID:$AGENT_GID\nWORKDIR /workspace\n`;\n\nexport const supportedAgents: readonly string[] = [\"codex\", \"claude\"];\nexport const supportedProviders: readonly string[] = [\n \"docker\",\n \"podman\",\n \"vercel\",\n \"daytona\",\n \"local\",\n];\nexport const supportedManagers: readonly string[] = [\n \"npm\",\n \"pnpm\",\n \"yarn\",\n \"bun\",\n];\nexport const managerLocks = [\n [\"pnpm-lock.yaml\", \"pnpm\"],\n [\"yarn.lock\", \"yarn\"],\n [\"bun.lock\", \"bun\"],\n [\"bun.lockb\", \"bun\"],\n] as const;\nexport const providerPackages = {\n docker: [],\n podman: [],\n local: [],\n vercel: [\"@vercel/sandbox\"],\n daytona: [\"@daytona/sdk\"],\n} as const;\n"]}
1
+ {"version":3,"file":"scaffold.constants.js","sourceRoot":"","sources":["../../src/cli/scaffold.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,WAAW,GAAG;;;;6EAIkD,aAAa,CAAC,KAAK,8BAA8B,aAAa,CAAC,MAAM,uBAAuB,aAAa,CAAC,MAAM;;;;;;CAM5L,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;CACR,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;CACN,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC1B,CAAC,WAAW,EAAE,MAAM,CAAC;IACrB,CAAC,UAAU,EAAE,KAAK,CAAC;IACnB,CAAC,WAAW,EAAE,KAAK,CAAC;CACZ,CAAC;AACX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,CAAC,iBAAiB,CAAC;IAC3B,OAAO,EAAE,CAAC,cAAc,CAAC;CACjB,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const imageRecipe = `FROM node:24-bookworm-slim\nARG AGENT_UID=1000\nARG AGENT_GID=1000\nRUN apt-get update && apt-get install -y --no-install-recommends git openssh-client ca-certificates curl procps util-linux python3 && rm -rf /var/lib/apt/lists/*\nRUN npm install -g --allow-scripts=@anthropic-ai/claude-code @openai/codex@${agentVersions.codex} @anthropic-ai/claude-code@${agentVersions.claude} @google/gemini-cli@${agentVersions.gemini}\nRUN groupmod -o -g \"$AGENT_GID\" node && usermod -o -u \"$AGENT_UID\" -g \"$AGENT_GID\" node\nRUN mkdir -p /home/agent && chown \"$AGENT_UID:$AGENT_GID\" /home/agent && chmod 700 /home/agent\nENV HOME=/home/agent\nUSER $AGENT_UID:$AGENT_GID\nWORKDIR /workspace\n`;\n\nexport const supportedAgents: readonly string[] = [\"codex\", \"claude\", \"gemini\"];\nexport const supportedProviders: readonly string[] = [\n \"docker\",\n \"podman\",\n \"vercel\",\n \"daytona\",\n \"local\",\n];\nexport const supportedManagers: readonly string[] = [\n \"npm\",\n \"pnpm\",\n \"yarn\",\n \"bun\",\n];\nexport const managerLocks = [\n [\"pnpm-lock.yaml\", \"pnpm\"],\n [\"yarn.lock\", \"yarn\"],\n [\"bun.lock\", \"bun\"],\n [\"bun.lockb\", \"bun\"],\n] as const;\nexport const providerPackages = {\n docker: [],\n podman: [],\n local: [],\n vercel: [\"@vercel/sandbox\"],\n daytona: [\"@daytona/sdk\"],\n} as const;\n"]}
@@ -15,6 +15,19 @@ export async function initialize(options = {}, executor) {
15
15
  const provider = options.provider ?? "docker";
16
16
  validateInitialization(options);
17
17
  const { hasPackage, manager, extension } = await projectSettings(root, options);
18
+ if (options.install) {
19
+ try {
20
+ await requireSuccess(process.platform === "win32"
21
+ ? {
22
+ executable: "cmd.exe",
23
+ arguments: ["/d", "/c", `${manager} --version`],
24
+ }
25
+ : { executable: manager, arguments: ["--version"] }, executor);
26
+ }
27
+ catch {
28
+ throw new OutpostError("configuration", `Package manager ${manager} is unavailable. Install it or select an installed manager with --manager before using --install.`);
29
+ }
30
+ }
18
31
  const files = await scaffoldFiles({ ...options, image: options.image ?? imageName(root) }, hasPackage, extension);
19
32
  const existingIgnore = await readFile(join(root, ".gitignore"), "utf8").catch((error) => {
20
33
  if (error.code === "ENOENT")
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/cli/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAA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from \"node:path\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { requireSuccess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { imageName } from \"../providers/container.ts\";\nimport { manageImage } from \"./image.ts\";\nimport { projectSettings } from \"./project-settings.ts\";\nimport { scaffoldFiles } from \"./scaffold-files.ts\";\nimport { validateInitialization } from \"./scaffold-validation.ts\";\nimport { providerPackages } from \"./scaffold.constants.ts\";\nimport type { InitOptions, ScaffoldResult } from \"./scaffold.types.ts\";\n\nexport { manageImage } from \"./image.ts\";\nexport { imageRecipe } from \"./scaffold.constants.ts\";\nexport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport async function initialize(\n options: InitOptions = {},\n executor?: Executor,\n): Promise<ScaffoldResult> {\n const root = resolve(options.directory ?? process.cwd());\n const provider = options.provider ?? \"docker\";\n validateInitialization(options);\n const { hasPackage, manager, extension } = await projectSettings(\n root,\n options,\n );\n const files = await scaffoldFiles(\n { ...options, image: options.image ?? imageName(root) },\n hasPackage,\n extension,\n );\n const existingIgnore = await readFile(join(root, \".gitignore\"), \"utf8\").catch(\n (error) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n },\n );\n const ignore = files[\".gitignore\"]!;\n if (existingIgnore !== undefined) delete files[\".gitignore\"];\n for (const name of Object.keys(files))\n if (\n await lstat(join(root, name))\n .then(() => true)\n .catch((error) => {\n if (error.code === \"ENOENT\") return false;\n throw error;\n })\n )\n throw new OutpostError(\n \"configuration\",\n `Initialization would overwrite ${name}`,\n );\n await mkdir(root, { recursive: true });\n for (const [name, content] of Object.entries(files))\n await writeFile(join(root, name), content, { flag: \"wx\" });\n if (existingIgnore !== undefined) {\n const rules = new Set(existingIgnore.split(/\\r?\\n/));\n const additions = ignore\n .trimEnd()\n .split(\"\\n\")\n .filter((rule) => !rules.has(rule));\n if (additions.length) {\n const suffix = `${existingIgnore && !existingIgnore.endsWith(\"\\n\") ? \"\\n\" : \"\"}${additions.join(\"\\n\")}\\n`;\n await appendFile(join(root, \".gitignore\"), suffix);\n files[\".gitignore\"] = existingIgnore + suffix;\n }\n }\n if (options.install) {\n const packages = [\"@elie-laloum/outpost\", ...providerPackages[provider]];\n const args =\n manager === \"npm\"\n ? [\"install\", \"--save-dev\", ...packages]\n : [\"add\", \"--dev\", ...packages];\n await requireSuccess(\n process.platform === \"win32\"\n ? {\n executable: \"cmd.exe\",\n arguments: [\"/d\", \"/c\", [manager, ...args].join(\" \")],\n directory: root,\n }\n : { executable: manager, arguments: args, directory: root },\n executor,\n );\n }\n if (options.build && (provider === \"docker\" || provider === \"podman\"))\n await manageImage(\n \"build\",\n {\n directory: root,\n engine: provider,\n ...(options.image ? { image: options.image } : {}),\n },\n executor,\n );\n return {\n files: Object.keys(files).map((name) => join(root, name)),\n run: `node run.${extension}`,\n };\n}\n"]}
1
+ {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/cli/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAA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,EAAE,QAAQ;YAChB,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,EACD,QAAQ,CACT,CAAC;IACJ,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzD,GAAG,EAAE,YAAY,SAAS,EAAE;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["import {\n appendFile,\n lstat,\n mkdir,\n readFile,\n writeFile,\n} from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { requireSuccess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { imageName } from \"../providers/container.ts\";\nimport { manageImage } from \"./image.ts\";\nimport { projectSettings } from \"./project-settings.ts\";\nimport { scaffoldFiles } from \"./scaffold-files.ts\";\nimport { validateInitialization } from \"./scaffold-validation.ts\";\nimport { providerPackages } from \"./scaffold.constants.ts\";\nimport type { InitOptions, ScaffoldResult } from \"./scaffold.types.ts\";\n\nexport { manageImage } from \"./image.ts\";\nexport { imageRecipe } from \"./scaffold.constants.ts\";\nexport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport async function initialize(\n options: InitOptions = {},\n executor?: Executor,\n): Promise<ScaffoldResult> {\n const root = resolve(options.directory ?? process.cwd());\n const provider = options.provider ?? \"docker\";\n validateInitialization(options);\n const { hasPackage, manager, extension } = await projectSettings(\n root,\n options,\n );\n if (options.install) {\n try {\n await requireSuccess(\n process.platform === \"win32\"\n ? {\n executable: \"cmd.exe\",\n arguments: [\"/d\", \"/c\", `${manager} --version`],\n }\n : { executable: manager, arguments: [\"--version\"] },\n executor,\n );\n } catch {\n throw new OutpostError(\n \"configuration\",\n `Package manager ${manager} is unavailable. Install it or select an installed manager with --manager before using --install.`,\n );\n }\n }\n const files = await scaffoldFiles(\n { ...options, image: options.image ?? imageName(root) },\n hasPackage,\n extension,\n );\n const existingIgnore = await readFile(join(root, \".gitignore\"), \"utf8\").catch(\n (error) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n },\n );\n const ignore = files[\".gitignore\"]!;\n if (existingIgnore !== undefined) delete files[\".gitignore\"];\n for (const name of Object.keys(files))\n if (\n await lstat(join(root, name))\n .then(() => true)\n .catch((error) => {\n if (error.code === \"ENOENT\") return false;\n throw error;\n })\n )\n throw new OutpostError(\n \"configuration\",\n `Initialization would overwrite ${name}`,\n );\n await mkdir(root, { recursive: true });\n for (const [name, content] of Object.entries(files))\n await writeFile(join(root, name), content, { flag: \"wx\" });\n if (existingIgnore !== undefined) {\n const rules = new Set(existingIgnore.split(/\\r?\\n/));\n const additions = ignore\n .trimEnd()\n .split(\"\\n\")\n .filter((rule) => !rules.has(rule));\n if (additions.length) {\n const suffix = `${existingIgnore && !existingIgnore.endsWith(\"\\n\") ? \"\\n\" : \"\"}${additions.join(\"\\n\")}\\n`;\n await appendFile(join(root, \".gitignore\"), suffix);\n files[\".gitignore\"] = existingIgnore + suffix;\n }\n }\n if (options.install) {\n const packages = [\"@elie-laloum/outpost\", ...providerPackages[provider]];\n const args =\n manager === \"npm\"\n ? [\"install\", \"--save-dev\", ...packages]\n : [\"add\", \"--dev\", ...packages];\n await requireSuccess(\n process.platform === \"win32\"\n ? {\n executable: \"cmd.exe\",\n arguments: [\"/d\", \"/c\", [manager, ...args].join(\" \")],\n directory: root,\n }\n : { executable: manager, arguments: args, directory: root },\n executor,\n );\n }\n if (options.build && (provider === \"docker\" || provider === \"podman\"))\n await manageImage(\n \"build\",\n {\n directory: root,\n engine: provider,\n ...(options.image ? { image: options.image } : {}),\n },\n executor,\n );\n return {\n files: Object.keys(files).map((name) => join(root, name)),\n run: `node run.${extension}`,\n };\n}\n"]}
@@ -1,10 +1,13 @@
1
1
  export interface InitOptions {
2
2
  readonly directory?: string;
3
3
  readonly repository?: string;
4
- readonly agent?: "claude" | "codex";
4
+ readonly agent?: "claude" | "codex" | "gemini";
5
5
  readonly provider?: "docker" | "podman" | "vercel" | "daytona" | "local";
6
6
  readonly manager?: "npm" | "pnpm" | "yarn" | "bun";
7
7
  readonly model?: string;
8
+ readonly baseUrl?: string;
9
+ readonly apiKeyEnvironment?: string;
10
+ readonly authentication?: "api-key" | "oauth-token" | "login";
8
11
  readonly install?: boolean;
9
12
  readonly build?: boolean;
10
13
  readonly image?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.types.js","sourceRoot":"","sources":["../../src/cli/scaffold.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface InitOptions {\n readonly directory?: string;\n readonly repository?: string;\n readonly agent?: \"claude\" | \"codex\";\n readonly provider?: \"docker\" | \"podman\" | \"vercel\" | \"daytona\" | \"local\";\n readonly manager?: \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n readonly model?: string;\n readonly install?: boolean;\n readonly build?: boolean;\n readonly image?: string;\n}\n\nexport interface PackageManifest {\n readonly type?: string;\n readonly packageManager?: string;\n}\nexport interface ProjectSettings {\n readonly extension: \"ts\" | \"mts\";\n readonly hasPackage: boolean;\n readonly manager: string;\n}\nexport interface ScaffoldResult {\n files: readonly string[];\n run: string;\n}\n"]}
1
+ {"version":3,"file":"scaffold.types.js","sourceRoot":"","sources":["../../src/cli/scaffold.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface InitOptions {\n readonly directory?: string;\n readonly repository?: string;\n readonly agent?: \"claude\" | \"codex\" | \"gemini\";\n readonly provider?: \"docker\" | \"podman\" | \"vercel\" | \"daytona\" | \"local\";\n readonly manager?: \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n readonly model?: string;\n readonly baseUrl?: string;\n readonly apiKeyEnvironment?: string;\n readonly authentication?: \"api-key\" | \"oauth-token\" | \"login\";\n readonly install?: boolean;\n readonly build?: boolean;\n readonly image?: string;\n}\n\nexport interface PackageManifest {\n readonly type?: string;\n readonly packageManager?: string;\n}\nexport interface ProjectSettings {\n readonly extension: \"ts\" | \"mts\";\n readonly hasPackage: boolean;\n readonly manager: string;\n}\nexport interface ScaffoldResult {\n files: readonly string[];\n run: string;\n}\n"]}
@@ -1,11 +1,16 @@
1
+ import { authenticationEnvironment, authenticationSource, } from "./init-authentication.js";
1
2
  export function starter(options) {
2
3
  const agent = options.agent ?? "codex", provider = options.provider ?? "docker";
3
4
  const model = options.model ? `model: ${JSON.stringify(options.model)}` : "";
5
+ const modelProvider = options.baseUrl
6
+ ? `, modelProvider: ${JSON.stringify({ baseUrl: options.baseUrl, ...(options.apiKeyEnvironment ? { apiKeyEnvironment: options.apiKeyEnvironment } : {}) })}`
7
+ : "";
4
8
  const image = options.image && (provider === "docker" || provider === "podman")
5
9
  ? `image: ${JSON.stringify(options.image)}, `
6
10
  : "";
7
11
  return `import { readFile } from "node:fs/promises";
8
12
  import { resolve } from "node:path";
13
+ import { homedir } from "node:os";
9
14
  import { parseEnv } from "node:util";
10
15
  import { dispatch, ${agent}, OutpostError, reporter } from "@elie-laloum/outpost";
11
16
  import { ${provider} } from "@elie-laloum/outpost/providers/${provider}";
@@ -17,10 +22,11 @@ const environment = await readFile(new URL(".env", import.meta.url), "utf8").cat
17
22
  throw error;
18
23
  });
19
24
  const variables = Object.fromEntries(
20
- Object.entries(parseEnv(environment)).map(([key, value]) => [key, value || process.env[key] || ""]),
25
+ Object.entries({ ...parseEnv(${JSON.stringify(authenticationEnvironment(options))}), ...parseEnv(environment) }).map(([key, value]) => [key, value || process.env[key] || ""]),
21
26
  );
27
+ ${authenticationSource(options)}
22
28
  const runtime = {
23
- agent: ${agent}({ ${model} }),
29
+ agent: ${agent}({ ${model}${modelProvider} }),
24
30
  provider: ${provider}({ ${image}variables }),
25
31
  };
26
32
  const objective = process.argv.slice(2).join(" ") || "Inspect this repository and implement one useful improvement.";
@@ -29,6 +35,7 @@ console.error("[outpost] Preparing sandbox...");
29
35
  try {
30
36
  const result = await dispatch({
31
37
  ...runtime,
38
+ hooks: authentication,
32
39
  repository,
33
40
  branch: { mode: "integrate" },
34
41
  brief: { file: resolve(import.meta.dirname, "brief.md"), values: { OBJECTIVE: objective } },
@@ -1 +1 @@
1
- {"version":3,"file":"starters.js","sourceRoot":"","sources":["../../src/cli/starters.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,OAAO,CAAC,OAAoB;IAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,MAAM,KAAK,GACT,OAAO,CAAC,KAAK,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,CAAC;QAC/D,CAAC,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;QAC7C,CAAC,CAAC,EAAE,CAAC;IACT,OAAO;;;qBAGY,KAAK;WACf,QAAQ,2CAA2C,QAAQ;;;kDAGpB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,IAAI,GAAG,CAAC;;;;;;;;;WAShF,KAAK,MAAM,KAAK;cACb,QAAQ,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;CAoBhC,CAAC;AACF,CAAC","sourcesContent":["import type { InitOptions } from \"./scaffold.types.ts\";\n\nexport function starter(options: InitOptions): string {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n const model = options.model ? `model: ${JSON.stringify(options.model)}` : \"\";\n const image =\n options.image && (provider === \"docker\" || provider === \"podman\")\n ? `image: ${JSON.stringify(options.image)}, `\n : \"\";\n return `import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { parseEnv } from \"node:util\";\nimport { dispatch, ${agent}, OutpostError, reporter } from \"@elie-laloum/outpost\";\nimport { ${provider} } from \"@elie-laloum/outpost/providers/${provider}\";\n\n// Paths are relative to this workflow, regardless of where Node is launched.\nconst repository = resolve(import.meta.dirname, ${JSON.stringify(options.repository ?? \".\")});\nconst environment = await readFile(new URL(\".env\", import.meta.url), \"utf8\").catch((error) => {\n if (error.code === \"ENOENT\") return \"\";\n throw error;\n});\nconst variables = Object.fromEntries(\n Object.entries(parseEnv(environment)).map(([key, value]) => [key, value || process.env[key] || \"\"]),\n);\nconst runtime = {\n agent: ${agent}({ ${model} }),\n provider: ${provider}({ ${image}variables }),\n};\nconst objective = process.argv.slice(2).join(\" \") || \"Inspect this repository and implement one useful improvement.\";\n\nconsole.error(\"[outpost] Preparing sandbox...\");\ntry {\n const result = await dispatch({\n ...runtime,\n repository,\n branch: { mode: \"integrate\" },\n brief: { file: resolve(import.meta.dirname, \"brief.md\"), values: { OBJECTIVE: objective } },\n observe: reporter(),\n warn: (message) => console.error(message),\n });\n console.log({ branch: result.branch, commits: result.commits, conversation: result.conversation });\n} catch (error) {\n if (!(error instanceof OutpostError) || error.code !== \"aborted\") throw error;\n process.exitCode ||= 130;\n console.error(\"[outpost] Cancelled. Recovery details:\", error.recovery);\n}\n`;\n}\n"]}
1
+ {"version":3,"file":"starters.js","sourceRoot":"","sources":["../../src/cli/starters.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,UAAU,OAAO,CAAC,OAAoB;IAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO;QACnC,CAAC,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QAC5J,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,KAAK,GACT,OAAO,CAAC,KAAK,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,CAAC;QAC/D,CAAC,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;QAC7C,CAAC,CAAC,EAAE,CAAC;IACT,OAAO;;;;qBAIY,KAAK;WACf,QAAQ,2CAA2C,QAAQ;;;kDAGpB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,IAAI,GAAG,CAAC;;;;;;iCAM1D,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;;EAEjF,oBAAoB,CAAC,OAAO,CAAC;;WAEpB,KAAK,MAAM,KAAK,GAAG,aAAa;cAC7B,QAAQ,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;CAqBhC,CAAC;AACF,CAAC","sourcesContent":["import {\n authenticationEnvironment,\n authenticationSource,\n} from \"./init-authentication.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport function starter(options: InitOptions): string {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n const model = options.model ? `model: ${JSON.stringify(options.model)}` : \"\";\n const modelProvider = options.baseUrl\n ? `, modelProvider: ${JSON.stringify({ baseUrl: options.baseUrl, ...(options.apiKeyEnvironment ? { apiKeyEnvironment: options.apiKeyEnvironment } : {}) })}`\n : \"\";\n const image =\n options.image && (provider === \"docker\" || provider === \"podman\")\n ? `image: ${JSON.stringify(options.image)}, `\n : \"\";\n return `import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { homedir } from \"node:os\";\nimport { parseEnv } from \"node:util\";\nimport { dispatch, ${agent}, OutpostError, reporter } from \"@elie-laloum/outpost\";\nimport { ${provider} } from \"@elie-laloum/outpost/providers/${provider}\";\n\n// Paths are relative to this workflow, regardless of where Node is launched.\nconst repository = resolve(import.meta.dirname, ${JSON.stringify(options.repository ?? \".\")});\nconst environment = await readFile(new URL(\".env\", import.meta.url), \"utf8\").catch((error) => {\n if (error.code === \"ENOENT\") return \"\";\n throw error;\n});\nconst variables = Object.fromEntries(\n Object.entries({ ...parseEnv(${JSON.stringify(authenticationEnvironment(options))}), ...parseEnv(environment) }).map(([key, value]) => [key, value || process.env[key] || \"\"]),\n);\n${authenticationSource(options)}\nconst runtime = {\n agent: ${agent}({ ${model}${modelProvider} }),\n provider: ${provider}({ ${image}variables }),\n};\nconst objective = process.argv.slice(2).join(\" \") || \"Inspect this repository and implement one useful improvement.\";\n\nconsole.error(\"[outpost] Preparing sandbox...\");\ntry {\n const result = await dispatch({\n ...runtime,\n hooks: authentication,\n repository,\n branch: { mode: \"integrate\" },\n brief: { file: resolve(import.meta.dirname, \"brief.md\"), values: { OBJECTIVE: objective } },\n observe: reporter(),\n warn: (message) => console.error(message),\n });\n console.log({ branch: result.branch, commits: result.commits, conversation: result.conversation });\n} catch (error) {\n if (!(error instanceof OutpostError) || error.code !== \"aborted\") throw error;\n process.exitCode ||= 130;\n console.error(\"[outpost] Cancelled. Recovery details:\", error.recovery);\n}\n`;\n}\n"]}
@@ -67,6 +67,8 @@ export interface AgentInput {
67
67
  }
68
68
  export interface AgentAdapter {
69
69
  readonly name: string;
70
+ readonly bootstrap?: string;
71
+ readonly requiresFinishedEvent?: boolean;
70
72
  readonly variables?: Variables;
71
73
  readonly conversations?: "claude" | "codex";
72
74
  readonly storage?: ConversationStore;
@@ -1 +1 @@
1
- {"version":3,"file":"agent.types.js","sourceRoot":"","sources":["../../src/domain/agent.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Command, Variables } from \"./command.types.ts\";\nimport type { ConversationStore } from \"./conversation.types.ts\";\n\nexport interface Usage {\n readonly input: number;\n readonly cached: number;\n readonly cacheCreated?: number;\n readonly output: number;\n}\n\nexport type AgentEvent =\n | {\n readonly kind: \"phase\";\n readonly name: string;\n readonly agent?: string;\n readonly branch?: string;\n readonly directory?: string;\n }\n | {\n readonly kind: \"summary\";\n readonly durationMs: number;\n readonly status: number;\n readonly tokens: Usage;\n }\n | { readonly kind: \"warning\"; readonly message: string }\n | { readonly kind: \"text\"; readonly text: string }\n | { readonly kind: \"result\"; readonly text: string }\n | { readonly kind: \"prompt\"; readonly text: string }\n | { readonly kind: \"tool\"; readonly name: string; readonly input: unknown }\n | { readonly kind: \"conversation\"; readonly id: string }\n | { readonly kind: \"usage\"; readonly tokens: Usage }\n | { readonly kind: \"failure\"; readonly message: string }\n | { readonly kind: \"finished\" }\n | { readonly kind: \"raw\"; readonly value: unknown };\n\nexport type AgentObservation = AgentEvent & {\n readonly pass: number;\n readonly at: string;\n};\n\nexport type AgentEventHandlers = {\n readonly [Kind in AgentEvent[\"kind\"]]?: (\n event: Extract<AgentEvent, { kind: Kind }>,\n ) => void;\n};\n\nexport interface AgentInput {\n readonly text?: string;\n readonly interactive?: boolean;\n readonly continuation?: { readonly id: string; readonly fork?: boolean };\n}\n\nexport interface AgentAdapter {\n readonly name: string;\n readonly variables?: Variables;\n readonly conversations?: \"claude\" | \"codex\";\n readonly storage?: ConversationStore;\n readonly capture?: boolean;\n readonly resumable?: boolean;\n transcriptUsage?(text: string): Usage | undefined;\n request(input: AgentInput): Command;\n events(line: string): readonly AgentEvent[];\n}\n\nexport interface RequiredAgent {\n readonly agent: AgentAdapter;\n}\n"]}
1
+ {"version":3,"file":"agent.types.js","sourceRoot":"","sources":["../../src/domain/agent.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Command, Variables } from \"./command.types.ts\";\nimport type { ConversationStore } from \"./conversation.types.ts\";\n\nexport interface Usage {\n readonly input: number;\n readonly cached: number;\n readonly cacheCreated?: number;\n readonly output: number;\n}\n\nexport type AgentEvent =\n | {\n readonly kind: \"phase\";\n readonly name: string;\n readonly agent?: string;\n readonly branch?: string;\n readonly directory?: string;\n }\n | {\n readonly kind: \"summary\";\n readonly durationMs: number;\n readonly status: number;\n readonly tokens: Usage;\n }\n | { readonly kind: \"warning\"; readonly message: string }\n | { readonly kind: \"text\"; readonly text: string }\n | { readonly kind: \"result\"; readonly text: string }\n | { readonly kind: \"prompt\"; readonly text: string }\n | { readonly kind: \"tool\"; readonly name: string; readonly input: unknown }\n | { readonly kind: \"conversation\"; readonly id: string }\n | { readonly kind: \"usage\"; readonly tokens: Usage }\n | { readonly kind: \"failure\"; readonly message: string }\n | { readonly kind: \"finished\" }\n | { readonly kind: \"raw\"; readonly value: unknown };\n\nexport type AgentObservation = AgentEvent & {\n readonly pass: number;\n readonly at: string;\n};\n\nexport type AgentEventHandlers = {\n readonly [Kind in AgentEvent[\"kind\"]]?: (\n event: Extract<AgentEvent, { kind: Kind }>,\n ) => void;\n};\n\nexport interface AgentInput {\n readonly text?: string;\n readonly interactive?: boolean;\n readonly continuation?: { readonly id: string; readonly fork?: boolean };\n}\n\nexport interface AgentAdapter {\n readonly name: string;\n readonly bootstrap?: string;\n readonly requiresFinishedEvent?: boolean;\n readonly variables?: Variables;\n readonly conversations?: \"claude\" | \"codex\";\n readonly storage?: ConversationStore;\n readonly capture?: boolean;\n readonly resumable?: boolean;\n transcriptUsage?(text: string): Usage | undefined;\n request(input: AgentInput): Command;\n events(line: string): readonly AgentEvent[];\n}\n\nexport interface RequiredAgent {\n readonly agent: AgentAdapter;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ArtifactReference } from "./artifact.types.ts";
2
+ export declare function artifactDigest(bytes: Uint8Array | string): string;
3
+ export declare function artifactId(reference: Omit<ArtifactReference, "id">): string;
4
+ export declare function validateArtifactReference(value: unknown): ArtifactReference;
@@ -0,0 +1,90 @@
1
+ import { artifactDigestPattern, artifactLabelMaxLength, } from "./artifact.constants.js";
2
+ import { createHash } from "node:crypto";
3
+ export function artifactDigest(bytes) {
4
+ return createHash("sha256").update(bytes).digest("hex");
5
+ }
6
+ export function artifactId(reference) {
7
+ return artifactDigest(JSON.stringify([
8
+ reference.format,
9
+ reference.digest,
10
+ reference.size,
11
+ reference.contract.name,
12
+ reference.contract.version,
13
+ reference.contract.encoding,
14
+ reference.producer.executionId,
15
+ reference.producer.taskKey,
16
+ reference.producer.attempt,
17
+ reference.parents,
18
+ ]));
19
+ }
20
+ export function validateArtifactReference(value) {
21
+ const invalid = () => new Error("Invalid artifact reference or lineage");
22
+ if (!value ||
23
+ typeof value !== "object" ||
24
+ !("format" in value) ||
25
+ value.format !== 1 ||
26
+ !("id" in value) ||
27
+ !digest(value.id) ||
28
+ !("digest" in value) ||
29
+ !digest(value.digest) ||
30
+ !("size" in value) ||
31
+ typeof value.size !== "number" ||
32
+ !Number.isSafeInteger(value.size) ||
33
+ value.size < 0 ||
34
+ !("contract" in value) ||
35
+ !value.contract ||
36
+ typeof value.contract !== "object" ||
37
+ !("producer" in value) ||
38
+ !value.producer ||
39
+ typeof value.producer !== "object" ||
40
+ !("parents" in value) ||
41
+ !Array.isArray(value.parents) ||
42
+ !value.parents.every(digest) ||
43
+ new Set(value.parents).size !== value.parents.length)
44
+ throw invalid();
45
+ const contract = value.contract, producer = value.producer;
46
+ if (!("name" in contract) ||
47
+ !label(contract.name) ||
48
+ !("version" in contract) ||
49
+ !label(contract.version) ||
50
+ !("encoding" in contract) ||
51
+ (contract.encoding !== "json" && contract.encoding !== "binary") ||
52
+ !("executionId" in producer) ||
53
+ !label(producer.executionId) ||
54
+ !("taskKey" in producer) ||
55
+ !label(producer.taskKey) ||
56
+ !("attempt" in producer) ||
57
+ typeof producer.attempt !== "number" ||
58
+ !Number.isSafeInteger(producer.attempt) ||
59
+ producer.attempt < 1)
60
+ throw invalid();
61
+ const reference = Object.freeze({
62
+ format: 1,
63
+ id: value.id,
64
+ digest: value.digest,
65
+ size: value.size,
66
+ contract: Object.freeze({
67
+ name: contract.name,
68
+ version: contract.version,
69
+ encoding: contract.encoding,
70
+ }),
71
+ producer: Object.freeze({
72
+ executionId: producer.executionId,
73
+ taskKey: producer.taskKey,
74
+ attempt: producer.attempt,
75
+ }),
76
+ parents: Object.freeze([...value.parents]),
77
+ });
78
+ if (artifactId(reference) !== reference.id)
79
+ throw invalid();
80
+ return reference;
81
+ }
82
+ function digest(value) {
83
+ return typeof value === "string" && artifactDigestPattern.test(value);
84
+ }
85
+ function label(value) {
86
+ return (typeof value === "string" &&
87
+ value.trim().length > 0 &&
88
+ value.length <= artifactLabelMaxLength);
89
+ }
90
+ //# sourceMappingURL=artifact-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-reference.js","sourceRoot":"","sources":["../../src/domain/artifact-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,SAAwC;IACjE,OAAO,cAAc,CACnB,IAAI,CAAC,SAAS,CAAC;QACb,SAAS,CAAC,MAAM;QAChB,SAAS,CAAC,MAAM;QAChB,SAAS,CAAC,IAAI;QACd,SAAS,CAAC,QAAQ,CAAC,IAAI;QACvB,SAAS,CAAC,QAAQ,CAAC,OAAO;QAC1B,SAAS,CAAC,Q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,EAAE,QAAQ,CAAC,QAAQ;SAC5B,CAAC;QACF,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,OAAO,EAAE,QAAQ,CAAC,OAAO;SAC1B,CAAC;QACF,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;KAC3C,CAAC,CAAC;IACH,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC,EAAE;QAAE,MAAM,OAAO,EAAE,CAAC;IAC5D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,KAAK,CAAC,KAAc;IAC3B,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;QACvB,KAAK,CAAC,MAAM,IAAI,sBAAsB,CACvC,CAAC;AACJ,CAAC","sourcesContent":["import {\n artifactDigestPattern,\n artifactLabelMaxLength,\n} from \"./artifact.constants.ts\";\nimport { createHash } from \"node:crypto\";\nimport type { ArtifactReference } from \"./artifact.types.ts\";\n\nexport function artifactDigest(bytes: Uint8Array | string): string {\n return createHash(\"sha256\").update(bytes).digest(\"hex\");\n}\n\nexport function artifactId(reference: Omit<ArtifactReference, \"id\">): string {\n return artifactDigest(\n JSON.stringify([\n reference.format,\n reference.digest,\n reference.size,\n reference.contract.name,\n reference.contract.version,\n reference.contract.encoding,\n reference.producer.executionId,\n reference.producer.taskKey,\n reference.producer.attempt,\n reference.parents,\n ]),\n );\n}\n\nexport function validateArtifactReference(value: unknown): ArtifactReference {\n const invalid = () => new Error(\"Invalid artifact reference or lineage\");\n if (\n !value ||\n typeof value !== \"object\" ||\n !(\"format\" in value) ||\n value.format !== 1 ||\n !(\"id\" in value) ||\n !digest(value.id) ||\n !(\"digest\" in value) ||\n !digest(value.digest) ||\n !(\"size\" in value) ||\n typeof value.size !== \"number\" ||\n !Number.isSafeInteger(value.size) ||\n value.size < 0 ||\n !(\"contract\" in value) ||\n !value.contract ||\n typeof value.contract !== \"object\" ||\n !(\"producer\" in value) ||\n !value.producer ||\n typeof value.producer !== \"object\" ||\n !(\"parents\" in value) ||\n !Array.isArray(value.parents) ||\n !value.parents.every(digest) ||\n new Set(value.parents).size !== value.parents.length\n )\n throw invalid();\n const contract = value.contract,\n producer = value.producer;\n if (\n !(\"name\" in contract) ||\n !label(contract.name) ||\n !(\"version\" in contract) ||\n !label(contract.version) ||\n !(\"encoding\" in contract) ||\n (contract.encoding !== \"json\" && contract.encoding !== \"binary\") ||\n !(\"executionId\" in producer) ||\n !label(producer.executionId) ||\n !(\"taskKey\" in producer) ||\n !label(producer.taskKey) ||\n !(\"attempt\" in producer) ||\n typeof producer.attempt !== \"number\" ||\n !Number.isSafeInteger(producer.attempt) ||\n producer.attempt < 1\n )\n throw invalid();\n const reference: ArtifactReference = Object.freeze({\n format: 1,\n id: value.id,\n digest: value.digest,\n size: value.size,\n contract: Object.freeze({\n name: contract.name,\n version: contract.version,\n encoding: contract.encoding,\n }),\n producer: Object.freeze({\n executionId: producer.executionId,\n taskKey: producer.taskKey,\n attempt: producer.attempt,\n }),\n parents: Object.freeze([...value.parents]),\n });\n if (artifactId(reference) !== reference.id) throw invalid();\n return reference;\n}\n\nfunction digest(value: unknown): value is string {\n return typeof value === \"string\" && artifactDigestPattern.test(value);\n}\n\nfunction label(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n value.trim().length > 0 &&\n value.length <= artifactLabelMaxLength\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const artifactLabelMaxLength = 1024;
2
+ export declare const artifactDigestPattern: RegExp;
@@ -0,0 +1,3 @@
1
+ export const artifactLabelMaxLength = 1024;
2
+ export const artifactDigestPattern = /^[a-f0-9]{64}$/;
3
+ //# sourceMappingURL=artifact.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.constants.js","sourceRoot":"","sources":["../../src/domain/artifact.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC","sourcesContent":["export const artifactLabelMaxLength = 1024;\nexport const artifactDigestPattern = /^[a-f0-9]{64}$/;\n"]}
@@ -0,0 +1,7 @@
1
+ import type { ArtifactContract, ArtifactContractOptions, ArtifactReference, ArtifactStore, JsonArtifactOptions, PublishArtifactOptions, ReadArtifactOptions } from "./artifact.types.ts";
2
+ export declare const artifact: {
3
+ json<T>(options: JsonArtifactOptions<T>): ArtifactContract<T>;
4
+ binary(options: ArtifactContractOptions): ArtifactContract<Uint8Array>;
5
+ };
6
+ export declare function publishArtifact<T>(store: ArtifactStore, contract: ArtifactContract<T>, value: T, options: PublishArtifactOptions): Promise<ArtifactReference>;
7
+ export declare function readStoredArtifact<T>(store: ArtifactStore, contract: ArtifactContract<T>, value: unknown, options?: ReadArtifactOptions): Promise<T>;
@@ -0,0 +1,104 @@
1
+ import { artifactLabelMaxLength } from "./artifact.constants.js";
2
+ import { artifactDigest, artifactId, validateArtifactReference, } from "./artifact-reference.js";
3
+ import { checkpointValue } from "./workflow/checkpoint-value.js";
4
+ function identity(options) {
5
+ if (!options.name.trim() ||
6
+ !options.version.trim() ||
7
+ options.name.length > artifactLabelMaxLength ||
8
+ options.version.length > artifactLabelMaxLength)
9
+ throw new Error(`Artifact contract name and version must be nonempty and at most ${artifactLabelMaxLength} characters`);
10
+ return { name: options.name, version: options.version };
11
+ }
12
+ export const artifact = {
13
+ json(options) {
14
+ const schema = options.schema;
15
+ async function validate(value) {
16
+ if (typeof schema === "function")
17
+ return schema(value);
18
+ const result = await schema["~standard"].validate(value);
19
+ if (result.issues)
20
+ throw new Error(`Artifact schema validation failed: ${JSON.stringify(result.issues)}`);
21
+ return result.value;
22
+ }
23
+ return Object.freeze({
24
+ ...identity(options),
25
+ encoding: "json",
26
+ async encode(value) {
27
+ const checked = checkpointValue(await validate(value));
28
+ if (checked.kind !== "json")
29
+ throw new Error("Artifact payload must be JSON");
30
+ return Buffer.from(JSON.stringify(checked.value));
31
+ },
32
+ async decode(bytes) {
33
+ return validate(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)));
34
+ },
35
+ });
36
+ },
37
+ binary(options) {
38
+ return Object.freeze({
39
+ ...identity(options),
40
+ encoding: "binary",
41
+ async encode(value) {
42
+ if (!(value instanceof Uint8Array))
43
+ throw new Error("Artifact payload must be Uint8Array");
44
+ return Uint8Array.from(value);
45
+ },
46
+ async decode(bytes) {
47
+ return Uint8Array.from(bytes);
48
+ },
49
+ });
50
+ },
51
+ };
52
+ export async function publishArtifact(store, contract, value, options) {
53
+ options.signal?.throwIfAborted();
54
+ const producer = { ...options.producer };
55
+ const parents = (options.parents ?? []).map((parent) => validateArtifactReference(parent).id);
56
+ const bytes = Uint8Array.from(await contract.encode(value));
57
+ options.signal?.throwIfAborted();
58
+ const metadata = {
59
+ format: 1,
60
+ digest: artifactDigest(bytes),
61
+ size: bytes.length,
62
+ contract: {
63
+ name: contract.name,
64
+ version: contract.version,
65
+ encoding: contract.encoding,
66
+ },
67
+ producer,
68
+ parents,
69
+ };
70
+ const reference = validateArtifactReference({
71
+ ...metadata,
72
+ id: artifactId(metadata),
73
+ });
74
+ await store.put(reference.id, bytes, options.signal);
75
+ options.signal?.throwIfAborted();
76
+ return reference;
77
+ }
78
+ export async function readStoredArtifact(store, contract, value, options = {}) {
79
+ options.signal?.throwIfAborted();
80
+ const reference = validateArtifactReference(value);
81
+ if (reference.contract.name !== contract.name ||
82
+ reference.contract.version !== contract.version ||
83
+ reference.contract.encoding !== contract.encoding)
84
+ throw new Error("Artifact contract mismatch");
85
+ const producer = options.producer;
86
+ if (producer &&
87
+ (reference.producer.executionId !== producer.executionId ||
88
+ reference.producer.taskKey !== producer.taskKey ||
89
+ reference.producer.attempt !== producer.attempt))
90
+ throw new Error("Artifact producer mismatch");
91
+ if (options.parents &&
92
+ JSON.stringify(reference.parents) !==
93
+ JSON.stringify(options.parents.map((parent) => validateArtifactReference(parent).id)))
94
+ throw new Error("Artifact lineage mismatch");
95
+ const bytes = await store.get(reference.id, options.signal);
96
+ options.signal?.throwIfAborted();
97
+ if (bytes.length !== reference.size ||
98
+ artifactDigest(bytes) !== reference.digest)
99
+ throw new Error("Artifact content integrity mismatch");
100
+ const result = await contract.decode(bytes);
101
+ options.signal?.throwIfAborted();
102
+ return result;
103
+ }
104
+ //# sourceMappingURL=artifact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/domain/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,UAAU,EACV,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAWjE,SAAS,QAAQ,CAAC,OAAgC;IAChD,IACE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;QACpB,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,sBAAsB;QAC5C,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,sBAAsB;QAE/C,MAAM,IAAI,KAAK,CACb,mEAAmE,sBAAsB,aAAa,CACvG,CAAC;IACJ,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,CAAI,OAA+B;Q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QAEH,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IACjC,IACE,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,IAAI;QAC/B,cAAc,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,MAAM;QAE1C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IACjC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { artifactLabelMaxLength } from \"./artifact.constants.ts\";\nimport {\n artifactDigest,\n artifactId,\n validateArtifactReference,\n} from \"./artifact-reference.ts\";\nimport { checkpointValue } from \"./workflow/checkpoint-value.ts\";\nimport type {\n ArtifactContract,\n ArtifactContractOptions,\n ArtifactReference,\n ArtifactStore,\n JsonArtifactOptions,\n PublishArtifactOptions,\n ReadArtifactOptions,\n} from \"./artifact.types.ts\";\n\nfunction identity(options: ArtifactContractOptions): ArtifactContractOptions {\n if (\n !options.name.trim() ||\n !options.version.trim() ||\n options.name.length > artifactLabelMaxLength ||\n options.version.length > artifactLabelMaxLength\n )\n throw new Error(\n `Artifact contract name and version must be nonempty and at most ${artifactLabelMaxLength} characters`,\n );\n return { name: options.name, version: options.version };\n}\n\nexport const artifact = {\n json<T>(options: JsonArtifactOptions<T>): ArtifactContract<T> {\n const schema = options.schema;\n async function validate(value: unknown): Promise<T> {\n if (typeof schema === \"function\") return schema(value);\n const result = await schema[\"~standard\"].validate(value);\n if (result.issues)\n throw new Error(\n `Artifact schema validation failed: ${JSON.stringify(result.issues)}`,\n );\n return result.value;\n }\n return Object.freeze({\n ...identity(options),\n encoding: \"json\",\n async encode(value: T) {\n const checked = checkpointValue(await validate(value));\n if (checked.kind !== \"json\")\n throw new Error(\"Artifact payload must be JSON\");\n return Buffer.from(JSON.stringify(checked.value));\n },\n async decode(bytes: Uint8Array) {\n return validate(\n JSON.parse(\n new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes),\n ) as unknown,\n );\n },\n });\n },\n binary(options: ArtifactContractOptions): ArtifactContract<Uint8Array> {\n return Object.freeze({\n ...identity(options),\n encoding: \"binary\",\n async encode(value: Uint8Array) {\n if (!(value instanceof Uint8Array))\n throw new Error(\"Artifact payload must be Uint8Array\");\n return Uint8Array.from(value);\n },\n async decode(bytes: Uint8Array) {\n return Uint8Array.from(bytes);\n },\n });\n },\n};\n\nexport async function publishArtifact<T>(\n store: ArtifactStore,\n contract: ArtifactContract<T>,\n value: T,\n options: PublishArtifactOptions,\n): Promise<ArtifactReference> {\n options.signal?.throwIfAborted();\n const producer = { ...options.producer };\n const parents = (options.parents ?? []).map(\n (parent) => validateArtifactReference(parent).id,\n );\n const bytes = Uint8Array.from(await contract.encode(value));\n options.signal?.throwIfAborted();\n const metadata = {\n format: 1 as const,\n digest: artifactDigest(bytes),\n size: bytes.length,\n contract: {\n name: contract.name,\n version: contract.version,\n encoding: contract.encoding,\n },\n producer,\n parents,\n };\n const reference = validateArtifactReference({\n ...metadata,\n id: artifactId(metadata),\n });\n await store.put(reference.id, bytes, options.signal);\n options.signal?.throwIfAborted();\n return reference;\n}\n\nexport async function readStoredArtifact<T>(\n store: ArtifactStore,\n contract: ArtifactContract<T>,\n value: unknown,\n options: ReadArtifactOptions = {},\n): Promise<T> {\n options.signal?.throwIfAborted();\n const reference = validateArtifactReference(value);\n if (\n reference.contract.name !== contract.name ||\n reference.contract.version !== contract.version ||\n reference.contract.encoding !== contract.encoding\n )\n throw new Error(\"Artifact contract mismatch\");\n const producer = options.producer;\n if (\n producer &&\n (reference.producer.executionId !== producer.executionId ||\n reference.producer.taskKey !== producer.taskKey ||\n reference.producer.attempt !== producer.attempt)\n )\n throw new Error(\"Artifact producer mismatch\");\n if (\n options.parents &&\n JSON.stringify(reference.parents) !==\n JSON.stringify(\n options.parents.map((parent) => validateArtifactReference(parent).id),\n )\n )\n throw new Error(\"Artifact lineage mismatch\");\n const bytes = await store.get(reference.id, options.signal);\n options.signal?.throwIfAborted();\n if (\n bytes.length !== reference.size ||\n artifactDigest(bytes) !== reference.digest\n )\n throw new Error(\"Artifact content integrity mismatch\");\n const result = await contract.decode(bytes);\n options.signal?.throwIfAborted();\n return result;\n}\n"]}
@@ -0,0 +1,44 @@
1
+ import type { StandardValidator } from "./response.types.ts";
2
+ export interface ArtifactIdentity {
3
+ readonly name: string;
4
+ readonly version: string;
5
+ readonly encoding: "json" | "binary";
6
+ }
7
+ export interface ArtifactProducer {
8
+ readonly executionId: string;
9
+ readonly taskKey: string;
10
+ readonly attempt: number;
11
+ }
12
+ export interface ArtifactReference {
13
+ readonly format: 1;
14
+ readonly id: string;
15
+ readonly digest: string;
16
+ readonly size: number;
17
+ readonly contract: ArtifactIdentity;
18
+ readonly producer: ArtifactProducer;
19
+ readonly parents: readonly string[];
20
+ }
21
+ export interface ArtifactContract<T> extends ArtifactIdentity {
22
+ encode(value: T): Promise<Uint8Array>;
23
+ decode(bytes: Uint8Array): Promise<T>;
24
+ }
25
+ export type ArtifactContractOptions = Pick<ArtifactIdentity, "name" | "version">;
26
+ export type JsonArtifactOptions<T> = ArtifactContractOptions & {
27
+ readonly schema: StandardValidator<T> | ((input: unknown) => T | Promise<T>);
28
+ };
29
+ export interface ArtifactStore {
30
+ /** Publish atomically; reject conflicting bytes for an existing ID. */
31
+ put(id: string, bytes: Uint8Array, signal?: AbortSignal): Promise<void>;
32
+ /** Read bounded bytes or reject missing objects; callers verify integrity. */
33
+ get(id: string, signal?: AbortSignal): Promise<Uint8Array>;
34
+ }
35
+ export interface PublishArtifactOptions {
36
+ readonly producer: ArtifactProducer;
37
+ readonly parents?: readonly ArtifactReference[];
38
+ readonly signal?: AbortSignal;
39
+ }
40
+ export interface ReadArtifactOptions {
41
+ readonly producer?: ArtifactProducer;
42
+ readonly parents?: readonly ArtifactReference[];
43
+ readonly signal?: AbortSignal;
44
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=artifact.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.types.js","sourceRoot":"","sources":["../../src/domain/artifact.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StandardValidator } from \"./response.types.ts\";\n\nexport interface ArtifactIdentity {\n readonly name: string;\n readonly version: string;\n readonly encoding: \"json\" | \"binary\";\n}\n\nexport interface ArtifactProducer {\n readonly executionId: string;\n readonly taskKey: string;\n readonly attempt: number;\n}\n\nexport interface ArtifactReference {\n readonly format: 1;\n readonly id: string;\n readonly digest: string;\n readonly size: number;\n readonly contract: ArtifactIdentity;\n readonly producer: ArtifactProducer;\n readonly parents: readonly string[];\n}\n\nexport interface ArtifactContract<T> extends ArtifactIdentity {\n encode(value: T): Promise<Uint8Array>;\n decode(bytes: Uint8Array): Promise<T>;\n}\n\nexport type ArtifactContractOptions = Pick<\n ArtifactIdentity,\n \"name\" | \"version\"\n>;\nexport type JsonArtifactOptions<T> = ArtifactContractOptions & {\n readonly schema: StandardValidator<T> | ((input: unknown) => T | Promise<T>);\n};\n\nexport interface ArtifactStore {\n /** Publish atomically; reject conflicting bytes for an existing ID. */\n put(id: string, bytes: Uint8Array, signal?: AbortSignal): Promise<void>;\n /** Read bounded bytes or reject missing objects; callers verify integrity. */\n get(id: string, signal?: AbortSignal): Promise<Uint8Array>;\n}\n\nexport interface PublishArtifactOptions {\n readonly producer: ArtifactProducer;\n readonly parents?: readonly ArtifactReference[];\n readonly signal?: AbortSignal;\n}\n\nexport interface ReadArtifactOptions {\n readonly producer?: ArtifactProducer;\n readonly parents?: readonly ArtifactReference[];\n readonly signal?: AbortSignal;\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare const egressFields: readonly string[];
@@ -0,0 +1,7 @@
1
+ export const egressFields = [
2
+ "mode",
3
+ "domains",
4
+ "allowCidrs",
5
+ "denyCidrs",
6
+ ];
7
+ //# sourceMappingURL=egress.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"egress.constants.js","sourceRoot":"","sources":["../../src/domain/egress.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,MAAM;IACN,SAAS;IACT,YAAY;IACZ,WAAW;CACZ,CAAC","sourcesContent":["export const egressFields: readonly string[] = [\n \"mode\",\n \"domains\",\n \"allowCidrs\",\n \"denyCidrs\",\n];\n"]}
@@ -0,0 +1,2 @@
1
+ import type { EgressPolicy } from "./egress.types.ts";
2
+ export declare function validateEgress(value: unknown): EgressPolicy | undefined;