@elie-laloum/outpost 3.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -3
  3. package/SECURITY.md +3 -1
  4. package/dist/adapters/agents/codex-adapter.js +2 -0
  5. package/dist/adapters/agents/codex-adapter.js.map +1 -1
  6. package/dist/adapters/agents/codex-provider.d.ts +2 -0
  7. package/dist/adapters/agents/codex-provider.js +32 -0
  8. package/dist/adapters/agents/codex-provider.js.map +1 -0
  9. package/dist/adapters/agents/codex-request.js +2 -1
  10. package/dist/adapters/agents/codex-request.js.map +1 -1
  11. package/dist/adapters/agents/gemini-adapter.d.ts +3 -0
  12. package/dist/adapters/agents/gemini-adapter.js +15 -0
  13. package/dist/adapters/agents/gemini-adapter.js.map +1 -0
  14. package/dist/adapters/agents/gemini-diagnostics.d.ts +2 -0
  15. package/dist/adapters/agents/gemini-diagnostics.js +15 -0
  16. package/dist/adapters/agents/gemini-diagnostics.js.map +1 -0
  17. package/dist/adapters/agents/gemini-events.d.ts +2 -0
  18. package/dist/adapters/agents/gemini-events.js +50 -0
  19. package/dist/adapters/agents/gemini-events.js.map +1 -0
  20. package/dist/adapters/agents/gemini-request.d.ts +4 -0
  21. package/dist/adapters/agents/gemini-request.js +23 -0
  22. package/dist/adapters/agents/gemini-request.js.map +1 -0
  23. package/dist/adapters/agents/gemini.types.d.ts +6 -0
  24. package/dist/adapters/agents/gemini.types.js +2 -0
  25. package/dist/adapters/agents/gemini.types.js.map +1 -0
  26. package/dist/adapters/agents/protocol-fixtures.constants.d.ts +1 -1
  27. package/dist/adapters/agents/protocol-fixtures.constants.js +37 -0
  28. package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -1
  29. package/dist/adapters/agents/settings.types.d.ts +5 -0
  30. package/dist/adapters/agents/settings.types.js.map +1 -1
  31. package/dist/application/agent-bootstrap.constants.d.ts +1 -0
  32. package/dist/application/agent-bootstrap.constants.js +1 -0
  33. package/dist/application/agent-bootstrap.constants.js.map +1 -1
  34. package/dist/application/agent-bootstrap.js +6 -2
  35. package/dist/application/agent-bootstrap.js.map +1 -1
  36. package/dist/application/agent-output.js +9 -2
  37. package/dist/application/agent-output.js.map +1 -1
  38. package/dist/application/artifact-tasks.d.ts +5 -0
  39. package/dist/application/artifact-tasks.js +31 -0
  40. package/dist/application/artifact-tasks.js.map +1 -0
  41. package/dist/application/artifact-tasks.types.d.ts +8 -0
  42. package/dist/application/artifact-tasks.types.js +2 -0
  43. package/dist/application/artifact-tasks.types.js.map +1 -0
  44. package/dist/application/dispatch-validation.js +2 -0
  45. package/dist/application/dispatch-validation.js.map +1 -1
  46. package/dist/application/doctor-agent.constants.d.ts +2 -0
  47. package/dist/application/doctor-agent.constants.js +2 -0
  48. package/dist/application/doctor-agent.constants.js.map +1 -1
  49. package/dist/application/doctor-agent.js +1 -1
  50. package/dist/application/doctor-agent.js.map +1 -1
  51. package/dist/application/doctor-protocol.js +2 -1
  52. package/dist/application/doctor-protocol.js.map +1 -1
  53. package/dist/application/doctor.constants.js +1 -1
  54. package/dist/application/doctor.constants.js.map +1 -1
  55. package/dist/application/doctor.types.d.ts +1 -1
  56. package/dist/application/doctor.types.js.map +1 -1
  57. package/dist/application/outpost.types.d.ts +2 -0
  58. package/dist/application/outpost.types.js.map +1 -1
  59. package/dist/application/queue-worker.d.ts +2 -0
  60. package/dist/application/queue-worker.js +75 -0
  61. package/dist/application/queue-worker.js.map +1 -0
  62. package/dist/application/queue-worker.types.d.ts +15 -0
  63. package/dist/application/queue-worker.types.js +2 -0
  64. package/dist/application/queue-worker.types.js.map +1 -0
  65. package/dist/application/queued-task.d.ts +3 -0
  66. package/dist/application/queued-task.js +56 -0
  67. package/dist/application/queued-task.js.map +1 -0
  68. package/dist/application/queued-task.types.d.ts +11 -0
  69. package/dist/application/queued-task.types.js +2 -0
  70. package/dist/application/queued-task.types.js.map +1 -0
  71. package/dist/application/recovery-inspection.js +5 -0
  72. package/dist/application/recovery-inspection.js.map +1 -1
  73. package/dist/application/recovery-inspection.types.d.ts +3 -0
  74. package/dist/application/recovery-inspection.types.js.map +1 -1
  75. package/dist/application/recovery-restore-snapshot.d.ts +2 -0
  76. package/dist/application/recovery-restore-snapshot.js +57 -0
  77. package/dist/application/recovery-restore-snapshot.js.map +1 -0
  78. package/dist/application/recovery-restore.d.ts +3 -0
  79. package/dist/application/recovery-restore.js +161 -0
  80. package/dist/application/recovery-restore.js.map +1 -0
  81. package/dist/application/recovery-restore.types.d.ts +28 -0
  82. package/dist/application/recovery-restore.types.js +2 -0
  83. package/dist/application/recovery-restore.types.js.map +1 -0
  84. package/dist/application/recovery-retention.js +5 -0
  85. package/dist/application/recovery-retention.js.map +1 -1
  86. package/dist/application/recovery-verification.d.ts +2 -1
  87. package/dist/application/recovery-verification.js +1 -1
  88. package/dist/application/recovery-verification.js.map +1 -1
  89. package/dist/application/remote-apply.js +6 -0
  90. package/dist/application/remote-apply.js.map +1 -1
  91. package/dist/application/remote-download.js +2 -2
  92. package/dist/application/remote-download.js.map +1 -1
  93. package/dist/application/remote-history.d.ts +6 -0
  94. package/dist/application/remote-history.js +114 -0
  95. package/dist/application/remote-history.js.map +1 -0
  96. package/dist/application/remote-upload.d.ts +2 -0
  97. package/dist/application/remote-upload.js +17 -0
  98. package/dist/application/remote-upload.js.map +1 -0
  99. package/dist/application/remote-validation.js +20 -28
  100. package/dist/application/remote-validation.js.map +1 -1
  101. package/dist/application/remote-workspace.js +4 -10
  102. package/dist/application/remote-workspace.js.map +1 -1
  103. package/dist/application/sandbox-activity.d.ts +3 -0
  104. package/dist/application/sandbox-activity.js +25 -0
  105. package/dist/application/sandbox-activity.js.map +1 -0
  106. package/dist/application/sandbox-provision.js +55 -10
  107. package/dist/application/sandbox-provision.js.map +1 -1
  108. package/dist/application/sandbox-session.types.d.ts +2 -0
  109. package/dist/application/sandbox-session.types.js.map +1 -1
  110. package/dist/application/sandbox.js +23 -11
  111. package/dist/application/sandbox.js.map +1 -1
  112. package/dist/application/speculation-host.d.ts +2 -0
  113. package/dist/application/speculation-host.js +30 -0
  114. package/dist/application/speculation-host.js.map +1 -0
  115. package/dist/application/speculation.constants.d.ts +4 -0
  116. package/dist/application/speculation.constants.js +2 -0
  117. package/dist/application/speculation.constants.js.map +1 -0
  118. package/dist/application/speculation.d.ts +2 -0
  119. package/dist/application/speculation.js +166 -0
  120. package/dist/application/speculation.js.map +1 -0
  121. package/dist/application/speculation.types.d.ts +56 -0
  122. package/dist/application/speculation.types.js +2 -0
  123. package/dist/application/speculation.types.js.map +1 -0
  124. package/dist/application/storage-reservation.d.ts +3 -0
  125. package/dist/application/storage-reservation.js +10 -0
  126. package/dist/application/storage-reservation.js.map +1 -0
  127. package/dist/application/storage-reservation.types.d.ts +4 -0
  128. package/dist/application/storage-reservation.types.js +2 -0
  129. package/dist/application/storage-reservation.types.js.map +1 -0
  130. package/dist/application/task-usage.d.ts +1 -1
  131. package/dist/application/task-usage.js.map +1 -1
  132. package/dist/application/tasks.js +1 -1
  133. package/dist/application/tasks.js.map +1 -1
  134. package/dist/application/tasks.types.d.ts +4 -3
  135. package/dist/application/tasks.types.js.map +1 -1
  136. package/dist/application/workspace-allocation.d.ts +3 -0
  137. package/dist/application/workspace-allocation.js +34 -0
  138. package/dist/application/workspace-allocation.js.map +1 -0
  139. package/dist/application/workspace.js +2 -2
  140. package/dist/application/workspace.js.map +1 -1
  141. package/dist/cli/commands.js +55 -18
  142. package/dist/cli/commands.js.map +1 -1
  143. package/dist/cli/doctor-command.js +1 -1
  144. package/dist/cli/doctor-command.js.map +1 -1
  145. package/dist/cli/init-authentication.constants.d.ts +13 -0
  146. package/dist/cli/init-authentication.constants.js +10 -0
  147. package/dist/cli/init-authentication.constants.js.map +1 -0
  148. package/dist/cli/init-authentication.d.ts +4 -0
  149. package/dist/cli/init-authentication.js +43 -0
  150. package/dist/cli/init-authentication.js.map +1 -0
  151. package/dist/cli/init-command.js +74 -15
  152. package/dist/cli/init-command.js.map +1 -1
  153. package/dist/cli/main.constants.d.ts +111 -2
  154. package/dist/cli/main.constants.js +148 -42
  155. package/dist/cli/main.constants.js.map +1 -1
  156. package/dist/cli/recovery-command.js +28 -4
  157. package/dist/cli/recovery-command.js.map +1 -1
  158. package/dist/cli/recovery-restore-command.d.ts +2 -0
  159. package/dist/cli/recovery-restore-command.js +34 -0
  160. package/dist/cli/recovery-restore-command.js.map +1 -0
  161. package/dist/cli/scaffold-files.js +3 -2
  162. package/dist/cli/scaffold-files.js.map +1 -1
  163. package/dist/cli/scaffold-validation.js +20 -1
  164. package/dist/cli/scaffold-validation.js.map +1 -1
  165. package/dist/cli/scaffold.constants.js +2 -2
  166. package/dist/cli/scaffold.constants.js.map +1 -1
  167. package/dist/cli/scaffold.js +13 -0
  168. package/dist/cli/scaffold.js.map +1 -1
  169. package/dist/cli/scaffold.types.d.ts +4 -1
  170. package/dist/cli/scaffold.types.js.map +1 -1
  171. package/dist/cli/starters.js +9 -2
  172. package/dist/cli/starters.js.map +1 -1
  173. package/dist/domain/agent.types.d.ts +2 -0
  174. package/dist/domain/agent.types.js.map +1 -1
  175. package/dist/domain/artifact-reference.d.ts +4 -0
  176. package/dist/domain/artifact-reference.js +90 -0
  177. package/dist/domain/artifact-reference.js.map +1 -0
  178. package/dist/domain/artifact.constants.d.ts +2 -0
  179. package/dist/domain/artifact.constants.js +3 -0
  180. package/dist/domain/artifact.constants.js.map +1 -0
  181. package/dist/domain/artifact.d.ts +7 -0
  182. package/dist/domain/artifact.js +104 -0
  183. package/dist/domain/artifact.js.map +1 -0
  184. package/dist/domain/artifact.types.d.ts +44 -0
  185. package/dist/domain/artifact.types.js +2 -0
  186. package/dist/domain/artifact.types.js.map +1 -0
  187. package/dist/domain/egress.constants.d.ts +1 -0
  188. package/dist/domain/egress.constants.js +7 -0
  189. package/dist/domain/egress.constants.js.map +1 -0
  190. package/dist/domain/egress.d.ts +2 -0
  191. package/dist/domain/egress.js +48 -0
  192. package/dist/domain/egress.js.map +1 -0
  193. package/dist/domain/egress.types.d.ts +8 -0
  194. package/dist/domain/egress.types.js +2 -0
  195. package/dist/domain/egress.types.js.map +1 -0
  196. package/dist/domain/sandbox.types.d.ts +1 -0
  197. package/dist/domain/sandbox.types.js.map +1 -1
  198. package/dist/domain/task-queue.constants.d.ts +8 -0
  199. package/dist/domain/task-queue.constants.js +9 -0
  200. package/dist/domain/task-queue.constants.js.map +1 -0
  201. package/dist/domain/task-queue.d.ts +11 -0
  202. package/dist/domain/task-queue.js +105 -0
  203. package/dist/domain/task-queue.js.map +1 -0
  204. package/dist/domain/task-queue.types.d.ts +41 -0
  205. package/dist/domain/task-queue.types.js +2 -0
  206. package/dist/domain/task-queue.types.js.map +1 -0
  207. package/dist/domain/workflow/budget.d.ts +2 -2
  208. package/dist/domain/workflow/budget.js +5 -3
  209. package/dist/domain/workflow/budget.js.map +1 -1
  210. package/dist/domain/workflow/checkpoint-validation.d.ts +3 -0
  211. package/dist/domain/workflow/checkpoint-validation.js +81 -0
  212. package/dist/domain/workflow/checkpoint-validation.js.map +1 -0
  213. package/dist/domain/workflow/checkpoint-value.d.ts +2 -0
  214. package/dist/domain/workflow/checkpoint-value.js +49 -0
  215. package/dist/domain/workflow/checkpoint-value.js.map +1 -0
  216. package/dist/domain/workflow/checkpoint.d.ts +3 -0
  217. package/dist/domain/workflow/checkpoint.js +70 -0
  218. package/dist/domain/workflow/checkpoint.js.map +1 -0
  219. package/dist/domain/workflow/checkpoint.types.d.ts +40 -0
  220. package/dist/domain/workflow/checkpoint.types.js +2 -0
  221. package/dist/domain/workflow/checkpoint.types.js.map +1 -0
  222. package/dist/domain/workflow/gate-validation.d.ts +4 -0
  223. package/dist/domain/workflow/gate-validation.js +71 -0
  224. package/dist/domain/workflow/gate-validation.js.map +1 -0
  225. package/dist/domain/workflow/gates.constants.d.ts +4 -0
  226. package/dist/domain/workflow/gates.constants.js +5 -0
  227. package/dist/domain/workflow/gates.constants.js.map +1 -0
  228. package/dist/domain/workflow/gates.d.ts +7 -0
  229. package/dist/domain/workflow/gates.js +85 -0
  230. package/dist/domain/workflow/gates.js.map +1 -0
  231. package/dist/domain/workflow/gates.types.d.ts +27 -0
  232. package/dist/domain/workflow/gates.types.js +2 -0
  233. package/dist/domain/workflow/gates.types.js.map +1 -0
  234. package/dist/domain/workflow/task-runner.js +14 -2
  235. package/dist/domain/workflow/task-runner.js.map +1 -1
  236. package/dist/domain/workflow/usage-receipt.constants.d.ts +2 -0
  237. package/dist/domain/workflow/usage-receipt.constants.js +3 -0
  238. package/dist/domain/workflow/usage-receipt.constants.js.map +1 -0
  239. package/dist/domain/workflow/usage-receipt.d.ts +2 -0
  240. package/dist/domain/workflow/usage-receipt.js +18 -0
  241. package/dist/domain/workflow/usage-receipt.js.map +1 -0
  242. package/dist/domain/workflow/validation.js +6 -0
  243. package/dist/domain/workflow/validation.js.map +1 -1
  244. package/dist/domain/workflow/workflow-scheduler.js +65 -32
  245. package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
  246. package/dist/domain/workflow/workflow-state.d.ts +2 -1
  247. package/dist/domain/workflow/workflow-state.js +91 -16
  248. package/dist/domain/workflow/workflow-state.js.map +1 -1
  249. package/dist/domain/workflow.types.d.ts +13 -2
  250. package/dist/domain/workflow.types.js.map +1 -1
  251. package/dist/index.d.ts +32 -2
  252. package/dist/index.js +14 -1
  253. package/dist/index.js.map +1 -1
  254. package/dist/infrastructure/artifact-store.constants.d.ts +1 -0
  255. package/dist/infrastructure/artifact-store.constants.js +2 -0
  256. package/dist/infrastructure/artifact-store.constants.js.map +1 -0
  257. package/dist/infrastructure/artifact-store.d.ts +3 -0
  258. package/dist/infrastructure/artifact-store.js +100 -0
  259. package/dist/infrastructure/artifact-store.js.map +1 -0
  260. package/dist/infrastructure/artifact-store.types.d.ts +4 -0
  261. package/dist/infrastructure/artifact-store.types.js +2 -0
  262. package/dist/infrastructure/artifact-store.types.js.map +1 -0
  263. package/dist/infrastructure/file-manifest.d.ts +1 -1
  264. package/dist/infrastructure/file-manifest.js +3 -2
  265. package/dist/infrastructure/file-manifest.js.map +1 -1
  266. package/dist/infrastructure/git/verification-command.d.ts +1 -1
  267. package/dist/infrastructure/git/verification-command.js +3 -2
  268. package/dist/infrastructure/git/verification-command.js.map +1 -1
  269. package/dist/infrastructure/opentelemetry.js +1 -1
  270. package/dist/infrastructure/opentelemetry.js.map +1 -1
  271. package/dist/infrastructure/resource-activity-inspection.d.ts +2 -0
  272. package/dist/infrastructure/resource-activity-inspection.js +152 -0
  273. package/dist/infrastructure/resource-activity-inspection.js.map +1 -0
  274. package/dist/infrastructure/resource-activity.constants.d.ts +8 -0
  275. package/dist/infrastructure/resource-activity.constants.js +26 -0
  276. package/dist/infrastructure/resource-activity.constants.js.map +1 -0
  277. package/dist/infrastructure/resource-activity.d.ts +2 -0
  278. package/dist/infrastructure/resource-activity.js +166 -0
  279. package/dist/infrastructure/resource-activity.js.map +1 -0
  280. package/dist/infrastructure/resource-activity.types.d.ts +53 -0
  281. package/dist/infrastructure/resource-activity.types.js +2 -0
  282. package/dist/infrastructure/resource-activity.types.js.map +1 -0
  283. package/dist/infrastructure/storage-mutation-lock.constants.d.ts +5 -0
  284. package/dist/infrastructure/storage-mutation-lock.constants.js +6 -0
  285. package/dist/infrastructure/storage-mutation-lock.constants.js.map +1 -0
  286. package/dist/infrastructure/storage-mutation-lock.d.ts +1 -0
  287. package/dist/infrastructure/storage-mutation-lock.js +21 -0
  288. package/dist/infrastructure/storage-mutation-lock.js.map +1 -0
  289. package/dist/infrastructure/storage-reservations.constants.d.ts +4 -0
  290. package/dist/infrastructure/storage-reservations.constants.js +5 -0
  291. package/dist/infrastructure/storage-reservations.constants.js.map +1 -0
  292. package/dist/infrastructure/storage-reservations.d.ts +2 -0
  293. package/dist/infrastructure/storage-reservations.js +150 -0
  294. package/dist/infrastructure/storage-reservations.js.map +1 -0
  295. package/dist/infrastructure/storage-reservations.types.d.ts +21 -0
  296. package/dist/infrastructure/storage-reservations.types.js +2 -0
  297. package/dist/infrastructure/storage-reservations.types.js.map +1 -0
  298. package/dist/infrastructure/task-queue-http.constants.d.ts +2 -0
  299. package/dist/infrastructure/task-queue-http.constants.js +3 -0
  300. package/dist/infrastructure/task-queue-http.constants.js.map +1 -0
  301. package/dist/infrastructure/task-queue-http.d.ts +4 -0
  302. package/dist/infrastructure/task-queue-http.js +158 -0
  303. package/dist/infrastructure/task-queue-http.js.map +1 -0
  304. package/dist/infrastructure/task-queue-http.types.d.ts +16 -0
  305. package/dist/infrastructure/task-queue-http.types.js +2 -0
  306. package/dist/infrastructure/task-queue-http.types.js.map +1 -0
  307. package/dist/infrastructure/task-queue.d.ts +2 -0
  308. package/dist/infrastructure/task-queue.js +134 -0
  309. package/dist/infrastructure/task-queue.js.map +1 -0
  310. package/dist/infrastructure/transfer.js +5 -0
  311. package/dist/infrastructure/transfer.js.map +1 -1
  312. package/dist/infrastructure/workflow-checkpoint.constants.d.ts +1 -0
  313. package/dist/infrastructure/workflow-checkpoint.constants.js +2 -0
  314. package/dist/infrastructure/workflow-checkpoint.constants.js.map +1 -0
  315. package/dist/infrastructure/workflow-checkpoint.d.ts +3 -0
  316. package/dist/infrastructure/workflow-checkpoint.js +77 -0
  317. package/dist/infrastructure/workflow-checkpoint.js.map +1 -0
  318. package/dist/infrastructure/workflow-checkpoint.types.d.ts +4 -0
  319. package/dist/infrastructure/workflow-checkpoint.types.js +2 -0
  320. package/dist/infrastructure/workflow-checkpoint.types.js.map +1 -0
  321. package/dist/providers/agents.d.ts +3 -1
  322. package/dist/providers/agents.js +1 -0
  323. package/dist/providers/agents.js.map +1 -1
  324. package/dist/providers/container-isolation.d.ts +2 -0
  325. package/dist/providers/container-isolation.js +29 -0
  326. package/dist/providers/container-isolation.js.map +1 -0
  327. package/dist/providers/container-mounts.js +7 -2
  328. package/dist/providers/container-mounts.js.map +1 -1
  329. package/dist/providers/container-network.d.ts +2 -0
  330. package/dist/providers/container-network.js +14 -0
  331. package/dist/providers/container-network.js.map +1 -0
  332. package/dist/providers/container-plan.js +4 -2
  333. package/dist/providers/container-plan.js.map +1 -1
  334. package/dist/providers/container.constants.d.ts +1 -0
  335. package/dist/providers/container.constants.js +1 -0
  336. package/dist/providers/container.constants.js.map +1 -1
  337. package/dist/providers/container.js +19 -2
  338. package/dist/providers/container.js.map +1 -1
  339. package/dist/providers/container.types.d.ts +3 -0
  340. package/dist/providers/container.types.js.map +1 -1
  341. package/dist/providers/daytona-command.constants.d.ts +2 -0
  342. package/dist/providers/daytona-command.constants.js +13 -0
  343. package/dist/providers/daytona-command.constants.js.map +1 -0
  344. package/dist/providers/daytona-command.js +12 -5
  345. package/dist/providers/daytona-command.js.map +1 -1
  346. package/dist/providers/daytona-output.d.ts +4 -0
  347. package/dist/providers/daytona-output.js +37 -0
  348. package/dist/providers/daytona-output.js.map +1 -0
  349. package/dist/providers/daytona-terminal.d.ts +3 -0
  350. package/dist/providers/daytona-terminal.js +130 -0
  351. package/dist/providers/daytona-terminal.js.map +1 -0
  352. package/dist/providers/daytona.js +2 -0
  353. package/dist/providers/daytona.js.map +1 -1
  354. package/dist/providers/docker.d.ts +1 -0
  355. package/dist/providers/docker.js.map +1 -1
  356. package/dist/providers/file-batches.d.ts +1 -1
  357. package/dist/providers/file-batches.js +9 -0
  358. package/dist/providers/file-batches.js.map +1 -1
  359. package/dist/providers/file-upload.constants.d.ts +1 -0
  360. package/dist/providers/file-upload.constants.js +68 -0
  361. package/dist/providers/file-upload.constants.js.map +1 -0
  362. package/dist/providers/file-upload.d.ts +2 -0
  363. package/dist/providers/file-upload.js +146 -0
  364. package/dist/providers/file-upload.js.map +1 -0
  365. package/dist/providers/firecracker-command.d.ts +5 -0
  366. package/dist/providers/firecracker-command.js +114 -0
  367. package/dist/providers/firecracker-command.js.map +1 -0
  368. package/dist/providers/firecracker-files.constants.d.ts +1 -0
  369. package/dist/providers/firecracker-files.constants.js +21 -0
  370. package/dist/providers/firecracker-files.constants.js.map +1 -0
  371. package/dist/providers/firecracker-files.d.ts +3 -0
  372. package/dist/providers/firecracker-files.js +110 -0
  373. package/dist/providers/firecracker-files.js.map +1 -0
  374. package/dist/providers/firecracker-machine.d.ts +3 -0
  375. package/dist/providers/firecracker-machine.js +155 -0
  376. package/dist/providers/firecracker-machine.js.map +1 -0
  377. package/dist/providers/firecracker.constants.d.ts +10 -0
  378. package/dist/providers/firecracker.constants.js +11 -0
  379. package/dist/providers/firecracker.constants.js.map +1 -0
  380. package/dist/providers/firecracker.d.ts +4 -0
  381. package/dist/providers/firecracker.js +103 -0
  382. package/dist/providers/firecracker.js.map +1 -0
  383. package/dist/providers/firecracker.types.d.ts +36 -0
  384. package/dist/providers/firecracker.types.js +2 -0
  385. package/dist/providers/firecracker.types.js.map +1 -0
  386. package/dist/providers/local.js +2 -1
  387. package/dist/providers/local.js.map +1 -1
  388. package/dist/providers/podman.d.ts +1 -0
  389. package/dist/providers/podman.js.map +1 -1
  390. package/dist/providers/terminal-bridge.d.ts +14 -0
  391. package/dist/providers/terminal-bridge.js +100 -0
  392. package/dist/providers/terminal-bridge.js.map +1 -0
  393. package/dist/providers/vercel-command.js +2 -2
  394. package/dist/providers/vercel-command.js.map +1 -1
  395. package/dist/providers/vercel-directory.d.ts +2 -0
  396. package/dist/providers/vercel-directory.js +7 -0
  397. package/dist/providers/vercel-directory.js.map +1 -0
  398. package/dist/providers/vercel-files.js +3 -2
  399. package/dist/providers/vercel-files.js.map +1 -1
  400. package/dist/providers/vercel-network.d.ts +2 -0
  401. package/dist/providers/vercel-network.js +18 -0
  402. package/dist/providers/vercel-network.js.map +1 -0
  403. package/dist/providers/vercel.d.ts +1 -0
  404. package/dist/providers/vercel.js +5 -1
  405. package/dist/providers/vercel.js.map +1 -1
  406. package/dist/providers/vercel.types.d.ts +2 -0
  407. package/dist/providers/vercel.types.js.map +1 -1
  408. package/dist/providers/versions.constants.d.ts +1 -0
  409. package/dist/providers/versions.constants.js +1 -0
  410. package/dist/providers/versions.constants.js.map +1 -1
  411. package/package.json +10 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.1.0
