@vercel/factory 0.0.14 → 0.0.16

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