@elie-laloum/outpost 1.1.4 → 3.0.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 (368) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +12 -6
  3. package/dist/adapters/agents/claude-diagnostics.d.ts +1 -0
  4. package/dist/adapters/agents/claude-diagnostics.js +7 -0
  5. package/dist/adapters/agents/claude-diagnostics.js.map +1 -0
  6. package/dist/adapters/agents/cli-diagnostics.constants.d.ts +12 -0
  7. package/dist/adapters/agents/cli-diagnostics.constants.js +24 -0
  8. package/dist/adapters/agents/cli-diagnostics.constants.js.map +1 -0
  9. package/dist/adapters/agents/cli-diagnostics.d.ts +4 -0
  10. package/dist/adapters/agents/cli-diagnostics.js +14 -0
  11. package/dist/adapters/agents/cli-diagnostics.js.map +1 -0
  12. package/dist/adapters/agents/cli-diagnostics.types.d.ts +13 -0
  13. package/dist/adapters/agents/cli-diagnostics.types.js +2 -0
  14. package/dist/adapters/agents/cli-diagnostics.types.js.map +1 -0
  15. package/dist/adapters/agents/codex-diagnostics.d.ts +1 -0
  16. package/dist/adapters/agents/codex-diagnostics.js +7 -0
  17. package/dist/adapters/agents/codex-diagnostics.js.map +1 -0
  18. package/dist/adapters/agents/protocol-fixtures.constants.d.ts +2 -0
  19. package/dist/adapters/agents/protocol-fixtures.constants.js +68 -0
  20. package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -0
  21. package/dist/adapters/agents/protocol-fixtures.types.d.ts +6 -0
  22. package/dist/adapters/agents/protocol-fixtures.types.js +2 -0
  23. package/dist/adapters/agents/protocol-fixtures.types.js.map +1 -0
  24. package/dist/application/diagnostic-probe.d.ts +3 -0
  25. package/dist/application/diagnostic-probe.js +55 -0
  26. package/dist/application/diagnostic-probe.js.map +1 -0
  27. package/dist/application/doctor-agent.constants.d.ts +9 -0
  28. package/dist/application/doctor-agent.constants.js +8 -0
  29. package/dist/application/doctor-agent.constants.js.map +1 -0
  30. package/dist/application/doctor-agent.d.ts +3 -0
  31. package/dist/application/doctor-agent.js +53 -0
  32. package/dist/application/doctor-agent.js.map +1 -0
  33. package/dist/application/doctor-image.d.ts +3 -0
  34. package/dist/application/doctor-image.js +133 -0
  35. package/dist/application/doctor-image.js.map +1 -0
  36. package/dist/application/doctor-protocol.d.ts +3 -0
  37. package/dist/application/doctor-protocol.js +29 -0
  38. package/dist/application/doctor-protocol.js.map +1 -0
  39. package/dist/application/doctor-protocol.types.d.ts +10 -0
  40. package/dist/application/doctor-protocol.types.js +2 -0
  41. package/dist/application/doctor-protocol.types.js.map +1 -0
  42. package/dist/application/doctor-sandbox.constants.d.ts +5 -0
  43. package/dist/application/doctor-sandbox.constants.js +6 -0
  44. package/dist/application/doctor-sandbox.constants.js.map +1 -0
  45. package/dist/application/doctor-sandbox.d.ts +4 -0
  46. package/dist/application/doctor-sandbox.js +133 -0
  47. package/dist/application/doctor-sandbox.js.map +1 -0
  48. package/dist/application/doctor-sandbox.types.d.ts +23 -0
  49. package/dist/application/doctor-sandbox.types.js +2 -0
  50. package/dist/application/doctor-sandbox.types.js.map +1 -0
  51. package/dist/application/doctor-transfers.constants.d.ts +6 -0
  52. package/dist/application/doctor-transfers.constants.js +7 -0
  53. package/dist/application/doctor-transfers.constants.js.map +1 -0
  54. package/dist/application/doctor-transfers.d.ts +4 -0
  55. package/dist/application/doctor-transfers.js +88 -0
  56. package/dist/application/doctor-transfers.js.map +1 -0
  57. package/dist/application/doctor.constants.d.ts +9 -0
  58. package/dist/application/doctor.constants.js +15 -0
  59. package/dist/application/doctor.constants.js.map +1 -0
  60. package/dist/application/doctor.d.ts +3 -0
  61. package/dist/application/doctor.js +106 -0
  62. package/dist/application/doctor.js.map +1 -0
  63. package/dist/application/doctor.types.d.ts +39 -0
  64. package/dist/application/doctor.types.js +2 -0
  65. package/dist/application/doctor.types.js.map +1 -0
  66. package/dist/application/execution.js +1 -0
  67. package/dist/application/execution.js.map +1 -1
  68. package/dist/application/outpost.types.d.ts +2 -0
  69. package/dist/application/outpost.types.js.map +1 -1
  70. package/dist/application/recovery-checksum-capture.d.ts +2 -0
  71. package/dist/application/recovery-checksum-capture.js +32 -0
  72. package/dist/application/recovery-checksum-capture.js.map +1 -0
  73. package/dist/application/recovery-checksum-paths.d.ts +2 -0
  74. package/dist/application/recovery-checksum-paths.js +11 -0
  75. package/dist/application/recovery-checksum-paths.js.map +1 -0
  76. package/dist/application/recovery-checksums.constants.d.ts +5 -0
  77. package/dist/application/recovery-checksums.constants.js +6 -0
  78. package/dist/application/recovery-checksums.constants.js.map +1 -0
  79. package/dist/application/recovery-checksums.d.ts +3 -0
  80. package/dist/application/recovery-checksums.js +94 -0
  81. package/dist/application/recovery-checksums.js.map +1 -0
  82. package/dist/application/recovery-checksums.types.d.ts +17 -0
  83. package/dist/application/recovery-checksums.types.js +2 -0
  84. package/dist/application/recovery-checksums.types.js.map +1 -0
  85. package/dist/application/recovery-inspection.d.ts +2 -0
  86. package/dist/application/recovery-inspection.js +27 -0
  87. package/dist/application/recovery-inspection.js.map +1 -0
  88. package/dist/application/recovery-inspection.types.d.ts +15 -0
  89. package/dist/application/recovery-inspection.types.js +2 -0
  90. package/dist/application/recovery-inspection.types.js.map +1 -0
  91. package/dist/application/recovery-restorability.d.ts +2 -0
  92. package/dist/application/recovery-restorability.js +137 -0
  93. package/dist/application/recovery-restorability.js.map +1 -0
  94. package/dist/application/recovery-retention-policy.d.ts +2 -0
  95. package/dist/application/recovery-retention-policy.js +21 -0
  96. package/dist/application/recovery-retention-policy.js.map +1 -0
  97. package/dist/application/recovery-retention.constants.d.ts +3 -0
  98. package/dist/application/recovery-retention.constants.js +2 -0
  99. package/dist/application/recovery-retention.constants.js.map +1 -0
  100. package/dist/application/recovery-retention.d.ts +4 -0
  101. package/dist/application/recovery-retention.js +202 -0
  102. package/dist/application/recovery-retention.js.map +1 -0
  103. package/dist/application/recovery-retention.types.d.ts +52 -0
  104. package/dist/application/recovery-retention.types.js +2 -0
  105. package/dist/application/recovery-retention.types.js.map +1 -0
  106. package/dist/application/recovery-verification.constants.d.ts +5 -0
  107. package/dist/application/recovery-verification.constants.js +10 -0
  108. package/dist/application/recovery-verification.constants.js.map +1 -0
  109. package/dist/application/recovery-verification.d.ts +2 -0
  110. package/dist/application/recovery-verification.js +107 -0
  111. package/dist/application/recovery-verification.js.map +1 -0
  112. package/dist/application/recovery-verification.types.d.ts +26 -0
  113. package/dist/application/recovery-verification.types.js +2 -0
  114. package/dist/application/recovery-verification.types.js.map +1 -0
  115. package/dist/application/remote-apply.js +24 -6
  116. package/dist/application/remote-apply.js.map +1 -1
  117. package/dist/application/remote-backup.js +6 -2
  118. package/dist/application/remote-backup.js.map +1 -1
  119. package/dist/application/remote-download.js +36 -4
  120. package/dist/application/remote-download.js.map +1 -1
  121. package/dist/application/remote-validation.js +19 -0
  122. package/dist/application/remote-validation.js.map +1 -1
  123. package/dist/application/remote-workspace.constants.d.ts +3 -0
  124. package/dist/application/remote-workspace.constants.js +2 -0
  125. package/dist/application/remote-workspace.constants.js.map +1 -0
  126. package/dist/application/remote-workspace.js +6 -0
  127. package/dist/application/remote-workspace.js.map +1 -1
  128. package/dist/application/remote-workspace.types.d.ts +3 -1
  129. package/dist/application/remote-workspace.types.js.map +1 -1
  130. package/dist/application/sandbox.js +11 -0
  131. package/dist/application/sandbox.js.map +1 -1
  132. package/dist/application/task-usage.d.ts +4 -0
  133. package/dist/application/task-usage.js +41 -0
  134. package/dist/application/task-usage.js.map +1 -0
  135. package/dist/application/task-usage.types.d.ts +5 -0
  136. package/dist/application/task-usage.types.js +2 -0
  137. package/dist/application/task-usage.types.js.map +1 -0
  138. package/dist/application/tasks.js +23 -2
  139. package/dist/application/tasks.js.map +1 -1
  140. package/dist/cli/commands.js +4 -0
  141. package/dist/cli/commands.js.map +1 -1
  142. package/dist/cli/doctor-command.d.ts +3 -0
  143. package/dist/cli/doctor-command.js +38 -0
  144. package/dist/cli/doctor-command.js.map +1 -0
  145. package/dist/cli/image.js +1 -1
  146. package/dist/cli/image.js.map +1 -1
  147. package/dist/cli/init-command.js +4 -3
  148. package/dist/cli/init-command.js.map +1 -1
  149. package/dist/cli/main.constants.d.ts +29 -8
  150. package/dist/cli/main.constants.js +19 -7
  151. package/dist/cli/main.constants.js.map +1 -1
  152. package/dist/cli/project-settings.js +8 -2
  153. package/dist/cli/project-settings.js.map +1 -1
  154. package/dist/cli/recovery-command.d.ts +2 -0
  155. package/dist/cli/recovery-command.js +69 -0
  156. package/dist/cli/recovery-command.js.map +1 -0
  157. package/dist/cli/recovery-prune-command.d.ts +2 -0
  158. package/dist/cli/recovery-prune-command.js +34 -0
  159. package/dist/cli/recovery-prune-command.js.map +1 -0
  160. package/dist/cli/recovery-verify-command.d.ts +2 -0
  161. package/dist/cli/recovery-verify-command.js +43 -0
  162. package/dist/cli/recovery-verify-command.js.map +1 -0
  163. package/dist/cli/scaffold-files.d.ts +1 -1
  164. package/dist/cli/scaffold-files.js +26 -20
  165. package/dist/cli/scaffold-files.js.map +1 -1
  166. package/dist/cli/scaffold-validation.js +2 -5
  167. package/dist/cli/scaffold-validation.js.map +1 -1
  168. package/dist/cli/scaffold.constants.d.ts +0 -2
  169. package/dist/cli/scaffold.constants.js +1 -13
  170. package/dist/cli/scaffold.constants.js.map +1 -1
  171. package/dist/cli/scaffold.d.ts +1 -1
  172. package/dist/cli/scaffold.js +37 -29
  173. package/dist/cli/scaffold.js.map +1 -1
  174. package/dist/cli/scaffold.types.d.ts +3 -5
  175. package/dist/cli/scaffold.types.js.map +1 -1
  176. package/dist/cli/starters.d.ts +1 -2
  177. package/dist/cli/starters.js +42 -30
  178. package/dist/cli/starters.js.map +1 -1
  179. package/dist/domain/ports.d.ts +1 -1
  180. package/dist/domain/ports.js.map +1 -1
  181. package/dist/domain/sandbox.types.d.ts +12 -0
  182. package/dist/domain/sandbox.types.js.map +1 -1
  183. package/dist/domain/workflow/budget.constants.d.ts +1 -0
  184. package/dist/domain/workflow/budget.constants.js +7 -0
  185. package/dist/domain/workflow/budget.constants.js.map +1 -0
  186. package/dist/domain/workflow/budget.d.ts +9 -0
  187. package/dist/domain/workflow/budget.js +67 -0
  188. package/dist/domain/workflow/budget.js.map +1 -0
  189. package/dist/domain/workflow/budget.types.d.ts +15 -0
  190. package/dist/domain/workflow/budget.types.js +2 -0
  191. package/dist/domain/workflow/budget.types.js.map +1 -0
  192. package/dist/domain/workflow/task-runner.js +8 -1
  193. package/dist/domain/workflow/task-runner.js.map +1 -1
  194. package/dist/domain/workflow/workflow-scheduler.js +4 -2
  195. package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
  196. package/dist/domain/workflow/workflow-state.js +29 -0
  197. package/dist/domain/workflow/workflow-state.js.map +1 -1
  198. package/dist/domain/workflow.d.ts +2 -0
  199. package/dist/domain/workflow.js +1 -0
  200. package/dist/domain/workflow.js.map +1 -1
  201. package/dist/domain/workflow.types.d.ts +10 -1
  202. package/dist/domain/workflow.types.js.map +1 -1
  203. package/dist/index.d.ts +12 -8
  204. package/dist/index.js +5 -3
  205. package/dist/index.js.map +1 -1
  206. package/dist/infrastructure/file-manifest.d.ts +6 -0
  207. package/dist/infrastructure/file-manifest.js +91 -0
  208. package/dist/infrastructure/file-manifest.js.map +1 -0
  209. package/dist/infrastructure/git/lock-inspection.constants.d.ts +4 -0
  210. package/dist/infrastructure/git/lock-inspection.constants.js +5 -0
  211. package/dist/infrastructure/git/lock-inspection.constants.js.map +1 -0
  212. package/dist/infrastructure/git/lock-inspection.d.ts +3 -0
  213. package/dist/infrastructure/git/lock-inspection.js +64 -0
  214. package/dist/infrastructure/git/lock-inspection.js.map +1 -0
  215. package/dist/infrastructure/git/lock-inspection.types.d.ts +27 -0
  216. package/dist/infrastructure/git/lock-inspection.types.js +2 -0
  217. package/dist/infrastructure/git/lock-inspection.types.js.map +1 -0
  218. package/dist/infrastructure/git/lock.d.ts +1 -0
  219. package/dist/infrastructure/git/lock.js +70 -29
  220. package/dist/infrastructure/git/lock.js.map +1 -1
  221. package/dist/infrastructure/git/process-identity.d.ts +3 -0
  222. package/dist/infrastructure/git/process-identity.js +73 -0
  223. package/dist/infrastructure/git/process-identity.js.map +1 -0
  224. package/dist/infrastructure/git/process-identity.types.d.ts +10 -0
  225. package/dist/infrastructure/git/process-identity.types.js +2 -0
  226. package/dist/infrastructure/git/process-identity.types.js.map +1 -0
  227. package/dist/infrastructure/git/verification-command.d.ts +1 -0
  228. package/dist/infrastructure/git/verification-command.js +36 -0
  229. package/dist/infrastructure/git/verification-command.js.map +1 -0
  230. package/dist/infrastructure/git/workspace-lease.js +1 -0
  231. package/dist/infrastructure/git/workspace-lease.js.map +1 -1
  232. package/dist/infrastructure/git/workspace.js +5 -1
  233. package/dist/infrastructure/git/workspace.js.map +1 -1
  234. package/dist/infrastructure/git/worktree-inspection.constants.d.ts +5 -0
  235. package/dist/infrastructure/git/worktree-inspection.constants.js +16 -0
  236. package/dist/infrastructure/git/worktree-inspection.constants.js.map +1 -0
  237. package/dist/infrastructure/git/worktree-inspection.d.ts +3 -0
  238. package/dist/infrastructure/git/worktree-inspection.js +120 -0
  239. package/dist/infrastructure/git/worktree-inspection.js.map +1 -0
  240. package/dist/infrastructure/git/worktree-inspection.types.d.ts +19 -0
  241. package/dist/infrastructure/git/worktree-inspection.types.js +2 -0
  242. package/dist/infrastructure/git/worktree-inspection.types.js.map +1 -0
  243. package/dist/infrastructure/inspection-file.constants.d.ts +1 -0
  244. package/dist/infrastructure/inspection-file.constants.js +5 -0
  245. package/dist/infrastructure/inspection-file.constants.js.map +1 -0
  246. package/dist/infrastructure/inspection-file.d.ts +1 -0
  247. package/dist/infrastructure/inspection-file.js +43 -0
  248. package/dist/infrastructure/inspection-file.js.map +1 -0
  249. package/dist/infrastructure/inspection-hash.constants.d.ts +1 -0
  250. package/dist/infrastructure/inspection-hash.constants.js +2 -0
  251. package/dist/infrastructure/inspection-hash.constants.js.map +1 -0
  252. package/dist/infrastructure/inspection-hash.d.ts +2 -0
  253. package/dist/infrastructure/inspection-hash.js +62 -0
  254. package/dist/infrastructure/inspection-hash.js.map +1 -0
  255. package/dist/infrastructure/inspection-hash.types.d.ts +5 -0
  256. package/dist/infrastructure/inspection-hash.types.js +2 -0
  257. package/dist/infrastructure/inspection-hash.types.js.map +1 -0
  258. package/dist/infrastructure/journal-retention.constants.d.ts +4 -0
  259. package/dist/infrastructure/journal-retention.constants.js +5 -0
  260. package/dist/infrastructure/journal-retention.constants.js.map +1 -0
  261. package/dist/infrastructure/journal-retention.d.ts +2 -0
  262. package/dist/infrastructure/journal-retention.js +51 -0
  263. package/dist/infrastructure/journal-retention.js.map +1 -0
  264. package/dist/infrastructure/journal.js +37 -13
  265. package/dist/infrastructure/journal.js.map +1 -1
  266. package/dist/infrastructure/opentelemetry.constants.d.ts +10 -0
  267. package/dist/infrastructure/opentelemetry.constants.js +11 -0
  268. package/dist/infrastructure/opentelemetry.constants.js.map +1 -0
  269. package/dist/infrastructure/opentelemetry.d.ts +3 -0
  270. package/dist/infrastructure/opentelemetry.js +131 -0
  271. package/dist/infrastructure/opentelemetry.js.map +1 -0
  272. package/dist/infrastructure/opentelemetry.types.d.ts +21 -0
  273. package/dist/infrastructure/opentelemetry.types.js +2 -0
  274. package/dist/infrastructure/opentelemetry.types.js.map +1 -0
  275. package/dist/infrastructure/storage-inventory.constants.d.ts +6 -0
  276. package/dist/infrastructure/storage-inventory.constants.js +11 -0
  277. package/dist/infrastructure/storage-inventory.constants.js.map +1 -0
  278. package/dist/infrastructure/storage-inventory.d.ts +2 -0
  279. package/dist/infrastructure/storage-inventory.js +123 -0
  280. package/dist/infrastructure/storage-inventory.js.map +1 -0
  281. package/dist/infrastructure/storage-inventory.types.d.ts +38 -0
  282. package/dist/infrastructure/storage-inventory.types.js +2 -0
  283. package/dist/infrastructure/storage-inventory.types.js.map +1 -0
  284. package/dist/infrastructure/transfer.js +12 -0
  285. package/dist/infrastructure/transfer.js.map +1 -1
  286. package/dist/providers/cloud.constants.d.ts +1 -0
  287. package/dist/providers/cloud.constants.js +1 -0
  288. package/dist/providers/cloud.constants.js.map +1 -1
  289. package/dist/providers/container-cache.constants.d.ts +11 -0
  290. package/dist/providers/container-cache.constants.js +9 -0
  291. package/dist/providers/container-cache.constants.js.map +1 -0
  292. package/dist/providers/container-cache.d.ts +4 -0
  293. package/dist/providers/container-cache.js +48 -0
  294. package/dist/providers/container-cache.js.map +1 -0
  295. package/dist/providers/container-cache.types.d.ts +8 -0
  296. package/dist/providers/container-cache.types.js +2 -0
  297. package/dist/providers/container-cache.types.js.map +1 -0
  298. package/dist/providers/container-plan.js +3 -1
  299. package/dist/providers/container-plan.js.map +1 -1
  300. package/dist/providers/container.js +31 -1
  301. package/dist/providers/container.js.map +1 -1
  302. package/dist/providers/container.types.d.ts +2 -0
  303. package/dist/providers/container.types.js.map +1 -1
  304. package/dist/providers/daytona-command.js +7 -4
  305. package/dist/providers/daytona-command.js.map +1 -1
  306. package/dist/providers/daytona.js +13 -4
  307. package/dist/providers/daytona.js.map +1 -1
  308. package/dist/providers/diagnostic-container.d.ts +4 -0
  309. package/dist/providers/diagnostic-container.js +15 -0
  310. package/dist/providers/diagnostic-container.js.map +1 -0
  311. package/dist/providers/docker.d.ts +1 -0
  312. package/dist/providers/docker.js.map +1 -1
  313. package/dist/providers/file-batches.constants.d.ts +10 -0
  314. package/dist/providers/file-batches.constants.js +57 -0
  315. package/dist/providers/file-batches.constants.js.map +1 -0
  316. package/dist/providers/file-batches.d.ts +2 -0
  317. package/dist/providers/file-batches.js +151 -0
  318. package/dist/providers/file-batches.js.map +1 -0
  319. package/dist/providers/podman.d.ts +1 -0
  320. package/dist/providers/podman.js.map +1 -1
  321. package/dist/providers/vercel.js +3 -1
  322. package/dist/providers/vercel.js.map +1 -1
  323. package/package.json +12 -1
  324. package/dist/adapters/backlogs/backlog.constants.d.ts +0 -4
  325. package/dist/adapters/backlogs/backlog.constants.js +0 -5
  326. package/dist/adapters/backlogs/backlog.constants.js.map +0 -1
  327. package/dist/adapters/backlogs/beads-adapter.d.ts +0 -4
  328. package/dist/adapters/backlogs/beads-adapter.js +0 -31
  329. package/dist/adapters/backlogs/beads-adapter.js.map +0 -1
  330. package/dist/adapters/backlogs/cli.d.ts +0 -3
  331. package/dist/adapters/backlogs/cli.js +0 -20
  332. package/dist/adapters/backlogs/cli.js.map +0 -1
  333. package/dist/adapters/backlogs/github-adapter.d.ts +0 -4
  334. package/dist/adapters/backlogs/github-adapter.js +0 -28
  335. package/dist/adapters/backlogs/github-adapter.js.map +0 -1
  336. package/dist/adapters/backlogs/issue.d.ts +0 -2
  337. package/dist/adapters/backlogs/issue.js +0 -13
  338. package/dist/adapters/backlogs/issue.js.map +0 -1
  339. package/dist/adapters/backlogs/settings.types.d.ts +0 -5
  340. package/dist/adapters/backlogs/settings.types.js +0 -2
  341. package/dist/adapters/backlogs/settings.types.js.map +0 -1
  342. package/dist/application/campaign-integration.d.ts +0 -2
  343. package/dist/application/campaign-integration.js +0 -44
  344. package/dist/application/campaign-integration.js.map +0 -1
  345. package/dist/application/campaign-planner.d.ts +0 -3
  346. package/dist/application/campaign-planner.js +0 -35
  347. package/dist/application/campaign-planner.js.map +0 -1
  348. package/dist/application/campaign-worker.d.ts +0 -3
  349. package/dist/application/campaign-worker.js +0 -54
  350. package/dist/application/campaign-worker.js.map +0 -1
  351. package/dist/application/campaign.constants.d.ts +0 -7
  352. package/dist/application/campaign.constants.js +0 -8
  353. package/dist/application/campaign.constants.js.map +0 -1
  354. package/dist/application/campaign.d.ts +0 -3
  355. package/dist/application/campaign.js +0 -96
  356. package/dist/application/campaign.js.map +0 -1
  357. package/dist/application/campaign.types.d.ts +0 -43
  358. package/dist/application/campaign.types.js +0 -2
  359. package/dist/application/campaign.types.js.map +0 -1
  360. package/dist/domain/backlog.d.ts +0 -3
  361. package/dist/domain/backlog.js +0 -23
  362. package/dist/domain/backlog.js.map +0 -1
  363. package/dist/domain/backlog.types.d.ts +0 -15
  364. package/dist/domain/backlog.types.js +0 -2
  365. package/dist/domain/backlog.types.js.map +0 -1
  366. package/dist/providers/backlogs.d.ts +0 -3
  367. package/dist/providers/backlogs.js +0 -3
  368. package/dist/providers/backlogs.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recovery-command.js","sourceRoot":"","sources":["../../src/cli/recovery-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG1D,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EACpC,MAAM,EACN,WAAW,GACG;IACd,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO;QAC5B,OAAO,oBAAoB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IACvD,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,QAAQ;QAC7B,OAAO,qBAAqB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IACxD,SAAS,CACP,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,EACxD,uGAAuG,CACxG,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACnC,SAAS,CACP,CAAC,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EACnE,kCAAkC,GAAG,EAAE,CACxC,CAAC;IACJ,MAAM,UAAU,GACd,MAAM,CAAC,aAAa,CAAC,KAAK,SAAS;QACjC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CA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IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAC3D,CAAC;QACJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,mBAAmB,MAAM,CAAC,KAAK,CAAC,KAAK,aAAa,MAAM,CAAC,KAAK,CAAC,KAAK,WAAW,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,UAAU,qBAAqB,CAC/I,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,2CAA2C,gEAAgE,CACzJ,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK;YACxB,CAAC,CAAC,yGAAyG;YAC3G,CAAC,CAAC,8FAA8F,CACnG,CAAC;IACJ,CAAC;IACD,IACE,CAAC,MAAM,CAAC,QAAQ;QAChB,MAAM,CAAC,GAAG,EAAE,QAAQ,KAAK,KAAK;QAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,KAAK,KAAK;QAEhC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import { recoveryPruneCommand } from \"./recovery-prune-command.ts\";\nimport { recoveryVerifyCommand } from \"./recovery-verify-command.ts\";\nimport { inspectRecovery } from \"../application/recovery-inspection.ts\";\nimport { invariant, positive } from \"../domain/errors.ts\";\nimport type { CliInvocation } from \"./main.types.ts\";\n\nexport async function recoveryCommand({\n values,\n positionals,\n}: CliInvocation): Promise<void> {\n if (positionals[1] === \"prune\")\n return recoveryPruneCommand({ values, positionals });\n if (positionals[1] === \"verify\")\n return recoveryVerifyCommand({ values, positionals });\n invariant(\n positionals.length === 2 && positionals[1] === \"inspect\",\n \"Usage: outpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--json]\",\n );\n for (const key of Object.keys(values))\n invariant(\n [\"repository\", \"max-entries\", \"git\", \"locks\", \"json\"].includes(key),\n `Unsupported recovery option: --${key}`,\n );\n const maxEntries =\n values[\"max-entries\"] === undefined\n ? undefined\n : positive(Number(values[\"max-entries\"]), \"max-entries\");\n const report = await inspectRecovery({\n ...(values.repository !== undefined\n ? { repository: values.repository }\n : {}),\n ...(maxEntries !== undefined ? { maxEntries } : {}),\n ...(values.git ? { git: true } : {}),\n ...(values.locks ? { locks: true } : {}),\n });\n if (values.json) process.stdout.write(`${JSON.stringify(report, null, 2)}\\n`);\n else {\n process.stdout.write(\n `Outpost recovery inspection — ${JSON.stringify(report.repository)}\\n`,\n );\n for (const category of report.categories) {\n process.stdout.write(\n `${category.name}: ${category.entries.length} listed entries\\n`,\n );\n for (const entry of category.entries)\n process.stdout.write(\n ` ${JSON.stringify(entry.name)} | ${entry.kind} | ${entry.bytes} bytes | ${entry.files} files | ${entry.symlinks} symlinks | ${entry.modifiedAt ?? \"unknown time\"} | ${entry.complete ? \"complete\" : \"partial\"}\\n`,\n );\n }\n if (report.git) {\n process.stdout.write(\n `Workspace Git inspection: ${report.git.complete ? \"complete for listed entries\" : \"partial\"}\\n`,\n );\n for (const workspace of report.git.workspaces) {\n const detail =\n workspace.state === \"registered\"\n ? `${workspace.branch === null ? \"detached HEAD\" : JSON.stringify(workspace.branch)} | ${workspace.dirty ? \"dirty\" : \"clean\"} | ${workspace.head}${workspace.locked ? \" | Git locked\" : \"\"}`\n : workspace.state;\n process.stdout.write(\n ` ${JSON.stringify(workspace.name)} | ${detail}\\n`,\n );\n }\n for (const issue of report.git.issues)\n process.stdout.write(\n `[PARTIAL] ${issue.code}: ${JSON.stringify(issue.path)}\\n`,\n );\n process.stdout.write(\n \"Git status excludes ignored files. Clean does not mean safe to delete.\\n\",\n );\n }\n if (report.locks) {\n process.stdout.write(\n `Lock PID inspection (local host): ${report.locks.complete ? \"complete for listed entries\" : \"partial\"}\\n`,\n );\n for (const lock of report.locks.entries) {\n const pid = \"pid\" in lock ? ` | PID ${lock.pid}` : \"\";\n const reason = \"reason\" in lock ? ` | ${lock.reason}` : \"\";\n process.stdout.write(\n ` ${JSON.stringify(lock.name)} | ${lock.state}${pid}${reason}${lock.ownership ? ` | ownership ${lock.ownership.status}: ${lock.ownership.reason}` : \"\"}\\n`,\n );\n }\n for (const issue of report.locks.issues)\n process.stdout.write(\n `[PARTIAL] ${issue.code}: ${JSON.stringify(issue.path)}\\n`,\n );\n process.stdout.write(\n \"PID presence does not prove lock ownership; PID absence does not authorize deletion.\\n\",\n );\n }\n for (const issue of report.issues)\n process.stdout.write(\n `[PARTIAL] ${issue.code}: ${JSON.stringify(issue.path)}\\n`,\n );\n process.stdout.write(\n `Total observed: ${report.usage.bytes} bytes in ${report.usage.files} files; ${report.scannedEntries}/${report.maxEntries} entries scanned.\\n`,\n );\n process.stdout.write(\n `${report.complete ? \"Inventory complete.\" : \"Inventory incomplete; totals are partial.\"} File sizes are logical bytes; symlink targets are excluded.\\n`,\n );\n process.stdout.write(\n report.git || report.locks\n ? \"Activity and recovery integrity are unverified. No raw file contents were displayed or files removed.\\n\"\n : \"Activity and recovery integrity are unverified. No files were read for content or removed.\\n\",\n );\n }\n if (\n !report.complete ||\n report.git?.complete === false ||\n report.locks?.complete === false\n )\n process.exitCode = 1;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { CliInvocation } from "./main.types.ts";
