@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,68 @@
1
+ import { changeIdSchema, repositoryIdSchema, taskIdSchema } from "./id.mjs";
2
+ import { isoDateTimeSchema, schemaVersionSchema } from "./common.mjs";
3
+ import { z } from "zod";
4
+ //#region src/schema/change.ts
5
+ /** Validates the shared ordinal scale used for risk and confidence. */
6
+ const changeLevelSchema = z.enum([
7
+ "low",
8
+ "medium",
9
+ "high"
10
+ ]);
11
+ /** Validates the durable lifecycle state of a pull-request Change. */
12
+ const changeStateSchema = z.enum([
13
+ "verifying",
14
+ "ready",
15
+ "merged",
16
+ "deployed",
17
+ "rolled_out",
18
+ "rolled_back",
19
+ "closed"
20
+ ]);
21
+ /** Validates the verification evidence used to assess a Change. */
22
+ const changeEvidenceSchema = z.strictObject({
23
+ reproVerified: z.boolean(),
24
+ testsAdded: z.number().int().min(0),
25
+ checksGreen: z.boolean(),
26
+ attackPassed: z.boolean(),
27
+ scopeMatches: z.boolean(),
28
+ previewUrl: z.url().optional()
29
+ });
30
+ const changeFields = {
31
+ schemaVersion: schemaVersionSchema,
32
+ id: changeIdSchema,
33
+ repositoryId: repositoryIdSchema,
34
+ taskId: taskIdSchema.optional(),
35
+ groupId: taskIdSchema.optional(),
36
+ prNumber: z.number().int().min(1),
37
+ prUrl: z.url(),
38
+ author: z.string().min(1),
39
+ risk: changeLevelSchema,
40
+ confidence: changeLevelSchema,
41
+ evidence: changeEvidenceSchema,
42
+ mergeSha: z.string().regex(/^[0-9a-f]{40}$/).optional().describe("Merge commit sha recorded when the pull request merges, matched against production deployments."),
43
+ createdAt: isoDateTimeSchema,
44
+ updatedAt: isoDateTimeSchema
45
+ };
46
+ /** Validates a persisted human-visible pull-request Change and its trust evidence. */
47
+ const changeSchema = z.discriminatedUnion("state", [z.strictObject({
48
+ ...changeFields,
49
+ state: z.enum([
50
+ "verifying",
51
+ "ready",
52
+ "closed"
53
+ ]),
54
+ decidedBy: z.string().min(1).optional()
55
+ }), z.strictObject({
56
+ ...changeFields,
57
+ state: z.enum([
58
+ "merged",
59
+ "deployed",
60
+ "rolled_out",
61
+ "rolled_back"
62
+ ]),
63
+ decidedBy: z.string().min(1)
64
+ })]);
65
+ //#endregion
66
+ export { changeEvidenceSchema, changeLevelSchema, changeSchema, changeStateSchema };
67
+
68
+ //# sourceMappingURL=change.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change.mjs","names":[],"sources":["../../src/schema/change.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, schemaVersionSchema } from \"./common\";\nimport { changeIdSchema, repositoryIdSchema, taskIdSchema } from \"./id\";\n\n/** Validates the shared ordinal scale used for risk and confidence. */\nexport const changeLevelSchema = z.enum([\"low\", \"medium\", \"high\"]);\n\n/** Validates the durable lifecycle state of a pull-request Change. */\nexport const changeStateSchema = z.enum([\n \"verifying\",\n \"ready\",\n \"merged\",\n \"deployed\",\n \"rolled_out\",\n \"rolled_back\",\n \"closed\",\n]);\n\n/** Validates the verification evidence used to assess a Change. */\nexport const changeEvidenceSchema = z.strictObject({\n reproVerified: z.boolean(),\n testsAdded: z.number().int().min(0),\n checksGreen: z.boolean(),\n attackPassed: z.boolean(),\n scopeMatches: z.boolean(),\n previewUrl: z.url().optional(),\n});\n\nconst changeFields = {\n schemaVersion: schemaVersionSchema,\n id: changeIdSchema,\n repositoryId: repositoryIdSchema,\n taskId: taskIdSchema.optional(),\n groupId: taskIdSchema.optional(),\n prNumber: z.number().int().min(1),\n prUrl: z.url(),\n author: z.string().min(1),\n risk: changeLevelSchema,\n confidence: changeLevelSchema,\n evidence: changeEvidenceSchema,\n mergeSha: z\n .string()\n .regex(/^[0-9a-f]{40}$/)\n .optional()\n .describe(\n \"Merge commit sha recorded when the pull request merges, matched against production deployments.\",\n ),\n createdAt: isoDateTimeSchema,\n updatedAt: isoDateTimeSchema,\n} as const;\n\n/** Validates a persisted human-visible pull-request Change and its trust evidence. */\nexport const changeSchema = z.discriminatedUnion(\"state\", [\n z.strictObject({\n ...changeFields,\n state: z.enum([\"verifying\", \"ready\", \"closed\"]),\n decidedBy: z.string().min(1).optional(),\n }),\n z.strictObject({\n ...changeFields,\n state: z.enum([\"merged\", \"deployed\", \"rolled_out\", \"rolled_back\"]),\n decidedBy: z.string().min(1),\n }),\n]);\n\n/** Shared low-to-high ordinal value used for risk and confidence. */\nexport type ChangeLevel = z.infer<typeof changeLevelSchema>;\n/** Durable lifecycle state of a human-visible pull-request Change. */\nexport type ChangeState = z.infer<typeof changeStateSchema>;\n/** Verification facts supporting the risk and confidence assigned to a Change. */\nexport type ChangeEvidence = z.infer<typeof changeEvidenceSchema>;\n/** Persisted pull-request Change tracked independently from the Tasks that produced it. */\nexport type Change = z.infer<typeof changeSchema>;\n/** Change read model narrowed to one exact lifecycle state. */\nexport type ChangeInState<State extends ChangeState> = Change & { readonly state: State };\n"],"mappings":";;;;;AAKA,MAAa,oBAAoB,EAAE,KAAK;CAAC;CAAO;CAAU;AAAM,CAAC;;AAGjE,MAAa,oBAAoB,EAAE,KAAK;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,MAAa,uBAAuB,EAAE,aAAa;CACjD,eAAe,EAAE,QAAQ;CACzB,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAClC,aAAa,EAAE,QAAQ;CACvB,cAAc,EAAE,QAAQ;CACxB,cAAc,EAAE,QAAQ;CACxB,YAAY,EAAE,IAAI,CAAC,CAAC,SAAS;AAC/B,CAAC;AAED,MAAM,eAAe;CACnB,eAAe;CACf,IAAI;CACJ,cAAc;CACd,QAAQ,aAAa,SAAS;CAC9B,SAAS,aAAa,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAChC,OAAO,EAAE,IAAI;CACb,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACxB,MAAM;CACN,YAAY;CACZ,UAAU;CACV,UAAU,EACP,OAAO,CAAC,CACR,MAAM,gBAAgB,CAAC,CACvB,SAAS,CAAC,CACV,SACC,iGACF;CACF,WAAW;CACX,WAAW;AACb;;AAGA,MAAa,eAAe,EAAE,mBAAmB,SAAS,CACxD,EAAE,aAAa;CACb,GAAG;CACH,OAAO,EAAE,KAAK;EAAC;EAAa;EAAS;CAAQ,CAAC;CAC9C,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;AACxC,CAAC,GACD,EAAE,aAAa;CACb,GAAG;CACH,OAAO,EAAE,KAAK;EAAC;EAAU;EAAY;EAAc;CAAa,CAAC;CACjE,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAC7B,CAAC,CACH,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ //#region src/schema/common.d.ts
3
+ /** Clock returning a validated UTC ISO-8601 timestamp string. */
4
+ type IsoDateTimeClock = () => string;
5
+ /** Clock returning a Date for calendar and elapsed-time policy decisions. */
6
+ type DateClock = () => Date;
7
+ /** Monotonic-style clock returning elapsed milliseconds as a number. */
8
+ type MillisecondClock = () => number;
9
+ /** Value supplied synchronously or through a Promise. */
10
+ type MaybePromise<Value> = Value | Promise<Value>;
11
+ /** Version written into every persisted Factory entity snapshot. */
12
+ declare const SCHEMA_VERSION = 1;
13
+ /** Validates the schema version supported by this package release. */
14
+ declare const schemaVersionSchema: z.ZodLiteral<1>;
15
+ /** Validates UTC timestamps serialized in ISO 8601 form. */
16
+ declare const isoDateTimeSchema: z.ZodISODateTime;
17
+ /** Validates a finite, nonnegative monetary amount denominated in US dollars. */
18
+ declare const usdSchema: z.ZodNumber;
19
+ /**
20
+ * Open vocabulary value. Standard values ship as exported constants; custom
21
+ * values matching the pattern are equally valid.
22
+ */
23
+ declare const vocabularySchema: z.ZodString;
24
+ /** Validates a connector-neutral destination for workflow replies. */
25
+ declare const replyToSchema: z.ZodObject<{
26
+ channel: z.ZodString;
27
+ address: z.ZodString;
28
+ }, z.core.$strict>;
29
+ /** Connector-neutral destination that preserves where a workflow should reply. */
30
+ type ReplyTo = z.infer<typeof replyToSchema>;
31
+ //#endregion
32
+ export { DateClock, IsoDateTimeClock, MaybePromise, MillisecondClock, ReplyTo, SCHEMA_VERSION, isoDateTimeSchema, replyToSchema, schemaVersionSchema, usdSchema, vocabularySchema };
33
+ //# sourceMappingURL=common.d.mts.map
@@ -1,33 +1,24 @@
1
1
  import { z } from "zod";
