@elie-laloum/outpost 4.2.0 → 6.0.1

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 (642) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +13 -11
  3. package/SECURITY.md +2 -0
  4. package/dist/adapters/agents/antigravity-adapter.d.ts +3 -0
  5. package/dist/adapters/agents/antigravity-adapter.js +39 -0
  6. package/dist/adapters/agents/antigravity-adapter.js.map +1 -0
  7. package/dist/adapters/agents/antigravity-authentication.d.ts +2 -0
  8. package/dist/adapters/agents/antigravity-authentication.js +27 -0
  9. package/dist/adapters/agents/antigravity-authentication.js.map +1 -0
  10. package/dist/adapters/agents/antigravity-diagnostics.d.ts +1 -0
  11. package/dist/adapters/agents/antigravity-diagnostics.js +6 -0
  12. package/dist/adapters/agents/antigravity-diagnostics.js.map +1 -0
  13. package/dist/adapters/agents/antigravity-events.d.ts +2 -0
  14. package/dist/adapters/agents/antigravity-events.js +66 -0
  15. package/dist/adapters/agents/antigravity-events.js.map +1 -0
  16. package/dist/adapters/agents/antigravity-request.d.ts +5 -0
  17. package/dist/adapters/agents/antigravity-request.js +29 -0
  18. package/dist/adapters/agents/antigravity-request.js.map +1 -0
  19. package/dist/adapters/agents/antigravity.types.d.ts +7 -0
  20. package/dist/adapters/agents/antigravity.types.js +2 -0
  21. package/dist/adapters/agents/antigravity.types.js.map +1 -0
  22. package/dist/adapters/agents/authentication.constants.d.ts +23 -0
  23. package/dist/adapters/agents/authentication.constants.js +13 -0
  24. package/dist/adapters/agents/authentication.constants.js.map +1 -0
  25. package/dist/adapters/agents/authentication.d.ts +11 -0
  26. package/dist/adapters/agents/authentication.js +75 -0
  27. package/dist/adapters/agents/authentication.js.map +1 -0
  28. package/dist/adapters/agents/authentication.types.d.ts +20 -0
  29. package/dist/adapters/agents/authentication.types.js +2 -0
  30. package/dist/adapters/agents/authentication.types.js.map +1 -0
  31. package/dist/adapters/agents/claude-adapter.d.ts +2 -2
  32. package/dist/adapters/agents/claude-adapter.js +32 -2
  33. package/dist/adapters/agents/claude-adapter.js.map +1 -1
  34. package/dist/adapters/agents/claude-authentication.d.ts +2 -0
  35. package/dist/adapters/agents/claude-authentication.js +34 -0
  36. package/dist/adapters/agents/claude-authentication.js.map +1 -0
  37. package/dist/adapters/agents/claude-request.d.ts +2 -2
  38. package/dist/adapters/agents/claude-request.js +3 -3
  39. package/dist/adapters/agents/claude-request.js.map +1 -1
  40. package/dist/adapters/agents/cli-diagnostics.constants.d.ts +6 -6
  41. package/dist/adapters/agents/cli-diagnostics.constants.js +6 -6
  42. package/dist/adapters/agents/cli-diagnostics.constants.js.map +1 -1
  43. package/dist/adapters/agents/cli-diagnostics.d.ts +1 -0
  44. package/dist/adapters/agents/cli-diagnostics.js +11 -0
  45. package/dist/adapters/agents/cli-diagnostics.js.map +1 -1
  46. package/dist/adapters/agents/codex-adapter.d.ts +2 -2
  47. package/dist/adapters/agents/codex-adapter.js +19 -1
  48. package/dist/adapters/agents/codex-adapter.js.map +1 -1
  49. package/dist/adapters/agents/codex-authentication.d.ts +3 -0
  50. package/dist/adapters/agents/codex-authentication.js +47 -0
  51. package/dist/adapters/agents/codex-authentication.js.map +1 -0
  52. package/dist/adapters/agents/codex-provider.d.ts +2 -2
  53. package/dist/adapters/agents/codex-provider.js +1 -1
  54. package/dist/adapters/agents/codex-provider.js.map +1 -1
  55. package/dist/adapters/agents/codex-request.d.ts +2 -2
  56. package/dist/adapters/agents/codex-request.js +3 -3
  57. package/dist/adapters/agents/codex-request.js.map +1 -1
  58. package/dist/adapters/agents/copilot-adapter.d.ts +3 -0
  59. package/dist/adapters/agents/copilot-adapter.js +39 -0
  60. package/dist/adapters/agents/copilot-adapter.js.map +1 -0
  61. package/dist/adapters/agents/copilot-authentication.d.ts +2 -0
  62. package/dist/adapters/agents/copilot-authentication.js +45 -0
  63. package/dist/adapters/agents/copilot-authentication.js.map +1 -0
  64. package/dist/adapters/agents/copilot-diagnostics.d.ts +1 -0
  65. package/dist/adapters/agents/copilot-diagnostics.js +6 -0
  66. package/dist/adapters/agents/copilot-diagnostics.js.map +1 -0
  67. package/dist/adapters/agents/copilot-events.d.ts +2 -0
  68. package/dist/adapters/agents/copilot-events.js +50 -0
  69. package/dist/adapters/agents/copilot-events.js.map +1 -0
  70. package/dist/adapters/agents/copilot-request.d.ts +5 -0
  71. package/dist/adapters/agents/copilot-request.js +19 -0
  72. package/dist/adapters/agents/copilot-request.js.map +1 -0
  73. package/dist/adapters/agents/copilot.types.d.ts +6 -0
  74. package/dist/adapters/agents/copilot.types.js +2 -0
  75. package/dist/adapters/agents/copilot.types.js.map +1 -0
  76. package/dist/adapters/agents/event-decoder.d.ts +2 -2
  77. package/dist/adapters/agents/event-decoder.js +6 -5
  78. package/dist/adapters/agents/event-decoder.js.map +1 -1
  79. package/dist/adapters/agents/kimi-adapter.d.ts +3 -0
  80. package/dist/adapters/agents/kimi-adapter.js +35 -0
  81. package/dist/adapters/agents/kimi-adapter.js.map +1 -0
  82. package/dist/adapters/agents/kimi-authentication.d.ts +2 -0
  83. package/dist/adapters/agents/kimi-authentication.js +48 -0
  84. package/dist/adapters/agents/kimi-authentication.js.map +1 -0
  85. package/dist/adapters/agents/kimi-diagnostics.d.ts +1 -0
  86. package/dist/adapters/agents/kimi-diagnostics.js +6 -0
  87. package/dist/adapters/agents/kimi-diagnostics.js.map +1 -0
  88. package/dist/adapters/agents/kimi-events.d.ts +2 -0
  89. package/dist/adapters/agents/kimi-events.js +51 -0
  90. package/dist/adapters/agents/kimi-events.js.map +1 -0
  91. package/dist/adapters/agents/kimi-request.d.ts +5 -0
  92. package/dist/adapters/agents/kimi-request.js +28 -0
  93. package/dist/adapters/agents/kimi-request.js.map +1 -0
  94. package/dist/adapters/agents/kimi.types.d.ts +6 -0
  95. package/dist/adapters/agents/kimi.types.js +2 -0
  96. package/dist/adapters/agents/kimi.types.js.map +1 -0
  97. package/dist/adapters/agents/model-support.constants.d.ts +8 -0
  98. package/dist/adapters/agents/model-support.constants.js +28 -0
  99. package/dist/adapters/agents/model-support.constants.js.map +1 -0
  100. package/dist/adapters/agents/model-support.d.ts +4 -0
  101. package/dist/adapters/agents/model-support.js +11 -0
  102. package/dist/adapters/agents/model-support.js.map +1 -0
  103. package/dist/adapters/agents/protocol-fixtures.constants.d.ts +2 -2
  104. package/dist/adapters/agents/protocol-fixtures.constants.js +135 -9
  105. package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -1
  106. package/dist/adapters/agents/protocol-fixtures.types.d.ts +1 -0
  107. package/dist/adapters/agents/protocol-fixtures.types.js.map +1 -1
  108. package/dist/adapters/agents/protocol.d.ts +1 -0
  109. package/dist/adapters/agents/protocol.js +9 -0
  110. package/dist/adapters/agents/protocol.js.map +1 -1
  111. package/dist/adapters/agents/settings.types.d.ts +11 -3
  112. package/dist/adapters/agents/settings.types.js.map +1 -1
  113. package/dist/adapters/models/anthropic-model-provider.constants.d.ts +3 -0
  114. package/dist/adapters/models/anthropic-model-provider.constants.js +17 -0
  115. package/dist/adapters/models/anthropic-model-provider.constants.js.map +1 -0
  116. package/dist/adapters/models/anthropic-model-provider.d.ts +3 -0
  117. package/dist/adapters/models/anthropic-model-provider.js +31 -0
  118. package/dist/adapters/models/anthropic-model-provider.js.map +1 -0
  119. package/dist/adapters/models/anthropic-model-provider.types.d.ts +7 -0
  120. package/dist/adapters/models/anthropic-model-provider.types.js +2 -0
  121. package/dist/adapters/models/anthropic-model-provider.types.js.map +1 -0
  122. package/dist/adapters/models/anthropic-request.d.ts +4 -0
  123. package/dist/adapters/models/anthropic-request.js +81 -0
  124. package/dist/adapters/models/anthropic-request.js.map +1 -0
  125. package/dist/adapters/models/anthropic-response.d.ts +3 -0
  126. package/dist/adapters/models/anthropic-response.js +55 -0
  127. package/dist/adapters/models/anthropic-response.js.map +1 -0
  128. package/dist/adapters/models/anthropic-stream.d.ts +2 -0
  129. package/dist/adapters/models/anthropic-stream.js +96 -0
  130. package/dist/adapters/models/anthropic-stream.js.map +1 -0
  131. package/dist/adapters/models/http-provider.d.ts +3 -0
  132. package/dist/adapters/models/http-provider.js +113 -0
  133. package/dist/adapters/models/http-provider.js.map +1 -0
  134. package/dist/adapters/models/{openai-http.js → model-http.js} +1 -1
  135. package/dist/adapters/models/model-http.js.map +1 -0
  136. package/dist/adapters/models/model-protocol.types.d.ts +41 -0
  137. package/dist/adapters/models/model-protocol.types.js +2 -0
  138. package/dist/adapters/models/model-protocol.types.js.map +1 -0
  139. package/dist/adapters/models/model-request.d.ts +2 -0
  140. package/dist/adapters/models/model-request.js +18 -0
  141. package/dist/adapters/models/model-request.js.map +1 -0
  142. package/dist/adapters/models/model-response.d.ts +7 -0
  143. package/dist/adapters/models/model-response.js +41 -0
  144. package/dist/adapters/models/model-response.js.map +1 -0
  145. package/dist/adapters/models/{openai-compatible.constants.js → model.constants.js} +6 -1
  146. package/dist/adapters/models/model.constants.js.map +1 -0
  147. package/dist/adapters/models/openai-chat-stream.d.ts +2 -0
  148. package/dist/adapters/models/openai-chat-stream.js +66 -0
  149. package/dist/adapters/models/openai-chat-stream.js.map +1 -0
  150. package/dist/adapters/models/openai-chat.d.ts +4 -0
  151. package/dist/adapters/models/openai-chat.js +108 -0
  152. package/dist/adapters/models/openai-chat.js.map +1 -0
  153. package/dist/adapters/models/openai-model-provider.d.ts +3 -0
  154. package/dist/adapters/models/openai-model-provider.js +13 -0
  155. package/dist/adapters/models/openai-model-provider.js.map +1 -0
  156. package/dist/adapters/models/openai-model-provider.types.d.ts +4 -0
  157. package/dist/adapters/models/openai-model-provider.types.js +2 -0
  158. package/dist/adapters/models/openai-model-provider.types.js.map +1 -0
  159. package/dist/adapters/models/openai-protocols.d.ts +2 -0
  160. package/dist/adapters/models/openai-protocols.js +22 -0
  161. package/dist/adapters/models/openai-protocols.js.map +1 -0
  162. package/dist/adapters/models/openai-responses-stream.d.ts +2 -0
  163. package/dist/adapters/models/openai-responses-stream.js +35 -0
  164. package/dist/adapters/models/openai-responses-stream.js.map +1 -0
  165. package/dist/adapters/models/openai-responses.d.ts +4 -0
  166. package/dist/adapters/models/openai-responses.js +107 -0
  167. package/dist/adapters/models/openai-responses.js.map +1 -0
  168. package/dist/adapters/models/openai-usage.d.ts +3 -0
  169. package/dist/adapters/models/openai-usage.js +20 -0
  170. package/dist/adapters/models/openai-usage.js.map +1 -0
  171. package/dist/adapters/models/stop-reasons.constants.d.ts +4 -0
  172. package/dist/adapters/models/stop-reasons.constants.js +19 -0
  173. package/dist/adapters/models/stop-reasons.constants.js.map +1 -0
  174. package/dist/adapters/models/stream-events.d.ts +3 -0
  175. package/dist/adapters/models/stream-events.js +22 -0
  176. package/dist/adapters/models/stream-events.js.map +1 -0
  177. package/dist/adapters/tools/edit-tools.d.ts +2 -0
  178. package/dist/adapters/tools/edit-tools.js +84 -0
  179. package/dist/adapters/tools/edit-tools.js.map +1 -0
  180. package/dist/adapters/tools/file-tools.d.ts +2 -0
  181. package/dist/adapters/tools/file-tools.js +97 -0
  182. package/dist/adapters/tools/file-tools.js.map +1 -0
  183. package/dist/adapters/tools/git-tools.d.ts +2 -0
  184. package/dist/adapters/tools/git-tools.js +54 -0
  185. package/dist/adapters/tools/git-tools.js.map +1 -0
  186. package/dist/adapters/tools/sandbox-files.d.ts +10 -0
  187. package/dist/adapters/tools/sandbox-files.js +60 -0
  188. package/dist/adapters/tools/sandbox-files.js.map +1 -0
  189. package/dist/adapters/tools/search-tools.d.ts +2 -0
  190. package/dist/adapters/tools/search-tools.js +65 -0
  191. package/dist/adapters/tools/search-tools.js.map +1 -0
  192. package/dist/adapters/tools/shell-tools.d.ts +3 -0
  193. package/dist/adapters/tools/shell-tools.js +38 -0
  194. package/dist/adapters/tools/shell-tools.js.map +1 -0
  195. package/dist/adapters/tools/tools.constants.d.ts +11 -0
  196. package/dist/adapters/tools/tools.constants.js +17 -0
  197. package/dist/adapters/tools/tools.constants.js.map +1 -0
  198. package/dist/adapters/tools/tools.types.d.ts +41 -0
  199. package/dist/adapters/tools/tools.types.js +2 -0
  200. package/dist/adapters/tools/tools.types.js.map +1 -0
  201. package/dist/application/activity-watchdog.js +15 -2
  202. package/dist/application/activity-watchdog.js.map +1 -1
  203. package/dist/application/agent-authentication.d.ts +4 -0
  204. package/dist/application/agent-authentication.js +32 -0
  205. package/dist/application/agent-authentication.js.map +1 -0
  206. package/dist/application/agent-bootstrap.constants.d.ts +2 -5
  207. package/dist/application/agent-bootstrap.constants.js +29 -4
  208. package/dist/application/agent-bootstrap.constants.js.map +1 -1
  209. package/dist/application/agent-bootstrap.d.ts +2 -2
  210. package/dist/application/agent-bootstrap.js +35 -12
  211. package/dist/application/agent-bootstrap.js.map +1 -1
  212. package/dist/application/agent-bootstrap.types.d.ts +20 -0
  213. package/dist/application/agent-bootstrap.types.js +2 -0
  214. package/dist/application/agent-bootstrap.types.js.map +1 -0
  215. package/dist/application/agent-storage.d.ts +3 -2
  216. package/dist/application/agent-storage.js +9 -2
  217. package/dist/application/agent-storage.js.map +1 -1
  218. package/dist/application/agent-turn.d.ts +3 -3
  219. package/dist/application/agent-turn.js +7 -1
  220. package/dist/application/agent-turn.js.map +1 -1
  221. package/dist/application/attach.js +1 -0
  222. package/dist/application/attach.js.map +1 -1
  223. package/dist/application/credential-installer.constants.d.ts +1 -0
  224. package/dist/application/credential-installer.constants.js +22 -0
  225. package/dist/application/credential-installer.constants.js.map +1 -0
  226. package/dist/application/custom-turn.d.ts +5 -0
  227. package/dist/application/custom-turn.js +190 -0
  228. package/dist/application/custom-turn.js.map +1 -0
  229. package/dist/application/dispatch-observation.d.ts +3 -0
  230. package/dist/application/dispatch-observation.js +51 -0
  231. package/dist/application/dispatch-observation.js.map +1 -0
  232. package/dist/application/dispatch-observation.types.d.ts +5 -0
  233. package/dist/application/dispatch-observation.types.js +2 -0
  234. package/dist/application/dispatch-observation.types.js.map +1 -0
  235. package/dist/application/dispatch-validation.d.ts +2 -2
  236. package/dist/application/dispatch-validation.js.map +1 -1
  237. package/dist/application/dispatch.js +8 -3
  238. package/dist/application/dispatch.js.map +1 -1
  239. package/dist/application/doctor-agent.constants.d.ts +2 -8
  240. package/dist/application/doctor-agent.constants.js +40 -6
  241. package/dist/application/doctor-agent.constants.js.map +1 -1
  242. package/dist/application/doctor-agent.d.ts +2 -1
  243. package/dist/application/doctor-agent.js +11 -3
  244. package/dist/application/doctor-agent.js.map +1 -1
  245. package/dist/application/doctor-image.js +7 -9
  246. package/dist/application/doctor-image.js.map +1 -1
  247. package/dist/application/doctor-protocol.js +6 -6
  248. package/dist/application/doctor-protocol.js.map +1 -1
  249. package/dist/application/doctor-protocol.types.d.ts +1 -1
  250. package/dist/application/doctor-protocol.types.js.map +1 -1
  251. package/dist/application/doctor-sandbox.js +6 -9
  252. package/dist/application/doctor-sandbox.js.map +1 -1
  253. package/dist/application/doctor-sandbox.types.d.ts +2 -2
  254. package/dist/application/doctor-sandbox.types.js.map +1 -1
  255. package/dist/application/doctor.constants.d.ts +1 -1
  256. package/dist/application/doctor.constants.js +1 -1
  257. package/dist/application/doctor.constants.js.map +1 -1
  258. package/dist/application/doctor.js +12 -13
  259. package/dist/application/doctor.js.map +1 -1
  260. package/dist/application/doctor.types.d.ts +12 -4
  261. package/dist/application/doctor.types.js.map +1 -1
  262. package/dist/application/execution.d.ts +2 -2
  263. package/dist/application/execution.js +1 -1
  264. package/dist/application/execution.js.map +1 -1
  265. package/dist/application/execution.types.d.ts +9 -2
  266. package/dist/application/execution.types.js.map +1 -1
  267. package/dist/application/harness-context.d.ts +2 -0
  268. package/dist/application/harness-context.js +54 -0
  269. package/dist/application/harness-context.js.map +1 -0
  270. package/dist/application/harness-history.d.ts +3 -0
  271. package/dist/application/harness-history.js +17 -0
  272. package/dist/application/harness-history.js.map +1 -0
  273. package/dist/application/harness-hooks.d.ts +9 -0
  274. package/dist/application/harness-hooks.js +90 -0
  275. package/dist/application/harness-hooks.js.map +1 -0
  276. package/dist/application/harness-loop.d.ts +2 -0
  277. package/dist/application/harness-loop.js +132 -0
  278. package/dist/application/harness-loop.js.map +1 -0
  279. package/dist/application/harness.types.d.ts +55 -0
  280. package/dist/application/harness.types.js +2 -0
  281. package/dist/application/harness.types.js.map +1 -0
  282. package/dist/application/lifecycle.constants.d.ts +1 -1
  283. package/dist/application/lifecycle.constants.js +1 -1
  284. package/dist/application/lifecycle.constants.js.map +1 -1
  285. package/dist/application/outpost.types.d.ts +6 -7
  286. package/dist/application/outpost.types.js.map +1 -1
  287. package/dist/application/recovery-retention.js +65 -24
  288. package/dist/application/recovery-retention.js.map +1 -1
  289. package/dist/application/remote-download.js +1 -1
  290. package/dist/application/remote-download.js.map +1 -1
  291. package/dist/application/sandbox-agents.js +14 -5
  292. package/dist/application/sandbox-agents.js.map +1 -1
  293. package/dist/application/sandbox-attach.js +5 -2
  294. package/dist/application/sandbox-attach.js.map +1 -1
  295. package/dist/application/sandbox-dispatch.js +3 -5
  296. package/dist/application/sandbox-dispatch.js.map +1 -1
  297. package/dist/application/sandbox-provision.js +13 -10
  298. package/dist/application/sandbox-provision.js.map +1 -1
  299. package/dist/application/sandbox-session.types.d.ts +13 -8
  300. package/dist/application/sandbox-session.types.js.map +1 -1
  301. package/dist/application/sandbox.js +6 -3
  302. package/dist/application/sandbox.js.map +1 -1
  303. package/dist/application/speculation.js +1 -1
  304. package/dist/application/speculation.js.map +1 -1
  305. package/dist/application/speculation.types.d.ts +3 -3
  306. package/dist/application/speculation.types.js.map +1 -1
  307. package/dist/application/startup-recovery.js +1 -1
  308. package/dist/application/startup-recovery.js.map +1 -1
  309. package/dist/application/storage-reservation.js +9 -2
  310. package/dist/application/storage-reservation.js.map +1 -1
  311. package/dist/application/tasks.types.d.ts +2 -2
  312. package/dist/application/tasks.types.js.map +1 -1
  313. package/dist/application/tool-execution.d.ts +3 -0
  314. package/dist/application/tool-execution.js +211 -0
  315. package/dist/application/tool-execution.js.map +1 -0
  316. package/dist/cli/commands.js +4 -2
  317. package/dist/cli/commands.js.map +1 -1
  318. package/dist/cli/doctor-command.js +11 -7
  319. package/dist/cli/doctor-command.js.map +1 -1
  320. package/dist/cli/init-authentication.d.ts +4 -1
  321. package/dist/cli/init-authentication.js +28 -34
  322. package/dist/cli/init-authentication.js.map +1 -1
  323. package/dist/cli/init-command.js +6 -6
  324. package/dist/cli/init-command.js.map +1 -1
  325. package/dist/cli/main.constants.d.ts +54 -17
  326. package/dist/cli/main.constants.js +74 -12
  327. package/dist/cli/main.constants.js.map +1 -1
  328. package/dist/cli/recovery-command.js +1 -1
  329. package/dist/cli/recovery-command.js.map +1 -1
  330. package/dist/cli/scaffold-files.js +6 -5
  331. package/dist/cli/scaffold-files.js.map +1 -1
  332. package/dist/cli/scaffold-validation.js +26 -16
  333. package/dist/cli/scaffold-validation.js.map +1 -1
  334. package/dist/cli/scaffold.constants.d.ts +0 -1
  335. package/dist/cli/scaffold.constants.js +5 -2
  336. package/dist/cli/scaffold.constants.js.map +1 -1
  337. package/dist/cli/scaffold.js +8 -4
  338. package/dist/cli/scaffold.js.map +1 -1
  339. package/dist/cli/scaffold.types.d.ts +9 -3
  340. package/dist/cli/scaffold.types.js.map +1 -1
  341. package/dist/cli/starters.js +8 -10
  342. package/dist/cli/starters.js.map +1 -1
  343. package/dist/domain/agent-model.d.ts +3 -0
  344. package/dist/domain/agent-model.js +22 -0
  345. package/dist/domain/agent-model.js.map +1 -0
  346. package/dist/domain/agent.d.ts +4 -0
  347. package/dist/domain/agent.js +32 -0
  348. package/dist/domain/agent.js.map +1 -0
  349. package/dist/domain/agent.types.d.ts +105 -2
  350. package/dist/domain/agent.types.js.map +1 -1
  351. package/dist/domain/authentication.constants.d.ts +3 -0
  352. package/dist/domain/authentication.constants.js +11 -0
  353. package/dist/domain/authentication.constants.js.map +1 -0
  354. package/dist/domain/authentication.d.ts +3 -0
  355. package/dist/domain/authentication.js +22 -0
  356. package/dist/domain/authentication.js.map +1 -0
  357. package/dist/domain/authentication.types.d.ts +5 -0
  358. package/dist/domain/authentication.types.js +2 -0
  359. package/dist/domain/authentication.types.js.map +1 -0
  360. package/dist/domain/context.constants.d.ts +7 -0
  361. package/dist/domain/context.constants.js +8 -0
  362. package/dist/domain/context.constants.js.map +1 -0
  363. package/dist/domain/context.d.ts +4 -0
  364. package/dist/domain/context.js +81 -0
  365. package/dist/domain/context.js.map +1 -0
  366. package/dist/domain/context.types.d.ts +26 -0
  367. package/dist/domain/context.types.js +2 -0
  368. package/dist/domain/context.types.js.map +1 -0
  369. package/dist/domain/dispatch-telemetry.types.d.ts +12 -0
  370. package/dist/domain/dispatch-telemetry.types.js +2 -0
  371. package/dist/domain/dispatch-telemetry.types.js.map +1 -0
  372. package/dist/domain/errors.types.d.ts +1 -1
  373. package/dist/domain/errors.types.js.map +1 -1
  374. package/dist/domain/glob.d.ts +2 -0
  375. package/dist/domain/glob.js +25 -0
  376. package/dist/domain/glob.js.map +1 -0
  377. package/dist/domain/glob.types.d.ts +1 -0
  378. package/dist/domain/glob.types.js +2 -0
  379. package/dist/domain/glob.types.js.map +1 -0
  380. package/dist/domain/harness.constants.d.ts +11 -0
  381. package/dist/domain/harness.constants.js +24 -0
  382. package/dist/domain/harness.constants.js.map +1 -0
  383. package/dist/domain/harness.d.ts +2 -0
  384. package/dist/domain/harness.js +89 -0
  385. package/dist/domain/harness.js.map +1 -0
  386. package/dist/domain/harness.types.d.ts +60 -0
  387. package/dist/domain/harness.types.js +2 -0
  388. package/dist/domain/harness.types.js.map +1 -0
  389. package/dist/domain/hook.constants.d.ts +3 -0
  390. package/dist/domain/hook.constants.js +10 -0
  391. package/dist/domain/hook.constants.js.map +1 -0
  392. package/dist/domain/hook.d.ts +3 -0
  393. package/dist/domain/hook.js +25 -0
  394. package/dist/domain/hook.js.map +1 -0
  395. package/dist/domain/hook.types.d.ts +66 -0
  396. package/dist/domain/hook.types.js +2 -0
  397. package/dist/domain/hook.types.js.map +1 -0
  398. package/dist/domain/instructions.d.ts +3 -0
  399. package/dist/domain/instructions.js +25 -0
  400. package/dist/domain/instructions.js.map +1 -0
  401. package/dist/domain/model-messages.d.ts +5 -0
  402. package/dist/domain/model-messages.js +81 -0
  403. package/dist/domain/model-messages.js.map +1 -0
  404. package/dist/domain/model-messages.types.d.ts +6 -0
  405. package/dist/domain/model-messages.types.js +2 -0
  406. package/dist/domain/model-messages.types.js.map +1 -0
  407. package/dist/domain/model.constants.d.ts +4 -0
  408. package/dist/domain/model.constants.js +16 -0
  409. package/dist/domain/model.constants.js.map +1 -0
  410. package/dist/domain/model.types.d.ts +59 -2
  411. package/dist/domain/model.types.js.map +1 -1
  412. package/dist/domain/permissions.d.ts +3 -0
  413. package/dist/domain/permissions.js +92 -0
  414. package/dist/domain/permissions.js.map +1 -0
  415. package/dist/domain/permissions.types.d.ts +34 -0
  416. package/dist/domain/permissions.types.js +2 -0
  417. package/dist/domain/permissions.types.js.map +1 -0
  418. package/dist/domain/response.js +3 -2
  419. package/dist/domain/response.js.map +1 -1
  420. package/dist/domain/response.types.d.ts +12 -0
  421. package/dist/domain/response.types.js.map +1 -1
  422. package/dist/domain/skill.constants.d.ts +2 -0
  423. package/dist/domain/skill.constants.js +8 -0
  424. package/dist/domain/skill.constants.js.map +1 -0
  425. package/dist/domain/skill.d.ts +8 -0
  426. package/dist/domain/skill.js +79 -0
  427. package/dist/domain/skill.js.map +1 -0
  428. package/dist/domain/skill.types.d.ts +18 -0
  429. package/dist/domain/skill.types.js +2 -0
  430. package/dist/domain/skill.types.js.map +1 -0
  431. package/dist/domain/standard-schema.d.ts +6 -0
  432. package/dist/domain/standard-schema.js +45 -0
  433. package/dist/domain/standard-schema.js.map +1 -0
  434. package/dist/domain/tool-schema.d.ts +3 -0
  435. package/dist/domain/tool-schema.js +109 -0
  436. package/dist/domain/tool-schema.js.map +1 -0
  437. package/dist/domain/tool.constants.d.ts +4 -0
  438. package/dist/domain/tool.constants.js +36 -0
  439. package/dist/domain/tool.constants.js.map +1 -0
  440. package/dist/domain/tool.d.ts +4 -0
  441. package/dist/domain/tool.js +66 -0
  442. package/dist/domain/tool.js.map +1 -0
  443. package/dist/domain/tool.types.d.ts +62 -0
  444. package/dist/domain/tool.types.js +2 -0
  445. package/dist/domain/tool.types.js.map +1 -0
  446. package/dist/domain/transcript.d.ts +4 -0
  447. package/dist/domain/transcript.js +48 -0
  448. package/dist/domain/transcript.js.map +1 -0
  449. package/dist/domain/transcript.types.d.ts +15 -0
  450. package/dist/domain/transcript.types.js +2 -0
  451. package/dist/domain/transcript.types.js.map +1 -0
  452. package/dist/domain/workflow/workflow-state.js +13 -6
  453. package/dist/domain/workflow/workflow-state.js.map +1 -1
  454. package/dist/domain/workflow.d.ts +1 -1
  455. package/dist/domain/workflow.js.map +1 -1
  456. package/dist/domain/workflow.types.d.ts +4 -0
  457. package/dist/domain/workflow.types.js.map +1 -1
  458. package/dist/index.d.ts +35 -13
  459. package/dist/index.js +19 -6
  460. package/dist/index.js.map +1 -1
  461. package/dist/infrastructure/conversations/harness-store.d.ts +3 -0
  462. package/dist/infrastructure/conversations/harness-store.js +27 -0
  463. package/dist/infrastructure/conversations/harness-store.js.map +1 -0
  464. package/dist/infrastructure/conversations/harness-transcript.d.ts +2 -0
  465. package/dist/infrastructure/conversations/harness-transcript.js +50 -0
  466. package/dist/infrastructure/conversations/harness-transcript.js.map +1 -0
  467. package/dist/infrastructure/conversations/harness-transcript.types.d.ts +18 -0
  468. package/dist/infrastructure/conversations/harness-transcript.types.js +2 -0
  469. package/dist/infrastructure/conversations/harness-transcript.types.js.map +1 -0
  470. package/dist/infrastructure/conversations.d.ts +4 -1
  471. package/dist/infrastructure/conversations.js +3 -0
  472. package/dist/infrastructure/conversations.js.map +1 -1
  473. package/dist/infrastructure/conversations.types.d.ts +1 -0
  474. package/dist/infrastructure/conversations.types.js.map +1 -1
  475. package/dist/infrastructure/custom-reporter.d.ts +2 -0
  476. package/dist/infrastructure/custom-reporter.js +33 -0
  477. package/dist/infrastructure/custom-reporter.js.map +1 -0
  478. package/dist/infrastructure/custom-reporter.types.d.ts +13 -0
  479. package/dist/infrastructure/custom-reporter.types.js +2 -0
  480. package/dist/infrastructure/custom-reporter.types.js.map +1 -0
  481. package/dist/infrastructure/git/git.constants.d.ts +1 -1
  482. package/dist/infrastructure/git/git.constants.js +2 -0
  483. package/dist/infrastructure/git/git.constants.js.map +1 -1
  484. package/dist/infrastructure/host-credentials.constants.d.ts +1 -0
  485. package/dist/infrastructure/host-credentials.constants.js +2 -0
  486. package/dist/infrastructure/host-credentials.constants.js.map +1 -0
  487. package/dist/infrastructure/host-credentials.d.ts +4 -0
  488. package/dist/infrastructure/host-credentials.js +89 -0
  489. package/dist/infrastructure/host-credentials.js.map +1 -0
  490. package/dist/infrastructure/inspection-path.js +4 -3
  491. package/dist/infrastructure/inspection-path.js.map +1 -1
  492. package/dist/infrastructure/journal.constants.d.ts +1 -0
  493. package/dist/infrastructure/journal.constants.js +2 -0
  494. package/dist/infrastructure/journal.constants.js.map +1 -0
  495. package/dist/infrastructure/journal.js +7 -71
  496. package/dist/infrastructure/journal.js.map +1 -1
  497. package/dist/infrastructure/journal.types.d.ts +0 -2
  498. package/dist/infrastructure/journal.types.js.map +1 -1
  499. package/dist/infrastructure/local-transport.js +9 -4
  500. package/dist/infrastructure/local-transport.js.map +1 -1
  501. package/dist/infrastructure/opentelemetry-dispatch.d.ts +6 -0
  502. package/dist/infrastructure/opentelemetry-dispatch.js +70 -0
  503. package/dist/infrastructure/opentelemetry-dispatch.js.map +1 -0
  504. package/dist/infrastructure/opentelemetry.constants.d.ts +3 -0
  505. package/dist/infrastructure/opentelemetry.constants.js +3 -0
  506. package/dist/infrastructure/opentelemetry.constants.js.map +1 -1
  507. package/dist/infrastructure/opentelemetry.js +4 -0
  508. package/dist/infrastructure/opentelemetry.js.map +1 -1
  509. package/dist/infrastructure/opentelemetry.types.d.ts +3 -3
  510. package/dist/infrastructure/opentelemetry.types.js.map +1 -1
  511. package/dist/infrastructure/reporter.js +27 -2
  512. package/dist/infrastructure/reporter.js.map +1 -1
  513. package/dist/infrastructure/repository-transport.constants.d.ts +1 -0
  514. package/dist/infrastructure/repository-transport.constants.js +2 -0
  515. package/dist/infrastructure/repository-transport.constants.js.map +1 -0
  516. package/dist/infrastructure/repository-transport.d.ts +2 -0
  517. package/dist/infrastructure/repository-transport.js +9 -0
  518. package/dist/infrastructure/repository-transport.js.map +1 -0
  519. package/dist/infrastructure/resource-activity-inspection.js +22 -26
  520. package/dist/infrastructure/resource-activity-inspection.js.map +1 -1
  521. package/dist/infrastructure/resource-activity.constants.d.ts +0 -1
  522. package/dist/infrastructure/resource-activity.constants.js +0 -1
  523. package/dist/infrastructure/resource-activity.constants.js.map +1 -1
  524. package/dist/infrastructure/resource-activity.js +22 -85
  525. package/dist/infrastructure/resource-activity.js.map +1 -1
  526. package/dist/infrastructure/resource-activity.types.d.ts +2 -2
  527. package/dist/infrastructure/resource-activity.types.js.map +1 -1
  528. package/dist/infrastructure/settings.d.ts +1 -1
  529. package/dist/infrastructure/settings.js +3 -3
  530. package/dist/infrastructure/settings.js.map +1 -1
  531. package/dist/infrastructure/sse.d.ts +2 -0
  532. package/dist/infrastructure/sse.js +64 -0
  533. package/dist/infrastructure/sse.js.map +1 -0
  534. package/dist/infrastructure/sse.types.d.ts +4 -0
  535. package/dist/infrastructure/sse.types.js +2 -0
  536. package/dist/infrastructure/sse.types.js.map +1 -0
  537. package/dist/infrastructure/storage-inventory.constants.js +1 -0
  538. package/dist/infrastructure/storage-inventory.constants.js.map +1 -1
  539. package/dist/infrastructure/storage-inventory.types.d.ts +1 -1
  540. package/dist/infrastructure/storage-inventory.types.js.map +1 -1
  541. package/dist/infrastructure/storage-reservations.types.d.ts +0 -8
  542. package/dist/infrastructure/storage-reservations.types.js.map +1 -1
  543. package/dist/infrastructure/transport-conversations.d.ts +2 -2
  544. package/dist/infrastructure/transport-conversations.js +8 -1
  545. package/dist/infrastructure/transport-conversations.js.map +1 -1
  546. package/dist/infrastructure/transport-journal.js +2 -1
  547. package/dist/infrastructure/transport-journal.js.map +1 -1
  548. package/dist/infrastructure/transport-reservations.d.ts +1 -1
  549. package/dist/infrastructure/transport-reservations.js +14 -8
  550. package/dist/infrastructure/transport-reservations.js.map +1 -1
  551. package/dist/providers/agents.d.ts +9 -4
  552. package/dist/providers/agents.js +6 -3
  553. package/dist/providers/agents.js.map +1 -1
  554. package/dist/providers/daytona.d.ts +1 -1
  555. package/dist/providers/daytona.js +1 -1
  556. package/dist/providers/daytona.js.map +1 -1
  557. package/dist/providers/docker.d.ts +1 -1
  558. package/dist/providers/docker.js +1 -1
  559. package/dist/providers/docker.js.map +1 -1
  560. package/dist/providers/factories.d.ts +2 -2
  561. package/dist/providers/factories.js +3 -3
  562. package/dist/providers/factories.js.map +1 -1
  563. package/dist/providers/firecracker.d.ts +1 -1
  564. package/dist/providers/firecracker.js +1 -1
  565. package/dist/providers/firecracker.js.map +1 -1
  566. package/dist/providers/local.d.ts +1 -1
  567. package/dist/providers/local.js +1 -1
  568. package/dist/providers/local.js.map +1 -1
  569. package/dist/providers/podman.d.ts +1 -1
  570. package/dist/providers/podman.js +1 -1
  571. package/dist/providers/podman.js.map +1 -1
  572. package/dist/providers/vercel.d.ts +1 -1
  573. package/dist/providers/vercel.js +1 -1
  574. package/dist/providers/vercel.js.map +1 -1
  575. package/dist/providers/versions.constants.d.ts +3 -1
  576. package/dist/providers/versions.constants.js +3 -1
  577. package/dist/providers/versions.constants.js.map +1 -1
  578. package/package.json +3 -3
  579. package/dist/adapters/agents/gemini-adapter.d.ts +0 -3
  580. package/dist/adapters/agents/gemini-adapter.js +0 -15
  581. package/dist/adapters/agents/gemini-adapter.js.map +0 -1
  582. package/dist/adapters/agents/gemini-diagnostics.d.ts +0 -2
  583. package/dist/adapters/agents/gemini-diagnostics.js +0 -15
  584. package/dist/adapters/agents/gemini-diagnostics.js.map +0 -1
  585. package/dist/adapters/agents/gemini-events.d.ts +0 -2
  586. package/dist/adapters/agents/gemini-events.js +0 -50
  587. package/dist/adapters/agents/gemini-events.js.map +0 -1
  588. package/dist/adapters/agents/gemini-request.d.ts +0 -4
  589. package/dist/adapters/agents/gemini-request.js +0 -23
  590. package/dist/adapters/agents/gemini-request.js.map +0 -1
  591. package/dist/adapters/agents/gemini.types.d.ts +0 -6
  592. package/dist/adapters/agents/gemini.types.js +0 -2
  593. package/dist/adapters/agents/gemini.types.js.map +0 -1
  594. package/dist/adapters/models/openai-compatible.constants.js.map +0 -1
  595. package/dist/adapters/models/openai-compatible.d.ts +0 -3
  596. package/dist/adapters/models/openai-compatible.js +0 -78
  597. package/dist/adapters/models/openai-compatible.js.map +0 -1
  598. package/dist/adapters/models/openai-compatible.types.d.ts +0 -14
  599. package/dist/adapters/models/openai-compatible.types.js +0 -2
  600. package/dist/adapters/models/openai-compatible.types.js.map +0 -1
  601. package/dist/adapters/models/openai-http.js.map +0 -1
  602. package/dist/adapters/models/openai-request.d.ts +0 -4
  603. package/dist/adapters/models/openai-request.js +0 -46
  604. package/dist/adapters/models/openai-request.js.map +0 -1
  605. package/dist/adapters/models/openai-response.d.ts +0 -3
  606. package/dist/adapters/models/openai-response.js +0 -65
  607. package/dist/adapters/models/openai-response.js.map +0 -1
  608. package/dist/cli/init-authentication.constants.d.ts +0 -13
  609. package/dist/cli/init-authentication.constants.js +0 -10
  610. package/dist/cli/init-authentication.constants.js.map +0 -1
  611. package/dist/infrastructure/artifact-store.d.ts +0 -3
  612. package/dist/infrastructure/artifact-store.js +0 -110
  613. package/dist/infrastructure/artifact-store.js.map +0 -1
  614. package/dist/infrastructure/artifact-store.types.d.ts +0 -6
  615. package/dist/infrastructure/artifact-store.types.js +0 -2
  616. package/dist/infrastructure/artifact-store.types.js.map +0 -1
  617. package/dist/infrastructure/journal-retention.constants.d.ts +0 -4
  618. package/dist/infrastructure/journal-retention.constants.js +0 -5
  619. package/dist/infrastructure/journal-retention.constants.js.map +0 -1
  620. package/dist/infrastructure/journal-retention.d.ts +0 -2
  621. package/dist/infrastructure/journal-retention.js +0 -51
  622. package/dist/infrastructure/journal-retention.js.map +0 -1
  623. package/dist/infrastructure/storage-mutation-lock.constants.d.ts +0 -5
  624. package/dist/infrastructure/storage-mutation-lock.constants.js +0 -6
  625. package/dist/infrastructure/storage-mutation-lock.constants.js.map +0 -1
  626. package/dist/infrastructure/storage-mutation-lock.d.ts +0 -1
  627. package/dist/infrastructure/storage-mutation-lock.js +0 -21
  628. package/dist/infrastructure/storage-mutation-lock.js.map +0 -1
  629. package/dist/infrastructure/storage-reservations.constants.d.ts +0 -4
  630. package/dist/infrastructure/storage-reservations.constants.js +0 -5
  631. package/dist/infrastructure/storage-reservations.constants.js.map +0 -1
  632. package/dist/infrastructure/storage-reservations.d.ts +0 -2
  633. package/dist/infrastructure/storage-reservations.js +0 -150
  634. package/dist/infrastructure/storage-reservations.js.map +0 -1
  635. package/dist/infrastructure/workflow-checkpoint.d.ts +0 -3
  636. package/dist/infrastructure/workflow-checkpoint.js +0 -84
  637. package/dist/infrastructure/workflow-checkpoint.js.map +0 -1
  638. package/dist/infrastructure/workflow-checkpoint.types.d.ts +0 -6
  639. package/dist/infrastructure/workflow-checkpoint.types.js +0 -2
  640. package/dist/infrastructure/workflow-checkpoint.types.js.map +0 -1
  641. /package/dist/adapters/models/{openai-http.d.ts → model-http.d.ts} +0 -0
  642. /package/dist/adapters/models/{openai-compatible.constants.d.ts → model.constants.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../src/application/dispatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,MAAM,EA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AAC,KAAK,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,OAAO;YACL,GAAG,MAAM;YACT,GAAG,QAAQ;YACX,MAAM,CAAI,IAA4B;gBACpC,SAAS,CAAC,YAAY,EAAE,6BAA6B,CAAC,CAAC;gBACvD,OAAO,QAAQ,CAAC;oBACd,GAAG,yBAAyB,CAAC,aAAa,EAAE,IAAI,CAAC;oBACjD,GAAG,IAAI;oBACP,YAAY,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE;iBACnC,CAAC,CAAC;YACL,CAAC;YACD,IAAI,CAAI,IAA4B;gBAClC,SAAS,CAAC,YAAY,EAAE,6BAA6B,CAAC,CAAC;gBACvD,OAAO,QAAQ,CAAC;oBACd,GAAG,yBAAyB,CAAC,aAAa,EAAE,IAAI,CAAC;oBACjD,GAAG,IAAI;oBACP,YAAY,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE;iBAC/C,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,EAAE;YACpB,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM;YAChC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,SAAS;SACvC,CAAC,CAAC;QACH,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,UAAU;YAAE,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC","sourcesContent":["import type { RequiredAgent, Usage } from \"../domain/agent.types.ts\";\nimport { invariant, recordRecovery } from \"../domain/errors.ts\";\nimport { addUsage } from \"../domain/usage.ts\";\nimport { storageFor } from \"./agent-storage.ts\";\nimport { continuationConfiguration } from \"./continuation.ts\";\nimport { preflightDispatch } from \"./dispatch-validation.ts\";\nimport { executionDefaults } from \"./execution.constants.ts\";\nimport type { DispatchOptions } from \"./execution.types.ts\";\nimport { notify } from \"./observation.ts\";\nimport type {\n ContinuationOptions,\n DispatchResult,\n SandboxOptions,\n} from \"./outpost.types.ts\";\nimport { createSandbox } from \"./sandbox.ts\";\n\nexport async function dispatch<T = undefined>(\n options: SandboxOptions & DispatchOptions<T> & RequiredAgent,\n): Promise<DispatchResult<T>> {\n options.signal?.throwIfAborted();\n await preflightDispatch(\n options,\n options.workspace?.repository ?? options.repository ?? process.cwd(),\n options.agent,\n );\n if ((options.passes ?? executionDefaults.passes) > 1) {\n const outputs: DispatchResult<T>[] = [];\n for (let index = 0; index < options.passes!; index++) {\n options.signal?.throwIfAborted();\n const output = await dispatch({\n ...options,\n passes: 1,\n observe: (event) =>\n notify(options.observe, { ...event, pass: index + 1 }),\n });\n outputs.push(output);\n if (output.completed) break;\n }\n const last = outputs.at(-1)!;\n return {\n ...last,\n text: outputs.map((output) => output.text).join(\"\\n\"),\n turns: outputs.flatMap((output) => output.turns),\n commits: outputs.flatMap((output) => output.commits),\n usage: outputs.reduce((sum, output) => addUsage(sum, output.usage), {\n input: 0,\n cached: 0,\n output: 0,\n } as Usage),\n };\n }\n if (options.continuation) {\n const storage = storageFor(options.agent);\n invariant(storage, \"This adapter does not support native conversations\");\n await storage.locate(\n options.continuation.id,\n options.workspace?.repository ?? options.repository ?? process.cwd(),\n options.conversationHome,\n );\n }\n const sandbox = await createSandbox(options);\n const {\n brief: _brief,\n response: _response,\n continuation: _continuation,\n passes: _passes,\n ...configuration\n } = options;\n let successful = false;\n try {\n const output = await sandbox.dispatch(options);\n await sandbox.workspace.integrate();\n successful = true;\n const disposed = await sandbox.close();\n const continuation = output.conversation;\n return {\n ...output,\n ...disposed,\n resume<U>(next: ContinuationOptions<U>) {\n invariant(continuation, \"No conversation was emitted\");\n return dispatch({\n ...continuationConfiguration(configuration, next),\n ...next,\n continuation: { id: continuation },\n });\n },\n fork<U>(next: ContinuationOptions<U>) {\n invariant(continuation, \"No conversation was emitted\");\n return dispatch({\n ...continuationConfiguration(configuration, next),\n ...next,\n continuation: { id: continuation, fork: true },\n });\n },\n };\n } catch (cause) {\n recordRecovery(cause, {\n branch: sandbox.workspace.branch,\n directory: sandbox.workspace.directory,\n });\n throw cause;\n } finally {\n if (!successful) await sandbox.close({ preserve: true });\n }\n}\n"]}