2
+ export declare function recoveryPruneCommand({ values, positionals, }: CliInvocation): Promise<void>;
@@ -0,0 +1,34 @@
1
+ import { recoveryRetentionLimits } from "../application/recovery-retention.constants.js";
2
+ import { planRecoveryRetention, pruneRecoveryRetention, } from "../application/recovery-retention.js";
3
+ import { retentionPolicy } from "../application/recovery-retention-policy.js";
4
+ import { invariant } from "../domain/errors.js";
5
+ import { readInspectionFile } from "../infrastructure/inspection-file.js";
6
+ import { resolve } from "node:path";
7
+ export async function recoveryPruneCommand({ values, positionals, }) {
8
+ invariant(positionals.length === 2 && !!values.policy, "Usage: outpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]");
9
+ for (const key of Object.keys(values))
10
+ invariant(["policy", "repository", "apply", "json"].includes(key), `Unsupported recovery prune option: --${key}`);
11
+ const policy = JSON.parse((await readInspectionFile(resolve(values.policy), recoveryRetentionLimits.maxPolicyBytes)).toString("utf8"));
12
+ retentionPolicy(policy);
13
+ const plan = await planRecoveryRetention({
14
+ policy,
15
+ ...(values.repository ? { repository: values.repository } : {}),
16
+ });
17
+ const result = values.apply ? await pruneRecoveryRetention(plan) : undefined;
18
+ const after = result?.after ?? plan;
19
+ if (values.json)
20
+ process.stdout.write(`${JSON.stringify({ dryRun: !values.apply, plan, ...(result ? { result } : {}) }, null, 2)}\n`);
21
+ else {
22
+ process.stdout.write(`Outpost retention ${values.apply ? "apply" : "dry run"} — ${JSON.stringify(plan.repository)}\n`);
23
+ for (const entry of plan.entries)
24
+ process.stdout.write(`${entry.eligible ? "CANDIDATE" : "RETAIN"} ${JSON.stringify(entry.path)} | ${entry.reason} | ${entry.bytes} bytes\n`);
25
+ for (const path of result?.removed ?? [])
26
+ process.stdout.write(`REMOVED ${JSON.stringify(path)}\n`);
27
+ for (const entry of result?.retained ?? [])
28
+ process.stdout.write(`RETAIN ${JSON.stringify(entry.path)} | ${entry.reason}\n`);
29
+ process.stdout.write(`Observed ${after.usageBytes} logical bytes; projected ${after.projectedBytes}; projected quota ${after.quota}. Branches and recovery artifacts are retained.\n`);
30
+ }
31
+ if (!after.complete || after.quota !== "within" || result?.retained.length)
32
+ process.exitCode = 1;
33
+ }
34
+ //# sourceMappingURL=recovery-prune-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recovery-prune-command.js","sourceRoot":"","sources":["../../src/cli/recovery-prune-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,C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IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,EAAE,QAAQ,CAAC,MAAM;QACxE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import { recoveryRetentionLimits } from \"../application/recovery-retention.constants.ts\";\nimport {\n planRecoveryRetention,\n pruneRecoveryRetention,\n} from \"../application/recovery-retention.ts\";\nimport { retentionPolicy } from \"../application/recovery-retention-policy.ts\";\nimport { invariant } from \"../domain/errors.ts\";\nimport { readInspectionFile } from \"../infrastructure/inspection-file.ts\";\nimport { resolve } from \"node:path\";\nimport type { CliInvocation } from \"./main.types.ts\";\n\nexport async function recoveryPruneCommand({\n values,\n positionals,\n}: CliInvocation): Promise<void> {\n invariant(\n positionals.length === 2 && !!values.policy,\n \"Usage: outpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]\",\n );\n for (const key of Object.keys(values))\n invariant(\n [\"policy\", \"repository\", \"apply\", \"json\"].includes(key),\n `Unsupported recovery prune option: --${key}`,\n );\n const policy: unknown = JSON.parse(\n (\n await readInspectionFile(\n resolve(values.policy),\n recoveryRetentionLimits.maxPolicyBytes,\n )\n ).toString(\"utf8\"),\n );\n retentionPolicy(policy);\n const plan = await planRecoveryRetention({\n policy,\n ...(values.repository ? { repository: values.repository } : {}),\n });\n const result = values.apply ? await pruneRecoveryRetention(plan) : undefined;\n const after = result?.after ?? plan;\n if (values.json)\n process.stdout.write(\n `${JSON.stringify({ dryRun: !values.apply, plan, ...(result ? { result } : {}) }, null, 2)}\\n`,\n );\n else {\n process.stdout.write(\n `Outpost retention ${values.apply ? \"apply\" : \"dry run\"} — ${JSON.stringify(plan.repository)}\\n`,\n );\n for (const entry of plan.entries)\n process.stdout.write(\n `${entry.eligible ? \"CANDIDATE\" : \"RETAIN\"} ${JSON.stringify(entry.path)} | ${entry.reason} | ${entry.bytes} bytes\\n`,\n );\n for (const path of result?.removed ?? [])\n process.stdout.write(`REMOVED ${JSON.stringify(path)}\\n`);\n for (const entry of result?.retained ?? [])\n process.stdout.write(\n `RETAIN ${JSON.stringify(entry.path)} | ${entry.reason}\\n`,\n );\n process.stdout.write(\n `Observed ${after.usageBytes} logical bytes; projected ${after.projectedBytes}; projected quota ${after.quota}. Branches and recovery artifacts are retained.\\n`,\n );\n }\n if (!after.complete || after.quota !== \"within\" || result?.retained.length)\n process.exitCode = 1;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { CliInvocation } from "./main.types.ts";
2
+ export declare function recoveryVerifyCommand({ values, positionals, }: CliInvocation): Promise<void>;
@@ -0,0 +1,43 @@
1
+ import { verifyRecoveryTransfer } from "../application/recovery-verification.js";
2
+ import { invariant, positive } from "../domain/errors.js";
3
+ export async function recoveryVerifyCommand({ values, positionals, }) {
4
+ invariant(positionals.length === 2 && !!values.directory, "Usage: outpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]");
5
+ for (const key of Object.keys(values))
6
+ invariant([
7
+ "directory",
8
+ "checksums",
9
+ "max-bytes",
10
+ "json",
11
+ "restorability",
12
+ "repository",
13
+ ].includes(key), `Unsupported recovery verify option: --${key}`);
14
+ invariant(values["max-bytes"] === undefined || values.checksums, "--max-bytes requires --checksums");
15
+ invariant(!values.repository || values.restorability, "--repository requires --restorability");
16
+ const report = await verifyRecoveryTransfer(values.directory, {
17
+ ...(values.restorability ? { restorability: true } : {}),
18
+ ...(values.repository ? { repository: values.repository } : {}),
19
+ ...(values.checksums ? { checksums: true } : {}),
20
+ ...(values["max-bytes"] !== undefined
21
+ ? { maxBytes: positive(Number(values["max-bytes"]), "max-bytes") }
22
+ : {}),
23
+ });
24
+ if (values.json)
25
+ process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
26
+ else {
27
+ process.stdout.write(`Outpost recovery structure verification — ${JSON.stringify(report.directory)}\n`);
28
+ for (const check of report.checks)
29
+ process.stdout.write(`[${check.status.toUpperCase()}] ${check.code}: ${JSON.stringify(check.path)}\n`);
30
+ process.stdout.write(`${report.complete ? "Requested transfer checks passed." : "Transfer checks failed or are incomplete."}\n`);
31
+ if (values.restorability)
32
+ process.stdout.write("Restorability scope: commit objects, bundle validity and three transfer patches applied independently in a temporary clone. Payload restoration, original staging/worktree consistency, session patches, submodules and external dependencies are outside this scope. Target repository unchanged.\n");
33
+ if (values.checksums) {
34
+ process.stdout.write(`Checksums: ${report.integrity}; ${report.checksums?.bytesChecked ?? 0} bytes checked.\n`);
35
+ process.stdout.write("Checksums compare against an unsigned manifest. Activity and full restoration remain unverified. No files were changed.\n");
36
+ }
37
+ if (!values.checksums && !values.restorability)
38
+ process.stdout.write("Patch and bundle contents, commit availability, activity and restorability are unverified. No files were changed.\n");
39
+ }
40
+ if (!report.complete)
41
+ process.exitCode = 1;
42
+ }
43
+ //# sourceMappingURL=recovery-verify-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recovery-verify-command.js","sourceRoot":"","sources":["../../src/cli/recovery-verify-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG1D,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,MAAM,EACN,WAAW,GACG;IACd,SAAS,CACP,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,EAC9C,0IAA0I,CAC3I,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACnC,SAAS,CACP;YACE,WAAW;YACX,WAAW;YACX,WAAW;YACX,MAAM;YACN,eAAe;YACf,YAAY;SACb,CAAC,QAAQ,CAAC,GAAG,CAAC,EACf,yCAAyC,GAAG,EAAE,CAC/C,CAAC;IACJ,SAAS,CACP,MAAM,CAAC,WAAW,CAAC,KAAK,SAAS,IAA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,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CACjF,CAAC;QACJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,2CAA2C,IAAI,CAC3G,CAAC;QACF,IAAI,MAAM,CAAC,aAAa;YACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,sSAAsS,CACvS,CAAC;QACJ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,cAAc,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE,YAAY,IAAI,CAAC,mBAAmB,CAC1F,CAAC;YACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,2HAA2H,CAC5H,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,aAAa;YAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qHAAqH,CACtH,CAAC;IACN,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ;QAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { verifyRecoveryTransfer } from \"../application/recovery-verification.ts\";\nimport { invariant, positive } from \"../domain/errors.ts\";\nimport type { CliInvocation } from \"./main.types.ts\";\n\nexport async function recoveryVerifyCommand({\n values,\n positionals,\n}: CliInvocation): Promise<void> {\n invariant(\n positionals.length === 2 && !!values.directory,\n \"Usage: outpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]\",\n );\n for (const key of Object.keys(values))\n invariant(\n [\n \"directory\",\n \"checksums\",\n \"max-bytes\",\n \"json\",\n \"restorability\",\n \"repository\",\n ].includes(key),\n `Unsupported recovery verify option: --${key}`,\n );\n invariant(\n values[\"max-bytes\"] === undefined || values.checksums,\n \"--max-bytes requires --checksums\",\n );\n invariant(\n !values.repository || values.restorability,\n \"--repository requires --restorability\",\n );\n const report = await verifyRecoveryTransfer(values.directory, {\n ...(values.restorability ? { restorability: true } : {}),\n ...(values.repository ? { repository: values.repository } : {}),\n ...(values.checksums ? { checksums: true } : {}),\n ...(values[\"max-bytes\"] !== undefined\n ? { maxBytes: positive(Number(values[\"max-bytes\"]), \"max-bytes\") }\n : {}),\n });\n if (values.json) process.stdout.write(`${JSON.stringify(report, null, 2)}\\n`);\n else {\n process.stdout.write(\n `Outpost recovery structure verification — ${JSON.stringify(report.directory)}\\n`,\n );\n for (const check of report.checks)\n process.stdout.write(\n `[${check.status.toUpperCase()}] ${check.code}: ${JSON.stringify(check.path)}\\n`,\n );\n process.stdout.write(\n `${report.complete ? \"Requested transfer checks passed.\" : \"Transfer checks failed or are incomplete.\"}\\n`,\n );\n if (values.restorability)\n process.stdout.write(\n \"Restorability scope: commit objects, bundle validity and three transfer patches applied independently in a temporary clone. Payload restoration, original staging/worktree consistency, session patches, submodules and external dependencies are outside this scope. Target repository unchanged.\\n\",\n );\n if (values.checksums) {\n process.stdout.write(\n `Checksums: ${report.integrity}; ${report.checksums?.bytesChecked ?? 0} bytes checked.\\n`,\n );\n process.stdout.write(\n \"Checksums compare against an unsigned manifest. Activity and full restoration remain unverified. No files were changed.\\n\",\n );\n }\n if (!values.checksums && !values.restorability)\n process.stdout.write(\n \"Patch and bundle contents, commit availability, activity and restorability are unverified. No files were changed.\\n\",\n );\n }\n if (!report.complete) process.exitCode = 1;\n}\n"]}
@@ -1,2 +1,2 @@
1
1
  import type { InitOptions } from "./scaffold.types.ts";