2
2
  //#region src/schema/common.ts
3
+ /** Version written into every persisted Factory entity snapshot. */
3
4
  const SCHEMA_VERSION = 1;
5
+ /** Validates the schema version supported by this package release. */
4
6
  const schemaVersionSchema = z.literal(1).describe("Version of the entity schema this row was written with.");
7
+ /** Validates UTC timestamps serialized in ISO 8601 form. */
5
8
  const isoDateTimeSchema = z.iso.datetime().describe("UTC timestamp in ISO 8601 format, e.g. 2026-08-26T12:00:00Z.");
9
+ /** Validates a finite, nonnegative monetary amount denominated in US dollars. */
6
10
  const usdSchema = z.number().finite().nonnegative().describe("Amount in US dollars.");
7
11
  /**
8
12
  * Open vocabulary value. Standard values ship as exported constants; custom
9
13
  * values matching the pattern are equally valid.
10
14
  */
11
15
  const vocabularySchema = z.string().regex(/^[a-z][a-z0-9_]{0,63}$/, "must be lowercase snake_case starting with a letter").describe("Lowercase snake_case name, e.g. github_issue or sentry_alert.");
16
+ /** Validates a connector-neutral destination for workflow replies. */
12
17
  const replyToSchema = z.strictObject({
13
18
  channel: z.string().min(1).describe("Connector that should carry replies, e.g. github or slack."),
14
19
  address: z.string().min(1).describe("Connector-specific reply address, e.g. acme/web#41 or a Slack thread id.")
15
20
  });
16
21
  //#endregion
17
- //#region src/schema/id.ts
18
- function idSchema(prefix) {
19
- return z.string().regex(new RegExp(`^${prefix}_[a-z0-9]{6,64}$`));
20
- }
21
- const factoryIdSchema = idSchema("fac");
22
- const repositoryIdSchema = idSchema("repo");
23
- const signalIdSchema = idSchema("sig");
24
- const taskIdSchema = idSchema("task");
25
- const changeIdSchema = idSchema("chg");
26
- const receiptIdSchema = idSchema("rcpt");
27
- const outboxIdSchema = idSchema("out");
28
- const answerIdSchema = idSchema("ans");
29
- const repositoryIdsSchema = z.array(repositoryIdSchema).min(1);
30
- //#endregion
31
- export { receiptIdSchema as a, signalIdSchema as c, isoDateTimeSchema as d, replyToSchema as f, vocabularySchema as h, outboxIdSchema as i, taskIdSchema as l, usdSchema as m, changeIdSchema as n, repositoryIdSchema as o, schemaVersionSchema as p, factoryIdSchema as r, repositoryIdsSchema as s, answerIdSchema as t, SCHEMA_VERSION as u };
22
+ export { SCHEMA_VERSION, isoDateTimeSchema, replyToSchema, schemaVersionSchema, usdSchema, vocabularySchema };
32
23
 
