@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
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/application/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAA0B,EAAE;IAE5B,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IACjE,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC;IAC3B,IAAI,OAAsC,CAAC;IAC3C,MAAM,MAAM,GAAY;QACtB,SAAS;QACT,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,QAAQ,CAAC,QAAQ;YACf,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC3B,OAAO,SAAS,CAAC,GAAG,EAAE,CAC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AAE;YACjB,IAAI,OAAO;gBAAE,OAAO,OAAO,CAAC;YAC5B,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;gBACpB,IAAI,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;gBAC1D,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;gBACnB,IAAI,OAAgB,CAAC;gBACrB,IAAI,CAAC;oBACH,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;oBACxB,MAAM,IAAI,EAAE,KAAK,EAAE,CAAC;gBACtB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,GAAG,KAAK,CAAC;gBAClB,CAAC;gBACD,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;gBAErB,UAAU,EAAE,CAAC;gBACb,MAAM,QAAQ,GAAG,KAAK;oBACpB,CAAC,CAAC,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;oBACrE,CAAC,CAAC,EAAE,CAAC;gBACP,IAAI,OAAO;oBAAE,MAAM,OAAO,CAAC;gBAC3B,OAAO,QAAQ,CAAC;YAClB,CAAC,CAAC,EAAE,CAAC;YACL,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;YACzB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;KACF,CAAC;IACF,MAAM,UAAU,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { OutpostError } from \"../domain/errors.ts\";\nimport { validateBrief } from \"../domain/prompts.ts\";\nimport type { Disposal } from \"../domain/workspace.types.ts\";\nimport { registerCleanup } from \"../infrastructure/shutdown.ts\";\nimport { validateDispatch } from \"./dispatch-validation.ts\";\nimport { operationGate } from \"./operation-gate.ts\";\nimport type { Sandbox, SandboxOptions } from \"./outpost.types.ts\";\nimport { sandboxAgents } from \"./sandbox-agents.ts\";\nimport { attachInSandbox } from \"./sandbox-attach.ts\";\nimport { dispatchInSandbox } from \"./sandbox-dispatch.ts\";\nimport { provisionSandbox } from \"./sandbox-provision.ts\";\n\nexport async function createSandbox(\n options: SandboxOptions = {},\n): Promise<Sandbox> {\n const context = await provisionSandbox(options);\n const { workspace, runtime, sync, stop, state, owned } = context;\n const agents = sandboxAgents(context);\n const gate = operationGate();\n const exclusive = gate.run;\n let closing: Promise<Disposal> | undefined;\n const result: Sandbox = {\n workspace,\n root: runtime.root,\n dispatch(settings) {\n validateDispatch(settings);\n return exclusive(() =>\n dispatchInSandbox(context, agents, result, settings),\n );\n },\n resume(id, settings) {\n return result.dispatch({ ...settings, continuation: { id } });\n },\n fork(id, settings) {\n return result.dispatch({ ...settings, continuation: { id, fork: true } });\n },\n attach(settings = {}) {\n settings.signal?.throwIfAborted();\n validateBrief(settings.brief, true);\n return exclusive(() => attachInSandbox(context, agents, settings));\n },\n command(command) {\n command.signal?.throwIfAborted();\n return exclusive(async () => {\n try {\n return await runtime.invoke({\n ...command,\n signal: command.signal\n ? AbortSignal.any([command.signal, stop.signal])\n : stop.signal,\n });\n } finally {\n await sync?.pull();\n }\n });\n },\n close(settings = {}) {\n if (closing) return closing;\n closing = (async () => {\n stop.abort(new OutpostError(\"aborted\", \"Sandbox closed\"));\n await gate.close();\n let failure: unknown;\n try {\n await runtime.release();\n await sync?.close();\n } catch (cause) {\n failure = cause;\n }\n state.active = false;\n\n unregister();\n const disposal = owned\n ? await workspace.close({ preserve: settings.preserve || !!failure })\n : {};\n if (failure) throw failure;\n return disposal;\n })();\n return closing;\n },\n async [Symbol.asyncDispose]() {\n await result.close();\n },\n };\n const unregister = registerCleanup(() => result.close({ preserve: true }));\n return result;\n}\n"]}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YAAY,CAAC;YACzB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;KACF,CAAC;IACF,MAAM,UAAU,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { OutpostError } from \"../domain/errors.ts\";\nimport { validateBrief } from \"../domain/prompts.ts\";\nimport type { Disposal } from \"../domain/workspace.types.ts\";\nimport { registerCleanup } from \"../infrastructure/shutdown.ts\";\nimport { validateDispatch } from \"./dispatch-validation.ts\";\nimport { diagnoseSandbox } from \"./doctor-sandbox.ts\";\nimport { operationGate } from \"./operation-gate.ts\";\nimport type { Sandbox, SandboxOptions } from \"./outpost.types.ts\";\nimport { sandboxAgents } from \"./sandbox-agents.ts\";\nimport { attachInSandbox } from \"./sandbox-attach.ts\";\nimport { dispatchInSandbox } from \"./sandbox-dispatch.ts\";\nimport { provisionSandbox } from \"./sandbox-provision.ts\";\n\nexport async function createSandbox(\n options: SandboxOptions = {},\n): Promise<Sandbox> {\n const context = await provisionSandbox(options);\n const { workspace, runtime, sync, stop, state, owned } = context;\n const agents = sandboxAgents(context);\n const gate = operationGate();\n const exclusive = gate.run;\n let closing: Promise<Disposal> | undefined;\n const result: Sandbox = {\n workspace,\n root: runtime.root,\n dispatch(settings) {\n validateDispatch(settings);\n return exclusive(() =>\n dispatchInSandbox(context, agents, result, settings),\n );\n },\n resume(id, settings) {\n return result.dispatch({ ...settings, continuation: { id } });\n },\n fork(id, settings) {\n return result.dispatch({ ...settings, continuation: { id, fork: true } });\n },\n attach(settings = {}) {\n settings.signal?.throwIfAborted();\n validateBrief(settings.brief, true);\n return exclusive(() => attachInSandbox(context, agents, settings));\n },\n diagnose(settings = {}) {\n settings.signal?.throwIfAborted();\n return exclusive(() =>\n diagnoseSandbox(runtime, {\n ...settings,\n provider: context.provider,\n signal: settings.signal\n ? AbortSignal.any([settings.signal, stop.signal])\n : stop.signal,\n }),\n );\n },\n command(command) {\n command.signal?.throwIfAborted();\n return exclusive(async () => {\n try {\n return await runtime.invoke({\n ...command,\n signal: command.signal\n ? AbortSignal.any([command.signal, stop.signal])\n : stop.signal,\n });\n } finally {\n await sync?.pull();\n }\n });\n },\n close(settings = {}) {\n if (closing) return closing;\n closing = (async () => {\n stop.abort(new OutpostError(\"aborted\", \"Sandbox closed\"));\n await gate.close();\n let failure: unknown;\n try {\n await runtime.release();\n await sync?.close();\n } catch (cause) {\n failure = cause;\n }\n state.active = false;\n\n unregister();\n const disposal = owned\n ? await workspace.close({ preserve: settings.preserve || !!failure })\n : {};\n if (failure) throw failure;\n return disposal;\n })();\n return closing;\n },\n async [Symbol.asyncDispose]() {\n await result.close();\n },\n };\n const unregister = registerCleanup(() => result.close({ preserve: true }));\n return result;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { AgentObservation } from "../domain/agent.types.ts";
2
+ import type { TaskContext } from "../domain/workflow.types.ts";
3
+ import type { TaskUsageObserver } from "./task-usage.types.ts";
4
+ export declare function taskUsage(context: TaskContext, observer: ((event: AgentObservation) => void) | undefined): TaskUsageObserver;
@@ -0,0 +1,41 @@
1
+ import { addUsage } from "../domain/usage.js";
2
+ import { notify } from "./observation.js";
3
+ export function taskUsage(context, observer) {
4
+ const passes = new Map();
5
+ let total = { input: 0, cached: 0, output: 0 };
6
+ function difference(next, previous) {
7
+ return {
8
+ input: Math.max(0, next.input - previous.input),
9
+ cached: Math.max(0, next.cached - previous.cached),
10
+ output: Math.max(0, next.output - previous.output),
11
+ cacheCreated: Math.max(0, (next.cacheCreated ?? 0) - (previous.cacheCreated ?? 0)),
12
+ };
13
+ }
14
+ function report(usage) {
15
+ if (!Object.values(usage).some((value) => value > 0))
16
+ return;
17
+ total = addUsage(total, usage);
18
+ context.reportUsage(usage);
19
+ }
20
+ return {
21
+ observe(event) {
22
+ if (event.kind === "usage" || event.kind === "summary") {
23
+ const previous = passes.get(event.pass) ?? {
24
+ input: 0,
25
+ cached: 0,
26
+ output: 0,
27
+ };
28
+ const delta = event.kind === "usage"
29
+ ? event.tokens
30
+ : difference(event.tokens, previous);
31
+ passes.set(event.pass, addUsage(previous, delta));
32
+ report(delta);
33
+ }
34
+ notify(observer, event);
35
+ },
36
+ reconcile(usage) {
37
+ report(difference(usage, total));
38
+ },
39
+ };
40
+ }
41
+ //# sourceMappingURL=task-usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-usage.js","sourceRoot":"","sources":["../../src/application/task-usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,UAAU,SAAS,CACvB,OAAoB,EACpB,QAAyD;IAEzD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IACxC,IAAI,KAAK,GAAU,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACtD,SAAS,UAAU,CAAC,IAAW,EAAE,QAAe;QAC9C,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC/C,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;YAClD,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;YAClD,YAAY,EAAE,IAAI,CAAC,GAAG,CACpB,CAAC,EACD,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC,CACxD;SACF,CAAC;IACJ,CAAC;IACD,SAAS,MAAM,CAAC,KAAY;QAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;YAAE,OAAO;QAC7D,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/B,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO;QACL,OAAO,CAAC,KAAK;YACX,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvD,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;oBACzC,KAAK,EAAE,CAAC;oBACR,MAAM,EAAE,CAAC;oBACT,MAAM,EAAE,CAAC;iBACV,CAAC;gBACF,MAAM,KAAK,GACT,KAAK,CAAC,IAAI,KAAK,OAAO;oBACpB,CAAC,CAAC,KAAK,CAAC,MAAM;oBACd,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;gBACzC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;gBAClD,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;YACD,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC1B,CAAC;QACD,SAAS,CAAC,KAAK;YACb,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentObservation, Usage } from \"../domain/agent.types.ts\";\nimport { addUsage } from \"../domain/usage.ts\";\nimport type { TaskContext } from \"../domain/workflow.types.ts\";\nimport { notify } from \"./observation.ts\";\nimport type { TaskUsageObserver } from \"./task-usage.types.ts\";\n\nexport function taskUsage(\n context: TaskContext,\n observer: ((event: AgentObservation) => void) | undefined,\n): TaskUsageObserver {\n const passes = new Map<number, Usage>();\n let total: Usage = { input: 0, cached: 0, output: 0 };\n function difference(next: Usage, previous: Usage): Usage {\n return {\n input: Math.max(0, next.input - previous.input),\n cached: Math.max(0, next.cached - previous.cached),\n output: Math.max(0, next.output - previous.output),\n cacheCreated: Math.max(\n 0,\n (next.cacheCreated ?? 0) - (previous.cacheCreated ?? 0),\n ),\n };\n }\n function report(usage: Usage): void {\n if (!Object.values(usage).some((value) => value > 0)) return;\n total = addUsage(total, usage);\n context.reportUsage(usage);\n }\n return {\n observe(event) {\n if (event.kind === \"usage\" || event.kind === \"summary\") {\n const previous = passes.get(event.pass) ?? {\n input: 0,\n cached: 0,\n output: 0,\n };\n const delta =\n event.kind === \"usage\"\n ? event.tokens\n : difference(event.tokens, previous);\n passes.set(event.pass, addUsage(previous, delta));\n report(delta);\n }\n notify(observer, event);\n },\n reconcile(usage) {\n report(difference(usage, total));\n },\n };\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { AgentObservation, Usage } from "../domain/agent.types.ts";
2
+ export interface TaskUsageObserver {
3
+ observe(event: AgentObservation): void;
4
+ reconcile(usage: Usage): void;
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=task-usage.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-usage.types.js","sourceRoot":"","sources":["../../src/application/task-usage.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentObservation, Usage } from \"../domain/agent.types.ts\";\nexport interface TaskUsageObserver {\n observe(event: AgentObservation): void;\n reconcile(usage: Usage): void;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { taskUsage } from "./task-usage.js";
1
2
  import { OutpostError } from "../domain/errors.js";
