@elie-laloum/outpost 5.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (647) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +11 -11
  3. package/SECURITY.md +10 -0
  4. package/dist/adapters/agents/antigravity-adapter.d.ts +3 -0
  5. package/dist/adapters/agents/antigravity-adapter.js +41 -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 +75 -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 +37 -0
  18. package/dist/adapters/agents/antigravity-request.js.map +1 -0
  19. package/dist/adapters/agents/antigravity.constants.d.ts +3 -0
  20. package/dist/adapters/agents/antigravity.constants.js +4 -0
  21. package/dist/adapters/agents/antigravity.constants.js.map +1 -0
  22. package/dist/adapters/agents/{gemini.types.d.ts → antigravity.types.d.ts} +2 -2
  23. package/dist/adapters/agents/antigravity.types.js +2 -0
  24. package/dist/adapters/agents/antigravity.types.js.map +1 -0
  25. package/dist/adapters/agents/authentication.constants.d.ts +19 -9
  26. package/dist/adapters/agents/authentication.constants.js +12 -9
  27. package/dist/adapters/agents/authentication.constants.js.map +1 -1
  28. package/dist/adapters/agents/authentication.d.ts +11 -2
  29. package/dist/adapters/agents/authentication.js +70 -47
  30. package/dist/adapters/agents/authentication.js.map +1 -1
  31. package/dist/adapters/agents/authentication.types.d.ts +20 -0
  32. package/dist/adapters/agents/authentication.types.js +2 -0
  33. package/dist/adapters/agents/authentication.types.js.map +1 -0
  34. package/dist/adapters/agents/claude-adapter.js +4 -2
  35. package/dist/adapters/agents/claude-adapter.js.map +1 -1
  36. package/dist/adapters/agents/claude-authentication.d.ts +2 -0
  37. package/dist/adapters/agents/claude-authentication.js +34 -0
  38. package/dist/adapters/agents/claude-authentication.js.map +1 -0
  39. package/dist/adapters/agents/claude-events.js +52 -9
  40. package/dist/adapters/agents/claude-events.js.map +1 -1
  41. package/dist/adapters/agents/claude-request.js +2 -0
  42. package/dist/adapters/agents/claude-request.js.map +1 -1
  43. package/dist/adapters/agents/cli-diagnostics.constants.d.ts +6 -6
  44. package/dist/adapters/agents/cli-diagnostics.constants.js +6 -6
  45. package/dist/adapters/agents/cli-diagnostics.constants.js.map +1 -1
  46. package/dist/adapters/agents/cli-diagnostics.d.ts +1 -0
  47. package/dist/adapters/agents/cli-diagnostics.js +18 -0
  48. package/dist/adapters/agents/cli-diagnostics.js.map +1 -1
  49. package/dist/adapters/agents/codex-adapter.js +4 -2
  50. package/dist/adapters/agents/codex-adapter.js.map +1 -1
  51. package/dist/adapters/agents/codex-authentication.d.ts +3 -0
  52. package/dist/adapters/agents/codex-authentication.js +47 -0
  53. package/dist/adapters/agents/codex-authentication.js.map +1 -0
  54. package/dist/adapters/agents/codex-events.js +28 -2
  55. package/dist/adapters/agents/codex-events.js.map +1 -1
  56. package/dist/adapters/agents/copilot-adapter.d.ts +3 -0
  57. package/dist/adapters/agents/copilot-adapter.js +45 -0
  58. package/dist/adapters/agents/copilot-adapter.js.map +1 -0
  59. package/dist/adapters/agents/copilot-authentication.d.ts +2 -0
  60. package/dist/adapters/agents/copilot-authentication.js +46 -0
  61. package/dist/adapters/agents/copilot-authentication.js.map +1 -0
  62. package/dist/adapters/agents/copilot-diagnostics.d.ts +1 -0
  63. package/dist/adapters/agents/copilot-diagnostics.js +6 -0
  64. package/dist/adapters/agents/copilot-diagnostics.js.map +1 -0
  65. package/dist/adapters/agents/copilot-events.d.ts +2 -0
  66. package/dist/adapters/agents/copilot-events.js +66 -0
  67. package/dist/adapters/agents/copilot-events.js.map +1 -0
  68. package/dist/adapters/agents/copilot-request.d.ts +5 -0
  69. package/dist/adapters/agents/copilot-request.js +24 -0
  70. package/dist/adapters/agents/copilot-request.js.map +1 -0
  71. package/dist/adapters/agents/copilot-usage.d.ts +3 -0
  72. package/dist/adapters/agents/copilot-usage.js +19 -0
  73. package/dist/adapters/agents/copilot-usage.js.map +1 -0
  74. package/dist/adapters/agents/copilot.types.d.ts +6 -0
  75. package/dist/adapters/agents/copilot.types.js +2 -0
  76. package/dist/adapters/agents/copilot.types.js.map +1 -0
  77. package/dist/adapters/agents/event-decoder.d.ts +2 -2
  78. package/dist/adapters/agents/event-decoder.js +6 -5
  79. package/dist/adapters/agents/event-decoder.js.map +1 -1
  80. package/dist/adapters/agents/kimi-adapter.d.ts +3 -0
  81. package/dist/adapters/agents/kimi-adapter.js +51 -0
  82. package/dist/adapters/agents/kimi-adapter.js.map +1 -0
  83. package/dist/adapters/agents/kimi-authentication.d.ts +3 -0
  84. package/dist/adapters/agents/kimi-authentication.js +63 -0
  85. package/dist/adapters/agents/kimi-authentication.js.map +1 -0
  86. package/dist/adapters/agents/kimi-diagnostics.d.ts +2 -0
  87. package/dist/adapters/agents/kimi-diagnostics.js +14 -0
  88. package/dist/adapters/agents/kimi-diagnostics.js.map +1 -0
  89. package/dist/adapters/agents/kimi-events.d.ts +2 -0
  90. package/dist/adapters/agents/kimi-events.js +55 -0
  91. package/dist/adapters/agents/kimi-events.js.map +1 -0
  92. package/dist/adapters/agents/kimi-fork.d.ts +2 -0
  93. package/dist/adapters/agents/kimi-fork.js +11 -0
  94. package/dist/adapters/agents/kimi-fork.js.map +1 -0
  95. package/dist/adapters/agents/{gemini-request.d.ts → kimi-request.d.ts} +2 -2
  96. package/dist/adapters/agents/kimi-request.js +33 -0
  97. package/dist/adapters/agents/kimi-request.js.map +1 -0
  98. package/dist/adapters/agents/kimi-usage.d.ts +2 -0
  99. package/dist/adapters/agents/kimi-usage.js +7 -0
  100. package/dist/adapters/agents/kimi-usage.js.map +1 -0
  101. package/dist/adapters/agents/kimi.constants.d.ts +13 -0
  102. package/dist/adapters/agents/kimi.constants.js +14 -0
  103. package/dist/adapters/agents/kimi.constants.js.map +1 -0
  104. package/dist/adapters/agents/kimi.types.d.ts +7 -0
  105. package/dist/adapters/agents/kimi.types.js +2 -0
  106. package/dist/adapters/agents/kimi.types.js.map +1 -0
  107. package/dist/adapters/agents/model-support.constants.d.ts +3 -1
  108. package/dist/adapters/agents/model-support.constants.js +12 -2
  109. package/dist/adapters/agents/model-support.constants.js.map +1 -1
  110. package/dist/adapters/agents/protocol-fixtures.constants.d.ts +2 -2
  111. package/dist/adapters/agents/protocol-fixtures.constants.js +131 -9
  112. package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -1
  113. package/dist/adapters/agents/protocol-fixtures.types.d.ts +1 -0
  114. package/dist/adapters/agents/protocol-fixtures.types.js.map +1 -1
  115. package/dist/adapters/agents/protocol.d.ts +1 -0
  116. package/dist/adapters/agents/protocol.js +9 -0
  117. package/dist/adapters/agents/protocol.js.map +1 -1
  118. package/dist/adapters/agents/session-usage.constants.d.ts +10 -0
  119. package/dist/adapters/agents/session-usage.constants.js +110 -0
  120. package/dist/adapters/agents/session-usage.constants.js.map +1 -0
  121. package/dist/adapters/agents/session-usage.d.ts +5 -0
  122. package/dist/adapters/agents/session-usage.js +45 -0
  123. package/dist/adapters/agents/session-usage.js.map +1 -0
  124. package/dist/adapters/agents/settings.types.d.ts +1 -0
  125. package/dist/adapters/agents/settings.types.js.map +1 -1
  126. package/dist/adapters/agents/tool-result.d.ts +2 -0
  127. package/dist/adapters/agents/tool-result.js +17 -0
  128. package/dist/adapters/agents/tool-result.js.map +1 -0
  129. package/dist/adapters/models/anthropic-response.js +3 -0
  130. package/dist/adapters/models/anthropic-response.js.map +1 -1
  131. package/dist/adapters/models/http-provider.js +6 -1
  132. package/dist/adapters/models/http-provider.js.map +1 -1
  133. package/dist/adapters/models/openai-responses.js +10 -0
  134. package/dist/adapters/models/openai-responses.js.map +1 -1
  135. package/dist/adapters/models/retry-after.d.ts +1 -0
  136. package/dist/adapters/models/retry-after.js +16 -0
  137. package/dist/adapters/models/retry-after.js.map +1 -0
  138. package/dist/application/activity-watchdog.js +1 -2
  139. package/dist/application/activity-watchdog.js.map +1 -1
  140. package/dist/application/agent-authentication.d.ts +4 -0
  141. package/dist/application/agent-authentication.js +32 -0
  142. package/dist/application/agent-authentication.js.map +1 -0
  143. package/dist/application/agent-bootstrap.constants.d.ts +2 -5
  144. package/dist/application/agent-bootstrap.constants.js +27 -4
  145. package/dist/application/agent-bootstrap.constants.js.map +1 -1
  146. package/dist/application/agent-bootstrap.js +39 -12
  147. package/dist/application/agent-bootstrap.js.map +1 -1
  148. package/dist/application/agent-bootstrap.types.d.ts +19 -0
  149. package/dist/application/agent-bootstrap.types.js +2 -0
  150. package/dist/application/agent-bootstrap.types.js.map +1 -0
  151. package/dist/application/agent-output.js +74 -8
  152. package/dist/application/agent-output.js.map +1 -1
  153. package/dist/application/agent-request.d.ts +3 -0
  154. package/dist/application/agent-request.js +11 -0
  155. package/dist/application/agent-request.js.map +1 -0
  156. package/dist/application/agent-turn.js +74 -6
  157. package/dist/application/agent-turn.js.map +1 -1
  158. package/dist/application/agent-usage.d.ts +6 -0
  159. package/dist/application/agent-usage.js +57 -0
  160. package/dist/application/agent-usage.js.map +1 -0
  161. package/dist/application/attach.js +2 -0
  162. package/dist/application/attach.js.map +1 -1
  163. package/dist/application/credential-installer.constants.d.ts +1 -0
  164. package/dist/application/credential-installer.constants.js +22 -0
  165. package/dist/application/credential-installer.constants.js.map +1 -0
  166. package/dist/application/custom-turn.js +44 -49
  167. package/dist/application/custom-turn.js.map +1 -1
  168. package/dist/application/dispatch-observation.d.ts +1 -1
  169. package/dist/application/dispatch-observation.js +141 -21
  170. package/dist/application/dispatch-observation.js.map +1 -1
  171. package/dist/application/dispatch-observation.types.d.ts +2 -0
  172. package/dist/application/dispatch-observation.types.js.map +1 -1
  173. package/dist/application/dispatch-validation.js +2 -0
  174. package/dist/application/dispatch-validation.js.map +1 -1
  175. package/dist/application/dispatch.js +1 -1
  176. package/dist/application/dispatch.js.map +1 -1
  177. package/dist/application/doctor-agent.constants.d.ts +2 -8
  178. package/dist/application/doctor-agent.constants.js +43 -6
  179. package/dist/application/doctor-agent.constants.js.map +1 -1
  180. package/dist/application/doctor-agent.d.ts +2 -1
  181. package/dist/application/doctor-agent.js +15 -3
  182. package/dist/application/doctor-agent.js.map +1 -1
  183. package/dist/application/doctor-image.js +4 -6
  184. package/dist/application/doctor-image.js.map +1 -1
  185. package/dist/application/doctor-protocol.js +6 -11
  186. package/dist/application/doctor-protocol.js.map +1 -1
  187. package/dist/application/doctor-protocol.types.d.ts +1 -1
  188. package/dist/application/doctor-protocol.types.js.map +1 -1
  189. package/dist/application/doctor-sandbox.js +2 -5
  190. package/dist/application/doctor-sandbox.js.map +1 -1
  191. package/dist/application/doctor.js +28 -10
  192. package/dist/application/doctor.js.map +1 -1
  193. package/dist/application/doctor.types.d.ts +10 -1
  194. package/dist/application/doctor.types.js.map +1 -1
  195. package/dist/application/execution.constants.d.ts +2 -0
  196. package/dist/application/execution.constants.js +2 -0
  197. package/dist/application/execution.constants.js.map +1 -1
  198. package/dist/application/execution.types.d.ts +8 -0
  199. package/dist/application/execution.types.js.map +1 -1
  200. package/dist/application/harness-budget.d.ts +3 -0
  201. package/dist/application/harness-budget.js +42 -0
  202. package/dist/application/harness-budget.js.map +1 -0
  203. package/dist/application/harness-budget.types.d.ts +5 -0
  204. package/dist/application/harness-budget.types.js +2 -0
  205. package/dist/application/harness-budget.types.js.map +1 -0
  206. package/dist/application/harness-hooks.js +34 -3
  207. package/dist/application/harness-hooks.js.map +1 -1
  208. package/dist/application/harness-loop.js +52 -24
  209. package/dist/application/harness-loop.js.map +1 -1
  210. package/dist/application/harness-model-provider.d.ts +3 -0
  211. package/dist/application/harness-model-provider.js +49 -0
  212. package/dist/application/harness-model-provider.js.map +1 -0
  213. package/dist/application/harness-model-provider.types.d.ts +10 -0
  214. package/dist/application/harness-model-provider.types.js +2 -0
  215. package/dist/application/harness-model-provider.types.js.map +1 -0
  216. package/dist/application/harness-subagent.d.ts +4 -0
  217. package/dist/application/harness-subagent.js +110 -0
  218. package/dist/application/harness-subagent.js.map +1 -0
  219. package/dist/application/harness.types.d.ts +11 -0
  220. package/dist/application/harness.types.js.map +1 -1
  221. package/dist/application/lifecycle-hooks.d.ts +1 -1
  222. package/dist/application/lifecycle-hooks.js +5 -4
  223. package/dist/application/lifecycle-hooks.js.map +1 -1
  224. package/dist/application/observed-lease.d.ts +3 -0
  225. package/dist/application/observed-lease.js +26 -0
  226. package/dist/application/observed-lease.js.map +1 -0
  227. package/dist/application/outpost.types.d.ts +3 -1
  228. package/dist/application/outpost.types.js.map +1 -1
  229. package/dist/application/output-lines.d.ts +4 -0
  230. package/dist/application/output-lines.js +28 -0
  231. package/dist/application/output-lines.js.map +1 -0
  232. package/dist/application/queue-worker.js +1 -1
  233. package/dist/application/queue-worker.js.map +1 -1
  234. package/dist/application/queue-worker.types.d.ts +1 -0
  235. package/dist/application/queue-worker.types.js.map +1 -1
  236. package/dist/application/queued-task.js +24 -5
  237. package/dist/application/queued-task.js.map +1 -1
  238. package/dist/application/recovery-archive.d.ts +3 -2
  239. package/dist/application/recovery-archive.js +9 -2
  240. package/dist/application/recovery-archive.js.map +1 -1
  241. package/dist/application/recovery-restore.d.ts +3 -2
  242. package/dist/application/recovery-restore.js +9 -2
  243. package/dist/application/recovery-restore.js.map +1 -1
  244. package/dist/application/recovery-retention.d.ts +3 -2
  245. package/dist/application/recovery-retention.js +74 -26
  246. package/dist/application/recovery-retention.js.map +1 -1
  247. package/dist/application/remote-workspace.js +5 -4
  248. package/dist/application/remote-workspace.js.map +1 -1
  249. package/dist/application/remote-workspace.types.d.ts +1 -0
  250. package/dist/application/remote-workspace.types.js.map +1 -1
  251. package/dist/application/sandbox-agents.js +19 -19
  252. package/dist/application/sandbox-agents.js.map +1 -1
  253. package/dist/application/sandbox-attach.js +12 -3
  254. package/dist/application/sandbox-attach.js.map +1 -1
  255. package/dist/application/sandbox-dispatch.js +13 -27
  256. package/dist/application/sandbox-dispatch.js.map +1 -1
  257. package/dist/application/sandbox-provision.js +15 -9
  258. package/dist/application/sandbox-provision.js.map +1 -1
  259. package/dist/application/sandbox-session.types.d.ts +7 -2
  260. package/dist/application/sandbox-session.types.js.map +1 -1
  261. package/dist/application/sandbox.js +13 -6
  262. package/dist/application/sandbox.js.map +1 -1
  263. package/dist/application/speculation-checkpoint.d.ts +6 -0
  264. package/dist/application/speculation-checkpoint.js +206 -0
  265. package/dist/application/speculation-checkpoint.js.map +1 -0
  266. package/dist/application/speculation-checkpoint.types.d.ts +24 -0
  267. package/dist/application/speculation-checkpoint.types.js +2 -0
  268. package/dist/application/speculation-checkpoint.types.js.map +1 -0
  269. package/dist/application/speculation-integration.constants.d.ts +4 -0
  270. package/dist/application/speculation-integration.constants.js +5 -0
  271. package/dist/application/speculation-integration.constants.js.map +1 -0
  272. package/dist/application/speculation-integration.d.ts +2 -0
  273. package/dist/application/speculation-integration.js +67 -0
  274. package/dist/application/speculation-integration.js.map +1 -0
  275. package/dist/application/speculation-resume.d.ts +4 -0
  276. package/dist/application/speculation-resume.js +71 -0
  277. package/dist/application/speculation-resume.js.map +1 -0
  278. package/dist/application/speculation-run.d.ts +4 -0
  279. package/dist/application/speculation-run.js +320 -0
  280. package/dist/application/speculation-run.js.map +1 -0
  281. package/dist/application/speculation-timeout.d.ts +1 -0
  282. package/dist/application/speculation-timeout.js +15 -0
  283. package/dist/application/speculation-timeout.js.map +1 -0
  284. package/dist/application/speculation.constants.d.ts +1 -0
  285. package/dist/application/speculation.constants.js +5 -1
  286. package/dist/application/speculation.constants.js.map +1 -1
  287. package/dist/application/speculation.js +41 -149
  288. package/dist/application/speculation.js.map +1 -1
  289. package/dist/application/speculation.types.d.ts +23 -0
  290. package/dist/application/speculation.types.js.map +1 -1
  291. package/dist/application/startup-recovery.js +14 -1
  292. package/dist/application/startup-recovery.js.map +1 -1
  293. package/dist/application/startup-recovery.types.d.ts +1 -0
  294. package/dist/application/startup-recovery.types.js.map +1 -1
  295. package/dist/application/stop-reason.d.ts +2 -0
  296. package/dist/application/stop-reason.js +21 -0
  297. package/dist/application/stop-reason.js.map +1 -0
  298. package/dist/application/stop-reason.types.d.ts +4 -0
  299. package/dist/application/stop-reason.types.js +2 -0
  300. package/dist/application/stop-reason.types.js.map +1 -0
  301. package/dist/application/storage-reservation.js +9 -2
  302. package/dist/application/storage-reservation.js.map +1 -1
  303. package/dist/application/task-observation.d.ts +3 -0
  304. package/dist/application/task-observation.js +22 -0
  305. package/dist/application/task-observation.js.map +1 -0
  306. package/dist/application/task-usage.js +5 -12
  307. package/dist/application/task-usage.js.map +1 -1
  308. package/dist/application/tasks.js +41 -16
  309. package/dist/application/tasks.js.map +1 -1
  310. package/dist/application/tool-execution.js +42 -19
  311. package/dist/application/tool-execution.js.map +1 -1
  312. package/dist/application/workspace.js +6 -4
  313. package/dist/application/workspace.js.map +1 -1
  314. package/dist/cli/doctor-command.js +6 -2
  315. package/dist/cli/doctor-command.js.map +1 -1
  316. package/dist/cli/init-authentication.d.ts +4 -1
  317. package/dist/cli/init-authentication.js +28 -33
  318. package/dist/cli/init-authentication.js.map +1 -1
  319. package/dist/cli/init-command.js +3 -3
  320. package/dist/cli/init-command.js.map +1 -1
  321. package/dist/cli/main.constants.d.ts +50 -13
  322. package/dist/cli/main.constants.js +70 -8
  323. package/dist/cli/main.constants.js.map +1 -1
  324. package/dist/cli/main.js +2 -1
  325. package/dist/cli/main.js.map +1 -1
  326. package/dist/cli/scaffold-files.js +1 -1
  327. package/dist/cli/scaffold-files.js.map +1 -1
  328. package/dist/cli/scaffold-validation.js +29 -22
  329. package/dist/cli/scaffold-validation.js.map +1 -1
  330. package/dist/cli/scaffold.constants.d.ts +0 -1
  331. package/dist/cli/scaffold.constants.js +6 -2
  332. package/dist/cli/scaffold.constants.js.map +1 -1
  333. package/dist/cli/scaffold.types.d.ts +8 -2
  334. package/dist/cli/scaffold.types.js.map +1 -1
  335. package/dist/cli/starters.js +1 -3
  336. package/dist/cli/starters.js.map +1 -1
  337. package/dist/domain/agent-observation.d.ts +4 -0
  338. package/dist/domain/agent-observation.js +27 -0
  339. package/dist/domain/agent-observation.js.map +1 -0
  340. package/dist/domain/agent.types.d.ts +122 -14
  341. package/dist/domain/agent.types.js.map +1 -1
  342. package/dist/domain/authentication.constants.d.ts +3 -0
  343. package/dist/domain/authentication.constants.js +11 -0
  344. package/dist/domain/authentication.constants.js.map +1 -0
  345. package/dist/domain/authentication.d.ts +3 -0
  346. package/dist/domain/authentication.js +22 -0
  347. package/dist/domain/authentication.js.map +1 -0
  348. package/dist/domain/authentication.types.d.ts +5 -0
  349. package/dist/domain/authentication.types.js +2 -0
  350. package/dist/domain/authentication.types.js.map +1 -0
  351. package/dist/domain/harness.d.ts +2 -2
  352. package/dist/domain/harness.js +6 -0
  353. package/dist/domain/harness.js.map +1 -1
  354. package/dist/domain/harness.types.d.ts +4 -3
  355. package/dist/domain/harness.types.js.map +1 -1
  356. package/dist/domain/model.types.d.ts +8 -0
  357. package/dist/domain/model.types.js.map +1 -1
  358. package/dist/domain/observation.constants.d.ts +8 -0
  359. package/dist/domain/observation.constants.js +9 -0
  360. package/dist/domain/observation.constants.js.map +1 -0
  361. package/dist/domain/observation.d.ts +2 -0
  362. package/dist/domain/observation.js +190 -0
  363. package/dist/domain/observation.js.map +1 -0
  364. package/dist/domain/observation.types.d.ts +84 -0
  365. package/dist/domain/observation.types.js +2 -0
  366. package/dist/domain/observation.types.js.map +1 -0
  367. package/dist/domain/observed-operation.d.ts +2 -0
  368. package/dist/domain/observed-operation.js +30 -0
  369. package/dist/domain/observed-operation.js.map +1 -0
  370. package/dist/domain/sandbox.types.d.ts +2 -0
  371. package/dist/domain/sandbox.types.js.map +1 -1
  372. package/dist/domain/subagent.constants.d.ts +13 -0
  373. package/dist/domain/subagent.constants.js +9 -0
  374. package/dist/domain/subagent.constants.js.map +1 -0
  375. package/dist/domain/subagent.d.ts +4 -0
  376. package/dist/domain/subagent.js +28 -0
  377. package/dist/domain/subagent.js.map +1 -0
  378. package/dist/domain/subagent.types.d.ts +13 -0
  379. package/dist/domain/subagent.types.js +2 -0
  380. package/dist/domain/subagent.types.js.map +1 -0
  381. package/dist/domain/transcript.types.d.ts +2 -0
  382. package/dist/domain/transcript.types.js.map +1 -1
  383. package/dist/domain/usage.d.ts +1 -0
  384. package/dist/domain/usage.js +16 -0
  385. package/dist/domain/usage.js.map +1 -1
  386. package/dist/domain/workflow/budget.d.ts +7 -3
  387. package/dist/domain/workflow/budget.js +26 -0
  388. package/dist/domain/workflow/budget.js.map +1 -1
  389. package/dist/domain/workflow/budget.types.d.ts +1 -1
  390. package/dist/domain/workflow/budget.types.js.map +1 -1
  391. package/dist/domain/workflow/checkpoint-validation.js +7 -1
  392. package/dist/domain/workflow/checkpoint-validation.js.map +1 -1
  393. package/dist/domain/workflow/checkpoint.js +3 -0
  394. package/dist/domain/workflow/checkpoint.js.map +1 -1
  395. package/dist/domain/workflow/gate-validation.js +14 -1
  396. package/dist/domain/workflow/gate-validation.js.map +1 -1
  397. package/dist/domain/workflow/gates.d.ts +1 -1
  398. package/dist/domain/workflow/gates.js +52 -4
  399. package/dist/domain/workflow/gates.js.map +1 -1
  400. package/dist/domain/workflow/gates.types.d.ts +15 -1
  401. package/dist/domain/workflow/gates.types.js.map +1 -1
  402. package/dist/domain/workflow/idempotency.d.ts +1 -0
  403. package/dist/domain/workflow/idempotency.js +7 -0
  404. package/dist/domain/workflow/idempotency.js.map +1 -0
  405. package/dist/domain/workflow/retry.constants.d.ts +2 -0
  406. package/dist/domain/workflow/retry.constants.js +3 -0
  407. package/dist/domain/workflow/retry.constants.js.map +1 -0
  408. package/dist/domain/workflow/retry.d.ts +4 -0
  409. package/dist/domain/workflow/retry.js +49 -0
  410. package/dist/domain/workflow/retry.js.map +1 -0
  411. package/dist/domain/workflow/task-runner.js +9 -5
  412. package/dist/domain/workflow/task-runner.js.map +1 -1
  413. package/dist/domain/workflow/task.js +6 -6
  414. package/dist/domain/workflow/task.js.map +1 -1
  415. package/dist/domain/workflow/workflow-scheduler.js +110 -72
  416. package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
  417. package/dist/domain/workflow/workflow-state.js +28 -12
  418. package/dist/domain/workflow/workflow-state.js.map +1 -1
  419. package/dist/domain/workflow.d.ts +1 -1
  420. package/dist/domain/workflow.js +1 -1
  421. package/dist/domain/workflow.js.map +1 -1
  422. package/dist/domain/workflow.types.d.ts +13 -2
  423. package/dist/domain/workflow.types.js.map +1 -1
  424. package/dist/index.d.ts +16 -11
  425. package/dist/index.js +7 -4
  426. package/dist/index.js.map +1 -1
  427. package/dist/infrastructure/conversations/capture.js +10 -0
  428. package/dist/infrastructure/conversations/capture.js.map +1 -1
  429. package/dist/infrastructure/conversations/harness-transcript.js +6 -0
  430. package/dist/infrastructure/conversations/harness-transcript.js.map +1 -1
  431. package/dist/infrastructure/conversations/harness-transcript.types.d.ts +2 -0
  432. package/dist/infrastructure/conversations/harness-transcript.types.js.map +1 -1
  433. package/dist/infrastructure/conversations/layout.js +2 -0
  434. package/dist/infrastructure/conversations/layout.js.map +1 -1
  435. package/dist/infrastructure/conversations/locate.js +7 -1
  436. package/dist/infrastructure/conversations/locate.js.map +1 -1
  437. package/dist/infrastructure/conversations/native-store.js +8 -1
  438. package/dist/infrastructure/conversations/native-store.js.map +1 -1
  439. package/dist/infrastructure/conversations/paths.js +3 -0
  440. package/dist/infrastructure/conversations/paths.js.map +1 -1
  441. package/dist/infrastructure/conversations/restore.js +7 -0
  442. package/dist/infrastructure/conversations/restore.js.map +1 -1
  443. package/dist/infrastructure/conversations/session-bundle.constants.d.ts +5 -0
  444. package/dist/infrastructure/conversations/session-bundle.constants.js +173 -0
  445. package/dist/infrastructure/conversations/session-bundle.constants.js.map +1 -0
  446. package/dist/infrastructure/conversations/session-bundle.d.ts +6 -0
  447. package/dist/infrastructure/conversations/session-bundle.js +98 -0
  448. package/dist/infrastructure/conversations/session-bundle.js.map +1 -0
  449. package/dist/infrastructure/conversations/session-bundle.types.d.ts +1 -0
  450. package/dist/infrastructure/conversations/session-bundle.types.js +2 -0
  451. package/dist/infrastructure/conversations/session-bundle.types.js.map +1 -0
  452. package/dist/infrastructure/conversations.js +4 -2
  453. package/dist/infrastructure/conversations.js.map +1 -1
  454. package/dist/infrastructure/conversations.types.d.ts +1 -1
  455. package/dist/infrastructure/conversations.types.js.map +1 -1
  456. package/dist/infrastructure/custom-reporter.js +32 -24
  457. package/dist/infrastructure/custom-reporter.js.map +1 -1
  458. package/dist/infrastructure/custom-reporter.types.d.ts +2 -0
  459. package/dist/infrastructure/custom-reporter.types.js.map +1 -1
  460. package/dist/infrastructure/git/git.constants.d.ts +1 -1
  461. package/dist/infrastructure/git/git.constants.js +1 -0
  462. package/dist/infrastructure/git/git.constants.js.map +1 -1
  463. package/dist/infrastructure/git/workspace-lease.js +4 -3
  464. package/dist/infrastructure/git/workspace-lease.js.map +1 -1
  465. package/dist/infrastructure/git/workspace.js +7 -6
  466. package/dist/infrastructure/git/workspace.js.map +1 -1
  467. package/dist/infrastructure/git/workspace.types.d.ts +1 -0
  468. package/dist/infrastructure/git/workspace.types.js.map +1 -1
  469. package/dist/infrastructure/host-credentials.constants.d.ts +1 -0
  470. package/dist/infrastructure/host-credentials.constants.js +2 -0
  471. package/dist/infrastructure/host-credentials.constants.js.map +1 -0
  472. package/dist/infrastructure/host-credentials.d.ts +4 -0
  473. package/dist/infrastructure/host-credentials.js +89 -0
  474. package/dist/infrastructure/host-credentials.js.map +1 -0
  475. package/dist/infrastructure/inspection-path.js +4 -3
  476. package/dist/infrastructure/inspection-path.js.map +1 -1
  477. package/dist/infrastructure/journal.constants.js +10 -1
  478. package/dist/infrastructure/journal.constants.js.map +1 -1
  479. package/dist/infrastructure/journal.d.ts +1 -1
  480. package/dist/infrastructure/journal.js +8 -75
  481. package/dist/infrastructure/journal.js.map +1 -1
  482. package/dist/infrastructure/journal.types.d.ts +2 -4
  483. package/dist/infrastructure/journal.types.js.map +1 -1
  484. package/dist/infrastructure/local-transport.js +9 -4
  485. package/dist/infrastructure/local-transport.js.map +1 -1
  486. package/dist/infrastructure/opentelemetry-dispatch.d.ts +3 -3
  487. package/dist/infrastructure/opentelemetry-dispatch.js +5 -4
  488. package/dist/infrastructure/opentelemetry-dispatch.js.map +1 -1
  489. package/dist/infrastructure/opentelemetry-observation.d.ts +5 -0
  490. package/dist/infrastructure/opentelemetry-observation.js +59 -0
  491. package/dist/infrastructure/opentelemetry-observation.js.map +1 -0
  492. package/dist/infrastructure/opentelemetry.js +15 -1
  493. package/dist/infrastructure/opentelemetry.js.map +1 -1
  494. package/dist/infrastructure/opentelemetry.types.d.ts +9 -1
  495. package/dist/infrastructure/opentelemetry.types.js.map +1 -1
  496. package/dist/infrastructure/reporter.d.ts +2 -2
  497. package/dist/infrastructure/reporter.js +5 -1
  498. package/dist/infrastructure/reporter.js.map +1 -1
  499. package/dist/infrastructure/repository-transport.constants.d.ts +1 -0
  500. package/dist/infrastructure/repository-transport.constants.js +2 -0
  501. package/dist/infrastructure/repository-transport.constants.js.map +1 -0
  502. package/dist/infrastructure/repository-transport.d.ts +2 -0
  503. package/dist/infrastructure/repository-transport.js +9 -0
  504. package/dist/infrastructure/repository-transport.js.map +1 -0
  505. package/dist/infrastructure/resource-activity-inspection.js +19 -24
  506. package/dist/infrastructure/resource-activity-inspection.js.map +1 -1
  507. package/dist/infrastructure/resource-activity.constants.d.ts +0 -1
  508. package/dist/infrastructure/resource-activity.constants.js +0 -1
  509. package/dist/infrastructure/resource-activity.constants.js.map +1 -1
  510. package/dist/infrastructure/resource-activity.js +20 -83
  511. package/dist/infrastructure/resource-activity.js.map +1 -1
  512. package/dist/infrastructure/s3-transport.constants.d.ts +2 -0
  513. package/dist/infrastructure/s3-transport.constants.js +3 -0
  514. package/dist/infrastructure/s3-transport.constants.js.map +1 -0
  515. package/dist/infrastructure/s3-transport.js +57 -3
  516. package/dist/infrastructure/s3-transport.js.map +1 -1
  517. package/dist/infrastructure/s3-transport.types.d.ts +1 -0
  518. package/dist/infrastructure/s3-transport.types.js.map +1 -1
  519. package/dist/infrastructure/speculation-store.constants.d.ts +3 -0
  520. package/dist/infrastructure/speculation-store.constants.js +2 -0
  521. package/dist/infrastructure/speculation-store.constants.js.map +1 -0
  522. package/dist/infrastructure/speculation-store.d.ts +4 -0
  523. package/dist/infrastructure/speculation-store.js +73 -0
  524. package/dist/infrastructure/speculation-store.js.map +1 -0
  525. package/dist/infrastructure/speculation-store.types.d.ts +12 -0
  526. package/dist/infrastructure/speculation-store.types.js +2 -0
  527. package/dist/infrastructure/speculation-store.types.js.map +1 -0
  528. package/dist/infrastructure/storage-inventory.constants.js +1 -0
  529. package/dist/infrastructure/storage-inventory.constants.js.map +1 -1
  530. package/dist/infrastructure/storage-inventory.types.d.ts +1 -1
  531. package/dist/infrastructure/storage-inventory.types.js.map +1 -1
  532. package/dist/infrastructure/storage-reservations.types.d.ts +0 -8
  533. package/dist/infrastructure/storage-reservations.types.js.map +1 -1
  534. package/dist/infrastructure/task-queue-bullmq-resources.js +3 -0
  535. package/dist/infrastructure/task-queue-bullmq-resources.js.map +1 -1
  536. package/dist/infrastructure/task-queue-http.js +29 -4
  537. package/dist/infrastructure/task-queue-http.js.map +1 -1
  538. package/dist/infrastructure/task-queue-http.types.d.ts +2 -2
  539. package/dist/infrastructure/task-queue-http.types.js.map +1 -1
  540. package/dist/infrastructure/transport-conversations.js +2 -0
  541. package/dist/infrastructure/transport-conversations.js.map +1 -1
  542. package/dist/infrastructure/transport-journal.d.ts +1 -1
  543. package/dist/infrastructure/transport-journal.js +8 -2
  544. package/dist/infrastructure/transport-journal.js.map +1 -1
  545. package/dist/infrastructure/transport-reservations.d.ts +1 -1
  546. package/dist/infrastructure/transport-reservations.js +14 -8
  547. package/dist/infrastructure/transport-reservations.js.map +1 -1
  548. package/dist/infrastructure/workflow-decision-signature.constants.d.ts +4 -0
  549. package/dist/infrastructure/workflow-decision-signature.constants.js +5 -0
  550. package/dist/infrastructure/workflow-decision-signature.constants.js.map +1 -0
  551. package/dist/infrastructure/workflow-decision-signature.d.ts +4 -0
  552. package/dist/infrastructure/workflow-decision-signature.js +83 -0
  553. package/dist/infrastructure/workflow-decision-signature.js.map +1 -0
  554. package/dist/infrastructure/workflow-decision-signature.types.d.ts +16 -0
  555. package/dist/infrastructure/workflow-decision-signature.types.js +2 -0
  556. package/dist/infrastructure/workflow-decision-signature.types.js.map +1 -0
  557. package/dist/providers/agents.d.ts +7 -2
  558. package/dist/providers/agents.js +4 -1
  559. package/dist/providers/agents.js.map +1 -1
  560. package/dist/providers/antigravity-install.constants.d.ts +2 -0
  561. package/dist/providers/antigravity-install.constants.js +28 -0
  562. package/dist/providers/antigravity-install.constants.js.map +1 -0
  563. package/dist/providers/antigravity-install.d.ts +2 -0
  564. package/dist/providers/antigravity-install.js +29 -0
  565. package/dist/providers/antigravity-install.js.map +1 -0
  566. package/dist/providers/antigravity-install.types.d.ts +4 -0
  567. package/dist/providers/antigravity-install.types.js +2 -0
  568. package/dist/providers/antigravity-install.types.js.map +1 -0
  569. package/dist/providers/container-recovery.d.ts +4 -0
  570. package/dist/providers/container-recovery.js +28 -0
  571. package/dist/providers/container-recovery.js.map +1 -0
  572. package/dist/providers/container.js +8 -0
  573. package/dist/providers/container.js.map +1 -1
  574. package/dist/providers/daytona-network.constants.d.ts +5 -0
  575. package/dist/providers/daytona-network.constants.js +8 -0
  576. package/dist/providers/daytona-network.constants.js.map +1 -0
  577. package/dist/providers/daytona-network.d.ts +4 -0
  578. package/dist/providers/daytona-network.js +33 -0
  579. package/dist/providers/daytona-network.js.map +1 -0
  580. package/dist/providers/daytona.d.ts +1 -0
  581. package/dist/providers/daytona.js +9 -3
  582. package/dist/providers/daytona.js.map +1 -1
  583. package/dist/providers/daytona.types.d.ts +2 -0
  584. package/dist/providers/daytona.types.js.map +1 -1
  585. package/dist/providers/firecracker-command.js +1 -1
  586. package/dist/providers/firecracker-command.js.map +1 -1
  587. package/dist/providers/firecracker-jailer.constants.d.ts +9 -0
  588. package/dist/providers/firecracker-jailer.constants.js +10 -0
  589. package/dist/providers/firecracker-jailer.constants.js.map +1 -0
  590. package/dist/providers/firecracker-jailer.d.ts +4 -0
  591. package/dist/providers/firecracker-jailer.js +171 -0
  592. package/dist/providers/firecracker-jailer.js.map +1 -0
  593. package/dist/providers/firecracker-machine.js +30 -8
  594. package/dist/providers/firecracker-machine.js.map +1 -1
  595. package/dist/providers/firecracker.types.d.ts +16 -0
  596. package/dist/providers/firecracker.types.js.map +1 -1
  597. package/dist/providers/vercel-network.js +1 -1
  598. package/dist/providers/vercel-network.js.map +1 -1
  599. package/dist/providers/vercel.js +6 -3
  600. package/dist/providers/vercel.js.map +1 -1
  601. package/dist/providers/versions.constants.d.ts +3 -1
  602. package/dist/providers/versions.constants.js +3 -1
  603. package/dist/providers/versions.constants.js.map +1 -1
  604. package/package.json +3 -3
  605. package/dist/adapters/agents/gemini-adapter.d.ts +0 -3
  606. package/dist/adapters/agents/gemini-adapter.js +0 -34
  607. package/dist/adapters/agents/gemini-adapter.js.map +0 -1
  608. package/dist/adapters/agents/gemini-diagnostics.d.ts +0 -2
  609. package/dist/adapters/agents/gemini-diagnostics.js +0 -15
  610. package/dist/adapters/agents/gemini-diagnostics.js.map +0 -1
  611. package/dist/adapters/agents/gemini-events.d.ts +0 -2
  612. package/dist/adapters/agents/gemini-events.js +0 -50
  613. package/dist/adapters/agents/gemini-events.js.map +0 -1
  614. package/dist/adapters/agents/gemini-request.js +0 -23
  615. package/dist/adapters/agents/gemini-request.js.map +0 -1
  616. package/dist/adapters/agents/gemini.types.js +0 -2
  617. package/dist/adapters/agents/gemini.types.js.map +0 -1
  618. package/dist/infrastructure/artifact-store.d.ts +0 -3
  619. package/dist/infrastructure/artifact-store.js +0 -110
  620. package/dist/infrastructure/artifact-store.js.map +0 -1
  621. package/dist/infrastructure/artifact-store.types.d.ts +0 -6
  622. package/dist/infrastructure/artifact-store.types.js +0 -2
  623. package/dist/infrastructure/artifact-store.types.js.map +0 -1
  624. package/dist/infrastructure/journal-retention.constants.d.ts +0 -4
  625. package/dist/infrastructure/journal-retention.constants.js +0 -5
  626. package/dist/infrastructure/journal-retention.constants.js.map +0 -1
  627. package/dist/infrastructure/journal-retention.d.ts +0 -2
  628. package/dist/infrastructure/journal-retention.js +0 -51
  629. package/dist/infrastructure/journal-retention.js.map +0 -1
  630. package/dist/infrastructure/storage-mutation-lock.constants.d.ts +0 -5
  631. package/dist/infrastructure/storage-mutation-lock.constants.js +0 -6
  632. package/dist/infrastructure/storage-mutation-lock.constants.js.map +0 -1
  633. package/dist/infrastructure/storage-mutation-lock.d.ts +0 -1
  634. package/dist/infrastructure/storage-mutation-lock.js +0 -21
  635. package/dist/infrastructure/storage-mutation-lock.js.map +0 -1
  636. package/dist/infrastructure/storage-reservations.constants.d.ts +0 -4
  637. package/dist/infrastructure/storage-reservations.constants.js +0 -5
  638. package/dist/infrastructure/storage-reservations.constants.js.map +0 -1
  639. package/dist/infrastructure/storage-reservations.d.ts +0 -2
  640. package/dist/infrastructure/storage-reservations.js +0 -150
  641. package/dist/infrastructure/storage-reservations.js.map +0 -1
  642. package/dist/infrastructure/workflow-checkpoint.d.ts +0 -3
  643. package/dist/infrastructure/workflow-checkpoint.js +0 -84
  644. package/dist/infrastructure/workflow-checkpoint.js.map +0 -1
  645. package/dist/infrastructure/workflow-checkpoint.types.d.ts +0 -6
  646. package/dist/infrastructure/workflow-checkpoint.types.js +0 -2
  647. package/dist/infrastructure/workflow-checkpoint.types.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { agent } from "./domain/agent.ts";