33
- //# sourceMappingURL=id-BLIkCVue.mjs.map
24
+ //# sourceMappingURL=common.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.mjs","names":[],"sources":["../../src/schema/common.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/** Clock returning a validated UTC ISO-8601 timestamp string. */\nexport type IsoDateTimeClock = () => string;\n/** Clock returning a Date for calendar and elapsed-time policy decisions. */\nexport type DateClock = () => Date;\n/** Monotonic-style clock returning elapsed milliseconds as a number. */\nexport type MillisecondClock = () => number;\n/** Value supplied synchronously or through a Promise. */\nexport type MaybePromise<Value> = Value | Promise<Value>;\n\n/** Version written into every persisted Factory entity snapshot. */\nexport const SCHEMA_VERSION = 1;\n\n/** Validates the schema version supported by this package release. */\nexport const schemaVersionSchema = z\n .literal(SCHEMA_VERSION)\n .describe(\"Version of the entity schema this row was written with.\");\n\n/** Validates UTC timestamps serialized in ISO 8601 form. */\nexport const isoDateTimeSchema = z.iso\n .datetime()\n .describe(\"UTC timestamp in ISO 8601 format, e.g. 2026-08-26T12:00:00Z.\");\n\n/** Validates a finite, nonnegative monetary amount denominated in US dollars. */\nexport const usdSchema = z.number().finite().nonnegative().describe(\"Amount in US dollars.\");\n\n/**\n * Open vocabulary value. Standard values ship as exported constants; custom\n * values matching the pattern are equally valid.\n */\nexport const vocabularySchema = z\n .string()\n .regex(/^[a-z][a-z0-9_]{0,63}$/, \"must be lowercase snake_case starting with a letter\")\n .describe(\"Lowercase snake_case name, e.g. github_issue or sentry_alert.\");\n\n/** Validates a connector-neutral destination for workflow replies. */\nexport const replyToSchema = z.strictObject({\n channel: z.string().min(1).describe(\"Connector that should carry replies, e.g. github or slack.\"),\n address: z\n .string()\n .min(1)\n .describe(\"Connector-specific reply address, e.g. acme/web#41 or a Slack thread id.\"),\n});\n\n/** Connector-neutral destination that preserves where a workflow should reply. */\nexport type ReplyTo = z.infer<typeof replyToSchema>;\n"],"mappings":";;;AAYA,MAAa,iBAAiB;;AAG9B,MAAa,sBAAsB,EAChC,QAAA,CAAsB,CAAC,CACvB,SAAS,yDAAyD;;AAGrE,MAAa,oBAAoB,EAAE,IAChC,SAAS,CAAC,CACV,SAAS,8DAA8D;;AAG1E,MAAa,YAAY,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,uBAAuB;;;;;AAM3F,MAAa,mBAAmB,EAC7B,OAAO,CAAC,CACR,MAAM,0BAA0B,qDAAqD,CAAC,CACtF,SAAS,+DAA+D;;AAG3E,MAAa,gBAAgB,EAAE,aAAa;CAC1C,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,4DAA4D;CAChG,SAAS,EACN,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,0EAA0E;AACxF,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ //#region src/schema/communication.d.ts
3
+ /** Standard connector-neutral outcomes understood by communication presenters. */
4
+ declare const communicationOutcomes: readonly ["accepted", "started", "succeeded", "failed", "cancelled", "needs_human", "question", "digest", "rolled_back", "budget_warning", "budget_exhausted", "message"];
5
+ /** Validates the bounded outcome vocabulary of an outbound communication event. */
6
+ declare const communicationOutcomeSchema: z.ZodEnum<{
7
+ message: "message";
8
+ succeeded: "succeeded";
9
+ failed: "failed";
10
+ needs_human: "needs_human";
11
+ cancelled: "cancelled";
12
+ accepted: "accepted";
13
+ question: "question";
14
+ rolled_back: "rolled_back";
15
+ started: "started";
16
+ digest: "digest";
17
+ budget_warning: "budget_warning";
18
+ budget_exhausted: "budget_exhausted";
19
+ }>;
20
+ /** Validates a connector-neutral event queued for delivery to its original destination. */
21
+ declare const communicationEventSchema: z.ZodObject<{
22
+ eventId: z.ZodString;
23
+ 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>>>>;
24
+ taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
25
+ changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
26
+ replyTo: z.ZodObject<{
27
+ channel: z.ZodString;
28
+ address: z.ZodString;
29
+ }, z.core.$strict>;
30
+ outcome: z.ZodEnum<{
31
+ message: "message";
32
+ succeeded: "succeeded";
33
+ failed: "failed";
34
+ needs_human: "needs_human";
35
+ cancelled: "cancelled";
36
+ accepted: "accepted";
37
+ question: "question";
38
+ rolled_back: "rolled_back";
39
+ started: "started";
40
+ digest: "digest";
41
+ budget_warning: "budget_warning";
42
+ budget_exhausted: "budget_exhausted";
43
+ }>;
44
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
45
+ }, z.core.$strict>;
46
+ /** Outcome category used by connector renderers to present a workflow event. */
47
+ type CommunicationOutcome = z.infer<typeof communicationOutcomeSchema>;
48
+ /** Connector-neutral outbound workflow event with a stable delivery identity. */
49
+ type CommunicationEvent = z.infer<typeof communicationEventSchema>;
50
+ //#endregion
51
+ export { CommunicationEvent, CommunicationOutcome, communicationEventSchema, communicationOutcomeSchema, communicationOutcomes };
52
+ //# sourceMappingURL=communication.d.mts.map
@@ -1,11 +1,14 @@
1
- import { f as replyToSchema, l as taskIdSchema, n as changeIdSchema, s as repositoryIdsSchema } from "./id-BLIkCVue.mjs";
1
+ import { changeIdSchema, repositoryIdsSchema, taskIdSchema } from "./id.mjs";
2
+ import { replyToSchema } from "./common.mjs";
2
3
  import { z } from "zod";
3
4
  //#region src/schema/communication.ts