1
+ {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../src/application/dispatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM1C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,OAA4D;IAE5D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IAC5D,OAAO,eAAe,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAC3C,iBAAiB,CAAC,EAAE,GAAG,aAAa,EAAE,GAAG,QAAQ,EAAE,EAAE,OAAO,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,iBAAiB,CAC9B,OAA4D,EAC5D,QAA6D;IAE7D,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IACjC,MAAM,iBAAiB,CACrB,OAAO,EACP,OAAO,CAAC,SAA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;oBACd,GAAG,yBAAyB,CAAC,aAAa,EAAE,IAAI,CAAC;oBACjD,GAAG,IAAI;oBACP,YAAY,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE;iBACnC,CAAC,CAAC;YACL,CAAC;YACD,IAAI,CAAI,IAA4B;gBAClC,SAAS,CAAC,YAAY,EAAE,6BAA6B,CAAC,CAAC;gBACvD,OAAO,QAAQ,CAAC;oBACd,GAAG,yBAAyB,CAAC,aAAa,EAAE,IAAI,CAAC;oBACjD,GAAG,IAAI;oBACP,YAAY,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE;iBAC/C,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,EAAE;YACpB,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM;YAChC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,SAAS;SACvC,CAAC,CAAC;QACH,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,UAAU;YAAE,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC","sourcesContent":["import type { RequiredAgent, Usage } from \"../domain/agent.types.ts\";\nimport { invariant, recordRecovery } from \"../domain/errors.ts\";\nimport { addUsage } from \"../domain/usage.ts\";\nimport { storageFor } from \"./agent-storage.ts\";\nimport { continuationConfiguration } from \"./continuation.ts\";\nimport { preflightDispatch } from \"./dispatch-validation.ts\";\nimport { executionDefaults } from \"./execution.constants.ts\";\nimport type { DispatchOptions } from \"./execution.types.ts\";\nimport { notify } from \"./observation.ts\";\nimport type {\n ContinuationOptions,\n DispatchResult,\n SandboxOptions,\n} from \"./outpost.types.ts\";\nimport { observeDispatch } from \"./dispatch-observation.ts\";\nimport { createSandbox } from \"./sandbox.ts\";\n\nexport async function dispatch<T = undefined>(\n options: SandboxOptions & DispatchOptions<T> & RequiredAgent,\n): Promise<DispatchResult<T>> {\n const { telemetry: _telemetry, ...configuration } = options;\n return observeDispatch(options, (observed) =>\n dispatchOperation({ ...configuration, ...observed }, options),\n );\n}\n\nasync function dispatchOperation<T>(\n options: SandboxOptions & DispatchOptions<T> & RequiredAgent,\n original: SandboxOptions & DispatchOptions<T> & RequiredAgent,\n): Promise<DispatchResult<T>> {\n options.signal?.throwIfAborted();\n await preflightDispatch(\n options,\n options.workspace?.repository ?? options.repository ?? process.cwd(),\n options.agent,\n );\n if ((options.passes ?? executionDefaults.passes) > 1) {\n const outputs: DispatchResult<T>[] = [];\n for (let index = 0; index < options.passes!; index++) {\n options.signal?.throwIfAborted();\n const output = await dispatchOperation(\n {\n ...options,\n passes: 1,\n observe: (event) =>\n notify(options.observe, { ...event, pass: index + 1 }),\n },\n original,\n );\n outputs.push(output);\n if (output.completed) break;\n }\n const last = outputs.at(-1)!;\n return {\n ...last,\n text: outputs.map((output) => output.text).join(\"\\n\"),\n turns: outputs.flatMap((output) => output.turns),\n commits: outputs.flatMap((output) => output.commits),\n usage: outputs.reduce((sum, output) => addUsage(sum, output.usage), {\n input: 0,\n cached: 0,\n output: 0,\n } as Usage),\n };\n }\n if (options.continuation) {\n const storage = storageFor(options.agent);\n invariant(storage, \"This adapter does not support native conversations\");\n await storage.locate(\n options.continuation.id,\n options.workspace?.repository ?? options.repository ?? process.cwd(),\n options.conversationHome,\n );\n }\n const sandbox = await createSandbox(options);\n const {\n brief: _brief,\n response: _response,\n continuation: _continuation,\n passes: _passes,\n ...configuration\n } = original;\n let successful = false;\n try {\n const output = await sandbox.dispatch(options);\n await sandbox.workspace.integrate();\n successful = true;\n const disposed = await sandbox.close();\n const continuation = output.conversation;\n return {\n ...output,\n ...disposed,\n resume<U>(next: ContinuationOptions<U>) {\n invariant(continuation, \"No conversation was emitted\");\n return dispatch({\n ...continuationConfiguration(configuration, next),\n ...next,\n continuation: { id: continuation },\n });\n },\n fork<U>(next: ContinuationOptions<U>) {\n invariant(continuation, \"No conversation was emitted\");\n return dispatch({\n ...continuationConfiguration(configuration, next),\n ...next,\n continuation: { id: continuation, fork: true },\n });\n },\n };\n } catch (cause) {\n recordRecovery(cause, {\n branch: sandbox.workspace.branch,\n directory: sandbox.workspace.directory,\n });\n throw cause;\n } finally {\n if (!successful) await sandbox.close({ preserve: true });\n }\n}\n"]}
@@ -1,11 +1,5 @@
1
- import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.ts";
2
- import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.ts";
3
- import { geminiDiagnostics } from "../adapters/agents/gemini-diagnostics.ts";
4
- export declare const agentDiagnosticPlans: {
5
- readonly gemini: typeof geminiDiagnostics;
6
- readonly claude: typeof claudeDiagnostics;
7
- readonly codex: typeof codexDiagnostics;
8
- };
1
+ import type { DoctorAgent, DoctorAgentProfile } from "./doctor.types.ts";
2
+ export declare const doctorAgents: Readonly<Record<DoctorAgent, DoctorAgentProfile>>;
9
3
  export declare const agentDiagnosticDefaults: Readonly<{
10
4
  retain: 65536;
11
5
  }>;