2
- export declare function scaffoldFiles(options: InitOptions, extension: string): Record<string, string>;
2
+ export declare function scaffoldFiles(options: InitOptions, hasPackage: boolean, extension: "ts" | "mts"): Promise<Record<string, string>>;
@@ -1,27 +1,33 @@
1
- import { imageRecipe } from "./scaffold.constants.js";
2
- import { starter, tracker } from "./starters.js";
3
- export function scaffoldFiles(options, extension) {
4
- const agent = options.agent ?? "codex", provider = options.provider ?? "docker", template = options.template ?? "blank";
1
+ import { readFile } from "node:fs/promises";
2
+ import { imageRecipe, providerPackages } from "./scaffold.constants.js";
3
+ import { starter } from "./starters.js";
4
+ export async function scaffoldFiles(options, hasPackage, extension) {
5
+ const agent = options.agent ?? "codex", provider = options.provider ?? "docker";
5
6
  const files = {
6
- [`run.${extension}`]: starter(options, extension),
7
+ [`run.${extension}`]: starter(options),
7
8
  "brief.md": "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",
8
- ".env.example": (agent === "codex" ? "OPENAI_API_KEY=\n" : "ANTHROPIC_API_KEY=\n") +
9
- (options.tracker === "github" ? "GH_TOKEN=\n" : ""),
10
- ".gitignore": ".env\nworkspaces/\nlocks/\nrecovery/\nlogs/\n",
9
+ ".env.example": agent === "codex" ? "OPENAI_API_KEY=\n" : "ANTHROPIC_API_KEY=\n",
10
+ ".gitignore": "node_modules/\n.env\n.outpost/workspaces/\n.outpost/locks/\n.outpost/recovery/\n.outpost/logs/\n",
11
11
  };
12
12
  if (provider === "docker" || provider === "podman")
13
- files[provider === "docker" ? "Dockerfile" : "Containerfile"] =
14
- options.tracker === "beads"
15
- ? imageRecipe.replace("RUN groupmod", "RUN npm install -g --allow-scripts=@beads/bd @beads/bd@1.2.2\nRUN groupmod")
16
- : imageRecipe;
17
- if (template !== "blank")
18
- files["STANDARDS.md"] =
19
- "# Engineering standards\n\nKeep domain rules separate from infrastructure. Test observable behavior, handle failure and cancellation, and preserve existing user changes. Run the repository checks before committing. Prefer clear names to comments; keep necessary comments at most two lines. Review the complete diff against the supplied base commit.\n";
20
- if (options.tracker)
21
- files[`tickets.${extension}`] = tracker(options.tracker, options.label);
22
- if (options.tracker === "custom")
23
- files["TRACKER.md"] =
24
- `# Custom issue tracker\n\nSet OUTPOST_TRACKER_URL in the host environment before running the starter. Implement GET issues?state=open (Issue[]), GET issues/:id (Issue), and POST issues/:id/close (any successful status). Issue has id, title, optional body and optional blockedBy ids. The generated tickets.${extension} is yours to adapt: add authentication, pagination and filtering for your tracker there. Never commit credentials.\n\nThe campaign reloads the backlog each cycle, reads an issue before implementation, and closes it only after its commits reach the host branch. Configure authentication in tickets.${extension}. A failed close is reported and must be reconciled before rerunning.\n`;
13
+ files[provider === "docker" ? "Dockerfile" : "Containerfile"] = imageRecipe;
14
+ if (!hasPackage) {
15
+ const manifest = JSON.parse(await readFile(new URL("../../package.json", import.meta.url), "utf8"));
16
+ files["package.json"] =
17
+ JSON.stringify({
18
+ private: true,
19
+ type: "module",
20
+ scripts: { start: `node run.${extension}` },
21
+ engines: { node: ">=24" },
22
+ devDependencies: {
23
+ "@elie-laloum/outpost": `^${manifest.version}`,
24
+ ...Object.fromEntries(providerPackages[provider].map((name) => [
25
+ name,
26
+ manifest.peerDependencies[name],
27
+ ])),
28
+ },
29
+ }, null, 2) + "\n";
30
+ }
25
31
  return files;
26
32
  }
27
33
  //# sourceMappingURL=scaffold-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold-files.js","sourceRoot":"","sources":["../../src/cli/scaffold-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,UAAU,aAAa,CAC3B,OAAoB,EACpB,SAAiB;IAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,EACvC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;IACzC,MAAM,KAAK,GAA2B;QACpC,CAAC,OAAO,SAAS,EAAE,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC;QACjD,UAAU,EACR,wNAAwN;QAC1N,cAAc,EACZ,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,sBAAsB,CAAC;YAClE,CAAC,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,YAAY,EAAE,+CAA+C;KAC9D,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;YAC3D,OAAO,CAAC,OAAO,KAAK,OAAO;gBACzB,CAAC,CAAC,WAAW,CAAC,OAAO,CACjB,cAAc,EACd,4EAA4E,CAC7E;gBACH,CAAC,CAAC,WAAW,CAAC;IACpB,IAAI,QAAQ,KAAK,OAAO;QACtB,KAAK,CAAC,cAAc,CAAC;YACnB,gWAAgW,CAAC;IACrW,IAAI,OAAO,CAAC,OAAO;QACjB,KAAK,CAAC,WAAW,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC1E,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ;QAC9B,KAAK,CAAC,YAAY,CAAC;YACjB,oTAAoT,SAAS,4SAA4S,SAAS,yEAAyE,CAAC;IAEhsB,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { imageRecipe } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\nimport { starter, tracker } from \"./starters.ts\";\n\nexport function scaffoldFiles(\n options: InitOptions,\n extension: string,\n): Record<string, string> {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\",\n template = options.template ?? \"blank\";\n const files: Record<string, string> = {\n [`run.${extension}`]: starter(options, extension),\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 (options.tracker === \"github\" ? \"GH_TOKEN=\\n\" : \"\"),\n \".gitignore\": \".env\\nworkspaces/\\nlocks/\\nrecovery/\\nlogs/\\n\",\n };\n if (provider === \"docker\" || provider === \"podman\")\n files[provider === \"docker\" ? \"Dockerfile\" : \"Containerfile\"] =\n options.tracker === \"beads\"\n ? imageRecipe.replace(\n \"RUN groupmod\",\n \"RUN npm install -g --allow-scripts=@beads/bd @beads/bd@1.2.2\\nRUN groupmod\",\n )\n : imageRecipe;\n if (template !== \"blank\")\n files[\"STANDARDS.md\"] =\n \"# Engineering standards\\n\\nKeep domain rules separate from infrastructure. Test observable behavior, handle failure and cancellation, and preserve existing user changes. Run the repository checks before committing. Prefer clear names to comments; keep necessary comments at most two lines. Review the complete diff against the supplied base commit.\\n\";\n if (options.tracker)\n files[`tickets.${extension}`] = tracker(options.tracker, options.label);\n if (options.tracker === \"custom\")\n files[\"TRACKER.md\"] =\n `# Custom issue tracker\\n\\nSet OUTPOST_TRACKER_URL in the host environment before running the starter. Implement GET issues?state=open (Issue[]), GET issues/:id (Issue), and POST issues/:id/close (any successful status). Issue has id, title, optional body and optional blockedBy ids. The generated tickets.${extension} is yours to adapt: add authentication, pagination and filtering for your tracker there. Never commit credentials.\\n\\nThe campaign reloads the backlog each cycle, reads an issue before implementation, and closes it only after its commits reach the host branch. Configure authentication in tickets.${extension}. A failed close is reported and must be reconciled before rerunning.\\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,MA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AC,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,11 +1,8 @@
1
1
  import { invariant } from "../domain/errors.js";
2
- import { supportedAgents, supportedProviders, supportedTemplates, supportedTrackers, } from "./scaffold.constants.js";
2
+ import { supportedAgents, supportedProviders } from "./scaffold.constants.js";
3
3
  export function validateInitialization(options) {
4
- const agent = options.agent ?? "codex", provider = options.provider ?? "docker", template = options.template ?? "blank";
4
+ const agent = options.agent ?? "codex", provider = options.provider ?? "docker";
5
5
  invariant(supportedAgents.includes(agent), "Choose codex or claude");
6
6
  invariant(supportedProviders.includes(provider), "Unknown sandbox provider");
7
- invariant(supportedTemplates.includes(template), "Unknown starter template");
8
- if (options.tracker)
9
- invariant(supportedTrackers.includes(options.tracker), "Unknown tracker");
10
7
  }
11
8
  //# 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,EACL,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,EACvC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;IACzC,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;IAC7E,SAAS,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,0BAA0B,CAAC,CAAC;IAC7E,IAAI,OAAO,CAAC,OAAO;QACjB,SAAS,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["import { invariant } from \"../domain/errors.ts\";\nimport {\n supportedAgents,\n supportedProviders,\n supportedTemplates,\n supportedTrackers,\n} 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 template = options.template ?? \"blank\";\n invariant(supportedAgents.includes(agent), \"Choose codex or claude\");\n invariant(supportedProviders.includes(provider), \"Unknown sandbox provider\");\n invariant(supportedTemplates.includes(template), \"Unknown starter template\");\n if (options.tracker)\n invariant(supportedTrackers.includes(options.tracker), \"Unknown tracker\");\n}\n"]}
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,8 +1,6 @@
1
1
  export declare const imageRecipe: string;
2
2
  export declare const supportedAgents: readonly string[];
3
3
  export declare const supportedProviders: readonly string[];
4
- export declare const supportedTemplates: readonly string[];
5
- export declare const supportedTrackers: readonly string[];
6
4
  export declare const supportedManagers: readonly string[];
7
5
  export declare const managerLocks: readonly [readonly ["pnpm-lock.yaml", "pnpm"], readonly ["yarn.lock", "yarn"], readonly ["bun.lock", "bun"], readonly ["bun.lockb", "bun"]];
8
6
  export declare const providerPackages: {
@@ -2,7 +2,7 @@ import { agentVersions } from "../providers/versions.js";
2
2
  export const imageRecipe = `FROM node:24-bookworm-slim
3
3
  ARG AGENT_UID=1000
4
4
  ARG AGENT_GID=1000
5
- RUN apt-get update && apt-get install -y --no-install-recommends git gh openssh-client ca-certificates curl procps util-linux python3 && rm -rf /var/lib/apt/lists/*
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
6
  RUN npm install -g --allow-scripts=@anthropic-ai/claude-code @openai/codex@${agentVersions.codex} @anthropic-ai/claude-code@${agentVersions.claude}
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
@@ -18,18 +18,6 @@ export const supportedProviders = [
18
18
  "daytona",
19
19
  "local",
20
20
  ];
21
- export const supportedTemplates = [
22
- "blank",
23
- "iterate",
24
- "review",
25
- "plan",
26
- "plan-review",
27
- ];
28
- export const supportedTrackers = [
29
- "github",
30
- "beads",
31
- "custom",
32
- ];
33
21
  export const supportedManagers = [
34
22
  "npm",
35
23
  "pnpm",
@@ -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,kBAAkB,GAAsB;IACnD,OAAO;IACP,SAAS;IACT,QAAQ;IACR,MAAM;IACN,aAAa;CACd,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,QAAQ;IACR,OAAO;IACP,QAAQ;CACT,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 gh 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 supportedTemplates: readonly string[] = [\n \"blank\",\n \"iterate\",\n \"review\",\n \"plan\",\n \"plan-review\",\n];\nexport const supportedTrackers: readonly string[] = [\n \"github\",\n \"beads\",\n \"custom\",\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;;;;;;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"]}
@@ -2,5 +2,5 @@ import type { Executor } from "../infrastructure/process.types.ts";
2
2
  import type { InitOptions, ScaffoldResult } from "./scaffold.types.ts";
3
3
  export { manageImage } from "./image.ts";
4
4
  export { imageRecipe } from "./scaffold.constants.ts";
5
- export type { InitOptions, Template } from "./scaffold.types.ts";
5
+ export type { InitOptions } from "./scaffold.types.ts";
6
6
  export declare function initialize(options?: InitOptions, executor?: Executor): Promise<ScaffoldResult>;
@@ -1,7 +1,8 @@
1
- import { access, mkdir, writeFile } from "node:fs/promises";
1
+ import { appendFile, lstat, mkdir, readFile, writeFile, } from "node:fs/promises";
2
2
  import { join, resolve } from "node:path";
3
- import { invariant, OutpostError } from "../domain/errors.js";
3
+ import { OutpostError } from "../domain/errors.js";
4
4
  import { requireSuccess } from "../infrastructure/process.js";
5
+ import { imageName } from "../providers/container.js";
5
6
  import { manageImage } from "./image.js";
6
7
  import { projectSettings } from "./project-settings.js";
7
8
  import { scaffoldFiles } from "./scaffold-files.js";
@@ -10,19 +11,43 @@ import { providerPackages } from "./scaffold.constants.js";
10
11
  export { manageImage } from "./image.js";
11
12
  export { imageRecipe } from "./scaffold.constants.js";
12
13
  export async function initialize(options = {}, executor) {
13
- const root = resolve(options.directory ?? process.cwd()), folder = join(root, ".outpost");
14
+ const root = resolve(options.directory ?? process.cwd());
14
15
  const provider = options.provider ?? "docker";
15
16
  validateInitialization(options);
16
- const { extension, manager } = await projectSettings(root, options);
17
- const files = scaffoldFiles(options, extension);
17
+ const { hasPackage, manager, extension } = await projectSettings(root, options);
18
+ const files = await scaffoldFiles({ ...options, image: options.image ?? imageName(root) }, hasPackage, extension);
19
+ const existingIgnore = await readFile(join(root, ".gitignore"), "utf8").catch((error) => {
20
+ if (error.code === "ENOENT")
21
+ return undefined;
22
+ throw error;
23
+ });
24
+ const ignore = files[".gitignore"];
25
+ if (existingIgnore !== undefined)
26
+ delete files[".gitignore"];
18
27
  for (const name of Object.keys(files))
19
- if (await access(join(folder, name))
28
+ if (await lstat(join(root, name))
20
29
  .then(() => true)
21
- .catch(() => false))
22
- throw new OutpostError("configuration", `Initialization would overwrite .outpost/${name}`);
23
- await mkdir(folder, { recursive: true });
30
+ .catch((error) => {
31
+ if (error.code === "ENOENT")
32
+ return false;
33
+ throw error;
34
+ }))
35
+ throw new OutpostError("configuration", `Initialization would overwrite ${name}`);
36
+ await mkdir(root, { recursive: true });
24
37
  for (const [name, content] of Object.entries(files))
25
- await writeFile(join(folder, name), content, { flag: "wx" });
38
+ await writeFile(join(root, name), content, { flag: "wx" });
39
+ if (existingIgnore !== undefined) {
40
+ const rules = new Set(existingIgnore.split(/\r?\n/));
41
+ const additions = ignore
42
+ .trimEnd()
43
+ .split("\n")
44
+ .filter((rule) => !rules.has(rule));
45
+ if (additions.length) {
46
+ const suffix = `${existingIgnore && !existingIgnore.endsWith("\n") ? "\n" : ""}${additions.join("\n")}\n`;
47
+ await appendFile(join(root, ".gitignore"), suffix);
48
+ files[".gitignore"] = existingIgnore + suffix;
49
+ }
50
+ }
26
51
  if (options.install) {
27
52
  const packages = ["@elie-laloum/outpost", ...providerPackages[provider]];
28
53
  const args = manager === "npm"
@@ -36,23 +61,6 @@ export async function initialize(options = {}, executor) {
36
61
  }
37
62
  : { executable: manager, arguments: args, directory: root }, executor);
38
63
  }
39
- if (options.label) {
40
- invariant(options.tracker === "github", "Labels require the GitHub tracker");
41
- await requireSuccess({
42
- executable: "gh",
43
- arguments: [
44
- "label",
45
- "create",
46
- options.label,
47
- "--color",
48
- "4969ED",
49
- "--description",
50
- "Ready for Outpost",
51
- "--force",
52
- ],
53
- directory: root,
54
- }, executor);
55
- }
56
64
  if (options.build && (provider === "docker" || provider === "podman"))
57
65
  await manageImage("build", {
58
66
  directory: root,
@@ -60,8 +68,8 @@ export async function initialize(options = {}, executor) {
60
68
  ...(options.image ? { image: options.image } : {}),
61
69
  }, executor);
62
70
  return {
63
- files: Object.keys(files).map((name) => join(folder, name)),
64
- run: `node .outpost/run.${extension}`,
71
+ files: Object.keys(files).map((name) => join(root, name)),
72
+ run: `node run.${extension}`,
65
73
  };
66
74
  }
67
75
  //# sourceMappingURL=scaffold.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/cli/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,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,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAuB,EAAE,EACzB,QAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,EACtD,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAG,OAAO,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File } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { invariant, OutpostError } from \"../domain/errors.ts\";\nimport { requireSuccess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.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, Template } 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 folder = join(root, \".outpost\");\n const provider = options.provider ?? \"docker\";\n validateInitialization(options);\n const { extension, manager } = await projectSettings(root, options);\n const files = scaffoldFiles(options, extension);\n for (const name of Object.keys(files))\n if (\n await access(join(folder, name))\n .then(() => true)\n .catch(() => false)\n )\n throw new OutpostError(\n \"configuration\",\n `Initialization would overwrite .outpost/${name}`,\n );\n await mkdir(folder, { recursive: true });\n for (const [name, content] of Object.entries(files))\n await writeFile(join(folder, name), content, { flag: \"wx\" });\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.label) {\n invariant(\n options.tracker === \"github\",\n \"Labels require the GitHub tracker\",\n );\n await requireSuccess(\n {\n executable: \"gh\",\n arguments: [\n \"label\",\n \"create\",\n options.label,\n \"--color\",\n \"4969ED\",\n \"--description\",\n \"Ready for Outpost\",\n \"--force\",\n ],\n directory: root,\n },\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(folder, name)),\n run: `node .outpost/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,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAuB,EAAE,EACzB,QAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC9C,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YAC1B,CAAC,CAAC;gBACE,UAAU,EAAE,SAAS;gBACrB,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,SAAS,EAAE,IAAI;aAChB;YACH,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAC7D,QAAQ,CACT,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,CAAC;QACnE,MAAM,WAAW,CACf,OAAO,EACP;YACE,SAAS,EAAE,IAAI;YACf,MAAM,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 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,14 +1,11 @@
1
- export type Template = "blank" | "iterate" | "review" | "plan" | "plan-review";
2
1
  export interface InitOptions {
3
2
  readonly directory?: string;
3
+ readonly repository?: string;
4
4
  readonly agent?: "claude" | "codex";
5
5
  readonly provider?: "docker" | "podman" | "vercel" | "daytona" | "local";
6
- readonly template?: Template;
7
- readonly tracker?: "github" | "beads" | "custom";
8
6
  readonly manager?: "npm" | "pnpm" | "yarn" | "bun";
9
7
  readonly model?: string;
10
8
  readonly install?: boolean;
11
- readonly label?: string;
12
9
  readonly build?: boolean;
13
10
  readonly image?: string;
14
11
  }
@@ -17,7 +14,8 @@ export interface PackageManifest {
17
14
  readonly packageManager?: string;
18
15
  }
19
16
  export interface ProjectSettings {
20
- readonly extension: string;
17
+ readonly extension: "ts" | "mts";
18
+ readonly hasPackage: boolean;
21
19
  readonly manager: string;
22
20
  }
23
21
  export interface ScaffoldResult {
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.types.js","sourceRoot":"","sources":["../../src/cli/scaffold.types.ts"],"names":[],"mappings":"","sourcesContent":["export type Template = \"blank\" | \"iterate\" | \"review\" | \"plan\" | \"plan-review\";\n\nexport interface InitOptions {\n readonly directory?: string;\n readonly agent?: \"claude\" | \"codex\";\n readonly provider?: \"docker\" | \"podman\" | \"vercel\" | \"daytona\" | \"local\";\n readonly template?: Template;\n readonly tracker?: \"github\" | \"beads\" | \"custom\";\n readonly manager?: \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n readonly model?: string;\n readonly install?: boolean;\n readonly label?: string;\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: string;\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\";\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,3 +1,2 @@
1
1
  import type { InitOptions } from "./scaffold.types.ts";
2
- export declare function starter(options: InitOptions, extension: string): string;
3
- export declare function tracker(kind: NonNullable<InitOptions["tracker"]>, label?: string): string;
2
+ export declare function starter(options: InitOptions): string;
@@ -1,34 +1,46 @@
1
- export function starter(options, extension) {
2
- const agent = options.agent ?? "codex", provider = options.provider ?? "docker", template = options.template ?? "blank";
3
- const planning = template === "plan" || template === "plan-review";
4
- const reviewing = template === "review" || template === "plan-review";
5
- const imports = `import { campaign, dispatch, ${agent} } from "@elie-laloum/outpost";\nimport type { Backlog } from "@elie-laloum/outpost";\nimport { ${provider} } from "@elie-laloum/outpost/providers/${provider}";\nimport { readFile } from "node:fs/promises";\n${options.tracker ? `import { backlog } from "./tickets.${extension}";\n` : ""}`;
6
- const config = `const runtime = { agent: ${agent}(${options.model ? `{ model: ${JSON.stringify(options.model)} }` : ""}), provider: ${provider}(${options.image && (provider === "docker" || provider === "podman") ? `{ image: ${JSON.stringify(options.image)} }` : ""}) };\nconst objective = process.argv.slice(2).join(" ") || "Inspect this repository and implement one useful improvement.";\n`;
7
- if (template === "blank")
8
- return `${imports}\n${config}\nconst result = await dispatch({ ...runtime, branch: { mode: "integrate" }, brief: { file: ".outpost/brief.md", values: { OBJECTIVE: objective } } });\nconsole.log({ branch: result.branch, commits: result.commits, conversation: result.conversation });\n`;
9
- const backlog = options.tracker
10
- ? ""
11
- : `let pending = true;\nconst requested = { id: "objective", title: objective };\nconst backlog: Backlog = {\n async list() { return pending ? [requested] : []; },\n async get() { return requested; },\n async close() { pending = false; },\n};\n`;
12
- return `${imports}\n${config}\n${backlog}\nconst result = await campaign({\n ...runtime, backlog,\n cycles: 10, concurrency: ${planning ? 3 : 1},\n implementationPasses: ${planning ? 100 : 1}, reviewPasses: 1,\n planner: ${planning ? "runtime.agent" : "false"}, reviewer: ${reviewing ? "runtime.agent" : "false"},\n copies: ["node_modules"],\n standards: await readFile(new URL("./STANDARDS.md", import.meta.url), "utf8"),\n observe: event => console.log(\`[cycle \${event.cycle}] \${event.phase}\${event.issue ? " " + event.issue : ""}\`),\n});\nconsole.log(result);\nif (result.issues.some(issue => issue.state === "failed")) process.exitCode = 1;\n`;
13
- }
14
- export function tracker(kind, label) {
15
- if (kind !== "custom") {
16
- const factory = kind === "github" ? "githubBacklog" : "beadsBacklog";
17
- return `import { ${factory} } from "@elie-laloum/outpost";\nexport const backlog = ${factory}(${label ? `{ label: ${JSON.stringify(label)} }` : ""});\n`;
18
- }
19
- return `import type { Backlog, Issue } from "@elie-laloum/outpost";
20
- async function request(path: string, method = "GET", signal?: AbortSignal) {
21
- const base = process.env.OUTPOST_TRACKER_URL;
22
- if (!base) throw new Error("Set OUTPOST_TRACKER_URL");
23
- const reply = await fetch(new URL(path, base.endsWith("/") ? base : base + "/"), { method, signal });
24
- if (!reply.ok) throw new Error(\`Tracker returned \${reply.status}\`);
25
- return reply;
26
- }
27
- export const backlog: Backlog = {
28
- async list(signal) { return await (await request("issues?state=open", "GET", signal)).json() as Issue[]; },
29
- async get(id, signal) { return await (await request("issues/" + encodeURIComponent(id), "GET", signal)).json() as Issue; },
30
- async close(id, signal) { await request("issues/" + encodeURIComponent(id) + "/close", "POST", signal); },
1
+ export function starter(options) {
2
+ const agent = options.agent ?? "codex", provider = options.provider ?? "docker";
3
+ const model = options.model ? `model: ${JSON.stringify(options.model)}` : "";
4
+ const image = options.image && (provider === "docker" || provider === "podman")
5
+ ? `image: ${JSON.stringify(options.image)}, `
6
+ : "";
7
+ return `import { readFile } from "node:fs/promises";
8
+ import { resolve } from "node:path";
9
+ import { parseEnv } from "node:util";
10
+ import { dispatch, ${agent}, OutpostError, reporter } from "@elie-laloum/outpost";
11
+ import { ${provider} } from "@elie-laloum/outpost/providers/${provider}";
12
+
13
+ // Paths are relative to this workflow, regardless of where Node is launched.
14
+ const repository = resolve(import.meta.dirname, ${JSON.stringify(options.repository ?? ".")});
15
+ const environment = await readFile(new URL(".env", import.meta.url), "utf8").catch((error) => {
16
+ if (error.code === "ENOENT") return "";
17
+ throw error;
18
+ });
19
+ const variables = Object.fromEntries(
20
+ Object.entries(parseEnv(environment)).map(([key, value]) => [key, value || process.env[key] || ""]),
21
+ );
22
+ const runtime = {
23
+ agent: ${agent}({ ${model} }),
24
+ provider: ${provider}({ ${image}variables }),
31
25
  };
26
+ const objective = process.argv.slice(2).join(" ") || "Inspect this repository and implement one useful improvement.";
27
+
28
+ console.error("[outpost] Preparing sandbox...");
29
+ try {
30
+ const result = await dispatch({
31
+ ...runtime,
32
+ repository,
33
+ branch: { mode: "integrate" },
34
+ brief: { file: resolve(import.meta.dirname, "brief.md"), values: { OBJECTIVE: objective } },
35
+ observe: reporter(),
36
+ warn: (message) => console.error(message),
37
+ });
38
+ console.log({ branch: result.branch, commits: result.commits, conversation: result.conversation });
39
+ } catch (error) {
40
+ if (!(error instanceof OutpostError) || error.code !== "aborted") throw error;
41
+ process.exitCode ||= 130;
42
+ console.error("[outpost] Cancelled. Recovery details:", error.recovery);
43
+ }
32
44
  `;
33
45
  }
34
46
  //# sourceMappingURL=starters.js.map