2
+ export { defineHarnessSubagent } from "./domain/subagent.ts";
3
+ export type { HarnessSubagent, HarnessSubagentInput, HarnessSubagentOptions, } from "./domain/subagent.types.ts";
2
4
  export { harness } from "./domain/harness.ts";
3
5
  export { defineHarnessContextStrategy, summarizeHistory, truncateToolResults, } from "./domain/context.ts";
4
6
  export type { HarnessContextInput, HarnessContextResult, HarnessContextStrategy, HarnessContextStrategyOptions, SummarizeHistoryOptions, TruncateToolResultsOptions, } from "./domain/context.types.ts";
@@ -16,8 +18,8 @@ export { harnessGitTools } from "./adapters/tools/git-tools.ts";
16
18
  export { harnessSearchTools } from "./adapters/tools/search-tools.ts";
17
19
  export { harnessShellTools } from "./adapters/tools/shell-tools.ts";
18
20
  export type { ShellToolsOptions } from "./adapters/tools/tools.types.ts";
19
- export type { AgentAuthentication, Agent, AgentOptions, Harness, CliHarness, CliAgent, CustomAgent, } from "./domain/agent.types.ts";
20
- export type { CustomHarness, CustomHarnessOptions, HarnessInstructionContext, HarnessInstructions, HarnessInstructionSource, HarnessInstructionsOption, HarnessLimits, HarnessToolExecution, } from "./domain/harness.types.ts";
21
+ export type { AccountCredential, AgentAuthentication, Agent, AgentOptions, AgentHarness, CliHarness, CliAgent, CustomAgent, UsageCredential, } from "./domain/agent.types.ts";
22
+ export type { Harness, HarnessOptions, HarnessInstructionContext, HarnessInstructions, HarnessInstructionSource, HarnessInstructionsOption, HarnessLimits, HarnessToolExecution, } from "./domain/harness.types.ts";
21
23
  export type { HarnessTool, HarnessToolContext, HarnessToolEvent, HarnessToolOptions, HarnessToolset, HarnessToolsetOptions, JsonSchema, StandardJsonSchema, ToolOutput, ToolValidation, } from "./domain/tool.types.ts";