@@ -1,10 +1,44 @@
1
+ import { antigravityHarness } from "../adapters/agents/antigravity-adapter.js";
2
+ import { antigravityDiagnostics } from "../adapters/agents/antigravity-diagnostics.js";
3
+ import { claudeHarness } from "../adapters/agents/claude-adapter.js";
1
4
  import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.js";
5
+ import { codexHarness } from "../adapters/agents/codex-adapter.js";
2
6
  import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.js";
3
- import { geminiDiagnostics } from "../adapters/agents/gemini-diagnostics.js";
4
- export const agentDiagnosticPlans = {
5
- gemini: geminiDiagnostics,
6
- claude: claudeDiagnostics,
7
- codex: codexDiagnostics,
8
- };
7
+ import { copilotHarness } from "../adapters/agents/copilot-adapter.js";
8
+ import { copilotDiagnostics } from "../adapters/agents/copilot-diagnostics.js";
9
+ import { kimiHarness } from "../adapters/agents/kimi-adapter.js";
10
+ import { kimiDiagnostics } from "../adapters/agents/kimi-diagnostics.js";
11
+ import { agentVersions } from "../providers/versions.constants.js";
12
+ export const doctorAgents = Object.freeze({
13
+ codex: {
14
+ executable: "codex",
15
+ referenceVersion: agentVersions.codex,
16
+ diagnostics: codexDiagnostics,
17
+ harness: () => codexHarness(),
18
+ },
19
+ claude: {
20
+ executable: "claude",
21
+ referenceVersion: agentVersions.claude,
22
+ diagnostics: claudeDiagnostics,
23
+ harness: () => claudeHarness(),
24
+ },
25
+ antigravity: {
26
+ executable: "agy",
27
+ diagnostics: antigravityDiagnostics,
28
+ harness: () => antigravityHarness(),
29
+ },
30
+ copilot: {
31
+ executable: "copilot",
32
+ referenceVersion: agentVersions.copilot,
33
+ diagnostics: copilotDiagnostics,
34
+ harness: () => copilotHarness(),
35
+ },
36
+ kimi: {
37
+ executable: "kimi",
38
+ referenceVersion: agentVersions.kimi,
39
+ diagnostics: kimiDiagnostics,
40
+ harness: () => kimiHarness(),
41
+ },
42
+ });
9
43
  export const agentDiagnosticDefaults = Object.freeze({ retain: 65_536 });