2
3
  import { task } from "../domain/workflow.js";
3
4
  import { dispatch } from "./outpost.js";
@@ -5,14 +6,34 @@ export function agentTask(options) {
5
6
  const { sandbox, request, ...definition } = options;
6
7
  return task({
7
8
  ...definition,
8
- perform: (context) => sandbox.dispatch({ ...request(context), signal: context.signal }),
9
+ async perform(context) {
10
+ const options = request(context);
11
+ const usage = taskUsage(context, options.observe);
12
+ const result = await sandbox.dispatch({
13
+ ...options,
14
+ signal: context.signal,
15
+ observe: usage.observe,
16
+ });
17
+ usage.reconcile(result.usage);
18
+ return result;
19
+ },
9
20
  });
10
21
  }
11
22
  export function isolatedTask(options) {
12
23
  const { request, ...definition } = options;
13
24
  return task({
14
25
  ...definition,
15
- perform: (context) => dispatch({ ...request(context), signal: context.signal }),
26
+ async perform(context) {
27
+ const options = request(context);
28
+ const usage = taskUsage(context, options.observe);
29
+ const result = await dispatch({
30
+ ...options,
31
+ signal: context.signal,
32
+ observe: usage.observe,
33
+ });
34
+ usage.reconcile(result.usage);
35
+ return result;
36
+ },
16
37
  });
17
38
  }