4
+
5
+ - Replace global CLI parsing and manual help with Commander subcommands and command-specific options; use Clack selection prompts for interactive initialization. Previously ignored options belonging to other commands are now rejected. Headless and JSON output remain plain.
6
+ - Guide initialization through package manager and authentication choices. Check a requested package manager before writing files when `--install` is used. Build Docker/Podman images automatically; use `--no-build` to generate files without building. Existing generated workflows are unchanged.
7
+ - Generate explicit API-key, Claude subscription-token and Codex account-login setup. Validate required model credentials before allocation; prepare Codex API login through stdin, or copy an explicitly selected account credential seed into the private sandbox home. Host keychains are not exported.
8
+ - Add `CodexModelProvider` with a custom Responses API URL and API-key environment variable; expose `--base-url`, `--api-key-env` and `--model` in initialization. Chat Completions-only endpoints are not supported. Verify the native Codex connection against a local simulated Responses endpoint in container CI.
9
+ - Preserve Vercel allocation variables on every command, with command-level overrides. Regress generated Claude token forwarding and document that switching providers must preserve explicit model variables.
10
+ - Add manually enabled authenticated Claude/Codex cloud campaigns with sanitized reports. Missing credentials remain skipped; adding this fixture does not establish a successful live account campaign. Scheduled runs do not make model calls.
11
+ - Preserve Daytona’s session shell and real exit status for non-interactive commands; accept an already removed PTY during cancellation cleanup. Regress both defects found by live testing. Validate Claude OAuth workflows on Docker, Vercel and Daytona, plus Daytona terminal input, resize, exit, cancellation and reuse.
12
+ - Preserve exact Daytona command output through encoded streaming, fixing synchronization of Git paths delimited by NUL bytes. Verify unterminated output, Unicode, exit status, cancellation and warm reuse.
13
+ - Make unattended Gemini `yolo` requests trust the selected workspace with `--skip-trust`; preserve other approval modes and document the trust boundary. Clarify generated Codex subscription login for local and cloud providers.
14
+ - Validate authenticated file-editing workflows with Codex subscription login and Gemini API keys on Docker, Vercel and Daytona, a custom Responses endpoint on Docker and Vercel, and OpenRouter Responses on Daytona. The same unmodified adapter completes the OpenRouter model/tool/synchronization workflow; the other custom endpoint still resets HTTPS connections from Daytona before authentication. Codex API-key authentication was not exercised in this campaign.
15
+ - Refocus the bilingual roadmap on near-term reliability and medium-term directions with explicit validation criteria.
16
+
17
+ ## 4.0.0
18
+
19
+ This major release extends public workflow status unions. Exhaustive consumers must handle task statuses `paused` and `rejected`, and workflow result status `paused`. Research features remain explicitly opt-in with their documented limitations.
20
+
21
+ - Allocate isolated container workspaces under a writable private parent for rootless Podman, and publish file artifacts without recreating Windows drive roots. Document manual checkpoint lock recovery when process ownership cannot be verified.
22
+ - Create missing Vercel workspace and transfer parent directories recursively before writing files.
23
+
24
+ - Add cooperative storage reservations with workspace ownership, isolated restoration of retained previous/incoming transfer state, and local sandbox/resource activity inspection.
25
+ - Batch and verify incremental file/symlink uploads; transfer verified Git history deltas while retaining complete recovery bundles. Directory copies keep their existing transfer behavior.
26
+ - Persist workflow checkpoints with JSON outputs, explicit replay and cumulative usage. Add approval/pause gates and typed immutable artifacts with unsigned lineage.
27
+ - Add SQLite durable task queues, authenticated HTTP transport and fenced workers. Replays can repeat side effects; terminal usage receipts prevent double accounting without guaranteeing real-time billing caps.
28
+ - Extend task statuses with `paused` and `rejected`, and workflow result status with `paused`; exhaustive status consumers must handle these values. Add optional checkpoint flushing and usage-receipt methods to task contexts.
29
+ - Support Daytona native PTY attachment with cancellation, resize and reuse; live account validation remains outstanding.
30
+ - Add the Gemini CLI adapter, bootstrap, diagnostics and image installation pinned to 0.61.0. Gemini supports fresh sessions only, without native conversation capture, continuation or automatic response repairs.
31
+ - Add opt-in research prototypes for isolated Docker/Podman Git checkouts, prepared-host Firecracker microVMs, container deny-all/Vercel egress policies, and bounded speculative candidates with explicit validation and no automatic integration.
32
+ - Attribute cloud reports to source commit/runtime/time and retain successful image-attestation verification artifacts. Live cloud campaigns, signed publication and real Firecracker boot remain separately gated validation, not implied successes.
33
+ - Synchronize the complete public API reference, bilingual guides and roadmap with implemented behavior and remaining prototype limits.
34
+
3
35
  ## 3.0.0