22
24
  export { TransportConflict } from "./domain/transport.ts";
23
25
  export type { Transport, TransportEntry, TransportObject, TransportReadOptions, TransportWriteOptions, TransportReference, TransportStoreOptions, } from "./domain/transport.types.ts";
@@ -36,14 +38,14 @@ export type { RecoveryArchiveOptions, RecoveryArchiveRestoreOptions, } from "./a
36
38
  export { attach, createSandbox, dispatch, openWorkspace, } from "./application/outpost.ts";
37
39
  export type { AttachOptions, AttachResult, ContinuationOptions, DispatchResult, Sandbox, SandboxOptions, WarmDispatchResult, Workspace, WorkspaceOptions, } from "./application/outpost.ts";
38
40
  export type { DispatchOptions, Execution, Turn, } from "./application/execution.ts";
39
- export { WorkflowFailure, WorkflowBudgetExceeded, task, workflow, } from "./domain/workflow.ts";
41
+ export { WorkflowFailure, WorkflowBudgetExceeded, WorkflowUsageUnavailable, task, workflow, } from "./domain/workflow.ts";
40
42
  export type { Retry, Task, TaskContext, TaskOptions, TaskRecord, TaskStatus, Workflow, WorkflowEvent, WorkflowOptions, WorkflowBudget, WorkflowUsage, WorkflowResult, WorkflowTelemetry, } from "./domain/workflow.ts";
