@vercel/factory 0.0.14 → 0.0.15

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 (467) hide show
  1. package/README.md +306 -0
  2. package/dist/agent-routes.d.mts +69 -0
  3. package/dist/agent-routes.mjs +64 -0
  4. package/dist/agent-routes.mjs.map +1 -0
  5. package/dist/api-contracts.d.mts +1749 -0
  6. package/dist/api-contracts.mjs +118 -0
  7. package/dist/api-contracts.mjs.map +1 -0
  8. package/dist/api-images.d.mts +30 -0
  9. package/dist/api-images.mjs +28 -0
  10. package/dist/api-images.mjs.map +1 -0
  11. package/dist/api-task-graph.mjs +57 -0
  12. package/dist/api-task-graph.mjs.map +1 -0
  13. package/dist/api.d.mts +68 -216
  14. package/dist/api.mjs +872 -97
  15. package/dist/api.mjs.map +1 -1
  16. package/dist/approval-access.d.mts +39 -0
  17. package/dist/approval-access.mjs +62 -0
  18. package/dist/approval-access.mjs.map +1 -0
  19. package/dist/approval-contracts.d.mts +692 -0
  20. package/dist/approval-contracts.mjs +27 -0
  21. package/dist/approval-contracts.mjs.map +1 -0
  22. package/dist/approval.d.mts +49 -0
  23. package/dist/approval.mjs +39 -0
  24. package/dist/approval.mjs.map +1 -0
  25. package/dist/blob/artifacts.d.mts +37 -0
  26. package/dist/blob/artifacts.mjs +45 -0
  27. package/dist/blob/artifacts.mjs.map +1 -0
  28. package/dist/blob/index.d.mts +41 -6
  29. package/dist/blob/index.mjs +158 -40
  30. package/dist/blob/index.mjs.map +1 -1
  31. package/dist/budget.d.mts +108 -0
  32. package/dist/budget.mjs +141 -0
  33. package/dist/budget.mjs.map +1 -0
  34. package/dist/budgets.d.mts +4 -0
  35. package/dist/budgets.mjs +4 -0
  36. package/dist/build-factory.d.mts +6 -4
  37. package/dist/build-factory.mjs +2 -1
  38. package/dist/build-factory.mjs.map +1 -1
  39. package/dist/change-verification/brief.d.mts +9 -0
  40. package/dist/change-verification/brief.mjs +13 -0
  41. package/dist/change-verification/brief.mjs.map +1 -0
  42. package/dist/change-verification/dispatch.d.mts +24 -0
  43. package/dist/change-verification/dispatch.mjs +45 -0
  44. package/dist/change-verification/dispatch.mjs.map +1 -0
  45. package/dist/change-verification/eve-tool.d.mts +60 -0
  46. package/dist/change-verification/eve-tool.mjs +101 -0
  47. package/dist/change-verification/eve-tool.mjs.map +1 -0
  48. package/dist/changes/eve-record-change.d.mts +56 -0
  49. package/dist/changes/eve-record-change.mjs +97 -0
  50. package/dist/changes/eve-record-change.mjs.map +1 -0
  51. package/dist/changes/presentation.d.mts +14 -0
  52. package/dist/changes.d.mts +23 -0
  53. package/dist/changes.mjs +29 -0
  54. package/dist/changes.mjs.map +1 -0
  55. package/dist/client-events.d.mts +18 -0
  56. package/dist/client-events.mjs +41 -0
  57. package/dist/client-events.mjs.map +1 -0
  58. package/dist/client-stream.d.mts +28 -0
  59. package/dist/client-stream.mjs +204 -0
  60. package/dist/client-stream.mjs.map +1 -0
  61. package/dist/client-transcript.d.mts +41 -0
  62. package/dist/client-transcript.mjs +229 -0
  63. package/dist/client-transcript.mjs.map +1 -0
  64. package/dist/client.d.mts +234 -0
  65. package/dist/client.mjs +258 -0
  66. package/dist/client.mjs.map +1 -0
  67. package/dist/code-review/contracts.d.mts +26 -0
  68. package/dist/code-review/eve-post-review.d.mts +70 -0
  69. package/dist/code-review/eve-post-review.mjs +183 -0
  70. package/dist/code-review/eve-post-review.mjs.map +1 -0
  71. package/dist/code-review/eve-review-comments.d.mts +64 -0
  72. package/dist/code-review/eve-review-comments.mjs +159 -0
  73. package/dist/code-review/eve-review-comments.mjs.map +1 -0
  74. package/dist/code-review/github-contracts.d.mts +10 -0
  75. package/dist/code-review/github-reporter.d.mts +44 -0
  76. package/dist/code-review/github-reporter.mjs +260 -0
  77. package/dist/code-review/github-reporter.mjs.map +1 -0
  78. package/dist/code-review/preparation.d.mts +34 -0
  79. package/dist/code-review/preparation.mjs +23 -0
  80. package/dist/code-review/preparation.mjs.map +1 -0
  81. package/dist/code-review/stall.d.mts +17 -0
  82. package/dist/code-review/stall.mjs +30 -0
  83. package/dist/code-review/stall.mjs.map +1 -0
  84. package/dist/code-review.d.mts +6 -0
  85. package/dist/code-review.mjs +5 -0
  86. package/dist/communication.d.mts +9 -0
  87. package/dist/communication.mjs +9 -0
  88. package/dist/connectors/github.d.mts +26 -0
  89. package/dist/connectors/github.mjs +55 -0
  90. package/dist/connectors/github.mjs.map +1 -0
  91. package/dist/connectors/index.d.mts +35 -3
  92. package/dist/connectors/index.mjs +3 -52
  93. package/dist/connectors/index.mjs.map +1 -1
  94. package/dist/connectors/outbox.d.mts +34 -0
  95. package/dist/connectors/outbox.mjs +50 -0
  96. package/dist/connectors/outbox.mjs.map +1 -0
  97. package/dist/connectors/slack-approval-blocks.mjs +136 -0
  98. package/dist/connectors/slack-approval-blocks.mjs.map +1 -0
  99. package/dist/connectors/slack-approvals.d.mts +29 -0
  100. package/dist/connectors/slack-approvals.mjs +346 -0
  101. package/dist/connectors/slack-approvals.mjs.map +1 -0
  102. package/dist/connectors/slack.d.mts +35 -52
  103. package/dist/connectors/slack.mjs +13 -85
  104. package/dist/connectors/slack.mjs.map +1 -1
  105. package/dist/deepsec/eve-tool.d.mts +110 -0
  106. package/dist/deepsec/eve-tool.mjs +164 -0
  107. package/dist/deepsec/eve-tool.mjs.map +1 -0
  108. package/dist/deepsec/finding.d.mts +84 -0
  109. package/dist/deepsec/finding.mjs +56 -0
  110. package/dist/deepsec/finding.mjs.map +1 -0
  111. package/dist/deepsec.d.mts +3 -0
  112. package/dist/delivery-metrics/metrics.d.mts +93 -0
  113. package/dist/delivery-metrics/metrics.mjs +200 -0
  114. package/dist/delivery-metrics/metrics.mjs.map +1 -0
  115. package/dist/delivery-metrics.d.mts +2 -0
  116. package/dist/delivery-metrics.mjs +2 -0
  117. package/dist/dispatch.d.mts +81 -0
  118. package/dist/dispatch.mjs +140 -0
  119. package/dist/dispatch.mjs.map +1 -0
  120. package/dist/errors.d.mts +15 -0
  121. package/dist/errors.mjs +38 -0
  122. package/dist/errors.mjs.map +1 -0
  123. package/dist/eve/index.d.mts +143 -1271
  124. package/dist/eve/index.mjs +233 -1065
  125. package/dist/eve/index.mjs.map +1 -1
  126. package/dist/eve/invoke.d.mts +144 -0
  127. package/dist/eve/invoke.mjs +241 -0
  128. package/dist/eve/invoke.mjs.map +1 -0
  129. package/dist/eve/session-client.d.mts +68 -0
  130. package/dist/eve/session-client.mjs +131 -0
  131. package/dist/eve/session-client.mjs.map +1 -0
  132. package/dist/eve/task-execution.mjs +18 -0
  133. package/dist/eve/task-execution.mjs.map +1 -0
  134. package/dist/eve/task-session.d.mts +87 -0
  135. package/dist/eve/task-session.mjs +203 -0
  136. package/dist/eve/task-session.mjs.map +1 -0
  137. package/dist/eve/transcript.d.mts +37 -0
  138. package/dist/eve/transcript.mjs +65 -0
  139. package/dist/eve/transcript.mjs.map +1 -0
  140. package/dist/execution-public.d.mts +8 -0
  141. package/dist/execution-public.mjs +7 -0
  142. package/dist/execution.d.mts +75 -0
  143. package/dist/execution.mjs +153 -0
  144. package/dist/execution.mjs.map +1 -0
  145. package/dist/finding-remediation/admission.d.mts +51 -0
  146. package/dist/finding-remediation/admission.mjs +87 -0
  147. package/dist/finding-remediation/admission.mjs.map +1 -0
  148. package/dist/finding-remediation/brief.d.mts +14 -0
  149. package/dist/finding-remediation/brief.mjs +25 -0
  150. package/dist/finding-remediation/brief.mjs.map +1 -0
  151. package/dist/finding-remediation/eve-tool.d.mts +29 -0
  152. package/dist/finding-remediation/eve-tool.mjs +34 -0
  153. package/dist/finding-remediation/eve-tool.mjs.map +1 -0
  154. package/dist/findings/fingerprint.d.mts +14 -0
  155. package/dist/findings/fingerprint.mjs +28 -0
  156. package/dist/findings/fingerprint.mjs.map +1 -0
  157. package/dist/findings.d.mts +6 -0
  158. package/dist/findings.mjs +6 -0
  159. package/dist/github-app.d.mts +54 -0
  160. package/dist/github-app.mjs +121 -0
  161. package/dist/github-app.mjs.map +1 -0
  162. package/dist/github-publication.d.mts +198 -0
  163. package/dist/github-publication.mjs +429 -0
  164. package/dist/github-publication.mjs.map +1 -0
  165. package/dist/github-transfer.d.mts +72 -0
  166. package/dist/github-transfer.mjs +125 -0
  167. package/dist/github-transfer.mjs.map +1 -0
  168. package/dist/github.d.mts +406 -2
  169. package/dist/github.mjs +239 -40
  170. package/dist/github.mjs.map +1 -1
  171. package/dist/image-input.d.mts +51 -0
  172. package/dist/image-input.mjs +63 -0
  173. package/dist/image-input.mjs.map +1 -0
  174. package/dist/index.d.mts +14 -484
  175. package/dist/index.mjs +14 -522
  176. package/dist/intake-contracts.d.mts +56 -0
  177. package/dist/intake-contracts.mjs +33 -0
  178. package/dist/intake-contracts.mjs.map +1 -0
  179. package/dist/integrations/deepsec.d.mts +4 -0
  180. package/dist/integrations/deepsec.mjs +3 -0
  181. package/dist/integrations/github.d.mts +11 -0
  182. package/dist/integrations/github.mjs +9 -0
  183. package/dist/integrations/slack.d.mts +3 -0
  184. package/dist/integrations/slack.mjs +3 -0
  185. package/dist/integrations/vercel.d.mts +3 -0
  186. package/dist/integrations/vercel.mjs +3 -0
  187. package/dist/merge-resolution/contracts.d.mts +17 -0
  188. package/dist/merge-resolution/contracts.mjs +19 -0
  189. package/dist/merge-resolution/contracts.mjs.map +1 -0
  190. package/dist/merge-resolution/eve-tools.d.mts +46 -0
  191. package/dist/merge-resolution/eve-tools.mjs +117 -0
  192. package/dist/merge-resolution/eve-tools.mjs.map +1 -0
  193. package/dist/multi-repository-changes/coordination.d.mts +49 -0
  194. package/dist/multi-repository-changes/coordination.mjs +115 -0
  195. package/dist/multi-repository-changes/coordination.mjs.map +1 -0
  196. package/dist/planning/cancellation.mjs +82 -0
  197. package/dist/planning/cancellation.mjs.map +1 -0
  198. package/dist/planning/configuration.d.mts +23 -0
  199. package/dist/planning/configuration.mjs +56 -0
  200. package/dist/planning/configuration.mjs.map +1 -0
  201. package/dist/planning/contracts.d.mts +136 -0
  202. package/dist/planning/contracts.mjs +42 -0
  203. package/dist/planning/contracts.mjs.map +1 -0
  204. package/dist/planning/dependencies.mjs +44 -0
  205. package/dist/planning/dependencies.mjs.map +1 -0
  206. package/dist/planning/effects.mjs +122 -0
  207. package/dist/planning/effects.mjs.map +1 -0
  208. package/dist/planning/reconcile.mjs +273 -0
  209. package/dist/planning/reconcile.mjs.map +1 -0
  210. package/dist/planning/runtime.d.mts +27 -0
  211. package/dist/planning/runtime.mjs +25 -0
  212. package/dist/planning/runtime.mjs.map +1 -0
  213. package/dist/planning/state.mjs +92 -0
  214. package/dist/planning/state.mjs.map +1 -0
  215. package/dist/planning/turns.mjs +262 -0
  216. package/dist/planning/turns.mjs.map +1 -0
  217. package/dist/planning/validation.mjs +106 -0
  218. package/dist/planning/validation.mjs.map +1 -0
  219. package/dist/postgres/index.d.mts +7 -1
  220. package/dist/postgres/index.mjs +7 -3
  221. package/dist/postgres/index.mjs.map +1 -1
  222. package/dist/presets/software-development/approval.d.mts +14 -0
  223. package/dist/presets/software-development/approval.mjs +21 -0
  224. package/dist/presets/software-development/approval.mjs.map +1 -0
  225. package/dist/presets/software-development/deepsec-brief.d.mts +8 -0
  226. package/dist/presets/software-development/deepsec-brief.mjs +14 -0
  227. package/dist/presets/software-development/deepsec-brief.mjs.map +1 -0
  228. package/dist/presets/software-development/dispatch.d.mts +53 -0
  229. package/dist/presets/software-development/dispatch.mjs +66 -0
  230. package/dist/presets/software-development/dispatch.mjs.map +1 -0
  231. package/dist/presets/software-development/eve-delegation-policy.d.mts +7 -0
  232. package/dist/presets/software-development/eve-delegation-policy.mjs +34 -0
  233. package/dist/presets/software-development/eve-delegation-policy.mjs.map +1 -0
  234. package/dist/presets/software-development/eve.d.mts +18 -0
  235. package/dist/presets/software-development/eve.mjs +19 -0
  236. package/dist/presets/software-development/eve.mjs.map +1 -0
  237. package/dist/presets/software-development/finish-task-policy.d.mts +7 -0
  238. package/dist/presets/software-development/finish-task-policy.mjs +9 -0
  239. package/dist/presets/software-development/finish-task-policy.mjs.map +1 -0
  240. package/dist/presets/software-development/recovery.d.mts +32 -0
  241. package/dist/presets/software-development/recovery.mjs +120 -0
  242. package/dist/presets/software-development/recovery.mjs.map +1 -0
  243. package/dist/presets/software-development/task-communication.d.mts +23 -0
  244. package/dist/presets/software-development/task-communication.mjs +120 -0
  245. package/dist/presets/software-development/task-communication.mjs.map +1 -0
  246. package/dist/presets/software-development.d.mts +9 -0
  247. package/dist/presets/software-development.mjs +9 -0
  248. package/dist/pull-requests/contracts.d.mts +72 -0
  249. package/dist/pull-requests/eve-fetch.d.mts +57 -0
  250. package/dist/pull-requests/eve-fetch.mjs +151 -0
  251. package/dist/pull-requests/eve-fetch.mjs.map +1 -0
  252. package/dist/pull-requests/github-label-manager.d.mts +27 -0
  253. package/dist/pull-requests/github-label-manager.mjs +40 -0
  254. package/dist/pull-requests/github-label-manager.mjs.map +1 -0
  255. package/dist/pull-requests/github-publisher.d.mts +53 -0
  256. package/dist/pull-requests/github-publisher.mjs +345 -0
  257. package/dist/pull-requests/github-publisher.mjs.map +1 -0
  258. package/dist/pull-requests.d.mts +5 -0
  259. package/dist/pull-requests.mjs +4 -0
  260. package/dist/receipts.d.mts +4 -0
  261. package/dist/receipts.mjs +3 -0
  262. package/dist/repositories.d.mts +18 -0
  263. package/dist/repositories.mjs +33 -0
  264. package/dist/repositories.mjs.map +1 -0
  265. package/dist/sandbox/command.d.mts +18 -0
  266. package/dist/sandbox/execution-abort.d.mts +16 -0
  267. package/dist/sandbox/execution-abort.mjs +49 -0
  268. package/dist/sandbox/execution-abort.mjs.map +1 -0
  269. package/dist/sandbox/execution-environment.d.mts +25 -0
  270. package/dist/sandbox/execution-run-ledger.d.mts +115 -0
  271. package/dist/sandbox/execution-run-ledger.mjs +209 -0
  272. package/dist/sandbox/execution-run-ledger.mjs.map +1 -0
  273. package/dist/sandbox/execution.d.mts +54 -0
  274. package/dist/sandbox/execution.mjs +228 -0
  275. package/dist/sandbox/execution.mjs.map +1 -0
  276. package/dist/sandbox/harness-runner.d.mts +79 -0
  277. package/dist/sandbox/harness-runner.mjs +162 -0
  278. package/dist/sandbox/harness-runner.mjs.map +1 -0
  279. package/dist/sandbox/index.d.mts +9 -0
  280. package/dist/sandbox/index.mjs +7 -0
  281. package/dist/sandbox/task-environment.d.mts +50 -0
  282. package/dist/sandbox/task-environment.mjs +140 -0
  283. package/dist/sandbox/task-environment.mjs.map +1 -0
  284. package/dist/sandbox/workspace.d.mts +29 -0
  285. package/dist/sandbox/workspace.mjs +28 -0
  286. package/dist/sandbox/workspace.mjs.map +1 -0
  287. package/dist/schema/agent-route.d.mts +22 -0
  288. package/dist/schema/agent-route.mjs +15 -0
  289. package/dist/schema/agent-route.mjs.map +1 -0
  290. package/dist/schema/answer.d.mts +23 -0
  291. package/dist/schema/answer.mjs +21 -0
  292. package/dist/schema/answer.mjs.map +1 -0
  293. package/dist/schema/budget.d.mts +38 -0
  294. package/dist/schema/budget.mjs +30 -0
  295. package/dist/schema/budget.mjs.map +1 -0
  296. package/dist/schema/catalog.mjs +72 -0
  297. package/dist/schema/catalog.mjs.map +1 -0
  298. package/dist/schema/change.d.mts +117 -0
  299. package/dist/schema/change.mjs +68 -0
  300. package/dist/schema/change.mjs.map +1 -0
  301. package/dist/schema/common.d.mts +33 -0
  302. package/dist/{id-BLIkCVue.mjs → schema/common.mjs} +7 -16
  303. package/dist/schema/common.mjs.map +1 -0
  304. package/dist/schema/communication.d.mts +52 -0
  305. package/dist/{communication-Kd9nU5RP.mjs → schema/communication.mjs} +8 -3
  306. package/dist/schema/communication.mjs.map +1 -0
  307. package/dist/schema/execution.d.mts +101 -0
  308. package/dist/schema/execution.mjs +86 -0
  309. package/dist/schema/execution.mjs.map +1 -0
  310. package/dist/schema/factory-config.d.mts +95 -0
  311. package/dist/schema/factory-config.mjs +60 -0
  312. package/dist/schema/factory-config.mjs.map +1 -0
  313. package/dist/schema/finding.d.mts +125 -0
  314. package/dist/schema/finding.mjs +67 -0
  315. package/dist/schema/finding.mjs.map +1 -0
  316. package/dist/schema/id.d.mts +43 -0
  317. package/dist/schema/id.mjs +32 -0
  318. package/dist/schema/id.mjs.map +1 -0
  319. package/dist/schema/outbox.d.mts +240 -0
  320. package/dist/schema/outbox.mjs +53 -0
  321. package/dist/schema/outbox.mjs.map +1 -0
  322. package/dist/schema/question-route.mjs +16 -0
  323. package/dist/schema/question-route.mjs.map +1 -0
  324. package/dist/schema/receipt.d.mts +81 -0
  325. package/dist/schema/receipt.mjs +94 -0
  326. package/dist/schema/receipt.mjs.map +1 -0
  327. package/dist/schema/repository.d.mts +26 -0
  328. package/dist/schema/repository.mjs +25 -0
  329. package/dist/schema/repository.mjs.map +1 -0
  330. package/dist/schema/session.d.mts +135 -0
  331. package/dist/schema/session.mjs +53 -0
  332. package/dist/schema/session.mjs.map +1 -0
  333. package/dist/schema/signal.d.mts +105 -0
  334. package/dist/schema/signal.mjs +81 -0
  335. package/dist/schema/signal.mjs.map +1 -0
  336. package/dist/schema/stored-session.mjs +10 -0
  337. package/dist/schema/stored-session.mjs.map +1 -0
  338. package/dist/schema/stored-task.mjs +20 -0
  339. package/dist/schema/stored-task.mjs.map +1 -0
  340. package/dist/schema/task-effect.d.mts +39 -0
  341. package/dist/schema/task-effect.mjs +29 -0
  342. package/dist/schema/task-effect.mjs.map +1 -0
  343. package/dist/schema/task-graph.d.mts +3134 -0
  344. package/dist/schema/task-graph.mjs +97 -0
  345. package/dist/schema/task-graph.mjs.map +1 -0
  346. package/dist/schema/task-message.d.mts +254 -0
  347. package/dist/schema/task-message.mjs +189 -0
  348. package/dist/schema/task-message.mjs.map +1 -0
  349. package/dist/schema/task.d.mts +272 -0
  350. package/dist/schema/task.mjs +199 -0
  351. package/dist/schema/task.mjs.map +1 -0
  352. package/dist/schema/transcript.d.mts +170 -0
  353. package/dist/schema/transcript.mjs +86 -0
  354. package/dist/schema/transcript.mjs.map +1 -0
  355. package/dist/schema/transitions.d.mts +50 -0
  356. package/dist/schema/transitions.mjs +303 -0
  357. package/dist/schema/transitions.mjs.map +1 -0
  358. package/dist/schema/work.d.mts +101 -0
  359. package/dist/schema/work.mjs +102 -0
  360. package/dist/schema/work.mjs.map +1 -0
  361. package/dist/signal-triage.d.mts +20 -0
  362. package/dist/signal-triage.mjs +85 -0
  363. package/dist/signal-triage.mjs.map +1 -0
  364. package/dist/signals.d.mts +19 -0
  365. package/dist/signals.mjs +19 -0
  366. package/dist/signals.mjs.map +1 -0
  367. package/dist/stall.d.mts +38 -0
  368. package/dist/stall.mjs +79 -0
  369. package/dist/stall.mjs.map +1 -0
  370. package/dist/storage.d.mts +4 -0
  371. package/dist/storage.mjs +4 -0
  372. package/dist/store/driver.d.mts +65 -0
  373. package/dist/store/driver.mjs +42 -0
  374. package/dist/store/driver.mjs.map +1 -0
  375. package/dist/store/engine.d.mts +485 -0
  376. package/dist/store/engine.mjs +2175 -0
  377. package/dist/store/engine.mjs.map +1 -0
  378. package/dist/store/memory.d.mts +7 -0
  379. package/dist/store/memory.mjs +52 -0
  380. package/dist/store/memory.mjs.map +1 -0
  381. package/dist/store/task-effects.d.mts +38 -0
  382. package/dist/store/task-effects.mjs +118 -0
  383. package/dist/store/task-effects.mjs.map +1 -0
  384. package/dist/store/task-graphs.d.mts +60 -0
  385. package/dist/store/task-graphs.mjs +212 -0
  386. package/dist/store/task-graphs.mjs.map +1 -0
  387. package/dist/store/task-messages.d.mts +136 -0
  388. package/dist/store/task-messages.mjs +475 -0
  389. package/dist/store/task-messages.mjs.map +1 -0
  390. package/dist/store/task-work.d.mts +65 -0
  391. package/dist/store/task-work.mjs +134 -0
  392. package/dist/store/task-work.mjs.map +1 -0
  393. package/dist/store/work-notifications.d.mts +19 -0
  394. package/dist/store/work-notifications.mjs +48 -0
  395. package/dist/store/work-notifications.mjs.map +1 -0
  396. package/dist/sweep.d.mts +57 -0
  397. package/dist/sweep.mjs +143 -0
  398. package/dist/sweep.mjs.map +1 -0
  399. package/dist/task-communication.d.mts +35 -0
  400. package/dist/task-communication.mjs +47 -0
  401. package/dist/task-communication.mjs.map +1 -0
  402. package/dist/task-graph-view.d.mts +264 -0
  403. package/dist/task-graph-view.mjs +17 -0
  404. package/dist/task-graph-view.mjs.map +1 -0
  405. package/dist/task-message-processing.d.mts +60 -0
  406. package/dist/task-message-processing.mjs +200 -0
  407. package/dist/task-message-processing.mjs.map +1 -0
  408. package/dist/task-protocols.d.mts +80 -0
  409. package/dist/task-protocols.mjs +47 -0
  410. package/dist/task-protocols.mjs.map +1 -0
  411. package/dist/tasks.d.mts +17 -0
  412. package/dist/tasks.mjs +17 -0
  413. package/dist/vercel-git.d.mts +21 -0
  414. package/dist/vercel-git.mjs +112 -0
  415. package/dist/vercel-git.mjs.map +1 -0
  416. package/dist/vercel.d.mts +33 -2
  417. package/dist/vercel.mjs +48 -3
  418. package/dist/vercel.mjs.map +1 -1
  419. package/dist/work-triage/eve-tool.d.mts +29 -0
  420. package/dist/work-triage/eve-tool.mjs +32 -0
  421. package/dist/work-triage/eve-tool.mjs.map +1 -0
  422. package/dist/work-triage/find-existing-work.d.mts +32 -0
  423. package/dist/work-triage/find-existing-work.mjs +31 -0
  424. package/dist/work-triage/find-existing-work.mjs.map +1 -0
  425. package/dist/work-triage/github.d.mts +15 -0
  426. package/dist/work-triage/github.mjs +14 -0
  427. package/dist/work-triage/github.mjs.map +1 -0
  428. package/dist/work-triage.d.mts +3 -0
  429. package/dist/work-triage.mjs +3 -0
  430. package/dist/workflows.d.mts +48 -0
  431. package/dist/workflows.mjs +86 -0
  432. package/dist/workflows.mjs.map +1 -0
  433. package/dist/workspace-diff-assembly.d.mts +33 -0
  434. package/dist/workspace-diff-assembly.mjs +95 -0
  435. package/dist/workspace-diff-assembly.mjs.map +1 -0
  436. package/dist/workspace-diff.d.mts +90 -0
  437. package/dist/workspace-diff.mjs +61 -0
  438. package/dist/workspace-diff.mjs.map +1 -0
  439. package/dist/workspace-snapshot.d.mts +26 -0
  440. package/dist/workspace-snapshot.mjs +80 -0
  441. package/dist/workspace-snapshot.mjs.map +1 -0
  442. package/package.json +129 -44
  443. package/dist/approval-JX2Px9IC.mjs +0 -132
  444. package/dist/approval-JX2Px9IC.mjs.map +0 -1
  445. package/dist/budget-DzSiIA4t.mjs +0 -42
  446. package/dist/budget-DzSiIA4t.mjs.map +0 -1
  447. package/dist/change-D2U6v7Ek.mjs +0 -554
  448. package/dist/change-D2U6v7Ek.mjs.map +0 -1
  449. package/dist/communication-Kd9nU5RP.mjs.map +0 -1
  450. package/dist/coordination-Cq08hb1l.mjs +0 -76
  451. package/dist/coordination-Cq08hb1l.mjs.map +0 -1
  452. package/dist/dispatch-BaZS3PT8.d.mts +0 -76
  453. package/dist/driver-BC0Mt5KG.d.mts +0 -34
  454. package/dist/driver-Bbd25rNM.mjs +0 -23
  455. package/dist/driver-Bbd25rNM.mjs.map +0 -1
  456. package/dist/engine-DFHU2Pe-.d.mts +0 -781
  457. package/dist/engine-WaUM2cGA.mjs +0 -1068
  458. package/dist/engine-WaUM2cGA.mjs.map +0 -1
  459. package/dist/factory-config-BoRXOw43.mjs +0 -50
  460. package/dist/factory-config-BoRXOw43.mjs.map +0 -1
  461. package/dist/factory-config-D2yU3G0c.d.mts +0 -58
  462. package/dist/github-C5HNBN6p.d.mts +0 -279
  463. package/dist/id-BLIkCVue.mjs.map +0 -1
  464. package/dist/index-Bw6hggoH.d.mts +0 -40
  465. package/dist/index.mjs.map +0 -1
  466. package/dist/task-CcOyOJ3k.mjs +0 -154
  467. package/dist/task-CcOyOJ3k.mjs.map +0 -1