4
36
 
5
37
  - Canonicalize temporary recovery verification directories across platforms and reuse existing Podman cache volumes without recreation.
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  [Documentation](https://elie-laloum.github.io/outpost/) · [Français](https://elie-laloum.github.io/outpost/fr/) · [API](https://elie-laloum.github.io/outpost/reference/) · [Changelog](CHANGELOG.md)
4
4
 
5
- Outpost is a TypeScript library for running coding agents in reusable sandboxes, managing their Git workspaces and composing typed workflows. Claude Code and Codex adapters work with Docker, Podman, Vercel, Daytona or explicit host execution.
5
+ Outpost is a TypeScript library for running coding agents in reusable sandboxes, managing their Git workspaces and composing typed workflows. Claude Code, Codex and Gemini CLI adapters work with Docker, Podman, Vercel, Daytona or explicit host execution. Gemini supports fresh sessions only; native conversation capture, resume and fork are available for Claude Code and Codex.
6
+
7
+ Version 4.1.0 improves CLI setup, explicit agent authentication and custom OpenAI Responses providers. Docker/Podman images build automatically during `init`; use `--no-build` to opt out. See the [changelog](CHANGELOG.md#410) for behavior changes and the [roadmap](https://elie-laloum.github.io/outpost/project/roadmap/) for upcoming priorities.
6
8
 
7
9
  ## Get started
8
10
 
@@ -11,7 +13,7 @@ Requires Node.js **24+**, Git, a target repository with a commit, and the creden
11
13
  ```sh
12
14
  mkdir workflow1
13
15
  cd workflow1
14
- npx @elie-laloum/outpost init --yes --repository /path1/repository --install --build
16
+ npx @elie-laloum/outpost init --yes --repository /path1/repository --install
15
17
  ```
16
18
 
17
19
  Copy `.env.example` to `.env` and declare `OPENAI_API_KEY`. An empty declaration inherits the matching process variable. Then run the generated script:
@@ -22,7 +24,7 @@ node run.ts "Add validation, run tests and commit the change"
22
24
 
23
25
  `init` creates `package.json`, `run.ts`, `brief.md`, `.env.example`, `.gitignore` and a container recipe directly in the workflow directory. Existing package manifests are preserved; explicit CommonJS projects get `run.mts` for compatibility. The script resolves its brief, environment and relative repository paths from its own directory. See [multi-repository workflows](https://elie-laloum.github.io/outpost/workflows/sandbox-tasks/) to orchestrate several repositories.
24
26
 
25
- For Codex API-key authentication, add the login hook from [Connect Codex](https://elie-laloum.github.io/outpost/agents/connect-codex/) before dispatching.
27
+ Generated Codex API-key workflows prepare login inside the sandbox. For account login and credential storage, see [Connect Codex](https://elie-laloum.github.io/outpost/agents/connect-codex/) before dispatching.
26
28
 
27
29
  ## Use the library
28
30
 
package/SECURITY.md CHANGED
@@ -2,10 +2,12 @@
2
2
 
3
3
  Outpost runs coding agents that execute arbitrary project commands. Use it with repositories and credentials appropriate for that task.
4
4
 
5
- Docker/Podman expose only the selected checkout, Git metadata and explicit volumes. The Docker socket is not mounted by default. Containers use a chosen UID/GID, dropped capabilities, no-new-privileges and a private home. Extra devices, writable mounts and elevated hooks expand the boundary deliberately.
5
+ By default, Docker/Podman expose the selected checkout, Git metadata and explicit volumes. The Docker socket is not mounted by default. Containers use a chosen UID/GID, dropped capabilities, no-new-privileges and a private home. Extra devices, writable mounts and elevated hooks expand the boundary deliberately.
6
6
 
7
7
  Shared Git metadata is writable by the agent. A mounted sandbox is not an adversarial boundary protecting the host repository or its configuration. Outpost disables host Git hooks for its own Git commands, but a malicious repository can contain other executable configuration or project tooling. Do not run untrusted repositories with valuable host credentials. Host `local()` provides no isolation.
8
8
 
9
+ The opt-in Docker/Podman `repositoryMode: "isolated"` prototype uses a private container checkout and Git directory, without mounting the host checkout or Git metadata. Bundle transfer and validated synchronization import changes into the host workspace; host hooks, configuration and unrelated refs are not copied back. Explicit mounts overlapping canonical host repository/workspace/Git paths or container workspace/control paths are rejected, including read-only mounts. Dependency caches remain separate engine-managed volumes. Trust the container image, engine and host mount configuration: custom devices, external mounts, credentials, network access and shared caches expand the boundary. This is not a certified hostile-agent sandbox or protection against container/kernel escapes, malicious host path replacement during allocation, or dangerous project code later executed on the host.
10
+
9
11
  Remote providers upload repository history and inputs to the selected cloud account. Explicit credentials and environment files are sent to that environment. Review the cloud provider's own storage/network policy. Concurrent host changes stop synchronization; recovery files preserve prior and incoming state when available.
10
12
 
11
13
  Prompt command expansion only recognizes commands present in the original prompt file. Substitution cannot introduce new expansion fragments. Values substituted inside an original shell command still have shell semantics and must be trusted or quoted by the prompt author.
@@ -1,6 +1,8 @@
1
+ import { codexProvider } from "./codex-provider.js";
1
2
  import { codexEvents } from "./codex-events.js";
2
3
  import { codexRequest } from "./codex-request.js";
3
4
  export function codex(settings = {}) {
5
+ codexProvider(settings);
4
6
  return Object.freeze({
5
7
  name: "codex",
6
8
  conversations: "codex",
@@ -1 +1 @@
1
- {"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,UAAU,KAAK,CAAC,WAA0B,EAAE;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,OAAO;QACb,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,QAAQ,CAAC,iBAAiB,IAAI,IAAI;QAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;QACjD,MAAM,EAAE,WAAW;KACG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { AgentAdapter } from \"../../domain/agent.types.ts\";\nimport { codexEvents } from \"./codex-events.ts\";\nimport { codexRequest } from \"./codex-request.ts\";\nimport type { CodexSettings } from \"./settings.types.ts\";\n\nexport function codex(settings: CodexSettings = {}): AgentAdapter {\n return Object.freeze({\n name: \"codex\",\n conversations: \"codex\",\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => codexRequest(settings, input),\n events: codexEvents,\n } satisfies AgentAdapter);\n}\n"]}
1
+ {"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,UAAU,KAAK,CAAC,WAA0B,EAAE;IAChD,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,OAAO;QACb,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,QAAQ,CAAC,iBAAiB,IAAI,IAAI;QAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;QACjD,MAAM,EAAE,WAAW;KACG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { AgentAdapter } from \"../../domain/agent.types.ts\";\nimport { codexProvider } from \"./codex-provider.ts\";\nimport { codexEvents } from \"./codex-events.ts\";\nimport { codexRequest } from \"./codex-request.ts\";\nimport type { CodexSettings } from \"./settings.types.ts\";\n\nexport function codex(settings: CodexSettings = {}): AgentAdapter {\n codexProvider(settings);\n return Object.freeze({\n name: \"codex\",\n conversations: \"codex\",\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => codexRequest(settings, input),\n events: codexEvents,\n } satisfies AgentAdapter);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { CodexSettings } from "./settings.types.ts";
2
+ export declare function codexProvider(settings: CodexSettings): readonly string[];
@@ -0,0 +1,32 @@
1
+ import { invariant } from "../../domain/errors.js";
2
+ export function codexProvider(settings) {
3
+ const provider = settings.modelProvider;
4
+ if (!provider)
5
+ return [];
6
+ invariant(settings.model?.trim(), "A custom model provider requires a model name");
7
+ let url;
8
+ try {
9
+ url = new URL(provider.baseUrl);
10
+ }
11
+ catch {
12
+ throw new Error("Model provider baseUrl must be an absolute HTTP(S) URL");
13
+ }
14
+ invariant(["http:", "https:"].includes(url.protocol) &&
15
+ !url.username &&
16
+ !url.password &&
17
+ !url.search &&
18
+ !url.hash, "Model provider baseUrl must use HTTP(S) without embedded credentials, query or fragment");
19
+ const environment = provider.apiKeyEnvironment ?? "OPENAI_API_KEY";
20
+ invariant(environment === false || /^[A-Za-z_][A-Za-z0-9_]*$/.test(environment), "Invalid model provider API-key environment variable");
21
+ const configuration = [
22
+ 'model_provider="outpost_compatible"',
23
+ 'model_providers.outpost_compatible.name="OpenAI compatible"',
24
+ `model_providers.outpost_compatible.base_url=${JSON.stringify(provider.baseUrl)}`,
25
+ 'model_providers.outpost_compatible.wire_api="responses"',
26
+ "model_providers.outpost_compatible.requires_openai_auth=false",
27
+ ];
28
+ if (environment !== false)
29
+ configuration.push(`model_providers.outpost_compatible.env_key=${JSON.stringify(environment)}`);
30
+ return configuration.flatMap((value) => ["-c", value]);
31
+ }
32
+ //# sourceMappingURL=codex-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-provider.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,MAAM,UAAU,aAAa,CAAC,QAAuB;IACnD,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC;IACxC,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,SAAS,CACP,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,EACtB,+CAA+C,CAChD,CAAC;IACF,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,SAAS,CACP,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;QACxC,CAAC,GAAG,CAAC,QAAQ;QACb,CAAC,GAAG,CAAC,QAAQ;QACb,CAAC,GAAG,CAAC,MAAM;QACX,CAAC,GAAG,CAAC,IAAI,EACX,yFAAyF,CAC1F,CAAC;IACF,MAAM,WAAW,GAAG,QAAQ,CAAC,iBAAiB,IAAI,gBAAgB,CAAC;IACnE,SAAS,CACP,WAAW,KAAK,KAAK,IAAI,0BAA0B,CAAC,IAAI,CAAC,WAAW,CAAC,EACrE,qDAAqD,CACtD,CAAC;IACF,MAAM,aAAa,GAAG;QACpB,qCAAqC;QACrC,6DAA6D;QAC7D,+CAA+C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjF,yDAAyD;QACzD,+DAA+D;KAChE,CAAC;IACF,IAAI,WAAW,KAAK,KAAK;QACvB,aAAa,CAAC,IAAI,CAChB,8CAA8C,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAC5E,CAAC;IACJ,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC","sourcesContent":["import { invariant } from \"../../domain/errors.ts\";\nimport type { CodexSettings } from \"./settings.types.ts\";\n\nexport function codexProvider(settings: CodexSettings): readonly string[] {\n const provider = settings.modelProvider;\n if (!provider) return [];\n invariant(\n settings.model?.trim(),\n \"A custom model provider requires a model name\",\n );\n let url: URL;\n try {\n url = new URL(provider.baseUrl);\n } catch {\n throw new Error(\"Model provider baseUrl must be an absolute HTTP(S) URL\");\n }\n invariant(\n [\"http:\", \"https:\"].includes(url.protocol) &&\n !url.username &&\n !url.password &&\n !url.search &&\n !url.hash,\n \"Model provider baseUrl must use HTTP(S) without embedded credentials, query or fragment\",\n );\n const environment = provider.apiKeyEnvironment ?? \"OPENAI_API_KEY\";\n invariant(\n environment === false || /^[A-Za-z_][A-Za-z0-9_]*$/.test(environment),\n \"Invalid model provider API-key environment variable\",\n );\n const configuration = [\n 'model_provider=\"outpost_compatible\"',\n 'model_providers.outpost_compatible.name=\"OpenAI compatible\"',\n `model_providers.outpost_compatible.base_url=${JSON.stringify(provider.baseUrl)}`,\n 'model_providers.outpost_compatible.wire_api=\"responses\"',\n \"model_providers.outpost_compatible.requires_openai_auth=false\",\n ];\n if (environment !== false)\n configuration.push(\n `model_providers.outpost_compatible.env_key=${JSON.stringify(environment)}`,\n );\n return configuration.flatMap((value) => [\"-c\", value]);\n}\n"]}
@@ -1,7 +1,8 @@
1
+ import { codexProvider } from "./codex-provider.js";
1
2
  import { validateContinuation } from "./continuation.js";
2
3
  export function codexRequest(settings, input) {
3
4
  validateContinuation(input);
4
- const args = [];
5
+ const args = [...codexProvider(settings)];
5
6
  if (settings.approvalReviewer === "auto_review")
6
7
  args.push("-a", "on-request", "-s", "danger-full-access", "-c", 'approvals_reviewer="auto_review"');
7
8
  if (settings.approvalReviewer !== "auto_review" && !input.interactive)
@@ -1 +1 @@
1
- {"version":3,"file":"codex-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,YAAY,CAC1B,QAAuB,EACvB,KAAiB;IAEjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,QAAQ,CAAC,gBAAgB,KAAK,aAAa;QAC7C,IAAI,CAAC,IAAI,CACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,oBAAoB,EACpB,IAAI,EACJ,kCAAkC,CACnC,CAAC;IACJ,IAAI,QAAQ,CAAC,gBAAgB,KAAK,aAAa,IAAI,CAAC,KAAK,CAAC,WAAW;QACnE,IAAI,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,IAAI,QAAQ,CAAC,SAAS;QACpB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,2BAA2B,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC;IACpE,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,YAAY;QACpB,IAAI,CAAC,IAAI,CACP,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAC3C,KAAK,CAAC,YAAY,CAAC,EAAE,CACtB,CAAC;IACJ,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjD,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO;QACL,UAAU,EAAE,OAAO;QACnB,SAAS,EAAE,IAAI;QACf,GAAG,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { validateContinuation } from \"./continuation.ts\";\nimport type { CodexSettings } from \"./settings.types.ts\";\n\nexport function codexRequest(\n settings: CodexSettings,\n input: AgentInput,\n): Command {\n validateContinuation(input);\n const args: string[] = [];\n if (settings.approvalReviewer === \"auto_review\")\n args.push(\n \"-a\",\n \"on-request\",\n \"-s\",\n \"danger-full-access\",\n \"-c\",\n 'approvals_reviewer=\"auto_review\"',\n );\n if (settings.approvalReviewer !== \"auto_review\" && !input.interactive)\n args.push(\"--dangerously-bypass-approvals-and-sandbox\");\n if (settings.model) args.push(\"--model\", settings.model);\n if (settings.reasoning)\n args.push(\"-c\", `model_reasoning_effort=\"${settings.reasoning}\"`);\n if (!input.interactive) args.push(\"exec\");\n if (input.continuation)\n args.push(\n input.continuation.fork ? \"fork\" : \"resume\",\n input.continuation.id,\n );\n if (!input.interactive) args.push(\"--json\", \"-\");\n if (input.interactive && input.text !== undefined)\n args.push(\"--\", input.text);\n return {\n executable: \"codex\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : { stdin: input.text ?? \"\" }),\n };\n}\n"]}
1
+ {"version":3,"file":"codex-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,YAAY,CAC1B,QAAuB,EACvB,KAAiB;IAEjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAa,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,IAAI,QAAQ,CAAC,gBAAgB,KAAK,aAAa;QAC7C,IAAI,CAAC,IAAI,CACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,oBAAoB,EACpB,IAAI,EACJ,kCAAkC,CACnC,CAAC;IACJ,IAAI,QAAQ,CAAC,gBAAgB,KAAK,aAAa,IAAI,CAAC,KAAK,CAAC,WAAW;QACnE,IAAI,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,IAAI,QAAQ,CAAC,SAAS;QACpB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,2BAA2B,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC;IACpE,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,YAAY;QACpB,IAAI,CAAC,IAAI,CACP,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAC3C,KAAK,CAAC,YAAY,CAAC,EAAE,CACtB,CAAC;IACJ,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjD,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO;QACL,UAAU,EAAE,OAAO;QACnB,SAAS,EAAE,IAAI;QACf,GAAG,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { codexProvider } from \"./codex-provider.ts\";\nimport { validateContinuation } from \"./continuation.ts\";\nimport type { CodexSettings } from \"./settings.types.ts\";\n\nexport function codexRequest(\n settings: CodexSettings,\n input: AgentInput,\n): Command {\n validateContinuation(input);\n const args: string[] = [...codexProvider(settings)];\n if (settings.approvalReviewer === \"auto_review\")\n args.push(\n \"-a\",\n \"on-request\",\n \"-s\",\n \"danger-full-access\",\n \"-c\",\n 'approvals_reviewer=\"auto_review\"',\n );\n if (settings.approvalReviewer !== \"auto_review\" && !input.interactive)\n args.push(\"--dangerously-bypass-approvals-and-sandbox\");\n if (settings.model) args.push(\"--model\", settings.model);\n if (settings.reasoning)\n args.push(\"-c\", `model_reasoning_effort=\"${settings.reasoning}\"`);\n if (!input.interactive) args.push(\"exec\");\n if (input.continuation)\n args.push(\n input.continuation.fork ? \"fork\" : \"resume\",\n input.continuation.id,\n );\n if (!input.interactive) args.push(\"--json\", \"-\");\n if (input.interactive && input.text !== undefined)\n args.push(\"--\", input.text);\n return {\n executable: \"codex\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : { stdin: input.text ?? \"\" }),\n };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { AgentAdapter } from "../../domain/agent.types.ts";
2
+ import type { GeminiSettings } from "./gemini.types.ts";
3
+ export declare function gemini(settings?: GeminiSettings): AgentAdapter;
@@ -0,0 +1,15 @@
1
+ import { geminiEvents } from "./gemini-events.js";
2
+ import { geminiRequest } from "./gemini-request.js";
3
+ export function gemini(settings = {}) {
4
+ return Object.freeze({
5
+ name: "gemini",
6
+ bootstrap: "gemini",
7
+ resumable: false,
8
+ capture: false,
9
+ requiresFinishedEvent: true,
10
+ variables: Object.freeze({ ...settings.variables }),
11
+ request: (input) => geminiRequest(settings, input),
12
+ events: geminiEvents,
13
+ });
14
+ }
15
+ //# sourceMappingURL=gemini-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gemini-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,UAAU,MAAM,CAAC,WAA2B,EAAE;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,qBAAqB,EAAE,IAAI;QAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC;QAClD,MAAM,EAAE,YAAY;KACE,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { AgentAdapter } from \"../../domain/agent.types.ts\";\nimport { geminiEvents } from \"./gemini-events.ts\";\nimport { geminiRequest } from \"./gemini-request.ts\";\nimport type { GeminiSettings } from \"./gemini.types.ts\";\n\nexport function gemini(settings: GeminiSettings = {}): AgentAdapter {\n return Object.freeze({\n name: \"gemini\",\n bootstrap: \"gemini\",\n resumable: false,\n capture: false,\n requiresFinishedEvent: true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => geminiRequest(settings, input),\n events: geminiEvents,\n } satisfies AgentAdapter);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { AgentCliDiagnostic } from "./cli-diagnostics.types.ts";
2
+ export declare function geminiDiagnostics(): readonly AgentCliDiagnostic[];
@@ -0,0 +1,15 @@
1
+ import { geminiRequest } from "./gemini-request.js";
2
+ export function geminiDiagnostics() {
3
+ const command = geminiRequest({}, {});
4
+ const args = command.arguments ?? [];
5
+ return [
6
+ {
7
+ mode: "start",
8
+ usage: "gemini",
9
+ options: args.filter((argument) => argument.startsWith("--")),
10
+ // Gemini omits supplied options from its help output.
11
+ command: { ...command, arguments: ["--help"] },
12
+ },
13
+ ];
14
+ }
15
+ //# sourceMappingURL=gemini-diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gemini-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IACrC,OAAO;QACL;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7D,sDAAsD;YACtD,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;SAC/C;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentCliDiagnostic } from \"./cli-diagnostics.types.ts\";\nimport { geminiRequest } from \"./gemini-request.ts\";\n\nexport function geminiDiagnostics(): readonly AgentCliDiagnostic[] {\n const command = geminiRequest({}, {});\n const args = command.arguments ?? [];\n return [\n {\n mode: \"start\",\n usage: \"gemini\",\n options: args.filter((argument) => argument.startsWith(\"--\")),\n // Gemini omits supplied options from its help output.\n command: { ...command, arguments: [\"--help\"] },\n },\n ];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { AgentEvent } from "../../domain/agent.types.ts";
2
+ export declare function geminiEvents(line: string): AgentEvent[];
@@ -0,0 +1,50 @@
1
+ import { decodeLine } from "./event-decoder.js";
2
+ import { asRecord, numberOrZero } from "./protocol.js";
3
+ function message(event) {
4
+ if (event.role !== "assistant" || typeof event.content !== "string")
5
+ return [];
6
+ return [{ kind: "text", text: event.content }];
7
+ }
8
+ function result(event) {
9
+ const events = [];
10
+ if (event.stats) {
11
+ const stats = asRecord(event.stats);
12
+ events.push({
13
+ kind: "usage",
14
+ tokens: {
15
+ input: numberOrZero(stats.input_tokens),
16
+ cached: numberOrZero(stats.cached),
17
+ output: numberOrZero(stats.output_tokens),
18
+ },
19
+ });
20
+ }
21
+ if (event.status === "success")
22
+ events.push({ kind: "finished" });
23
+ if (event.status === "error")
24
+ events.push({
25
+ kind: "failure",
26
+ message: String(asRecord(event.error).message ?? "Gemini failed"),
27
+ });
28
+ return events;
29
+ }
30
+ export function geminiEvents(line) {
31
+ return decodeLine(line, {
32
+ init: (event) => typeof event.session_id === "string"
33
+ ? [{ kind: "conversation", id: event.session_id }]
34
+ : [],
35
+ message,
36
+ tool_use: (event) => typeof event.tool_name === "string"
37
+ ? [{ kind: "tool", name: event.tool_name, input: event.parameters }]
38
+ : [],
39
+ error: (event) => typeof event.message === "string"
40
+ ? [
41
+ {
42
+ kind: event.severity === "warning" ? "warning" : "failure",
43
+ message: event.message,
44
+ },
45
+ ]
46
+ : [],
47
+ result,
48
+ });
49
+ }
50
+ //# sourceMappingURL=gemini-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gemini-events.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGvD,SAAS,OAAO,CAAC,KAAqB;IACpC,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QACjE,OAAO,EAAE,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,MAAM,CAAC,KAAqB;IACnC,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC;YACV,I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E,IAAI,EAAE,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;oBAC1D,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF;YACH,CAAC,CAAC,EAAE;QACR,MAAM;KACP,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentEvent } from \"../../domain/agent.types.ts\";\nimport { decodeLine } from \"./event-decoder.ts\";\nimport { asRecord, numberOrZero } from \"./protocol.ts\";\nimport type { ProtocolRecord } from \"./protocol.types.ts\";\n\nfunction message(event: ProtocolRecord): AgentEvent[] {\n if (event.role !== \"assistant\" || typeof event.content !== \"string\")\n return [];\n return [{ kind: \"text\", text: event.content }];\n}\n\nfunction result(event: ProtocolRecord): AgentEvent[] {\n const events: AgentEvent[] = [];\n if (event.stats) {\n const stats = asRecord(event.stats);\n events.push({\n kind: \"usage\",\n tokens: {\n input: numberOrZero(stats.input_tokens),\n cached: numberOrZero(stats.cached),\n output: numberOrZero(stats.output_tokens),\n },\n });\n }\n if (event.status === \"success\") events.push({ kind: \"finished\" });\n if (event.status === \"error\")\n events.push({\n kind: \"failure\",\n message: String(asRecord(event.error).message ?? \"Gemini failed\"),\n });\n return events;\n}\n\nexport function geminiEvents(line: string): AgentEvent[] {\n return decodeLine(line, {\n init: (event) =>\n typeof event.session_id === \"string\"\n ? [{ kind: \"conversation\", id: event.session_id }]\n : [],\n message,\n tool_use: (event) =>\n typeof event.tool_name === \"string\"\n ? [{ kind: \"tool\", name: event.tool_name, input: event.parameters }]\n : [],\n error: (event) =>\n typeof event.message === \"string\"\n ? [\n {\n kind: event.severity === \"warning\" ? \"warning\" : \"failure\",\n message: event.message,\n },\n ]\n : [],\n result,\n });\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { AgentInput } from "../../domain/agent.types.ts";
2
+ import type { Command } from "../../domain/command.types.ts";
3
+ import type { GeminiSettings } from "./gemini.types.ts";
4
+ export declare function geminiRequest(settings: GeminiSettings, input: AgentInput): Command;
@@ -0,0 +1,23 @@
1
+ import { invariant } from "../../domain/errors.js";
2
+ export function geminiRequest(settings, input) {
3
+ invariant(!input.continuation, "Gemini does not support continuation or fork in Outpost");
4
+ const args = [];
5
+ if (settings.model)
6
+ args.push("--model", settings.model);
7
+ const approvalMode = settings.approvalMode ?? (input.interactive ? "default" : "yolo");
8
+ args.push("--approval-mode", approvalMode);
9
+ if (!input.interactive && approvalMode === "yolo")
10
+ args.push("--skip-trust");
11
+ if (!input.interactive)
12
+ args.push("--output-format", "stream-json");
13
+ if (input.interactive && input.text !== undefined)
14
+ args.push("--prompt-interactive", input.text);
15
+ return {
16
+ executable: "gemini",
17
+ arguments: args,
18
+ ...(input.interactive
19
+ ? { interactive: true }
20
+ : { stdin: input.text ?? "" }),
21
+ };
22
+ }
23
+ //# sourceMappingURL=gemini-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gemini-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,MAAM,UAAU,aAAa,CAC3B,QAAwB,EACxB,KAAiB;IAEjB,SAAS,CACP,CAAC,KAAK,CAAC,YAAY,EACnB,yDAAyD,CAC1D,CAAC;IACF,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,MAAM,YAAY,GAChB,QAAQ,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACpE,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,YAAY,KAAK,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7E,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IACpE,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAC/C,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO;QACL,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,IAAI;QACf,GAAG,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport type { GeminiSettings } from \"./gemini.types.ts\";\n\nexport function geminiRequest(\n settings: GeminiSettings,\n input: AgentInput,\n): Command {\n invariant(\n !input.continuation,\n \"Gemini does not support continuation or fork in Outpost\",\n );\n const args: string[] = [];\n if (settings.model) args.push(\"--model\", settings.model);\n const approvalMode =\n settings.approvalMode ?? (input.interactive ? \"default\" : \"yolo\");\n args.push(\"--approval-mode\", approvalMode);\n if (!input.interactive && approvalMode === \"yolo\") args.push(\"--skip-trust\");\n if (!input.interactive) args.push(\"--output-format\", \"stream-json\");\n if (input.interactive && input.text !== undefined)\n args.push(\"--prompt-interactive\", input.text);\n return {\n executable: \"gemini\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : { stdin: input.text ?? \"\" }),\n };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { Variables } from "../../domain/command.types.ts";
2
+ export interface GeminiSettings {
3
+ readonly model?: string;
4
+ readonly variables?: Variables;
5
+ readonly approvalMode?: "default" | "auto_edit" | "yolo" | "plan";
6
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=gemini.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gemini.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Variables } from \"../../domain/command.types.ts\";\n\nexport interface GeminiSettings {\n readonly model?: string;\n readonly variables?: Variables;\n readonly approvalMode?: \"default\" | \"auto_edit\" | \"yolo\" | \"plan\";\n}\n"]}
@@ -1,2 +1,2 @@
1
1
  import type { AgentProtocolFixture } from "./protocol-fixtures.types.ts";
2
- export declare const protocolFixtures: Readonly<Record<"claude" | "codex", readonly AgentProtocolFixture[]>>;
2
+ export declare const protocolFixtures: Readonly<Record<"claude" | "codex" | "gemini", readonly AgentProtocolFixture[]>>;
@@ -1,4 +1,41 @@
1
1
  export const protocolFixtures = {
2
+ gemini: [
3
+ {
4
+ name: "turn",
5
+ lines: [
6
+ '{"type":"init","session_id":"fixture-conversation","model":"fixture-model"}',
7
+ '{"type":"tool_use","tool_name":"command","tool_id":"call-1","parameters":{"command":"fixture-command"}}',
8
+ '{"type":"message","role":"assistant","content":"fixture-result","delta":true}',
9
+ '{"type":"result","status":"success","stats":{"input_tokens":10,"cached":2,"output_tokens":3}}',
10
+ ],
11
+ expected: [
12
+ { kind: "conversation", id: "fixture-conversation" },
13
+ {
14
+ kind: "tool",
15
+ name: "command",
16
+ input: { command: "fixture-command" },
17
+ },
18
+ { kind: "text", text: "fixture-result" },
19
+ { kind: "usage", tokens: { input: 10, cached: 2, output: 3 } },
20
+ { kind: "finished" },
21
+ ],
22
+ },
23
+ {
24
+ name: "failure",
25
+ lines: [
26
+ '{"type":"result","status":"error","error":{"message":"fixture-failure"}}',
27
+ ],
28
+ expected: [{ kind: "failure", message: "fixture-failure" }],
29
+ },
30
+ {
31
+ name: "unknown",
32
+ lines: ['{"type":"future.event"}', "invalid-json"],
33
+ expected: [
34
+ { kind: "raw", value: { type: "future.event" } },
35
+ { kind: "raw", value: "invalid-json" },
36
+ ],
37
+ },
38
+ ],
2
39
  codex: [
3
40
  {
4
41
  name: "turn",
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-fixtures.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/protocol-fixtures.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAEzB;IACF,KAAK,EAAE;QACL;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,8DAA8D;gBAC9D,yFAAyF;gBACzF,mFAAmF;gBACnF,iGAAiG;aAClG;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9D,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,8DAA8D,CAAC;YACvE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,uDAAuD;gBACvD,qJAAqJ;gBACrJ,uJAAuJ;aACxJ;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAC1C;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;iBAC7D;gBACD,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,8DAA8D,CAAC;YACvE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;CACF,CAAC","sourcesContent":["import type { AgentProtocolFixture } from \"./protocol-fixtures.types.ts\";\n\nexport const protocolFixtures: Readonly<\n Record<\"claude\" | \"codex\", readonly AgentProtocolFixture[]>\n> = {\n codex: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"thread.started\",\"thread_id\":\"fixture-conversation\"}',\n '{\"type\":\"item.started\",\"item\":{\"type\":\"command_execution\",\"command\":\"fixture-command\"}}',\n '{\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"fixture-result\"}}',\n '{\"type\":\"turn.completed\",\"usage\":{\"input_tokens\":10,\"cached_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"turn.failed\",\"error\":{\"message\":\"fixture-failure\"}}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n claude: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"system\",\"session_id\":\"fixture-conversation\"}',\n '{\"type\":\"assistant\",\"message\":{\"content\":[{\"type\":\"tool_use\",\"name\":\"command\",\"input\":\"fixture-command\"},{\"type\":\"text\",\"text\":\"fixture-result\"}]}}',\n '{\"type\":\"result\",\"result\":\"fixture-result\",\"usage\":{\"input_tokens\":10,\"cache_creation_input_tokens\":1,\"cache_read_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"result\", text: \"fixture-result\" },\n {\n kind: \"usage\",\n tokens: { input: 10, cached: 2, cacheCreated: 1, output: 3 },\n },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"result\",\"is_error\":true,\"result\":\"fixture-failure\"}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n};\n"]}
1
+ {"version":3,"file":"protocol-fixtures.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/protocol-fixtures.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAEzB;IACF,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,6EAA6E;gBAC7E,yGAAyG;gBACzG,+EAA+E;gBAC/E,+FAA+F;aAChG;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;iBACtC;gBACD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9D,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE;gBACL,0EAA0E;aAC3E;YACD,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE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ACpD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAC1C;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;iBAC7D;gBACD,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,8DAA8D,CAAC;YACvE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;CACF,CAAC","sourcesContent":["import type { AgentProtocolFixture } from \"./protocol-fixtures.types.ts\";\n\nexport const protocolFixtures: Readonly<\n Record<\"claude\" | \"codex\" | \"gemini\", readonly AgentProtocolFixture[]>\n> = {\n gemini: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"init\",\"session_id\":\"fixture-conversation\",\"model\":\"fixture-model\"}',\n '{\"type\":\"tool_use\",\"tool_name\":\"command\",\"tool_id\":\"call-1\",\"parameters\":{\"command\":\"fixture-command\"}}',\n '{\"type\":\"message\",\"role\":\"assistant\",\"content\":\"fixture-result\",\"delta\":true}',\n '{\"type\":\"result\",\"status\":\"success\",\"stats\":{\"input_tokens\":10,\"cached\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n {\n kind: \"tool\",\n name: \"command\",\n input: { command: \"fixture-command\" },\n },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: [\n '{\"type\":\"result\",\"status\":\"error\",\"error\":{\"message\":\"fixture-failure\"}}',\n ],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n codex: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"thread.started\",\"thread_id\":\"fixture-conversation\"}',\n '{\"type\":\"item.started\",\"item\":{\"type\":\"command_execution\",\"command\":\"fixture-command\"}}',\n '{\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"fixture-result\"}}',\n '{\"type\":\"turn.completed\",\"usage\":{\"input_tokens\":10,\"cached_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"turn.failed\",\"error\":{\"message\":\"fixture-failure\"}}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n claude: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"system\",\"session_id\":\"fixture-conversation\"}',\n '{\"type\":\"assistant\",\"message\":{\"content\":[{\"type\":\"tool_use\",\"name\":\"command\",\"input\":\"fixture-command\"},{\"type\":\"text\",\"text\":\"fixture-result\"}]}}',\n '{\"type\":\"result\",\"result\":\"fixture-result\",\"usage\":{\"input_tokens\":10,\"cache_creation_input_tokens\":1,\"cache_read_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"result\", text: \"fixture-result\" },\n {\n kind: \"usage\",\n tokens: { input: 10, cached: 2, cacheCreated: 1, output: 3 },\n },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"result\",\"is_error\":true,\"result\":\"fixture-failure\"}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n};\n"]}
@@ -8,7 +8,12 @@ export interface ClaudeSettings extends CommonAgentSettings {
8
8
  readonly reasoning?: "low" | "medium" | "high" | "xhigh" | "max";
9
9
  readonly permissions?: "default" | "acceptEdits" | "plan" | "auto" | "dontAsk" | "bypassPermissions";
10
10
  }
11
+ export interface CodexModelProvider {
12
+ readonly baseUrl: string;
13
+ readonly apiKeyEnvironment?: string | false;
14
+ }
11
15
  export interface CodexSettings extends CommonAgentSettings {
16
+ readonly modelProvider?: CodexModelProvider;
12
17
  readonly reasoning?: "low" | "medium" | "high" | "xhigh";
13
18
  readonly approvalReviewer?: "user" | "auto_review";
14
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"settings.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/settings.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Variables } from \"../../domain/command.types.ts\";\n\nexport interface CommonAgentSettings {\n readonly model?: string;\n readonly variables?: Variables;\n readonly saveConversations?: boolean;\n}\n\nexport interface ClaudeSettings extends CommonAgentSettings {\n readonly reasoning?: \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\";\n readonly permissions?:\n | \"default\"\n | \"acceptEdits\"\n | \"plan\"\n | \"auto\"\n | \"dontAsk\"\n | \"bypassPermissions\";\n}\n\nexport interface CodexSettings extends CommonAgentSettings {\n readonly reasoning?: \"low\" | \"medium\" | \"high\" | \"xhigh\";\n readonly approvalReviewer?: \"user\" | \"auto_review\";\n}\n"]}
1
+ {"version":3,"file":"settings.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/settings.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Variables } from \"../../domain/command.types.ts\";\n\nexport interface CommonAgentSettings {\n readonly model?: string;\n readonly variables?: Variables;\n readonly saveConversations?: boolean;\n}\n\nexport interface ClaudeSettings extends CommonAgentSettings {\n readonly reasoning?: \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\";\n readonly permissions?:\n | \"default\"\n | \"acceptEdits\"\n | \"plan\"\n | \"auto\"\n | \"dontAsk\"\n | \"bypassPermissions\";\n}\n\nexport interface CodexModelProvider {\n readonly baseUrl: string;\n readonly apiKeyEnvironment?: string | false;\n}\n\nexport interface CodexSettings extends CommonAgentSettings {\n readonly modelProvider?: CodexModelProvider;\n readonly reasoning?: \"low\" | \"medium\" | \"high\" | \"xhigh\";\n readonly approvalReviewer?: \"user\" | \"auto_review\";\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export declare const agentPackages: Readonly<{
2
2
  claude: "@anthropic-ai/claude-code@2.1.280";
3
+ gemini: "@google/gemini-cli@0.61.0";
3
4
  codex: "@openai/codex@0.156.1";
4
5
  }>;
@@ -1,6 +1,7 @@
1
1
  import { agentVersions } from "../providers/versions.js";
2
2
  export const agentPackages = Object.freeze({
3
3
  claude: `@anthropic-ai/claude-code@${agentVersions.claude}`,
4
+ gemini: `@google/gemini-cli@${agentVersions.gemini}`,
4
5
  codex: `@openai/codex@${agentVersions.codex}`,
5
6
  });
6
7
  //# sourceMappingURL=agent-bootstrap.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-bootstrap.constants.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,6BAA6B,aAAa,CAAC,MAAM,EAAE;IAC3D,KAAK,EAAE,iBAAiB,aAAa,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const agentPackages = Object.freeze({\n claude: `@anthropic-ai/claude-code@${agentVersions.claude}`,\n codex: `@openai/codex@${agentVersions.codex}`,\n});\n"]}
1
+ {"version":3,"file":"agent-bootstrap.constants.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,6BAA6B,aAAa,CAAC,MAAM,EAAE;IAC3D,MAAM,EAAE,sBAAsB,aAAa,CAAC,MAAM,EAAE;IACpD,KAAK,EAAE,iBAAiB,aAAa,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const agentPackages = Object.freeze({\n claude: `@anthropic-ai/claude-code@${agentVersions.claude}`,\n gemini: `@google/gemini-cli@${agentVersions.gemini}`,\n codex: `@openai/codex@${agentVersions.codex}`,\n});\n"]}
@@ -2,10 +2,14 @@ import { posix } from "node:path";
2
2
  import { invariant } from "../domain/errors.js";
3
3
  import { quote, requireSuccess } from "../infrastructure/process.js";
4
4
  import { agentPackages } from "./agent-bootstrap.constants.js";
5
+ function isBootstrapAgent(name) {
6
+ return Object.hasOwn(agentPackages, name);
7
+ }
5
8
  export async function prepareAdapter(agent, runtime, signal) {
6
- if (!agent.conversations)
9
+ const executable = agent.bootstrap ?? agent.conversations;
10
+ if (!executable)
7
11
  return agent;
8
- const executable = agent.conversations;
12
+ invariant(isBootstrapAgent(executable), `Unknown agent bootstrap: ${executable}`);
9
13
  const cli = agentPackages[executable];
10
14
  const prefix = posix.join(runtime.home, ".outpost-tools"), target = posix.join(prefix, "bin", executable);
11
15
  const installed = await requireSuccess({
@@ -1 +1 @@
1
- {"version":3,"file":"agent-bootstrap.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAmB,EACnB,OAAqB,EACrB,MAAmB;IAEnB,IAAI,CAAC,KAAK,CAAC,aAAa;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC;IACvC,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACvD,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,cAAc,CACpC;QACE,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE;YACT,IAAI;YACJ,iBAAiB,UAAU,qCAAqC,UAAU,kBAAkB,KAAK,CAAC,MAAM,CAAC,yBAAyB,KAAK,CAAC,MAAM,CAAC,kFAAkF,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,0BAA0B,KAAK,CAAC,MAAM,CAAC,MAAM;SACnS;QACD,MAAM;KACP,EACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAC7B,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACvC,SAAS,CACP,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAChD,qDAAqD,CACtD,CAAC;IACF,OAAO;QACL,GAAG,KAAK;QACR,OAAO,CAAC,KAAK;YACX,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QACzD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { posix } from \"node:path\";\nimport type { AgentAdapter } from \"../domain/agent.types.ts\";\nimport { invariant } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport { quote, requireSuccess } from \"../infrastructure/process.ts\";\nimport { agentPackages } from \"./agent-bootstrap.constants.ts\";\n\nexport async function prepareAdapter(\n agent: AgentAdapter,\n runtime: SandboxLease,\n signal: AbortSignal,\n): Promise<AgentAdapter> {\n if (!agent.conversations) return agent;\n const executable = agent.conversations;\n const cli = agentPackages[executable];\n const prefix = posix.join(runtime.home, \".outpost-tools\"),\n target = posix.join(prefix, \"bin\", executable);\n const installed = await requireSuccess(\n {\n executable: \"sh\",\n arguments: [\n \"-c\",\n `if command -v ${executable} >/dev/null 2>&1; then command -v ${executable}; elif test -x ${quote(target)}; then printf '%s\\\\n' ${quote(target)}; else npm install --global --allow-scripts=@anthropic-ai/claude-code --prefix ${quote(prefix)} ${cli} >&2 && printf '%s\\\\n' ${quote(target)}; fi`,\n ],\n signal,\n },\n runtime.invoke.bind(runtime),\n );\n const binary = installed.stdout.trim();\n invariant(\n binary.startsWith(\"/\") && !binary.includes(\"\\n\"),\n \"Agent bootstrap returned an invalid executable path\",\n );\n return {\n ...agent,\n request(input) {\n return { ...agent.request(input), executable: binary };\n },\n };\n}\n"]}
1
+ {"version":3,"file":"agent-bootstrap.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAmB,EACnB,OAAqB,EACrB,MAAmB;IAEnB,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,aAAa,CAAC;IAC1D,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC9B,SAAS,CACP,gBAAgB,CAAC,UAAU,CAAC,EAC5B,4BAA4B,UAAU,EAAE,CACzC,CAAC;IACF,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACvD,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,cAAc,CACpC;QACE,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE;YACT,IAAI;YACJ,iBAAiB,UAAU,qCAAqC,UAAU,kBAAkB,KAAK,CAAC,MAAM,CAAC,yBAAyB,KAAK,CAAC,MAAM,CAAC,kFAAkF,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,0BAA0B,KAAK,CAAC,MAAM,CAAC,MAAM;SACnS;QACD,MAAM;KACP,EACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAC7B,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACvC,SAAS,CACP,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAChD,qDAAqD,CACtD,CAAC;IACF,OAAO;QACL,GAAG,KAAK;QACR,OAAO,CAAC,KAAK;YACX,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QACzD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { posix } from \"node:path\";\nimport type { AgentAdapter } from \"../domain/agent.types.ts\";\nimport { invariant } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport { quote, requireSuccess } from \"../infrastructure/process.ts\";\nimport { agentPackages } from \"./agent-bootstrap.constants.ts\";\n\nfunction isBootstrapAgent(name: string): name is keyof typeof agentPackages {\n return Object.hasOwn(agentPackages, name);\n}\n\nexport async function prepareAdapter(\n agent: AgentAdapter,\n runtime: SandboxLease,\n signal: AbortSignal,\n): Promise<AgentAdapter> {\n const executable = agent.bootstrap ?? agent.conversations;\n if (!executable) return agent;\n invariant(\n isBootstrapAgent(executable),\n `Unknown agent bootstrap: ${executable}`,\n );\n const cli = agentPackages[executable];\n const prefix = posix.join(runtime.home, \".outpost-tools\"),\n target = posix.join(prefix, \"bin\", executable);\n const installed = await requireSuccess(\n {\n executable: \"sh\",\n arguments: [\n \"-c\",\n `if command -v ${executable} >/dev/null 2>&1; then command -v ${executable}; elif test -x ${quote(target)}; then printf '%s\\\\n' ${quote(target)}; else npm install --global --allow-scripts=@anthropic-ai/claude-code --prefix ${quote(prefix)} ${cli} >&2 && printf '%s\\\\n' ${quote(target)}; fi`,\n ],\n signal,\n },\n runtime.invoke.bind(runtime),\n );\n const binary = installed.stdout.trim();\n invariant(\n binary.startsWith(\"/\") && !binary.includes(\"\\n\"),\n \"Agent bootstrap returned an invalid executable path\",\n );\n return {\n ...agent,\n request(input) {\n return { ...agent.request(input), executable: binary };\n },\n };\n}\n"]}
@@ -7,7 +7,7 @@ export function agentOutput(agent, options, markers, pass) {
7
7
  let pending = "", text = "", rawTail = "";
8
8
  let finalText, conversation, failure;
9
9
  let usage = { input: 0, cached: 0, output: 0 };
10
- let completed = false;
10
+ let completed = false, finished = false;
11
11
  const handlers = {
12
12
  text: (event) => {
13
13
  text += event.text;
@@ -18,6 +18,9 @@ export function agentOutput(agent, options, markers, pass) {
18
18
  conversation: (event) => {
19
19
  conversation = event.id;
20
20
  },
21
+ finished: () => {
22
+ finished = true;
23
+ },
21
24
  failure: (event) => {
22
25
  failure = event.message;
23
26
  },
@@ -33,7 +36,9 @@ export function agentOutput(agent, options, markers, pass) {
33
36
  if (event.kind !== "raw")
34
37
  notify(options.observe, { ...event, pass, at });
35
38
  }
36
- completed = markers.some((marker) => (finalText ?? text).includes(marker));
39
+ completed =
40
+ (!agent.requiresFinishedEvent || finished) &&
41
+ markers.some((marker) => (finalText ?? text).includes(marker));
37
42
  }
38
43
  return {
39
44
  get completed() {
@@ -61,6 +66,8 @@ export function agentOutput(agent, options, markers, pass) {
61
66
  result() {
62
67
  if (failure)
63
68
  throw new OutpostError("process", failure, { conversation });
69
+ if (agent.requiresFinishedEvent && !finished)
70
+ throw new OutpostError("process", "Agent exited without a successful final event", { conversation });
64
71
  return {
65
72
  text: finalText ?? (text || rawTail),
66
73
  usage,
@@ -1 +1 @@
1
-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D,IAAI,OAAO,CAAC,MAAM,GAAG,iBAAiB,CAAC,UAAU;gBAC/C,MAAM,IAAI,YAAY,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC;QAC1E,CAAC;QACD,KAAK;YACH,IAAI,OAAO;gBAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC9B,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM;YACJ,IAAI,OAAO;gBAAE,MAAM,IAAI,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;YAC1E,OAAO;gBACL,IAAI,EAAE,SAAS,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC;gBACpC,KAAK;gBACL,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1C,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { visitAgentEvent } from \"../domain/agent-events.ts\";\nimport type { AgentAdapter, Usage } from \"../domain/agent.types.ts\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { addUsage } from \"../domain/usage.ts\";\nimport { executionDefaults } from \"./execution.constants.ts\";\nimport type { AgentOutput, DispatchOptions } from \"./execution.types.ts\";\nimport { notify } from \"./observation.ts\";\n\nexport function agentOutput(\n agent: AgentAdapter,\n options: DispatchOptions<unknown>,\n markers: readonly string[],\n pass: number,\n): AgentOutput {\n let pending = \"\",\n text = \"\",\n rawTail = \"\";\n let finalText: string | undefined,\n conversation: string | undefined,\n failure: string | undefined;\n let usage: Usage = { input: 0, cached: 0, output: 0 };\n let completed = false;\n const handlers: import(\"../domain/agent.types.ts\").AgentEventHandlers = {\n text: (event) => {\n text += event.text;\n },\n result: (event) => {\n finalText = event.text;\n },\n conversation: (event) => {\n conversation = event.id;\n },\n failure: (event) => {\n failure = event.message;\n },\n usage: (event) => {\n usage = addUsage(usage, event.tokens);\n },\n };\n function consume(line: string): void {\n const at = new Date().toISOString();\n notify(options.observe, { kind: \"raw\", value: line, pass, at });\n for (const event of agent.events(line)) {\n visitAgentEvent(event, handlers);\n if (event.kind !== \"raw\") notify(options.observe, { ...event, pass, at });\n }\n completed = markers.some((marker) => (finalText ?? text).includes(marker));\n }\n return {\n get completed() {\n return completed;\n },\n get conversation() {\n return conversation;\n },\n append(chunk) {\n rawTail = (rawTail + chunk).slice(-executionDefaults.rawTailBytes);\n pending += chunk;\n let end: number;\n while ((end = pending.indexOf(\"\\n\")) >= 0) {\n consume(pending.slice(0, end));\n pending = pending.slice(end + 1);\n }\n if (pending.length > executionDefaults.eventBytes)\n throw new OutpostError(\"process\", \"Agent emitted an oversized event\");\n },\n flush() {\n if (pending) consume(pending);\n pending = \"\";\n },\n result() {\n if (failure) throw new OutpostError(\"process\", failure, { conversation });\n return {\n text: finalText ?? (text || rawTail),\n usage,\n ...(conversation ? { conversation } : {}),\n };\n },\n };\n}\n"]}
1
+ {"version":3,"file":"agent-output.js","sourceRoot":"","sources":["../../src/application/agent-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,UAAU,WAAW,CACzB,KAAmB,EACnB,OAAiC,EACjC,OAA0B,EAC1B,IAAY;IAEZ,IAAI,OAAO,GAAG,EAAE,EACd,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,EAAE,CAAC;IACf,IAAI,SAA6B,EAC/B,YAAgC,EAChC,OAA2B,CAAC;IAC9B,IAAI,KAAK,GAAU,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAA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B,CAAC;YACJ,OAAO;gBACL,IAAI,EAAE,SAAS,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC;gBACpC,KAAK;gBACL,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1C,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { visitAgentEvent } from \"../domain/agent-events.ts\";\nimport type { AgentAdapter, Usage } from \"../domain/agent.types.ts\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { addUsage } from \"../domain/usage.ts\";\nimport { executionDefaults } from \"./execution.constants.ts\";\nimport type { AgentOutput, DispatchOptions } from \"./execution.types.ts\";\nimport { notify } from \"./observation.ts\";\n\nexport function agentOutput(\n agent: AgentAdapter,\n options: DispatchOptions<unknown>,\n markers: readonly string[],\n pass: number,\n): AgentOutput {\n let pending = \"\",\n text = \"\",\n rawTail = \"\";\n let finalText: string | undefined,\n conversation: string | undefined,\n failure: string | undefined;\n let usage: Usage = { input: 0, cached: 0, output: 0 };\n let completed = false,\n finished = false;\n const handlers: import(\"../domain/agent.types.ts\").AgentEventHandlers = {\n text: (event) => {\n text += event.text;\n },\n result: (event) => {\n finalText = event.text;\n },\n conversation: (event) => {\n conversation = event.id;\n },\n finished: () => {\n finished = true;\n },\n failure: (event) => {\n failure = event.message;\n },\n usage: (event) => {\n usage = addUsage(usage, event.tokens);\n },\n };\n function consume(line: string): void {\n const at = new Date().toISOString();\n notify(options.observe, { kind: \"raw\", value: line, pass, at });\n for (const event of agent.events(line)) {\n visitAgentEvent(event, handlers);\n if (event.kind !== \"raw\") notify(options.observe, { ...event, pass, at });\n }\n completed =\n (!agent.requiresFinishedEvent || finished) &&\n markers.some((marker) => (finalText ?? text).includes(marker));\n }\n return {\n get completed() {\n return completed;\n },\n get conversation() {\n return conversation;\n },\n append(chunk) {\n rawTail = (rawTail + chunk).slice(-executionDefaults.rawTailBytes);\n pending += chunk;\n let end: number;\n while ((end = pending.indexOf(\"\\n\")) >= 0) {\n consume(pending.slice(0, end));\n pending = pending.slice(end + 1);\n }\n if (pending.length > executionDefaults.eventBytes)\n throw new OutpostError(\"process\", \"Agent emitted an oversized event\");\n },\n flush() {\n if (pending) consume(pending);\n pending = \"\";\n },\n result() {\n if (failure) throw new OutpostError(\"process\", failure, { conversation });\n if (agent.requiresFinishedEvent && !finished)\n throw new OutpostError(\n \"process\",\n \"Agent exited without a successful final event\",\n { conversation },\n );\n return {\n text: finalText ?? (text || rawTail),\n usage,\n ...(conversation ? { conversation } : {}),\n };\n },\n };\n}\n"]}