41
43
  export { agentTask, commandTask, isolatedTask } from "./application/tasks.ts";
42
- export { claudeHarness, codexHarness, geminiHarness, } from "./providers/agents.ts";
44
+ export { antigravityHarness, claudeHarness, codexHarness, copilotHarness, kimiHarness, } from "./providers/agents.ts";
43
45
  export { agentVersions } from "./providers/versions.ts";
44
46
  export { conversations, harnessConversations, } from "./infrastructure/conversations.ts";
45
47
  export type { ConversationFormat, ConversationLocation, StoredConversationFormat, } from "./infrastructure/conversations.ts";
46
- export type { ClaudeSettings, CodexSettings, CodexModelProvider, GeminiSettings, } from "./providers/agents.ts";
48
+ export type { AntigravitySettings, ClaudeSettings, CodexSettings, CodexModelProvider, CopilotSettings, KimiSettings, } from "./providers/agents.ts";
47
49
  export { mountedSandboxProvider, remoteSandboxProvider, } from "./providers/factories.ts";
48
50
  export { ResponseError, response } from "./domain/response.ts";
49
51
  export type { ResponseSpec, StandardValidator } from "./domain/response.ts";
@@ -72,20 +74,16 @@ export type { RecoveryStorageReservationOptions } from "./application/storage-re
72
74
  export type { StorageReservation, StorageReservationOptions, } from "./infrastructure/storage-reservations.types.ts";
73
75
  export { planRecoveryRestore, restoreRecoveryTransfer, } from "./application/recovery-restore.ts";
74
76
  export type { RecoveryRestoreOptions, RecoveryRestorePlan, RecoveryRestoreResult, } from "./application/recovery-restore.types.ts";
75
- export { fileWorkflowCheckpointStore } from "./infrastructure/workflow-checkpoint.ts";
76
- export type { FileWorkflowCheckpointOptions } from "./infrastructure/workflow-checkpoint.types.ts";
77
77
  export type { WorkflowCheckpoint, WorkflowCheckpointOptions, WorkflowCheckpointStore, WorkflowCheckpointLease, WorkflowCheckpointValue, WorkflowJson, } from "./domain/workflow/checkpoint.types.ts";
78
78
  export { approvalTask, pauseTask } from "./domain/workflow/gates.ts";
79
- export type { WorkflowGate, WorkflowGateOptions, WorkflowPauseRequest, WorkflowDecision, WorkflowDecisionRecord, } from "./domain/workflow/gates.types.ts";
79
+ export type { WorkflowGate, WorkflowGateOptions, WorkflowPauseRequest, WorkflowDecision, WorkflowDecisionRecord, WorkflowDecisionProof, WorkflowDecisionVerification, WorkflowDecisionVerifier, } from "./domain/workflow/gates.types.ts";
80
80
  export { inspectRecovery } from "./application/recovery-inspection.ts";
81
81
  export type { RecoveryInspection, RecoveryInspectionOptions, } from "./application/recovery-inspection.types.ts";
82
82
  export type { ResourceActivityRecord, ResourceInspection, ResourceInspectionEntry, ResourceOperation, ResourceOperationKind, ResourceOperationResult, ResourcePhase, } from "./infrastructure/resource-activity.types.ts";
83
83
  export { artifact, publishArtifact, readStoredArtifact, } from "./domain/artifact.ts";
84
84
  export { artifactTask, readArtifact } from "./application/artifact-tasks.ts";
85
- export { fileArtifactStore } from "./infrastructure/artifact-store.ts";
86
85
  export type { ArtifactContract, ArtifactContractOptions, ArtifactIdentity, ArtifactProducer, ArtifactReference, ArtifactStore, JsonArtifactOptions, PublishArtifactOptions, ReadArtifactOptions, } from "./domain/artifact.types.ts";
87
86
  export type { ArtifactTaskOptions } from "./application/artifact-tasks.types.ts";
88
- export type { FileArtifactStoreOptions } from "./infrastructure/artifact-store.types.ts";
89
87
  export { sqliteTaskQueue } from "./infrastructure/task-queue.ts";
90
88
  export { serveTaskQueue, httpTaskQueue, } from "./infrastructure/task-queue-http.ts";
91
89
  export { runQueueWorker } from "./application/queue-worker.ts";
@@ -95,10 +93,17 @@ export type { QueueServerOptions, QueueServer, QueueClientOptions, } from "./inf
95
93
  export type { QueueHandlerContext, QueueHandler, QueueWorkerOptions, } from "./application/queue-worker.types.ts";
96
94
  export type { QueuedTaskOptions } from "./application/queued-task.types.ts";
97
95
  export type { EgressPolicy } from "./domain/egress.types.ts";
96
+ export { recoverSpeculation } from "./infrastructure/speculation-store.ts";
97
+ export type { SpeculationRecoveryOptions } from "./infrastructure/speculation-store.types.ts";
98
+ export { checkSpeculationIntegration } from "./application/speculation-integration.ts";
98
99
  export { speculate } from "./application/speculation.ts";
99
- export type { SpeculationOptions, SpeculationResult, SpeculativeCandidate, SpeculativeCandidateResult, SpeculativeOutput, SpeculativeHostSnapshot, SpeculativeValidation, } from "./application/speculation.types.ts";
100
+ export type { SpeculationDurability, SpeculationIntegration, SpeculationOptions, SpeculationResult, SpeculativeCandidate, SpeculativeCandidateResult, SpeculativeOutput, SpeculativeHostSnapshot, SpeculativeValidation, } from "./application/speculation.types.ts";
100
101
  export { openaiModelProvider } from "./adapters/models/openai-model-provider.ts";
101
102
  export type { OpenAIModelProviderOptions } from "./adapters/models/openai-model-provider.types.ts";
102
103
  export type { AgentModel, ModelContentBlock, ModelMessage, ModelProvider, ModelReasoning, ModelReasoningBlock, ModelRequest, ModelResult, ModelSpec, ModelStopReason, ModelStreamEvent, ModelTextBlock, ModelToolCallBlock, ModelToolResultBlock, ModelToolSpec, } from "./domain/model.types.ts";
103
104
  export { anthropicModelProvider } from "./adapters/models/anthropic-model-provider.ts";
104
105
  export type { AnthropicModelProviderOptions } from "./adapters/models/anthropic-model-provider.types.ts";
106
+ export { createObservationHub } from "./domain/observation.ts";
107
+ export type { Observation, ObservationScope, ObservationSource, ObservationEvent, OperationEvent, ObservationHub, ObservationHubOptions, ObservationSink, } from "./domain/observation.types.ts";
108
+ export { signWorkflowDecision, ed25519DecisionVerifier, } from "./infrastructure/workflow-decision-signature.ts";
109
+ export type { WorkflowDecisionSigningOptions, WorkflowApproverKey, WorkflowDecisionVerifierOptions, } from "./infrastructure/workflow-decision-signature.types.ts";
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { agent } from "./domain/agent.js";
2
+ export { defineHarnessSubagent } from "./domain/subagent.js";
2
3
  export { harness } from "./domain/harness.js";
3
4
  export { defineHarnessContextStrategy, summarizeHistory, truncateToolResults, } from "./domain/context.js";
4
5
  export { defineHarnessHook } from "./domain/hook.js";
@@ -19,9 +20,9 @@ export { readJournal } from "./infrastructure/transport-journal.js";
19
20
  export { transportConversations } from "./infrastructure/transport-conversations.js";
20
21
  export { archiveRecovery, materializeRecoveryArchive, } from "./application/recovery-archive.js";
21
22
  export { attach, createSandbox, dispatch, openWorkspace, } from "./application/outpost.js";
22
- export { WorkflowFailure, WorkflowBudgetExceeded, task, workflow, } from "./domain/workflow.js";
23
+ export { WorkflowFailure, WorkflowBudgetExceeded, WorkflowUsageUnavailable, task, workflow, } from "./domain/workflow.js";
23
24
  export { agentTask, commandTask, isolatedTask } from "./application/tasks.js";
24
- export { claudeHarness, codexHarness, geminiHarness, } from "./providers/agents.js";
25
+ export { antigravityHarness, claudeHarness, codexHarness, copilotHarness, kimiHarness, } from "./providers/agents.js";
25
26
  export { agentVersions } from "./providers/versions.js";
26
27
  export { conversations, harnessConversations, } from "./infrastructure/conversations.js";
27
28
  export { mountedSandboxProvider, remoteSandboxProvider, } from "./providers/factories.js";
@@ -35,17 +36,19 @@ export { diagnoseSandbox } from "./application/doctor-sandbox.js";
35
36
  export { diagnoseAgentProtocol } from "./application/doctor-protocol.js";
36
37
  export { reserveRecoveryStorage } from "./application/storage-reservation.js";
37
38
  export { planRecoveryRestore, restoreRecoveryTransfer, } from "./application/recovery-restore.js";
38
- export { fileWorkflowCheckpointStore } from "./infrastructure/workflow-checkpoint.js";
39
39
  export { approvalTask, pauseTask } from "./domain/workflow/gates.js";
40
40
  export { inspectRecovery } from "./application/recovery-inspection.js";
41
41
  export { artifact, publishArtifact, readStoredArtifact, } from "./domain/artifact.js";
42
42
  export { artifactTask, readArtifact } from "./application/artifact-tasks.js";
43
- export { fileArtifactStore } from "./infrastructure/artifact-store.js";
44
43
  export { sqliteTaskQueue } from "./infrastructure/task-queue.js";
45
44
  export { serveTaskQueue, httpTaskQueue, } from "./infrastructure/task-queue-http.js";
46
45
  export { runQueueWorker } from "./application/queue-worker.js";
47
46
  export { queuedTask } from "./application/queued-task.js";
47
+ export { recoverSpeculation } from "./infrastructure/speculation-store.js";
48
+ export { checkSpeculationIntegration } from "./application/speculation-integration.js";
48
49
  export { speculate } from "./application/speculation.js";
49
50
  export { openaiModelProvider } from "./adapters/models/openai-model-provider.js";
50
51
  export { anthropicModelProvider } from "./adapters/models/anthropic-model-provider.js";
