@vercel/factory 0.0.13 → 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 (458) hide show
  1. package/README.md +307 -1
  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 +77 -0
  14. package/dist/api.mjs +1087 -0
  15. package/dist/api.mjs.map +1 -0
  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 +44 -8
  29. package/dist/blob/index.mjs +159 -35
  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 -2
  92. package/dist/connectors/index.mjs +4 -26
  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 -41
  103. package/dist/connectors/slack.mjs +13 -69
  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 -1561
  124. package/dist/eve/index.mjs +244 -1063
  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 +250 -37
  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 -314
  175. package/dist/index.mjs +14 -1124
  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-DwCihQr4.mjs → schema/common.mjs} +7 -14
  303. package/dist/schema/common.mjs.map +1 -0
  304. package/dist/schema/communication.d.mts +52 -0
  305. package/dist/schema/communication.mjs +35 -0
  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 -40
  443. package/dist/approval-CwhTP1XB.mjs +0 -269
  444. package/dist/approval-CwhTP1XB.mjs.map +0 -1
  445. package/dist/change-CzEAoFVE.mjs +0 -620
  446. package/dist/change-CzEAoFVE.mjs.map +0 -1
  447. package/dist/dispatch-B77cuPxh.d.mts +0 -713
  448. package/dist/driver-BJutB0PE.d.mts +0 -34
  449. package/dist/driver-Bbd25rNM.mjs +0 -23
  450. package/dist/driver-Bbd25rNM.mjs.map +0 -1
  451. package/dist/factory-config-BJcjsPKl.mjs +0 -86
  452. package/dist/factory-config-BJcjsPKl.mjs.map +0 -1
  453. package/dist/factory-config-D2yU3G0c.d.mts +0 -58
  454. package/dist/github-DXsxboUL.d.mts +0 -271
  455. package/dist/id-DwCihQr4.mjs.map +0 -1
  456. package/dist/index-Cy4jfXh5.d.mts +0 -67
  457. package/dist/index.mjs.map +0 -1
  458. package/dist/signal-CHVEmzvI.d.mts +0 -59
