@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
@@ -0,0 +1,63 @@
1
+ import { join, posix } from "node:path";
2
+ import { DEFAULT_KIMI_REGION, kimiRegions } from "./kimi.constants.js";
3
+ import { invariant } from "../../domain/errors.js";
4
+ import { KIMI_LOGIN_DEADLINE_MS, credentialVariables, } from "./authentication.constants.js";
5
+ import { credentialPlan, toolCommand, variableCredential, } from "./authentication.js";
6
+ function profile(root, region) {
7
+ const selected = kimiRegions[region];
8
+ const profileFiles = [["credentials", selected.credential], ["device_id"]];
9
+ return (variables) => {
10
+ for (const [name, expected] of [
11
+ ["KIMI_CODE_OAUTH_HOST", selected.oauthHost],
12
+ ["KIMI_OAUTH_HOST", selected.oauthHost],
13
+ ["KIMI_CODE_BASE_URL", selected.baseUrl],
14
+ ])
15
+ invariant(!variables[name] || variables[name]?.replace(/\/+$/, "") === expected, `Kimi ${name} conflicts with account region "${region}"`);
16
+ return credentialPlan({
17
+ variables: {
18
+ KIMI_CODE_OAUTH_HOST: selected.oauthHost,
19
+ KIMI_CODE_BASE_URL: selected.baseUrl,
20
+ },
21
+ host: profileFiles.map((parts) => ({
22
+ source: root(join(...parts)),
23
+ destination: { file: posix.join(".kimi-code", ...parts) },
24
+ login: `kimi login --region ${region}`,
25
+ alternative: `"usage" with ${credentialVariables.kimi.usage} and a model`,
26
+ })),
27
+ commands: [
28
+ toolCommand("kimi", ["login", "--region", region], {
29
+ deadlineMs: KIMI_LOGIN_DEADLINE_MS,
30
+ }),
31
+ ],
32
+ });
33
+ };
34
+ }
35
+ function modelName(input) {
36
+ const name = input.model?.name;
37
+ invariant(name, "Kimi Code usage authentication requires a model name on agent()");
38
+ return name;
39
+ }
40
+ const key = variableCredential({
41
+ variable: credentialVariables.kimi.usage,
42
+ bind: modelName,
43
+ expose: (secret, input) => ({
44
+ variables: {
45
+ KIMI_MODEL_API_KEY: secret,
46
+ KIMI_MODEL_PROVIDER_TYPE: "kimi",
47
+ KIMI_MODEL_NAME: modelName(input),
48
+ },
49
+ }),
50
+ });
51
+ export function kimiCredentials(region = DEFAULT_KIMI_REGION) {
52
+ return Object.freeze({
53
+ account: () => profile((path) => ({
54
+ path: join("~/.kimi-code", path),
55
+ home: { variable: "KIMI_CODE_HOME", path },
56
+ }), region),
57
+ "account.file": (input) => profile((path) => ({ path: join(input.value, path) }), region),
58
+ usage: key.preset,
59
+ "usage.key": key.key,
60
+ "usage.variable": key.variable,
61
+ });
62
+ }
63
+ //# sourceMappingURL=kimi-authentication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi-authentication.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi-authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,cAAc,EACd,WAAW,EACX,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAO7B,SAAS,OAAO,CACd,IAA0C,EAC1C,MAA2C;IAE3C,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,CAAC,CAAC,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3E,OAAO,CAAC,SAAS,EAAE,EAAE;QACnB,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI;YAC7B,CAAC,sBAAsB,EAAE,QAAQ,CAAC,SAAS,CAAC;YAC5C,CAAC,iBAAiB,EAAE,QAAQ,CAAC,SAAS,CAAC;YACvC,CAAC,oBAAoB,EAAE,QAAQ,CAAC,OAAO,CAAC;SAChC;YACR,SAAS,CACP,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,QAAQ,EACrE,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AAEH,MAAM,UAAU,eAAe,CAC7B,SAA8C,mBAAmB;IAEjE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,GAAG,EAAE,CACZ,OAAO,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACT,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC;YAChC,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE;SAC3C,CAAC,EACF,MAAM,CACP;QACH,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CACxB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAChE,KAAK,EAAE,GAAG,CAAC,MAAM;QACjB,WAAW,EAAE,GAAG,CAAC,GAAG;QACpB,gBAAgB,EAAE,GAAG,CAAC,QAAQ;KAC/B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { join, posix } from \"node:path\";\nimport { DEFAULT_KIMI_REGION, kimiRegions } from \"./kimi.constants.ts\";\nimport type { KimiSettings } from \"./kimi.types.ts\";\nimport type { HostCredentialPath } from \"../../domain/agent.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport {\n KIMI_LOGIN_DEADLINE_MS,\n credentialVariables,\n} from \"./authentication.constants.ts\";\nimport {\n credentialPlan,\n toolCommand,\n variableCredential,\n} from \"./authentication.ts\";\nimport type {\n CredentialInput,\n CredentialPlanner,\n CredentialStrategy,\n} from \"./authentication.types.ts\";\n\nfunction profile(\n root: (path: string) => HostCredentialPath,\n region: NonNullable<KimiSettings[\"region\"]>,\n): CredentialPlanner {\n const selected = kimiRegions[region];\n const profileFiles = [[\"credentials\", selected.credential], [\"device_id\"]];\n return (variables) => {\n for (const [name, expected] of [\n [\"KIMI_CODE_OAUTH_HOST\", selected.oauthHost],\n [\"KIMI_OAUTH_HOST\", selected.oauthHost],\n [\"KIMI_CODE_BASE_URL\", selected.baseUrl],\n ] as const)\n invariant(\n !variables[name] || variables[name]?.replace(/\\/+$/, \"\") === expected,\n `Kimi ${name} conflicts with account region \"${region}\"`,\n );\n return credentialPlan({\n variables: {\n KIMI_CODE_OAUTH_HOST: selected.oauthHost,\n KIMI_CODE_BASE_URL: selected.baseUrl,\n },\n host: profileFiles.map((parts) => ({\n source: root(join(...parts)),\n destination: { file: posix.join(\".kimi-code\", ...parts) },\n login: `kimi login --region ${region}`,\n alternative: `\"usage\" with ${credentialVariables.kimi.usage} and a model`,\n })),\n commands: [\n toolCommand(\"kimi\", [\"login\", \"--region\", region], {\n deadlineMs: KIMI_LOGIN_DEADLINE_MS,\n }),\n ],\n });\n };\n}\n\nfunction modelName(input: CredentialInput): string {\n const name = input.model?.name;\n invariant(\n name,\n \"Kimi Code usage authentication requires a model name on agent()\",\n );\n return name;\n}\n\nconst key = variableCredential({\n variable: credentialVariables.kimi.usage,\n bind: modelName,\n expose: (secret, input) => ({\n variables: {\n KIMI_MODEL_API_KEY: secret,\n KIMI_MODEL_PROVIDER_TYPE: \"kimi\",\n KIMI_MODEL_NAME: modelName(input),\n },\n }),\n});\n\nexport function kimiCredentials(\n region: NonNullable<KimiSettings[\"region\"]> = DEFAULT_KIMI_REGION,\n): CredentialStrategy {\n return Object.freeze({\n account: () =>\n profile(\n (path) => ({\n path: join(\"~/.kimi-code\", path),\n home: { variable: \"KIMI_CODE_HOME\", path },\n }),\n region,\n ),\n \"account.file\": (input) =>\n profile((path) => ({ path: join(input.value, path) }), region),\n usage: key.preset,\n \"usage.key\": key.key,\n \"usage.variable\": key.variable,\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { AgentCliDiagnostic } from "./cli-diagnostics.types.ts";
2
+ export declare function kimiDiagnostics(): readonly AgentCliDiagnostic[];
@@ -0,0 +1,14 @@
1
+ import { helpDiagnostics } from "./cli-diagnostics.js";
2
+ import { kimiRequest } from "./kimi-request.js";
3
+ export function kimiDiagnostics() {
4
+ return [
5
+ ...helpDiagnostics((input) => kimiRequest({}, input), "Usage: kimi [", true),
6
+ {
7
+ mode: "fork",
8
+ usage: "Usage: kimi fork [",
9
+ options: ["--yes"],
10
+ command: { executable: "kimi", arguments: ["fork", "--help"] },
11
+ },
12
+ ];
13
+ }
14
+ //# sourceMappingURL=kimi-diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL,GAAG,eAAe,CAChB,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,EACjC,eAAe,EACf,IAAI,CACL;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE,CAAC,OAAO,CAAC;YAClB,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;SAC/D;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { helpDiagnostics } from \"./cli-diagnostics.ts\";\nimport { kimiRequest } from \"./kimi-request.ts\";\nimport type { AgentCliDiagnostic } from \"./cli-diagnostics.types.ts\";\n\nexport function kimiDiagnostics(): readonly AgentCliDiagnostic[] {\n return [\n ...helpDiagnostics(\n (input) => kimiRequest({}, input),\n \"Usage: kimi [\",\n true,\n ),\n {\n mode: \"fork\",\n usage: \"Usage: kimi fork [\",\n options: [\"--yes\"],\n command: { executable: \"kimi\", arguments: [\"fork\", \"--help\"] },\n },\n ];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { AgentEvent } from "../../domain/agent.types.ts";
2
+ export declare function kimiEvents(line: string): AgentEvent[];
@@ -0,0 +1,55 @@
1
+ import { toolResult } from "./tool-result.js";
2
+ import { decodeLine } from "./event-decoder.js";
3
+ import { asRecord } from "./protocol.js";
4
+ function toolInput(value) {
5
+ if (typeof value !== "string")
6
+ return value;
7
+ try {
8
+ return JSON.parse(value);
9
+ }
10
+ catch {
11
+ return value;
12
+ }
13
+ }
14
+ function assistant(event) {
15
+ const calls = Array.isArray(event.tool_calls) ? event.tool_calls : [];
16
+ const tools = calls.map(asRecord).flatMap((call) => {
17
+ const invocation = asRecord(call.function);
18
+ return typeof invocation.name === "string"
19
+ ? [
20
+ {
21
+ kind: "tool",
22
+ name: invocation.name,
23
+ input: toolInput(invocation.arguments),
24
+ ...(typeof call.id === "string" ? { callId: call.id } : {}),
25
+ },
26
+ ]
27
+ : [];
28
+ });
29
+ if (typeof event.reasoning_content === "string" && event.reasoning_content)
30
+ tools.push({ kind: "reasoning", text: event.reasoning_content });
31
+ return typeof event.content === "string" && event.content
32
+ ? [{ kind: "text", text: event.content }, ...tools]
33
+ : tools;
34
+ }
35
+ const meta = {
36
+ "session.resume_hint": (event) => typeof event.session_id === "string"
37
+ ? [{ kind: "conversation", id: event.session_id }]
38
+ : [],
39
+ "turn.step.retrying": (event) => typeof event.error_message === "string"
40
+ ? [{ kind: "warning", message: event.error_message }]
41
+ : [],
42
+ };
43
+ export function kimiEvents(line) {
44
+ return decodeLine(line, {
45
+ assistant,
46
+ tool: (event) => toolResult(event.tool_call_id, event.name, event.content, event.is_error === true),
47
+ meta: (event) => {
48
+ const decode = typeof event.type === "string" && Object.hasOwn(meta, event.type)
49
+ ? meta[event.type]
50
+ : undefined;
51
+ return decode?.(event) ?? [];
52
+ },
53
+ }, "role");
54
+ }
55
+ //# sourceMappingURL=kimi-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi-events.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi-events.ts"],"names":[],"mappings":"AAAA,OAAO,E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;gBAClB,CAAC,CAAC,SAAS,CAAC;YAChB,OAAO,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC;KACF,EACD,MAAM,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { toolResult } from \"./tool-result.ts\";\nimport type { AgentEvent } from \"../../domain/agent.types.ts\";\nimport { decodeLine } from \"./event-decoder.ts\";\nimport { asRecord } from \"./protocol.ts\";\nimport type { EventDecoders, ProtocolRecord } from \"./protocol.types.ts\";\n\nfunction toolInput(value: unknown): unknown {\n if (typeof value !== \"string\") return value;\n try {\n return JSON.parse(value);\n } catch {\n return value;\n }\n}\n\nfunction assistant(event: ProtocolRecord): AgentEvent[] {\n const calls = Array.isArray(event.tool_calls) ? event.tool_calls : [];\n const tools = calls.map(asRecord).flatMap((call): AgentEvent[] => {\n const invocation = asRecord(call.function);\n return typeof invocation.name === \"string\"\n ? [\n {\n kind: \"tool\",\n name: invocation.name,\n input: toolInput(invocation.arguments),\n ...(typeof call.id === \"string\" ? { callId: call.id } : {}),\n },\n ]\n : [];\n });\n if (typeof event.reasoning_content === \"string\" && event.reasoning_content)\n tools.push({ kind: \"reasoning\", text: event.reasoning_content });\n return typeof event.content === \"string\" && event.content\n ? [{ kind: \"text\", text: event.content }, ...tools]\n : tools;\n}\n\nconst meta: EventDecoders = {\n \"session.resume_hint\": (event) =>\n typeof event.session_id === \"string\"\n ? [{ kind: \"conversation\", id: event.session_id }]\n : [],\n \"turn.step.retrying\": (event) =>\n typeof event.error_message === \"string\"\n ? [{ kind: \"warning\", message: event.error_message }]\n : [],\n};\n\nexport function kimiEvents(line: string): AgentEvent[] {\n return decodeLine(\n line,\n {\n assistant,\n tool: (event) =>\n toolResult(\n event.tool_call_id,\n event.name,\n event.content,\n event.is_error === true,\n ),\n meta: (event) => {\n const decode =\n typeof event.type === \"string\" && Object.hasOwn(meta, event.type)\n ? meta[event.type]\n : undefined;\n return decode?.(event) ?? [];\n },\n },\n \"role\",\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { AgentAdapter } from "../../domain/agent.types.ts";
2
+ export declare const forkKimi: NonNullable<AgentAdapter["fork"]>;
@@ -0,0 +1,11 @@
1
+ import { invariant } from "../../domain/errors.js";
2
+ import { validId } from "../../infrastructure/conversations/identity.js";
3
+ import { requireSuccess } from "../../infrastructure/process.js";
4
+ export const forkKimi = async (id, invoke) => {
5
+ validId(id);
6
+ const result = await requireSuccess({ executable: "kimi", arguments: ["fork", id, "--yes"] }, invoke);
7
+ const child = /^Forked to ([A-Za-z0-9_-]+)(?: |$)/m.exec(result.stdout)?.[1];
8
+ invariant(child && child !== id, "Kimi fork did not return a distinct conversation identifier");
9
+ return child;
10
+ };
11
+ //# sourceMappingURL=kimi-fork.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi-fork.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi-fork.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,gDAAgD,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAsC,KAAK,EAC9D,EAAE,EACF,MAAM,EACN,EAAE;IACF,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,MAAM,MAAM,GAAG,MAAM,cAAc,CACjC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EACxD,MAAM,CACP,CAAC;IACF,MAAM,KAAK,GAAG,qCAAqC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7E,SAAS,CACP,KAAK,IAAI,KAAK,KAAK,EAAE,EACrB,6DAA6D,CAC9D,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import type { AgentAdapter } from \"../../domain/agent.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport { validId } from \"../../infrastructure/conversations/identity.ts\";\nimport { requireSuccess } from \"../../infrastructure/process.ts\";\n\nexport const forkKimi: NonNullable<AgentAdapter[\"fork\"]> = async (\n id,\n invoke,\n) => {\n validId(id);\n const result = await requireSuccess(\n { executable: \"kimi\", arguments: [\"fork\", id, \"--yes\"] },\n invoke,\n );\n const child = /^Forked to ([A-Za-z0-9_-]+)(?: |$)/m.exec(result.stdout)?.[1];\n invariant(\n child && child !== id,\n \"Kimi fork did not return a distinct conversation identifier\",\n );\n return child;\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { AgentInput } from "../../domain/agent.types.ts";
2
2
  import type { Command } from "../../domain/command.types.ts";