52
+ export { createObservationHub } from "./domain/observation.js";
53
+ export { signWorkflowDecision, ed25519DecisionVerifier, } from "./infrastructure/workflow-decision-signature.js";
51
54
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAoBnE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAg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from \"./domain/agent.ts\";\nexport { harness } from \"./domain/harness.ts\";\nexport {\n defineHarnessContextStrategy,\n summarizeHistory,\n truncateToolResults,\n} from \"./domain/context.ts\";\nexport type {\n HarnessContextInput,\n HarnessContextResult,\n HarnessContextStrategy,\n HarnessContextStrategyOptions,\n SummarizeHistoryOptions,\n TruncateToolResultsOptions,\n} from \"./domain/context.types.ts\";\nexport { defineHarnessHook } from \"./domain/hook.ts\";\nexport { defineHarnessSkill } from \"./domain/skill.ts\";\nexport type {\n HarnessSkill,\n HarnessSkillOptions,\n} from \"./domain/skill.types.ts\";\nexport { defineHarnessInstructions } from \"./domain/instructions.ts\";\nexport { defineHarnessPermissions } from \"./domain/permissions.ts\";\nexport type {\n HarnessHook,\n HarnessHookContext,\n HarnessHookDecisions,\n HarnessHookEvents,\n HarnessHookInput,\n HarnessHookOptions,\n HarnessHookPhase,\n HarnessHookResult,\n HarnessToolResultView,\n} from \"./domain/hook.types.ts\";\nexport type {\n HarnessPermissionRule,\n HarnessPermissions,\n HarnessPermissionsOptions,\n PermissionDecision,\n PermissionEffect,\n ToolResources,\n} from \"./domain/permissions.types.ts\";\nexport { defineHarnessTool, defineHarnessToolset } from \"./domain/tool.ts\";\nexport { harnessEditTools } from \"./adapters/tools/edit-tools.ts\";\nexport { harnessFileTools } from \"./adapters/tools/file-tools.ts\";\nexport { harnessGitTools } from \"./adapters/tools/git-tools.ts\";\nexport { harnessSearchTools } from \"./adapters/tools/search-tools.ts\";\nexport { harnessShellTools } from \"./adapters/tools/shell-tools.ts\";\nexport type { ShellToolsOptions } from \"./adapters/tools/tools.types.ts\";\nexport type {\n AgentAuthentication,\n Agent,\n AgentOptions,\n Harness,\n CliHarness,\n CliAgent,\n CustomAgent,\n} from \"./domain/agent.types.ts\";\nexport type {\n CustomHarness,\n CustomHarnessOptions,\n HarnessInstructionContext,\n HarnessInstructions,\n HarnessInstructionSource,\n HarnessInstructionsOption,\n HarnessLimits,\n HarnessToolExecution,\n} from \"./domain/harness.types.ts\";\nexport type {\n HarnessTool,\n HarnessToolContext,\n HarnessToolEvent,\n HarnessToolOptions,\n HarnessToolset,\n HarnessToolsetOptions,\n JsonSchema,\n StandardJsonSchema,\n ToolOutput,\n ToolValidation,\n} from \"./domain/tool.types.ts\";\nexport { TransportConflict } from \"./domain/transport.ts\";\nexport type {\n Transport,\n TransportEntry,\n TransportObject,\n TransportReadOptions,\n TransportWriteOptions,\n TransportReference,\n TransportStoreOptions,\n} from \"./domain/transport.types.ts\";\nexport { localTransport } from \"./infrastructure/local-transport.ts\";\nexport type { LocalTransportOptions } from \"./infrastructure/local-transport.types.ts\";\nexport { artifactStore } from \"./infrastructure/transport-artifact-store.ts\";\nexport type { ArtifactStoreOptions } from \"./infrastructure/transport-artifact-store.types.ts\";\nexport {\n workflowCheckpointStore,\n recoverWorkflowCheckpoint,\n} from \"./infrastructure/transport-checkpoint.ts\";\nexport type { CheckpointRecoveryOptions } from \"./infrastructure/transport-checkpoint.types.ts\";\nexport { readJournal } from \"./infrastructure/transport-journal.ts\";\nexport type { ReadJournalOptions } from \"./infrastructure/transport-journal.types.ts\";\nexport { transportConversations } from \"./infrastructure/transport-conversations.ts\";\nexport type { TransportConversationOptions } from \"./infrastructure/transport-conversations.types.ts\";\nexport {\n archiveRecovery,\n materializeRecoveryArchive,\n} from \"./application/recovery-archive.ts\";\nexport type {\n RecoveryArchiveOptions,\n RecoveryArchiveRestoreOptions,\n} from \"./application/recovery-archive.types.ts\";\n\nexport {\n attach,\n createSandbox,\n dispatch,\n openWorkspace,\n} from \"./application/outpost.ts\";\n\nexport type {\n AttachOptions,\n AttachResult,\n ContinuationOptions,\n DispatchResult,\n Sandbox,\n SandboxOptions,\n WarmDispatchResult,\n Workspace,\n WorkspaceOptions,\n} from \"./application/outpost.ts\";\n\nexport type {\n DispatchOptions,\n Execution,\n Turn,\n} from \"./application/execution.ts\";\n\nexport {\n WorkflowFailure,\n WorkflowBudgetExceeded,\n task,\n workflow,\n} from \"./domain/workflow.ts\";\n\nexport type {\n Retry,\n Task,\n TaskContext,\n TaskOptions,\n TaskRecord,\n TaskStatus,\n Workflow,\n WorkflowEvent,\n WorkflowOptions,\n WorkflowBudget,\n WorkflowUsage,\n WorkflowResult,\n WorkflowTelemetry,\n} from \"./domain/workflow.ts\";\n\nexport { agentTask, commandTask, isolatedTask } from \"./application/tasks.ts\";\n\nexport {\n claudeHarness,\n codexHarness,\n geminiHarness,\n} from \"./providers/agents.ts\";\n\nexport { agentVersions } from \"./providers/versions.ts\";\n\nexport {\n conversations,\n harnessConversations,\n} from \"./infrastructure/conversations.ts\";\n\nexport type {\n ConversationFormat,\n ConversationLocation,\n StoredConversationFormat,\n} from \"./infrastructure/conversations.ts\";\n\nexport type {\n ClaudeSettings,\n CodexSettings,\n CodexModelProvider,\n GeminiSettings,\n} from \"./providers/agents.ts\";\n\nexport {\n mountedSandboxProvider,\n remoteSandboxProvider,\n} from \"./providers/factories.ts\";\n\nexport { ResponseError, response } from \"./domain/response.ts\";\n\nexport type { ResponseSpec, StandardValidator } from \"./domain/response.ts\";\n\nexport { OutpostError, recoveryDetails } from \"./domain/errors.ts\";\n\nexport type { FaultCode } from \"./domain/errors.ts\";\n\nexport type {\n AgentAdapter,\n AgentEvent,\n AgentInput,\n AgentObservation,\n BranchPolicy,\n Channel,\n Command,\n CommandResult,\n Commit,\n ConversationContext,\n ConversationRecord,\n ConversationStore,\n Disposal,\n LifecycleHooks,\n FileManifestEntry,\n FileTransfers,\n SandboxContext,\n SandboxLease,\n SandboxProvider,\n StageLimits,\n TransferOptions,\n Usage,\n Variables,\n Volume,\n WorkspaceRecord,\n} from \"./domain/ports.ts\";\n\nexport type { Brief, PromptVariables } from \"./domain/prompts.ts\";\n\nexport type { Logging } from \"./infrastructure/journal.ts\";\n\nexport { createReporter } from \"./infrastructure/custom-reporter.ts\";\nexport type {\n CustomReporter,\n CustomReporterOptions,\n ReporterHandlers,\n} from \"./infrastructure/custom-reporter.types.ts\";\nexport type {\n DispatchTelemetry,\n DispatchTelemetrySession,\n DispatchTelemetryOutcome,\n} from \"./domain/dispatch-telemetry.types.ts\";\nexport { reporter } from \"./infrastructure/reporter.ts\";\n\nexport type { ReporterOptions } from \"./infrastructure/reporter.ts\";\n\nexport type { VariableQuestion } from \"./application/interactive-brief.ts\";\n\nexport {\n planRecoveryRetention,\n pruneRecoveryRetention,\n assertRecoveryQuota,\n} from \"./application/recovery-retention.ts\";\nexport type {\n RecoveryRetentionPolicy,\n RecoveryRetentionOptions,\n RecoveryRetentionPlan,\n RecoveryRetentionEntry,\n RecoveryPruneResult,\n RecoveryQuotaOptions,\n} from \"./application/recovery-retention.types.ts\";\nexport { verifyRecoveryTransfer } from \"./application/recovery-verification.ts\";\nexport type {\n RecoveryVerification,\n RecoveryVerificationOptions,\n} from \"./application/recovery-verification.types.ts\";\n\nexport { diagnoseSandbox } from \"./application/doctor-sandbox.ts\";\nexport type {\n SandboxDiagnosticOptions,\n SandboxDiagnosticReport,\n DiagnosticCapability,\n} from \"./application/doctor-sandbox.types.ts\";\nexport type {\n DiagnosticCheck,\n DiagnosticStatus,\n DoctorAgent,\n} from \"./application/doctor.types.ts\";\nexport { diagnoseAgentProtocol } from \"./application/doctor-protocol.ts\";\nexport type { AgentProtocolReport } from \"./application/doctor-protocol.types.ts\";\n\nexport { reserveRecoveryStorage } from \"./application/storage-reservation.ts\";\nexport type { RecoveryStorageReservationOptions } from \"./application/storage-reservation.types.ts\";\nexport type {\n StorageReservation,\n StorageReservationOptions,\n} from \"./infrastructure/storage-reservations.types.ts\";\n\nexport {\n planRecoveryRestore,\n restoreRecoveryTransfer,\n} from \"./application/recovery-restore.ts\";\nexport type {\n RecoveryRestoreOptions,\n RecoveryRestorePlan,\n RecoveryRestoreResult,\n} from \"./application/recovery-restore.types.ts\";\n\nexport { fileWorkflowCheckpointStore } from \"./infrastructure/workflow-checkpoint.ts\";\nexport type { FileWorkflowCheckpointOptions } from \"./infrastructure/workflow-checkpoint.types.ts\";\nexport type {\n WorkflowCheckpoint,\n WorkflowCheckpointOptions,\n WorkflowCheckpointStore,\n WorkflowCheckpointLease,\n WorkflowCheckpointValue,\n WorkflowJson,\n} from \"./domain/workflow/checkpoint.types.ts\";\n\nexport { approvalTask, pauseTask } from \"./domain/workflow/gates.ts\";\nexport type {\n WorkflowGate,\n WorkflowGateOptions,\n WorkflowPauseRequest,\n WorkflowDecision,\n WorkflowDecisionRecord,\n} from \"./domain/workflow/gates.types.ts\";\n\nexport { inspectRecovery } from \"./application/recovery-inspection.ts\";\nexport type {\n RecoveryInspection,\n RecoveryInspectionOptions,\n} from \"./application/recovery-inspection.types.ts\";\nexport type {\n ResourceActivityRecord,\n ResourceInspection,\n ResourceInspectionEntry,\n ResourceOperation,\n ResourceOperationKind,\n ResourceOperationResult,\n ResourcePhase,\n} from \"./infrastructure/resource-activity.types.ts\";\n\nexport {\n artifact,\n publishArtifact,\n readStoredArtifact,\n} from \"./domain/artifact.ts\";\nexport { artifactTask, readArtifact } from \"./application/artifact-tasks.ts\";\nexport { fileArtifactStore } from \"./infrastructure/artifact-store.ts\";\nexport type {\n ArtifactContract,\n ArtifactContractOptions,\n ArtifactIdentity,\n ArtifactProducer,\n ArtifactReference,\n ArtifactStore,\n JsonArtifactOptions,\n PublishArtifactOptions,\n ReadArtifactOptions,\n} from \"./domain/artifact.types.ts\";\nexport type { ArtifactTaskOptions } from \"./application/artifact-tasks.types.ts\";\nexport type { FileArtifactStoreOptions } from \"./infrastructure/artifact-store.types.ts\";\n\nexport { sqliteTaskQueue } from \"./infrastructure/task-queue.ts\";\nexport {\n serveTaskQueue,\n httpTaskQueue,\n} from \"./infrastructure/task-queue-http.ts\";\nexport { runQueueWorker } from \"./application/queue-worker.ts\";\nexport { queuedTask } from \"./application/queued-task.ts\";\nexport type {\n QueueRequest,\n QueueResult,\n QueueJob,\n QueueClaim,\n QueueLease,\n TaskQueue,\n DurableTaskQueue,\n} from \"./domain/task-queue.types.ts\";\nexport type {\n QueueServerOptions,\n QueueServer,\n QueueClientOptions,\n} from \"./infrastructure/task-queue-http.types.ts\";\nexport type {\n QueueHandlerContext,\n QueueHandler,\n QueueWorkerOptions,\n} from \"./application/queue-worker.types.ts\";\nexport type { QueuedTaskOptions } from \"./application/queued-task.types.ts\";\n\nexport type { EgressPolicy } from \"./domain/egress.types.ts\";\n\nexport { speculate } from \"./application/speculation.ts\";\nexport type {\n SpeculationOptions,\n SpeculationResult,\n SpeculativeCandidate,\n SpeculativeCandidateResult,\n SpeculativeOutput,\n SpeculativeHostSnapshot,\n SpeculativeValidation,\n} from \"./application/speculation.types.ts\";\n\nexport { openaiModelProvider } from \"./adapters/models/openai-model-provider.ts\";\nexport type { OpenAIModelProviderOptions } from \"./adapters/models/openai-model-provider.types.ts\";\nexport type {\n AgentModel,\n ModelContentBlock,\n ModelMessage,\n ModelProvider,\n ModelReasoning,\n ModelReasoningBlock,\n ModelRequest,\n ModelResult,\n ModelSpec,\n ModelStopReason,\n ModelStreamEvent,\n ModelTextBlock,\n ModelToolCallBlock,\n ModelToolResultBlock,\n ModelToolSpec,\n} from \"./domain/model.types.ts\";\nexport { anthropicModelProvider } from \"./adapters/models/anthropic-model-provider.ts\";\nexport type { AnthropicModelProviderOptions } from \"./adapters/models/anthropic-model-provider.types.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAM7D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,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E3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAazD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAmBjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAY/D,OAAO,EACL,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,iDAAiD,CAAC","sourcesContent":["export { agent } from \"./domain/agent.ts\";\nexport { defineHarnessSubagent } from \"./domain/subagent.ts\";\nexport type {\n HarnessSubagent,\n HarnessSubagentInput,\n HarnessSubagentOptions,\n} from \"./domain/subagent.types.ts\";\nexport { harness } from \"./domain/harness.ts\";\nexport {\n defineHarnessContextStrategy,\n summarizeHistory,\n truncateToolResults,\n} from \"./domain/context.ts\";\nexport type {\n HarnessContextInput,\n HarnessContextResult,\n HarnessContextStrategy,\n HarnessContextStrategyOptions,\n SummarizeHistoryOptions,\n TruncateToolResultsOptions,\n} from \"./domain/context.types.ts\";\nexport { defineHarnessHook } from \"./domain/hook.ts\";\nexport { defineHarnessSkill } from \"./domain/skill.ts\";\nexport type {\n HarnessSkill,\n HarnessSkillOptions,\n} from \"./domain/skill.types.ts\";\nexport { defineHarnessInstructions } from \"./domain/instructions.ts\";\nexport { defineHarnessPermissions } from \"./domain/permissions.ts\";\nexport type {\n HarnessHook,\n HarnessHookContext,\n HarnessHookDecisions,\n HarnessHookEvents,\n HarnessHookInput,\n HarnessHookOptions,\n HarnessHookPhase,\n HarnessHookResult,\n HarnessToolResultView,\n} from \"./domain/hook.types.ts\";\nexport type {\n HarnessPermissionRule,\n HarnessPermissions,\n HarnessPermissionsOptions,\n PermissionDecision,\n PermissionEffect,\n ToolResources,\n} from \"./domain/permissions.types.ts\";\nexport { defineHarnessTool, defineHarnessToolset } from \"./domain/tool.ts\";\nexport { harnessEditTools } from \"./adapters/tools/edit-tools.ts\";\nexport { harnessFileTools } from \"./adapters/tools/file-tools.ts\";\nexport { harnessGitTools } from \"./adapters/tools/git-tools.ts\";\nexport { harnessSearchTools } from \"./adapters/tools/search-tools.ts\";\nexport { harnessShellTools } from \"./adapters/tools/shell-tools.ts\";\nexport type { ShellToolsOptions } from \"./adapters/tools/tools.types.ts\";\nexport type {\n AccountCredential,\n AgentAuthentication,\n Agent,\n AgentOptions,\n AgentHarness,\n CliHarness,\n CliAgent,\n CustomAgent,\n UsageCredential,\n} from \"./domain/agent.types.ts\";\nexport type {\n Harness,\n HarnessOptions,\n HarnessInstructionContext,\n HarnessInstructions,\n HarnessInstructionSource,\n HarnessInstructionsOption,\n HarnessLimits,\n HarnessToolExecution,\n} from \"./domain/harness.types.ts\";\nexport type {\n HarnessTool,\n HarnessToolContext,\n HarnessToolEvent,\n HarnessToolOptions,\n HarnessToolset,\n HarnessToolsetOptions,\n JsonSchema,\n StandardJsonSchema,\n ToolOutput,\n ToolValidation,\n} from \"./domain/tool.types.ts\";\nexport { TransportConflict } from \"./domain/transport.ts\";\nexport type {\n Transport,\n TransportEntry,\n TransportObject,\n TransportReadOptions,\n TransportWriteOptions,\n TransportReference,\n TransportStoreOptions,\n} from \"./domain/transport.types.ts\";\nexport { localTransport } from \"./infrastructure/local-transport.ts\";\nexport type { LocalTransportOptions } from \"./infrastructure/local-transport.types.ts\";\nexport { artifactStore } from \"./infrastructure/transport-artifact-store.ts\";\nexport type { ArtifactStoreOptions } from \"./infrastructure/transport-artifact-store.types.ts\";\nexport {\n workflowCheckpointStore,\n recoverWorkflowCheckpoint,\n} from \"./infrastructure/transport-checkpoint.ts\";\nexport type { CheckpointRecoveryOptions } from \"./infrastructure/transport-checkpoint.types.ts\";\nexport { readJournal } from \"./infrastructure/transport-journal.ts\";\nexport type { ReadJournalOptions } from \"./infrastructure/transport-journal.types.ts\";\nexport { transportConversations } from \"./infrastructure/transport-conversations.ts\";\nexport type { TransportConversationOptions } from \"./infrastructure/transport-conversations.types.ts\";\nexport {\n archiveRecovery,\n materializeRecoveryArchive,\n} from \"./application/recovery-archive.ts\";\nexport type {\n RecoveryArchiveOptions,\n RecoveryArchiveRestoreOptions,\n} from \"./application/recovery-archive.types.ts\";\n\nexport {\n attach,\n createSandbox,\n dispatch,\n openWorkspace,\n} from \"./application/outpost.ts\";\n\nexport type {\n AttachOptions,\n AttachResult,\n ContinuationOptions,\n DispatchResult,\n Sandbox,\n SandboxOptions,\n WarmDispatchResult,\n Workspace,\n WorkspaceOptions,\n} from \"./application/outpost.ts\";\n\nexport type {\n DispatchOptions,\n Execution,\n Turn,\n} from \"./application/execution.ts\";\n\nexport {\n WorkflowFailure,\n WorkflowBudgetExceeded,\n WorkflowUsageUnavailable,\n task,\n workflow,\n} from \"./domain/workflow.ts\";\n\nexport type {\n Retry,\n Task,\n TaskContext,\n TaskOptions,\n TaskRecord,\n TaskStatus,\n Workflow,\n WorkflowEvent,\n WorkflowOptions,\n WorkflowBudget,\n WorkflowUsage,\n WorkflowResult,\n WorkflowTelemetry,\n} from \"./domain/workflow.ts\";\n\nexport { agentTask, commandTask, isolatedTask } from \"./application/tasks.ts\";\n\nexport {\n antigravityHarness,\n claudeHarness,\n codexHarness,\n copilotHarness,\n kimiHarness,\n} from \"./providers/agents.ts\";\n\nexport { agentVersions } from \"./providers/versions.ts\";\n\nexport {\n conversations,\n harnessConversations,\n} from \"./infrastructure/conversations.ts\";\n\nexport type {\n ConversationFormat,\n ConversationLocation,\n StoredConversationFormat,\n} from \"./infrastructure/conversations.ts\";\n\nexport type {\n AntigravitySettings,\n ClaudeSettings,\n CodexSettings,\n CodexModelProvider,\n CopilotSettings,\n KimiSettings,\n} from \"./providers/agents.ts\";\n\nexport {\n mountedSandboxProvider,\n remoteSandboxProvider,\n} from \"./providers/factories.ts\";\n\nexport { ResponseError, response } from \"./domain/response.ts\";\n\nexport type { ResponseSpec, StandardValidator } from \"./domain/response.ts\";\n\nexport { OutpostError, recoveryDetails } from \"./domain/errors.ts\";\n\nexport type { FaultCode } from \"./domain/errors.ts\";\n\nexport type {\n AgentAdapter,\n AgentEvent,\n AgentInput,\n AgentObservation,\n BranchPolicy,\n Channel,\n Command,\n CommandResult,\n Commit,\n ConversationContext,\n ConversationRecord,\n ConversationStore,\n Disposal,\n LifecycleHooks,\n FileManifestEntry,\n FileTransfers,\n SandboxContext,\n SandboxLease,\n SandboxProvider,\n StageLimits,\n TransferOptions,\n Usage,\n Variables,\n Volume,\n WorkspaceRecord,\n} from \"./domain/ports.ts\";\n\nexport type { Brief, PromptVariables } from \"./domain/prompts.ts\";\n\nexport type { Logging } from \"./infrastructure/journal.ts\";\n\nexport { createReporter } from \"./infrastructure/custom-reporter.ts\";\nexport type {\n CustomReporter,\n CustomReporterOptions,\n ReporterHandlers,\n} from \"./infrastructure/custom-reporter.types.ts\";\nexport type {\n DispatchTelemetry,\n DispatchTelemetrySession,\n DispatchTelemetryOutcome,\n} from \"./domain/dispatch-telemetry.types.ts\";\nexport { reporter } from \"./infrastructure/reporter.ts\";\n\nexport type { ReporterOptions } from \"./infrastructure/reporter.ts\";\n\nexport type { VariableQuestion } from \"./application/interactive-brief.ts\";\n\nexport {\n planRecoveryRetention,\n pruneRecoveryRetention,\n assertRecoveryQuota,\n} from \"./application/recovery-retention.ts\";\nexport type {\n RecoveryRetentionPolicy,\n RecoveryRetentionOptions,\n RecoveryRetentionPlan,\n RecoveryRetentionEntry,\n RecoveryPruneResult,\n RecoveryQuotaOptions,\n} from \"./application/recovery-retention.types.ts\";\nexport { verifyRecoveryTransfer } from \"./application/recovery-verification.ts\";\nexport type {\n RecoveryVerification,\n RecoveryVerificationOptions,\n} from \"./application/recovery-verification.types.ts\";\n\nexport { diagnoseSandbox } from \"./application/doctor-sandbox.ts\";\nexport type {\n SandboxDiagnosticOptions,\n SandboxDiagnosticReport,\n DiagnosticCapability,\n} from \"./application/doctor-sandbox.types.ts\";\nexport type {\n DiagnosticCheck,\n DiagnosticStatus,\n DoctorAgent,\n} from \"./application/doctor.types.ts\";\nexport { diagnoseAgentProtocol } from \"./application/doctor-protocol.ts\";\nexport type { AgentProtocolReport } from \"./application/doctor-protocol.types.ts\";\n\nexport { reserveRecoveryStorage } from \"./application/storage-reservation.ts\";\nexport type { RecoveryStorageReservationOptions } from \"./application/storage-reservation.types.ts\";\nexport type {\n StorageReservation,\n StorageReservationOptions,\n} from \"./infrastructure/storage-reservations.types.ts\";\n\nexport {\n planRecoveryRestore,\n restoreRecoveryTransfer,\n} from \"./application/recovery-restore.ts\";\nexport type {\n RecoveryRestoreOptions,\n RecoveryRestorePlan,\n RecoveryRestoreResult,\n} from \"./application/recovery-restore.types.ts\";\n\nexport type {\n WorkflowCheckpoint,\n WorkflowCheckpointOptions,\n WorkflowCheckpointStore,\n WorkflowCheckpointLease,\n WorkflowCheckpointValue,\n WorkflowJson,\n} from \"./domain/workflow/checkpoint.types.ts\";\n\nexport { approvalTask, pauseTask } from \"./domain/workflow/gates.ts\";\nexport type {\n WorkflowGate,\n WorkflowGateOptions,\n WorkflowPauseRequest,\n WorkflowDecision,\n WorkflowDecisionRecord,\n WorkflowDecisionProof,\n WorkflowDecisionVerification,\n WorkflowDecisionVerifier,\n} from \"./domain/workflow/gates.types.ts\";\n\nexport { inspectRecovery } from \"./application/recovery-inspection.ts\";\nexport type {\n RecoveryInspection,\n RecoveryInspectionOptions,\n} from \"./application/recovery-inspection.types.ts\";\nexport type {\n ResourceActivityRecord,\n ResourceInspection,\n ResourceInspectionEntry,\n ResourceOperation,\n ResourceOperationKind,\n ResourceOperationResult,\n ResourcePhase,\n} from \"./infrastructure/resource-activity.types.ts\";\n\nexport {\n artifact,\n publishArtifact,\n readStoredArtifact,\n} from \"./domain/artifact.ts\";\nexport { artifactTask, readArtifact } from \"./application/artifact-tasks.ts\";\nexport type {\n ArtifactContract,\n ArtifactContractOptions,\n ArtifactIdentity,\n ArtifactProducer,\n ArtifactReference,\n ArtifactStore,\n JsonArtifactOptions,\n PublishArtifactOptions,\n ReadArtifactOptions,\n} from \"./domain/artifact.types.ts\";\nexport type { ArtifactTaskOptions } from \"./application/artifact-tasks.types.ts\";\n\nexport { sqliteTaskQueue } from \"./infrastructure/task-queue.ts\";\nexport {\n serveTaskQueue,\n httpTaskQueue,\n} from \"./infrastructure/task-queue-http.ts\";\nexport { runQueueWorker } from \"./application/queue-worker.ts\";\nexport { queuedTask } from \"./application/queued-task.ts\";\nexport type {\n QueueRequest,\n QueueResult,\n QueueJob,\n QueueClaim,\n QueueLease,\n TaskQueue,\n DurableTaskQueue,\n} from \"./domain/task-queue.types.ts\";\nexport type {\n QueueServerOptions,\n QueueServer,\n QueueClientOptions,\n} from \"./infrastructure/task-queue-http.types.ts\";\nexport type {\n QueueHandlerContext,\n QueueHandler,\n QueueWorkerOptions,\n} from \"./application/queue-worker.types.ts\";\nexport type { QueuedTaskOptions } from \"./application/queued-task.types.ts\";\n\nexport type { EgressPolicy } from \"./domain/egress.types.ts\";\n\nexport { recoverSpeculation } from \"./infrastructure/speculation-store.ts\";\nexport type { SpeculationRecoveryOptions } from \"./infrastructure/speculation-store.types.ts\";\nexport { checkSpeculationIntegration } from \"./application/speculation-integration.ts\";\nexport { speculate } from \"./application/speculation.ts\";\nexport type {\n SpeculationDurability,\n SpeculationIntegration,\n SpeculationOptions,\n SpeculationResult,\n SpeculativeCandidate,\n SpeculativeCandidateResult,\n SpeculativeOutput,\n SpeculativeHostSnapshot,\n SpeculativeValidation,\n} from \"./application/speculation.types.ts\";\n\nexport { openaiModelProvider } from \"./adapters/models/openai-model-provider.ts\";\nexport type { OpenAIModelProviderOptions } from \"./adapters/models/openai-model-provider.types.ts\";\nexport type {\n AgentModel,\n ModelContentBlock,\n ModelMessage,\n ModelProvider,\n ModelReasoning,\n ModelReasoningBlock,\n ModelRequest,\n ModelResult,\n ModelSpec,\n ModelStopReason,\n ModelStreamEvent,\n ModelTextBlock,\n ModelToolCallBlock,\n ModelToolResultBlock,\n ModelToolSpec,\n} from \"./domain/model.types.ts\";\nexport { anthropicModelProvider } from \"./adapters/models/anthropic-model-provider.ts\";\nexport type { AnthropicModelProviderOptions } from \"./adapters/models/anthropic-model-provider.types.ts\";\n\nexport { createObservationHub } from \"./domain/observation.ts\";\nexport type {\n Observation,\n ObservationScope,\n ObservationSource,\n ObservationEvent,\n OperationEvent,\n ObservationHub,\n ObservationHubOptions,\n ObservationSink,\n} from \"./domain/observation.types.ts\";\n\nexport {\n signWorkflowDecision,\n ed25519DecisionVerifier,\n} from \"./infrastructure/workflow-decision-signature.ts\";\nexport type {\n WorkflowDecisionSigningOptions,\n WorkflowApproverKey,\n WorkflowDecisionVerifierOptions,\n} from \"./infrastructure/workflow-decision-signature.types.ts\";\n"]}
@@ -1,3 +1,4 @@
1
+ import { sessionConversations } from "./session-bundle.js";
1
2
  import { randomUUID } from "node:crypto";