18
39
  export function commandTask(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/application/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAA+B,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,UAAU,SAAS,CACvB,OACqB;IAErB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IACpD,OAAO,IAAI,CAAC;QACV,GAAG,UAAU;QACb,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACnB,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;KACpE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,OACwB;IAExB,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IAC3C,OAAO,IAAI,CAAC;QACV,GAAG,UAAU;QACb,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACnB,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;KAC5D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,OAAyE;IAEzE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IACpD,OAAO,IAAI,CAAC;QACV,GAAG,UAAU;QACb,KAAK,CAAC,OAAO,CAAC,OAAO;YACnB,MAAM,UAAU,GACd,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC7D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC;gBACnC,GAAG,UAAU;gBACb,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC,CAAC;YACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBACrB,MAAM,IAAI,YAAY,CAAC,SAAS,EAAE,yBAAyB,EAAE;oBAC3D,GAAG,MAAM;iBACV,CAAC,CAAC;YACL,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { OutpostError } from \"../domain/errors.ts\";\nimport type { CommandResult } from \"../domain/ports.ts\";\nimport { task, type Task, type TaskOptions } from \"../domain/workflow.ts\";\nimport type { DispatchResult } from \"./outpost.ts\";\nimport { dispatch } from \"./outpost.ts\";\nimport type {\n AgentTaskOptions,\n CommandTaskOptions,\n IsolatedTaskOptions,\n} from \"./tasks.types.ts\";\n\nexport function agentTask<T>(\n options: Omit<TaskOptions<DispatchResult<T>>, \"perform\"> &\n AgentTaskOptions<T>,\n): Task<DispatchResult<T>> {\n const { sandbox, request, ...definition } = options;\n return task({\n ...definition,\n perform: (context) =>\n sandbox.dispatch({ ...request(context), signal: context.signal }),\n });\n}\n\nexport function isolatedTask<T>(\n options: Omit<TaskOptions<DispatchResult<T>>, \"perform\"> &\n IsolatedTaskOptions<T>,\n): Task<DispatchResult<T>> {\n const { request, ...definition } = options;\n return task({\n ...definition,\n perform: (context) =>\n dispatch({ ...request(context), signal: context.signal }),\n });\n}\n\nexport function commandTask(\n options: Omit<TaskOptions<CommandResult>, \"perform\"> & CommandTaskOptions,\n): Task<CommandResult> {\n const { sandbox, command, ...definition } = options;\n return task({\n ...definition,\n async perform(context) {\n const invocation =\n typeof command === \"function\" ? command(context) : command;\n const result = await sandbox.command({\n ...invocation,\n signal: context.signal,\n });\n if (result.status !== 0)\n throw new OutpostError(\"process\", \"Workflow command failed\", {\n ...result,\n });\n return result;\n },\n });\n}\n"]}
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/application/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAA+B,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,UAAU,SAAS,CACvB,OACqB;IAErB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IACpD,OAAO,IAAI,CAAC;QACV,GAAG,UAAU;QACb,KAAK,CAAC,OAAO,CAAC,OAAO;YACnB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAClD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC;gBACpC,GAAG,OAAO;gBACV,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,CAAC;YACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBACrB,MAAM,IAAI,YAAY,CAAC,SAAS,EAAE,yBAAyB,EAAE;oBAC3D,GAAG,MAAM;iBACV,CAAC,CAAC;YACL,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { taskUsage } from \"./task-usage.ts\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport type { CommandResult } from \"../domain/ports.ts\";\nimport { task, type Task, type TaskOptions } from \"../domain/workflow.ts\";\nimport type { DispatchResult } from \"./outpost.ts\";\nimport { dispatch } from \"./outpost.ts\";\nimport type {\n AgentTaskOptions,\n CommandTaskOptions,\n IsolatedTaskOptions,\n} from \"./tasks.types.ts\";\n\nexport function agentTask<T>(\n options: Omit<TaskOptions<DispatchResult<T>>, \"perform\"> &\n AgentTaskOptions<T>,\n): Task<DispatchResult<T>> {\n const { sandbox, request, ...definition } = options;\n return task({\n ...definition,\n async perform(context) {\n const options = request(context);\n const usage = taskUsage(context, options.observe);\n const result = await sandbox.dispatch({\n ...options,\n signal: context.signal,\n observe: usage.observe,\n });\n usage.reconcile(result.usage);\n return result;\n },\n });\n}\n\nexport function isolatedTask<T>(\n options: Omit<TaskOptions<DispatchResult<T>>, \"perform\"> &\n IsolatedTaskOptions<T>,\n): Task<DispatchResult<T>> {\n const { request, ...definition } = options;\n return task({\n ...definition,\n async perform(context) {\n const options = request(context);\n const usage = taskUsage(context, options.observe);\n const result = await dispatch({\n ...options,\n signal: context.signal,\n observe: usage.observe,\n });\n usage.reconcile(result.usage);\n return result;\n },\n });\n}\n\nexport function commandTask(\n options: Omit<TaskOptions<CommandResult>, \"perform\"> & CommandTaskOptions,\n): Task<CommandResult> {\n const { sandbox, command, ...definition } = options;\n return task({\n ...definition,\n async perform(context) {\n const invocation =\n typeof command === \"function\" ? command(context) : command;\n const result = await sandbox.command({\n ...invocation,\n signal: context.signal,\n });\n if (result.status !== 0)\n throw new OutpostError(\"process\", \"Workflow command failed\", {\n ...result,\n });\n return result;\n },\n });\n}\n"]}
@@ -1,4 +1,6 @@
1
1
  import { parseArgs } from "node:util";
2
+ import { recoveryCommand } from "./recovery-command.js";
3
+ import { doctorCommand } from "./doctor-command.js";
2
4
  import { imageCommand } from "./image-command.js";
3
5
  import { initializeCommand } from "./init-command.js";
4
6
  import { cliOptions, help } from "./main.constants.js";
@@ -13,6 +15,8 @@ export async function runCli(args = process.argv.slice(2)) {
13
15
  return;
14
16
  }