@@ -0,0 +1,3134 @@
1
+ import { JsonValue } from "./work.mjs";
2
+ import { Task, TaskKind } from "./task.mjs";
3
+ import { z } from "zod";
4
+ //#region src/schema/task-graph.d.ts
5
+ /** Maximum number of Tasks admitted to one canonical root graph. */
6
+ declare const MAX_TASK_GRAPH_NODES = 256;
7
+ /** Maximum explicit dependencies allowed on one Task graph node. */
8
+ declare const MAX_TASK_GRAPH_DEPENDENCIES: number;
9
+ /** Validates a bounded, duplicate-free list of canonical Task dependencies. */
10
+ declare const taskGraphDependenciesSchema: z.ZodReadonly<z.ZodArray<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>>;
11
+ /** Validates the immutable queued Task snapshot retained for creation recovery. */
12
+ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
13
+ schemaVersion: z.ZodLiteral<1>;
14
+ id: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
15
+ repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
16
+ kind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
17
+ area: z.ZodOptional<z.ZodString>;
18
+ state: z.ZodEnum<{
19
+ queued: "queued";
20
+ running: "running";
21
+ stalled: "stalled";
22
+ verifying: "verifying";
23
+ succeeded: "succeeded";
24
+ failed: "failed";
25
+ needs_human: "needs_human";
26
+ cancelled: "cancelled";
27
+ }>;
28
+ approval: z.ZodOptional<z.ZodEnum<{
29
+ required: "required";
30
+ granted: "granted";
31
+ denied: "denied";
32
+ }>>;
33
+ origin: z.ZodObject<{
34
+ signalId: z.ZodOptional<z.ZodType<`sig_${string}`, string, z.core.$ZodTypeInternals<`sig_${string}`, string>>>;
35
+ operator: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strict>;
37
+ work: z.ZodObject<{
38
+ title: z.ZodString;
39
+ input: z.ZodCustom<JsonValue, JsonValue>;
40
+ completionCriteria: z.ZodReadonly<z.ZodArray<z.ZodString>>;
41
+ workflow: z.core.$ZodBranded<z.ZodObject<{
42
+ id: z.ZodString;
43
+ version: z.ZodNumber;
44
+ }, z.core.$strict>, "WorkflowBinding", "out">;
45
+ route: z.ZodOptional<z.core.$ZodBranded<z.ZodObject<{
46
+ id: z.ZodString;
47
+ version: z.ZodNumber;
48
+ }, z.core.$strict>, "AgentRouteBinding", "out">>;
49
+ }, z.core.$strict>;
50
+ workResult: z.ZodOptional<z.ZodObject<{
51
+ output: z.ZodCustom<JsonValue, JsonValue>;
52
+ completedAt: z.ZodISODateTime;
53
+ }, z.core.$strict>>;
54
+ waitingForMessages: z.ZodOptional<z.ZodBoolean>;
55
+ workflowPhase: z.ZodOptional<z.ZodString>;
56
+ rootTaskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
57
+ parentTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
58
+ parentTaskAttempt: z.ZodOptional<z.ZodNumber>;
59
+ replyTo: z.ZodObject<{
60
+ channel: z.ZodString;
61
+ address: z.ZodString;
62
+ }, z.core.$strict>;
63
+ pendingCommunicationReceiptIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>>>>;
64
+ failureReceiptId: z.ZodOptional<z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>>;
65
+ attempt: z.ZodNumber;
66
+ execution: z.ZodOptional<z.ZodObject<{
67
+ provider: z.ZodString;
68
+ sessionId: z.ZodString;
69
+ environmentId: z.ZodOptional<z.ZodString>;
70
+ harness: z.ZodOptional<z.ZodString>;
71
+ traceId: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strict>>;
73
+ lastProgressAt: z.ZodOptional<z.ZodISODateTime>;
74
+ stalledAt: z.ZodOptional<z.ZodISODateTime>;
75
+ stalledReason: z.ZodOptional<z.ZodString>;
76
+ needsHumanAction: z.ZodOptional<z.ZodString>;
77
+ needsHumanNotifiedAt: z.ZodOptional<z.ZodISODateTime>;
78
+ reservedUsd: z.ZodOptional<z.ZodNumber>;
79
+ reservedAt: z.ZodOptional<z.ZodISODateTime>;
80
+ usage: z.ZodOptional<z.ZodObject<{
81
+ costUsd: z.ZodNumber;
82
+ inputTokens: z.ZodNumber;
83
+ outputTokens: z.ZodNumber;
84
+ cacheReadTokens: z.ZodNumber;
85
+ cacheWriteTokens: z.ZodNumber;
86
+ steps: z.ZodRecord<z.ZodString, z.ZodNumber>;
87
+ }, z.core.$strict>>;
88
+ settledUsd: z.ZodOptional<z.ZodNumber>;
89
+ question: z.ZodOptional<z.ZodObject<{
90
+ text: z.ZodString;
91
+ options: z.ZodReadonly<z.ZodArray<z.ZodString>>;
92
+ closingOptions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
93
+ answer: z.ZodOptional<z.ZodString>;
94
+ answeredBy: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strict>>;
96
+ questionTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
97
+ answerEventIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<`ans_${string}`, string, z.core.$ZodTypeInternals<`ans_${string}`, string>>>>>;
98
+ changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
99
+ reportRef: z.ZodOptional<z.ZodString>;
100
+ createdAt: z.ZodISODateTime;
101
+ updatedAt: z.ZodISODateTime;
102
+ }, z.core.$strict>, keyof z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>> & z.ZodType<Task, {
103
+ schemaVersion: 1;
104
+ id: string;
105
+ repositoryIds: readonly [string, ...string[]];
106
+ kind: unknown;
107
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
108
+ origin: {
109
+ signalId?: string | undefined;
110
+ operator?: string | undefined;
111
+ };
112
+ work: {
113
+ title: string;
114
+ input: JsonValue;
115
+ completionCriteria: readonly string[];
116
+ workflow: {
117
+ id: string;
118
+ version: number;
119
+ };
120
+ route?: {
121
+ id: string;
122
+ version: number;
123
+ } | undefined;
124
+ };
125
+ rootTaskId: string;
126
+ replyTo: {
127
+ channel: string;
128
+ address: string;
129
+ };
130
+ attempt: number;
131
+ createdAt: string;
132
+ updatedAt: string;
133
+ area?: string | undefined;
134
+ approval?: "required" | "granted" | "denied" | undefined;
135
+ workResult?: {
136
+ output: JsonValue;
137
+ completedAt: string;
138
+ } | undefined;
139
+ waitingForMessages?: boolean | undefined;
140
+ workflowPhase?: string | undefined;
141
+ parentTaskId?: string | undefined;
142
+ parentTaskAttempt?: number | undefined;
143
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
144
+ failureReceiptId?: string | undefined;
145
+ execution?: {
146
+ provider: string;
147
+ sessionId: string;
148
+ environmentId?: string | undefined;
149
+ harness?: string | undefined;
150
+ traceId?: string | undefined;
151
+ } | undefined;
152
+ lastProgressAt?: string | undefined;
153
+ stalledAt?: string | undefined;
154
+ stalledReason?: string | undefined;
155
+ needsHumanAction?: string | undefined;
156
+ needsHumanNotifiedAt?: string | undefined;
157
+ reservedUsd?: number | undefined;
158
+ reservedAt?: string | undefined;
159
+ usage?: {
160
+ costUsd: number;
161
+ inputTokens: number;
162
+ outputTokens: number;
163
+ cacheReadTokens: number;
164
+ cacheWriteTokens: number;
165
+ steps: Record<string, number>;
166
+ } | undefined;
167
+ settledUsd?: number | undefined;
168
+ question?: {
169
+ text: string;
170
+ options: readonly string[];
171
+ closingOptions?: readonly string[] | undefined;
172
+ answer?: string | undefined;
173
+ answeredBy?: string | undefined;
174
+ } | undefined;
175
+ questionTaskId?: string | undefined;
176
+ answerEventIds?: readonly string[] | undefined;
177
+ changeId?: string | undefined;
178
+ reportRef?: string | undefined;
179
+ }, z.core.$ZodTypeInternals<Task, {
180
+ schemaVersion: 1;
181
+ id: string;
182
+ repositoryIds: readonly [string, ...string[]];
183
+ kind: unknown;
184
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
185
+ origin: {
186
+ signalId?: string | undefined;
187
+ operator?: string | undefined;
188
+ };
189
+ work: {
190
+ title: string;
191
+ input: JsonValue;
192
+ completionCriteria: readonly string[];
193
+ workflow: {
194
+ id: string;
195
+ version: number;
196
+ };
197
+ route?: {
198
+ id: string;
199
+ version: number;
200
+ } | undefined;
201
+ };
202
+ rootTaskId: string;
203
+ replyTo: {
204
+ channel: string;
205
+ address: string;
206
+ };
207
+ attempt: number;
208
+ createdAt: string;
209
+ updatedAt: string;
210
+ area?: string | undefined;
211
+ approval?: "required" | "granted" | "denied" | undefined;
212
+ workResult?: {
213
+ output: JsonValue;
214
+ completedAt: string;
215
+ } | undefined;
216
+ waitingForMessages?: boolean | undefined;
217
+ workflowPhase?: string | undefined;
218
+ parentTaskId?: string | undefined;
219
+ parentTaskAttempt?: number | undefined;
220
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
221
+ failureReceiptId?: string | undefined;
222
+ execution?: {
223
+ provider: string;
224
+ sessionId: string;
225
+ environmentId?: string | undefined;
226
+ harness?: string | undefined;
227
+ traceId?: string | undefined;
228
+ } | undefined;
229
+ lastProgressAt?: string | undefined;
230
+ stalledAt?: string | undefined;
231
+ stalledReason?: string | undefined;
232
+ needsHumanAction?: string | undefined;
233
+ needsHumanNotifiedAt?: string | undefined;
234
+ reservedUsd?: number | undefined;
235
+ reservedAt?: string | undefined;
236
+ usage?: {
237
+ costUsd: number;
238
+ inputTokens: number;
239
+ outputTokens: number;
240
+ cacheReadTokens: number;
241
+ cacheWriteTokens: number;
242
+ steps: Record<string, number>;
243
+ } | undefined;
244
+ settledUsd?: number | undefined;
245
+ question?: {
246
+ text: string;
247
+ options: readonly string[];
248
+ closingOptions?: readonly string[] | undefined;
249
+ answer?: string | undefined;
250
+ answeredBy?: string | undefined;
251
+ } | undefined;
252
+ questionTaskId?: string | undefined;
253
+ answerEventIds?: readonly string[] | undefined;
254
+ changeId?: string | undefined;
255
+ reportRef?: string | undefined;
256
+ }>> & z.ZodType<({
257
+ id: `task_${string}`;
258
+ schemaVersion: 1;
259
+ replyTo: {
260
+ channel: string;
261
+ address: string;
262
+ };
263
+ attempt: number;
264
+ updatedAt: string;
265
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
266
+ kind: TaskKind;
267
+ area?: string | undefined;
268
+ approval?: "required" | "granted" | "denied" | undefined;
269
+ origin: {
270
+ signalId?: `sig_${string}` | undefined;
271
+ operator?: string | undefined;
272
+ };
273
+ work: {
274
+ title: string;
275
+ input: JsonValue;
276
+ completionCriteria: readonly string[];
277
+ workflow: {
278
+ id: string;
279
+ version: number;
280
+ } & z.core.$brand<"WorkflowBinding">;
281
+ route?: ({
282
+ id: string;
283
+ version: number;
284
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
285
+ };
286
+ workflowPhase?: string | undefined;
287
+ rootTaskId: `task_${string}`;
288
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
289
+ execution?: {
290
+ provider: string;
291
+ sessionId: string;
292
+ environmentId?: string | undefined;
293
+ harness?: string | undefined;
294
+ traceId?: string | undefined;
295
+ } | undefined;
296
+ lastProgressAt?: string | undefined;
297
+ reservedUsd?: number | undefined;
298
+ reservedAt?: string | undefined;
299
+ usage?: {
300
+ costUsd: number;
301
+ inputTokens: number;
302
+ outputTokens: number;
303
+ cacheReadTokens: number;
304
+ cacheWriteTokens: number;
305
+ steps: Record<string, number>;
306
+ } | undefined;
307
+ settledUsd?: number | undefined;
308
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
309
+ changeId?: `chg_${string}` | undefined;
310
+ reportRef?: string | undefined;
311
+ createdAt: string;
312
+ } & {
313
+ waitingForMessages?: false;
314
+ needsHumanAction?: never;
315
+ needsHumanNotifiedAt?: never;
316
+ } & {
317
+ stalledAt?: never;
318
+ stalledReason?: never;
319
+ } & {
320
+ failureReceiptId?: never;
321
+ } & {
322
+ state: "queued";
323
+ workResult?: {
324
+ output: JsonValue;
325
+ completedAt: string;
326
+ };
327
+ } & {
328
+ question?: never;
329
+ questionTaskId?: never;
330
+ parentTaskAttempt?: never;
331
+ parentTaskId?: `task_${string}`;
332
+ }) | ({
333
+ id: `task_${string}`;
334
+ schemaVersion: 1;
335
+ replyTo: {
336
+ channel: string;
337
+ address: string;
338
+ };
339
+ attempt: number;
340
+ updatedAt: string;
341
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
342
+ kind: TaskKind;
343
+ area?: string | undefined;
344
+ approval?: "required" | "granted" | "denied" | undefined;
345
+ origin: {
346
+ signalId?: `sig_${string}` | undefined;
347
+ operator?: string | undefined;
348
+ };
349
+ work: {
350
+ title: string;
351
+ input: JsonValue;
352
+ completionCriteria: readonly string[];
353
+ workflow: {
354
+ id: string;
355
+ version: number;
356
+ } & z.core.$brand<"WorkflowBinding">;
357
+ route?: ({
358
+ id: string;
359
+ version: number;
360
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
361
+ };
362
+ workflowPhase?: string | undefined;
363
+ rootTaskId: `task_${string}`;
364
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
365
+ execution?: {
366
+ provider: string;
367
+ sessionId: string;
368
+ environmentId?: string | undefined;
369
+ harness?: string | undefined;
370
+ traceId?: string | undefined;
371
+ } | undefined;
372
+ lastProgressAt?: string | undefined;
373
+ reservedUsd?: number | undefined;
374
+ reservedAt?: string | undefined;
375
+ usage?: {
376
+ costUsd: number;
377
+ inputTokens: number;
378
+ outputTokens: number;
379
+ cacheReadTokens: number;
380
+ cacheWriteTokens: number;
381
+ steps: Record<string, number>;
382
+ } | undefined;
383
+ settledUsd?: number | undefined;
384
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
385
+ changeId?: `chg_${string}` | undefined;
386
+ reportRef?: string | undefined;
387
+ createdAt: string;
388
+ } & {
389
+ waitingForMessages?: false;
390
+ needsHumanAction?: never;
391
+ needsHumanNotifiedAt?: never;
392
+ } & {
393
+ stalledAt?: never;
394
+ stalledReason?: never;
395
+ } & {
396
+ failureReceiptId?: never;
397
+ } & {
398
+ state: "queued";
399
+ workResult?: {
400
+ output: JsonValue;
401
+ completedAt: string;
402
+ };
403
+ } & {
404
+ question: {
405
+ text: string;
406
+ options: readonly string[];
407
+ closingOptions?: readonly string[] | undefined;
408
+ answer?: string | undefined;
409
+ answeredBy?: string | undefined;
410
+ };
411
+ questionTaskId?: never;
412
+ parentTaskAttempt?: never;
413
+ parentTaskId?: `task_${string}`;
414
+ }) | ({
415
+ id: `task_${string}`;
416
+ schemaVersion: 1;
417
+ replyTo: {
418
+ channel: string;
419
+ address: string;
420
+ };
421
+ attempt: number;
422
+ updatedAt: string;
423
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
424
+ kind: TaskKind;
425
+ area?: string | undefined;
426
+ approval?: "required" | "granted" | "denied" | undefined;
427
+ origin: {
428
+ signalId?: `sig_${string}` | undefined;
429
+ operator?: string | undefined;
430
+ };
431
+ work: {
432
+ title: string;
433
+ input: JsonValue;
434
+ completionCriteria: readonly string[];
435
+ workflow: {
436
+ id: string;
437
+ version: number;
438
+ } & z.core.$brand<"WorkflowBinding">;
439
+ route?: ({
440
+ id: string;
441
+ version: number;
442
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
443
+ };
444
+ workflowPhase?: string | undefined;
445
+ rootTaskId: `task_${string}`;
446
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
447
+ execution?: {
448
+ provider: string;
449
+ sessionId: string;
450
+ environmentId?: string | undefined;
451
+ harness?: string | undefined;
452
+ traceId?: string | undefined;
453
+ } | undefined;
454
+ lastProgressAt?: string | undefined;
455
+ reservedUsd?: number | undefined;
456
+ reservedAt?: string | undefined;
457
+ usage?: {
458
+ costUsd: number;
459
+ inputTokens: number;
460
+ outputTokens: number;
461
+ cacheReadTokens: number;
462
+ cacheWriteTokens: number;
463
+ steps: Record<string, number>;
464
+ } | undefined;
465
+ settledUsd?: number | undefined;
466
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
467
+ changeId?: `chg_${string}` | undefined;
468
+ reportRef?: string | undefined;
469
+ createdAt: string;
470
+ } & {
471
+ waitingForMessages?: false;
472
+ needsHumanAction?: never;
473
+ needsHumanNotifiedAt?: never;
474
+ } & {
475
+ stalledAt?: never;
476
+ stalledReason?: never;
477
+ } & {
478
+ failureReceiptId?: never;
479
+ } & {
480
+ state: "queued";
481
+ workResult?: {
482
+ output: JsonValue;
483
+ completedAt: string;
484
+ };
485
+ } & {
486
+ question: {
487
+ text: string;
488
+ options: readonly string[];
489
+ closingOptions?: readonly string[] | undefined;
490
+ answer?: string | undefined;
491
+ answeredBy?: string | undefined;
492
+ };
493
+ questionTaskId?: never;
494
+ parentTaskAttempt: number;
495
+ parentTaskId: `task_${string}`;
496
+ }) | ({
497
+ id: `task_${string}`;
498
+ schemaVersion: 1;
499
+ replyTo: {
500
+ channel: string;
501
+ address: string;
502
+ };
503
+ attempt: number;
504
+ updatedAt: string;
505
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
506
+ kind: TaskKind;
507
+ area?: string | undefined;
508
+ approval?: "required" | "granted" | "denied" | undefined;
509
+ origin: {
510
+ signalId?: `sig_${string}` | undefined;
511
+ operator?: string | undefined;
512
+ };
513
+ work: {
514
+ title: string;
515
+ input: JsonValue;
516
+ completionCriteria: readonly string[];
517
+ workflow: {
518
+ id: string;
519
+ version: number;
520
+ } & z.core.$brand<"WorkflowBinding">;
521
+ route?: ({
522
+ id: string;
523
+ version: number;
524
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
525
+ };
526
+ workflowPhase?: string | undefined;
527
+ rootTaskId: `task_${string}`;
528
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
529
+ execution?: {
530
+ provider: string;
531
+ sessionId: string;
532
+ environmentId?: string | undefined;
533
+ harness?: string | undefined;
534
+ traceId?: string | undefined;
535
+ } | undefined;
536
+ lastProgressAt?: string | undefined;
537
+ reservedUsd?: number | undefined;
538
+ reservedAt?: string | undefined;
539
+ usage?: {
540
+ costUsd: number;
541
+ inputTokens: number;
542
+ outputTokens: number;
543
+ cacheReadTokens: number;
544
+ cacheWriteTokens: number;
545
+ steps: Record<string, number>;
546
+ } | undefined;
547
+ settledUsd?: number | undefined;
548
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
549
+ changeId?: `chg_${string}` | undefined;
550
+ reportRef?: string | undefined;
551
+ createdAt: string;
552
+ } & {
553
+ waitingForMessages?: false;
554
+ needsHumanAction?: never;
555
+ needsHumanNotifiedAt?: never;
556
+ } & {
557
+ stalledAt?: never;
558
+ stalledReason?: never;
559
+ } & {
560
+ failureReceiptId?: never;
561
+ } & {
562
+ state: "queued";
563
+ workResult?: {
564
+ output: JsonValue;
565
+ completedAt: string;
566
+ };
567
+ } & {
568
+ question?: never;
569
+ questionTaskId: `task_${string}`;
570
+ parentTaskAttempt?: never;
571
+ parentTaskId?: `task_${string}`;
572
+ }), {
573
+ schemaVersion: 1;
574
+ id: string;
575
+ repositoryIds: readonly [string, ...string[]];
576
+ kind: unknown;
577
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
578
+ origin: {
579
+ signalId?: string | undefined;
580
+ operator?: string | undefined;
581
+ };
582
+ work: {
583
+ title: string;
584
+ input: JsonValue;
585
+ completionCriteria: readonly string[];
586
+ workflow: {
587
+ id: string;
588
+ version: number;
589
+ };
590
+ route?: {
591
+ id: string;
592
+ version: number;
593
+ } | undefined;
594
+ };
595
+ rootTaskId: string;
596
+ replyTo: {
597
+ channel: string;
598
+ address: string;
599
+ };
600
+ attempt: number;
601
+ createdAt: string;
602
+ updatedAt: string;
603
+ area?: string | undefined;
604
+ approval?: "required" | "granted" | "denied" | undefined;
605
+ workResult?: {
606
+ output: JsonValue;
607
+ completedAt: string;
608
+ } | undefined;
609
+ waitingForMessages?: boolean | undefined;
610
+ workflowPhase?: string | undefined;
611
+ parentTaskId?: string | undefined;
612
+ parentTaskAttempt?: number | undefined;
613
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
614
+ failureReceiptId?: string | undefined;
615
+ execution?: {
616
+ provider: string;
617
+ sessionId: string;
618
+ environmentId?: string | undefined;
619
+ harness?: string | undefined;
620
+ traceId?: string | undefined;
621
+ } | undefined;
622
+ lastProgressAt?: string | undefined;
623
+ stalledAt?: string | undefined;
624
+ stalledReason?: string | undefined;
625
+ needsHumanAction?: string | undefined;
626
+ needsHumanNotifiedAt?: string | undefined;
627
+ reservedUsd?: number | undefined;
628
+ reservedAt?: string | undefined;
629
+ usage?: {
630
+ costUsd: number;
631
+ inputTokens: number;
632
+ outputTokens: number;
633
+ cacheReadTokens: number;
634
+ cacheWriteTokens: number;
635
+ steps: Record<string, number>;
636
+ } | undefined;
637
+ settledUsd?: number | undefined;
638
+ question?: {
639
+ text: string;
640
+ options: readonly string[];
641
+ closingOptions?: readonly string[] | undefined;
642
+ answer?: string | undefined;
643
+ answeredBy?: string | undefined;
644
+ } | undefined;
645
+ questionTaskId?: string | undefined;
646
+ answerEventIds?: readonly string[] | undefined;
647
+ changeId?: string | undefined;
648
+ reportRef?: string | undefined;
649
+ }, z.core.$ZodTypeInternals<({
650
+ id: `task_${string}`;
651
+ schemaVersion: 1;
652
+ replyTo: {
653
+ channel: string;
654
+ address: string;
655
+ };
656
+ attempt: number;
657
+ updatedAt: string;
658
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
659
+ kind: TaskKind;
660
+ area?: string | undefined;
661
+ approval?: "required" | "granted" | "denied" | undefined;
662
+ origin: {
663
+ signalId?: `sig_${string}` | undefined;
664
+ operator?: string | undefined;
665
+ };
666
+ work: {
667
+ title: string;
668
+ input: JsonValue;
669
+ completionCriteria: readonly string[];
670
+ workflow: {
671
+ id: string;
672
+ version: number;
673
+ } & z.core.$brand<"WorkflowBinding">;
674
+ route?: ({
675
+ id: string;
676
+ version: number;
677
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
678
+ };
679
+ workflowPhase?: string | undefined;
680
+ rootTaskId: `task_${string}`;
681
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
682
+ execution?: {
683
+ provider: string;
684
+ sessionId: string;
685
+ environmentId?: string | undefined;
686
+ harness?: string | undefined;
687
+ traceId?: string | undefined;
688
+ } | undefined;
689
+ lastProgressAt?: string | undefined;
690
+ reservedUsd?: number | undefined;
691
+ reservedAt?: string | undefined;
692
+ usage?: {
693
+ costUsd: number;
694
+ inputTokens: number;
695
+ outputTokens: number;
696
+ cacheReadTokens: number;
697
+ cacheWriteTokens: number;
698
+ steps: Record<string, number>;
699
+ } | undefined;
700
+ settledUsd?: number | undefined;
701
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
702
+ changeId?: `chg_${string}` | undefined;
703
+ reportRef?: string | undefined;
704
+ createdAt: string;
705
+ } & {
706
+ waitingForMessages?: false;
707
+ needsHumanAction?: never;
708
+ needsHumanNotifiedAt?: never;
709
+ } & {
710
+ stalledAt?: never;
711
+ stalledReason?: never;
712
+ } & {
713
+ failureReceiptId?: never;
714
+ } & {
715
+ state: "queued";
716
+ workResult?: {
717
+ output: JsonValue;
718
+ completedAt: string;
719
+ };
720
+ } & {
721
+ question?: never;
722
+ questionTaskId?: never;
723
+ parentTaskAttempt?: never;
724
+ parentTaskId?: `task_${string}`;
725
+ }) | ({
726
+ id: `task_${string}`;
727
+ schemaVersion: 1;
728
+ replyTo: {
729
+ channel: string;
730
+ address: string;
731
+ };
732
+ attempt: number;
733
+ updatedAt: string;
734
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
735
+ kind: TaskKind;
736
+ area?: string | undefined;
737
+ approval?: "required" | "granted" | "denied" | undefined;
738
+ origin: {
739
+ signalId?: `sig_${string}` | undefined;
740
+ operator?: string | undefined;
741
+ };
742
+ work: {
743
+ title: string;
744
+ input: JsonValue;
745
+ completionCriteria: readonly string[];
746
+ workflow: {
747
+ id: string;
748
+ version: number;
749
+ } & z.core.$brand<"WorkflowBinding">;
750
+ route?: ({
751
+ id: string;
752
+ version: number;
753
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
754
+ };
755
+ workflowPhase?: string | undefined;
756
+ rootTaskId: `task_${string}`;
757
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
758
+ execution?: {
759
+ provider: string;
760
+ sessionId: string;
761
+ environmentId?: string | undefined;
762
+ harness?: string | undefined;
763
+ traceId?: string | undefined;
764
+ } | undefined;
765
+ lastProgressAt?: string | undefined;
766
+ reservedUsd?: number | undefined;
767
+ reservedAt?: string | undefined;
768
+ usage?: {
769
+ costUsd: number;
770
+ inputTokens: number;
771
+ outputTokens: number;
772
+ cacheReadTokens: number;
773
+ cacheWriteTokens: number;
774
+ steps: Record<string, number>;
775
+ } | undefined;
776
+ settledUsd?: number | undefined;
777
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
778
+ changeId?: `chg_${string}` | undefined;
779
+ reportRef?: string | undefined;
780
+ createdAt: string;
781
+ } & {
782
+ waitingForMessages?: false;
783
+ needsHumanAction?: never;
784
+ needsHumanNotifiedAt?: never;
785
+ } & {
786
+ stalledAt?: never;
787
+ stalledReason?: never;
788
+ } & {
789
+ failureReceiptId?: never;
790
+ } & {
791
+ state: "queued";
792
+ workResult?: {
793
+ output: JsonValue;
794
+ completedAt: string;
795
+ };
796
+ } & {
797
+ question: {
798
+ text: string;
799
+ options: readonly string[];
800
+ closingOptions?: readonly string[] | undefined;
801
+ answer?: string | undefined;
802
+ answeredBy?: string | undefined;
803
+ };
804
+ questionTaskId?: never;
805
+ parentTaskAttempt?: never;
806
+ parentTaskId?: `task_${string}`;
807
+ }) | ({
808
+ id: `task_${string}`;
809
+ schemaVersion: 1;
810
+ replyTo: {
811
+ channel: string;
812
+ address: string;
813
+ };
814
+ attempt: number;
815
+ updatedAt: string;
816
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
817
+ kind: TaskKind;
818
+ area?: string | undefined;
819
+ approval?: "required" | "granted" | "denied" | undefined;
820
+ origin: {
821
+ signalId?: `sig_${string}` | undefined;
822
+ operator?: string | undefined;
823
+ };
824
+ work: {
825
+ title: string;
826
+ input: JsonValue;
827
+ completionCriteria: readonly string[];
828
+ workflow: {
829
+ id: string;
830
+ version: number;
831
+ } & z.core.$brand<"WorkflowBinding">;
832
+ route?: ({
833
+ id: string;
834
+ version: number;
835
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
836
+ };
837
+ workflowPhase?: string | undefined;
838
+ rootTaskId: `task_${string}`;
839
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
840
+ execution?: {
841
+ provider: string;
842
+ sessionId: string;
843
+ environmentId?: string | undefined;
844
+ harness?: string | undefined;
845
+ traceId?: string | undefined;
846
+ } | undefined;
847
+ lastProgressAt?: string | undefined;
848
+ reservedUsd?: number | undefined;
849
+ reservedAt?: string | undefined;
850
+ usage?: {
851
+ costUsd: number;
852
+ inputTokens: number;
853
+ outputTokens: number;
854
+ cacheReadTokens: number;
855
+ cacheWriteTokens: number;
856
+ steps: Record<string, number>;
857
+ } | undefined;
858
+ settledUsd?: number | undefined;
859
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
860
+ changeId?: `chg_${string}` | undefined;
861
+ reportRef?: string | undefined;
862
+ createdAt: string;
863
+ } & {
864
+ waitingForMessages?: false;
865
+ needsHumanAction?: never;
866
+ needsHumanNotifiedAt?: never;
867
+ } & {
868
+ stalledAt?: never;
869
+ stalledReason?: never;
870
+ } & {
871
+ failureReceiptId?: never;
872
+ } & {
873
+ state: "queued";
874
+ workResult?: {
875
+ output: JsonValue;
876
+ completedAt: string;
877
+ };
878
+ } & {
879
+ question: {
880
+ text: string;
881
+ options: readonly string[];
882
+ closingOptions?: readonly string[] | undefined;
883
+ answer?: string | undefined;
884
+ answeredBy?: string | undefined;
885
+ };
886
+ questionTaskId?: never;
887
+ parentTaskAttempt: number;
888
+ parentTaskId: `task_${string}`;
889
+ }) | ({
890
+ id: `task_${string}`;
891
+ schemaVersion: 1;
892
+ replyTo: {
893
+ channel: string;
894
+ address: string;
895
+ };
896
+ attempt: number;
897
+ updatedAt: string;
898
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
899
+ kind: TaskKind;
900
+ area?: string | undefined;
901
+ approval?: "required" | "granted" | "denied" | undefined;
902
+ origin: {
903
+ signalId?: `sig_${string}` | undefined;
904
+ operator?: string | undefined;
905
+ };
906
+ work: {
907
+ title: string;
908
+ input: JsonValue;
909
+ completionCriteria: readonly string[];
910
+ workflow: {
911
+ id: string;
912
+ version: number;
913
+ } & z.core.$brand<"WorkflowBinding">;
914
+ route?: ({
915
+ id: string;
916
+ version: number;
917
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
918
+ };
919
+ workflowPhase?: string | undefined;
920
+ rootTaskId: `task_${string}`;
921
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
922
+ execution?: {
923
+ provider: string;
924
+ sessionId: string;
925
+ environmentId?: string | undefined;
926
+ harness?: string | undefined;
927
+ traceId?: string | undefined;
928
+ } | undefined;
929
+ lastProgressAt?: string | undefined;
930
+ reservedUsd?: number | undefined;
931
+ reservedAt?: string | undefined;
932
+ usage?: {
933
+ costUsd: number;
934
+ inputTokens: number;
935
+ outputTokens: number;
936
+ cacheReadTokens: number;
937
+ cacheWriteTokens: number;
938
+ steps: Record<string, number>;
939
+ } | undefined;
940
+ settledUsd?: number | undefined;
941
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
942
+ changeId?: `chg_${string}` | undefined;
943
+ reportRef?: string | undefined;
944
+ createdAt: string;
945
+ } & {
946
+ waitingForMessages?: false;
947
+ needsHumanAction?: never;
948
+ needsHumanNotifiedAt?: never;
949
+ } & {
950
+ stalledAt?: never;
951
+ stalledReason?: never;
952
+ } & {
953
+ failureReceiptId?: never;
954
+ } & {
955
+ state: "queued";
956
+ workResult?: {
957
+ output: JsonValue;
958
+ completedAt: string;
959
+ };
960
+ } & {
961
+ question?: never;
962
+ questionTaskId: `task_${string}`;
963
+ parentTaskAttempt?: never;
964
+ parentTaskId?: `task_${string}`;
965
+ }), {
966
+ schemaVersion: 1;
967
+ id: string;
968
+ repositoryIds: readonly [string, ...string[]];
969
+ kind: unknown;
970
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
971
+ origin: {
972
+ signalId?: string | undefined;
973
+ operator?: string | undefined;
974
+ };
975
+ work: {
976
+ title: string;
977
+ input: JsonValue;
978
+ completionCriteria: readonly string[];
979
+ workflow: {
980
+ id: string;
981
+ version: number;
982
+ };
983
+ route?: {
984
+ id: string;
985
+ version: number;
986
+ } | undefined;
987
+ };
988
+ rootTaskId: string;
989
+ replyTo: {
990
+ channel: string;
991
+ address: string;
992
+ };
993
+ attempt: number;
994
+ createdAt: string;
995
+ updatedAt: string;
996
+ area?: string | undefined;
997
+ approval?: "required" | "granted" | "denied" | undefined;
998
+ workResult?: {
999
+ output: JsonValue;
1000
+ completedAt: string;
1001
+ } | undefined;
1002
+ waitingForMessages?: boolean | undefined;
1003
+ workflowPhase?: string | undefined;
1004
+ parentTaskId?: string | undefined;
1005
+ parentTaskAttempt?: number | undefined;
1006
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
1007
+ failureReceiptId?: string | undefined;
1008
+ execution?: {
1009
+ provider: string;
1010
+ sessionId: string;
1011
+ environmentId?: string | undefined;
1012
+ harness?: string | undefined;
1013
+ traceId?: string | undefined;
1014
+ } | undefined;
1015
+ lastProgressAt?: string | undefined;
1016
+ stalledAt?: string | undefined;
1017
+ stalledReason?: string | undefined;
1018
+ needsHumanAction?: string | undefined;
1019
+ needsHumanNotifiedAt?: string | undefined;
1020
+ reservedUsd?: number | undefined;
1021
+ reservedAt?: string | undefined;
1022
+ usage?: {
1023
+ costUsd: number;
1024
+ inputTokens: number;
1025
+ outputTokens: number;
1026
+ cacheReadTokens: number;
1027
+ cacheWriteTokens: number;
1028
+ steps: Record<string, number>;
1029
+ } | undefined;
1030
+ settledUsd?: number | undefined;
1031
+ question?: {
1032
+ text: string;
1033
+ options: readonly string[];
1034
+ closingOptions?: readonly string[] | undefined;
1035
+ answer?: string | undefined;
1036
+ answeredBy?: string | undefined;
1037
+ } | undefined;
1038
+ questionTaskId?: string | undefined;
1039
+ answerEventIds?: readonly string[] | undefined;
1040
+ changeId?: string | undefined;
1041
+ reportRef?: string | undefined;
1042
+ }>>;
1043
+ /** Validates one Task's membership, ownership, dependencies, and admission intent. */
1044
+ declare const taskGraphNodeSchema: z.ZodObject<{
1045
+ taskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
1046
+ parentTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
1047
+ dependencies: z.ZodReadonly<z.ZodArray<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>>;
1048
+ sealed: z.ZodBoolean;
1049
+ admission: Omit<z.ZodObject<{
1050
+ schemaVersion: z.ZodLiteral<1>;
1051
+ id: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
1052
+ repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
1053
+ kind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
1054
+ area: z.ZodOptional<z.ZodString>;
1055
+ state: z.ZodEnum<{
1056
+ queued: "queued";
1057
+ running: "running";
1058
+ stalled: "stalled";
1059
+ verifying: "verifying";
1060
+ succeeded: "succeeded";
1061
+ failed: "failed";
1062
+ needs_human: "needs_human";
1063
+ cancelled: "cancelled";
1064
+ }>;
1065
+ approval: z.ZodOptional<z.ZodEnum<{
1066
+ required: "required";
1067
+ granted: "granted";
1068
+ denied: "denied";
1069
+ }>>;
1070
+ origin: z.ZodObject<{
1071
+ signalId: z.ZodOptional<z.ZodType<`sig_${string}`, string, z.core.$ZodTypeInternals<`sig_${string}`, string>>>;
1072
+ operator: z.ZodOptional<z.ZodString>;
1073
+ }, z.core.$strict>;
1074
+ work: z.ZodObject<{
1075
+ title: z.ZodString;
1076
+ input: z.ZodCustom<JsonValue, JsonValue>;
1077
+ completionCriteria: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1078
+ workflow: z.core.$ZodBranded<z.ZodObject<{
1079
+ id: z.ZodString;
1080
+ version: z.ZodNumber;
1081
+ }, z.core.$strict>, "WorkflowBinding", "out">;
1082
+ route: z.ZodOptional<z.core.$ZodBranded<z.ZodObject<{
1083
+ id: z.ZodString;
1084
+ version: z.ZodNumber;
1085
+ }, z.core.$strict>, "AgentRouteBinding", "out">>;
1086
+ }, z.core.$strict>;
1087
+ workResult: z.ZodOptional<z.ZodObject<{
1088
+ output: z.ZodCustom<JsonValue, JsonValue>;
1089
+ completedAt: z.ZodISODateTime;
1090
+ }, z.core.$strict>>;
1091
+ waitingForMessages: z.ZodOptional<z.ZodBoolean>;
1092
+ workflowPhase: z.ZodOptional<z.ZodString>;
1093
+ rootTaskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
1094
+ parentTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
1095
+ parentTaskAttempt: z.ZodOptional<z.ZodNumber>;
1096
+ replyTo: z.ZodObject<{
1097
+ channel: z.ZodString;
1098
+ address: z.ZodString;
1099
+ }, z.core.$strict>;
1100
+ pendingCommunicationReceiptIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>>>>;
1101
+ failureReceiptId: z.ZodOptional<z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>>;
1102
+ attempt: z.ZodNumber;
1103
+ execution: z.ZodOptional<z.ZodObject<{
1104
+ provider: z.ZodString;
1105
+ sessionId: z.ZodString;
1106
+ environmentId: z.ZodOptional<z.ZodString>;
1107
+ harness: z.ZodOptional<z.ZodString>;
1108
+ traceId: z.ZodOptional<z.ZodString>;
1109
+ }, z.core.$strict>>;
1110
+ lastProgressAt: z.ZodOptional<z.ZodISODateTime>;
1111
+ stalledAt: z.ZodOptional<z.ZodISODateTime>;
1112
+ stalledReason: z.ZodOptional<z.ZodString>;
1113
+ needsHumanAction: z.ZodOptional<z.ZodString>;
1114
+ needsHumanNotifiedAt: z.ZodOptional<z.ZodISODateTime>;
1115
+ reservedUsd: z.ZodOptional<z.ZodNumber>;
1116
+ reservedAt: z.ZodOptional<z.ZodISODateTime>;
1117
+ usage: z.ZodOptional<z.ZodObject<{
1118
+ costUsd: z.ZodNumber;
1119
+ inputTokens: z.ZodNumber;
1120
+ outputTokens: z.ZodNumber;
1121
+ cacheReadTokens: z.ZodNumber;
1122
+ cacheWriteTokens: z.ZodNumber;
1123
+ steps: z.ZodRecord<z.ZodString, z.ZodNumber>;
1124
+ }, z.core.$strict>>;
1125
+ settledUsd: z.ZodOptional<z.ZodNumber>;
1126
+ question: z.ZodOptional<z.ZodObject<{
1127
+ text: z.ZodString;
1128
+ options: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1129
+ closingOptions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1130
+ answer: z.ZodOptional<z.ZodString>;
1131
+ answeredBy: z.ZodOptional<z.ZodString>;
1132
+ }, z.core.$strict>>;
1133
+ questionTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
1134
+ answerEventIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<`ans_${string}`, string, z.core.$ZodTypeInternals<`ans_${string}`, string>>>>>;
1135
+ changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
1136
+ reportRef: z.ZodOptional<z.ZodString>;
1137
+ createdAt: z.ZodISODateTime;
1138
+ updatedAt: z.ZodISODateTime;
1139
+ }, z.core.$strict>, keyof z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>> & z.ZodType<Task, {
1140
+ schemaVersion: 1;
1141
+ id: string;
1142
+ repositoryIds: readonly [string, ...string[]];
1143
+ kind: unknown;
1144
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
1145
+ origin: {
1146
+ signalId?: string | undefined;
1147
+ operator?: string | undefined;
1148
+ };
1149
+ work: {
1150
+ title: string;
1151
+ input: JsonValue;
1152
+ completionCriteria: readonly string[];
1153
+ workflow: {
1154
+ id: string;
1155
+ version: number;
1156
+ };
1157
+ route?: {
1158
+ id: string;
1159
+ version: number;
1160
+ } | undefined;
1161
+ };
1162
+ rootTaskId: string;
1163
+ replyTo: {
1164
+ channel: string;
1165
+ address: string;
1166
+ };
1167
+ attempt: number;
1168
+ createdAt: string;
1169
+ updatedAt: string;
1170
+ area?: string | undefined;
1171
+ approval?: "required" | "granted" | "denied" | undefined;
1172
+ workResult?: {
1173
+ output: JsonValue;
1174
+ completedAt: string;
1175
+ } | undefined;
1176
+ waitingForMessages?: boolean | undefined;
1177
+ workflowPhase?: string | undefined;
1178
+ parentTaskId?: string | undefined;
1179
+ parentTaskAttempt?: number | undefined;
1180
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
1181
+ failureReceiptId?: string | undefined;
1182
+ execution?: {
1183
+ provider: string;
1184
+ sessionId: string;
1185
+ environmentId?: string | undefined;
1186
+ harness?: string | undefined;
1187
+ traceId?: string | undefined;
1188
+ } | undefined;
1189
+ lastProgressAt?: string | undefined;
1190
+ stalledAt?: string | undefined;
1191
+ stalledReason?: string | undefined;
1192
+ needsHumanAction?: string | undefined;
1193
+ needsHumanNotifiedAt?: string | undefined;
1194
+ reservedUsd?: number | undefined;
1195
+ reservedAt?: string | undefined;
1196
+ usage?: {
1197
+ costUsd: number;
1198
+ inputTokens: number;
1199
+ outputTokens: number;
1200
+ cacheReadTokens: number;
1201
+ cacheWriteTokens: number;
1202
+ steps: Record<string, number>;
1203
+ } | undefined;
1204
+ settledUsd?: number | undefined;
1205
+ question?: {
1206
+ text: string;
1207
+ options: readonly string[];
1208
+ closingOptions?: readonly string[] | undefined;
1209
+ answer?: string | undefined;
1210
+ answeredBy?: string | undefined;
1211
+ } | undefined;
1212
+ questionTaskId?: string | undefined;
1213
+ answerEventIds?: readonly string[] | undefined;
1214
+ changeId?: string | undefined;
1215
+ reportRef?: string | undefined;
1216
+ }, z.core.$ZodTypeInternals<Task, {
1217
+ schemaVersion: 1;
1218
+ id: string;
1219
+ repositoryIds: readonly [string, ...string[]];
1220
+ kind: unknown;
1221
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
1222
+ origin: {
1223
+ signalId?: string | undefined;
1224
+ operator?: string | undefined;
1225
+ };
1226
+ work: {
1227
+ title: string;
1228
+ input: JsonValue;
1229
+ completionCriteria: readonly string[];
1230
+ workflow: {
1231
+ id: string;
1232
+ version: number;
1233
+ };
1234
+ route?: {
1235
+ id: string;
1236
+ version: number;
1237
+ } | undefined;
1238
+ };
1239
+ rootTaskId: string;
1240
+ replyTo: {
1241
+ channel: string;
1242
+ address: string;
1243
+ };
1244
+ attempt: number;
1245
+ createdAt: string;
1246
+ updatedAt: string;
1247
+ area?: string | undefined;
1248
+ approval?: "required" | "granted" | "denied" | undefined;
1249
+ workResult?: {
1250
+ output: JsonValue;
1251
+ completedAt: string;
1252
+ } | undefined;
1253
+ waitingForMessages?: boolean | undefined;
1254
+ workflowPhase?: string | undefined;
1255
+ parentTaskId?: string | undefined;
1256
+ parentTaskAttempt?: number | undefined;
1257
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
1258
+ failureReceiptId?: string | undefined;
1259
+ execution?: {
1260
+ provider: string;
1261
+ sessionId: string;
1262
+ environmentId?: string | undefined;
1263
+ harness?: string | undefined;
1264
+ traceId?: string | undefined;
1265
+ } | undefined;
1266
+ lastProgressAt?: string | undefined;
1267
+ stalledAt?: string | undefined;
1268
+ stalledReason?: string | undefined;
1269
+ needsHumanAction?: string | undefined;
1270
+ needsHumanNotifiedAt?: string | undefined;
1271
+ reservedUsd?: number | undefined;
1272
+ reservedAt?: string | undefined;
1273
+ usage?: {
1274
+ costUsd: number;
1275
+ inputTokens: number;
1276
+ outputTokens: number;
1277
+ cacheReadTokens: number;
1278
+ cacheWriteTokens: number;
1279
+ steps: Record<string, number>;
1280
+ } | undefined;
1281
+ settledUsd?: number | undefined;
1282
+ question?: {
1283
+ text: string;
1284
+ options: readonly string[];
1285
+ closingOptions?: readonly string[] | undefined;
1286
+ answer?: string | undefined;
1287
+ answeredBy?: string | undefined;
1288
+ } | undefined;
1289
+ questionTaskId?: string | undefined;
1290
+ answerEventIds?: readonly string[] | undefined;
1291
+ changeId?: string | undefined;
1292
+ reportRef?: string | undefined;
1293
+ }>> & z.ZodType<({
1294
+ id: `task_${string}`;
1295
+ schemaVersion: 1;
1296
+ replyTo: {
1297
+ channel: string;
1298
+ address: string;
1299
+ };
1300
+ attempt: number;
1301
+ updatedAt: string;
1302
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1303
+ kind: TaskKind;
1304
+ area?: string | undefined;
1305
+ approval?: "required" | "granted" | "denied" | undefined;
1306
+ origin: {
1307
+ signalId?: `sig_${string}` | undefined;
1308
+ operator?: string | undefined;
1309
+ };
1310
+ work: {
1311
+ title: string;
1312
+ input: JsonValue;
1313
+ completionCriteria: readonly string[];
1314
+ workflow: {
1315
+ id: string;
1316
+ version: number;
1317
+ } & z.core.$brand<"WorkflowBinding">;
1318
+ route?: ({
1319
+ id: string;
1320
+ version: number;
1321
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1322
+ };
1323
+ workflowPhase?: string | undefined;
1324
+ rootTaskId: `task_${string}`;
1325
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1326
+ execution?: {
1327
+ provider: string;
1328
+ sessionId: string;
1329
+ environmentId?: string | undefined;
1330
+ harness?: string | undefined;
1331
+ traceId?: string | undefined;
1332
+ } | undefined;
1333
+ lastProgressAt?: string | undefined;
1334
+ reservedUsd?: number | undefined;
1335
+ reservedAt?: string | undefined;
1336
+ usage?: {
1337
+ costUsd: number;
1338
+ inputTokens: number;
1339
+ outputTokens: number;
1340
+ cacheReadTokens: number;
1341
+ cacheWriteTokens: number;
1342
+ steps: Record<string, number>;
1343
+ } | undefined;
1344
+ settledUsd?: number | undefined;
1345
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1346
+ changeId?: `chg_${string}` | undefined;
1347
+ reportRef?: string | undefined;
1348
+ createdAt: string;
1349
+ } & {
1350
+ waitingForMessages?: false;
1351
+ needsHumanAction?: never;
1352
+ needsHumanNotifiedAt?: never;
1353
+ } & {
1354
+ stalledAt?: never;
1355
+ stalledReason?: never;
1356
+ } & {
1357
+ failureReceiptId?: never;
1358
+ } & {
1359
+ state: "queued";
1360
+ workResult?: {
1361
+ output: JsonValue;
1362
+ completedAt: string;
1363
+ };
1364
+ } & {
1365
+ question?: never;
1366
+ questionTaskId?: never;
1367
+ parentTaskAttempt?: never;
1368
+ parentTaskId?: `task_${string}`;
1369
+ }) | ({
1370
+ id: `task_${string}`;
1371
+ schemaVersion: 1;
1372
+ replyTo: {
1373
+ channel: string;
1374
+ address: string;
1375
+ };
1376
+ attempt: number;
1377
+ updatedAt: string;
1378
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1379
+ kind: TaskKind;
1380
+ area?: string | undefined;
1381
+ approval?: "required" | "granted" | "denied" | undefined;
1382
+ origin: {
1383
+ signalId?: `sig_${string}` | undefined;
1384
+ operator?: string | undefined;
1385
+ };
1386
+ work: {
1387
+ title: string;
1388
+ input: JsonValue;
1389
+ completionCriteria: readonly string[];
1390
+ workflow: {
1391
+ id: string;
1392
+ version: number;
1393
+ } & z.core.$brand<"WorkflowBinding">;
1394
+ route?: ({
1395
+ id: string;
1396
+ version: number;
1397
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1398
+ };
1399
+ workflowPhase?: string | undefined;
1400
+ rootTaskId: `task_${string}`;
1401
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1402
+ execution?: {
1403
+ provider: string;
1404
+ sessionId: string;
1405
+ environmentId?: string | undefined;
1406
+ harness?: string | undefined;
1407
+ traceId?: string | undefined;
1408
+ } | undefined;
1409
+ lastProgressAt?: string | undefined;
1410
+ reservedUsd?: number | undefined;
1411
+ reservedAt?: string | undefined;
1412
+ usage?: {
1413
+ costUsd: number;
1414
+ inputTokens: number;
1415
+ outputTokens: number;
1416
+ cacheReadTokens: number;
1417
+ cacheWriteTokens: number;
1418
+ steps: Record<string, number>;
1419
+ } | undefined;
1420
+ settledUsd?: number | undefined;
1421
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1422
+ changeId?: `chg_${string}` | undefined;
1423
+ reportRef?: string | undefined;
1424
+ createdAt: string;
1425
+ } & {
1426
+ waitingForMessages?: false;
1427
+ needsHumanAction?: never;
1428
+ needsHumanNotifiedAt?: never;
1429
+ } & {
1430
+ stalledAt?: never;
1431
+ stalledReason?: never;
1432
+ } & {
1433
+ failureReceiptId?: never;
1434
+ } & {
1435
+ state: "queued";
1436
+ workResult?: {
1437
+ output: JsonValue;
1438
+ completedAt: string;
1439
+ };
1440
+ } & {
1441
+ question: {
1442
+ text: string;
1443
+ options: readonly string[];
1444
+ closingOptions?: readonly string[] | undefined;
1445
+ answer?: string | undefined;
1446
+ answeredBy?: string | undefined;
1447
+ };
1448
+ questionTaskId?: never;
1449
+ parentTaskAttempt?: never;
1450
+ parentTaskId?: `task_${string}`;
1451
+ }) | ({
1452
+ id: `task_${string}`;
1453
+ schemaVersion: 1;
1454
+ replyTo: {
1455
+ channel: string;
1456
+ address: string;
1457
+ };
1458
+ attempt: number;
1459
+ updatedAt: string;
1460
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1461
+ kind: TaskKind;
1462
+ area?: string | undefined;
1463
+ approval?: "required" | "granted" | "denied" | undefined;
1464
+ origin: {
1465
+ signalId?: `sig_${string}` | undefined;
1466
+ operator?: string | undefined;
1467
+ };
1468
+ work: {
1469
+ title: string;
1470
+ input: JsonValue;
1471
+ completionCriteria: readonly string[];
1472
+ workflow: {
1473
+ id: string;
1474
+ version: number;
1475
+ } & z.core.$brand<"WorkflowBinding">;
1476
+ route?: ({
1477
+ id: string;
1478
+ version: number;
1479
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1480
+ };
1481
+ workflowPhase?: string | undefined;
1482
+ rootTaskId: `task_${string}`;
1483
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1484
+ execution?: {
1485
+ provider: string;
1486
+ sessionId: string;
1487
+ environmentId?: string | undefined;
1488
+ harness?: string | undefined;
1489
+ traceId?: string | undefined;
1490
+ } | undefined;
1491
+ lastProgressAt?: string | undefined;
1492
+ reservedUsd?: number | undefined;
1493
+ reservedAt?: string | undefined;
1494
+ usage?: {
1495
+ costUsd: number;
1496
+ inputTokens: number;
1497
+ outputTokens: number;
1498
+ cacheReadTokens: number;
1499
+ cacheWriteTokens: number;
1500
+ steps: Record<string, number>;
1501
+ } | undefined;
1502
+ settledUsd?: number | undefined;
1503
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1504
+ changeId?: `chg_${string}` | undefined;
1505
+ reportRef?: string | undefined;
1506
+ createdAt: string;
1507
+ } & {
1508
+ waitingForMessages?: false;
1509
+ needsHumanAction?: never;
1510
+ needsHumanNotifiedAt?: never;
1511
+ } & {
1512
+ stalledAt?: never;
1513
+ stalledReason?: never;
1514
+ } & {
1515
+ failureReceiptId?: never;
1516
+ } & {
1517
+ state: "queued";
1518
+ workResult?: {
1519
+ output: JsonValue;
1520
+ completedAt: string;
1521
+ };
1522
+ } & {
1523
+ question: {
1524
+ text: string;
1525
+ options: readonly string[];
1526
+ closingOptions?: readonly string[] | undefined;
1527
+ answer?: string | undefined;
1528
+ answeredBy?: string | undefined;
1529
+ };
1530
+ questionTaskId?: never;
1531
+ parentTaskAttempt: number;
1532
+ parentTaskId: `task_${string}`;
1533
+ }) | ({
1534
+ id: `task_${string}`;
1535
+ schemaVersion: 1;
1536
+ replyTo: {
1537
+ channel: string;
1538
+ address: string;
1539
+ };
1540
+ attempt: number;
1541
+ updatedAt: string;
1542
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1543
+ kind: TaskKind;
1544
+ area?: string | undefined;
1545
+ approval?: "required" | "granted" | "denied" | undefined;
1546
+ origin: {
1547
+ signalId?: `sig_${string}` | undefined;
1548
+ operator?: string | undefined;
1549
+ };
1550
+ work: {
1551
+ title: string;
1552
+ input: JsonValue;
1553
+ completionCriteria: readonly string[];
1554
+ workflow: {
1555
+ id: string;
1556
+ version: number;
1557
+ } & z.core.$brand<"WorkflowBinding">;
1558
+ route?: ({
1559
+ id: string;
1560
+ version: number;
1561
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1562
+ };
1563
+ workflowPhase?: string | undefined;
1564
+ rootTaskId: `task_${string}`;
1565
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1566
+ execution?: {
1567
+ provider: string;
1568
+ sessionId: string;
1569
+ environmentId?: string | undefined;
1570
+ harness?: string | undefined;
1571
+ traceId?: string | undefined;
1572
+ } | undefined;
1573
+ lastProgressAt?: string | undefined;
1574
+ reservedUsd?: number | undefined;
1575
+ reservedAt?: string | undefined;
1576
+ usage?: {
1577
+ costUsd: number;
1578
+ inputTokens: number;
1579
+ outputTokens: number;
1580
+ cacheReadTokens: number;
1581
+ cacheWriteTokens: number;
1582
+ steps: Record<string, number>;
1583
+ } | undefined;
1584
+ settledUsd?: number | undefined;
1585
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1586
+ changeId?: `chg_${string}` | undefined;
1587
+ reportRef?: string | undefined;
1588
+ createdAt: string;
1589
+ } & {
1590
+ waitingForMessages?: false;
1591
+ needsHumanAction?: never;
1592
+ needsHumanNotifiedAt?: never;
1593
+ } & {
1594
+ stalledAt?: never;
1595
+ stalledReason?: never;
1596
+ } & {
1597
+ failureReceiptId?: never;
1598
+ } & {
1599
+ state: "queued";
1600
+ workResult?: {
1601
+ output: JsonValue;
1602
+ completedAt: string;
1603
+ };
1604
+ } & {
1605
+ question?: never;
1606
+ questionTaskId: `task_${string}`;
1607
+ parentTaskAttempt?: never;
1608
+ parentTaskId?: `task_${string}`;
1609
+ }), {
1610
+ schemaVersion: 1;
1611
+ id: string;
1612
+ repositoryIds: readonly [string, ...string[]];
1613
+ kind: unknown;
1614
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
1615
+ origin: {
1616
+ signalId?: string | undefined;
1617
+ operator?: string | undefined;
1618
+ };
1619
+ work: {
1620
+ title: string;
1621
+ input: JsonValue;
1622
+ completionCriteria: readonly string[];
1623
+ workflow: {
1624
+ id: string;
1625
+ version: number;
1626
+ };
1627
+ route?: {
1628
+ id: string;
1629
+ version: number;
1630
+ } | undefined;
1631
+ };
1632
+ rootTaskId: string;
1633
+ replyTo: {
1634
+ channel: string;
1635
+ address: string;
1636
+ };
1637
+ attempt: number;
1638
+ createdAt: string;
1639
+ updatedAt: string;
1640
+ area?: string | undefined;
1641
+ approval?: "required" | "granted" | "denied" | undefined;
1642
+ workResult?: {
1643
+ output: JsonValue;
1644
+ completedAt: string;
1645
+ } | undefined;
1646
+ waitingForMessages?: boolean | undefined;
1647
+ workflowPhase?: string | undefined;
1648
+ parentTaskId?: string | undefined;
1649
+ parentTaskAttempt?: number | undefined;
1650
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
1651
+ failureReceiptId?: string | undefined;
1652
+ execution?: {
1653
+ provider: string;
1654
+ sessionId: string;
1655
+ environmentId?: string | undefined;
1656
+ harness?: string | undefined;
1657
+ traceId?: string | undefined;
1658
+ } | undefined;
1659
+ lastProgressAt?: string | undefined;
1660
+ stalledAt?: string | undefined;
1661
+ stalledReason?: string | undefined;
1662
+ needsHumanAction?: string | undefined;
1663
+ needsHumanNotifiedAt?: string | undefined;
1664
+ reservedUsd?: number | undefined;
1665
+ reservedAt?: string | undefined;
1666
+ usage?: {
1667
+ costUsd: number;
1668
+ inputTokens: number;
1669
+ outputTokens: number;
1670
+ cacheReadTokens: number;
1671
+ cacheWriteTokens: number;
1672
+ steps: Record<string, number>;
1673
+ } | undefined;
1674
+ settledUsd?: number | undefined;
1675
+ question?: {
1676
+ text: string;
1677
+ options: readonly string[];
1678
+ closingOptions?: readonly string[] | undefined;
1679
+ answer?: string | undefined;
1680
+ answeredBy?: string | undefined;
1681
+ } | undefined;
1682
+ questionTaskId?: string | undefined;
1683
+ answerEventIds?: readonly string[] | undefined;
1684
+ changeId?: string | undefined;
1685
+ reportRef?: string | undefined;
1686
+ }, z.core.$ZodTypeInternals<({
1687
+ id: `task_${string}`;
1688
+ schemaVersion: 1;
1689
+ replyTo: {
1690
+ channel: string;
1691
+ address: string;
1692
+ };
1693
+ attempt: number;
1694
+ updatedAt: string;
1695
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1696
+ kind: TaskKind;
1697
+ area?: string | undefined;
1698
+ approval?: "required" | "granted" | "denied" | undefined;
1699
+ origin: {
1700
+ signalId?: `sig_${string}` | undefined;
1701
+ operator?: string | undefined;
1702
+ };
1703
+ work: {
1704
+ title: string;
1705
+ input: JsonValue;
1706
+ completionCriteria: readonly string[];
1707
+ workflow: {
1708
+ id: string;
1709
+ version: number;
1710
+ } & z.core.$brand<"WorkflowBinding">;
1711
+ route?: ({
1712
+ id: string;
1713
+ version: number;
1714
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1715
+ };
1716
+ workflowPhase?: string | undefined;
1717
+ rootTaskId: `task_${string}`;
1718
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1719
+ execution?: {
1720
+ provider: string;
1721
+ sessionId: string;
1722
+ environmentId?: string | undefined;
1723
+ harness?: string | undefined;
1724
+ traceId?: string | undefined;
1725
+ } | undefined;
1726
+ lastProgressAt?: string | undefined;
1727
+ reservedUsd?: number | undefined;
1728
+ reservedAt?: string | undefined;
1729
+ usage?: {
1730
+ costUsd: number;
1731
+ inputTokens: number;
1732
+ outputTokens: number;
1733
+ cacheReadTokens: number;
1734
+ cacheWriteTokens: number;
1735
+ steps: Record<string, number>;
1736
+ } | undefined;
1737
+ settledUsd?: number | undefined;
1738
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1739
+ changeId?: `chg_${string}` | undefined;
1740
+ reportRef?: string | undefined;
1741
+ createdAt: string;
1742
+ } & {
1743
+ waitingForMessages?: false;
1744
+ needsHumanAction?: never;
1745
+ needsHumanNotifiedAt?: never;
1746
+ } & {
1747
+ stalledAt?: never;
1748
+ stalledReason?: never;
1749
+ } & {
1750
+ failureReceiptId?: never;
1751
+ } & {
1752
+ state: "queued";
1753
+ workResult?: {
1754
+ output: JsonValue;
1755
+ completedAt: string;
1756
+ };
1757
+ } & {
1758
+ question?: never;
1759
+ questionTaskId?: never;
1760
+ parentTaskAttempt?: never;
1761
+ parentTaskId?: `task_${string}`;
1762
+ }) | ({
1763
+ id: `task_${string}`;
1764
+ schemaVersion: 1;
1765
+ replyTo: {
1766
+ channel: string;
1767
+ address: string;
1768
+ };
1769
+ attempt: number;
1770
+ updatedAt: string;
1771
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1772
+ kind: TaskKind;
1773
+ area?: string | undefined;
1774
+ approval?: "required" | "granted" | "denied" | undefined;
1775
+ origin: {
1776
+ signalId?: `sig_${string}` | undefined;
1777
+ operator?: string | undefined;
1778
+ };
1779
+ work: {
1780
+ title: string;
1781
+ input: JsonValue;
1782
+ completionCriteria: readonly string[];
1783
+ workflow: {
1784
+ id: string;
1785
+ version: number;
1786
+ } & z.core.$brand<"WorkflowBinding">;
1787
+ route?: ({
1788
+ id: string;
1789
+ version: number;
1790
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1791
+ };
1792
+ workflowPhase?: string | undefined;
1793
+ rootTaskId: `task_${string}`;
1794
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1795
+ execution?: {
1796
+ provider: string;
1797
+ sessionId: string;
1798
+ environmentId?: string | undefined;
1799
+ harness?: string | undefined;
1800
+ traceId?: string | undefined;
1801
+ } | undefined;
1802
+ lastProgressAt?: string | undefined;
1803
+ reservedUsd?: number | undefined;
1804
+ reservedAt?: string | undefined;
1805
+ usage?: {
1806
+ costUsd: number;
1807
+ inputTokens: number;
1808
+ outputTokens: number;
1809
+ cacheReadTokens: number;
1810
+ cacheWriteTokens: number;
1811
+ steps: Record<string, number>;
1812
+ } | undefined;
1813
+ settledUsd?: number | undefined;
1814
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1815
+ changeId?: `chg_${string}` | undefined;
1816
+ reportRef?: string | undefined;
1817
+ createdAt: string;
1818
+ } & {
1819
+ waitingForMessages?: false;
1820
+ needsHumanAction?: never;
1821
+ needsHumanNotifiedAt?: never;
1822
+ } & {
1823
+ stalledAt?: never;
1824
+ stalledReason?: never;
1825
+ } & {
1826
+ failureReceiptId?: never;
1827
+ } & {
1828
+ state: "queued";
1829
+ workResult?: {
1830
+ output: JsonValue;
1831
+ completedAt: string;
1832
+ };
1833
+ } & {
1834
+ question: {
1835
+ text: string;
1836
+ options: readonly string[];
1837
+ closingOptions?: readonly string[] | undefined;
1838
+ answer?: string | undefined;
1839
+ answeredBy?: string | undefined;
1840
+ };
1841
+ questionTaskId?: never;
1842
+ parentTaskAttempt?: never;
1843
+ parentTaskId?: `task_${string}`;
1844
+ }) | ({
1845
+ id: `task_${string}`;
1846
+ schemaVersion: 1;
1847
+ replyTo: {
1848
+ channel: string;
1849
+ address: string;
1850
+ };
1851
+ attempt: number;
1852
+ updatedAt: string;
1853
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1854
+ kind: TaskKind;
1855
+ area?: string | undefined;
1856
+ approval?: "required" | "granted" | "denied" | undefined;
1857
+ origin: {
1858
+ signalId?: `sig_${string}` | undefined;
1859
+ operator?: string | undefined;
1860
+ };
1861
+ work: {
1862
+ title: string;
1863
+ input: JsonValue;
1864
+ completionCriteria: readonly string[];
1865
+ workflow: {
1866
+ id: string;
1867
+ version: number;
1868
+ } & z.core.$brand<"WorkflowBinding">;
1869
+ route?: ({
1870
+ id: string;
1871
+ version: number;
1872
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1873
+ };
1874
+ workflowPhase?: string | undefined;
1875
+ rootTaskId: `task_${string}`;
1876
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1877
+ execution?: {
1878
+ provider: string;
1879
+ sessionId: string;
1880
+ environmentId?: string | undefined;
1881
+ harness?: string | undefined;
1882
+ traceId?: string | undefined;
1883
+ } | undefined;
1884
+ lastProgressAt?: string | undefined;
1885
+ reservedUsd?: number | undefined;
1886
+ reservedAt?: string | undefined;
1887
+ usage?: {
1888
+ costUsd: number;
1889
+ inputTokens: number;
1890
+ outputTokens: number;
1891
+ cacheReadTokens: number;
1892
+ cacheWriteTokens: number;
1893
+ steps: Record<string, number>;
1894
+ } | undefined;
1895
+ settledUsd?: number | undefined;
1896
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1897
+ changeId?: `chg_${string}` | undefined;
1898
+ reportRef?: string | undefined;
1899
+ createdAt: string;
1900
+ } & {
1901
+ waitingForMessages?: false;
1902
+ needsHumanAction?: never;
1903
+ needsHumanNotifiedAt?: never;
1904
+ } & {
1905
+ stalledAt?: never;
1906
+ stalledReason?: never;
1907
+ } & {
1908
+ failureReceiptId?: never;
1909
+ } & {
1910
+ state: "queued";
1911
+ workResult?: {
1912
+ output: JsonValue;
1913
+ completedAt: string;
1914
+ };
1915
+ } & {
1916
+ question: {
1917
+ text: string;
1918
+ options: readonly string[];
1919
+ closingOptions?: readonly string[] | undefined;
1920
+ answer?: string | undefined;
1921
+ answeredBy?: string | undefined;
1922
+ };
1923
+ questionTaskId?: never;
1924
+ parentTaskAttempt: number;
1925
+ parentTaskId: `task_${string}`;
1926
+ }) | ({
1927
+ id: `task_${string}`;
1928
+ schemaVersion: 1;
1929
+ replyTo: {
1930
+ channel: string;
1931
+ address: string;
1932
+ };
1933
+ attempt: number;
1934
+ updatedAt: string;
1935
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
1936
+ kind: TaskKind;
1937
+ area?: string | undefined;
1938
+ approval?: "required" | "granted" | "denied" | undefined;
1939
+ origin: {
1940
+ signalId?: `sig_${string}` | undefined;
1941
+ operator?: string | undefined;
1942
+ };
1943
+ work: {
1944
+ title: string;
1945
+ input: JsonValue;
1946
+ completionCriteria: readonly string[];
1947
+ workflow: {
1948
+ id: string;
1949
+ version: number;
1950
+ } & z.core.$brand<"WorkflowBinding">;
1951
+ route?: ({
1952
+ id: string;
1953
+ version: number;
1954
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
1955
+ };
1956
+ workflowPhase?: string | undefined;
1957
+ rootTaskId: `task_${string}`;
1958
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
1959
+ execution?: {
1960
+ provider: string;
1961
+ sessionId: string;
1962
+ environmentId?: string | undefined;
1963
+ harness?: string | undefined;
1964
+ traceId?: string | undefined;
1965
+ } | undefined;
1966
+ lastProgressAt?: string | undefined;
1967
+ reservedUsd?: number | undefined;
1968
+ reservedAt?: string | undefined;
1969
+ usage?: {
1970
+ costUsd: number;
1971
+ inputTokens: number;
1972
+ outputTokens: number;
1973
+ cacheReadTokens: number;
1974
+ cacheWriteTokens: number;
1975
+ steps: Record<string, number>;
1976
+ } | undefined;
1977
+ settledUsd?: number | undefined;
1978
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
1979
+ changeId?: `chg_${string}` | undefined;
1980
+ reportRef?: string | undefined;
1981
+ createdAt: string;
1982
+ } & {
1983
+ waitingForMessages?: false;
1984
+ needsHumanAction?: never;
1985
+ needsHumanNotifiedAt?: never;
1986
+ } & {
1987
+ stalledAt?: never;
1988
+ stalledReason?: never;
1989
+ } & {
1990
+ failureReceiptId?: never;
1991
+ } & {
1992
+ state: "queued";
1993
+ workResult?: {
1994
+ output: JsonValue;
1995
+ completedAt: string;
1996
+ };
1997
+ } & {
1998
+ question?: never;
1999
+ questionTaskId: `task_${string}`;
2000
+ parentTaskAttempt?: never;
2001
+ parentTaskId?: `task_${string}`;
2002
+ }), {
2003
+ schemaVersion: 1;
2004
+ id: string;
2005
+ repositoryIds: readonly [string, ...string[]];
2006
+ kind: unknown;
2007
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
2008
+ origin: {
2009
+ signalId?: string | undefined;
2010
+ operator?: string | undefined;
2011
+ };
2012
+ work: {
2013
+ title: string;
2014
+ input: JsonValue;
2015
+ completionCriteria: readonly string[];
2016
+ workflow: {
2017
+ id: string;
2018
+ version: number;
2019
+ };
2020
+ route?: {
2021
+ id: string;
2022
+ version: number;
2023
+ } | undefined;
2024
+ };
2025
+ rootTaskId: string;
2026
+ replyTo: {
2027
+ channel: string;
2028
+ address: string;
2029
+ };
2030
+ attempt: number;
2031
+ createdAt: string;
2032
+ updatedAt: string;
2033
+ area?: string | undefined;
2034
+ approval?: "required" | "granted" | "denied" | undefined;
2035
+ workResult?: {
2036
+ output: JsonValue;
2037
+ completedAt: string;
2038
+ } | undefined;
2039
+ waitingForMessages?: boolean | undefined;
2040
+ workflowPhase?: string | undefined;
2041
+ parentTaskId?: string | undefined;
2042
+ parentTaskAttempt?: number | undefined;
2043
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
2044
+ failureReceiptId?: string | undefined;
2045
+ execution?: {
2046
+ provider: string;
2047
+ sessionId: string;
2048
+ environmentId?: string | undefined;
2049
+ harness?: string | undefined;
2050
+ traceId?: string | undefined;
2051
+ } | undefined;
2052
+ lastProgressAt?: string | undefined;
2053
+ stalledAt?: string | undefined;
2054
+ stalledReason?: string | undefined;
2055
+ needsHumanAction?: string | undefined;
2056
+ needsHumanNotifiedAt?: string | undefined;
2057
+ reservedUsd?: number | undefined;
2058
+ reservedAt?: string | undefined;
2059
+ usage?: {
2060
+ costUsd: number;
2061
+ inputTokens: number;
2062
+ outputTokens: number;
2063
+ cacheReadTokens: number;
2064
+ cacheWriteTokens: number;
2065
+ steps: Record<string, number>;
2066
+ } | undefined;
2067
+ settledUsd?: number | undefined;
2068
+ question?: {
2069
+ text: string;
2070
+ options: readonly string[];
2071
+ closingOptions?: readonly string[] | undefined;
2072
+ answer?: string | undefined;
2073
+ answeredBy?: string | undefined;
2074
+ } | undefined;
2075
+ questionTaskId?: string | undefined;
2076
+ answerEventIds?: readonly string[] | undefined;
2077
+ changeId?: string | undefined;
2078
+ reportRef?: string | undefined;
2079
+ }>>;
2080
+ admissionDependencies: z.ZodReadonly<z.ZodArray<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>>;
2081
+ }, z.core.$strict>;
2082
+ /** Canonical graph membership and dependency record for one Task. */
2083
+ type TaskGraphNode = z.infer<typeof taskGraphNodeSchema>;
2084
+ /** Validates a bounded, acyclic canonical Task graph owned by one root Task. */
2085
+ declare const taskGraphSchema: z.ZodObject<{
2086
+ schemaVersion: z.ZodLiteral<1>;
2087
+ rootTaskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
2088
+ revision: z.ZodNumber;
2089
+ nodes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
2090
+ taskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
2091
+ parentTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
2092
+ dependencies: z.ZodReadonly<z.ZodArray<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>>;
2093
+ sealed: z.ZodBoolean;
2094
+ admission: Omit<z.ZodObject<{
2095
+ schemaVersion: z.ZodLiteral<1>;
2096
+ id: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
2097
+ repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
2098
+ kind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
2099
+ area: z.ZodOptional<z.ZodString>;
2100
+ state: z.ZodEnum<{
2101
+ queued: "queued";
2102
+ running: "running";
2103
+ stalled: "stalled";
2104
+ verifying: "verifying";
2105
+ succeeded: "succeeded";
2106
+ failed: "failed";
2107
+ needs_human: "needs_human";
2108
+ cancelled: "cancelled";
2109
+ }>;
2110
+ approval: z.ZodOptional<z.ZodEnum<{
2111
+ required: "required";
2112
+ granted: "granted";
2113
+ denied: "denied";
2114
+ }>>;
2115
+ origin: z.ZodObject<{
2116
+ signalId: z.ZodOptional<z.ZodType<`sig_${string}`, string, z.core.$ZodTypeInternals<`sig_${string}`, string>>>;
2117
+ operator: z.ZodOptional<z.ZodString>;
2118
+ }, z.core.$strict>;
2119
+ work: z.ZodObject<{
2120
+ title: z.ZodString;
2121
+ input: z.ZodCustom<JsonValue, JsonValue>;
2122
+ completionCriteria: z.ZodReadonly<z.ZodArray<z.ZodString>>;
2123
+ workflow: z.core.$ZodBranded<z.ZodObject<{
2124
+ id: z.ZodString;
2125
+ version: z.ZodNumber;
2126
+ }, z.core.$strict>, "WorkflowBinding", "out">;
2127
+ route: z.ZodOptional<z.core.$ZodBranded<z.ZodObject<{
2128
+ id: z.ZodString;
2129
+ version: z.ZodNumber;
2130
+ }, z.core.$strict>, "AgentRouteBinding", "out">>;
2131
+ }, z.core.$strict>;
2132
+ workResult: z.ZodOptional<z.ZodObject<{
2133
+ output: z.ZodCustom<JsonValue, JsonValue>;
2134
+ completedAt: z.ZodISODateTime;
2135
+ }, z.core.$strict>>;
2136
+ waitingForMessages: z.ZodOptional<z.ZodBoolean>;
2137
+ workflowPhase: z.ZodOptional<z.ZodString>;
2138
+ rootTaskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
2139
+ parentTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
2140
+ parentTaskAttempt: z.ZodOptional<z.ZodNumber>;
2141
+ replyTo: z.ZodObject<{
2142
+ channel: z.ZodString;
2143
+ address: z.ZodString;
2144
+ }, z.core.$strict>;
2145
+ pendingCommunicationReceiptIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>>>>;
2146
+ failureReceiptId: z.ZodOptional<z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>>;
2147
+ attempt: z.ZodNumber;
2148
+ execution: z.ZodOptional<z.ZodObject<{
2149
+ provider: z.ZodString;
2150
+ sessionId: z.ZodString;
2151
+ environmentId: z.ZodOptional<z.ZodString>;
2152
+ harness: z.ZodOptional<z.ZodString>;
2153
+ traceId: z.ZodOptional<z.ZodString>;
2154
+ }, z.core.$strict>>;
2155
+ lastProgressAt: z.ZodOptional<z.ZodISODateTime>;
2156
+ stalledAt: z.ZodOptional<z.ZodISODateTime>;
2157
+ stalledReason: z.ZodOptional<z.ZodString>;
2158
+ needsHumanAction: z.ZodOptional<z.ZodString>;
2159
+ needsHumanNotifiedAt: z.ZodOptional<z.ZodISODateTime>;
2160
+ reservedUsd: z.ZodOptional<z.ZodNumber>;
2161
+ reservedAt: z.ZodOptional<z.ZodISODateTime>;
2162
+ usage: z.ZodOptional<z.ZodObject<{
2163
+ costUsd: z.ZodNumber;
2164
+ inputTokens: z.ZodNumber;
2165
+ outputTokens: z.ZodNumber;
2166
+ cacheReadTokens: z.ZodNumber;
2167
+ cacheWriteTokens: z.ZodNumber;
2168
+ steps: z.ZodRecord<z.ZodString, z.ZodNumber>;
2169
+ }, z.core.$strict>>;
2170
+ settledUsd: z.ZodOptional<z.ZodNumber>;
2171
+ question: z.ZodOptional<z.ZodObject<{
2172
+ text: z.ZodString;
2173
+ options: z.ZodReadonly<z.ZodArray<z.ZodString>>;
2174
+ closingOptions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
2175
+ answer: z.ZodOptional<z.ZodString>;
2176
+ answeredBy: z.ZodOptional<z.ZodString>;
2177
+ }, z.core.$strict>>;
2178
+ questionTaskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
2179
+ answerEventIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<`ans_${string}`, string, z.core.$ZodTypeInternals<`ans_${string}`, string>>>>>;
2180
+ changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
2181
+ reportRef: z.ZodOptional<z.ZodString>;
2182
+ createdAt: z.ZodISODateTime;
2183
+ updatedAt: z.ZodISODateTime;
2184
+ }, z.core.$strict>, keyof z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>> & z.ZodType<Task, {
2185
+ schemaVersion: 1;
2186
+ id: string;
2187
+ repositoryIds: readonly [string, ...string[]];
2188
+ kind: unknown;
2189
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
2190
+ origin: {
2191
+ signalId?: string | undefined;
2192
+ operator?: string | undefined;
2193
+ };
2194
+ work: {
2195
+ title: string;
2196
+ input: JsonValue;
2197
+ completionCriteria: readonly string[];
2198
+ workflow: {
2199
+ id: string;
2200
+ version: number;
2201
+ };
2202
+ route?: {
2203
+ id: string;
2204
+ version: number;
2205
+ } | undefined;
2206
+ };
2207
+ rootTaskId: string;
2208
+ replyTo: {
2209
+ channel: string;
2210
+ address: string;
2211
+ };
2212
+ attempt: number;
2213
+ createdAt: string;
2214
+ updatedAt: string;
2215
+ area?: string | undefined;
2216
+ approval?: "required" | "granted" | "denied" | undefined;
2217
+ workResult?: {
2218
+ output: JsonValue;
2219
+ completedAt: string;
2220
+ } | undefined;
2221
+ waitingForMessages?: boolean | undefined;
2222
+ workflowPhase?: string | undefined;
2223
+ parentTaskId?: string | undefined;
2224
+ parentTaskAttempt?: number | undefined;
2225
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
2226
+ failureReceiptId?: string | undefined;
2227
+ execution?: {
2228
+ provider: string;
2229
+ sessionId: string;
2230
+ environmentId?: string | undefined;
2231
+ harness?: string | undefined;
2232
+ traceId?: string | undefined;
2233
+ } | undefined;
2234
+ lastProgressAt?: string | undefined;
2235
+ stalledAt?: string | undefined;
2236
+ stalledReason?: string | undefined;
2237
+ needsHumanAction?: string | undefined;
2238
+ needsHumanNotifiedAt?: string | undefined;
2239
+ reservedUsd?: number | undefined;
2240
+ reservedAt?: string | undefined;
2241
+ usage?: {
2242
+ costUsd: number;
2243
+ inputTokens: number;
2244
+ outputTokens: number;
2245
+ cacheReadTokens: number;
2246
+ cacheWriteTokens: number;
2247
+ steps: Record<string, number>;
2248
+ } | undefined;
2249
+ settledUsd?: number | undefined;
2250
+ question?: {
2251
+ text: string;
2252
+ options: readonly string[];
2253
+ closingOptions?: readonly string[] | undefined;
2254
+ answer?: string | undefined;
2255
+ answeredBy?: string | undefined;
2256
+ } | undefined;
2257
+ questionTaskId?: string | undefined;
2258
+ answerEventIds?: readonly string[] | undefined;
2259
+ changeId?: string | undefined;
2260
+ reportRef?: string | undefined;
2261
+ }, z.core.$ZodTypeInternals<Task, {
2262
+ schemaVersion: 1;
2263
+ id: string;
2264
+ repositoryIds: readonly [string, ...string[]];
2265
+ kind: unknown;
2266
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
2267
+ origin: {
2268
+ signalId?: string | undefined;
2269
+ operator?: string | undefined;
2270
+ };
2271
+ work: {
2272
+ title: string;
2273
+ input: JsonValue;
2274
+ completionCriteria: readonly string[];
2275
+ workflow: {
2276
+ id: string;
2277
+ version: number;
2278
+ };
2279
+ route?: {
2280
+ id: string;
2281
+ version: number;
2282
+ } | undefined;
2283
+ };
2284
+ rootTaskId: string;
2285
+ replyTo: {
2286
+ channel: string;
2287
+ address: string;
2288
+ };
2289
+ attempt: number;
2290
+ createdAt: string;
2291
+ updatedAt: string;
2292
+ area?: string | undefined;
2293
+ approval?: "required" | "granted" | "denied" | undefined;
2294
+ workResult?: {
2295
+ output: JsonValue;
2296
+ completedAt: string;
2297
+ } | undefined;
2298
+ waitingForMessages?: boolean | undefined;
2299
+ workflowPhase?: string | undefined;
2300
+ parentTaskId?: string | undefined;
2301
+ parentTaskAttempt?: number | undefined;
2302
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
2303
+ failureReceiptId?: string | undefined;
2304
+ execution?: {
2305
+ provider: string;
2306
+ sessionId: string;
2307
+ environmentId?: string | undefined;
2308
+ harness?: string | undefined;
2309
+ traceId?: string | undefined;
2310
+ } | undefined;
2311
+ lastProgressAt?: string | undefined;
2312
+ stalledAt?: string | undefined;
2313
+ stalledReason?: string | undefined;
2314
+ needsHumanAction?: string | undefined;
2315
+ needsHumanNotifiedAt?: string | undefined;
2316
+ reservedUsd?: number | undefined;
2317
+ reservedAt?: string | undefined;
2318
+ usage?: {
2319
+ costUsd: number;
2320
+ inputTokens: number;
2321
+ outputTokens: number;
2322
+ cacheReadTokens: number;
2323
+ cacheWriteTokens: number;
2324
+ steps: Record<string, number>;
2325
+ } | undefined;
2326
+ settledUsd?: number | undefined;
2327
+ question?: {
2328
+ text: string;
2329
+ options: readonly string[];
2330
+ closingOptions?: readonly string[] | undefined;
2331
+ answer?: string | undefined;
2332
+ answeredBy?: string | undefined;
2333
+ } | undefined;
2334
+ questionTaskId?: string | undefined;
2335
+ answerEventIds?: readonly string[] | undefined;
2336
+ changeId?: string | undefined;
2337
+ reportRef?: string | undefined;
2338
+ }>> & z.ZodType<({
2339
+ id: `task_${string}`;
2340
+ schemaVersion: 1;
2341
+ replyTo: {
2342
+ channel: string;
2343
+ address: string;
2344
+ };
2345
+ attempt: number;
2346
+ updatedAt: string;
2347
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2348
+ kind: TaskKind;
2349
+ area?: string | undefined;
2350
+ approval?: "required" | "granted" | "denied" | undefined;
2351
+ origin: {
2352
+ signalId?: `sig_${string}` | undefined;
2353
+ operator?: string | undefined;
2354
+ };
2355
+ work: {
2356
+ title: string;
2357
+ input: JsonValue;
2358
+ completionCriteria: readonly string[];
2359
+ workflow: {
2360
+ id: string;
2361
+ version: number;
2362
+ } & z.core.$brand<"WorkflowBinding">;
2363
+ route?: ({
2364
+ id: string;
2365
+ version: number;
2366
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
2367
+ };
2368
+ workflowPhase?: string | undefined;
2369
+ rootTaskId: `task_${string}`;
2370
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
2371
+ execution?: {
2372
+ provider: string;
2373
+ sessionId: string;
2374
+ environmentId?: string | undefined;
2375
+ harness?: string | undefined;
2376
+ traceId?: string | undefined;
2377
+ } | undefined;
2378
+ lastProgressAt?: string | undefined;
2379
+ reservedUsd?: number | undefined;
2380
+ reservedAt?: string | undefined;
2381
+ usage?: {
2382
+ costUsd: number;
2383
+ inputTokens: number;
2384
+ outputTokens: number;
2385
+ cacheReadTokens: number;
2386
+ cacheWriteTokens: number;
2387
+ steps: Record<string, number>;
2388
+ } | undefined;
2389
+ settledUsd?: number | undefined;
2390
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
2391
+ changeId?: `chg_${string}` | undefined;
2392
+ reportRef?: string | undefined;
2393
+ createdAt: string;
2394
+ } & {
2395
+ waitingForMessages?: false;
2396
+ needsHumanAction?: never;
2397
+ needsHumanNotifiedAt?: never;
2398
+ } & {
2399
+ stalledAt?: never;
2400
+ stalledReason?: never;
2401
+ } & {
2402
+ failureReceiptId?: never;
2403
+ } & {
2404
+ state: "queued";
2405
+ workResult?: {
2406
+ output: JsonValue;
2407
+ completedAt: string;
2408
+ };
2409
+ } & {
2410
+ question?: never;
2411
+ questionTaskId?: never;
2412
+ parentTaskAttempt?: never;
2413
+ parentTaskId?: `task_${string}`;
2414
+ }) | ({
2415
+ id: `task_${string}`;
2416
+ schemaVersion: 1;
2417
+ replyTo: {
2418
+ channel: string;
2419
+ address: string;
2420
+ };
2421
+ attempt: number;
2422
+ updatedAt: string;
2423
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2424
+ kind: TaskKind;
2425
+ area?: string | undefined;
2426
+ approval?: "required" | "granted" | "denied" | undefined;
2427
+ origin: {
2428
+ signalId?: `sig_${string}` | undefined;
2429
+ operator?: string | undefined;
2430
+ };
2431
+ work: {
2432
+ title: string;
2433
+ input: JsonValue;
2434
+ completionCriteria: readonly string[];
2435
+ workflow: {
2436
+ id: string;
2437
+ version: number;
2438
+ } & z.core.$brand<"WorkflowBinding">;
2439
+ route?: ({
2440
+ id: string;
2441
+ version: number;
2442
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
2443
+ };
2444
+ workflowPhase?: string | undefined;
2445
+ rootTaskId: `task_${string}`;
2446
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
2447
+ execution?: {
2448
+ provider: string;
2449
+ sessionId: string;
2450
+ environmentId?: string | undefined;
2451
+ harness?: string | undefined;
2452
+ traceId?: string | undefined;
2453
+ } | undefined;
2454
+ lastProgressAt?: string | undefined;
2455
+ reservedUsd?: number | undefined;
2456
+ reservedAt?: string | undefined;
2457
+ usage?: {
2458
+ costUsd: number;
2459
+ inputTokens: number;
2460
+ outputTokens: number;
2461
+ cacheReadTokens: number;
2462
+ cacheWriteTokens: number;
2463
+ steps: Record<string, number>;
2464
+ } | undefined;
2465
+ settledUsd?: number | undefined;
2466
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
2467
+ changeId?: `chg_${string}` | undefined;
2468
+ reportRef?: string | undefined;
2469
+ createdAt: string;
2470
+ } & {
2471
+ waitingForMessages?: false;
2472
+ needsHumanAction?: never;
2473
+ needsHumanNotifiedAt?: never;
2474
+ } & {
2475
+ stalledAt?: never;
2476
+ stalledReason?: never;
2477
+ } & {
2478
+ failureReceiptId?: never;
2479
+ } & {
2480
+ state: "queued";
2481
+ workResult?: {
2482
+ output: JsonValue;
2483
+ completedAt: string;
2484
+ };
2485
+ } & {
2486
+ question: {
2487
+ text: string;
2488
+ options: readonly string[];
2489
+ closingOptions?: readonly string[] | undefined;
2490
+ answer?: string | undefined;
2491
+ answeredBy?: string | undefined;
2492
+ };
2493
+ questionTaskId?: never;
2494
+ parentTaskAttempt?: never;
2495
+ parentTaskId?: `task_${string}`;
2496
+ }) | ({
2497
+ id: `task_${string}`;
2498
+ schemaVersion: 1;
2499
+ replyTo: {
2500
+ channel: string;
2501
+ address: string;
2502
+ };
2503
+ attempt: number;
2504
+ updatedAt: string;
2505
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2506
+ kind: TaskKind;
2507
+ area?: string | undefined;
2508
+ approval?: "required" | "granted" | "denied" | undefined;
2509
+ origin: {
2510
+ signalId?: `sig_${string}` | undefined;
2511
+ operator?: string | undefined;
2512
+ };
2513
+ work: {
2514
+ title: string;
2515
+ input: JsonValue;
2516
+ completionCriteria: readonly string[];
2517
+ workflow: {
2518
+ id: string;
2519
+ version: number;
2520
+ } & z.core.$brand<"WorkflowBinding">;
2521
+ route?: ({
2522
+ id: string;
2523
+ version: number;
2524
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
2525
+ };
2526
+ workflowPhase?: string | undefined;
2527
+ rootTaskId: `task_${string}`;
2528
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
2529
+ execution?: {
2530
+ provider: string;
2531
+ sessionId: string;
2532
+ environmentId?: string | undefined;
2533
+ harness?: string | undefined;
2534
+ traceId?: string | undefined;
2535
+ } | undefined;
2536
+ lastProgressAt?: string | undefined;
2537
+ reservedUsd?: number | undefined;
2538
+ reservedAt?: string | undefined;
2539
+ usage?: {
2540
+ costUsd: number;
2541
+ inputTokens: number;
2542
+ outputTokens: number;
2543
+ cacheReadTokens: number;
2544
+ cacheWriteTokens: number;
2545
+ steps: Record<string, number>;
2546
+ } | undefined;
2547
+ settledUsd?: number | undefined;
2548
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
2549
+ changeId?: `chg_${string}` | undefined;
2550
+ reportRef?: string | undefined;
2551
+ createdAt: string;
2552
+ } & {
2553
+ waitingForMessages?: false;
2554
+ needsHumanAction?: never;
2555
+ needsHumanNotifiedAt?: never;
2556
+ } & {
2557
+ stalledAt?: never;
2558
+ stalledReason?: never;
2559
+ } & {
2560
+ failureReceiptId?: never;
2561
+ } & {
2562
+ state: "queued";
2563
+ workResult?: {
2564
+ output: JsonValue;
2565
+ completedAt: string;
2566
+ };
2567
+ } & {
2568
+ question: {
2569
+ text: string;
2570
+ options: readonly string[];
2571
+ closingOptions?: readonly string[] | undefined;
2572
+ answer?: string | undefined;
2573
+ answeredBy?: string | undefined;
2574
+ };
2575
+ questionTaskId?: never;
2576
+ parentTaskAttempt: number;
2577
+ parentTaskId: `task_${string}`;
2578
+ }) | ({
2579
+ id: `task_${string}`;
2580
+ schemaVersion: 1;
2581
+ replyTo: {
2582
+ channel: string;
2583
+ address: string;
2584
+ };
2585
+ attempt: number;
2586
+ updatedAt: string;
2587
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2588
+ kind: TaskKind;
2589
+ area?: string | undefined;
2590
+ approval?: "required" | "granted" | "denied" | undefined;
2591
+ origin: {
2592
+ signalId?: `sig_${string}` | undefined;
2593
+ operator?: string | undefined;
2594
+ };
2595
+ work: {
2596
+ title: string;
2597
+ input: JsonValue;
2598
+ completionCriteria: readonly string[];
2599
+ workflow: {
2600
+ id: string;
2601
+ version: number;
2602
+ } & z.core.$brand<"WorkflowBinding">;
2603
+ route?: ({
2604
+ id: string;
2605
+ version: number;
2606
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
2607
+ };
2608
+ workflowPhase?: string | undefined;
2609
+ rootTaskId: `task_${string}`;
2610
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
2611
+ execution?: {
2612
+ provider: string;
2613
+ sessionId: string;
2614
+ environmentId?: string | undefined;
2615
+ harness?: string | undefined;
2616
+ traceId?: string | undefined;
2617
+ } | undefined;
2618
+ lastProgressAt?: string | undefined;
2619
+ reservedUsd?: number | undefined;
2620
+ reservedAt?: string | undefined;
2621
+ usage?: {
2622
+ costUsd: number;
2623
+ inputTokens: number;
2624
+ outputTokens: number;
2625
+ cacheReadTokens: number;
2626
+ cacheWriteTokens: number;
2627
+ steps: Record<string, number>;
2628
+ } | undefined;
2629
+ settledUsd?: number | undefined;
2630
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
2631
+ changeId?: `chg_${string}` | undefined;
2632
+ reportRef?: string | undefined;
2633
+ createdAt: string;
2634
+ } & {
2635
+ waitingForMessages?: false;
2636
+ needsHumanAction?: never;
2637
+ needsHumanNotifiedAt?: never;
2638
+ } & {
2639
+ stalledAt?: never;
2640
+ stalledReason?: never;
2641
+ } & {
2642
+ failureReceiptId?: never;
2643
+ } & {
2644
+ state: "queued";
2645
+ workResult?: {
2646
+ output: JsonValue;
2647
+ completedAt: string;
2648
+ };
2649
+ } & {
2650
+ question?: never;
2651
+ questionTaskId: `task_${string}`;
2652
+ parentTaskAttempt?: never;
2653
+ parentTaskId?: `task_${string}`;
2654
+ }), {
2655
+ schemaVersion: 1;
2656
+ id: string;
2657
+ repositoryIds: readonly [string, ...string[]];
2658
+ kind: unknown;
2659
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
2660
+ origin: {
2661
+ signalId?: string | undefined;
2662
+ operator?: string | undefined;
2663
+ };
2664
+ work: {
2665
+ title: string;
2666
+ input: JsonValue;
2667
+ completionCriteria: readonly string[];
2668
+ workflow: {
2669
+ id: string;
2670
+ version: number;
2671
+ };
2672
+ route?: {
2673
+ id: string;
2674
+ version: number;
2675
+ } | undefined;
2676
+ };
2677
+ rootTaskId: string;
2678
+ replyTo: {
2679
+ channel: string;
2680
+ address: string;
2681
+ };
2682
+ attempt: number;
2683
+ createdAt: string;
2684
+ updatedAt: string;
2685
+ area?: string | undefined;
2686
+ approval?: "required" | "granted" | "denied" | undefined;
2687
+ workResult?: {
2688
+ output: JsonValue;
2689
+ completedAt: string;
2690
+ } | undefined;
2691
+ waitingForMessages?: boolean | undefined;
2692
+ workflowPhase?: string | undefined;
2693
+ parentTaskId?: string | undefined;
2694
+ parentTaskAttempt?: number | undefined;
2695
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
2696
+ failureReceiptId?: string | undefined;
2697
+ execution?: {
2698
+ provider: string;
2699
+ sessionId: string;
2700
+ environmentId?: string | undefined;
2701
+ harness?: string | undefined;
2702
+ traceId?: string | undefined;
2703
+ } | undefined;
2704
+ lastProgressAt?: string | undefined;
2705
+ stalledAt?: string | undefined;
2706
+ stalledReason?: string | undefined;
2707
+ needsHumanAction?: string | undefined;
2708
+ needsHumanNotifiedAt?: string | undefined;
2709
+ reservedUsd?: number | undefined;
2710
+ reservedAt?: string | undefined;
2711
+ usage?: {
2712
+ costUsd: number;
2713
+ inputTokens: number;
2714
+ outputTokens: number;
2715
+ cacheReadTokens: number;
2716
+ cacheWriteTokens: number;
2717
+ steps: Record<string, number>;
2718
+ } | undefined;
2719
+ settledUsd?: number | undefined;
2720
+ question?: {
2721
+ text: string;
2722
+ options: readonly string[];
2723
+ closingOptions?: readonly string[] | undefined;
2724
+ answer?: string | undefined;
2725
+ answeredBy?: string | undefined;
2726
+ } | undefined;
2727
+ questionTaskId?: string | undefined;
2728
+ answerEventIds?: readonly string[] | undefined;
2729
+ changeId?: string | undefined;
2730
+ reportRef?: string | undefined;
2731
+ }, z.core.$ZodTypeInternals<({
2732
+ id: `task_${string}`;
2733
+ schemaVersion: 1;
2734
+ replyTo: {
2735
+ channel: string;
2736
+ address: string;
2737
+ };
2738
+ attempt: number;
2739
+ updatedAt: string;
2740
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2741
+ kind: TaskKind;
2742
+ area?: string | undefined;
2743
+ approval?: "required" | "granted" | "denied" | undefined;
2744
+ origin: {
2745
+ signalId?: `sig_${string}` | undefined;
2746
+ operator?: string | undefined;
2747
+ };
2748
+ work: {
2749
+ title: string;
2750
+ input: JsonValue;
2751
+ completionCriteria: readonly string[];
2752
+ workflow: {
2753
+ id: string;
2754
+ version: number;
2755
+ } & z.core.$brand<"WorkflowBinding">;
2756
+ route?: ({
2757
+ id: string;
2758
+ version: number;
2759
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
2760
+ };
2761
+ workflowPhase?: string | undefined;
2762
+ rootTaskId: `task_${string}`;
2763
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
2764
+ execution?: {
2765
+ provider: string;
2766
+ sessionId: string;
2767
+ environmentId?: string | undefined;
2768
+ harness?: string | undefined;
2769
+ traceId?: string | undefined;
2770
+ } | undefined;
2771
+ lastProgressAt?: string | undefined;
2772
+ reservedUsd?: number | undefined;
2773
+ reservedAt?: string | undefined;
2774
+ usage?: {
2775
+ costUsd: number;
2776
+ inputTokens: number;
2777
+ outputTokens: number;
2778
+ cacheReadTokens: number;
2779
+ cacheWriteTokens: number;
2780
+ steps: Record<string, number>;
2781
+ } | undefined;
2782
+ settledUsd?: number | undefined;
2783
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
2784
+ changeId?: `chg_${string}` | undefined;
2785
+ reportRef?: string | undefined;
2786
+ createdAt: string;
2787
+ } & {
2788
+ waitingForMessages?: false;
2789
+ needsHumanAction?: never;
2790
+ needsHumanNotifiedAt?: never;
2791
+ } & {
2792
+ stalledAt?: never;
2793
+ stalledReason?: never;
2794
+ } & {
2795
+ failureReceiptId?: never;
2796
+ } & {
2797
+ state: "queued";
2798
+ workResult?: {
2799
+ output: JsonValue;
2800
+ completedAt: string;
2801
+ };
2802
+ } & {
2803
+ question?: never;
2804
+ questionTaskId?: never;
2805
+ parentTaskAttempt?: never;
2806
+ parentTaskId?: `task_${string}`;
2807
+ }) | ({
2808
+ id: `task_${string}`;
2809
+ schemaVersion: 1;
2810
+ replyTo: {
2811
+ channel: string;
2812
+ address: string;
2813
+ };
2814
+ attempt: number;
2815
+ updatedAt: string;
2816
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2817
+ kind: TaskKind;
2818
+ area?: string | undefined;
2819
+ approval?: "required" | "granted" | "denied" | undefined;
2820
+ origin: {
2821
+ signalId?: `sig_${string}` | undefined;
2822
+ operator?: string | undefined;
2823
+ };
2824
+ work: {
2825
+ title: string;
2826
+ input: JsonValue;
2827
+ completionCriteria: readonly string[];
2828
+ workflow: {
2829
+ id: string;
2830
+ version: number;
2831
+ } & z.core.$brand<"WorkflowBinding">;
2832
+ route?: ({
2833
+ id: string;
2834
+ version: number;
2835
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
2836
+ };
2837
+ workflowPhase?: string | undefined;
2838
+ rootTaskId: `task_${string}`;
2839
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
2840
+ execution?: {
2841
+ provider: string;
2842
+ sessionId: string;
2843
+ environmentId?: string | undefined;
2844
+ harness?: string | undefined;
2845
+ traceId?: string | undefined;
2846
+ } | undefined;
2847
+ lastProgressAt?: string | undefined;
2848
+ reservedUsd?: number | undefined;
2849
+ reservedAt?: string | undefined;
2850
+ usage?: {
2851
+ costUsd: number;
2852
+ inputTokens: number;
2853
+ outputTokens: number;
2854
+ cacheReadTokens: number;
2855
+ cacheWriteTokens: number;
2856
+ steps: Record<string, number>;
2857
+ } | undefined;
2858
+ settledUsd?: number | undefined;
2859
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
2860
+ changeId?: `chg_${string}` | undefined;
2861
+ reportRef?: string | undefined;
2862
+ createdAt: string;
2863
+ } & {
2864
+ waitingForMessages?: false;
2865
+ needsHumanAction?: never;
2866
+ needsHumanNotifiedAt?: never;
2867
+ } & {
2868
+ stalledAt?: never;
2869
+ stalledReason?: never;
2870
+ } & {
2871
+ failureReceiptId?: never;
2872
+ } & {
2873
+ state: "queued";
2874
+ workResult?: {
2875
+ output: JsonValue;
2876
+ completedAt: string;
2877
+ };
2878
+ } & {
2879
+ question: {
2880
+ text: string;
2881
+ options: readonly string[];
2882
+ closingOptions?: readonly string[] | undefined;
2883
+ answer?: string | undefined;
2884
+ answeredBy?: string | undefined;
2885
+ };
2886
+ questionTaskId?: never;
2887
+ parentTaskAttempt?: never;
2888
+ parentTaskId?: `task_${string}`;
2889
+ }) | ({
2890
+ id: `task_${string}`;
2891
+ schemaVersion: 1;
2892
+ replyTo: {
2893
+ channel: string;
2894
+ address: string;
2895
+ };
2896
+ attempt: number;
2897
+ updatedAt: string;
2898
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2899
+ kind: TaskKind;
2900
+ area?: string | undefined;
2901
+ approval?: "required" | "granted" | "denied" | undefined;
2902
+ origin: {
2903
+ signalId?: `sig_${string}` | undefined;
2904
+ operator?: string | undefined;
2905
+ };
2906
+ work: {
2907
+ title: string;
2908
+ input: JsonValue;
2909
+ completionCriteria: readonly string[];
2910
+ workflow: {
2911
+ id: string;
2912
+ version: number;
2913
+ } & z.core.$brand<"WorkflowBinding">;
2914
+ route?: ({
2915
+ id: string;
2916
+ version: number;
2917
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
2918
+ };
2919
+ workflowPhase?: string | undefined;
2920
+ rootTaskId: `task_${string}`;
2921
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
2922
+ execution?: {
2923
+ provider: string;
2924
+ sessionId: string;
2925
+ environmentId?: string | undefined;
2926
+ harness?: string | undefined;
2927
+ traceId?: string | undefined;
2928
+ } | undefined;
2929
+ lastProgressAt?: string | undefined;
2930
+ reservedUsd?: number | undefined;
2931
+ reservedAt?: string | undefined;
2932
+ usage?: {
2933
+ costUsd: number;
2934
+ inputTokens: number;
2935
+ outputTokens: number;
2936
+ cacheReadTokens: number;
2937
+ cacheWriteTokens: number;
2938
+ steps: Record<string, number>;
2939
+ } | undefined;
2940
+ settledUsd?: number | undefined;
2941
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
2942
+ changeId?: `chg_${string}` | undefined;
2943
+ reportRef?: string | undefined;
2944
+ createdAt: string;
2945
+ } & {
2946
+ waitingForMessages?: false;
2947
+ needsHumanAction?: never;
2948
+ needsHumanNotifiedAt?: never;
2949
+ } & {
2950
+ stalledAt?: never;
2951
+ stalledReason?: never;
2952
+ } & {
2953
+ failureReceiptId?: never;
2954
+ } & {
2955
+ state: "queued";
2956
+ workResult?: {
2957
+ output: JsonValue;
2958
+ completedAt: string;
2959
+ };
2960
+ } & {
2961
+ question: {
2962
+ text: string;
2963
+ options: readonly string[];
2964
+ closingOptions?: readonly string[] | undefined;
2965
+ answer?: string | undefined;
2966
+ answeredBy?: string | undefined;
2967
+ };
2968
+ questionTaskId?: never;
2969
+ parentTaskAttempt: number;
2970
+ parentTaskId: `task_${string}`;
2971
+ }) | ({
2972
+ id: `task_${string}`;
2973
+ schemaVersion: 1;
2974
+ replyTo: {
2975
+ channel: string;
2976
+ address: string;
2977
+ };
2978
+ attempt: number;
2979
+ updatedAt: string;
2980
+ repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
2981
+ kind: TaskKind;
2982
+ area?: string | undefined;
2983
+ approval?: "required" | "granted" | "denied" | undefined;
2984
+ origin: {
2985
+ signalId?: `sig_${string}` | undefined;
2986
+ operator?: string | undefined;
2987
+ };
2988
+ work: {
2989
+ title: string;
2990
+ input: JsonValue;
2991
+ completionCriteria: readonly string[];
2992
+ workflow: {
2993
+ id: string;
2994
+ version: number;
2995
+ } & z.core.$brand<"WorkflowBinding">;
2996
+ route?: ({
2997
+ id: string;
2998
+ version: number;
2999
+ } & z.core.$brand<"AgentRouteBinding">) | undefined;
3000
+ };
3001
+ workflowPhase?: string | undefined;
3002
+ rootTaskId: `task_${string}`;
3003
+ pendingCommunicationReceiptIds?: readonly `rcpt_${string}`[] | undefined;
3004
+ execution?: {
3005
+ provider: string;
3006
+ sessionId: string;
3007
+ environmentId?: string | undefined;
3008
+ harness?: string | undefined;
3009
+ traceId?: string | undefined;
3010
+ } | undefined;
3011
+ lastProgressAt?: string | undefined;
3012
+ reservedUsd?: number | undefined;
3013
+ reservedAt?: string | undefined;
3014
+ usage?: {
3015
+ costUsd: number;
3016
+ inputTokens: number;
3017
+ outputTokens: number;
3018
+ cacheReadTokens: number;
3019
+ cacheWriteTokens: number;
3020
+ steps: Record<string, number>;
3021
+ } | undefined;
3022
+ settledUsd?: number | undefined;
3023
+ answerEventIds?: readonly `ans_${string}`[] | undefined;
3024
+ changeId?: `chg_${string}` | undefined;
3025
+ reportRef?: string | undefined;
3026
+ createdAt: string;
3027
+ } & {
3028
+ waitingForMessages?: false;
3029
+ needsHumanAction?: never;
3030
+ needsHumanNotifiedAt?: never;
3031
+ } & {
3032
+ stalledAt?: never;
3033
+ stalledReason?: never;
3034
+ } & {
3035
+ failureReceiptId?: never;
3036
+ } & {
3037
+ state: "queued";
3038
+ workResult?: {
3039
+ output: JsonValue;
3040
+ completedAt: string;
3041
+ };
3042
+ } & {
3043
+ question?: never;
3044
+ questionTaskId: `task_${string}`;
3045
+ parentTaskAttempt?: never;
3046
+ parentTaskId?: `task_${string}`;
3047
+ }), {
3048
+ schemaVersion: 1;
3049
+ id: string;
3050
+ repositoryIds: readonly [string, ...string[]];
3051
+ kind: unknown;
3052
+ state: "queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
3053
+ origin: {
3054
+ signalId?: string | undefined;
3055
+ operator?: string | undefined;
3056
+ };
3057
+ work: {
3058
+ title: string;
3059
+ input: JsonValue;
3060
+ completionCriteria: readonly string[];
3061
+ workflow: {
3062
+ id: string;
3063
+ version: number;
3064
+ };
3065
+ route?: {
3066
+ id: string;
3067
+ version: number;
3068
+ } | undefined;
3069
+ };
3070
+ rootTaskId: string;
3071
+ replyTo: {
3072
+ channel: string;
3073
+ address: string;
3074
+ };
3075
+ attempt: number;
3076
+ createdAt: string;
3077
+ updatedAt: string;
3078
+ area?: string | undefined;
3079
+ approval?: "required" | "granted" | "denied" | undefined;
3080
+ workResult?: {
3081
+ output: JsonValue;
3082
+ completedAt: string;
3083
+ } | undefined;
3084
+ waitingForMessages?: boolean | undefined;
3085
+ workflowPhase?: string | undefined;
3086
+ parentTaskId?: string | undefined;
3087
+ parentTaskAttempt?: number | undefined;
3088
+ pendingCommunicationReceiptIds?: readonly string[] | undefined;
3089
+ failureReceiptId?: string | undefined;
3090
+ execution?: {
3091
+ provider: string;
3092
+ sessionId: string;
3093
+ environmentId?: string | undefined;
3094
+ harness?: string | undefined;
3095
+ traceId?: string | undefined;
3096
+ } | undefined;
3097
+ lastProgressAt?: string | undefined;
3098
+ stalledAt?: string | undefined;
3099
+ stalledReason?: string | undefined;
3100
+ needsHumanAction?: string | undefined;
3101
+ needsHumanNotifiedAt?: string | undefined;
3102
+ reservedUsd?: number | undefined;
3103
+ reservedAt?: string | undefined;
3104
+ usage?: {
3105
+ costUsd: number;
3106
+ inputTokens: number;
3107
+ outputTokens: number;
3108
+ cacheReadTokens: number;
3109
+ cacheWriteTokens: number;
3110
+ steps: Record<string, number>;
3111
+ } | undefined;
3112
+ settledUsd?: number | undefined;
3113
+ question?: {
3114
+ text: string;
3115
+ options: readonly string[];
3116
+ closingOptions?: readonly string[] | undefined;
3117
+ answer?: string | undefined;
3118
+ answeredBy?: string | undefined;
3119
+ } | undefined;
3120
+ questionTaskId?: string | undefined;
3121
+ answerEventIds?: readonly string[] | undefined;
3122
+ changeId?: string | undefined;
3123
+ reportRef?: string | undefined;
3124
+ }>>;
3125
+ admissionDependencies: z.ZodReadonly<z.ZodArray<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>>;
3126
+ }, z.core.$strict>>>;
3127
+ createdAt: z.ZodISODateTime;
3128
+ updatedAt: z.ZodISODateTime;
3129
+ }, z.core.$strict>;
3130
+ /** Directly addressed CAS snapshot owning one root's Task membership and dependencies. */
3131
+ type TaskGraph = z.infer<typeof taskGraphSchema>;
3132
+ //#endregion
3133
+ export { MAX_TASK_GRAPH_DEPENDENCIES, MAX_TASK_GRAPH_NODES, TaskGraph, TaskGraphNode, taskGraphAdmissionSchema, taskGraphDependenciesSchema, taskGraphNodeSchema, taskGraphSchema };
3134
+ //# sourceMappingURL=task-graph.d.mts.map