@@ -1,1309 +1,181 @@
1
- import { l as AgentRouteRegistry, r as DispatchBudget, s as AgentRoute } from "../dispatch-BaZS3PT8.mjs";
2
- import { St as AnswerEvent, Tt as Task, h as FactoryStores } from "../engine-DFHU2Pe-.mjs";
3
- import { ApprovalPolicy, Finding } from "../index.mjs";
4
- import { C as GitHubReviewComment, F as SubmittedPullRequestReview, k as PullRequestReviewComment } from "../github-C5HNBN6p.mjs";
5
- import { z } from "zod";
6
- //#region src/eve/fetch.d.ts
7
- /** The subset of the eve sandbox handle a credentialed git operation needs. */
8
- interface CommandSandbox {
9
- run(options: {
10
- command: string;
11
- }): PromiseLike<{
12
- stdout: string;
13
- stderr?: string;
14
- exitCode?: number;
15
- }>;
1
+ import { Signal, SignalOutcome } from "../schema/signal.mjs";
2
+ import { ChangeId, RepositoryIds, SignalId, TaskId } from "../schema/id.mjs";
3
+ import { JsonValue } from "../schema/work.mjs";
4
+ import { Task, TaskQuestion } from "../schema/task.mjs";
5
+ import { MaybePromise } from "../schema/common.mjs";
6
+ import { Receipt, ReceiptKind, ReceiptState } from "../schema/receipt.mjs";
7
+ import { AnswerQuestionResult, FactoryStores } from "../store/engine.mjs";
8
+ import { EveTranscriptMaterializer, EveTranscriptMaterializerOptions, EveTranscriptRequestScope, TranscriptMaterializationInput, createEveTranscriptMaterializer } from "./transcript.mjs";
9
+ import { ConversationBinding, FactoryConversationSessionBinding, conversationBinding, conversationBindingForSession, conversationHeaders, factoryReplyAddressAttribute, factoryReplyAddressHeader, factoryReplyChannelAttribute, factoryReplyChannelHeader, factoryRepositoryIdsAttribute, factoryRepositoryIdsHeader, factoryTaskAttemptAttribute, factoryTaskAttemptHeader, factoryTaskAttribute, factoryTaskHeader, hasFactoryTaskBinding, optionalTaskIdForSession, replyToForSession, repositoryIdsForSession, requireTaskIdForSession, taskBindingForSession, taskHeaders, taskSessionAuth, withFactoryTask, withOptionalFactoryTask } from "./task-session.mjs";
10
+ import { CancelEveSessionOptions, EveSessionEvent, EveSessionStream, EveSessionStreamInput, ForwardEveSessionRequestOptions, ReadCompletedEveTurnOptions, StartEveSessionOptions, cancelEveSession, forwardEveSessionRequest, readCompletedEveTurn, startEveSession } from "./session-client.mjs";
11
+ import { DelegateAgentLaunchInput, DelegateAgentTool, DelegateAgentToolInput, DelegateAgentToolOptions, DelegateAgentToolStores, DelegateWorkflowInput, DelegateWorkflowPolicy, DelegateWorkflowResult, InvokeAgentTool, InvokeAgentToolInput, InvokeAgentToolOptions, InvokeAgentToolResult, InvokeAgentToolStores, createDelegateAgentTool, createInvokeAgentTool } from "./invoke.mjs";
12
+ import { HookDefinition } from "eve/hooks";
13
+ import { ToolContext, ToolDefinition } from "eve/tools";
14
+ //#region src/eve/index.d.ts
15
+ /** Receipt, Signal, and Task capabilities used by the provider-neutral Eve tool bundle. */
16
+ type TaskToolsStores = Pick<FactoryStores, "receipts" | "signals" | "tasks">;
17
+ /** Task capability used to project Eve lifecycle events onto durable Factory state. */
18
+ type FactoryHooksStores = Pick<FactoryStores, "tasks">;
19
+ /** Configures the provider-neutral Task, signal, question, and receipt Eve tools. */
20
+ interface TaskToolsOptions {
21
+ /** Present a persisted human question through the application's Foreman communication boundary. */
22
+ presentQuestion?: (task: Task) => Promise<void>;
23
+ /** Return a refusal reason when this task must use a more specific outcome tool. */
24
+ finishTaskPolicy?: (task: Task) => MaybePromise<string | null>;
16
25
  }
17
- interface FetchPullRequestOptions<S extends CommandSandbox = CommandSandbox> {
18
- /**
19
- * Runs one git command against `slug` with a credential the sandbox does not
20
- * otherwise have, and removes it again before resolving. Supplied by the
21
- * app, which owns how credentials are minted and where they are injected;
22
- * the library only decides what is fetched.
23
- */
24
- withCredential: (sandbox: S, slug: string, command: string) => Promise<{
25
- stdout: string;
26
- stderr?: string;
27
- exitCode?: number;
28
- }>;
29
- /** Path of the checkout inside the sandbox. Defaults to `repo`. */
30
- repoPath?: string;
31
- /** Fetch depth for the pull request head. Defaults to 50. */
32
- depth?: number;
26
+ /** Delivers a persisted human-question Task through an application-owned channel. */
27
+ type PresentQuestion = NonNullable<TaskToolsOptions["presentQuestion"]>;
28
+ /** Identifies the Task to read through the provider-neutral task tool. */
29
+ interface GetTaskToolInput {
30
+ taskId: TaskId;
33
31
  }
34
- type FetchPullRequestResult = {
35
- fetched: false;
36
- reason: string;
37
- } | {
38
- fetched: true;
39
- prNumber: number;
40
- prUrl: string;
41
- branch: string;
42
- headSha: string;
43
- baseBranch: string;
44
- baseSha: string;
45
- mergeBaseSha: string;
46
- diffCommand: string;
47
- };
48
- /**
49
- * The verifier's way in to the change under review. The sandbox has no
50
- * GitHub credential while the agent runs, so trusted code does the one fetch
51
- * the agent cannot: the pull request number and repository come from the
52
- * change record, never from the agent, and the credential is gone again
53
- * before control returns. Mirrors how publication reads commits out of the
54
- * sandbox instead of letting the agent push.
55
- */
56
- declare function fetchPullRequestTool<S extends CommandSandbox>(stores: FactoryStores, options: FetchPullRequestOptions<S>): import("eve/tools").ToolDefinition<{
57
- changeId: string;
58
- }, FetchPullRequestResult> & {
59
- execute(input: {
60
- changeId: string;
61
- }, ctx: import("eve/tools").ToolContext): Promise<FetchPullRequestResult>;
62
- };
63
- //#endregion
64
- //#region src/eve/conflict.d.ts
65
- declare const mergeConflictPayloadSchema: z.ZodObject<{
66
- repository: z.ZodString;
67
- prNumber: z.ZodNumber;
68
- prUrl: z.ZodURL;
69
- headBranch: z.ZodString;
70
- headSha: z.ZodString;
71
- baseBranch: z.ZodString;
72
- baseSha: z.ZodString;
73
- }, z.core.$strict>;
74
- type MergeConflictPayload = z.infer<typeof mergeConflictPayloadSchema>;
75
- interface MergeConflictToolOptions<S extends CommandSandbox = CommandSandbox> {
76
- withCredential: (sandbox: S, repository: string, command: string) => Promise<{
77
- stdout: string;
78
- stderr?: string;
79
- exitCode?: number;
80
- }>;
81
- repoPath?: string;
82
- }
83
- declare function mergeConflictTools<S extends CommandSandbox>(stores: FactoryStores, options: MergeConflictToolOptions<S>): {
84
- fetch_merge_conflict: import("eve/tools").ToolDefinition<{
85
- taskId: string;
86
- }, {
87
- conflictedFiles: string[];
88
- repository: string;
89
- prNumber: number;
90
- prUrl: string;
91
- headBranch: string;
92
- headSha: string;
93
- baseBranch: string;
94
- baseSha: string;
95
- }> & {
96
- execute(input: {
97
- taskId: string;
98
- }, ctx: import("eve/tools").ToolContext): Promise<{
99
- conflictedFiles: string[];
100
- repository: string;
101
- prNumber: number;
102
- prUrl: string;
103
- headBranch: string;
104
- headSha: string;
105
- baseBranch: string;
106
- baseSha: string;
107
- }>;
108
- };
109
- publish_merge_resolution: import("eve/tools").ToolDefinition<{
110
- taskId: string;
111
- summary: string;
112
- }, {
113
- updated: true;
114
- prNumber: number;
115
- prUrl: string;
116
- }> & {
117
- execute(input: {
118
- taskId: string;
119
- summary: string;
120
- }, ctx: import("eve/tools").ToolContext): Promise<{
121
- updated: true;
122
- prNumber: number;
123
- prUrl: string;
124
- }>;
125
- };
126
- };
127
- //#endregion
128
- //#region src/eve/finding.d.ts
129
- interface RecordFindingOptions {
130
- /** Signal source the findings are recorded under. Defaults to security_scan. */
131
- source?: string;
132
- /** Which resulting tasks wait for a human. Defaults to the standard policy. */
133
- approval?: ApprovalPolicy;
32
+ /** Explicit not-found result returned when a requested Task does not exist. */
33
+ interface TaskNotFoundResult {
34
+ readonly found: false;
35
+ readonly taskId: TaskId;
134
36
  }
135
- type RecordFindingResult = {
136
- recorded: false;
137
- reason: string;
138
- duplicate?: true;
139
- signalId?: string;
140
- } | {
141
- recorded: true;
142
- signalId: string;
143
- taskId: string;
144
- approval: "required" | "not_required";
145
- };
146
- /**
147
- * Turn one finding into a signal and a fix task. The fingerprint is the
148
- * signal's delivery id, so the same problem reported twice is a no-op. The
149
- * signal is accepted on the reporter's own verification (a human gate follows
150
- * when the approval policy says so), and the task carries the approval
151
- * decision from the moment it exists. Shared by record_finding and scanner
152
- * tools that record on the agent's behalf.
153
- */
154
- declare function recordFinding(stores: FactoryStores, repositoryId: string, finding: Finding, options?: RecordFindingOptions): Promise<RecordFindingResult>;
155
- /**
156
- * The scanner's outcome tool: turns one finding into a signal and a fix task
157
- * in a single deterministic step. The finding's fingerprint is the signal's
158
- * delivery id, so reporting the same problem twice is a no-op. The signal is
159
- * accepted on the reporter's own verification (a human gate follows when the
160
- * approval policy says so), and the task carries the approval decision from
161
- * the moment it exists.
162
- */
163
- declare function recordFindingTool(stores: FactoryStores, options?: RecordFindingOptions): import("eve/tools").ToolDefinition<{
164
- repositoryId: string;
165
- finding: {
166
- title: string;
167
- body: string;
168
- priority: "P0" | "P1" | "P2" | "P3";
169
- category: "security" | "correctness" | "reliability" | "performance" | "compatibility" | "accessibility" | "documentation" | "maintainability" | "testing" | "usability";
170
- verification: {
171
- level: "unverified" | "supported" | "confirmed";
172
- method: "documentation" | "code_inspection" | "static_analysis" | "manual_reproduction" | "unit_test" | "integration_test" | "e2e_test" | "runtime_observation";
173
- summary: string;
174
- limitations?: string | undefined;
175
- };
176
- path?: string | undefined;
177
- line?: number | undefined;
178
- endLine?: number | undefined;
179
- tool?: string | undefined;
180
- ruleId?: string | undefined;
181
- };
182
- }, RecordFindingResult> & {
183
- execute(input: {
184
- repositoryId: string;
185
- finding: {
186
- title: string;
187
- body: string;
188
- priority: "P0" | "P1" | "P2" | "P3";
189
- category: "security" | "correctness" | "reliability" | "performance" | "compatibility" | "accessibility" | "documentation" | "maintainability" | "testing" | "usability";
190
- verification: {
191
- level: "unverified" | "supported" | "confirmed";
192
- method: "documentation" | "code_inspection" | "static_analysis" | "manual_reproduction" | "unit_test" | "integration_test" | "e2e_test" | "runtime_observation";
193
- summary: string;
194
- limitations?: string | undefined;
195
- };
196
- path?: string | undefined;
197
- line?: number | undefined;
198
- endLine?: number | undefined;
199
- tool?: string | undefined;
200
- ruleId?: string | undefined;
201
- };
202
- }, ctx: import("eve/tools").ToolContext): Promise<RecordFindingResult>;
203
- };
204
- //#endregion
205
- //#region src/eve/deepsec.d.ts
206
- interface DeepsecScanOptions<S extends CommandSandbox = CommandSandbox> extends RecordFindingOptions {
207
- /**
208
- * Runs one shell command with the model credential deepsec's gateway route
209
- * expects, and removes it again before resolving. Supplied by the app, which
210
- * owns where the credential comes from: on Vercel it is the deployment's own
211
- * OIDC identity (VERCEL_OIDC_TOKEN), so nothing has to be configured.
212
- */
213
- withModelCredential: (sandbox: S, command: string) => Promise<{
214
- stdout: string;
215
- stderr?: string;
216
- exitCode?: number;
217
- }>;
218
- /** deepsec agent backend: claude, codex, or pi. */
219
- agent?: "claude" | "codex" | "pi";
220
- /** Model deepsec's investigation agent uses, through the AI Gateway (e.g. claude-sonnet-4-6). */
221
- model?: string;
222
- /** Reasoning effort for the investigation: minimal, low, medium, high, or xhigh. */
223
- thinkingLevel?: "minimal" | "low" | "medium" | "high" | "xhigh";
224
- /** Parallel investigation batches. */
225
- concurrency?: number;
226
- /** deepsec version to install. */
227
- version?: string;
228
- /** Repository checkout inside the sandbox. Defaults to `repo`. */
229
- repoPath?: string;
230
- /** deepsec workspace inside the sandbox. Defaults to `deepsec`. */
231
- workspacePath?: string;
232
- /** Shell run before every deepsec command, e.g. to put a Node 24 on PATH. */
233
- commandPrefix?: string;
234
- /**
235
- * Candidate files investigated per run. deepsec keeps state, so successive
236
- * scans continue where the last one stopped; the cap keeps one run inside
237
- * the deployment's time limit on large repositories. Defaults to 40.
238
- */
239
- filesPerRun?: number;
37
+ /** Existing Task or explicit not-found result returned by the task lookup tool. */
38
+ type GetTaskToolResult = Task | TaskNotFoundResult;
39
+ /** Provider-neutral Eve tool for reading one Factory Task. */
40
+ interface GetTaskTool extends ToolDefinition<GetTaskToolInput, GetTaskToolResult> {
41
+ execute(input: GetTaskToolInput, ctx: ToolContext): Promise<GetTaskToolResult>;
240
42
  }
241
- /** deepsec's exported finding shape, as far as we depend on it. */
242
- declare const deepsecFindingSchema: z.ZodObject<{
243
- title: z.ZodString;
244
- description: z.ZodString;
245
- severity: z.ZodString;
246
- metadata: z.ZodOptional<z.ZodObject<{
247
- filePath: z.ZodOptional<z.ZodString>;
248
- lineNumbers: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
249
- vulnSlug: z.ZodOptional<z.ZodString>;
250
- confidence: z.ZodOptional<z.ZodString>;
251
- runId: z.ZodOptional<z.ZodString>;
252
- }, z.core.$loose>>;
253
- }, z.core.$loose>;
254
- /** Convert one deepsec finding into the factory's Finding. Pure; exported for tests. */
255
- declare function findingFromDeepsec(raw: z.infer<typeof deepsecFindingSchema>): Finding;
256
- /**
257
- * Runs deepsec (vercel-labs/deepsec) against the sandbox checkout and records
258
- * what it finds through the same path as record_finding, so every deepsec
259
- * finding becomes a fix task subject to the approval policy. Trusted code
260
- * owns the command sequence and the credential; the agent chooses when to
261
- * scan and reports the outcome.
262
- */
263
- declare function deepsecScanTool<S extends CommandSandbox>(stores: FactoryStores, options: DeepsecScanOptions<S>): import("eve/tools").ToolDefinition<{
264
- repositoryId: string;
265
- limit?: number | undefined;
266
- }, {
267
- scanned: false;
43
+ /** One final triage decision submitted for a pending Signal. */
44
+ interface DecideSignalToolInput {
45
+ signalId: SignalId;
46
+ outcome: Exclude<SignalOutcome, "pending">;
268
47
  reason: string;
269
- tool?: undefined;
270
- found?: undefined;
271
- recorded?: undefined;
272
- duplicates?: undefined;
273
- awaitingApproval?: undefined;
274
- findings?: undefined;
275
- } | {
276
- scanned: true;
277
- tool: string;
278
- found: number;
279
- recorded: number;
280
- duplicates: number;
281
- awaitingApproval: number;
282
- findings: ({
283
- taskId: string;
284
- approval: "required" | "not_required";
285
- title: string;
286
- priority: "P0" | "P1" | "P2" | "P3";
287
- path: string | undefined;
288
- line: number | undefined;
289
- } | {
290
- duplicate: boolean;
291
- title: string;
292
- priority: "P0" | "P1" | "P2" | "P3";
293
- path: string | undefined;
294
- line: number | undefined;
295
- })[];
296
- reason?: undefined;
297
- }> & {
298
- execute(input: {
299
- repositoryId: string;
300
- limit?: number | undefined;
301
- }, ctx: import("eve/tools").ToolContext): Promise<{
302
- scanned: false;
303
- reason: string;
304
- tool?: undefined;
305
- found?: undefined;
306
- recorded?: undefined;
307
- duplicates?: undefined;
308
- awaitingApproval?: undefined;
309
- findings?: undefined;
310
- } | {
311
- scanned: true;
312
- tool: string;
313
- found: number;
314
- recorded: number;
315
- duplicates: number;
316
- awaitingApproval: number;
317
- findings: ({
318
- taskId: string;
319
- approval: "required" | "not_required";
320
- title: string;
321
- priority: "P0" | "P1" | "P2" | "P3";
322
- path: string | undefined;
323
- line: number | undefined;
324
- } | {
325
- duplicate: boolean;
326
- title: string;
327
- priority: "P0" | "P1" | "P2" | "P3";
328
- path: string | undefined;
329
- line: number | undefined;
330
- })[];
331
- reason?: undefined;
332
- }>;
333
- };
334
- //#endregion
335
- //#region src/eve/invoke.d.ts
336
- interface InvokeAgentOptions {
337
- /** The factory task kind the handoff creates, e.g. "verification". */
338
- kind: string;
339
- /** Model-facing description of what the target agent does and when to invoke it. */
340
- description: string;
341
- /**
342
- * Base URL of the target agent's eve transport, e.g.
343
- * `https://factory.example.com/eve/agents/verifier`. Resolved at call time so
344
- * a deployment can derive it from its own origin.
345
- */
346
- targetUrl: () => string;
347
- /** Bearer token for the target agent's eve channel, when it requires auth. */
348
- token?: () => Promise<string | undefined>;
349
- /** Extra headers for the session request, e.g. a deployment protection bypass. */
350
- headers?: (task: Task) => Record<string, string> | Promise<Record<string, string>>;
351
- /**
352
- * Reserve-before-execution limits for the handoff dispatch, resolved at
353
- * call time. Without it, handoff tasks run outside the budget.
354
- */
355
- budget?: () => DispatchBudget | undefined;
356
- fetch?: typeof fetch;
48
+ detail?: string;
357
49
  }
358
- interface DelegateAgentOptions {
359
- routes: AgentRouteRegistry;
360
- targetUrl: (route: AgentRoute) => string;
361
- token?: (route: AgentRoute) => Promise<string | undefined>;
362
- headers?: (task: Task, route: AgentRoute) => Record<string, string> | Promise<Record<string, string>>;
363
- budget?: (route: AgentRoute) => DispatchBudget | undefined;
364
- fetch?: typeof fetch;
50
+ /** Provider-neutral Eve tool for recording a Signal decision. */
51
+ interface DecideSignalTool extends ToolDefinition<DecideSignalToolInput, Signal> {
52
+ execute(input: DecideSignalToolInput, ctx: ToolContext): Promise<Signal>;
365
53
  }
366
- /**
367
- * A tool that lets one agent hand work to another, NMA-style: the caller
368
- * decides to invoke; trusted code owns the how. The handoff is recorded as a
369
- * factory task (single-winner dispatch, receipts), then a fresh session is
370
- * started on the target agent carrying only the task id — never the caller's
371
- * context. The session start is create-once on the task id, so a retried
372
- * tool call cannot start a second session.
373
- */
374
- declare function invokeAgentTool(stores: FactoryStores, options: InvokeAgentOptions): import("eve/tools").ToolDefinition<{
375
- repositoryIds: string[];
376
- channel: string;
377
- address: string;
378
- brief: string;
379
- parentTaskId?: string | undefined;
380
- changeId?: string | undefined;
381
- }, {
382
- taskId: string;
383
- kind: string;
384
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
385
- }> & {
386
- execute(input: {
387
- repositoryIds: string[];
388
- channel: string;
389
- address: string;
390
- brief: string;
391
- parentTaskId?: string | undefined;
392
- changeId?: string | undefined;
393
- }, ctx: import("eve/tools").ToolContext): Promise<{
394
- taskId: string;
395
- kind: string;
396
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
397
- }>;
398
- };
399
- /**
400
- * Give a conversational agent one bounded delegation surface backed by the
401
- * application's route registry. The caller selects a declared route; trusted
402
- * code owns task creation, budget enforcement, and the fresh target session.
403
- */
404
- declare function delegateAgentTool(stores: FactoryStores, options: DelegateAgentOptions): import("eve/tools").ToolDefinition<{
405
- routeId: string;
406
- repositoryIds: string[];
407
- channel: string;
408
- address: string;
409
- brief: string;
410
- signalId?: string | undefined;
411
- parentTaskId?: string | undefined;
412
- changeId?: string | undefined;
413
- }, {
414
- taskId: string;
415
- childTaskIds: string[];
416
- routeId: string;
417
- agent: string;
418
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
419
- } | {
420
- taskId: string;
421
- routeId: string;
422
- agent: string;
423
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
424
- childTaskIds?: undefined;
425
- }> & {
426
- execute(input: {
427
- routeId: string;
428
- repositoryIds: string[];
429
- channel: string;
430
- address: string;
431
- brief: string;
432
- signalId?: string | undefined;
433
- parentTaskId?: string | undefined;
434
- changeId?: string | undefined;
435
- }, ctx: import("eve/tools").ToolContext): Promise<{
436
- taskId: string;
437
- childTaskIds: string[];
438
- routeId: string;
439
- agent: string;
440
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
441
- } | {
442
- taskId: string;
443
- routeId: string;
444
- agent: string;
445
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
446
- childTaskIds?: undefined;
447
- }>;
448
- };
449
- //#endregion
450
- //#region src/eve/post-review.d.ts
451
- interface CompletedReview {
452
- taskId: string;
453
- changeId: string;
454
- repository: string;
455
- pullRequestNumber: number;
456
- headSha: string;
457
- verdict: "approve" | "request_changes" | "comment";
54
+ /** Running Task and summary supplied to the generic completion tool. */
55
+ interface FinishTaskToolInput {
56
+ taskId: TaskId;
458
57
  summary: string;
459
- comments: readonly CompletedReviewFinding[];
460
58
  }
461
- interface CompletedReviewFinding extends PullRequestReviewComment {
462
- fingerprint: string;
463
- key: string;
464
- title: string;
59
+ /** Successful generic Task completion. */
60
+ interface FinishTaskSuccess {
61
+ readonly finished: true;
62
+ readonly taskState: "succeeded";
465
63
  }
466
- interface PublishedReview extends CompletedReview {
467
- review: SubmittedPullRequestReview;
64
+ /** Policy or lifecycle refusal returned by the generic Task completion tool. */
65
+ interface FinishTaskRefusal {
66
+ readonly finished: false;
67
+ readonly reason: string;
468
68
  }
469
- interface PostReviewToolOptions {
470
- tokenForRepository: (repository: string) => Promise<string>;
471
- publishReviews?: boolean;
472
- onCompleted?: (completed: CompletedReview) => Promise<void>;
473
- onPublished?: (published: PublishedReview) => Promise<void>;
474
- fetch?: typeof globalThis.fetch;
69
+ /** Completion or bounded refusal returned by the generic Task completion tool. */
70
+ type FinishTaskToolResult = FinishTaskSuccess | FinishTaskRefusal;
71
+ /** Provider-neutral Eve tool for completing a running Task. */
72
+ interface FinishTaskTool extends ToolDefinition<FinishTaskToolInput, FinishTaskToolResult> {
73
+ execute(input: FinishTaskToolInput, ctx: ToolContext): Promise<FinishTaskToolResult>;
475
74
  }
476
- /**
477
- * Publish an independent review of an existing pull request and finish the
478
- * review task without changing the pull request's factory lifecycle.
479
- */
480
- declare function postReviewTool(stores: FactoryStores, options: PostReviewToolOptions): import("eve/tools").ToolDefinition<{
481
- taskId: string;
482
- changeId: string;
483
- verdict: "approve" | "request_changes" | "comment";
484
- headSha: string;
485
- summary: string;
486
- comments: {
487
- path: string;
488
- line: number;
489
- body: string;
490
- key?: string | undefined;
491
- title?: string | undefined;
492
- }[];
493
- }, {
494
- recorded: false;
495
- reason: string;
496
- } | {
497
- taskState: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
498
- review?: SubmittedPullRequestReview | undefined;
499
- recorded: true;
500
- verdict: "approve" | "request_changes" | "comment";
501
- published: boolean;
502
- reason?: undefined;
503
- }> & {
504
- execute(input: {
505
- taskId: string;
506
- changeId: string;
507
- verdict: "approve" | "request_changes" | "comment";
508
- headSha: string;
509
- summary: string;
510
- comments: {
511
- path: string;
512
- line: number;
513
- body: string;
514
- key?: string | undefined;
515
- title?: string | undefined;
516
- }[];
517
- }, ctx: import("eve/tools").ToolContext): Promise<{
518
- recorded: false;
519
- reason: string;
520
- } | {
521
- taskState: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
522
- review?: SubmittedPullRequestReview | undefined;
523
- recorded: true;
524
- verdict: "approve" | "request_changes" | "comment";
525
- published: boolean;
526
- reason?: undefined;
527
- }>;
528
- };
529
- //#endregion
530
- //#region src/eve/review.d.ts
531
- interface ReviewCommentToolOptions<S extends CommandSandbox = CommandSandbox> {
532
- tokenForRepository: (repository: string) => Promise<string>;
533
- withCredential?: (sandbox: S, repository: string, command: string) => Promise<{
534
- stdout: string;
535
- stderr?: string;
536
- exitCode?: number;
537
- }>;
538
- fetch?: typeof globalThis.fetch;
539
- repoPath?: string;
75
+ /** Unanswered question shape accepted when a Task requests human input. */
76
+ type HumanInputQuestion = Omit<TaskQuestion, "answer" | "answeredBy">;
77
+ /** Currently running parent Task and its single human question for this execution. */
78
+ interface RequestHumanInputToolInput {
79
+ parentTaskId: TaskId;
80
+ question: HumanInputQuestion;
540
81
  }
541
- declare function reviewCommentTools<S extends CommandSandbox>(stores: FactoryStores, options: ReviewCommentToolOptions<S>): {
542
- read_review_comment: import("eve/tools").ToolDefinition<{
543
- changeId: string;
544
- commentId: number;
545
- }, GitHubReviewComment> & {
546
- execute(input: {
547
- changeId: string;
548
- commentId: number;
549
- }, ctx: import("eve/tools").ToolContext): Promise<GitHubReviewComment>;
550
- };
551
- answer_review_comment: import("eve/tools").ToolDefinition<{
552
- changeId: string;
553
- commentId: number;
554
- body: string;
555
- }, GitHubReviewComment> & {
556
- execute(input: {
557
- changeId: string;
558
- commentId: number;
559
- body: string;
560
- }, ctx: import("eve/tools").ToolContext): Promise<GitHubReviewComment>;
561
- };
562
- suggest_review_fix: import("eve/tools").ToolDefinition<{
563
- changeId: string;
564
- commentId: number;
565
- confidence: "medium";
566
- replacement: string;
567
- summary: string;
568
- }, GitHubReviewComment> & {
569
- execute(input: {
570
- changeId: string;
571
- commentId: number;
572
- confidence: "medium";
573
- replacement: string;
574
- summary: string;
575
- }, ctx: import("eve/tools").ToolContext): Promise<GitHubReviewComment>;
576
- };
577
- apply_review_fix: import("eve/tools").ToolDefinition<{
578
- changeId: string;
579
- commentId: number;
580
- confidence: "high";
581
- summary: string;
582
- }, {
583
- updated: true;
584
- prNumber: number;
585
- prUrl: string;
586
- reply: GitHubReviewComment;
587
- }> & {
588
- execute(input: {
589
- changeId: string;
590
- commentId: number;
591
- confidence: "high";
592
- summary: string;
593
- }, ctx: import("eve/tools").ToolContext): Promise<{
594
- updated: true;
595
- prNumber: number;
596
- prUrl: string;
597
- reply: GitHubReviewComment;
598
- }>;
599
- };
600
- };
601
- //#endregion
602
- //#region src/eve/verification.d.ts
603
- interface RecordVerificationOptions {
604
- presentResult?: (input: {
605
- taskId: string;
606
- changeId: string;
607
- verdict: "pass" | "fail";
608
- summary: string;
609
- }) => Promise<void>;
82
+ /** Provider-neutral Eve tool for pausing one running execution on one persisted human question. */
83
+ interface RequestHumanInputTool extends ToolDefinition<RequestHumanInputToolInput, Task> {
84
+ execute(input: RequestHumanInputToolInput, ctx: ToolContext): Promise<Task>;
610
85
  }
611
- /**
612
- * The verifier's outcome tool. Writes evidence onto the change and moves it
613
- * to ready only when the verdict is pass; a failed verdict leaves the change
614
- * verifying with the evidence recorded, and the verification task itself
615
- * ends with a receipt either way. The change's own code_change task follows
616
- * the verdict too: succeeded on pass, failed on fail with the verifier's
617
- * summary as the reason, so the ledger never shows a verified-and-rejected fix
618
- * as still in progress. Fail closed: the agent cannot mark a change ready
619
- * without supplying every evidence field.
620
- */
621
- declare function recordVerificationTool(stores: FactoryStores, options?: RecordVerificationOptions): import("eve/tools").ToolDefinition<{
622
- taskId: string;
623
- changeId: string;
624
- verdict: "pass" | "fail";
625
- evidence: {
626
- reproVerified: boolean;
627
- testsAdded: number;
628
- checksGreen: boolean;
629
- attackPassed: boolean;
630
- scopeMatches: boolean;
631
- previewUrl?: string | undefined;
632
- };
633
- confidence: "low" | "medium" | "high";
634
- summary: string;
635
- }, {
636
- recorded: false;
637
- reason: string;
638
- verdict?: undefined;
639
- changeState?: undefined;
640
- taskState?: undefined;
641
- } | {
642
- recorded: true;
643
- verdict: "pass" | "fail";
644
- changeState: "rolled_back" | "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "closed";
645
- taskState: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
646
- reason?: undefined;
647
- }> & {
648
- execute(input: {
649
- taskId: string;
650
- changeId: string;
651
- verdict: "pass" | "fail";
652
- evidence: {
653
- reproVerified: boolean;
654
- testsAdded: number;
655
- checksGreen: boolean;
656
- attackPassed: boolean;
657
- scopeMatches: boolean;
658
- previewUrl?: string | undefined;
659
- };
660
- confidence: "low" | "medium" | "high";
661
- summary: string;
662
- }, ctx: import("eve/tools").ToolContext): Promise<{
663
- recorded: false;
664
- reason: string;
665
- verdict?: undefined;
666
- changeState?: undefined;
667
- taskState?: undefined;
668
- } | {
669
- recorded: true;
670
- verdict: "pass" | "fail";
671
- changeState: "rolled_back" | "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "closed";
672
- taskState: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
673
- reason?: undefined;
674
- }>;
675
- };
676
- //#endregion
677
- //#region src/eve/index.d.ts
678
- declare const recordChangeInputSchema: z.ZodObject<{
679
- taskId: z.ZodString;
680
- repositoryId: z.ZodString;
681
- prNumber: z.ZodNumber;
682
- prUrl: z.ZodURL;
683
- risk: z.ZodEnum<{
684
- low: "low";
685
- medium: "medium";
686
- high: "high";
687
- }>;
688
- confidence: z.ZodEnum<{
689
- low: "low";
690
- medium: "medium";
691
- high: "high";
692
- }>;
693
- summary: z.ZodString;
694
- }, z.core.$strip>;
695
- type RecordChangeInput = z.infer<typeof recordChangeInputSchema>;
696
- type GateVerdict = {
697
- ok: true;
698
- } | {
699
- ok: false;
700
- reason: string;
701
- };
702
- interface FactoryToolsOptions {
703
- /**
704
- * Pre-action gate for record_change, run as an eve approval policy before
705
- * the tool executes. Refusals reach the model as a denial with the reason.
706
- * Gates must fail closed: when they cannot verify, they refuse.
707
- */
708
- recordChangeGate?: (input: RecordChangeInput) => Promise<GateVerdict>;
709
- /** Whether recorded code changes wait for an independent verification task. Default: required. */
710
- verification?: "required" | "disabled";
711
- /** Present the pull request after record_change persists its durable state. */
712
- presentChange?: (input: {
713
- taskId: string;
714
- changeId: string;
715
- verification: "required" | "disabled";
716
- summary: string;
717
- }) => Promise<void>;
718
- /** Present a persisted human question through the application's Foreman communication boundary. */
719
- presentQuestion?: (task: Task) => Promise<void>;
86
+ /** Question Task and authenticated answer supplied to the answer tool. */
87
+ interface AnswerQuestionToolInput {
88
+ questionTaskId: TaskId;
89
+ answer: string;
90
+ }
91
+ /** Provider-neutral Eve tool for answering a persisted human question. */
92
+ interface AnswerQuestionTool extends ToolDefinition<AnswerQuestionToolInput, AnswerQuestionResult> {
93
+ execute(input: AnswerQuestionToolInput, ctx: ToolContext): Promise<AnswerQuestionResult>;
94
+ }
95
+ /** Immutable audit event accepted by the generic receipt tool. */
96
+ interface AppendReceiptToolInput {
97
+ repositoryIds: RepositoryIds;
98
+ taskId?: TaskId;
99
+ changeId?: ChangeId;
100
+ kind: ReceiptKind;
101
+ state: ReceiptState;
102
+ reason?: string;
103
+ dedupeKey?: string;
104
+ }
105
+ /** Provider-neutral Eve tool for appending one immutable audit Receipt. */
106
+ interface AppendReceiptTool extends ToolDefinition<AppendReceiptToolInput, Receipt> {
107
+ execute(input: AppendReceiptToolInput, ctx: ToolContext): Promise<Receipt>;
108
+ }
109
+ /** The provider-neutral Task, Signal, question, and Receipt tools exposed to an Eve agent. */
110
+ interface TaskTools {
111
+ readonly get_task: GetTaskTool;
112
+ readonly decide_signal: DecideSignalTool;
113
+ readonly finish_task: FinishTaskTool;
114
+ readonly request_human_input: RequestHumanInputTool;
115
+ readonly answer_question: AnswerQuestionTool;
116
+ readonly append_receipt: AppendReceiptTool;
720
117
  }
721
- type PresentQuestion = NonNullable<FactoryToolsOptions["presentQuestion"]>;
722
118
  /**
723
- * The factory's store operations wrapped as eve tools. Expose a tool to an
119
+ * The factory's provider-neutral store operations wrapped as Eve tools. Expose a tool to an
724
120
  * agent by re-exporting it from a file under agent/tools/, e.g.
725
- * `export default factoryTools(stores).get_task;`. Every write goes through
121
+ * `export default createTaskTools(stores).get_task;`. Every write goes through
726
122
  * the engine, so agents inherit transition legality and receipts.
727
123
  */
728
- declare function factoryTools(stores: FactoryStores, options?: FactoryToolsOptions): {
729
- get_task: import("eve/tools").ToolDefinition<{
730
- taskId: string;
731
- }, {
732
- schemaVersion: 1;
733
- id: string;
734
- repositoryIds: string[];
735
- kind: string;
736
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
737
- origin: {
738
- signalId?: string | undefined;
739
- parentTaskId?: string | undefined;
740
- operator?: string | undefined;
741
- };
742
- replyTo: {
743
- channel: string;
744
- address: string;
745
- };
746
- attempt: number;
747
- createdAt: string;
748
- updatedAt: string;
749
- area?: string | undefined;
750
- approval?: "required" | "granted" | "denied" | undefined;
751
- dependsOn?: string[] | undefined;
752
- execution?: {
753
- provider: string;
754
- sessionId: string;
755
- environmentId?: string | undefined;
756
- harness?: string | undefined;
757
- traceId?: string | undefined;
758
- } | undefined;
759
- lastProgressAt?: string | undefined;
760
- stalledAt?: string | undefined;
761
- stalledReason?: string | undefined;
762
- reservedUsd?: number | undefined;
763
- reservedAt?: string | undefined;
764
- usage?: {
765
- costUsd: number;
766
- inputTokens: number;
767
- outputTokens: number;
768
- cacheReadTokens: number;
769
- cacheWriteTokens: number;
770
- steps: Record<string, number>;
771
- } | undefined;
772
- settledUsd?: number | undefined;
773
- question?: {
774
- text: string;
775
- options: string[];
776
- answer?: string | undefined;
777
- answeredBy?: string | undefined;
778
- } | undefined;
779
- questionTaskId?: string | undefined;
780
- answerEventIds?: string[] | undefined;
781
- changeId?: string | undefined;
782
- reportRef?: string | undefined;
783
- } | {
784
- found: false;
785
- taskId: string;
786
- }> & {
787
- execute(input: {
788
- taskId: string;
789
- }, ctx: import("eve/tools").ToolContext): Promise<{
790
- schemaVersion: 1;
791
- id: string;
792
- repositoryIds: string[];
793
- kind: string;
794
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
795
- origin: {
796
- signalId?: string | undefined;
797
- parentTaskId?: string | undefined;
798
- operator?: string | undefined;
799
- };
800
- replyTo: {
801
- channel: string;
802
- address: string;
803
- };
804
- attempt: number;
805
- createdAt: string;
806
- updatedAt: string;
807
- area?: string | undefined;
808
- approval?: "required" | "granted" | "denied" | undefined;
809
- dependsOn?: string[] | undefined;
810
- execution?: {
811
- provider: string;
812
- sessionId: string;
813
- environmentId?: string | undefined;
814
- harness?: string | undefined;
815
- traceId?: string | undefined;
816
- } | undefined;
817
- lastProgressAt?: string | undefined;
818
- stalledAt?: string | undefined;
819
- stalledReason?: string | undefined;
820
- reservedUsd?: number | undefined;
821
- reservedAt?: string | undefined;
822
- usage?: {
823
- costUsd: number;
824
- inputTokens: number;
825
- outputTokens: number;
826
- cacheReadTokens: number;
827
- cacheWriteTokens: number;
828
- steps: Record<string, number>;
829
- } | undefined;
830
- settledUsd?: number | undefined;
831
- question?: {
832
- text: string;
833
- options: string[];
834
- answer?: string | undefined;
835
- answeredBy?: string | undefined;
836
- } | undefined;
837
- questionTaskId?: string | undefined;
838
- answerEventIds?: string[] | undefined;
839
- changeId?: string | undefined;
840
- reportRef?: string | undefined;
841
- } | {
842
- found: false;
843
- taskId: string;
844
- }>;
845
- };
846
- decide_signal: import("eve/tools").ToolDefinition<{
847
- signalId: string;
848
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored";
849
- reason: string;
850
- detail?: string | undefined;
851
- }, {
852
- schemaVersion: 1;
853
- id: string;
854
- repositoryId: string;
855
- source: string;
856
- deliveryId: string;
857
- replyTo: {
858
- channel: string;
859
- address: string;
860
- };
861
- payload: unknown;
862
- receivedAt: string;
863
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored" | "pending";
864
- detail?: string | undefined;
865
- reason?: string | undefined;
866
- decidedAt?: string | undefined;
867
- }> & {
868
- execute(input: {
869
- signalId: string;
870
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored";
871
- reason: string;
872
- detail?: string | undefined;
873
- }, ctx: import("eve/tools").ToolContext): Promise<{
874
- schemaVersion: 1;
875
- id: string;
876
- repositoryId: string;
877
- source: string;
878
- deliveryId: string;
879
- replyTo: {
880
- channel: string;
881
- address: string;
882
- };
883
- payload: unknown;
884
- receivedAt: string;
885
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored" | "pending";
886
- detail?: string | undefined;
887
- reason?: string | undefined;
888
- decidedAt?: string | undefined;
889
- }>;
890
- };
891
- record_change: import("eve/tools").ToolDefinition<{
892
- taskId: string;
893
- repositoryId: string;
894
- prNumber: number;
895
- prUrl: string;
896
- risk: "low" | "medium" | "high";
897
- confidence: "low" | "medium" | "high";
898
- summary: string;
899
- }, {
900
- change: {
901
- schemaVersion: 1;
902
- id: string;
903
- repositoryId: string;
904
- prNumber: number;
905
- prUrl: string;
906
- author: string;
907
- risk: "low" | "medium" | "high";
908
- confidence: "low" | "medium" | "high";
909
- evidence: {
910
- reproVerified: boolean;
911
- testsAdded: number;
912
- checksGreen: boolean;
913
- attackPassed: boolean;
914
- scopeMatches: boolean;
915
- previewUrl?: string | undefined;
916
- };
917
- state: "rolled_back" | "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "closed";
918
- createdAt: string;
919
- updatedAt: string;
920
- taskId?: string | undefined;
921
- groupId?: string | undefined;
922
- mergeSha?: string | undefined;
923
- decidedBy?: string | undefined;
924
- };
925
- task: {
926
- schemaVersion: 1;
927
- id: string;
928
- repositoryIds: string[];
929
- kind: string;
930
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
931
- origin: {
932
- signalId?: string | undefined;
933
- parentTaskId?: string | undefined;
934
- operator?: string | undefined;
935
- };
936
- replyTo: {
937
- channel: string;
938
- address: string;
939
- };
940
- attempt: number;
941
- createdAt: string;
942
- updatedAt: string;
943
- area?: string | undefined;
944
- approval?: "required" | "granted" | "denied" | undefined;
945
- dependsOn?: string[] | undefined;
946
- execution?: {
947
- provider: string;
948
- sessionId: string;
949
- environmentId?: string | undefined;
950
- harness?: string | undefined;
951
- traceId?: string | undefined;
952
- } | undefined;
953
- lastProgressAt?: string | undefined;
954
- stalledAt?: string | undefined;
955
- stalledReason?: string | undefined;
956
- reservedUsd?: number | undefined;
957
- reservedAt?: string | undefined;
958
- usage?: {
959
- costUsd: number;
960
- inputTokens: number;
961
- outputTokens: number;
962
- cacheReadTokens: number;
963
- cacheWriteTokens: number;
964
- steps: Record<string, number>;
965
- } | undefined;
966
- settledUsd?: number | undefined;
967
- question?: {
968
- text: string;
969
- options: string[];
970
- answer?: string | undefined;
971
- answeredBy?: string | undefined;
972
- } | undefined;
973
- questionTaskId?: string | undefined;
974
- answerEventIds?: string[] | undefined;
975
- changeId?: string | undefined;
976
- reportRef?: string | undefined;
977
- };
978
- }> & {
979
- execute(input: {
980
- taskId: string;
981
- repositoryId: string;
982
- prNumber: number;
983
- prUrl: string;
984
- risk: "low" | "medium" | "high";
985
- confidence: "low" | "medium" | "high";
986
- summary: string;
987
- }, ctx: import("eve/tools").ToolContext): Promise<{
988
- change: {
989
- schemaVersion: 1;
990
- id: string;
991
- repositoryId: string;
992
- prNumber: number;
993
- prUrl: string;
994
- author: string;
995
- risk: "low" | "medium" | "high";
996
- confidence: "low" | "medium" | "high";
997
- evidence: {
998
- reproVerified: boolean;
999
- testsAdded: number;
1000
- checksGreen: boolean;
1001
- attackPassed: boolean;
1002
- scopeMatches: boolean;
1003
- previewUrl?: string | undefined;
1004
- };
1005
- state: "rolled_back" | "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "closed";
1006
- createdAt: string;
1007
- updatedAt: string;
1008
- taskId?: string | undefined;
1009
- groupId?: string | undefined;
1010
- mergeSha?: string | undefined;
1011
- decidedBy?: string | undefined;
1012
- };
1013
- task: {
1014
- schemaVersion: 1;
1015
- id: string;
1016
- repositoryIds: string[];
1017
- kind: string;
1018
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
1019
- origin: {
1020
- signalId?: string | undefined;
1021
- parentTaskId?: string | undefined;
1022
- operator?: string | undefined;
1023
- };
1024
- replyTo: {
1025
- channel: string;
1026
- address: string;
1027
- };
1028
- attempt: number;
1029
- createdAt: string;
1030
- updatedAt: string;
1031
- area?: string | undefined;
1032
- approval?: "required" | "granted" | "denied" | undefined;
1033
- dependsOn?: string[] | undefined;
1034
- execution?: {
1035
- provider: string;
1036
- sessionId: string;
1037
- environmentId?: string | undefined;
1038
- harness?: string | undefined;
1039
- traceId?: string | undefined;
1040
- } | undefined;
1041
- lastProgressAt?: string | undefined;
1042
- stalledAt?: string | undefined;
1043
- stalledReason?: string | undefined;
1044
- reservedUsd?: number | undefined;
1045
- reservedAt?: string | undefined;
1046
- usage?: {
1047
- costUsd: number;
1048
- inputTokens: number;
1049
- outputTokens: number;
1050
- cacheReadTokens: number;
1051
- cacheWriteTokens: number;
1052
- steps: Record<string, number>;
1053
- } | undefined;
1054
- settledUsd?: number | undefined;
1055
- question?: {
1056
- text: string;
1057
- options: string[];
1058
- answer?: string | undefined;
1059
- answeredBy?: string | undefined;
1060
- } | undefined;
1061
- questionTaskId?: string | undefined;
1062
- answerEventIds?: string[] | undefined;
1063
- changeId?: string | undefined;
1064
- reportRef?: string | undefined;
1065
- };
1066
- }>;
1067
- };
1068
- finish_task: import("eve/tools").ToolDefinition<{
1069
- taskId: string;
1070
- summary: string;
1071
- }, {
1072
- finished: false;
1073
- reason: string;
1074
- taskState?: undefined;
1075
- } | {
1076
- finished: true;
1077
- taskState: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
1078
- reason?: undefined;
1079
- }> & {
1080
- execute(input: {
1081
- taskId: string;
1082
- summary: string;
1083
- }, ctx: import("eve/tools").ToolContext): Promise<{
1084
- finished: false;
1085
- reason: string;
1086
- taskState?: undefined;
1087
- } | {
1088
- finished: true;
1089
- taskState: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
1090
- reason?: undefined;
1091
- }>;
1092
- };
1093
- request_human_input: import("eve/tools").ToolDefinition<{
1094
- parentTaskId: string;
1095
- question: {
1096
- text: string;
1097
- options: string[];
1098
- };
1099
- }, {
1100
- schemaVersion: 1;
1101
- id: string;
1102
- repositoryIds: string[];
1103
- kind: string;
1104
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
1105
- origin: {
1106
- signalId?: string | undefined;
1107
- parentTaskId?: string | undefined;
1108
- operator?: string | undefined;
1109
- };
1110
- replyTo: {
1111
- channel: string;
1112
- address: string;
1113
- };
1114
- attempt: number;
1115
- createdAt: string;
1116
- updatedAt: string;
1117
- area?: string | undefined;
1118
- approval?: "required" | "granted" | "denied" | undefined;
1119
- dependsOn?: string[] | undefined;
1120
- execution?: {
1121
- provider: string;
1122
- sessionId: string;
1123
- environmentId?: string | undefined;
1124
- harness?: string | undefined;
1125
- traceId?: string | undefined;
1126
- } | undefined;
1127
- lastProgressAt?: string | undefined;
1128
- stalledAt?: string | undefined;
1129
- stalledReason?: string | undefined;
1130
- reservedUsd?: number | undefined;
1131
- reservedAt?: string | undefined;
1132
- usage?: {
1133
- costUsd: number;
1134
- inputTokens: number;
1135
- outputTokens: number;
1136
- cacheReadTokens: number;
1137
- cacheWriteTokens: number;
1138
- steps: Record<string, number>;
1139
- } | undefined;
1140
- settledUsd?: number | undefined;
1141
- question?: {
1142
- text: string;
1143
- options: string[];
1144
- answer?: string | undefined;
1145
- answeredBy?: string | undefined;
1146
- } | undefined;
1147
- questionTaskId?: string | undefined;
1148
- answerEventIds?: string[] | undefined;
1149
- changeId?: string | undefined;
1150
- reportRef?: string | undefined;
1151
- }> & {
1152
- execute(input: {
1153
- parentTaskId: string;
1154
- question: {
1155
- text: string;
1156
- options: string[];
1157
- };
1158
- }, ctx: import("eve/tools").ToolContext): Promise<{
1159
- schemaVersion: 1;
1160
- id: string;
1161
- repositoryIds: string[];
1162
- kind: string;
1163
- state: "succeeded" | "failed" | "needs_human" | "queued" | "running" | "stalled" | "verifying" | "cancelled";
1164
- origin: {
1165
- signalId?: string | undefined;
1166
- parentTaskId?: string | undefined;
1167
- operator?: string | undefined;
1168
- };
1169
- replyTo: {
1170
- channel: string;
1171
- address: string;
1172
- };
1173
- attempt: number;
1174
- createdAt: string;
1175
- updatedAt: string;
1176
- area?: string | undefined;
1177
- approval?: "required" | "granted" | "denied" | undefined;
1178
- dependsOn?: string[] | undefined;
1179
- execution?: {
1180
- provider: string;
1181
- sessionId: string;
1182
- environmentId?: string | undefined;
1183
- harness?: string | undefined;
1184
- traceId?: string | undefined;
1185
- } | undefined;
1186
- lastProgressAt?: string | undefined;
1187
- stalledAt?: string | undefined;
1188
- stalledReason?: string | undefined;
1189
- reservedUsd?: number | undefined;
1190
- reservedAt?: string | undefined;
1191
- usage?: {
1192
- costUsd: number;
1193
- inputTokens: number;
1194
- outputTokens: number;
1195
- cacheReadTokens: number;
1196
- cacheWriteTokens: number;
1197
- steps: Record<string, number>;
1198
- } | undefined;
1199
- settledUsd?: number | undefined;
1200
- question?: {
1201
- text: string;
1202
- options: string[];
1203
- answer?: string | undefined;
1204
- answeredBy?: string | undefined;
1205
- } | undefined;
1206
- questionTaskId?: string | undefined;
1207
- answerEventIds?: string[] | undefined;
1208
- changeId?: string | undefined;
1209
- reportRef?: string | undefined;
1210
- }>;
1211
- };
1212
- answer_question: import("eve/tools").ToolDefinition<{
1213
- questionTaskId: string;
1214
- answer: string;
1215
- }, {
1216
- answerEvent: AnswerEvent;
1217
- questionTask: Task;
1218
- parentTask: Task | null;
1219
- }> & {
1220
- execute(input: {
1221
- questionTaskId: string;
1222
- answer: string;
1223
- }, ctx: import("eve/tools").ToolContext): Promise<{
1224
- answerEvent: AnswerEvent;
1225
- questionTask: Task;
1226
- parentTask: Task | null;
1227
- }>;
1228
- };
1229
- append_receipt: import("eve/tools").ToolDefinition<{
1230
- repositoryIds: string[];
1231
- kind: string;
1232
- state: string;
1233
- taskId?: string | undefined;
1234
- changeId?: string | undefined;
1235
- reason?: string | undefined;
1236
- dedupeKey?: string | undefined;
1237
- }, {
1238
- schemaVersion: 1;
1239
- receiptId: string;
1240
- repositoryIds: string[];
1241
- kind: string;
1242
- state: string;
1243
- attempt: number;
1244
- recordedAt: string;
1245
- taskId?: string | undefined;
1246
- changeId?: string | undefined;
1247
- phase?: string | undefined;
1248
- reason?: string | undefined;
1249
- cost?: {
1250
- totalUsd: number;
1251
- } | undefined;
1252
- decidedBy?: string | undefined;
1253
- }> & {
1254
- execute(input: {
1255
- repositoryIds: string[];
1256
- kind: string;
1257
- state: string;
1258
- taskId?: string | undefined;
1259
- changeId?: string | undefined;
1260
- reason?: string | undefined;
1261
- dedupeKey?: string | undefined;
1262
- }, ctx: import("eve/tools").ToolContext): Promise<{
1263
- schemaVersion: 1;
1264
- receiptId: string;
1265
- repositoryIds: string[];
1266
- kind: string;
1267
- state: string;
1268
- attempt: number;
1269
- recordedAt: string;
1270
- taskId?: string | undefined;
1271
- changeId?: string | undefined;
1272
- phase?: string | undefined;
1273
- reason?: string | undefined;
1274
- cost?: {
1275
- totalUsd: number;
1276
- } | undefined;
1277
- decidedBy?: string | undefined;
1278
- }>;
1279
- };
1280
- };
1281
- type FactoryTools = ReturnType<typeof factoryTools>;
124
+ declare function createTaskTools(stores: TaskToolsStores, options?: TaskToolsOptions): TaskTools;
125
+ /** Completed conversation output, or `false` when the Task is not a conversation. */
126
+ type ConversationCompletionResult = {
127
+ readonly output: JsonValue;
128
+ } | false;
129
+ /** Configures attempt recovery, conversation completion, and transcript projection for Eve hooks. */
1282
130
  interface FactoryHooksOptions {
1283
131
  /** Session auth attribute naming the task a dispatched session works on. Default `factoryTaskId`. */
1284
132
  taskIdAttribute?: string;
133
+ /** Session auth attribute naming the execution attempt. Default `factoryTaskAttempt`. */
134
+ taskAttemptAttribute?: string;
135
+ /** Attempts allowed before an explicit provider failure becomes terminal. Default: 3. */
136
+ maxAttempts?: number;
1285
137
  /** Present the recovery question created when a task turn ends without an outcome. */
1286
138
  presentQuestion: PresentQuestion;
139
+ /** Classify discussion Tasks on failure or cancellation without collecting a successful response. */
140
+ isConversation?: (task: Task) => MaybePromise<boolean>;
141
+ /** Return the actual completed response for an opted-in discussion, or false for other work. */
142
+ completeConversation?: (task: Task) => Promise<ConversationCompletionResult>;
143
+ /** Persist the browser-safe transcript projection after Eve durably records a response boundary. */
144
+ materializeTranscript?: EveTranscriptMaterializer;
145
+ }
146
+ /** Observe-only hook for agents that do not use the Factory task-lifecycle hook. */
147
+ declare function createTranscriptSnapshotHook(materialize: EveTranscriptMaterializer): TranscriptSnapshotHook;
148
+ /** Observe-only Eve hook that materializes transcript snapshots at response boundaries. */
149
+ type TranscriptSnapshotHook = HookDefinition<"session.waiting" | "session.completed" | "session.failed">;
150
+ type FactoryHookEvent = "step.completed" | "turn.failed" | "session.failed" | "session.waiting" | "session.completed" | "turn.cancelled" | "turn.completed";
151
+ /** The Eve lifecycle hook projected onto durable Factory Task state. */
152
+ interface FactoryHooks {
153
+ readonly factory: HookDefinition<FactoryHookEvent>;
1287
154
  }
1288
155
  /**
1289
156
  * Observe-only eve hooks that keep the ledger honest about session outcomes.
1290
157
  * Mount by re-exporting from agent/hooks/, e.g.
1291
- * `export default factoryHooks(stores, { presentQuestion }).factory;`.
158
+ * `export default createFactoryHooks(stores, { presentQuestion }).factory;`.
1292
159
  *
1293
160
  * step.completed: records the step's tokens and AI Gateway cost on the bound
1294
161
  * task. Delivery is at least once; recordUsage dedupes by (turnId, stepIndex).
1295
162
  *
163
+ * turn.failed/session.failed: immediately re-queues the current attempt, or
164
+ * fails it when its configured attempts are exhausted. turn.cancelled marks
165
+ * the current Task cancelled. Late events from prior attempts are ignored.
166
+ *
1296
167
  * turn.completed: settles the bound task's recorded usage if the task is
1297
- * already terminal (the sweep handles tasks that end later), then moves any
1298
- * still-running task at this session's reply address behind a surfaced human
1299
- * question, because the agent finished talking without recording an outcome.
168
+ * already terminal, and enforces the turn contract otherwise: a still-running
169
+ * bound task (or a still-running task at this session's reply address, for
170
+ * conversational continuations that never got their own bound session)
171
+ * escalates immediately to a surfaced human question instead of waiting out
172
+ * the stall window, because the agent finished without recording an outcome.
1300
173
  *
1301
174
  * Every store call is swallowed: a hook throw fails the turn.
175
+ * Transcript projection writes at session response boundaries are likewise
176
+ * best-effort; the API can rebuild a missing projection from durable events.
1302
177
  */
1303
- declare function factoryHooks(stores: FactoryStores, options: FactoryHooksOptions): {
1304
- factory: import("eve/hooks").HookDefinition<"step.completed" | "turn.completed">;
1305
- };
1306
- type FactoryHooks = ReturnType<typeof factoryHooks>;
178
+ declare function createFactoryHooks(stores: FactoryHooksStores, options: FactoryHooksOptions): FactoryHooks;
1307
179
  //#endregion
1308
- export { type CommandSandbox, type CompletedReview, type CompletedReviewFinding, type DeepsecScanOptions, type DelegateAgentOptions, FactoryHooks, FactoryHooksOptions, FactoryTools, FactoryToolsOptions, type FetchPullRequestOptions, type FetchPullRequestResult, GateVerdict, type InvokeAgentOptions, type MergeConflictPayload, type MergeConflictToolOptions, type PostReviewToolOptions, type PublishedReview, RecordChangeInput, type RecordFindingOptions, type RecordFindingResult, type RecordVerificationOptions, type ReviewCommentToolOptions, deepsecScanTool, delegateAgentTool, factoryHooks, factoryTools, fetchPullRequestTool, findingFromDeepsec, invokeAgentTool, mergeConflictPayloadSchema, mergeConflictTools, postReviewTool, recordFinding, recordFindingTool, recordVerificationTool, reviewCommentTools };
180
+ export { AnswerQuestionTool, AnswerQuestionToolInput, AppendReceiptTool, AppendReceiptToolInput, type CancelEveSessionOptions, type ConversationBinding, ConversationCompletionResult, DecideSignalTool, DecideSignalToolInput, type DelegateAgentLaunchInput, type DelegateAgentTool, type DelegateAgentToolInput, type DelegateAgentToolOptions, type DelegateAgentToolStores, type DelegateWorkflowInput, type DelegateWorkflowPolicy, type DelegateWorkflowResult, type EveSessionEvent, type EveSessionStream, type EveSessionStreamInput, type EveTranscriptMaterializer, type EveTranscriptMaterializerOptions, type EveTranscriptRequestScope, type FactoryConversationSessionBinding, FactoryHooks, FactoryHooksOptions, FactoryHooksStores, FinishTaskRefusal, FinishTaskSuccess, FinishTaskTool, FinishTaskToolInput, FinishTaskToolResult, type ForwardEveSessionRequestOptions, GetTaskTool, GetTaskToolInput, GetTaskToolResult, HumanInputQuestion, type InvokeAgentTool, type InvokeAgentToolInput, type InvokeAgentToolOptions, type InvokeAgentToolResult, type InvokeAgentToolStores, PresentQuestion, type ReadCompletedEveTurnOptions, RequestHumanInputTool, RequestHumanInputToolInput, type StartEveSessionOptions, TaskNotFoundResult, TaskTools, TaskToolsOptions, TaskToolsStores, type TranscriptMaterializationInput, TranscriptSnapshotHook, cancelEveSession, conversationBinding, conversationBindingForSession, conversationHeaders, createDelegateAgentTool, createEveTranscriptMaterializer, createFactoryHooks, createInvokeAgentTool, createTaskTools, createTranscriptSnapshotHook, factoryReplyAddressAttribute, factoryReplyAddressHeader, factoryReplyChannelAttribute, factoryReplyChannelHeader, factoryRepositoryIdsAttribute, factoryRepositoryIdsHeader, factoryTaskAttemptAttribute, factoryTaskAttemptHeader, factoryTaskAttribute, factoryTaskHeader, forwardEveSessionRequest, hasFactoryTaskBinding, optionalTaskIdForSession, readCompletedEveTurn, replyToForSession, repositoryIdsForSession, requireTaskIdForSession, startEveSession, taskBindingForSession, taskHeaders, taskSessionAuth, withFactoryTask, withOptionalFactoryTask };
1309
181
  //# sourceMappingURL=index.d.mts.map