15
17
  const commands = {
18
+ doctor: doctorCommand,
19
+ recovery: recoveryCommand,
16
20
  init: initializeCommand,
17
21
  image: imageCommand,
18
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAA0B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/C,MAAM,UAAU,GAAG,SAAS,CAAC;QAC3B,IAAI;QACJ,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,UAAU;KACpB,CAAC,CAAC;IACH,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAyC;QACrD,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,YAAY;KACpB,CAAC;IACF,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,MAAM,QAAQ,CAAC,IAAI,CAAE,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { parseArgs } from \"node:util\";\nimport { imageCommand } from \"./image-command.ts\";\nimport { initializeCommand } from \"./init-command.ts\";\nimport { cliOptions, help } from \"./main.constants.ts\";\nimport type { CliCommand } from \"./main.types.ts\";\n\nexport async function runCli(\n args: readonly string[] = process.argv.slice(2),\n): Promise<void> {\n const invocation = parseArgs({\n args,\n allowPositionals: true,\n options: cliOptions,\n });\n if (invocation.values.help || !invocation.positionals.length) {\n process.stdout.write(help);\n return;\n }\n const commands: Readonly<Record<string, CliCommand>> = {\n init: initializeCommand,\n image: imageCommand,\n };\n const name = invocation.positionals[0]!;\n if (!Object.hasOwn(commands, name))\n throw new Error(\"Unknown command. Run outpost --help.\");\n await commands[name]!(invocation);\n}\n"]}
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAA0B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/C,MAAM,UAAU,GAAG,SAAS,CAAC;QAC3B,IAAI;QACJ,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,UAAU;KACpB,CAAC,CAAC;IACH,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAyC;QACrD,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,YAAY;KACpB,CAAC;IACF,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,MAAM,QAAQ,CAAC,IAAI,CAAE,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { parseArgs } from \"node:util\";\nimport { recoveryCommand } from \"./recovery-command.ts\";\nimport { doctorCommand } from \"./doctor-command.ts\";\nimport { imageCommand } from \"./image-command.ts\";\nimport { initializeCommand } from \"./init-command.ts\";\nimport { cliOptions, help } from \"./main.constants.ts\";\nimport type { CliCommand } from \"./main.types.ts\";\n\nexport async function runCli(\n args: readonly string[] = process.argv.slice(2),\n): Promise<void> {\n const invocation = parseArgs({\n args,\n allowPositionals: true,\n options: cliOptions,\n });\n if (invocation.values.help || !invocation.positionals.length) {\n process.stdout.write(help);\n return;\n }\n const commands: Readonly<Record<string, CliCommand>> = {\n doctor: doctorCommand,\n recovery: recoveryCommand,\n init: initializeCommand,\n image: imageCommand,\n };\n const name = invocation.positionals[0]!;\n if (!Object.hasOwn(commands, name))\n throw new Error(\"Unknown command. Run outpost --help.\");\n await commands[name]!(invocation);\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { Executor } from "../infrastructure/process.types.ts";
2
+ import type { CliInvocation } from "./main.types.ts";
3
+ export declare function doctorCommand({ values, positionals }: CliInvocation, execute?: Executor, write?: (text: string) => void): Promise<void>;
@@ -0,0 +1,38 @@
1
+ import { doctorDefaults, providerDiagnostics, } from "../application/doctor.constants.js";
2
+ import { diagnose } from "../application/doctor.js";
3
+ import { invariant } from "../domain/errors.js";
4
+ function isProvider(value) {
5
+ return Object.hasOwn(providerDiagnostics, value);
6
+ }
7
+ export async function doctorCommand({ values, positionals }, execute, write = (text) => {
8
+ process.stdout.write(text);
9
+ }) {
10
+ invariant(positionals.length === 1, "Usage: outpost doctor [--provider NAME] [--agent NAME] [--image NAME] [--json]");
11
+ for (const key of Object.keys(values))
12
+ invariant(["provider", "agent", "image", "json"].includes(key), `Unsupported doctor option: --${key}`);
13
+ const provider = values.provider ?? doctorDefaults.provider;
14
+ const agent = values.agent ?? doctorDefaults.agent;
15
+ invariant(isProvider(provider), "Unknown provider. Choose docker, podman, local, vercel or daytona.");
16
+ invariant(agent === "codex" || agent === "claude", "Unknown agent. Choose codex or claude.");
17
+ const report = await diagnose({
18
+ provider,
19
+ agent,
20
+ ...(values.image !== undefined ? { image: values.image } : {}),
21
+ }, execute);
22
+ if (values.json)
23
+ write(`${JSON.stringify(report, null, 2)}\n`);
24
+ else {
25
+ write(`Outpost doctor — ${report.scope === "host" ? "host checks" : "host and image checks"} (${provider}, ${agent})\n`);
26
+ write(`Provider contract: ${report.placement}; interactive terminal: ${report.interactiveTerminal ? "supported" : "unsupported"}. Workflow execution is not tested.\n`);
27
+ if (report.image)
28
+ write(`Image: ${report.image}\n`);
29
+ for (const check of report.checks)
30
+ write(`[${check.status.toUpperCase()}] ${check.id}${check.version ? ` ${check.version}` : ""}${check.referenceVersion ? ` (pinned: ${check.referenceVersion})` : ""}: ${check.message}\n`);
31
+ write(report.hasFailures
32
+ ? "Diagnostic checks found failures.\n"
33
+ : "No blocking check failed; warnings and skipped checks still need review.\n");
34
+ }
35
+ if (report.hasFailures)
36
+ process.exitCode = 1;
37
+ }
38
+ //# sourceMappingURL=doctor-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-command.js","sourceRoot":"","sources":["../../src/cli/doctor-command.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,EAAE,MAAM,EAAE,WAAW,EAAiB,EACtC,OAAkB,EAClB,QAAgC,CAAC,IAAI,EAAE,EAAE;IACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;IAED,SAAS,CACP,WAAW,CAAC,MAAM,KAAK,CAAC,EACxB,gFAAgF,CACjF,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACnC,SAAS,CACP,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EACpD,gCAAgC,GAAG,EAAE,CACtC,CAAC;IACJ,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,cAAc,CAAC,QAAQ,CAAC;IAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC;IACnD,SAAS,CACP,UAAU,CAAC,QAAQ,CAAC,EACpB,oEAAoE,CACrE,CAAC;IACF,SAAS,CACP,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,QAAQ,EACvC,wCAAwC,CACzC,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,QA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AW;QAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import {\n doctorDefaults,\n providerDiagnostics,\n} from \"../application/doctor.constants.ts\";\nimport { diagnose } from \"../application/doctor.ts\";\nimport type { DoctorProvider } from \"../application/doctor.types.ts\";\nimport { invariant } from \"../domain/errors.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport type { CliInvocation } from \"./main.types.ts\";\n\nfunction isProvider(value: string): value is DoctorProvider {\n return Object.hasOwn(providerDiagnostics, value);\n}\nexport async function doctorCommand(\n { values, positionals }: CliInvocation,\n execute?: Executor,\n write: (text: string) => void = (text) => {\n process.stdout.write(text);\n },\n): Promise<void> {\n invariant(\n positionals.length === 1,\n \"Usage: outpost doctor [--provider NAME] [--agent NAME] [--image NAME] [--json]\",\n );\n for (const key of Object.keys(values))\n invariant(\n [\"provider\", \"agent\", \"image\", \"json\"].includes(key),\n `Unsupported doctor option: --${key}`,\n );\n const provider = values.provider ?? doctorDefaults.provider;\n const agent = values.agent ?? doctorDefaults.agent;\n invariant(\n isProvider(provider),\n \"Unknown provider. Choose docker, podman, local, vercel or daytona.\",\n );\n invariant(\n agent === \"codex\" || agent === \"claude\",\n \"Unknown agent. Choose codex or claude.\",\n );\n const report = await diagnose(\n {\n provider,\n agent,\n ...(values.image !== undefined ? { image: values.image } : {}),\n },\n execute,\n );\n if (values.json) write(`${JSON.stringify(report, null, 2)}\\n`);\n else {\n write(\n `Outpost doctor — ${report.scope === \"host\" ? \"host checks\" : \"host and image checks\"} (${provider}, ${agent})\\n`,\n );\n write(\n `Provider contract: ${report.placement}; interactive terminal: ${report.interactiveTerminal ? \"supported\" : \"unsupported\"}. Workflow execution is not tested.\\n`,\n );\n if (report.image) write(`Image: ${report.image}\\n`);\n for (const check of report.checks)\n write(\n `[${check.status.toUpperCase()}] ${check.id}${check.version ? ` ${check.version}` : \"\"}${check.referenceVersion ? ` (pinned: ${check.referenceVersion})` : \"\"}: ${check.message}\\n`,\n );\n write(\n report.hasFailures\n ? \"Diagnostic checks found failures.\\n\"\n : \"No blocking check failed; warnings and skipped checks still need review.\\n\",\n );\n }\n if (report.hasFailures) process.exitCode = 1;\n}\n"]}
package/dist/cli/image.js CHANGED
@@ -18,7 +18,7 @@ export async function manageImage(action, options = {}, executor) {
18
18
  "--tag",
19
19
  image,
20
20
  "--file",
21
- resolve(root, options.file ?? `.outpost/${imageFiles[engine]}`),
21
+ resolve(root, options.file ?? imageFiles[engine]),
22
22
  "--build-arg",
23
23
  `AGENT_UID=${uid}`,
24
24
  "--build-arg",
@@ -1 +1 @@
1
- {"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/cli/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGjE,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAA0B,EAC1B,UAAwB,EAAE,EAC1B,QAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,EACtD,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,QAAQ,EACnC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;IAC3C,SAAS,CACP,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,QAAQ,EAC1C,uCAAuC,CACxC,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,aAAa,CAAC,GAAG,EAChE,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,aAAa,CAAC,GAAG,CAAC;IAC/D,SAAS,CACP,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC;QACvB,GAAG,IAAI,CAAC;QACR,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC;QACzB,GAAG,IAAI,CAAC,EACV,0CAA0C,CAC3C,CAAC;IACF,MAAM,IAAI,GACR,MAAM,KAAK,QAAQ;QACjB,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC;QACxB,CAAC,CAAC;YACE,OAAO;YACP,OAAO;YACP,KAAK;YACL,QAAQ;YACR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,YAAY,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/D,aAAa;YACb,aAAa,GAAG,EAAE;YAClB,aAAa;YACb,aAAa,GAAG,EAAE;YAClB,IAAI;SACL,CAAC;IACR,MAAM,cAAc,CAClB;QACE,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,aAAa,CAAC,OAAO;QACjC,OAAO,CAAC,OAAO,EAAE,IAAI;YACnB,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvE,CAAC;KACF,EACD,QAAQ,CACT,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { resolve } from \"node:path\";\nimport { invariant } 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 { imageDefaults, imageFiles } from \"./image.constants.ts\";\nimport type { ImageOptions } from \"./image.types.ts\";\n\nexport async function manageImage(\n action: \"build\" | \"remove\",\n options: ImageOptions = {},\n executor?: Executor,\n): Promise<string> {\n const root = resolve(options.directory ?? process.cwd()),\n engine = options.engine ?? \"docker\",\n image = options.image ?? imageName(root);\n invariant(\n engine === \"docker\" || engine === \"podman\",\n \"Image engine must be docker or podman\",\n );\n const uid = options.uid ?? process.getuid?.() ?? imageDefaults.uid,\n gid = options.gid ?? process.getgid?.() ?? imageDefaults.gid;\n invariant(\n Number.isSafeInteger(uid) &&\n uid >= 0 &&\n Number.isSafeInteger(gid) &&\n gid >= 0,\n \"UID and GID must be nonnegative integers\",\n );\n const args =\n action === \"remove\"\n ? [\"image\", \"rm\", image]\n : [\n \"build\",\n \"--tag\",\n image,\n \"--file\",\n resolve(root, options.file ?? `.outpost/${imageFiles[engine]}`),\n \"--build-arg\",\n `AGENT_UID=${uid}`,\n \"--build-arg\",\n `AGENT_GID=${gid}`,\n root,\n ];\n await requireSuccess(\n {\n executable: engine,\n arguments: args,\n directory: root,\n deadlineMs: imageDefaults.buildMs,\n observe(channel, text) {\n (channel === \"stdout\" ? process.stdout : process.stderr).write(text);\n },\n },\n executor,\n );\n return image;\n}\n"]}
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/cli/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGjE,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAA0B,EAC1B,UAAwB,EAAE,EAC1B,QAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,EACtD,MAAM,GAAG,OAAO,CAAC,MAAM,I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AC;IACF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { resolve } from \"node:path\";\nimport { invariant } 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 { imageDefaults, imageFiles } from \"./image.constants.ts\";\nimport type { ImageOptions } from \"./image.types.ts\";\n\nexport async function manageImage(\n action: \"build\" | \"remove\",\n options: ImageOptions = {},\n executor?: Executor,\n): Promise<string> {\n const root = resolve(options.directory ?? process.cwd()),\n engine = options.engine ?? \"docker\",\n image = options.image ?? imageName(root);\n invariant(\n engine === \"docker\" || engine === \"podman\",\n \"Image engine must be docker or podman\",\n );\n const uid = options.uid ?? process.getuid?.() ?? imageDefaults.uid,\n gid = options.gid ?? process.getgid?.() ?? imageDefaults.gid;\n invariant(\n Number.isSafeInteger(uid) &&\n uid >= 0 &&\n Number.isSafeInteger(gid) &&\n gid >= 0,\n \"UID and GID must be nonnegative integers\",\n );\n const args =\n action === \"remove\"\n ? [\"image\", \"rm\", image]\n : [\n \"build\",\n \"--tag\",\n image,\n \"--file\",\n resolve(root, options.file ?? imageFiles[engine]),\n \"--build-arg\",\n `AGENT_UID=${uid}`,\n \"--build-arg\",\n `AGENT_GID=${gid}`,\n root,\n ];\n await requireSuccess(\n {\n executable: engine,\n arguments: args,\n directory: root,\n deadlineMs: imageDefaults.buildMs,\n observe(channel, text) {\n (channel === \"stdout\" ? process.stdout : process.stderr).write(text);\n },\n },\n executor,\n );\n return image;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { resolve } from "node:path";
1
2
  import { createInterface } from "node:readline/promises";