2
3
  import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
3
4
  import { homedir } from "node:os";
@@ -11,6 +12,15 @@ import { locateConversation } from "./locate.js";
11
12
  import { validId } from "./paths.js";
12
13
  import { relocateTranscript } from "./relocate.js";
13
14
  export async function captureConversation(format, id, repository, lease, staging, options = {}) {
15
+ if (format === "copilot" || format === "kimi") {
16
+ const record = await sessionConversations(format).capture(id, {
17
+ repository,
18
+ sandbox: lease,
19
+ staging,
20
+ ...options,
21
+ });
22
+ return { ...record, format };
23
+ }
14
24
  validId(id);
15
25
  const home = options.home ?? homedir();
16
26
  const layout = conversationLayout(format);
@@ -1 +1 @@
1
- {"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE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CAAC;wBACH,MAAM,SAAS,CACb,WAAW,EACX,kBAAkB,CAChB,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,EAC/B,OAAO,CAAC,UAAU,CAAC,CACpB,EACD,EAAE,IAAI,EAAE,KAAK,EAAE,CAChB,CAAC;oBACJ,CAAC;4BAAS,CAAC;wBACT,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;oBACrC,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,IAAI,EAAE,CACZ,uCAAuC,MAAM,CAAC,KAAK,CAAC,EAAE,CACvD,CAAC;gBACJ,CAAC;YACH,CAAC;IACL,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, posix, resolve } from \"node:path\";\nimport { OutpostError } from \"../../domain/errors.ts\";\nimport type { SandboxLease } from \"../../domain/sandbox.types.ts\";\nimport type {\n ConversationFormat,\n ConversationLocation,\n} from \"../conversations.types.ts\";\nimport { safeDestination } from \"../files.ts\";\nimport type { CaptureOptions } from \"./capture.types.ts\";\nimport { transcriptSearchBytes } from \"./conversation.constants.ts\";\nimport { files } from \"./files.ts\";\nimport { conversationLayout } from \"./layout.ts\";\nimport { locateConversation } from \"./locate.ts\";\nimport { validId } from \"./paths.ts\";\nimport { relocateTranscript } from \"./relocate.ts\";\n\nexport async function captureConversation(\n format: ConversationFormat,\n id: string,\n repository: string,\n lease: SandboxLease,\n staging: string,\n options: CaptureOptions = {},\n): Promise<ConversationLocation> {\n validId(id);\n const home = options.home ?? homedir();\n const layout = conversationLayout(format);\n const search = layout.remoteSearchRoot(lease.home);\n const pattern = layout.pattern(id);\n const result = options.local\n ? {\n status: 0,\n stdout: (await locateConversation(format, id, lease.root, lease.home))\n .file,\n }\n : await lease.invoke({\n executable: \"find\",\n arguments: [search, \"-type\", \"f\", \"-name\", pattern],\n retain: transcriptSearchBytes,\n });\n const remote = result.stdout.trim().split(\"\\n\").filter(Boolean)[0];\n if (result.status !== 0 || !remote)\n throw new OutpostError(\n \"session\",\n `Agent emitted conversation ${id} but its transcript is unavailable`,\n { id, search },\n );\n const file = layout.capturePath(id, repository, home, remote);\n await mkdir(staging, { recursive: true });\n const temporary = join(staging, `${randomUUID()}.jsonl`);\n await lease.download(remote, temporary);\n await mkdir(dirname(file), { recursive: true });\n try {\n await writeFile(\n file,\n relocateTranscript(\n await readFile(temporary, \"utf8\"),\n resolve(repository),\n ),\n { mode: 0o600 },\n );\n } finally {\n await rm(temporary, { force: true });\n }\n if (layout.sidecars) {\n const remoteSidecars = posix.join(\n posix.dirname(remote.replaceAll(\"\\\\\", \"/\")),\n id,\n \"subagents\",\n );\n const listed = options.local\n ? {\n status: 0,\n stdout: (await files(join(dirname(remote), id, \"subagents\"))).join(\n \"\\n\",\n ),\n }\n : await lease.invoke({\n executable: \"find\",\n arguments: [remoteSidecars, \"-type\", \"f\", \"-name\", \"*.jsonl\"],\n retain: transcriptSearchBytes,\n });\n if (listed.status === 0)\n for (const child of listed.stdout.split(\"\\n\").filter(Boolean)) {\n try {\n const scratch = join(staging, `${randomUUID()}.jsonl`);\n await lease.download(child, scratch);\n const destination = await safeDestination(\n join(dirname(file), id, \"subagents\"),\n posix.relative(\n remoteSidecars.replaceAll(\"\\\\\", \"/\"),\n child.replaceAll(\"\\\\\", \"/\"),\n ),\n );\n await mkdir(dirname(destination), { recursive: true });\n try {\n await writeFile(\n destination,\n relocateTranscript(\n await readFile(scratch, \"utf8\"),\n resolve(repository),\n ),\n { mode: 0o600 },\n );\n } finally {\n await rm(scratch, { force: true });\n }\n } catch (cause) {\n options.warn?.(\n `Could not capture child transcript: ${String(cause)}`,\n );\n }\n }\n }\n return { id, file, format };\n}\n"]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./session-bundle.ts\";\nimport { randomUUID } from \"node:crypto\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, posix, resolve } from \"node:path\";\nimport { OutpostError } from \"../../domain/errors.ts\";\nimport type { SandboxLease } from \"../../domain/sandbox.types.ts\";\nimport type {\n ConversationFormat,\n ConversationLocation,\n} from \"../conversations.types.ts\";\nimport { safeDestination } from \"../files.ts\";\nimport type { CaptureOptions } from \"./capture.types.ts\";\nimport { transcriptSearchBytes } from \"./conversation.constants.ts\";\nimport { files } from \"./files.ts\";\nimport { conversationLayout } from \"./layout.ts\";\nimport { locateConversation } from \"./locate.ts\";\nimport { validId } from \"./paths.ts\";\nimport { relocateTranscript } from \"./relocate.ts\";\n\nexport async function captureConversation(\n format: ConversationFormat,\n id: string,\n repository: string,\n lease: SandboxLease,\n staging: string,\n options: CaptureOptions = {},\n): Promise<ConversationLocation> {\n if (format === \"copilot\" || format === \"kimi\") {\n const record = await sessionConversations(format).capture(id, {\n repository,\n sandbox: lease,\n staging,\n ...options,\n });\n return { ...record, format };\n }\n validId(id);\n const home = options.home ?? homedir();\n const layout = conversationLayout(format);\n const search = layout.remoteSearchRoot(lease.home);\n const pattern = layout.pattern(id);\n const result = options.local\n ? {\n status: 0,\n stdout: (await locateConversation(format, id, lease.root, lease.home))\n .file,\n }\n : await lease.invoke({\n executable: \"find\",\n arguments: [search, \"-type\", \"f\", \"-name\", pattern],\n retain: transcriptSearchBytes,\n });\n const remote = result.stdout.trim().split(\"\\n\").filter(Boolean)[0];\n if (result.status !== 0 || !remote)\n throw new OutpostError(\n \"session\",\n `Agent emitted conversation ${id} but its transcript is unavailable`,\n { id, search },\n );\n const file = layout.capturePath(id, repository, home, remote);\n await mkdir(staging, { recursive: true });\n const temporary = join(staging, `${randomUUID()}.jsonl`);\n await lease.download(remote, temporary);\n await mkdir(dirname(file), { recursive: true });\n try {\n await writeFile(\n file,\n relocateTranscript(\n await readFile(temporary, \"utf8\"),\n resolve(repository),\n ),\n { mode: 0o600 },\n );\n } finally {\n await rm(temporary, { force: true });\n }\n if (layout.sidecars) {\n const remoteSidecars = posix.join(\n posix.dirname(remote.replaceAll(\"\\\\\", \"/\")),\n id,\n \"subagents\",\n );\n const listed = options.local\n ? {\n status: 0,\n stdout: (await files(join(dirname(remote), id, \"subagents\"))).join(\n \"\\n\",\n ),\n }\n : await lease.invoke({\n executable: \"find\",\n arguments: [remoteSidecars, \"-type\", \"f\", \"-name\", \"*.jsonl\"],\n retain: transcriptSearchBytes,\n });\n if (listed.status === 0)\n for (const child of listed.stdout.split(\"\\n\").filter(Boolean)) {\n try {\n const scratch = join(staging, `${randomUUID()}.jsonl`);\n await lease.download(child, scratch);\n const destination = await safeDestination(\n join(dirname(file), id, \"subagents\"),\n posix.relative(\n remoteSidecars.replaceAll(\"\\\\\", \"/\"),\n child.replaceAll(\"\\\\\", \"/\"),\n ),\n );\n await mkdir(dirname(destination), { recursive: true });\n try {\n await writeFile(\n destination,\n relocateTranscript(\n await readFile(scratch, \"utf8\"),\n resolve(repository),\n ),\n { mode: 0o600 },\n );\n } finally {\n await rm(scratch, { force: true });\n }\n } catch (cause) {\n options.warn?.(\n `Could not capture child transcript: ${String(cause)}`,\n );\n }\n }\n }\n return { id, file, format };\n}\n"]}
@@ -23,6 +23,12 @@ export async function openTranscript(options) {
23
23
  version: 1,
24
24
  id,
25
25
  model: options.model,
26
+ ...(options.parentConversation
27
+ ? { parentConversation: options.parentConversation }
28
+ : {}),
29
+ ...(options.parentCallId
30
+ ? { parentCallId: options.parentCallId }
31
+ : {}),
26
32
  ...(continuation ? { parent: continuation.id } : {}),
27
33
  createdAt: new Date().toISOString(),
28
34
  },