10
44
  //# sourceMappingURL=doctor-agent.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-agent.constants.js","sourceRoot":"","sources":["../../src/application/doctor-agent.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,gBAAgB;CACf,CAAC;AACX,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC","sourcesContent":["import { claudeDiagnostics } from \"../adapters/agents/claude-diagnostics.ts\";\nimport { codexDiagnostics } from \"../adapters/agents/codex-diagnostics.ts\";\nimport { geminiDiagnostics } from \"../adapters/agents/gemini-diagnostics.ts\";\n\nexport const agentDiagnosticPlans = {\n gemini: geminiDiagnostics,\n claude: claudeDiagnostics,\n codex: codexDiagnostics,\n} as const;\nexport const agentDiagnosticDefaults = Object.freeze({ retain: 65_536 });\n"]}
1
+ {"version":3,"file":"doctor-agent.constants.js","sourceRoot":"","sources":["../../src/application/doctor-agent.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,MAAM,CAAC,MAAM,YAAY,GACvB,MAAM,CAAC,MAAM,CAAC;IACZ,KAAK,EAAE;QACL,UAAU,EAAE,OAAO;QACnB,gBAAgB,EAAE,aAAa,CAAC,KAAK;QACrC,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE;KAC9B;IACD,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,gBAAgB,EAAE,aAAa,CAAC,MAAM;QACtC,WAAW,EAAE,iBAAiB;QAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE;KAC/B;IACD,WAAW,EAAE;QACX,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,sBAAsB;QACnC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE;KACpC;IACD,OAAO,EAAE;QACP,UAAU,EAAE,SAAS;QACrB,gBAAgB,EAAE,aAAa,CAAC,OAAO;QACvC,WAAW,EAAE,kBAAkB;QAC/B,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE;KAChC;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,gBAAgB,EAAE,aAAa,CAAC,IAAI;QACpC,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE;KAC7B;CACF,CAAC,CAAC;AACL,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC","sourcesContent":["import { antigravityHarness } from \"../adapters/agents/antigravity-adapter.ts\";\nimport { antigravityDiagnostics } from \"../adapters/agents/antigravity-diagnostics.ts\";\nimport { claudeHarness } from \"../adapters/agents/claude-adapter.ts\";\nimport { claudeDiagnostics } from \"../adapters/agents/claude-diagnostics.ts\";\nimport { codexHarness } from \"../adapters/agents/codex-adapter.ts\";\nimport { codexDiagnostics } from \"../adapters/agents/codex-diagnostics.ts\";\nimport { copilotHarness } from \"../adapters/agents/copilot-adapter.ts\";\nimport { copilotDiagnostics } from \"../adapters/agents/copilot-diagnostics.ts\";\nimport { kimiHarness } from \"../adapters/agents/kimi-adapter.ts\";\nimport { kimiDiagnostics } from \"../adapters/agents/kimi-diagnostics.ts\";\nimport { agentVersions } from \"../providers/versions.constants.ts\";\nimport type { DoctorAgent, DoctorAgentProfile } from \"./doctor.types.ts\";\n\nexport const doctorAgents: Readonly<Record<DoctorAgent, DoctorAgentProfile>> =\n Object.freeze({\n codex: {\n executable: \"codex\",\n referenceVersion: agentVersions.codex,\n diagnostics: codexDiagnostics,\n harness: () => codexHarness(),\n },\n claude: {\n executable: \"claude\",\n referenceVersion: agentVersions.claude,\n diagnostics: claudeDiagnostics,\n harness: () => claudeHarness(),\n },\n antigravity: {\n executable: \"agy\",\n diagnostics: antigravityDiagnostics,\n harness: () => antigravityHarness(),\n },\n copilot: {\n executable: \"copilot\",\n referenceVersion: agentVersions.copilot,\n diagnostics: copilotDiagnostics,\n harness: () => copilotHarness(),\n },\n kimi: {\n executable: \"kimi\",\n referenceVersion: agentVersions.kimi,\n diagnostics: kimiDiagnostics,\n harness: () => kimiHarness(),\n },\n });\nexport const agentDiagnosticDefaults = Object.freeze({ retain: 65_536 });\n"]}
@@ -1,3 +1,4 @@
1
1
  import type { Executor } from "../infrastructure/process.types.ts";
2
- import type { DiagnosticCheck, DoctorAgent } from "./doctor.types.ts";
2
+ import type { DiagnosticCheck, DiagnosticProbe, DoctorAgent } from "./doctor.types.ts";
3
+ export declare function agentVersionProbe(agent: DoctorAgent): Pick<DiagnosticProbe, "command" | "readVersion" | "referenceVersion">;
3
4
  export declare function diagnoseAgentCli(agent: DoctorAgent, execute: Executor): Promise<readonly DiagnosticCheck[]>;
@@ -1,9 +1,17 @@
1
1
  import { stripVTControlCharacters } from "node:util";
2
2
  import { diagnosticProbe } from "./diagnostic-probe.js";
3
- import { agentDiagnosticDefaults, agentDiagnosticPlans, } from "./doctor-agent.constants.js";
3
+ import { agentDiagnosticDefaults, doctorAgents, } from "./doctor-agent.constants.js";
4
+ export function agentVersionProbe(agent) {
5
+ const { executable, referenceVersion } = doctorAgents[agent];
6
+ return {
7
+ command: { executable, arguments: ["--version"] },
8
+ readVersion: true,
9
+ ...(referenceVersion === undefined ? {} : { referenceVersion }),
10
+ };
11
+ }
4
12
  export async function diagnoseAgentCli(agent, execute) {
5
13
  const checks = [];
6
- for (const plan of agentDiagnosticPlans[agent]()) {
14
+ for (const plan of doctorAgents[agent].diagnostics()) {
7
15
  let help = "";
8
16
  const check = await diagnosticProbe({
9
17
  id: `agent.cli.${plan.mode}`,
@@ -21,7 +29,7 @@ export async function diagnoseAgentCli(agent, execute) {
21
29
  }
22
30
  const usage = help
23
31
  .split(/\r?\n/)
24
- .some((line) => line.trim().startsWith(`Usage: ${plan.usage} [`));
32
+ .some((line) => line.trim().startsWith(plan.usage));
25
33
  if (!usage) {
26
34
  checks.push({
27
35
  id: check.id,
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-agent.js","sourceRoot":"","sources":["../../src/application/doctor-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAkB,EAClB,OAAiB;IAEjB,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;QACjD,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,MAAM,eAAe,CACjC;YACE,EAAE,EAAE,aAAa,IAAI,CAAC,IAAI,EAAE;YAC5B,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,uBAAuB,CAAC,MAAM,EAAE;YACpE,aAAa,EAAE,MAAM;YACrB,MAAM,EACJ,gGAAgG;SACnG,EACD,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;YACtC,IAAI,GAAG,wBAAwB,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YACtE,OAAO,MAAM,CAAC;QAChB,CAAC,CACF,CAAC;QACF,IAAI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AAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { stripVTControlCharacters } from \"node:util\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport {\n agentDiagnosticDefaults,\n agentDiagnosticPlans,\n} from \"./doctor-agent.constants.ts\";\nimport type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport async function diagnoseAgentCli(\n agent: DoctorAgent,\n execute: Executor,\n): Promise<readonly DiagnosticCheck[]> {\n const checks: DiagnosticCheck[] = [];\n for (const plan of agentDiagnosticPlans[agent]()) {\n let help = \"\";\n const check = await diagnosticProbe(\n {\n id: `agent.cli.${plan.mode}`,\n command: { ...plan.command, retain: agentDiagnosticDefaults.retain },\n failureStatus: \"fail\",\n remedy:\n \"The agent CLI help command failed. Check the agent CLI in this image and rebuild it if needed.\",\n },\n async (command) => {\n const result = await execute(command);\n help = stripVTControlCharacters(`${result.stdout}\\n${result.stderr}`);\n return result;\n },\n );\n if (check.status !== \"pass\") {\n checks.push(check);\n continue;\n }\n const usage = help\n .split(/\\r?\\n/)\n .some((line) => line.trim().startsWith(`Usage: ${plan.usage} [`));\n if (!usage) {\n checks.push({\n id: check.id,\n status: \"warn\",\n message:\n \"Command exited successfully but the expected help could not be identified; CLI support is unverified.\",\n });\n continue;\n }\n const declared = new Set(\n [\n ...help.matchAll(/^\\s*(?:-[A-Za-z0-9?],?\\s+)?(--[A-Za-z][\\w-]*)\\b/gm),\n ].map((match) => match[1]),\n );\n const missing = plan.options.filter((option) => !declared.has(option));\n if (missing.length) {\n checks.push({\n id: check.id,\n status: \"fail\",\n message: `Help does not declare required options: ${missing.join(\", \")}. Rebuild the image with a CLI supporting Outpost's default invocation.`,\n });\n continue;\n }\n checks.push({\n id: check.id,\n status: \"pass\",\n message:\n \"Help identifies the command and declares the options used by Outpost's default invocation. Conversation execution and event decoding are not tested.\",\n });\n }\n return checks;\n}\n"]}
1
+ {"version":3,"file":"doctor-ag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,sJAAsJ;SACzJ,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { stripVTControlCharacters } from \"node:util\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport {\n agentDiagnosticDefaults,\n doctorAgents,\n} from \"./doctor-agent.constants.ts\";\nimport type {\n DiagnosticCheck,\n DiagnosticProbe,\n DoctorAgent,\n} from \"./doctor.types.ts\";\n\nexport function agentVersionProbe(\n agent: DoctorAgent,\n): Pick<DiagnosticProbe, \"command\" | \"readVersion\" | \"referenceVersion\"> {\n const { executable, referenceVersion } = doctorAgents[agent];\n return {\n command: { executable, arguments: [\"--version\"] },\n readVersion: true,\n ...(referenceVersion === undefined ? {} : { referenceVersion }),\n };\n}\n\nexport async function diagnoseAgentCli(\n agent: DoctorAgent,\n execute: Executor,\n): Promise<readonly DiagnosticCheck[]> {\n const checks: DiagnosticCheck[] = [];\n for (const plan of doctorAgents[agent].diagnostics()) {\n let help = \"\";\n const check = await diagnosticProbe(\n {\n id: `agent.cli.${plan.mode}`,\n command: { ...plan.command, retain: agentDiagnosticDefaults.retain },\n failureStatus: \"fail\",\n remedy:\n \"The agent CLI help command failed. Check the agent CLI in this image and rebuild it if needed.\",\n },\n async (command) => {\n const result = await execute(command);\n help = stripVTControlCharacters(`${result.stdout}\\n${result.stderr}`);\n return result;\n },\n );\n if (check.status !== \"pass\") {\n checks.push(check);\n continue;\n }\n const usage = help\n .split(/\\r?\\n/)\n .some((line) => line.trim().startsWith(plan.usage));\n if (!usage) {\n checks.push({\n id: check.id,\n status: \"warn\",\n message:\n \"Command exited successfully but the expected help could not be identified; CLI support is unverified.\",\n });\n continue;\n }\n const declared = new Set(\n [\n ...help.matchAll(/^\\s*(?:-[A-Za-z0-9?],?\\s+)?(--[A-Za-z][\\w-]*)\\b/gm),\n ].map((match) => match[1]),\n );\n const missing = plan.options.filter((option) => !declared.has(option));\n if (missing.length) {\n checks.push({\n id: check.id,\n status: \"fail\",\n message: `Help does not declare required options: ${missing.join(\", \")}. Rebuild the image with a CLI supporting Outpost's default invocation.`,\n });\n continue;\n }\n checks.push({\n id: check.id,\n status: \"pass\",\n message:\n \"Help identifies the command and declares the options used by Outpost's default invocation. Conversation execution and event decoding are not tested.\",\n });\n }\n return checks;\n}\n"]}
@@ -5,8 +5,8 @@ import { OutpostError } from "../domain/errors.js";
5
5
  import { executeProcess } from "../infrastructure/process.js";
6
6
  import { registerCleanup } from "../infrastructure/shutdown.js";
7
7
  import { diagnosticContainer } from "../providers/diagnostic-container.js";
8
- import { agentVersions } from "../providers/versions.constants.js";
9
- import { diagnoseAgentCli } from "./doctor-agent.js";
8
+ import { doctorAgents } from "./doctor-agent.constants.js";
9
+ import { agentVersionProbe, diagnoseAgentCli } from "./doctor-agent.js";
10
10
  import { diagnosticProbe } from "./diagnostic-probe.js";
11
11
  import { doctorDefaults } from "./doctor.constants.js";
12
12
  export async function diagnoseImage(options, execute = executeProcess) {
@@ -23,7 +23,7 @@ export async function diagnoseImage(options, execute = executeProcess) {
23
23
  unregister();
24
24
  }
25
25
  }
26
- async function inspectImage({ provider, agent, image }, execute, signal) {
26
+ async function inspectImage({ sandboxProvider, agent, image }, execute, signal) {
27
27
  const directory = await mkdtemp(join(tmpdir(), "outpost-doctor-"));
28
28
  const checks = [];
29
29
  let lease;
@@ -37,7 +37,7 @@ async function inspectImage({ provider, agent, image }, execute, signal) {
37
37
  return execute(command);
38
38
  };
39
39
  try {
40
- lease = await diagnosticContainer(provider, image, doctorDefaults.deadlineMs, tracked).acquire({
40
+ lease = await diagnosticContainer(sandboxProvider, image, doctorDefaults.deadlineMs, tracked).acquire({
41
41
  repository: directory,
42
42
  directory,
43
43
  gitDirectories: [],
@@ -71,11 +71,9 @@ async function inspectImage({ provider, agent, image }, execute, signal) {
71
71
  }, invoke));
72
72
  const agentVersion = await diagnosticProbe({
73
73
  id: "agent.sandbox",
74
- command: { executable: agent, arguments: ["--version"] },
74
+ ...agentVersionProbe(agent),
75
75
  failureStatus: "fail",
76
- readVersion: true,
77
- referenceVersion: agentVersions[agent],
78
- remedy: `Install ${agent} in the image and rebuild it. This check does not bootstrap agents.`,
76
+ remedy: `Install ${doctorAgents[agent].executable} in the image and rebuild it. This check does not bootstrap agents.`,
79
77
  }, invoke);
80
78
  checks.push(agentVersion);
81
79
  if (agentVersion.status === "fail")
@@ -113,7 +111,7 @@ async function inspectImage({ provider, agent, image }, execute, signal) {
113
111
  checks.push({
114
112
  id: "image.cleanup",
115
113
  status: "fail",
116
- message: `Cleanup could not be confirmed. Inspect container ${container ?? "creation state"} with ${provider}; temporary workspace retained at ${directory}.`,
114
+ message: `Cleanup could not be confirmed. Inspect container ${container ?? "creation state"} with ${sandboxProvider}; temporary workspace retained at ${directory}.`,
117
115
  });
118
116
  if (!retained) {
119
117
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-image.js","sourceRoot":"","sources":["../../src/application/doctor-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,MAAM,CAAC,KAAK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AAI,CAAC;gBACH,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACxD,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC;oBACV,EAAE,EAAE,iBAAiB;oBACrB,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,wCAAwC,SAAS,GAAG;iBAC9D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { mkdtemp, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport { executeProcess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { registerCleanup } from \"../infrastructure/shutdown.ts\";\nimport { diagnosticContainer } from \"../providers/diagnostic-container.ts\";\nimport { agentVersions } from \"../providers/versions.constants.ts\";\nimport { diagnoseAgentCli } from \"./doctor-agent.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport { doctorDefaults } from \"./doctor.constants.ts\";\nimport type { DiagnosticCheck, DoctorImageOptions } from \"./doctor.types.ts\";\n\nexport async function diagnoseImage(\n options: DoctorImageOptions,\n execute: Executor = executeProcess,\n): Promise<readonly DiagnosticCheck[]> {\n const stop = new AbortController();\n const pending = inspectImage(options, execute, stop.signal);\n const unregister = registerCleanup(async () => {\n stop.abort(new OutpostError(\"aborted\", \"Image diagnostics interrupted\"));\n await pending;\n });\n try {\n return await pending;\n } finally {\n unregister();\n }\n}\n\nasync function inspectImage(\n { provider, agent, image }: DoctorImageOptions,\n execute: Executor,\n signal: AbortSignal,\n): Promise<readonly DiagnosticCheck[]> {\n const directory = await mkdtemp(join(tmpdir(), \"outpost-doctor-\"));\n const checks: DiagnosticCheck[] = [];\n let lease: SandboxLease | undefined;\n let retained = false;\n let container: string | undefined;\n const tracked: Executor = (command) => {\n if (command.arguments?.[0] === \"create\") {\n const index = command.arguments.indexOf(\"--name\");\n container = command.arguments[index + 1];\n }\n return execute(command);\n };\n try {\n lease = await diagnosticContainer(\n provider,\n image,\n doctorDefaults.deadlineMs,\n tracked,\n ).acquire({\n repository: directory,\n directory,\n gitDirectories: [],\n variables: {},\n signal,\n });\n checks.push({\n id: \"image.runtime\",\n status: \"pass\",\n message:\n \"Temporary sandbox started with network disabled and an empty workspace.\",\n });\n const sandbox = lease;\n const invoke: Executor = (command) =>\n sandbox.invoke({ ...command, signal });\n for (const executable of [\"node\", \"git\"]) {\n checks.push(\n await diagnosticProbe(\n {\n id: `image.${executable}`,\n command: { executable, arguments: [\"--version\"] },\n failureStatus: \"fail\",\n readVersion: true,\n remedy: `Install ${executable} in the image and rebuild it.`,\n },\n invoke,\n ),\n );\n }\n checks.push(\n await diagnosticProbe(\n {\n id: \"image.home\",\n command: {\n executable: \"sh\",\n arguments: [\"-c\", 'test -d \"$HOME\" && test -w \"$HOME\"'],\n },\n failureStatus: \"fail\",\n remedy:\n \"Check the image user and permissions of the private agent home.\",\n },\n invoke,\n ),\n );\n const agentVersion = await diagnosticProbe(\n {\n id: \"agent.sandbox\",\n command: { executable: agent, arguments: [\"--version\"] },\n failureStatus: \"fail\",\n readVersion: true,\n referenceVersion: agentVersions[agent],\n remedy: `Install ${agent} in the image and rebuild it. This check does not bootstrap agents.`,\n },\n invoke,\n );\n checks.push(agentVersion);\n if (agentVersion.status === \"fail\")\n checks.push({\n id: \"agent.cli\",\n status: \"skipped\",\n message: \"CLI help checks require a successful agent version probe.\",\n });\n else checks.push(...(await diagnoseAgentCli(agent, invoke)));\n } catch (error) {\n retained = error instanceof AggregateError;\n checks.push({\n id: \"image.runtime\",\n status: \"fail\",\n message:\n \"Image diagnostics could not start. Check that the image exists locally, its UID matches the host, and sh, sleep, setsid, kill, tar and cp are installed. No image is downloaded.\",\n });\n } finally {\n if (lease) {\n try {\n await lease.release();\n checks.push({\n id: \"image.cleanup\",\n status: \"pass\",\n message: \"Diagnostic container removed.\",\n });\n } catch {\n retained = true;\n }\n }\n if (retained)\n checks.push({\n id: \"image.cleanup\",\n status: \"fail\",\n message: `Cleanup could not be confirmed. Inspect container ${container ?? \"creation state\"} with ${provider}; temporary workspace retained at ${directory}.`,\n });\n if (!retained) {\n try {\n await rm(directory, { recursive: true, force: true });\n } catch {\n checks.push({\n id: \"image.workspace\",\n status: \"fail\",\n message: `Could not remove temporary workspace ${directory}.`,\n });\n }\n }\n }\n return checks;\n}\n"]}
1
+ {"version":3,"file":"doctor-image.js","sourceRoot":"","sources":["../../src/application/doctor-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAA2B,EAC3B,UAAoB,cAAc;IAElC,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,I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AwC,SAAS,GAAG;iBAC9D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { mkdtemp, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport { executeProcess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { registerCleanup } from \"../infrastructure/shutdown.ts\";\nimport { diagnosticContainer } from \"../providers/diagnostic-container.ts\";\nimport { doctorAgents } from \"./doctor-agent.constants.ts\";\nimport { agentVersionProbe, diagnoseAgentCli } from \"./doctor-agent.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport { doctorDefaults } from \"./doctor.constants.ts\";\nimport type { DiagnosticCheck, DoctorImageOptions } from \"./doctor.types.ts\";\n\nexport async function diagnoseImage(\n options: DoctorImageOptions,\n execute: Executor = executeProcess,\n): Promise<readonly DiagnosticCheck[]> {\n const stop = new AbortController();\n const pending = inspectImage(options, execute, stop.signal);\n const unregister = registerCleanup(async () => {\n stop.abort(new OutpostError(\"aborted\", \"Image diagnostics interrupted\"));\n await pending;\n });\n try {\n return await pending;\n } finally {\n unregister();\n }\n}\n\nasync function inspectImage(\n { sandboxProvider, agent, image }: DoctorImageOptions,\n execute: Executor,\n signal: AbortSignal,\n): Promise<readonly DiagnosticCheck[]> {\n const directory = await mkdtemp(join(tmpdir(), \"outpost-doctor-\"));\n const checks: DiagnosticCheck[] = [];\n let lease: SandboxLease | undefined;\n let retained = false;\n let container: string | undefined;\n const tracked: Executor = (command) => {\n if (command.arguments?.[0] === \"create\") {\n const index = command.arguments.indexOf(\"--name\");\n container = command.arguments[index + 1];\n }\n return execute(command);\n };\n try {\n lease = await diagnosticContainer(\n sandboxProvider,\n image,\n doctorDefaults.deadlineMs,\n tracked,\n ).acquire({\n repository: directory,\n directory,\n gitDirectories: [],\n variables: {},\n signal,\n });\n checks.push({\n id: \"image.runtime\",\n status: \"pass\",\n message:\n \"Temporary sandbox started with network disabled and an empty workspace.\",\n });\n const sandbox = lease;\n const invoke: Executor = (command) =>\n sandbox.invoke({ ...command, signal });\n for (const executable of [\"node\", \"git\"]) {\n checks.push(\n await diagnosticProbe(\n {\n id: `image.${executable}`,\n command: { executable, arguments: [\"--version\"] },\n failureStatus: \"fail\",\n readVersion: true,\n remedy: `Install ${executable} in the image and rebuild it.`,\n },\n invoke,\n ),\n );\n }\n checks.push(\n await diagnosticProbe(\n {\n id: \"image.home\",\n command: {\n executable: \"sh\",\n arguments: [\"-c\", 'test -d \"$HOME\" && test -w \"$HOME\"'],\n },\n failureStatus: \"fail\",\n remedy:\n \"Check the image user and permissions of the private agent home.\",\n },\n invoke,\n ),\n );\n const agentVersion = await diagnosticProbe(\n {\n id: \"agent.sandbox\",\n ...agentVersionProbe(agent),\n failureStatus: \"fail\",\n remedy: `Install ${doctorAgents[agent].executable} in the image and rebuild it. This check does not bootstrap agents.`,\n },\n invoke,\n );\n checks.push(agentVersion);\n if (agentVersion.status === \"fail\")\n checks.push({\n id: \"agent.cli\",\n status: \"skipped\",\n message: \"CLI help checks require a successful agent version probe.\",\n });\n else checks.push(...(await diagnoseAgentCli(agent, invoke)));\n } catch (error) {\n retained = error instanceof AggregateError;\n checks.push({\n id: \"image.runtime\",\n status: \"fail\",\n message:\n \"Image diagnostics could not start. Check that the image exists locally, its UID matches the host, and sh, sleep, setsid, kill, tar and cp are installed. No image is downloaded.\",\n });\n } finally {\n if (lease) {\n try {\n await lease.release();\n checks.push({\n id: \"image.cleanup\",\n status: \"pass\",\n message: \"Diagnostic container removed.\",\n });\n } catch {\n retained = true;\n }\n }\n if (retained)\n checks.push({\n id: \"image.cleanup\",\n status: \"fail\",\n message: `Cleanup could not be confirmed. Inspect container ${container ?? \"creation state\"} with ${sandboxProvider}; temporary workspace retained at ${directory}.`,\n });\n if (!retained) {\n try {\n await rm(directory, { recursive: true, force: true });\n } catch {\n checks.push({\n id: \"image.workspace\",\n status: \"fail\",\n message: `Could not remove temporary workspace ${directory}.`,\n });\n }\n }\n }\n return checks;\n}\n"]}
@@ -1,11 +1,9 @@
1
1
  import { isDeepStrictEqual } from "node:util";
2
- import { claude } from "../adapters/agents/claude-adapter.js";
3
- import { codex } from "../adapters/agents/codex-adapter.js";
4
- import { gemini } from "../adapters/agents/gemini-adapter.js";
5
2
  import { protocolFixtures } from "../adapters/agents/protocol-fixtures.constants.js";
6
- import { agentVersions } from "../providers/versions.constants.js";
3
+ import { doctorAgents } from "./doctor-agent.constants.js";
7
4
  export function diagnoseAgentProtocol(agent) {
8
- const adapter = { claude, codex, gemini }[agent]();
5
+ const profile = doctorAgents[agent];
6
+ const adapter = profile.harness().bind();
9
7
  const checks = protocolFixtures[agent].map((fixture) => {
10
8
  const events = fixture.lines.flatMap((line) => adapter.events(line));
11
9
  const passed = isDeepStrictEqual(events, fixture.expected);
@@ -20,7 +18,9 @@ export function diagnoseAgentProtocol(agent) {
20
18
  return {
21
19
  scope: "bundled-protocol-fixtures",
22
20
  agent,
23
- referenceVersion: agentVersions[agent],
21
+ ...(profile.referenceVersion === undefined
22
+ ? {}
23
+ : { referenceVersion: profile.referenceVersion }),
24
24
  installedCli: "unverified",
25
25
  modelCompatibility: "unverified",
26
26
  checks,
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-protocol.js","sourceRoot":"","sources":["../../src/application/doctor-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE,MAAM,UAAU,qBAAqB,CAAC,KAAkB;IACtD,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IACnD,MAAM,MAAM,GAAsB,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACxE,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3D,OAAO;YACL,EAAE,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;YACtC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAChC,OAAO,EAAE,MAAM;gBACb,CAAC,CAAC,iHAAiH;gBACnH,CAAC,CAAC,6EAA6E;SAClF,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,KAAK,EAAE,2BAA2B;QAClC,KAAK;QACL,gBAAgB,EAAE,aAAa,CAAC,KAAK,CAAC;QACtC,YAAY,EAAE,YAAY;QAC1B,kBAAkB,EAAE,YAAY;QAChC,MAAM;QACN,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import { isDeepStrictEqual } from \"node:util\";\nimport { claude } from \"../adapters/agents/claude-adapter.ts\";\nimport { codex } from \"../adapters/agents/codex-adapter.ts\";\nimport { gemini } from \"../adapters/agents/gemini-adapter.ts\";\nimport { protocolFixtures } from \"../adapters/agents/protocol-fixtures.constants.ts\";\nimport { agentVersions } from \"../providers/versions.constants.ts\";\nimport type { AgentProtocolReport } from \"./doctor-protocol.types.ts\";\nimport type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport function diagnoseAgentProtocol(agent: DoctorAgent): AgentProtocolReport {\n const adapter = { claude, codex, gemini }[agent]();\n const checks: DiagnosticCheck[] = protocolFixtures[agent].map((fixture) => {\n const events = fixture.lines.flatMap((line) => adapter.events(line));\n const passed = isDeepStrictEqual(events, fixture.expected);\n return {\n id: `protocol.fixture.${fixture.name}`,\n status: passed ? \"pass\" : \"fail\",\n message: passed\n ? \"Bundled synthetic events decode to the expected structural observations. No installed CLI or model was invoked.\"\n : \"Bundled synthetic events do not match the expected structural observations.\",\n };\n });\n return {\n scope: \"bundled-protocol-fixtures\",\n agent,\n referenceVersion: agentVersions[agent],\n installedCli: \"unverified\",\n modelCompatibility: \"unverified\",\n checks,\n hasFailures: checks.some((check) => check.status === \"fail\"),\n };\n}\n"]}
1
+ {"version":3,"file":"doctor-protocol.js","sourceRoot":"","sources":["../../src/application/doctor-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAI3D,MAAM,UAAU,qBAAqB,CAAC,KAAkB;IACtD,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,MAAM,GAAsB,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACxE,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3D,OAAO;YACL,EAAE,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;YACtC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAChC,OAAO,EAAE,MAAM;gBACb,CAAC,CAAC,iHAAiH;gBACnH,CAAC,CAAC,6EAA6E;SAClF,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,KAAK,EAAE,2BAA2B;QAClC,KAAK;QACL,GAAG,CAAC,OAAO,CAAC,gBAAgB,KAAK,SAAS;YACxC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC;QACnD,YAAY,EAAE,YAAY;QAC1B,kBAAkB,EAAE,YAAY;QAChC,MAAM;QACN,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import { isDeepStrictEqual } from \"node:util\";\nimport { protocolFixtures } from \"../adapters/agents/protocol-fixtures.constants.ts\";\nimport { doctorAgents } from \"./doctor-agent.constants.ts\";\nimport type { AgentProtocolReport } from \"./doctor-protocol.types.ts\";\nimport type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport function diagnoseAgentProtocol(agent: DoctorAgent): AgentProtocolReport {\n const profile = doctorAgents[agent];\n const adapter = profile.harness().bind();\n const checks: DiagnosticCheck[] = protocolFixtures[agent].map((fixture) => {\n const events = fixture.lines.flatMap((line) => adapter.events(line));\n const passed = isDeepStrictEqual(events, fixture.expected);\n return {\n id: `protocol.fixture.${fixture.name}`,\n status: passed ? \"pass\" : \"fail\",\n message: passed\n ? \"Bundled synthetic events decode to the expected structural observations. No installed CLI or model was invoked.\"\n : \"Bundled synthetic events do not match the expected structural observations.\",\n };\n });\n return {\n scope: \"bundled-protocol-fixtures\",\n agent,\n ...(profile.referenceVersion === undefined\n ? {}\n : { referenceVersion: profile.referenceVersion }),\n installedCli: \"unverified\",\n modelCompatibility: \"unverified\",\n checks,\n hasFailures: checks.some((check) => check.status === \"fail\"),\n };\n}\n"]}
@@ -2,7 +2,7 @@ import type { DiagnosticCheck, DoctorAgent } from "./doctor.types.ts";
2
2
  export interface AgentProtocolReport {
3
3
  readonly scope: "bundled-protocol-fixtures";
4
4
  readonly agent: DoctorAgent;
5
- readonly referenceVersion: string;
5
+ readonly referenceVersion?: string;
6
6
  readonly installedCli: "unverified";
7
7
  readonly modelCompatibility: "unverified";
8
8
  readonly checks: readonly DiagnosticCheck[];
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-protocol.types.js","sourceRoot":"","sources":["../../src/application/doctor-protocol.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport interface AgentProtocolReport {\n readonly scope: \"bundled-protocol-fixtures\";\n readonly agent: DoctorAgent;\n readonly referenceVersion: string;\n readonly installedCli: \"unverified\";\n readonly modelCompatibility: \"unverified\";\n readonly checks: readonly DiagnosticCheck[];\n readonly hasFailures: boolean;\n}\n"]}
1
+ {"version":3,"file":"doctor-protocol.types.js","sourceRoot":"","sources":["../../src/application/doctor-protocol.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport interface AgentProtocolReport {\n readonly scope: \"bundled-protocol-fixtures\";\n readonly agent: DoctorAgent;\n readonly referenceVersion?: string;\n readonly installedCli: \"unverified\";\n readonly modelCompatibility: \"unverified\";\n readonly checks: readonly DiagnosticCheck[];\n readonly hasFailures: boolean;\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import { invariant } from "../domain/errors.js";
2
- import { agentVersions } from "../providers/versions.constants.js";
3
- import { diagnoseAgentCli } from "./doctor-agent.js";
2
+ import { agentVersionProbe, diagnoseAgentCli } from "./doctor-agent.js";
4
3
  import { diagnosticProbe } from "./diagnostic-probe.js";
5
4
  import { doctorDefaults } from "./doctor.constants.js";
6
5
  import { diagnoseTransfers } from "./doctor-transfers.js";
@@ -69,9 +68,7 @@ export async function diagnoseSandbox(target, options = {}) {
69
68
  if (options.agent) {
70
69
  const version = await diagnosticProbe({
71
70
  id: "agent.sandbox",
72
- command: { executable: options.agent, arguments: ["--version"] },
73
- readVersion: true,
74
- referenceVersion: agentVersions[options.agent],
71
+ ...agentVersionProbe(options.agent),
75
72
  failureStatus: "fail",
76
73
  remedy: "Install the agent explicitly; diagnostics never bootstrap it.",
77
74
  }, invoke);
@@ -95,11 +92,11 @@ export async function diagnoseSandbox(target, options = {}) {
95
92
  return {
96
93
  scope: "owned-sandbox",
97
94
  ownership: "caller",
98
- ...(options.provider
95
+ ...(options.sandboxProvider
99
96
  ? {
100
- provider: {
101
- name: options.provider.name,
102
- placement: options.provider.placement,
97
+ sandboxProvider: {
98
+ name: options.sandboxProvider.name,
99
+ placement: options.sandboxProvider.placement,
103
100
  },
104
101
  }
105
102
  : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-sandbox.js","sourceRoot":"","sources":["../../src/application/doctor-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAO1E,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAA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AO,CAAC,QAAQ,CAAC,IAAI;oBAC3B,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,SAAS;iBACtC;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,YAAY,EAAE;YACZ;gBACE,EAAE,EAAE,SAAS;gBACb,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC;aACtC;YACD;gBACE,EAAE,EAAE,WAAW;gBACf,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,QAAQ,CAAC,mBAAmB,CAAC;aACxC;YACD;gBACE,EAAE,EAAE,gBAAgB;gBACpB,UAAU,EAAE,MAAM,CAAC,aAAa,KAAK,SAAS;gBAC9C,QAAQ,EAAE,YAAY;aACvB;YACD;gBACE,EAAE,EAAE,qBAAqB;gBACzB,UAAU,EAAE,SAAS;gBACrB,QAAQ,EAAE,YAAY;aACvB;SACF;QACD,MAAM;QACN,kBAAkB,EAAE,YAAY;QAChC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import { invariant } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { agentVersions } from \"../providers/versions.constants.ts\";\nimport { diagnoseAgentCli } from \"./doctor-agent.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport { doctorDefaults } from \"./doctor.constants.ts\";\nimport type { DiagnosticCheck } from \"./doctor.types.ts\";\nimport { diagnoseTransfers } from \"./doctor-transfers.ts\";\nimport { sandboxDiagnosticDefaults } from \"./doctor-sandbox.constants.ts\";\nimport type {\n SandboxDiagnosticOptions,\n SandboxDiagnosticReport,\n} from \"./doctor-sandbox.types.ts\";\nimport type { Sandbox } from \"./outpost.types.ts\";\n\nexport async function diagnoseSandbox(\n target: Sandbox | SandboxLease,\n options: SandboxDiagnosticOptions = {},\n): Promise<SandboxDiagnosticReport> {\n if (\"diagnose\" in target) return target.diagnose(options);\n const deadlineMs = options.deadlineMs ?? doctorDefaults.deadlineMs;\n invariant(\n Number.isInteger(deadlineMs) &&\n deadlineMs > 0 &&\n deadlineMs <= sandboxDiagnosticDefaults.maximumDeadlineMs,\n \"Diagnostic deadlineMs must be an integer from 1 to 60000\",\n );\n options.signal?.throwIfAborted();\n const invoke: Executor = (command) => {\n options.signal?.throwIfAborted();\n return target.invoke({\n ...command,\n deadlineMs,\n retain: command.retain ?? doctorDefaults.retain,\n signal: options.signal\n ? AbortSignal.any([options.signal, AbortSignal.timeout(deadlineMs)])\n : AbortSignal.timeout(deadlineMs),\n });\n };\n const checks: DiagnosticCheck[] = [];\n for (const executable of [\"node\", \"git\"]) {\n checks.push(\n await diagnosticProbe(\n {\n id: `sandbox.${executable}`,\n command: { executable, arguments: [\"--version\"] },\n readVersion: true,\n failureStatus: \"fail\",\n remedy: `Install ${executable} in this sandbox.`,\n },\n invoke,\n ),\n );\n }\n try {\n const result = await invoke({\n executable: \"node\",\n arguments: [\"-e\", sandboxDiagnosticDefaults.command],\n });\n const passed =\n result.status === 7 &&\n result.stdout === \"outpost-stdout\" &&\n result.stderr === \"outpost-stderr\";\n checks.push({\n id: \"sandbox.command\",\n status: passed ? \"pass\" : \"fail\",\n message: passed\n ? \"Observed separate output streams and nonzero process exit status.\"\n : \"Command output or exit status did not match the diagnostic sentinel.\",\n });\n } catch {\n checks.push({\n id: \"sandbox.command\",\n status: \"fail\",\n message: \"Bounded command probe failed or was interrupted.\",\n });\n }\n checks.push(\n await diagnosticProbe(\n {\n id: \"sandbox.home\",\n command: {\n executable: \"node\",\n arguments: [\"-e\", sandboxDiagnosticDefaults.home, target.home],\n },\n failureStatus: \"fail\",\n remedy: \"Check the lease home directory and its permissions.\",\n },\n invoke,\n ),\n );\n if (options.agent) {\n const version = await diagnosticProbe(\n {\n id: \"agent.sandbox\",\n command: { executable: options.agent, arguments: [\"--version\"] },\n readVersion: true,\n referenceVersion: agentVersions[options.agent],\n failureStatus: \"fail\",\n remedy: \"Install the agent explicitly; diagnostics never bootstrap it.\",\n },\n invoke,\n );\n checks.push(version);\n if (version.status !== \"fail\")\n checks.push(...(await diagnoseAgentCli(options.agent, invoke)));\n }\n if (options.transfers === true)\n checks.push(\n ...(await diagnoseTransfers(\n target,\n { deadlineMs, ...(options.signal ? { signal: options.signal } : {}) },\n invoke,\n )),\n );\n checks.push({\n id: \"model\",\n status: \"skipped\",\n message:\n \"Authentication, model access and installed agent protocol compatibility are unverified. No model request was made.\",\n });\n const observed = (id: string) => {\n const check = checks.find((check) => check.id === id);\n if (!check) return \"unverified\" as const;\n return check.status === \"pass\" ? (\"pass\" as const) : (\"fail\" as const);\n };\n return {\n scope: \"owned-sandbox\",\n ownership: \"caller\",\n ...(options.provider\n ? {\n provider: {\n name: options.provider.name,\n placement: options.provider.placement,\n },\n }\n : {}),\n capabilities: [\n {\n id: \"command\",\n advertised: true,\n observed: observed(\"sandbox.command\"),\n },\n {\n id: \"transfers\",\n advertised: true,\n observed: observed(\"sandbox.transfers\"),\n },\n {\n id: \"batchTransfers\",\n advertised: target.fileTransfers !== undefined,\n observed: \"unverified\",\n },\n {\n id: \"interactiveTerminal\",\n advertised: \"unknown\",\n observed: \"unverified\",\n },\n ],\n checks,\n modelCompatibility: \"unverified\",\n hasFailures: checks.some((check) => check.status === \"fail\"),\n };\n}\n"]}
1
+ {"version":3,"file":"doctor-sandbox.js","sourceRoot":"","sources":["../../src/application/doctor-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,O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f,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,IAAI;oBAClC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,SAAS;iBAC7C;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,YAAY,EAAE;YACZ;gBACE,EAAE,EAAE,SAAS;gBACb,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC;aACtC;YACD;gBACE,EAAE,EAAE,WAAW;gBACf,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,QAAQ,CAAC,mBAAmB,CAAC;aACxC;YACD;gBACE,EAAE,EAAE,gBAAgB;gBACpB,UAAU,EAAE,MAAM,CAAC,aAAa,KAAK,SAAS;gBAC9C,QAAQ,EAAE,YAAY;aACvB;YACD;gBACE,EAAE,EAAE,qBAAqB;gBACzB,UAAU,EAAE,SAAS;gBACrB,QAAQ,EAAE,YAAY;aACvB;SACF;QACD,MAAM;QACN,kBAAkB,EAAE,YAAY;QAChC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import { invariant } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { agentVersionProbe, diagnoseAgentCli } from \"./doctor-agent.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport { doctorDefaults } from \"./doctor.constants.ts\";\nimport type { DiagnosticCheck } from \"./doctor.types.ts\";\nimport { diagnoseTransfers } from \"./doctor-transfers.ts\";\nimport { sandboxDiagnosticDefaults } from \"./doctor-sandbox.constants.ts\";\nimport type {\n SandboxDiagnosticOptions,\n SandboxDiagnosticReport,\n} from \"./doctor-sandbox.types.ts\";\nimport type { Sandbox } from \"./outpost.types.ts\";\n\nexport async function diagnoseSandbox(\n target: Sandbox | SandboxLease,\n options: SandboxDiagnosticOptions = {},\n): Promise<SandboxDiagnosticReport> {\n if (\"diagnose\" in target) return target.diagnose(options);\n const deadlineMs = options.deadlineMs ?? doctorDefaults.deadlineMs;\n invariant(\n Number.isInteger(deadlineMs) &&\n deadlineMs > 0 &&\n deadlineMs <= sandboxDiagnosticDefaults.maximumDeadlineMs,\n \"Diagnostic deadlineMs must be an integer from 1 to 60000\",\n );\n options.signal?.throwIfAborted();\n const invoke: Executor = (command) => {\n options.signal?.throwIfAborted();\n return target.invoke({\n ...command,\n deadlineMs,\n retain: command.retain ?? doctorDefaults.retain,\n signal: options.signal\n ? AbortSignal.any([options.signal, AbortSignal.timeout(deadlineMs)])\n : AbortSignal.timeout(deadlineMs),\n });\n };\n const checks: DiagnosticCheck[] = [];\n for (const executable of [\"node\", \"git\"]) {\n checks.push(\n await diagnosticProbe(\n {\n id: `sandbox.${executable}`,\n command: { executable, arguments: [\"--version\"] },\n readVersion: true,\n failureStatus: \"fail\",\n remedy: `Install ${executable} in this sandbox.`,\n },\n invoke,\n ),\n );\n }\n try {\n const result = await invoke({\n executable: \"node\",\n arguments: [\"-e\", sandboxDiagnosticDefaults.command],\n });\n const passed =\n result.status === 7 &&\n result.stdout === \"outpost-stdout\" &&\n result.stderr === \"outpost-stderr\";\n checks.push({\n id: \"sandbox.command\",\n status: passed ? \"pass\" : \"fail\",\n message: passed\n ? \"Observed separate output streams and nonzero process exit status.\"\n : \"Command output or exit status did not match the diagnostic sentinel.\",\n });\n } catch {\n checks.push({\n id: \"sandbox.command\",\n status: \"fail\",\n message: \"Bounded command probe failed or was interrupted.\",\n });\n }\n checks.push(\n await diagnosticProbe(\n {\n id: \"sandbox.home\",\n command: {\n executable: \"node\",\n arguments: [\"-e\", sandboxDiagnosticDefaults.home, target.home],\n },\n failureStatus: \"fail\",\n remedy: \"Check the lease home directory and its permissions.\",\n },\n invoke,\n ),\n );\n if (options.agent) {\n const version = await diagnosticProbe(\n {\n id: \"agent.sandbox\",\n ...agentVersionProbe(options.agent),\n failureStatus: \"fail\",\n remedy: \"Install the agent explicitly; diagnostics never bootstrap it.\",\n },\n invoke,\n );\n checks.push(version);\n if (version.status !== \"fail\")\n checks.push(...(await diagnoseAgentCli(options.agent, invoke)));\n }\n if (options.transfers === true)\n checks.push(\n ...(await diagnoseTransfers(\n target,\n { deadlineMs, ...(options.signal ? { signal: options.signal } : {}) },\n invoke,\n )),\n );\n checks.push({\n id: \"model\",\n status: \"skipped\",\n message:\n \"Authentication, model access and installed agent protocol compatibility are unverified. No model request was made.\",\n });\n const observed = (id: string) => {\n const check = checks.find((check) => check.id === id);\n if (!check) return \"unverified\" as const;\n return check.status === \"pass\" ? (\"pass\" as const) : (\"fail\" as const);\n };\n return {\n scope: \"owned-sandbox\",\n ownership: \"caller\",\n ...(options.sandboxProvider\n ? {\n sandboxProvider: {\n name: options.sandboxProvider.name,\n placement: options.sandboxProvider.placement,\n },\n }\n : {}),\n capabilities: [\n {\n id: \"command\",\n advertised: true,\n observed: observed(\"sandbox.command\"),\n },\n {\n id: \"transfers\",\n advertised: true,\n observed: observed(\"sandbox.transfers\"),\n },\n {\n id: \"batchTransfers\",\n advertised: target.fileTransfers !== undefined,\n observed: \"unverified\",\n },\n {\n id: \"interactiveTerminal\",\n advertised: \"unknown\",\n observed: \"unverified\",\n },\n ],\n checks,\n modelCompatibility: \"unverified\",\n hasFailures: checks.some((check) => check.status === \"fail\"),\n };\n}\n"]}
@@ -5,7 +5,7 @@ export interface SandboxDiagnosticOptions {
5
5
  readonly deadlineMs?: number;
6
6
  readonly signal?: AbortSignal;
7
7
  readonly transfers?: boolean;
8
- readonly provider?: Pick<SandboxProvider, "name" | "placement">;
8
+ readonly sandboxProvider?: Pick<SandboxProvider, "name" | "placement">;
9
9
  }
10
10
  export interface DiagnosticCapability {
11
11
  readonly id: "command" | "transfers" | "batchTransfers" | "interactiveTerminal";
@@ -15,7 +15,7 @@ export interface DiagnosticCapability {
15
15
  export interface SandboxDiagnosticReport {
16
16
  readonly scope: "owned-sandbox";
17
17
  readonly ownership: "caller";
18
- readonly provider?: Pick<SandboxProvider, "name" | "placement">;
18
+ readonly sandboxProvider?: Pick<SandboxProvider, "name" | "placement">;
19
19
  readonly capabilities: readonly DiagnosticCapability[];
20
20
  readonly checks: readonly DiagnosticCheck[];
21
21
  readonly modelCompatibility: "unverified";
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-sandbox.types.js","sourceRoot":"","sources":["../../src/application/doctor-sandbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SandboxProvider } from \"../domain/sandbox.types.ts\";\nimport type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport interface SandboxDiagnosticOptions {\n readonly agent?: DoctorAgent;\n readonly deadlineMs?: number;\n readonly signal?: AbortSignal;\n readonly transfers?: boolean;\n readonly provider?: Pick<SandboxProvider, \"name\" | \"placement\">;\n}\n\nexport interface DiagnosticCapability {\n readonly id:\n \"command\" | \"transfers\" | \"batchTransfers\" | \"interactiveTerminal\";\n readonly advertised: boolean | \"unknown\";\n readonly observed: \"pass\" | \"fail\" | \"unverified\";\n}\n\nexport interface SandboxDiagnosticReport {\n readonly scope: \"owned-sandbox\";\n readonly ownership: \"caller\";\n readonly provider?: Pick<SandboxProvider, \"name\" | \"placement\">;\n readonly capabilities: readonly DiagnosticCapability[];\n readonly checks: readonly DiagnosticCheck[];\n readonly modelCompatibility: \"unverified\";\n readonly hasFailures: boolean;\n}\n"]}
1
+ {"version":3,"file":"doctor-sandbox.types.js","sourceRoot":"","sources":["../../src/application/doctor-sandbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SandboxProvider } from \"../domain/sandbox.types.ts\";\nimport type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport interface SandboxDiagnosticOptions {\n readonly agent?: DoctorAgent;\n readonly deadlineMs?: number;\n readonly signal?: AbortSignal;\n readonly transfers?: boolean;\n readonly sandboxProvider?: Pick<SandboxProvider, \"name\" | \"placement\">;\n}\n\nexport interface DiagnosticCapability {\n readonly id:\n \"command\" | \"transfers\" | \"batchTransfers\" | \"interactiveTerminal\";\n readonly advertised: boolean | \"unknown\";\n readonly observed: \"pass\" | \"fail\" | \"unverified\";\n}\n\nexport interface SandboxDiagnosticReport {\n readonly scope: \"owned-sandbox\";\n readonly ownership: \"caller\";\n readonly sandboxProvider?: Pick<SandboxProvider, \"name\" | \"placement\">;\n readonly capabilities: readonly DiagnosticCapability[];\n readonly checks: readonly DiagnosticCheck[];\n readonly modelCompatibility: \"unverified\";\n readonly hasFailures: boolean;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { DoctorProvider, DoctorReport } from "./doctor.types.ts";
2
2
  export declare const doctorDefaults: Readonly<{
3
- readonly provider: "docker";
3
+ readonly sandboxProvider: "docker";
4
4
  readonly agent: "codex";
5
5
  readonly deadlineMs: 5000;
6
6
  readonly retain: 4096;
@@ -1,5 +1,5 @@
1
1
  export const doctorDefaults = Object.freeze({
2
- provider: "docker",
2
+ sandboxProvider: "docker",
3
3
  agent: "codex",
4
4
  deadlineMs: 5_000,
5
5
  retain: 4_096,
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.constants.js","sourceRoot":"","sources":["../../src/application/doctor.constants.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,EAAE;CACZ,CAAC,CAAC;AACZ,MAAM,CAAC,MAAM,mBAAmB,GAK5B;IACF,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE;IAC3D,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE;IAC3D,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE;IACvD,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE;IAC3D,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAE;CAC5D,CAAC","sourcesContent":["import type { DoctorProvider, DoctorReport } from \"./doctor.types.ts\";\nexport const doctorDefaults = Object.freeze({\n provider: \"docker\",\n agent: \"codex\",\n deadlineMs: 5_000,\n retain: 4_096,\n minimumNodeMajor: 24,\n} as const);\nexport const providerDiagnostics: Readonly<\n Record<\n DoctorProvider,\n Pick<DoctorReport, \"placement\" | \"interactiveTerminal\">\n >\n> = {\n docker: { placement: \"mounted\", interactiveTerminal: true },\n podman: { placement: \"mounted\", interactiveTerminal: true },\n local: { placement: \"host\", interactiveTerminal: true },\n vercel: { placement: \"remote\", interactiveTerminal: false },\n daytona: { placement: \"remote\", interactiveTerminal: true },\n};\n"]}
1
+ {"version":3,"file":"doctor.constants.js","sourceRoot":"","sources":["../../src/application/doctor.constants.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,eAAe,EAAE,QAAQ;IACzB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,EAAE;CACZ,CAAC,CAAC;AACZ,MAAM,CAAC,MAAM,mBAAmB,GAK5B;IACF,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE;IAC3D,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE;IAC3D,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE;IACvD,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE;IAC3D,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAE;CAC5D,CAAC","sourcesContent":["import type { DoctorProvider, DoctorReport } from \"./doctor.types.ts\";\nexport const doctorDefaults = Object.freeze({\n sandboxProvider: \"docker\",\n agent: \"codex\",\n deadlineMs: 5_000,\n retain: 4_096,\n minimumNodeMajor: 24,\n} as const);\nexport const providerDiagnostics: Readonly<\n Record<\n DoctorProvider,\n Pick<DoctorReport, \"placement\" | \"interactiveTerminal\">\n >\n> = {\n docker: { placement: \"mounted\", interactiveTerminal: true },\n podman: { placement: \"mounted\", interactiveTerminal: true },\n local: { placement: \"host\", interactiveTerminal: true },\n vercel: { placement: \"remote\", interactiveTerminal: false },\n daytona: { placement: \"remote\", interactiveTerminal: true },\n};\n"]}
@@ -1,18 +1,18 @@
1
1
  import { invariant } from "../domain/errors.js";
2
2
  import { executeProcess } from "../infrastructure/process.js";
3
- import { agentVersions } from "../providers/versions.constants.js";
3
+ import { agentVersionProbe } from "./doctor-agent.js";
4
4
  import { diagnoseImage } from "./doctor-image.js";
5
5
  import { diagnosticProbe } from "./diagnostic-probe.js";
6
6
  import { doctorDefaults, providerDiagnostics } from "./doctor.constants.js";
7
7
  export async function diagnose(options, execute = executeProcess) {
8
- const { provider, agent, image } = options;
8
+ const { sandboxProvider, agent, image } = options;
9
9
  if (image !== undefined) {
10
- invariant(provider === "docker" || provider === "podman", "--image requires docker or podman.");
10
+ invariant(sandboxProvider === "docker" || sandboxProvider === "podman", "--image requires docker or podman.");
11
11
  invariant(image.length > 0 &&
12
12
  !image.startsWith("-") &&
13
13
  !/[\x00-\x20\x7f]/.test(image), "Invalid diagnostic image name.");
14
14
  }
15
- const capabilities = providerDiagnostics[provider];
15
+ const capabilities = providerDiagnostics[sandboxProvider];
16
16
  const checks = [
17
17
  {
18
18
  id: "host.node",
@@ -34,9 +34,9 @@ export async function diagnose(options, execute = executeProcess) {
34
34
  if (capabilities.placement === "mounted") {
35
35
  const engine = await diagnosticProbe({
36
36
  id: "provider.cli",
37
- command: { executable: provider, arguments: ["--version"] },
37
+ command: { executable: sandboxProvider, arguments: ["--version"] },
38
38
  failureStatus: "fail",
39
- remedy: `Install ${provider} and make it available on PATH.`,
39
+ remedy: `Install ${sandboxProvider} and make it available on PATH.`,
40
40
  readVersion: true,
41
41
  }, execute);
42
42
  checks.push(engine);
@@ -44,11 +44,11 @@ export async function diagnose(options, execute = executeProcess) {
44
44
  checks.push(await diagnosticProbe({
45
45
  id: "provider.connection",
46
46
  command: {
47
- executable: provider,
47
+ executable: sandboxProvider,
48
48
  arguments: ["info"],
49
49
  },
50
50
  failureStatus: "fail",
51
- remedy: `Check ${provider} is running and accessible to this user; on macOS, start its virtual machine.`,
51
+ remedy: `Check ${sandboxProvider} is running and accessible to this user; on macOS, start its virtual machine.`,
52
52
  }, execute));
53
53
  checks.push(await diagnosticProbe({
54
54
  id: "host.tar",
@@ -65,16 +65,15 @@ export async function diagnose(options, execute = executeProcess) {
65
65
  });
66
66
  checks.push(await diagnosticProbe({
67
67
  id: "agent.host",
68
- command: { executable: agent, arguments: ["--version"] },
68
+ ...agentVersionProbe(agent),
69
69
  failureStatus: "warn",
70
70
  remedy: "Host CLI is unavailable or unverified. A sandbox may have its own CLI; dispatch can bootstrap a missing agent.",
71
- readVersion: true,
72
- referenceVersion: agentVersions[agent],
73
71
  }, execute));
74
- if (image !== undefined && (provider === "docker" || provider === "podman")) {
72
+ if (image !== undefined &&
73
+ (sandboxProvider === "docker" || sandboxProvider === "podman")) {
75
74
  const connected = checks.some((check) => check.id === "provider.connection" && check.status === "pass");
76
75
  if (connected)
77
- checks.push(...(await diagnoseImage({ provider, agent, image }, execute)));
76
+ checks.push(...(await diagnoseImage({ sandboxProvider, agent, image }, execute)));
78
77
  else
79
78
  checks.push({
80
79
  id: "image.runtime",