2
3
  import { initializationQuestions } from "./main.constants.js";
3
4
  import { initialize } from "./scaffold.js";
@@ -5,8 +6,8 @@ export async function initializeCommand({ values, }) {
5
6
  const options = Object.fromEntries(Object.entries(values).filter(([key]) => !["help", "yes"].includes(key)));
6
7
  if (!values.yes &&
7
8
  !process.stdin.isTTY &&
8
- (!values.agent || !values.provider || !values.template || !values.tracker))
9
- throw new Error("Headless initialization requires --yes for defaults, or --agent, --provider, --template and --tracker.");
9
+ (!values.agent || !values.provider))
10
+ throw new Error("Headless initialization requires --yes for defaults, or --agent and --provider.");
10
11
  if (!values.yes && process.stdin.isTTY) {
11
12
  const terminal = createInterface({
12
13
  input: process.stdin,
@@ -24,6 +25,6 @@ export async function initializeCommand({ values, }) {
24
25
  }
25
26
  }
26
27
  const result = await initialize(options);
27
- process.stdout.write(`Created ${result.files.length} files.\nRun: ${result.run}\n`);
28
+ process.stdout.write(`Initialized ${result.files.length} files in ${resolve(values.directory ?? process.cwd())}.\nRun: ${result.run}\n`);
28
29
  }
29
30
  //# sourceMappingURL=init-command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-command.js","sourceRoot":"","sources":["../../src/cli/init-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EACtC,MAAM,GACQ;IACd,MAAM,OAAO,GAA4B,MAAM,CAAC,WAAW,CACzD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CACzE,CAAC;IACF,IACE,CAAC,MAAM,CAAC,GAAG;QACX,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;QACpB,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAE1E,MAAM,IAAI,KAAK,CACb,wGAAwG,CACzG,CAAC;IACJ,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,eAAe,CAAC;YAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;QACH,IAAI,CAAC;YACH,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,uBAAuB,EAAE,CAAC;gBAC7D,OAAO,CAAC,GAAG,CAAC;oBACV,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,KAAK,QAAQ,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;wBAC5D,QAAQ,CAAC;YACb,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAsB,CAAC,CAAC;IACxD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,WAAW,MAAM,CAAC,KAAK,CAAC,MAAM,iBAAiB,MAAM,CAAC,GAAG,IAAI,CAC9D,CAAC;AACJ,CAAC","sourcesContent":["import { createInterface } from \"node:readline/promises\";\nimport { initializationQuestions } from \"./main.constants.ts\";\nimport type { CliInvocation } from \"./main.types.ts\";\nimport { initialize } from \"./scaffold.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport async function initializeCommand({\n values,\n}: CliInvocation): Promise<void> {\n const options: Record<string, unknown> = Object.fromEntries(\n Object.entries(values).filter(([key]) => ![\"help\", \"yes\"].includes(key)),\n );\n if (\n !values.yes &&\n !process.stdin.isTTY &&\n (!values.agent || !values.provider || !values.template || !values.tracker)\n )\n throw new Error(\n \"Headless initialization requires --yes for defaults, or --agent, --provider, --template and --tracker.\",\n );\n if (!values.yes && process.stdin.isTTY) {\n const terminal = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n try {\n for (const [key, label, fallback] of initializationQuestions) {\n options[key] ??=\n (await terminal.question(`${label} [${fallback}]: `)).trim() ||\n fallback;\n }\n } finally {\n terminal.close();\n }\n }\n const result = await initialize(options as InitOptions);\n process.stdout.write(\n `Created ${result.files.length} files.\\nRun: ${result.run}\\n`,\n );\n}\n"]}
1
+ {"version":3,"file":"init-command.js","sourceRoot":"","sources":["../../src/cli/init-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EACtC,MAAM,GACQ;IACd,MAAM,OAAO,GAA4B,MAAM,CAAC,WAAW,CACzD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CACzE,CAAC;IACF,IACE,CAAC,MAAM,CAAC,GAAG;QACX,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;QACpB,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAEnC,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,eAAe,CAAC;YAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;QACH,IAAI,CAAC;YACH,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,uBAAuB,EAAE,CAAC;gBAC7D,OAAO,CAAC,GAAG,CAAC;oBACV,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,KAAK,QAAQ,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;wBAC5D,QAAQ,CAAC;YACb,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAsB,CAAC,CAAC;IACxD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,eAAe,MAAM,CAAC,KAAK,CAAC,MAAM,aAAa,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,MAAM,CAAC,GAAG,IAAI,CACnH,CAAC;AACJ,CAAC","sourcesContent":["import { resolve } from \"node:path\";\nimport { createInterface } from \"node:readline/promises\";\nimport { initializationQuestions } from \"./main.constants.ts\";\nimport type { CliInvocation } from \"./main.types.ts\";\nimport { initialize } from \"./scaffold.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport async function initializeCommand({\n values,\n}: CliInvocation): Promise<void> {\n const options: Record<string, unknown> = Object.fromEntries(\n Object.entries(values).filter(([key]) => ![\"help\", \"yes\"].includes(key)),\n );\n if (\n !values.yes &&\n !process.stdin.isTTY &&\n (!values.agent || !values.provider)\n )\n throw new Error(\n \"Headless initialization requires --yes for defaults, or --agent and --provider.\",\n );\n if (!values.yes && process.stdin.isTTY) {\n const terminal = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n try {\n for (const [key, label, fallback] of initializationQuestions) {\n options[key] ??=\n (await terminal.question(`${label} [${fallback}]: `)).trim() ||\n fallback;\n }\n } finally {\n terminal.close();\n }\n }\n const result = await initialize(options as InitOptions);\n process.stdout.write(\n `Initialized ${result.files.length} files in ${resolve(values.directory ?? process.cwd())}.\\nRun: ${result.run}\\n`,\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- export declare const help = "Outpost \u2014 sandboxed coding agents and workflows\n\noutpost init [--yes] [--agent codex|claude] [--provider docker|podman|vercel|daytona|local]\n [--template blank|iterate|review|plan|plan-review] [--tracker github|beads|custom]\n [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--label NAME] [--directory PATH]\noutpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]\n\nNode.js 24+ and Git are required. Run generated scripts with Node.js.\n";
1
+ export declare const help = "Outpost \u2014 sandboxed coding agents and workflows\n\noutpost init [--yes] [--agent codex|claude] [--provider docker|podman|vercel|daytona|local]\n [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--directory PATH] [--repository PATH]\noutpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]\n\noutpost doctor [--provider docker|podman|local|vercel|daytona] [--agent codex|claude] [--image NAME] [--json]\n\noutpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--json]\noutpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]\noutpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]\n\nNode.js 24+ and Git are required. Run generated scripts with Node.js.\nInitialization writes run.ts and project files directly into --directory (default: current directory).\n--repository selects the target Git repository; relative paths are resolved from the workflow directory.\n";
2
2
  export declare const cliOptions: {
3
3
  readonly help: {
4
4
  readonly type: "boolean";
@@ -14,16 +14,37 @@ export declare const cliOptions: {
14
14
  readonly build: {
15
15
  readonly type: "boolean";
16
16
  };
17
- readonly agent: {
17
+ readonly json: {
18
+ readonly type: "boolean";
19
+ };
20
+ readonly git: {
21
+ readonly type: "boolean";
22
+ };
23
+ readonly locks: {
24
+ readonly type: "boolean";
25
+ };
26
+ readonly restorability: {
27
+ readonly type: "boolean";
28
+ };
29
+ readonly apply: {
30
+ readonly type: "boolean";
31
+ };
32
+ readonly policy: {
18
33
  readonly type: "string";
19
34
  };
20
- readonly provider: {
35
+ readonly checksums: {
36
+ readonly type: "boolean";
37
+ };
38
+ readonly "max-bytes": {
39
+ readonly type: "string";
40
+ };
41
+ readonly "max-entries": {
21
42
  readonly type: "string";
22
43
  };
23
- readonly template: {
44
+ readonly agent: {
24
45
  readonly type: "string";
25
46
  };
26
- readonly tracker: {
47
+ readonly provider: {
27
48
  readonly type: "string";
28
49
  };
29
50
  readonly manager: {
@@ -32,10 +53,10 @@ export declare const cliOptions: {
32
53
  readonly model: {
33
54
  readonly type: "string";
34
55
  };
35
- readonly label: {
56
+ readonly directory: {
36
57
  readonly type: "string";
37
58
  };
38
- readonly directory: {
59
+ readonly repository: {
39
60
  readonly type: "string";
40
61
  };
41
62
  readonly engine: {
@@ -54,4 +75,4 @@ export declare const cliOptions: {
54
75
  readonly type: "string";
55
76
  };
56
77
  };
57
- export declare const initializationQuestions: readonly [readonly ["agent", "Agent (codex/claude)", "codex"], readonly ["provider", "Sandbox (docker/podman/vercel/daytona/local)", "docker"], readonly ["template", "Template (blank/iterate/review/plan/plan-review)", "blank"], readonly ["tracker", "Issue tracker (github/beads/custom)", "github"]];
78
+ export declare const initializationQuestions: readonly [readonly ["agent", "Agent (codex/claude)", "codex"], readonly ["provider", "Sandbox (docker/podman/vercel/daytona/local)", "docker"]];
@@ -1,25 +1,39 @@
1
1
  export const help = `Outpost — sandboxed coding agents and workflows
2
2
 
3
3
  outpost init [--yes] [--agent codex|claude] [--provider docker|podman|vercel|daytona|local]
4
- [--template blank|iterate|review|plan|plan-review] [--tracker github|beads|custom]
5
- [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--label NAME] [--directory PATH]
4
+ [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--directory PATH] [--repository PATH]
6
5
  outpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]
7
6
 
7
+ outpost doctor [--provider docker|podman|local|vercel|daytona] [--agent codex|claude] [--image NAME] [--json]
8
+
9
+ outpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--json]
10
+ outpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]
11
+ outpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]
12
+
8
13
  Node.js 24+ and Git are required. Run generated scripts with Node.js.
14
+ Initialization writes run.ts and project files directly into --directory (default: current directory).
15
+ --repository selects the target Git repository; relative paths are resolved from the workflow directory.
9
16
  `;
10
17
  export const cliOptions = {
11
18
  help: { type: "boolean", short: "h" },
12
19
  yes: { type: "boolean", short: "y" },
13
20
  install: { type: "boolean" },
14
21
  build: { type: "boolean" },
22
+ json: { type: "boolean" },
23
+ git: { type: "boolean" },
24
+ locks: { type: "boolean" },
25
+ restorability: { type: "boolean" },
26
+ apply: { type: "boolean" },
27
+ policy: { type: "string" },
28
+ checksums: { type: "boolean" },
29
+ "max-bytes": { type: "string" },
30
+ "max-entries": { type: "string" },
15
31
  agent: { type: "string" },
16
32
  provider: { type: "string" },
17
- template: { type: "string" },
18
- tracker: { type: "string" },
19
33
  manager: { type: "string" },
20
34
  model: { type: "string" },
21
- label: { type: "string" },
22
35
  directory: { type: "string" },
36
+ repository: { type: "string" },
23
37
  engine: { type: "string" },
24
38
  file: { type: "string" },
25
39
  image: { type: "string" },
@@ -29,7 +43,5 @@ export const cliOptions = {
29
43
  export const initializationQuestions = [
30
44
  ["agent", "Agent (codex/claude)", "codex"],
31
45
  ["provider", "Sandbox (docker/podman/vercel/daytona/local)", "docker"],
32
- ["template", "Template (blank/iterate/review/plan/plan-review)", "blank"],
33
- ["tracker", "Issue tracker (github/beads/custom)", "github"],
34
46
  ];
35
47
  //# sourceMappingURL=main.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.constants.js","sourceRoot":"","s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,CAAC,SAAS,EAAE,qCAAqC,EAAE,QAAQ,CAAC;CACpD,CAAC","sourcesContent":["export const help = `Outpost — sandboxed coding agents and workflows\n\noutpost init [--yes] [--agent codex|claude] [--provider docker|podman|vercel|daytona|local]\n [--template blank|iterate|review|plan|plan-review] [--tracker github|beads|custom]\n [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--label NAME] [--directory PATH]\noutpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]\n\nNode.js 24+ and Git are required. Run generated scripts with Node.js.\n`;\n\nexport const cliOptions = {\n help: { type: \"boolean\", short: \"h\" },\n yes: { type: \"boolean\", short: \"y\" },\n install: { type: \"boolean\" },\n build: { type: \"boolean\" },\n agent: { type: \"string\" },\n provider: { type: \"string\" },\n template: { type: \"string\" },\n tracker: { type: \"string\" },\n manager: { type: \"string\" },\n model: { type: \"string\" },\n label: { type: \"string\" },\n directory: { type: \"string\" },\n engine: { type: \"string\" },\n file: { type: \"string\" },\n image: { type: \"string\" },\n uid: { type: \"string\" },\n gid: { type: \"string\" },\n} as const;\n\nexport const initializationQuestions = [\n [\"agent\", \"Agent (codex/claude)\", \"codex\"],\n [\"provider\", \"Sandbox (docker/podman/vercel/daytona/local)\", \"docker\"],\n [\"template\", \"Template (blank/iterate/review/plan/plan-review)\", \"blank\"],\n [\"tracker\", \"Issue tracker (github/beads/custom)\", \"github\"],\n] as const;\n"]}
1
+ {"version":3,"file":"main.constants.js","sourceRoot":"","sources":["../../src/cli/main.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;CAenB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACpC,OAAO,EAA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9D,CAAC","sourcesContent":["export const help = `Outpost — sandboxed coding agents and workflows\n\noutpost init [--yes] [--agent codex|claude] [--provider docker|podman|vercel|daytona|local]\n [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--directory PATH] [--repository PATH]\noutpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]\n\noutpost doctor [--provider docker|podman|local|vercel|daytona] [--agent codex|claude] [--image NAME] [--json]\n\noutpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--json]\noutpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]\noutpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]\n\nNode.js 24+ and Git are required. Run generated scripts with Node.js.\nInitialization writes run.ts and project files directly into --directory (default: current directory).\n--repository selects the target Git repository; relative paths are resolved from the workflow directory.\n`;\n\nexport const cliOptions = {\n help: { type: \"boolean\", short: \"h\" },\n yes: { type: \"boolean\", short: \"y\" },\n install: { type: \"boolean\" },\n build: { type: \"boolean\" },\n json: { type: \"boolean\" },\n git: { type: \"boolean\" },\n locks: { type: \"boolean\" },\n restorability: { type: \"boolean\" },\n apply: { type: \"boolean\" },\n policy: { type: \"string\" },\n checksums: { type: \"boolean\" },\n \"max-bytes\": { type: \"string\" },\n \"max-entries\": { type: \"string\" },\n agent: { type: \"string\" },\n provider: { type: \"string\" },\n manager: { type: \"string\" },\n model: { type: \"string\" },\n directory: { type: \"string\" },\n repository: { type: \"string\" },\n engine: { type: \"string\" },\n file: { type: \"string\" },\n image: { type: \"string\" },\n uid: { type: \"string\" },\n gid: { type: \"string\" },\n} as const;\n\nexport const initializationQuestions = [\n [\"agent\", \"Agent (codex/claude)\", \"codex\"],\n [\"provider\", \"Sandbox (docker/podman/vercel/daytona/local)\", \"docker\"],\n] as const;\n"]}
@@ -4,17 +4,19 @@ import { invariant } from "../domain/errors.js";
4
4
  import { managerLocks, supportedManagers } from "./scaffold.constants.js";
5
5
  export async function projectSettings(root, options) {
6
6
  let pkg = {};
7
+ let hasPackage = true;
7
8
  try {
8
9
  pkg = JSON.parse(await readFile(join(root, "package.json"), "utf8"));
9
10
  if (!pkg || typeof pkg !== "object")
10
11
  pkg = {};
11
12
  }
12
13
  catch (cause) {
14
+ if (cause.code === "ENOENT")
15
+ hasPackage = false;
13
16
  if (!(cause instanceof SyntaxError) &&
14
17
  cause.code !== "ENOENT")
15
18
  throw cause;
16
19
  }
17
- const extension = pkg.type === "module" ? "ts" : "mts";
18
20
  let detected = typeof pkg.packageManager === "string"
19
21
  ? pkg.packageManager.split("@")[0]
20
22
  : undefined;
@@ -31,6 +33,10 @@ export async function projectSettings(root, options) {
31
33
  }
32
34
  const manager = options.manager ?? detected ?? "npm";
33
35
  invariant(supportedManagers.includes(manager), "Unknown package manager");
34
- return { extension, manager };
36
+ return {
37
+ hasPackage,
38
+ manager,
39
+ extension: pkg.type === "commonjs" ? "mts" : "ts",
40
+ };
35
41
  }
36
42
  //# sourceMappingURL=project-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-settings.js","sourceRoot":"","sources":["../../src/cli/project-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO1E,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAY,EACZ,OAAoB;IAEpB,IAAI,GAAG,GAAoB,EAAE,CAAC;IAC9B,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,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"node:path\";\nimport { invariant } from \"../domain/errors.ts\";\nimport { managerLocks, supportedManagers } from \"./scaffold.constants.ts\";\nimport type {\n InitOptions,\n PackageManifest,\n ProjectSettings,\n} from \"./scaffold.types.ts\";\n\nexport async function projectSettings(\n root: string,\n options: InitOptions,\n): Promise<ProjectSettings> {\n let pkg: PackageManifest = {};\n try {\n pkg = JSON.parse(await readFile(join(root, \"package.json\"), \"utf8\"));\n if (!pkg || typeof pkg !== \"object\") pkg = {};\n } catch (cause) {\n if (\n !(cause instanceof SyntaxError) &&\n (cause as NodeJS.ErrnoException).code !== \"ENOENT\"\n )\n throw cause;\n }\n const extension = pkg.type === \"module\" ? \"ts\" : \"mts\";\n let detected =\n typeof pkg.packageManager === \"string\"\n ? pkg.packageManager.split(\"@\")[0]\n : undefined;\n if (!detected || !supportedManagers.includes(detected)) {\n detected = undefined;\n for (const [file, manager] of managerLocks) {\n if (\n await access(join(root, file!))\n .then(() => true)\n .catch(() => false)\n ) {\n detected = manager;\n break;\n }\n }\n }\n const manager = options.manager ?? detected ?? \"npm\";\n invariant(supportedManagers.includes(manager), \"Unknown package manager\");\n\n return { extension, manager };\n}\n"]}
1
+ {"version":3,"file":"project-settings.js","sourceRoot":"","sources":["../../src/cli/project-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO1E,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAY,EACZ,OAAoB;IAEpB,IAAI,GAAG,GAAoB,EAAE,CAAC;IAC9B,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,C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,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;KAClD,CAAC;AACJ,CAAC","sourcesContent":["import { access, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { invariant } from \"../domain/errors.ts\";\nimport { managerLocks, supportedManagers } from \"./scaffold.constants.ts\";\nimport type {\n InitOptions,\n PackageManifest,\n ProjectSettings,\n} from \"./scaffold.types.ts\";\n\nexport async function projectSettings(\n root: string,\n options: InitOptions,\n): Promise<ProjectSettings> {\n let pkg: PackageManifest = {};\n let hasPackage = true;\n try {\n pkg = JSON.parse(await readFile(join(root, \"package.json\"), \"utf8\"));\n if (!pkg || typeof pkg !== \"object\") pkg = {};\n } catch (cause) {\n if ((cause as NodeJS.ErrnoException).code === \"ENOENT\") hasPackage = false;\n if (\n !(cause instanceof SyntaxError) &&\n (cause as NodeJS.ErrnoException).code !== \"ENOENT\"\n )\n throw cause;\n }\n let detected =\n typeof pkg.packageManager === \"string\"\n ? pkg.packageManager.split(\"@\")[0]\n : undefined;\n if (!detected || !supportedManagers.includes(detected)) {\n detected = undefined;\n for (const [file, manager] of managerLocks) {\n if (\n await access(join(root, file!))\n .then(() => true)\n .catch(() => false)\n ) {\n detected = manager;\n break;\n }\n }\n }\n const manager = options.manager ?? detected ?? \"npm\";\n invariant(supportedManagers.includes(manager), \"Unknown package manager\");\n\n return {\n hasPackage,\n manager,\n extension: pkg.type === \"commonjs\" ? \"mts\" : \"ts\",\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { CliInvocation } from "./main.types.ts";
2
+ export declare function recoveryCommand({ values, positionals, }: CliInvocation): Promise<void>;
@@ -0,0 +1,69 @@
1
+ import { recoveryPruneCommand } from "./recovery-prune-command.js";
2
+ import { recoveryVerifyCommand } from "./recovery-verify-command.js";
3
+ import { inspectRecovery } from "../application/recovery-inspection.js";
4
+ import { invariant, positive } from "../domain/errors.js";
5
+ export async function recoveryCommand({ values, positionals, }) {
6
+ if (positionals[1] === "prune")
7
+ return recoveryPruneCommand({ values, positionals });
8
+ if (positionals[1] === "verify")
9
+ return recoveryVerifyCommand({ values, positionals });
10
+ invariant(positionals.length === 2 && positionals[1] === "inspect", "Usage: outpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--json]");
11
+ for (const key of Object.keys(values))
12
+ invariant(["repository", "max-entries", "git", "locks", "json"].includes(key), `Unsupported recovery option: --${key}`);
13
+ const maxEntries = values["max-entries"] === undefined
14
+ ? undefined
15
+ : positive(Number(values["max-entries"]), "max-entries");
16
+ const report = await inspectRecovery({
17
+ ...(values.repository !== undefined
18
+ ? { repository: values.repository }
19
+ : {}),
20
+ ...(maxEntries !== undefined ? { maxEntries } : {}),
21
+ ...(values.git ? { git: true } : {}),
22
+ ...(values.locks ? { locks: true } : {}),
23
+ });
24
+ if (values.json)
25
+ process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
26
+ else {
27
+ process.stdout.write(`Outpost recovery inspection — ${JSON.stringify(report.repository)}\n`);
28
+ for (const category of report.categories) {
29
+ process.stdout.write(`${category.name}: ${category.entries.length} listed entries\n`);
30
+ for (const entry of category.entries)
31
+ process.stdout.write(` ${JSON.stringify(entry.name)} | ${entry.kind} | ${entry.bytes} bytes | ${entry.files} files | ${entry.symlinks} symlinks | ${entry.modifiedAt ?? "unknown time"} | ${entry.complete ? "complete" : "partial"}\n`);
32
+ }
33
+ if (report.git) {
34
+ process.stdout.write(`Workspace Git inspection: ${report.git.complete ? "complete for listed entries" : "partial"}\n`);
35
+ for (const workspace of report.git.workspaces) {
36
+ const detail = workspace.state === "registered"
37
+ ? `${workspace.branch === null ? "detached HEAD" : JSON.stringify(workspace.branch)} | ${workspace.dirty ? "dirty" : "clean"} | ${workspace.head}${workspace.locked ? " | Git locked" : ""}`
38
+ : workspace.state;
39
+ process.stdout.write(` ${JSON.stringify(workspace.name)} | ${detail}\n`);
40
+ }
41
+ for (const issue of report.git.issues)
42
+ process.stdout.write(`[PARTIAL] ${issue.code}: ${JSON.stringify(issue.path)}\n`);
43
+ process.stdout.write("Git status excludes ignored files. Clean does not mean safe to delete.\n");
44
+ }
45
+ if (report.locks) {
46
+ process.stdout.write(`Lock PID inspection (local host): ${report.locks.complete ? "complete for listed entries" : "partial"}\n`);
47
+ for (const lock of report.locks.entries) {
48
+ const pid = "pid" in lock ? ` | PID ${lock.pid}` : "";
49
+ const reason = "reason" in lock ? ` | ${lock.reason}` : "";
50
+ process.stdout.write(` ${JSON.stringify(lock.name)} | ${lock.state}${pid}${reason}${lock.ownership ? ` | ownership ${lock.ownership.status}: ${lock.ownership.reason}` : ""}\n`);
51
+ }
52
+ for (const issue of report.locks.issues)
53
+ process.stdout.write(`[PARTIAL] ${issue.code}: ${JSON.stringify(issue.path)}\n`);
54
+ process.stdout.write("PID presence does not prove lock ownership; PID absence does not authorize deletion.\n");
55
+ }
56
+ for (const issue of report.issues)
57
+ process.stdout.write(`[PARTIAL] ${issue.code}: ${JSON.stringify(issue.path)}\n`);
58
+ process.stdout.write(`Total observed: ${report.usage.bytes} bytes in ${report.usage.files} files; ${report.scannedEntries}/${report.maxEntries} entries scanned.\n`);
59
+ process.stdout.write(`${report.complete ? "Inventory complete." : "Inventory incomplete; totals are partial."} File sizes are logical bytes; symlink targets are excluded.\n`);
60
+ process.stdout.write(report.git || report.locks
61
+ ? "Activity and recovery integrity are unverified. No raw file contents were displayed or files removed.\n"
62
+ : "Activity and recovery integrity are unverified. No files were read for content or removed.\n");
63
+ }
64
+ if (!report.complete ||
65
+ report.git?.complete === false ||
66
+ report.locks?.complete === false)
67
+ process.exitCode = 1;
68
+ }
69
+ //# sourceMappingURL=recovery-command.js.map