@@ -1 +1 @@
1
- {"version":3,"file":"harness-transcript.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/harness-transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU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CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzE,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { appendFile, mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport {\n parseTranscript,\n transcriptMessages,\n} from \"../../domain/transcript.ts\";\nimport type { TranscriptRecord } from \"../../domain/transcript.types.ts\";\nimport { lock } from \"../git/lock.ts\";\nimport { harnessTranscriptPath } from \"./harness-store.ts\";\nimport type {\n TranscriptHandle,\n TranscriptOptions,\n} from \"./harness-transcript.types.ts\";\n\nexport async function openTranscript(\n options: TranscriptOptions,\n): Promise<TranscriptHandle> {\n const { continuation } = options;\n const source = continuation\n ? await options.store.locate(continuation.id, options.repository)\n : undefined;\n const text = source ? await readFile(source.file, \"utf8\") : undefined;\n const messages = text ? transcriptMessages(parseTranscript(text)) : [];\n const id =\n continuation && !continuation.fork ? continuation.id : randomUUID();\n const file = harnessTranscriptPath(options.repository, id);\n const release = await lock(options.repository, `harness-conversation:${id}`);\n try {\n await mkdir(dirname(file), { recursive: true, mode: 0o700 });\n if (!continuation || continuation.fork)\n await writeFile(\n file,\n lines([\n {\n type: \"session\",\n version: 1,\n id,\n model: options.model,\n ...(continuation ? { parent: continuation.id } : {}),\n createdAt: new Date().toISOString(),\n },\n ...(messages.length\n ? [{ type: \"compaction\" as const, messages }]\n : []),\n ]),\n { flag: \"wx\", mode: 0o600 },\n );\n if (continuation && !continuation.fork && source!.file !== file)\n await writeFile(file, text!, { mode: 0o600 });\n } catch (error) {\n await release();\n throw error;\n }\n return {\n id,\n messages,\n append: (record) => appendFile(file, lines([record]), { mode: 0o600 }),\n close: release,\n };\n}\n\nfunction lines(records: readonly TranscriptRecord[]): string {\n return records.map((record) => `${JSON.stringify(record)}\\n`).join(\"\");\n}\n"]}
1
+ {"version":3,"file":"harness-transcript.js","sourceRoot":"","sources":["../../../src/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M,OAAO,EAAE,CAAC;QAChB,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO;QACL,EAAE;QACF,QAAQ;QACR,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACtE,KAAK,EAAE,OAAO;KACf,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,OAAoC;IACjD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzE,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { appendFile, mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport {\n parseTranscript,\n transcriptMessages,\n} from \"../../domain/transcript.ts\";\nimport type { TranscriptRecord } from \"../../domain/transcript.types.ts\";\nimport { lock } from \"../git/lock.ts\";\nimport { harnessTranscriptPath } from \"./harness-store.ts\";\nimport type {\n TranscriptHandle,\n TranscriptOptions,\n} from \"./harness-transcript.types.ts\";\n\nexport async function openTranscript(\n options: TranscriptOptions,\n): Promise<TranscriptHandle> {\n const { continuation } = options;\n const source = continuation\n ? await options.store.locate(continuation.id, options.repository)\n : undefined;\n const text = source ? await readFile(source.file, \"utf8\") : undefined;\n const messages = text ? transcriptMessages(parseTranscript(text)) : [];\n const id =\n continuation && !continuation.fork ? continuation.id : randomUUID();\n const file = harnessTranscriptPath(options.repository, id);\n const release = await lock(options.repository, `harness-conversation:${id}`);\n try {\n await mkdir(dirname(file), { recursive: true, mode: 0o700 });\n if (!continuation || continuation.fork)\n await writeFile(\n file,\n lines([\n {\n type: \"session\",\n version: 1,\n id,\n model: options.model,\n ...(options.parentConversation\n ? { parentConversation: options.parentConversation }\n : {}),\n ...(options.parentCallId\n ? { parentCallId: options.parentCallId }\n : {}),\n ...(continuation ? { parent: continuation.id } : {}),\n createdAt: new Date().toISOString(),\n },\n ...(messages.length\n ? [{ type: \"compaction\" as const, messages }]\n : []),\n ]),\n { flag: \"wx\", mode: 0o600 },\n );\n if (continuation && !continuation.fork && source!.file !== file)\n await writeFile(file, text!, { mode: 0o600 });\n } catch (error) {\n await release();\n throw error;\n }\n return {\n id,\n messages,\n append: (record) => appendFile(file, lines([record]), { mode: 0o600 }),\n close: release,\n };\n}\n\nfunction lines(records: readonly TranscriptRecord[]): string {\n return records.map((record) => `${JSON.stringify(record)}\\n`).join(\"\");\n}\n"]}
@@ -5,6 +5,8 @@ export interface TranscriptOptions {
5
5
  readonly repository: string;
6
6
  readonly store: ConversationStore;
7
7
  readonly model: string;
8
+ readonly parentConversation?: string;
9
+ readonly parentCallId?: string;
8
10
  readonly continuation?: {
9
11
  readonly id: string;
10
12
  readonly fork?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"harness-transcript.types.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/harness-transcript.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ConversationStore } from \"../../domain/conversation.types.ts\";\nimport type { ModelMessage } from \"../../domain/model.types.ts\";\nimport type { TranscriptRecord } from \"../../domain/transcript.types.ts\";\n\nexport interface TranscriptOptions {\n readonly repository: string;\n readonly store: ConversationStore;\n readonly model: string;\n readonly continuation?: { readonly id: string; readonly fork?: boolean };\n}\n\nexport interface TranscriptHandle {\n readonly id: string;\n readonly messages: readonly ModelMessage[];\n append(record: TranscriptRecord): Promise<void>;\n close(): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"harness-transcript.types.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/harness-transcript.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ConversationStore } from \"../../domain/conversation.types.ts\";\nimport type { ModelMessage } from \"../../domain/model.types.ts\";\nimport type { TranscriptRecord } from \"../../domain/transcript.types.ts\";\n\nexport interface TranscriptOptions {\n readonly repository: string;\n readonly store: ConversationStore;\n readonly model: string;\n readonly parentConversation?: string;\n readonly parentCallId?: string;\n readonly continuation?: { readonly id: string; readonly fork?: boolean };\n}\n\nexport interface TranscriptHandle {\n readonly id: string;\n readonly messages: readonly ModelMessage[];\n append(record: TranscriptRecord): Promise<void>;\n close(): Promise<void>;\n}\n"]}
@@ -1,6 +1,8 @@
1
+ import { invariant } from "../../domain/errors.js";
1
2
  import { claudeLayout } from "./claude-layout.js";
2
3
  import { codexLayout } from "./codex-layout.js";
3
4
  export function conversationLayout(format) {
5
+ invariant(format === "claude" || format === "codex", "This format stores a session bundle, not a single transcript");
4
6
  const factories = { claude: claudeLayout, codex: codexLayout };
5
7
  return factories[format]();
6
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,UAAU,kBAAkB,CAChC,MAA0B;IAE1B,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAC/D,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import type { ConversationFormat } from \"../conversations.types.ts\";\nimport { claudeLayout } from \"./claude-layout.ts\";\nimport { codexLayout } from \"./codex-layout.ts\";\nimport type { ConversationLayout } from \"./layout.types.ts\";\n\nexport function conversationLayout(\n format: ConversationFormat,\n): ConversationLayout {\n const factories = { claude: claudeLayout, codex: codexLayout };\n return factories[format]();\n}\n"]}
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,UAAU,kBAAkB,CAChC,MAA0B;IAE1B,SAAS,CACP,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,OAAO,EACzC,8DAA8D,CAC/D,CAAC;IACF,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAC/D,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import { invariant } from \"../../domain/errors.ts\";\nimport type { ConversationFormat } from \"../conversations.types.ts\";\nimport { claudeLayout } from \"./claude-layout.ts\";\nimport { codexLayout } from \"./codex-layout.ts\";\nimport type { ConversationLayout } from \"./layout.types.ts\";\n\nexport function conversationLayout(\n format: ConversationFormat,\n): ConversationLayout {\n invariant(\n format === \"claude\" || format === \"codex\",\n \"This format stores a session bundle, not a single transcript\",\n );\n const factories = { claude: claudeLayout, codex: codexLayout };\n return factories[format]();\n}\n"]}
@@ -1,10 +1,16 @@
1
+ import { sessionConversations } from "./session-bundle.js";
1
2
  import { stat } from "node:fs/promises";
2
3
  import { homedir } from "node:os";
3
4
  import { OutpostError } from "../../domain/errors.js";
4
5
  import { files } from "./files.js";
5
6
  import { conversationLayout } from "./layout.js";
6
7
  import { validId } from "./paths.js";