3
- import type { GeminiSettings } from "./gemini.types.ts";
3
+ import type { KimiSettings } from "./kimi.types.ts";
4
4
  import type { Bound } from "./settings.types.ts";
5
- export declare function geminiRequest(settings: Bound<GeminiSettings>, input: AgentInput): Command;
5
+ export declare function kimiRequest(settings: Bound<KimiSettings>, input: AgentInput): Command;
@@ -0,0 +1,33 @@
1
+ import { validId } from "../../infrastructure/conversations/identity.js";
2
+ import { authenticationForm } from "../../domain/authentication.js";
3
+ import { invariant } from "../../domain/errors.js";
4
+ function modelOption(settings) {
5
+ if (!settings.model)
6
+ return [];
7
+ const usage = settings.authentication !== undefined &&
8
+ authenticationForm(settings.authentication).form.startsWith("usage");
9
+ return usage ? [] : ["--model", settings.model.name];
10
+ }
11
+ export function kimiRequest(settings, input) {
12
+ invariant(!input.continuation?.fork, "Kimi Code requires native fork preparation in Outpost");
13
+ const args = [...modelOption(settings)];
14
+ if (input.continuation) {
15
+ validId(input.continuation.id);
16
+ args.push("--session", input.continuation.id);
17
+ }
18
+ if (input.interactive) {
19
+ invariant(input.text === undefined, "Kimi Code starts interactive sessions without an initial prompt");
20
+ return { executable: "kimi", arguments: args, interactive: true };
21
+ }
22
+ return {
23
+ executable: "kimi",
24
+ arguments: [
25
+ ...args,
26
+ "--prompt",
27
+ input.text ?? "",
28
+ "--output-format",
29
+ "stream-json",
30
+ ],
31
+ };
32
+ }
33
+ //# sourceMappingURL=kimi-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gDAAgD,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,SAAS,WAAW,CAAC,QAA6B;IAChD,IAAI,CAAC,QAAQ,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAC/B,MAAM,KAAK,GACT,QAAQ,CAAC,cAAc,KAAK,SAAS;QACrC,kBAAkB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACvE,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,QAA6B,EAC7B,KAAiB;IAEjB,SAAS,CACP,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EACzB,uDAAuD,CACxD,CAAC;IACF,MAAM,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,SAAS,CACP,KAAK,CAAC,IAAI,KAAK,SAAS,EACxB,iEAAiE,CAClE,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IACpE,CAAC;IACD,OAAO;QACL,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE;YACT,GAAG,IAAI;YACP,UAAU;YACV,KAAK,CAAC,IAAI,IAAI,EAAE;YAChB,iBAAiB;YACjB,aAAa;SACd;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { validId } from \"../../infrastructure/conversations/identity.ts\";\nimport type { AgentInput } from \"../../domain/agent.types.ts\";\nimport { authenticationForm } from \"../../domain/authentication.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport type { KimiSettings } from \"./kimi.types.ts\";\nimport type { Bound } from \"./settings.types.ts\";\n\nfunction modelOption(settings: Bound<KimiSettings>): readonly string[] {\n if (!settings.model) return [];\n const usage =\n settings.authentication !== undefined &&\n authenticationForm(settings.authentication).form.startsWith(\"usage\");\n return usage ? [] : [\"--model\", settings.model.name];\n}\n\nexport function kimiRequest(\n settings: Bound<KimiSettings>,\n input: AgentInput,\n): Command {\n invariant(\n !input.continuation?.fork,\n \"Kimi Code requires native fork preparation in Outpost\",\n );\n const args = [...modelOption(settings)];\n if (input.continuation) {\n validId(input.continuation.id);\n args.push(\"--session\", input.continuation.id);\n }\n if (input.interactive) {\n invariant(\n input.text === undefined,\n \"Kimi Code starts interactive sessions without an initial prompt\",\n );\n return { executable: \"kimi\", arguments: args, interactive: true };\n }\n return {\n executable: \"kimi\",\n arguments: [\n ...args,\n \"--prompt\",\n input.text ?? \"\",\n \"--output-format\",\n \"stream-json\",\n ],\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { Usage } from "../../domain/agent.types.ts";
2
+ export declare function kimiUsage(value: unknown): Usage;
@@ -0,0 +1,7 @@
1
+ import { asRecord } from "./protocol.js";
2
+ import { usageCounts } from "./session-usage.js";
3
+ export function kimiUsage(value) {
4
+ const usage = asRecord(value);
5
+ return usageCounts(usage.inputOther, usage.output, usage.inputCacheRead, usage.inputCacheCreation);
6
+ }
7
+ //# sourceMappingURL=kimi-usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi-usage.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi-usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,WAAW,CAChB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,kBAAkB,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import type { Usage } from \"../../domain/agent.types.ts\";\nimport { asRecord } from \"./protocol.ts\";\nimport { usageCounts } from \"./session-usage.ts\";\n\nexport function kimiUsage(value: unknown): Usage {\n const usage = asRecord(value);\n return usageCounts(\n usage.inputOther,\n usage.output,\n usage.inputCacheRead,\n usage.inputCacheCreation,\n );\n}\n"]}
@@ -0,0 +1,13 @@
1
+ export declare const DEFAULT_KIMI_REGION = "global";
2
+ export declare const kimiRegions: Readonly<{
3
+ readonly "mainland-cn": {
4
+ readonly credential: "kimi-code.json";
5
+ readonly oauthHost: "https://auth.kimi.com";
6
+ readonly baseUrl: "https://api.kimi.com/coding/v1";
7
+ };
8
+ readonly global: {
9
+ readonly credential: "kimi-code-env-0e4f99c69cc27850.json";
10
+ readonly oauthHost: "https://auth.kimi.ai";
11
+ readonly baseUrl: "https://api.kimi.ai/coding/v1";
12
+ };
13
+ }>;
@@ -0,0 +1,14 @@
1
+ export const DEFAULT_KIMI_REGION = "global";
2
+ export const kimiRegions = Object.freeze({
3
+ "mainland-cn": {
4
+ credential: "kimi-code.json",
5
+ oauthHost: "https://auth.kimi.com",
6
+ baseUrl: "https://api.kimi.com/coding/v1",
7
+ },
8
+ global: {
9
+ credential: "kimi-code-env-0e4f99c69cc27850.json",
10
+ oauthHost: "https://auth.kimi.ai",
11
+ baseUrl: "https://api.kimi.ai/coding/v1",
12
+ },
13
+ });
14
+ //# sourceMappingURL=kimi.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAE5C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE;QACb,UAAU,EAAE,gBAAgB;QAC5B,SAAS,EAAE,uBAAuB;QAClC,OAAO,EAAE,gCAAgC;KAC1C;IACD,MAAM,EAAE;QACN,UAAU,EAAE,qCAAqC;QACjD,SAAS,EAAE,sBAAsB;QACjC,OAAO,EAAE,+BAA+B;KACzC;CACO,CAAC,CAAC","sourcesContent":["export const DEFAULT_KIMI_REGION = \"global\";\n\nexport const kimiRegions = Object.freeze({\n \"mainland-cn\": {\n credential: \"kimi-code.json\",\n oauthHost: \"https://auth.kimi.com\",\n baseUrl: \"https://api.kimi.com/coding/v1\",\n },\n global: {\n credential: \"kimi-code-env-0e4f99c69cc27850.json\",\n oauthHost: \"https://auth.kimi.ai\",\n baseUrl: \"https://api.kimi.ai/coding/v1\",\n },\n} as const);\n"]}
@@ -0,0 +1,7 @@
1
+ import type { AgentAuthentication } from "../../domain/agent.types.ts";
2
+ import type { Variables } from "../../domain/command.types.ts";
3
+ export interface KimiSettings {
4
+ readonly region?: "mainland-cn" | "global";
5
+ readonly authentication?: AgentAuthentication;
6
+ readonly variables?: Variables;
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=kimi.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kimi.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/kimi.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentAuthentication } from \"../../domain/agent.types.ts\";\nimport type { Variables } from \"../../domain/command.types.ts\";\n\nexport interface KimiSettings {\n readonly region?: \"mainland-cn\" | \"global\";\n readonly authentication?: AgentAuthentication;\n readonly variables?: Variables;\n}\n"]}
@@ -2,5 +2,7 @@ import type { CliModelSupport } from "./settings.types.ts";
2
2
  export declare const CLAUDE_MAX_OUTPUT_VARIABLE = "CLAUDE_CODE_MAX_OUTPUT_TOKENS";