5
+ /** Standard connector-neutral outcomes understood by communication presenters. */
4
6
  const communicationOutcomes = [
5
7
  "accepted",
6
8
  "started",
7
9
  "succeeded",
8
10
  "failed",
11
+ "cancelled",
9
12
  "needs_human",
10
13
  "question",
11
14
  "digest",
@@ -14,7 +17,9 @@ const communicationOutcomes = [
14
17
  "budget_exhausted",
15
18
  "message"
16
19
  ];
20
+ /** Validates the bounded outcome vocabulary of an outbound communication event. */
17
21
  const communicationOutcomeSchema = z.enum(communicationOutcomes).describe("Lifecycle outcome a connector should render and deliver.");
22
+ /** Validates a connector-neutral event queued for delivery to its original destination. */
18
23
  const communicationEventSchema = z.strictObject({
19
24
  eventId: z.string().min(1).describe("Stable idempotency key for this delivery."),
20
25
  repositoryIds: repositoryIdsSchema,
@@ -25,6 +30,6 @@ const communicationEventSchema = z.strictObject({
25
30
  data: z.record(z.string(), z.unknown()).describe("Outcome-specific connector payload.")
26
31
  });
27
32
  //#endregion
28
- export { communicationOutcomeSchema as n, communicationOutcomes as r, communicationEventSchema as t };
33
+ export { communicationEventSchema, communicationOutcomeSchema, communicationOutcomes };
29
34
 
30
- //# sourceMappingURL=communication-Kd9nU5RP.mjs.map
35
+ //# sourceMappingURL=communication.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communication.mjs","names":[],"sources":["../../src/schema/communication.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { replyToSchema } from \"./common\";\nimport { changeIdSchema, repositoryIdsSchema, taskIdSchema } from \"./id\";\n\n/** Standard connector-neutral outcomes understood by communication presenters. */\nexport const communicationOutcomes = [\n \"accepted\",\n \"started\",\n \"succeeded\",\n \"failed\",\n \"cancelled\",\n \"needs_human\",\n \"question\",\n \"digest\",\n \"rolled_back\",\n \"budget_warning\",\n \"budget_exhausted\",\n \"message\",\n] as const;\n\n/** Validates the bounded outcome vocabulary of an outbound communication event. */\nexport const communicationOutcomeSchema = z\n .enum(communicationOutcomes)\n .describe(\"Lifecycle outcome a connector should render and deliver.\");\n\n/** Validates a connector-neutral event queued for delivery to its original destination. */\nexport const communicationEventSchema = z.strictObject({\n eventId: z.string().min(1).describe(\"Stable idempotency key for this delivery.\"),\n repositoryIds: repositoryIdsSchema,\n taskId: taskIdSchema.optional(),\n changeId: changeIdSchema.optional(),\n replyTo: replyToSchema,\n outcome: communicationOutcomeSchema,\n data: z.record(z.string(), z.unknown()).describe(\"Outcome-specific connector payload.\"),\n});\n\n/** Outcome category used by connector renderers to present a workflow event. */\nexport type CommunicationOutcome = z.infer<typeof communicationOutcomeSchema>;\n/** Connector-neutral outbound workflow event with a stable delivery identity. */\nexport type CommunicationEvent = z.infer<typeof communicationEventSchema>;\n"],"mappings":";;;;;AAKA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAa,6BAA6B,EACvC,KAAK,qBAAqB,CAAC,CAC3B,SAAS,0DAA0D;;AAGtE,MAAa,2BAA2B,EAAE,aAAa;CACrD,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,2CAA2C;CAC/E,eAAe;CACf,QAAQ,aAAa,SAAS;CAC9B,UAAU,eAAe,SAAS;CAClC,SAAS;CACT,SAAS;CACT,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,qCAAqC;AACxF,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { TaskId } from "./id.mjs";
2
+ import { Task } from "./task.mjs";
3
+ import { z } from "zod";
4
+ //#region src/schema/execution.d.ts
5
+ /** Validates a durable evidence reference returned by an execution provider. */
6
+ declare const executionArtifactSchema: z.ZodObject<{
7
+ kind: z.ZodEnum<{
8
+ patch: "patch";
9
+ report: "report";
10
+ log: "log";
11
+ }>;
12
+ ref: z.ZodString;
13
+ }, z.core.$strict>;
14
+ /** Validates a Task identity paired with its positive execution-attempt fence. */
15
+ declare const taskAttemptRefSchema: z.ZodReadonly<z.ZodObject<{
16
+ taskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
17
+ attempt: z.ZodNumber;
18
+ }, z.core.$strict>>;
19
+ /** Stable provider idempotency key derived from one exact Task attempt. */
20
+ type ExecutionLaunchKey = `factory-task:${TaskId}:${number}`;
21
+ /** Validates the stable provider idempotency key for one exact Task attempt. */
22
+ declare const executionLaunchKeySchema: z.ZodType<ExecutionLaunchKey, string>;
23
+ /** Validates the immutable, bounded coding request captured before provider execution. */
24
+ declare const codingExecutionRequestSchema: z.ZodObject<{
25
+ repository: z.ZodObject<{
26
+ slug: z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
27
+ baseSha: z.ZodString;
28
+ }, z.core.$strict>;
29
+ harness: z.ZodEnum<{
30
+ "claude-code": "claude-code";
31
+ codex: "codex";
32
+ fx: "fx";
33
+ pi: "pi";
34
+ }>;
35
+ prompt: z.ZodString;
36
+ allowedConstructs: z.ZodReadonly<z.ZodArray<z.ZodString>>;
37
+ environment: z.ZodObject<{
38
+ snapshotId: z.ZodOptional<z.ZodString>;
39
+ timeoutMs: z.ZodNumber;
40
+ }, z.core.$strict>;
41
+ limits: z.ZodObject<{
42
+ maxTokens: z.ZodOptional<z.ZodNumber>;
43
+ maxCostUsd: z.ZodOptional<z.ZodNumber>;
44
+ }, z.core.$strict>;
45
+ taskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
46
+ attempt: z.ZodNumber;
47
+ }, z.core.$strict>;
48
+ declare const executionResultFieldsSchema: z.ZodObject<{
49
+ execution: z.ZodObject<{
50
+ provider: z.ZodString;
51
+ sessionId: z.ZodString;
52
+ environmentId: z.ZodOptional<z.ZodString>;
53
+ harness: z.ZodOptional<z.ZodString>;
54
+ traceId: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strict>;
56
+ artifacts: z.ZodReadonly<z.ZodArray<z.ZodObject<{
57
+ kind: z.ZodEnum<{
58
+ patch: "patch";
59
+ report: "report";
60
+ log: "log";
61
+ }>;
62
+ ref: z.ZodString;
63
+ }, z.core.$strict>>>;
64
+ usage: z.ZodObject<{
65
+ inputTokens: z.ZodOptional<z.ZodNumber>;
66
+ outputTokens: z.ZodOptional<z.ZodNumber>;
67
+ computeMs: z.ZodNumber;
68
+ costUsd: z.ZodOptional<z.ZodNumber>;
69
+ }, z.core.$strict>;
70
+ reason: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strict>;
72
+ type ExecutionResultFields = z.infer<typeof executionResultFieldsSchema>;
73
+ /** Provider outcome, evidence references, and cumulative usage for one execution attempt. */
74
+ type ExecutionResult = ExecutionResultFields & ({
75
+ status: "completed";
76
+ failureCode?: never;
77
+ } | {
78
+ status: "needs_input";
79
+ failureCode?: never;
80
+ } | {
81
+ status: "cancelled";
82
+ failureCode?: never;
83
+ } | {
84
+ status: "failed";
85
+ failureCode?: "missing_output";
86
+ });
87
+ /** Validates a provider outcome and cumulative usage without inferring Task success. */
88
+ declare const executionResultSchema: z.ZodType<ExecutionResult>;
89
+ /** Task identity and attempt fence used by execution operations and launch keys. */
90
+ type TaskAttemptRef = z.infer<typeof taskAttemptRefSchema>;
91
+ /** Constructs and validates a Task identity with its positive execution-attempt fence. */
92
+ declare function taskAttemptRef(taskId: TaskAttemptRef["taskId"], attempt: number): TaskAttemptRef;
93
+ /** Converts a Task-shaped value into the canonical Task identity and attempt fence. */
94
+ declare function taskAttemptRefFromTask(task: Pick<Task, "id" | "attempt">): TaskAttemptRef;
95
+ /** Immutable repository, harness, capability, environment, and limit request for one coding Task attempt. */
96
+ type CodingExecutionRequest = z.infer<typeof codingExecutionRequestSchema>;
97
+ /** Durable evidence reference returned by an execution provider. */
98
+ type ExecutionArtifact = z.infer<typeof executionArtifactSchema>;
99
+ //#endregion
100
+ export { CodingExecutionRequest, ExecutionArtifact, ExecutionLaunchKey, ExecutionResult, TaskAttemptRef, codingExecutionRequestSchema, executionArtifactSchema, executionLaunchKeySchema, executionResultSchema, taskAttemptRef, taskAttemptRefFromTask, taskAttemptRefSchema };
101
+ //# sourceMappingURL=execution.d.mts.map
@@ -0,0 +1,86 @@
1
+ import { taskIdSchema } from "./id.mjs";
2
+ import { usdSchema } from "./common.mjs";
3
+ import { repositorySlugSchema } from "./repository.mjs";
4
+ import { jsonValueSchema } from "./work.mjs";
5
+ import { executionReferenceSchema } from "./task.mjs";
6
+ import { z } from "zod";
7
+ //#region src/schema/execution.ts
8
+ /** Validates a durable evidence reference returned by an execution provider. */
9
+ const executionArtifactSchema = z.strictObject({
10
+ kind: z.enum([
11
+ "patch",
12
+ "report",
13
+ "log"
14
+ ]).describe("Evidence artifact type."),
15
+ ref: z.string().min(1).max(2048).describe("Durable artifact reference; grants no read authority.")
16
+ });
17
+ const artifacts = z.array(executionArtifactSchema).max(32).readonly().describe("Bounded durable evidence references.");
18
+ /** Validates a Task ID and execution-attempt fence that must travel together. */
19
+ const taskAttemptRefFields = {
20
+ taskId: taskIdSchema.describe("Task that owns the operation."),
21
+ attempt: z.number().int().positive().describe("Current Task execution attempt.")
22
+ };
23
+ /** Validates a Task identity paired with its positive execution-attempt fence. */
24
+ const taskAttemptRefSchema = z.strictObject(taskAttemptRefFields).readonly();
25
+ /** Validates the stable provider idempotency key for one exact Task attempt. */
26
+ const executionLaunchKeySchema = z.string().regex(/^factory-task:task_[a-z0-9]{6,64}:[1-9]\d*$/u, "Expected factory-task:<task-id>:<positive-attempt>");
27
+ /** Validates the immutable, bounded coding request captured before provider execution. */
28
+ const codingExecutionRequestSchema = z.strictObject({
29
+ ...taskAttemptRefFields,
30
+ repository: z.strictObject({
31
+ slug: repositorySlugSchema,
32
+ baseSha: z.string().regex(/^[0-9a-f]{40}$/).describe("Immutable source commit to check out.")
33
+ }).describe("Explicit repository and immutable starting code."),
34
+ harness: z.enum([
35
+ "claude-code",
36
+ "codex",
37
+ "fx",
38
+ "pi"
39
+ ]).describe("Configured V1 coding harness."),
40
+ prompt: z.string().min(1).max(32e3).describe("Bounded instructions captured before launching."),
41
+ allowedConstructs: z.array(z.string().min(1).max(128)).max(64).readonly().describe("Only the capabilities granted by the workflow."),
42
+ environment: z.strictObject({
43
+ snapshotId: z.string().min(1).max(2048).optional().describe("Optional immutable environment snapshot."),
44
+ timeoutMs: z.number().int().positive().describe("Maximum execution duration in milliseconds.")
45
+ }).describe("Reproducible environment policy."),
46
+ limits: z.strictObject({
47
+ maxTokens: z.number().int().positive().optional().describe("Maximum tokens for this execution."),
48
+ maxCostUsd: usdSchema.optional().describe("Maximum execution spend.")
49
+ }).describe("Adapter-enforced execution limits.")
50
+ }).refine((value) => jsonValueSchema.safeParse(value).success, "Execution request must fit bounded work JSON");
51
+ const executionResultFieldsSchema = z.strictObject({
52
+ execution: executionReferenceSchema,
53
+ artifacts,
54
+ usage: z.strictObject({
55
+ inputTokens: z.number().int().nonnegative().optional().describe("Total input tokens for this attempt."),
56
+ outputTokens: z.number().int().nonnegative().optional().describe("Total output tokens for this attempt."),
57
+ computeMs: z.number().int().nonnegative().describe("Observed compute duration."),
58
+ costUsd: usdSchema.optional().describe("Observed attempt cost; absent means unknown, never free.")
59
+ }).describe("Cumulative usage for this attempt, recorded once."),
60
+ reason: z.string().min(1).max(2e3).optional().describe("Human-readable outcome explanation.")
61
+ });
62
+ /** Validates a provider outcome and cumulative usage without inferring Task success. */
63
+ const executionResultSchema = z.discriminatedUnion("status", [
64
+ executionResultFieldsSchema.extend({ status: z.literal("completed").describe("The provider completed its bounded execution.") }),
65
+ executionResultFieldsSchema.extend({ status: z.literal("needs_input").describe("The provider requires additional input.") }),
66
+ executionResultFieldsSchema.extend({ status: z.literal("cancelled").describe("The execution was cancelled.") }),
67
+ executionResultFieldsSchema.extend({
68
+ status: z.literal("failed").describe("The execution failed."),
69
+ failureCode: z.literal("missing_output").optional().describe("Required output was absent. Workflow policy, not this code, authorizes replacement.")
70
+ })
71
+ ]).refine((value) => jsonValueSchema.safeParse(value).success, "Execution result must fit bounded work JSON");
72
+ /** Constructs and validates a Task identity with its positive execution-attempt fence. */
73
+ function taskAttemptRef(taskId, attempt) {
74
+ return taskAttemptRefSchema.parse({
75
+ taskId,
76
+ attempt
77
+ });
78
+ }
79
+ /** Converts a Task-shaped value into the canonical Task identity and attempt fence. */
80
+ function taskAttemptRefFromTask(task) {
81
+ return taskAttemptRef(task.id, task.attempt);
82
+ }
83
+ //#endregion
84
+ export { codingExecutionRequestSchema, executionArtifactSchema, executionLaunchKeySchema, executionResultSchema, taskAttemptRef, taskAttemptRefFromTask, taskAttemptRefSchema };
85
+
86
+ //# sourceMappingURL=execution.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.mjs","names":[],"sources":["../../src/schema/execution.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { usdSchema } from \"./common\";\nimport { taskIdSchema, type TaskId } from \"./id\";\nimport { repositorySlugSchema } from \"./repository\";\nimport { jsonValueSchema } from \"./work\";\n\nimport { executionReferenceSchema } from \"./task\";\n\n/** Validates a durable evidence reference returned by an execution provider. */\nexport const executionArtifactSchema = z.strictObject({\n kind: z.enum([\"patch\", \"report\", \"log\"]).describe(\"Evidence artifact type.\"),\n ref: z\n .string()\n .min(1)\n .max(2048)\n .describe(\"Durable artifact reference; grants no read authority.\"),\n});\nconst artifacts = z\n .array(executionArtifactSchema)\n .max(32)\n .readonly()\n .describe(\"Bounded durable evidence references.\");\n/** Validates a Task ID and execution-attempt fence that must travel together. */\nconst taskAttemptRefFields = {\n taskId: taskIdSchema.describe(\"Task that owns the operation.\"),\n attempt: z.number().int().positive().describe(\"Current Task execution attempt.\"),\n} as const;\n/** Validates a Task identity paired with its positive execution-attempt fence. */\nexport const taskAttemptRefSchema = z.strictObject(taskAttemptRefFields).readonly();\n\n/** Stable provider idempotency key derived from one exact Task attempt. */\nexport type ExecutionLaunchKey = `factory-task:${TaskId}:${number}`;\n/** Validates the stable provider idempotency key for one exact Task attempt. */\nexport const executionLaunchKeySchema = z\n .string()\n .regex(\n /^factory-task:task_[a-z0-9]{6,64}:[1-9]\\d*$/u,\n \"Expected factory-task:<task-id>:<positive-attempt>\",\n ) as z.ZodType<ExecutionLaunchKey, string>;\n\n/** Validates the immutable, bounded coding request captured before provider execution. */\nexport const codingExecutionRequestSchema = z\n .strictObject({\n ...taskAttemptRefFields,\n repository: z\n .strictObject({\n slug: repositorySlugSchema,\n baseSha: z\n .string()\n .regex(/^[0-9a-f]{40}$/)\n .describe(\"Immutable source commit to check out.\"),\n })\n .describe(\"Explicit repository and immutable starting code.\"),\n harness: z.enum([\"claude-code\", \"codex\", \"fx\", \"pi\"]).describe(\"Configured V1 coding harness.\"),\n prompt: z\n .string()\n .min(1)\n .max(32_000)\n .describe(\"Bounded instructions captured before launching.\"),\n allowedConstructs: z\n .array(z.string().min(1).max(128))\n .max(64)\n .readonly()\n .describe(\"Only the capabilities granted by the workflow.\"),\n environment: z\n .strictObject({\n snapshotId: z\n .string()\n .min(1)\n .max(2048)\n .optional()\n .describe(\"Optional immutable environment snapshot.\"),\n timeoutMs: z\n .number()\n .int()\n .positive()\n .describe(\"Maximum execution duration in milliseconds.\"),\n })\n .describe(\"Reproducible environment policy.\"),\n limits: z\n .strictObject({\n maxTokens: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\"Maximum tokens for this execution.\"),\n maxCostUsd: usdSchema.optional().describe(\"Maximum execution spend.\"),\n })\n .describe(\"Adapter-enforced execution limits.\"),\n })\n .refine(\n (value) => jsonValueSchema.safeParse(value).success,\n \"Execution request must fit bounded work JSON\",\n );\n\nconst executionResultFieldsSchema = z.strictObject({\n execution: executionReferenceSchema,\n artifacts,\n usage: z\n .strictObject({\n inputTokens: z\n .number()\n .int()\n .nonnegative()\n .optional()\n .describe(\"Total input tokens for this attempt.\"),\n outputTokens: z\n .number()\n .int()\n .nonnegative()\n .optional()\n .describe(\"Total output tokens for this attempt.\"),\n computeMs: z.number().int().nonnegative().describe(\"Observed compute duration.\"),\n costUsd: usdSchema\n .optional()\n .describe(\"Observed attempt cost; absent means unknown, never free.\"),\n })\n .describe(\"Cumulative usage for this attempt, recorded once.\"),\n reason: z.string().min(1).max(2000).optional().describe(\"Human-readable outcome explanation.\"),\n});\n\ntype ExecutionResultFields = z.infer<typeof executionResultFieldsSchema>;\n\n/** Provider outcome, evidence references, and cumulative usage for one execution attempt. */\nexport type ExecutionResult = ExecutionResultFields &\n (\n | { status: \"completed\"; failureCode?: never }\n | { status: \"needs_input\"; failureCode?: never }\n | { status: \"cancelled\"; failureCode?: never }\n | { status: \"failed\"; failureCode?: \"missing_output\" }\n );\n\n/** Validates a provider outcome and cumulative usage without inferring Task success. */\nexport const executionResultSchema = z\n .discriminatedUnion(\"status\", [\n executionResultFieldsSchema.extend({\n status: z.literal(\"completed\").describe(\"The provider completed its bounded execution.\"),\n }),\n executionResultFieldsSchema.extend({\n status: z.literal(\"needs_input\").describe(\"The provider requires additional input.\"),\n }),\n executionResultFieldsSchema.extend({\n status: z.literal(\"cancelled\").describe(\"The execution was cancelled.\"),\n }),\n executionResultFieldsSchema.extend({\n status: z.literal(\"failed\").describe(\"The execution failed.\"),\n failureCode: z\n .literal(\"missing_output\")\n .optional()\n .describe(\n \"Required output was absent. Workflow policy, not this code, authorizes replacement.\",\n ),\n }),\n ])\n .refine(\n (value) => jsonValueSchema.safeParse(value).success,\n \"Execution result must fit bounded work JSON\",\n ) as z.ZodType<ExecutionResult>;\n\n/** Task identity and attempt fence used by execution operations and launch keys. */\nexport type TaskAttemptRef = z.infer<typeof taskAttemptRefSchema>;\n/** Constructs and validates a Task identity with its positive execution-attempt fence. */\nexport function taskAttemptRef(taskId: TaskAttemptRef[\"taskId\"], attempt: number): TaskAttemptRef {\n return taskAttemptRefSchema.parse({ taskId, attempt });\n}\n/** Converts a Task-shaped value into the canonical Task identity and attempt fence. */\nexport function taskAttemptRefFromTask(\n task: Pick<import(\"./task\").Task, \"id\" | \"attempt\">,\n): TaskAttemptRef {\n return taskAttemptRef(task.id, task.attempt);\n}\n/** Immutable repository, harness, capability, environment, and limit request for one coding Task attempt. */\nexport type CodingExecutionRequest = z.infer<typeof codingExecutionRequestSchema>;\n/** Durable evidence reference returned by an execution provider. */\nexport type ExecutionArtifact = z.infer<typeof executionArtifactSchema>;\n"],"mappings":";;;;;;;;AASA,MAAa,0BAA0B,EAAE,aAAa;CACpD,MAAM,EAAE,KAAK;EAAC;EAAS;EAAU;CAAK,CAAC,CAAC,CAAC,SAAS,yBAAyB;CAC3E,KAAK,EACF,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,IAAI,CAAC,CACT,SAAS,uDAAuD;AACrE,CAAC;AACD,MAAM,YAAY,EACf,MAAM,uBAAuB,CAAC,CAC9B,IAAI,EAAE,CAAC,CACP,SAAS,CAAC,CACV,SAAS,sCAAsC;;AAElD,MAAM,uBAAuB;CAC3B,QAAQ,aAAa,SAAS,+BAA+B;CAC7D,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;AACjF;;AAEA,MAAa,uBAAuB,EAAE,aAAa,oBAAoB,CAAC,CAAC,SAAS;;AAKlF,MAAa,2BAA2B,EACrC,OAAO,CAAC,CACR,MACC,gDACA,oDACF;;AAGF,MAAa,+BAA+B,EACzC,aAAa;CACZ,GAAG;CACH,YAAY,EACT,aAAa;EACZ,MAAM;EACN,SAAS,EACN,OAAO,CAAC,CACR,MAAM,gBAAgB,CAAC,CACvB,SAAS,uCAAuC;CACrD,CAAC,CAAC,CACD,SAAS,kDAAkD;CAC9D,SAAS,EAAE,KAAK;EAAC;EAAe;EAAS;EAAM;CAAI,CAAC,CAAC,CAAC,SAAS,+BAA+B;CAC9F,QAAQ,EACL,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,IAAM,CAAC,CACX,SAAS,iDAAiD;CAC7D,mBAAmB,EAChB,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CACjC,IAAI,EAAE,CAAC,CACP,SAAS,CAAC,CACV,SAAS,gDAAgD;CAC5D,aAAa,EACV,aAAa;EACZ,YAAY,EACT,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,IAAI,CAAC,CACT,SAAS,CAAC,CACV,SAAS,0CAA0C;EACtD,WAAW,EACR,OAAO,CAAC,CACR,IAAI,CAAC,CACL,SAAS,CAAC,CACV,SAAS,6CAA6C;CAC3D,CAAC,CAAC,CACD,SAAS,kCAAkC;CAC9C,QAAQ,EACL,aAAa;EACZ,WAAW,EACR,OAAO,CAAC,CACR,IAAI,CAAC,CACL,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,oCAAoC;EAChD,YAAY,UAAU,SAAS,CAAC,CAAC,SAAS,0BAA0B;CACtE,CAAC,CAAC,CACD,SAAS,oCAAoC;AAClD,CAAC,CAAC,CACD,QACE,UAAU,gBAAgB,UAAU,KAAK,CAAC,CAAC,SAC5C,8CACF;AAEF,MAAM,8BAA8B,EAAE,aAAa;CACjD,WAAW;CACX;CACA,OAAO,EACJ,aAAa;EACZ,aAAa,EACV,OAAO,CAAC,CACR,IAAI,CAAC,CACL,YAAY,CAAC,CACb,SAAS,CAAC,CACV,SAAS,sCAAsC;EAClD,cAAc,EACX,OAAO,CAAC,CACR,IAAI,CAAC,CACL,YAAY,CAAC,CACb,SAAS,CAAC,CACV,SAAS,uCAAuC;EACnD,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,4BAA4B;EAC/E,SAAS,UACN,SAAS,CAAC,CACV,SAAS,0DAA0D;CACxE,CAAC,CAAC,CACD,SAAS,mDAAmD;CAC/D,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;AAC/F,CAAC;;AAcD,MAAa,wBAAwB,EAClC,mBAAmB,UAAU;CAC5B,4BAA4B,OAAO,EACjC,QAAQ,EAAE,QAAQ,WAAW,CAAC,CAAC,SAAS,+CAA+C,EACzF,CAAC;CACD,4BAA4B,OAAO,EACjC,QAAQ,EAAE,QAAQ,aAAa,CAAC,CAAC,SAAS,yCAAyC,EACrF,CAAC;CACD,4BAA4B,OAAO,EACjC,QAAQ,EAAE,QAAQ,WAAW,CAAC,CAAC,SAAS,8BAA8B,EACxE,CAAC;CACD,4BAA4B,OAAO;EACjC,QAAQ,EAAE,QAAQ,QAAQ,CAAC,CAAC,SAAS,uBAAuB;EAC5D,aAAa,EACV,QAAQ,gBAAgB,CAAC,CACzB,SAAS,CAAC,CACV,SACC,qFACF;CACJ,CAAC;AACH,CAAC,CAAC,CACD,QACE,UAAU,gBAAgB,UAAU,KAAK,CAAC,CAAC,SAC5C,6CACF;;AAKF,SAAgB,eAAe,QAAkC,SAAiC;CAChG,OAAO,qBAAqB,MAAM;EAAE;EAAQ;CAAQ,CAAC;AACvD;;AAEA,SAAgB,uBACd,MACgB;CAChB,OAAO,eAAe,KAAK,IAAI,KAAK,OAAO;AAC7C"}
@@ -0,0 +1,122 @@
1
+ import { RepositorySlug } from "./repository.mjs";
2
+ import { TaskKind } from "./task.mjs";
3
+ import { z } from "zod";
4
+ //#region src/schema/factory-config.d.ts
5
+ /** Validates one repository allowlist entry and its configured dependency ordering. */
6
+ declare const factoryConfigRepositorySchema: z.ZodReadonly<z.ZodObject<{
7
+ slug: z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
8
+ defaultBranch: z.ZodDefault<z.ZodString>;
9
+ dependsOn: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>>>>;
10
+ }, z.core.$strict>>;
11
+ declare const githubConnectorSchema: z.ZodReadonly<z.ZodObject<{
12
+ owner: z.ZodString;
13
+ connector: z.ZodString;
14
+ }, z.core.$strict>>;
15
+ declare const slackConnectorSchema: z.ZodReadonly<z.ZodObject<{
16
+ connector: z.ZodString;
17
+ operatorDirectMessages: z.ZodDefault<z.ZodBoolean>;
18
+ approvalChannel: z.ZodOptional<z.ZodString>;
19
+ autonomousPullRequests: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
20
+ channelId: z.ZodString;
21
+ mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
22
+ }, z.core.$strict>>>;
23
+ autonomousPullRequestsByRepository: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>, z.ZodNullable<z.ZodReadonly<z.ZodObject<{
24
+ channelId: z.ZodString;
25
+ mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
26
+ }, z.core.$strict>>>>>>;
27
+ }, z.core.$strict>>;
28
+ /** Validates stall detection and replacement-attempt limits for running Tasks. */
29
+ declare const executionPolicySchema: z.ZodReadonly<z.ZodObject<{
30
+ maxAttempts: z.ZodNumber;
31
+ stallMinutes: z.ZodNumber;
32
+ stallMinutesByKind: z.ZodDefault<z.ZodReadonly<z.ZodRecord<z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>> & z.core.$partial, z.ZodNumber>>>;
33
+ }, z.core.$strict>>;
34
+ /** Stall detection and retry limits applied to running Tasks. */
35
+ type ExecutionPolicy = z.infer<typeof executionPolicySchema>;
36
+ /** Conservative default stall window and three-attempt execution policy. */
37
+ declare const defaultExecutionPolicy: Readonly<{
38
+ maxAttempts: number;
39
+ stallMinutes: number;
40
+ stallMinutesByKind: Readonly<Partial<Record<TaskKind, number>>>;
41
+ }>;
42
+ /** Validates the repositories, operators, connectors, budget, and policies of a Factory. */
43
+ declare const factoryConfigSchema: z.ZodReadonly<z.ZodObject<{
44
+ connectors: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
45
+ github: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
46
+ owner: z.ZodString;
47
+ connector: z.ZodString;
48
+ }, z.core.$strict>>>>;
49
+ slack: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
50
+ connector: z.ZodString;
51
+ operatorDirectMessages: z.ZodDefault<z.ZodBoolean>;
52
+ approvalChannel: z.ZodOptional<z.ZodString>;
53
+ autonomousPullRequests: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
54
+ channelId: z.ZodString;
55
+ mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
56
+ }, z.core.$strict>>>;
57
+ autonomousPullRequestsByRepository: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>, z.ZodNullable<z.ZodReadonly<z.ZodObject<{
58
+ channelId: z.ZodString;
59
+ mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
60
+ }, z.core.$strict>>>>>>;
61
+ }, z.core.$strict>>>>>;
62
+ }, z.core.$strict>>>;
63
+ repositories: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
64
+ slug: z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
65
+ defaultBranch: z.ZodDefault<z.ZodString>;
66
+ dependsOn: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>>>>;
67
+ }, z.core.$strict>>>>;
68
+ operators: z.ZodReadonly<z.ZodArray<z.ZodString>>;
69
+ sandboxGitHubCredentials: z.ZodDefault<z.ZodEnum<{
70
+ connect: "connect";
71
+ vercel: "vercel";
72
+ }>>;
73
+ commitIdentity: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
74
+ name: z.ZodString;
75
+ email: z.ZodString;
76
+ }, z.core.$strict>>>;
77
+ approval: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
78
+ source: z.ZodOptional<z.ZodString>;
79
+ kind: z.ZodOptional<z.ZodString>;
80
+ priority: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
81
+ require: z.ZodBoolean;
82
+ }, z.core.$strict>>>>>;
83
+ budget: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
84
+ totalUsd: z.ZodNumber;
85
+ investigationUsd: z.ZodNumber;
86
+ perTaskReservationUsd: z.ZodNumber;
87
+ warningPercent: z.ZodNumber;
88
+ perRepositoryUsd: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>, z.ZodNumber>>>;
89
+ }, z.core.$strict>>>;
90
+ enforceBudget: z.ZodDefault<z.ZodBoolean>;
91
+ execution: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
92
+ maxAttempts: z.ZodNumber;
93
+ stallMinutes: z.ZodNumber;
94
+ stallMinutesByKind: z.ZodDefault<z.ZodReadonly<z.ZodRecord<z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>> & z.core.$partial, z.ZodNumber>>>;
95
+ }, z.core.$strict>>>;
96
+ }, z.core.$strict>>;
97
+ /** Fully resolved repository allowlist entry in a Factory configuration. */
98
+ type FactoryConfigRepository = z.infer<typeof factoryConfigRepositorySchema>;
99
+ /** Fully resolved and validated Factory configuration. */
100
+ type FactoryConfig = z.infer<typeof factoryConfigSchema>;
101
+ type FactoryConfigSchemaInput = z.input<typeof factoryConfigSchema>;
102
+ type FactoryConfigConnectorsInput = Readonly<{
103
+ github: readonly Readonly<z.input<typeof githubConnectorSchema>>[];
104
+ slack?: readonly Readonly<z.input<typeof slackConnectorSchema>>[];
105
+ }>;
106
+ /** Repository allowlist entry accepted when defining a Factory, before defaults are applied. */
107
+ type FactoryConfigRepositoryInput = Readonly<{
108
+ slug: RepositorySlug;
109
+ defaultBranch?: string;
110
+ dependsOn?: readonly RepositorySlug[];
111
+ }>;
112
+ /** Caller input accepted when defining a Factory, before schema defaults are applied. */
113
+ type FactoryConfigInput = Readonly<Omit<FactoryConfigSchemaInput, "connectors" | "repositories" | "operators"> & {
114
+ connectors?: FactoryConfigConnectorsInput;
115
+ repositories: readonly FactoryConfigRepositoryInput[];
116
+ operators: readonly string[];
117
+ }>;
118
+ /** Validates a Factory configuration and applies its declared defaults. */
119
+ declare function defineFactory(config: FactoryConfigInput): FactoryConfig;
120
+ //#endregion
121
+ export { ExecutionPolicy, FactoryConfig, FactoryConfigInput, FactoryConfigRepository, FactoryConfigRepositoryInput, defaultExecutionPolicy, defineFactory, executionPolicySchema, factoryConfigRepositorySchema, factoryConfigSchema };
122
+ //# sourceMappingURL=factory-config.d.mts.map