7
- export async function locateConversation(format, id, repository, home = homedir()) {
8
+ export async function locateConversation(format, id, repository, home) {
9
+ if (format === "copilot" || format === "kimi") {
10
+ const record = await sessionConversations(format).locate(id, repository, home);
11
+ return { ...record, format };
12
+ }
13
+ home ??= homedir();
8
14
  validId(id);
9
15
  const layout = conversationLayout(format);
10
16
  const expected = layout.preferredPath?.(id, repository, home);
@@ -1 +1 @@
1
- {"version":3,"file":"locate.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/locate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,I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at } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { OutpostError } from \"../../domain/errors.ts\";\nimport type {\n ConversationFormat,\n ConversationLocation,\n} from \"../conversations.types.ts\";\nimport { files } from \"./files.ts\";\nimport { conversationLayout } from \"./layout.ts\";\nimport { validId } from \"./paths.ts\";\n\nexport async function locateConversation(\n format: ConversationFormat,\n id: string,\n repository: string,\n home = homedir(),\n): Promise<ConversationLocation> {\n validId(id);\n const layout = conversationLayout(format);\n const expected = layout.preferredPath?.(id, repository, home);\n if (expected && (await stat(expected).catch(() => undefined))?.isFile())\n return { id, file: expected, format };\n const found = (await files(layout.searchRoot(home))).find((file) =>\n layout.matches(file, id),\n );\n if (found) return { id, file: found, format };\n throw new OutpostError(\n \"session\",\n `Conversation ${id} was not found in native ${format} storage`,\n { id, repository },\n );\n}\n"]}
1
+ {"version":3,"file":"locate.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/locate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAKtD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAA0B,EAC1B,EAAU,EACV,UAAkB,EAClB,IAAa;IAEb,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,MAAM,CAAC,CAAC,MAAM,CACtD,EAAE,EACF,UAAU,EACV,IAAI,CACL,CAAC;QACF,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,KAAK,OAAO,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAC9D,IAAI,QAAQ,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE;QACrE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACjE,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CACzB,CAAC;IACF,IAAI,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC9C,MAAM,IAAI,YAAY,CACpB,SAAS,EACT,gBAAgB,EAAE,4BAA4B,MAAM,UAAU,EAC9D,EAAE,EAAE,EAAE,UAAU,EAAE,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { sessionConversations } from \"./session-bundle.ts\";\nimport { stat } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { OutpostError } from \"../../domain/errors.ts\";\nimport type {\n ConversationFormat,\n ConversationLocation,\n} from \"../conversations.types.ts\";\nimport { files } from \"./files.ts\";\nimport { conversationLayout } from \"./layout.ts\";\nimport { validId } from \"./paths.ts\";\n\nexport async function locateConversation(\n format: ConversationFormat,\n id: string,\n repository: string,\n home?: string,\n): Promise<ConversationLocation> {\n if (format === \"copilot\" || format === \"kimi\") {\n const record = await sessionConversations(format).locate(\n id,\n repository,\n home,\n );\n return { ...record, format };\n }\n home ??= homedir();\n validId(id);\n const layout = conversationLayout(format);\n const expected = layout.preferredPath?.(id, repository, home);\n if (expected && (await stat(expected).catch(() => undefined))?.isFile())\n return { id, file: expected, format };\n const found = (await files(layout.searchRoot(home))).find((file) =>\n layout.matches(file, id),\n );\n if (found) return { id, file: found, format };\n throw new OutpostError(\n \"session\",\n `Conversation ${id} was not found in native ${format} storage`,\n { id, repository },\n );\n}\n"]}
@@ -1,8 +1,11 @@
1
+ import { sessionConversations } from "./session-bundle.js";
1
2
  import { invariant } from "../../domain/errors.js";
2
3
  import { captureConversation } from "./capture.js";
3
4
  import { locateConversation } from "./locate.js";
4
5
  import { restoreConversation } from "./restore.js";
5
6
  export function nativeConversations(format) {
7
+ if (format === "copilot" || format === "kimi")
8
+ return sessionConversations(format);
6
9
  return {
7
10
  name: format,
8
11
  locate(id, repository, home) {
@@ -11,8 +14,12 @@ export function nativeConversations(format) {
11
14
  capture(id, context) {
12
15
  return captureConversation(format, id, context.repository, context.sandbox, context.staging, context);
13
16
  },
14
- restore(record, context) {
17
+ async restore(record, context) {
15
18
  invariant(record.format === format, "Conversation format does not match its storage");
19
+ if (context.local &&
20
+ context.sandbox.root === context.repository &&
21
+ record.reference === undefined)
22
+ return;
16
23
  return restoreConversation({ ...record, format }, context.sandbox, context.staging);
17
24
  },
18
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"native-store.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/native-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,mBAAmB,CACjC,MAA0B;IAE1B,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI;YACzB,OAAO,kBAAkB,CAAC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,OAAO;YACjB,OAAO,mBAAmB,CACxB,MAAM,EACN,EAAE,EACF,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,OAAO,EACf,OAAO,CACR,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,MAAM,EAAE,OAAO;YACrB,SAAS,CACP,MAAM,CAAC,MAAM,KAAK,MAAM,EACxB,gDAAgD,CACjD,CAAC;YACF,OAAO,mBAAmB,CACxB,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,EACrB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,OAAO,CAChB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ConversationStore } from \"../../domain/conversation.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport type { ConversationFormat } from \"../conversations.types.ts\";\nimport { captureConversation } from \"./capture.ts\";\nimport { locateConversation } from \"./locate.ts\";\nimport { restoreConversation } from \"./restore.ts\";\n\nexport function nativeConversations(\n format: ConversationFormat,\n): ConversationStore {\n return {\n name: format,\n locate(id, repository, home) {\n return locateConversation(format, id, repository, home);\n },\n capture(id, context) {\n return captureConversation(\n format,\n id,\n context.repository,\n context.sandbox,\n context.staging,\n context,\n );\n },\n restore(record, context) {\n invariant(\n record.format === format,\n \"Conversation format does not match its storage\",\n );\n return restoreConversation(\n { ...record, format },\n context.sandbox,\n context.staging,\n );\n },\n };\n}\n"]}
1
+ {"version":3,"file":"native-store.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/native-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,mBAAmB,CACjC,MAA0B;IAE1B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM;QAC3C,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI;YACzB,OAAO,kBAAkB,CAAC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,OAAO;YACjB,OAAO,mBAAmB,CACxB,MAAM,EACN,EAAE,EACF,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,OAAO,EACf,OAAO,CACR,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO;YAC3B,SAAS,CACP,MAAM,CAAC,MAAM,KAAK,MAAM,EACxB,gDAAgD,CACjD,CAAC;YACF,IACE,OAAO,CAAC,KAAK;gBACb,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,UAAU;gBAC3C,MAAM,CAAC,SAAS,KAAK,SAAS;gBAE9B,OAAO;YACT,OAAO,mBAAmB,CACxB,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,EACrB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,OAAO,CAChB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { sessionConversations } from \"./session-bundle.ts\";\nimport type { ConversationStore } from \"../../domain/conversation.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport type { ConversationFormat } from \"../conversations.types.ts\";\nimport { captureConversation } from \"./capture.ts\";\nimport { locateConversation } from \"./locate.ts\";\nimport { restoreConversation } from \"./restore.ts\";\n\nexport function nativeConversations(\n format: ConversationFormat,\n): ConversationStore {\n if (format === \"copilot\" || format === \"kimi\")\n return sessionConversations(format);\n return {\n name: format,\n locate(id, repository, home) {\n return locateConversation(format, id, repository, home);\n },\n capture(id, context) {\n return captureConversation(\n format,\n id,\n context.repository,\n context.sandbox,\n context.staging,\n context,\n );\n },\n async restore(record, context) {\n invariant(\n record.format === format,\n \"Conversation format does not match its storage\",\n );\n if (\n context.local &&\n context.sandbox.root === context.repository &&\n record.reference === undefined\n )\n return;\n return restoreConversation(\n { ...record, format },\n context.sandbox,\n context.staging,\n );\n },\n };\n}\n"]}
@@ -1,8 +1,11 @@
1
+ import { posix } from "node:path";
1
2
  import { validId } from "./identity.js";
2
3
  import { conversationLayout } from "./layout.js";
3
4
  export { projectKey, validId } from "./identity.js";
4
5
  export function remotePath(format, id, lease, original) {
5
6
  validId(id);
7
+ if (format === "copilot" || format === "kimi")
8
+ return posix.join(lease.home, ".outpost", "conversations", format, `${id}.json`);
6
9
  return conversationLayout(format).remotePath(id, lease, original);
7
10
  }
8
11
  //# sourceMappingURL=paths.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/paths.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACpD,MAAM,UAAU,UAAU,CACxB,MAA0B,EAC1B,EAAU,EACV,KAAmB,EACnB,QAAgB;IAEhB,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import type { SandboxLease } from \"../../domain/sandbox.types.ts\";\nimport type { ConversationFormat } from \"../conversations.types.ts\";\nimport { validId } from \"./identity.ts\";\nimport { conversationLayout } from \"./layout.ts\";\n\nexport { projectKey, validId } from \"./identity.ts\";\nexport function remotePath(\n format: ConversationFormat,\n id: string,\n lease: SandboxLease,\n original: string,\n): string {\n validId(id);\n return conversationLayout(format).remotePath(id, lease, original);\n}\n"]}
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACpD,MAAM,UAAU,UAAU,CACxB,MAA0B,EAC1B,EAAU,EACV,KAAmB,EACnB,QAAgB;IAEhB,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM;QAC3C,OAAO,KAAK,CAAC,IAAI,CACf,KAAK,CAAC,IAAI,EACV,UAAU,EACV,eAAe,EACf,MAAM,EACN,GAAG,EAAE,OAAO,CACb,CAAC;IACJ,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { posix } from \"node:path\";\nimport type { SandboxLease } from \"../../domain/sandbox.types.ts\";\nimport type { ConversationFormat } from \"../conversations.types.ts\";\nimport { validId } from \"./identity.ts\";\nimport { conversationLayout } from \"./layout.ts\";\n\nexport { projectKey, validId } from \"./identity.ts\";\nexport function remotePath(\n format: ConversationFormat,\n id: string,\n lease: SandboxLease,\n original: string,\n): string {\n validId(id);\n if (format === \"copilot\" || format === \"kimi\")\n return posix.join(\n lease.home,\n \".outpost\",\n \"conversations\",\n format,\n `${id}.json`,\n );\n return conversationLayout(format).remotePath(id, lease, original);\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { sessionConversations } from "./session-bundle.js";
1
2
  import { randomUUID } from "node:crypto";
2
3
  import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
3
4
  import { dirname, join, posix, relative } from "node:path";
@@ -6,6 +7,12 @@ import { conversationLayout } from "./layout.js";
6
7
  import { remotePath } from "./paths.js";
7
8
  import { relocateTranscript } from "./relocate.js";
8
9
  export async function restoreConversation(location, lease, staging) {
10
+ if (location.format === "copilot" || location.format === "kimi")
11
+ return sessionConversations(location.format).restore(location, {
12
+ repository: lease.root,
13
+ sandbox: lease,
14
+ staging,
15
+ });
9
16
  const target = remotePath(location.format, location.id, lease, location.file);
10
17
  const contents = relocateTranscript(await readFile(location.file, "utf8"), lease.root);
11
18
  const temporary = join(staging, `${randomUUID()}.jsonl`);
@@ -1 +1 @@
1
- {"version":3,"file":"restore.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/restore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAA8B,EAC9B,KAAmB,EACnB,OA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AC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,EAC5D,EAAE,IAAI,EAAE,KAAK,EAAE,CAChB,CAAC;YACF,IAAI,CAAC;gBACH,MAAM,KAAK,CAAC,MAAM,CAChB,KAAK,EACL,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,CAClE,CAAC;YACJ,CAAC;oBAAS,CAAC;gBACT,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, join, posix, relative } from \"node:path\";\nimport type { SandboxLease } from \"../../domain/sandbox.types.ts\";\nimport type { ConversationLocation } from \"../conversations.types.ts\";\nimport { files } from \"./files.ts\";\nimport { conversationLayout } from \"./layout.ts\";\nimport { remotePath } from \"./paths.ts\";\nimport { relocateTranscript } from \"./relocate.ts\";\n\nexport async function restoreConversation(\n location: ConversationLocation,\n lease: SandboxLease,\n staging: string,\n): Promise<void> {\n const target = remotePath(location.format, location.id, lease, location.file);\n const contents = relocateTranscript(\n await readFile(location.file, \"utf8\"),\n lease.root,\n );\n const temporary = join(staging, `${randomUUID()}.jsonl`);\n await mkdir(staging, { recursive: true });\n await writeFile(temporary, contents, { mode: 0o600 });\n try {\n await lease.upload(temporary, target);\n } finally {\n await rm(temporary, { force: true });\n }\n if (conversationLayout(location.format).sidecars) {\n const sidecars = join(dirname(location.file), location.id, \"subagents\");\n for (const file of await files(sidecars)) {\n const name = relative(sidecars, file).replaceAll(\"\\\\\", \"/\");\n const local = join(staging, `${randomUUID()}.jsonl`);\n await writeFile(\n local,\n relocateTranscript(await readFile(file, \"utf8\"), lease.root),\n { mode: 0o600 },\n );\n try {\n await lease.upload(\n local,\n posix.join(posix.dirname(target), location.id, \"subagents\", name),\n );\n } finally {\n await rm(local, { force: true });\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"restore.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/restore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAA8B,EAC9B,KAAmB,EACnB,OAAe;IAEf,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM;QAC7D,OAAO,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE;YAC7D,UAAU,EAAE,KAAK,CAAC,IAAI;YACtB,OAAO,EAAE,KAAK;YACd,OAAO;SACR,CAAC,CAAC;IACL,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,kBAAkB,CACjC,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA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AO,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,CAClE,CAAC;YACJ,CAAC;oBAAS,CAAC;gBACT,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { sessionConversations } from \"./session-bundle.ts\";\nimport { randomUUID } from \"node:crypto\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, join, posix, relative } from \"node:path\";\nimport type { SandboxLease } from \"../../domain/sandbox.types.ts\";\nimport type { ConversationLocation } from \"../conversations.types.ts\";\nimport { files } from \"./files.ts\";\nimport { conversationLayout } from \"./layout.ts\";\nimport { remotePath } from \"./paths.ts\";\nimport { relocateTranscript } from \"./relocate.ts\";\n\nexport async function restoreConversation(\n location: ConversationLocation,\n lease: SandboxLease,\n staging: string,\n): Promise<void> {\n if (location.format === \"copilot\" || location.format === \"kimi\")\n return sessionConversations(location.format).restore(location, {\n repository: lease.root,\n sandbox: lease,\n staging,\n });\n const target = remotePath(location.format, location.id, lease, location.file);\n const contents = relocateTranscript(\n await readFile(location.file, \"utf8\"),\n lease.root,\n );\n const temporary = join(staging, `${randomUUID()}.jsonl`);\n await mkdir(staging, { recursive: true });\n await writeFile(temporary, contents, { mode: 0o600 });\n try {\n await lease.upload(temporary, target);\n } finally {\n await rm(temporary, { force: true });\n }\n if (conversationLayout(location.format).sidecars) {\n const sidecars = join(dirname(location.file), location.id, \"subagents\");\n for (const file of await files(sidecars)) {\n const name = relative(sidecars, file).replaceAll(\"\\\\\", \"/\");\n const local = join(staging, `${randomUUID()}.jsonl`);\n await writeFile(\n local,\n relocateTranscript(await readFile(file, \"utf8\"), lease.root),\n { mode: 0o600 },\n );\n try {\n await lease.upload(\n local,\n posix.join(posix.dirname(target), location.id, \"subagents\", name),\n );\n } finally {\n await rm(local, { force: true });\n }\n }\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export declare const sessionBundleLimits: Readonly<{
2
+ bytes: number;
3
+ files: 4096;
4
+ }>;
5
+ export declare const sessionBundleScript: string;