3
3
  export declare const claudeModelSupport: CliModelSupport;
4
4
  export declare const codexModelSupport: CliModelSupport;
5
- export declare const geminiModelSupport: CliModelSupport;
5
+ export declare const antigravityModelSupport: CliModelSupport;
6
+ export declare const copilotModelSupport: CliModelSupport;
7
+ export declare const kimiModelSupport: CliModelSupport;
6
8
  export declare const HARNESS_MODEL_KEYS: string[];
@@ -9,8 +9,18 @@ export const codexModelSupport = {
9
9
  reasoning: new Set(["low", "medium", "high", "xhigh", "max"]),
10
10
  maxOutputTokens: false,
11
11
  };
12
- export const geminiModelSupport = {
13
- agent: "Gemini CLI",
12
+ export const antigravityModelSupport = {
13
+ agent: "Antigravity CLI",
14
+ reasoning: new Set(),
15
+ maxOutputTokens: false,
16
+ };
17
+ export const copilotModelSupport = {
18
+ agent: "GitHub Copilot CLI",
19
+ reasoning: new Set(),
20
+ maxOutputTokens: false,
21
+ };
22
+ export const kimiModelSupport = {
23
+ agent: "Kimi Code",
14
24
  reasoning: new Set(),
15
25
  maxOutputTokens: false,
16
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"model-support.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/model-support.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAA+B,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7D,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7D,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,IAAI,GAAG,EAAE;IACpB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { CliModelSupport } from \"./settings.types.ts\";\n\nexport const CLAUDE_MAX_OUTPUT_VARIABLE = \"CLAUDE_CODE_MAX_OUTPUT_TOKENS\";\n\nexport const claudeModelSupport: CliModelSupport = {\n agent: \"Claude Code\",\n reasoning: new Set([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]),\n maxOutputTokens: true,\n};\n\nexport const codexModelSupport: CliModelSupport = {\n agent: \"Codex\",\n reasoning: new Set([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]),\n maxOutputTokens: false,\n};\n\nexport const geminiModelSupport: CliModelSupport = {\n agent: \"Gemini CLI\",\n reasoning: new Set(),\n maxOutputTokens: false,\n};\n\nexport const HARNESS_MODEL_KEYS = [\"model\", \"reasoning\", \"maxOutputTokens\"];\n"]}
1
+ {"version":3,"file":"model-support.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/model-support.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAA+B,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7D,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7D,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAoB;IACtD,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,IAAI,GAAG,EAAE;IACpB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAoB;IAClD,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,IAAI,GAAG,EAAE;IACpB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,IAAI,GAAG,EAAE;IACpB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { CliModelSupport } from \"./settings.types.ts\";\n\nexport const CLAUDE_MAX_OUTPUT_VARIABLE = \"CLAUDE_CODE_MAX_OUTPUT_TOKENS\";\n\nexport const claudeModelSupport: CliModelSupport = {\n agent: \"Claude Code\",\n reasoning: new Set([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]),\n maxOutputTokens: true,\n};\n\nexport const codexModelSupport: CliModelSupport = {\n agent: \"Codex\",\n reasoning: new Set([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]),\n maxOutputTokens: false,\n};\n\nexport const antigravityModelSupport: CliModelSupport = {\n agent: \"Antigravity CLI\",\n reasoning: new Set(),\n maxOutputTokens: false,\n};\n\nexport const copilotModelSupport: CliModelSupport = {\n agent: \"GitHub Copilot CLI\",\n reasoning: new Set(),\n maxOutputTokens: false,\n};\n\nexport const kimiModelSupport: CliModelSupport = {\n agent: \"Kimi Code\",\n reasoning: new Set(),\n maxOutputTokens: false,\n};\n\nexport const HARNESS_MODEL_KEYS = [\"model\", \"reasoning\", \"maxOutputTokens\"];\n"]}
@@ -1,2 +1,2 @@
1
- import type { AgentProtocolFixture } from "./protocol-fixtures.types.ts";
2
- export declare const protocolFixtures: Readonly<Record<"claude" | "codex" | "gemini", readonly AgentProtocolFixture[]>>;
1
+ import type { AgentProtocolFixture, ProtocolAgent } from "./protocol-fixtures.types.ts";
2
+ export declare const protocolFixtures: Readonly<Record<ProtocolAgent, readonly AgentProtocolFixture[]>>;
@@ -1,31 +1,104 @@
1
1
  export const protocolFixtures = {
2
- gemini: [
2
+ antigravity: [
3
3
  {
4
4
  name: "turn",
5
5
  lines: [
6
- '{"type":"init","session_id":"fixture-conversation","model":"fixture-model"}',
7
- '{"type":"tool_use","tool_name":"command","tool_id":"call-1","parameters":{"command":"fixture-command"}}',
8
- '{"type":"message","role":"assistant","content":"fixture-result","delta":true}',
9
- '{"type":"result","status":"success","stats":{"input_tokens":10,"cached":2,"output_tokens":3}}',
6
+ '{"event":"init","conversation_id":"fixture-conversation","init":{"cwd":"/workspace","model":"fixture-model"}}',
7
+ '{"event":"step_update","step_update":{"conversation_id":"fixture-conversation","step_index":1,"state":"ACTIVE","step_type":"tool","tool_name":"run_command"}}',
8
+ '{"event":"step_update","step_update":{"conversation_id":"fixture-conversation","step_index":1,"state":"DONE","step_type":"tool","tool_name":"run_command","tool_info":{"name":"run_command","parameters":{"command":"fixture-command"}}}}',
9
+ '{"event":"step_update","step_update":{"conversation_id":"fixture-conversation","step_index":2,"state":"ACTIVE","step_type":"agent_response","text_delta":"fixture-result"}}',
10
+ '{"event":"result","result":{"conversation_id":"fixture-conversation","status":"SUCCESS","response":"fixture-result","usage":{"input_tokens":10,"output_tokens":3,"thinking_tokens":1,"cache_read_tokens":2}}}',
10
11
  ],
11
12
  expected: [
12
13
  { kind: "conversation", id: "fixture-conversation" },
13
14
  {
14
15
  kind: "tool",
15
- name: "command",
16
+ name: "run_command",
17
+ input: undefined,
18
+ callId: "fixture-conversation:1",
19
+ },
20
+ {
21
+ kind: "tool-result",
22
+ name: "run_command",
23
+ callId: "fixture-conversation:1",
24
+ preview: "",
25
+ characters: 0,
26
+ isError: false,
27
+ },
28
+ { kind: "text", text: "fixture-result" },
29
+ { kind: "usage", tokens: { input: 10, cached: 2, output: 4 } },
30
+ { kind: "result", text: "fixture-result" },
31
+ { kind: "finished" },
32
+ ],
33
+ },
34
+ {
35
+ name: "failure",
36
+ lines: [
37
+ '{"event":"result","result":{"status":"CANCELED","response":""}}',
38
+ '{"event":"result","result":{"status":"ERROR","error":"fixture-failure"}}',
39
+ ],
40
+ expected: [
41
+ {
42
+ kind: "failure",
43
+ message: "Antigravity ended the turn with status CANCELED",
44
+ },
45
+ { kind: "failure", message: "fixture-failure" },
46
+ ],
47
+ },
48
+ {
49
+ name: "unknown",
50
+ lines: ['{"event":"future.event"}', "invalid-json"],
51
+ expected: [
52
+ { kind: "raw", value: { event: "future.event" } },
53
+ { kind: "raw", value: "invalid-json" },
54
+ ],
55
+ },
56
+ ],
57
+ copilot: [
58
+ {
59
+ name: "turn",
60
+ lines: [
61
+ '{"id":"1","timestamp":"2026-01-01T00:00:00.000Z","parentId":null,"type":"assistant.turn_start","data":{"turnId":"t1"}}',
62
+ '{"id":"2","timestamp":"2026-01-01T00:00:01.000Z","parentId":"1","type":"assistant.message","data":{"messageId":"m1","content":"","toolRequests":[{"toolCallId":"call-1","name":"bash","arguments":{"command":"fixture-command"},"type":"function"}]}}',
63
+ '{"id":"3","timestamp":"2026-01-01T00:00:02.000Z","parentId":"2","type":"assistant.message","data":{"messageId":"m2","content":"fixture-result","toolRequests":[]}}',
64
+ '{"type":"result","timestamp":"2026-01-01T00:00:03.000Z","sessionId":"fixture-conversation","exitCode":0,"usage":{"premiumRequests":1}}',
65
+ ],
66
+ expected: [
67
+ {
68
+ kind: "raw",
69
+ value: {
70
+ id: "1",
71
+ timestamp: "2026-01-01T00:00:00.000Z",
72
+ parentId: null,
73
+ type: "assistant.turn_start",
74
+ data: { turnId: "t1" },
75
+ },
76
+ },
77
+ {
78
+ kind: "tool",
79
+ name: "bash",
16
80
  input: { command: "fixture-command" },
81
+ callId: "call-1",
17
82
  },
18
83
  { kind: "text", text: "fixture-result" },
19
- { kind: "usage", tokens: { input: 10, cached: 2, output: 3 } },
84
+ { kind: "conversation", id: "fixture-conversation" },
20
85
  { kind: "finished" },
21
86
  ],
22
87
  },
23
88
  {
24
89
  name: "failure",
25
90
  lines: [
26
- '{"type":"result","status":"error","error":{"message":"fixture-failure"}}',
91
+ '{"type":"session.error","data":{"errorType":"authentication","message":"fixture-warning","statusCode":401}}',
92
+ '{"type":"result","sessionId":"fixture-conversation","exitCode":1}',
93
+ ],
94
+ expected: [
95
+ { kind: "warning", message: "fixture-warning" },
96
+ { kind: "conversation", id: "fixture-conversation" },
97
+ {
98
+ kind: "failure",
99
+ message: "GitHub Copilot CLI ended with exit code 1",
100
+ },
27
101
  ],
28
- expected: [{ kind: "failure", message: "fixture-failure" }],
29
102
  },
30
103
  {
31
104
  name: "unknown",
@@ -36,6 +109,55 @@ export const protocolFixtures = {
36
109
  ],
37
110
  },
38
111
  ],
112
+ kimi: [
113
+ {
114
+ name: "turn",
115
+ lines: [
116
+ '{"role":"meta","type":"system.version","version":"2.1.1"}',
117
+ '{"role":"assistant","tool_calls":[{"type":"function","id":"call-1","function":{"name":"Shell","arguments":"{\\"command\\":\\"fixture-command\\"}"}}]}',
118
+ '{"role":"tool","tool_call_id":"call-1","content":"fixture-output"}',
119
+ '{"role":"assistant","content":"fixture-result"}',
120
+ '{"role":"meta","type":"session.resume_hint","session_id":"fixture-conversation","command":"kimi -r fixture-conversation"}',
121
+ ],
122
+ expected: [
123
+ {
124
+ kind: "raw",
125
+ value: { role: "meta", type: "system.version", version: "2.1.1" },
126
+ },
127
+ {
128
+ kind: "tool",
129
+ name: "Shell",
130
+ input: { command: "fixture-command" },
131
+ callId: "call-1",
132
+ },
133
+ {
134
+ kind: "tool-result",
135
+ callId: "call-1",
136
+ name: "",
137
+ preview: "fixture-output",
138
+ characters: 14,
139
+ isError: false,
140
+ },
141
+ { kind: "text", text: "fixture-result" },
142
+ { kind: "conversation", id: "fixture-conversation" },
143
+ ],
144
+ },
145
+ {
146
+ name: "retry",
147
+ lines: [
148
+ '{"role":"meta","type":"turn.step.retrying","failed_attempt":1,"next_attempt":2,"error_message":"fixture-warning","status_code":429}',
149
+ ],
150
+ expected: [{ kind: "warning", message: "fixture-warning" }],
151
+ },
152
+ {
153
+ name: "unknown",
154
+ lines: ['{"role":"future"}', "invalid-json"],
155
+ expected: [
156
+ { kind: "raw", value: { role: "future" } },
157
+ { kind: "raw", value: "invalid-json" },
158
+ ],
159
+ },
160
+ ],
39
161
  codex: [
40
162
  {
41
163
  name: "turn",
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-fixtures.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/protocol-fixtures.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAEzB;IACF,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,6EAA6E;gBAC7E,yGAAyG;gBACzG,+EAA+E;gBAC/E,+FAA+F;aAChG;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;iBACtC;gBACD,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B,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;CACF,CAAC","sourcesContent":["import type { AgentProtocolFixture } from \"./protocol-fixtures.types.ts\";\n\nexport const protocolFixtures: Readonly<\n Record<\"claude\" | \"codex\" | \"gemini\", readonly AgentProtocolFixture[]>\n> = {\n gemini: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"init\",\"session_id\":\"fixture-conversation\",\"model\":\"fixture-model\"}',\n '{\"type\":\"tool_use\",\"tool_name\":\"command\",\"tool_id\":\"call-1\",\"parameters\":{\"command\":\"fixture-command\"}}',\n '{\"type\":\"message\",\"role\":\"assistant\",\"content\":\"fixture-result\",\"delta\":true}',\n '{\"type\":\"result\",\"status\":\"success\",\"stats\":{\"input_tokens\":10,\"cached\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n {\n kind: \"tool\",\n name: \"command\",\n input: { command: \"fixture-command\" },\n },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: [\n '{\"type\":\"result\",\"status\":\"error\",\"error\":{\"message\":\"fixture-failure\"}}',\n ],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n codex: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"thread.started\",\"thread_id\":\"fixture-conversation\"}',\n '{\"type\":\"item.started\",\"item\":{\"type\":\"command_execution\",\"command\":\"fixture-command\"}}',\n '{\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"fixture-result\"}}',\n '{\"type\":\"turn.completed\",\"usage\":{\"input_tokens\":10,\"cached_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"turn.failed\",\"error\":{\"message\":\"fixture-failure\"}}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n claude: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"system\",\"session_id\":\"fixture-conversation\"}',\n '{\"type\":\"assistant\",\"message\":{\"content\":[{\"type\":\"tool_use\",\"name\":\"command\",\"input\":\"fixture-command\"},{\"type\":\"text\",\"text\":\"fixture-result\"}]}}',\n '{\"type\":\"result\",\"result\":\"fixture-result\",\"usage\":{\"input_tokens\":10,\"cache_creation_input_tokens\":1,\"cache_read_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"result\", text: \"fixture-result\" },\n {\n kind: \"usage\",\n tokens: { input: 10, cached: 2, cacheCreated: 1, output: 3 },\n },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"result\",\"is_error\":true,\"result\":\"fixture-failure\"}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n};\n"]}
1
+ {"version":3,"file":"protocol-fixtures.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/protocol-fixtures.constants.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,gBAAgB,GAEzB;IACF,WAAW,EAAE;QACX;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,+GAA+G;gBAC/G,+JAA+J;gBAC/J,2OAA2O;gBAC3O,6KAA6K;gBAC7K,+MAA+M;aAChN;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,SAAS;oBAChB,MAAM,EAAE,wBAAwB;iBACjC;gBACD;oBACE,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,wBAAwB;oBAChC,OAAO,EAAE,EAAE;oBACX,UAAU,EAAE,CAAC;oBACb,OAAO,EAAE,KAAK;iBACf;gBACD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9D,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAC1C,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE;gBACL,iEAAiE;gBACjE,0EAA0E;aAC3E;YACD,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,iDAAiD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vC;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,uDAAuD;gBACvD,qJAAqJ;gBACrJ,uJAAuJ;aACxJ;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAC1C;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;iBAC7D;gBACD,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,8DAA8D,CAAC;YACvE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;CACF,CAAC","sourcesContent":["import type {\n AgentProtocolFixture,\n ProtocolAgent,\n} from \"./protocol-fixtures.types.ts\";\n\nexport const protocolFixtures: Readonly<\n Record<ProtocolAgent, readonly AgentProtocolFixture[]>\n> = {\n antigravity: [\n {\n name: \"turn\",\n lines: [\n '{\"event\":\"init\",\"conversation_id\":\"fixture-conversation\",\"init\":{\"cwd\":\"/workspace\",\"model\":\"fixture-model\"}}',\n '{\"event\":\"step_update\",\"step_update\":{\"conversation_id\":\"fixture-conversation\",\"step_index\":1,\"state\":\"ACTIVE\",\"step_type\":\"tool\",\"tool_name\":\"run_command\"}}',\n '{\"event\":\"step_update\",\"step_update\":{\"conversation_id\":\"fixture-conversation\",\"step_index\":1,\"state\":\"DONE\",\"step_type\":\"tool\",\"tool_name\":\"run_command\",\"tool_info\":{\"name\":\"run_command\",\"parameters\":{\"command\":\"fixture-command\"}}}}',\n '{\"event\":\"step_update\",\"step_update\":{\"conversation_id\":\"fixture-conversation\",\"step_index\":2,\"state\":\"ACTIVE\",\"step_type\":\"agent_response\",\"text_delta\":\"fixture-result\"}}',\n '{\"event\":\"result\",\"result\":{\"conversation_id\":\"fixture-conversation\",\"status\":\"SUCCESS\",\"response\":\"fixture-result\",\"usage\":{\"input_tokens\":10,\"output_tokens\":3,\"thinking_tokens\":1,\"cache_read_tokens\":2}}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n {\n kind: \"tool\",\n name: \"run_command\",\n input: undefined,\n callId: \"fixture-conversation:1\",\n },\n {\n kind: \"tool-result\",\n name: \"run_command\",\n callId: \"fixture-conversation:1\",\n preview: \"\",\n characters: 0,\n isError: false,\n },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 4 } },\n { kind: \"result\", text: \"fixture-result\" },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: [\n '{\"event\":\"result\",\"result\":{\"status\":\"CANCELED\",\"response\":\"\"}}',\n '{\"event\":\"result\",\"result\":{\"status\":\"ERROR\",\"error\":\"fixture-failure\"}}',\n ],\n expected: [\n {\n kind: \"failure\",\n message: \"Antigravity ended the turn with status CANCELED\",\n },\n { kind: \"failure\", message: \"fixture-failure\" },\n ],\n },\n {\n name: \"unknown\",\n lines: ['{\"event\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { event: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n copilot: [\n {\n name: \"turn\",\n lines: [\n '{\"id\":\"1\",\"timestamp\":\"2026-01-01T00:00:00.000Z\",\"parentId\":null,\"type\":\"assistant.turn_start\",\"data\":{\"turnId\":\"t1\"}}',\n '{\"id\":\"2\",\"timestamp\":\"2026-01-01T00:00:01.000Z\",\"parentId\":\"1\",\"type\":\"assistant.message\",\"data\":{\"messageId\":\"m1\",\"content\":\"\",\"toolRequests\":[{\"toolCallId\":\"call-1\",\"name\":\"bash\",\"arguments\":{\"command\":\"fixture-command\"},\"type\":\"function\"}]}}',\n '{\"id\":\"3\",\"timestamp\":\"2026-01-01T00:00:02.000Z\",\"parentId\":\"2\",\"type\":\"assistant.message\",\"data\":{\"messageId\":\"m2\",\"content\":\"fixture-result\",\"toolRequests\":[]}}',\n '{\"type\":\"result\",\"timestamp\":\"2026-01-01T00:00:03.000Z\",\"sessionId\":\"fixture-conversation\",\"exitCode\":0,\"usage\":{\"premiumRequests\":1}}',\n ],\n expected: [\n {\n kind: \"raw\",\n value: {\n id: \"1\",\n timestamp: \"2026-01-01T00:00:00.000Z\",\n parentId: null,\n type: \"assistant.turn_start\",\n data: { turnId: \"t1\" },\n },\n },\n {\n kind: \"tool\",\n name: \"bash\",\n input: { command: \"fixture-command\" },\n callId: \"call-1\",\n },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: [\n '{\"type\":\"session.error\",\"data\":{\"errorType\":\"authentication\",\"message\":\"fixture-warning\",\"statusCode\":401}}',\n '{\"type\":\"result\",\"sessionId\":\"fixture-conversation\",\"exitCode\":1}',\n ],\n expected: [\n { kind: \"warning\", message: \"fixture-warning\" },\n { kind: \"conversation\", id: \"fixture-conversation\" },\n {\n kind: \"failure\",\n message: \"GitHub Copilot CLI ended with exit code 1\",\n },\n ],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n kimi: [\n {\n name: \"turn\",\n lines: [\n '{\"role\":\"meta\",\"type\":\"system.version\",\"version\":\"2.1.1\"}',\n '{\"role\":\"assistant\",\"tool_calls\":[{\"type\":\"function\",\"id\":\"call-1\",\"function\":{\"name\":\"Shell\",\"arguments\":\"{\\\\\"command\\\\\":\\\\\"fixture-command\\\\\"}\"}}]}',\n '{\"role\":\"tool\",\"tool_call_id\":\"call-1\",\"content\":\"fixture-output\"}',\n '{\"role\":\"assistant\",\"content\":\"fixture-result\"}',\n '{\"role\":\"meta\",\"type\":\"session.resume_hint\",\"session_id\":\"fixture-conversation\",\"command\":\"kimi -r fixture-conversation\"}',\n ],\n expected: [\n {\n kind: \"raw\",\n value: { role: \"meta\", type: \"system.version\", version: \"2.1.1\" },\n },\n {\n kind: \"tool\",\n name: \"Shell\",\n input: { command: \"fixture-command\" },\n callId: \"call-1\",\n },\n {\n kind: \"tool-result\",\n callId: \"call-1\",\n name: \"\",\n preview: \"fixture-output\",\n characters: 14,\n isError: false,\n },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"conversation\", id: \"fixture-conversation\" },\n ],\n },\n {\n name: \"retry\",\n lines: [\n '{\"role\":\"meta\",\"type\":\"turn.step.retrying\",\"failed_attempt\":1,\"next_attempt\":2,\"error_message\":\"fixture-warning\",\"status_code\":429}',\n ],\n expected: [{ kind: \"warning\", message: \"fixture-warning\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"role\":\"future\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { role: \"future\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n codex: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"thread.started\",\"thread_id\":\"fixture-conversation\"}',\n '{\"type\":\"item.started\",\"item\":{\"type\":\"command_execution\",\"command\":\"fixture-command\"}}',\n '{\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"fixture-result\"}}',\n '{\"type\":\"turn.completed\",\"usage\":{\"input_tokens\":10,\"cached_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"turn.failed\",\"error\":{\"message\":\"fixture-failure\"}}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n claude: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"system\",\"session_id\":\"fixture-conversation\"}',\n '{\"type\":\"assistant\",\"message\":{\"content\":[{\"type\":\"tool_use\",\"name\":\"command\",\"input\":\"fixture-command\"},{\"type\":\"text\",\"text\":\"fixture-result\"}]}}',\n '{\"type\":\"result\",\"result\":\"fixture-result\",\"usage\":{\"input_tokens\":10,\"cache_creation_input_tokens\":1,\"cache_read_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"result\", text: \"fixture-result\" },\n {\n kind: \"usage\",\n tokens: { input: 10, cached: 2, cacheCreated: 1, output: 3 },\n },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"result\",\"is_error\":true,\"result\":\"fixture-failure\"}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n};\n"]}