@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,90 @@
1
+ import { repositorySlugSchema } from "./repository.mjs";
2
+ import { budgetLimitsSchema } from "./budget.mjs";
3
+ import { taskKindSchema } from "./task.mjs";
4
+ import { allowByDefaultApprovalPolicy, approvalPolicySchema } from "../approval.mjs";
5
+ import { slackPrNotificationsSchema } from "./slack-pr-notifications.mjs";
6
+ import { z } from "zod";
7
+ //#region src/schema/factory-config.ts
8
+ /** Validates one repository allowlist entry and its configured dependency ordering. */
9
+ const factoryConfigRepositorySchema = z.strictObject({
10
+ slug: repositorySlugSchema.describe("Repository this factory may work on."),
11
+ defaultBranch: z.string().min(1).default("main").describe("Branch changes land on, usually main."),
12
+ dependsOn: z.array(repositorySlugSchema).readonly().default([]).describe("Repositories that must land changes before this repository.")
13
+ }).readonly();
14
+ const githubConnectorSchema = z.strictObject({
15
+ owner: z.string().regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/).describe("GitHub user or organization that owns this connector installation."),
16
+ connector: z.string().regex(/^github\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/).describe("Vercel Connect UID installed for this GitHub owner.")
17
+ }).readonly();
18
+ const slackConnectorSchema = z.strictObject({
19
+ connector: z.string().regex(/^slack\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/).describe("Vercel Connect UID installed for this Slack app."),
20
+ operatorDirectMessages: z.boolean().default(false).describe("Opt in to operator DMs for human-action requests, digests, and budget alerts. Independent of operator authorization, PR announcements, and replies in the original conversation."),
21
+ approvalChannel: z.string().regex(/^[CDG][A-Z0-9]+$/u).optional().describe("Explicit Slack channel for approval proposals that have no originating Slack thread. Absent disables cross-channel approval notifications."),
22
+ autonomousPullRequests: slackPrNotificationsSchema.optional().describe("Channel announcements for every Factory-produced PR, including human-requested work, in addition to the original conversation reply. Saved Slack settings override this default; resetting restores it. Absent disables announcements unless Slack enables them."),
23
+ autonomousPullRequestsByRepository: z.record(repositorySlugSchema, slackPrNotificationsSchema.nullable()).readonly().optional().describe("Repository-specific PR destinations, taking precedence over the factory-wide default. Null disables announcements for that repository. Saved repository settings override these entries.")
24
+ }).readonly();
25
+ function isSupportedCommitIdentityValue(value, maxBytes) {
26
+ return value.trim() === value && !/[\0\r\n<>]/u.test(value) && new TextEncoder().encode(value).byteLength <= maxBytes;
27
+ }
28
+ const commitIdentitySchema = z.strictObject({
29
+ name: z.string().min(1).refine((value) => isSupportedCommitIdentityValue(value, 256)).describe("Name recorded on Factory-authored commits."),
30
+ email: z.string().email().refine((value) => isSupportedCommitIdentityValue(value, 320)).describe("Email recorded on Factory-authored commits.")
31
+ }).readonly();
32
+ /** Validates stall detection and replacement-attempt limits for running Tasks. */
33
+ const executionPolicySchema = z.strictObject({
34
+ maxAttempts: z.number().int().min(1).describe("Attempts a task may consume before a stall fails it for good."),
35
+ stallMinutes: z.number().int().min(1).describe("Minutes without progress before a running task is marked stalled."),
36
+ stallMinutesByKind: z.partialRecord(taskKindSchema, z.number().int().min(1)).readonly().default({}).describe("Per-kind stall windows for long single-step work, e.g. security_scan: 300.")
37
+ }).readonly();
38
+ /** Conservative default stall window and three-attempt execution policy. */
39
+ const defaultExecutionPolicy = executionPolicySchema.parse({
40
+ maxAttempts: 3,
41
+ stallMinutes: 45,
42
+ stallMinutesByKind: {}
43
+ });
44
+ /** Validates the repositories, operators, connectors, budget, and policies of a Factory. */
45
+ const factoryConfigSchema = z.strictObject({
46
+ connectors: z.strictObject({
47
+ github: z.array(githubConnectorSchema).readonly().refine((connectors) => new Set(connectors.map(({ owner }) => owner)).size === connectors.length, "GitHub connector owners must be unique."),
48
+ slack: z.array(slackConnectorSchema).max(1, "A factory may configure one Slack connector.").readonly().default([])
49
+ }).readonly().default({
50
+ github: [],
51
+ slack: []
52
+ }).describe("Provider connections available to this factory."),
53
+ repositories: z.array(factoryConfigRepositorySchema).min(1).readonly().describe("Repositories this factory is allowed to inspect and change."),
54
+ operators: z.array(z.string().min(1)).min(1).readonly().describe("Provider-qualified identities allowed to operate this factory."),
55
+ sandboxGitHubCredentials: z.enum(["connect", "vercel"]).default("connect").describe("Credential source selected for trusted GitHub Sandbox operations."),
56
+ commitIdentity: commitIdentitySchema.default({
57
+ name: "Vercel Factory",
58
+ email: "not+real@example.org"
59
+ }).describe("Replaceable attribution metadata for Factory-authored commits."),
60
+ approval: approvalPolicySchema.default(allowByDefaultApprovalPolicy).describe("Which Tasks wait for a human before they run. First match wins."),
61
+ budget: budgetLimitsSchema.default({
62
+ totalUsd: 500,
63
+ investigationUsd: 100,
64
+ perTaskReservationUsd: 5,
65
+ warningPercent: 80
66
+ }).describe("Monthly spending thresholds and per-task accounting reservations."),
67
+ enforceBudget: z.boolean().default(true).describe("Refuse new work above the monthly budget. False keeps cost accounting without spending limits or budget alerts."),
68
+ execution: executionPolicySchema.default(defaultExecutionPolicy).describe("Stall detection and retry limits for running tasks.")
69
+ }).superRefine((config, ctx) => {
70
+ const repositories = new Set(config.repositories.map(({ slug }) => slug));
71
+ for (const [index, connector] of config.connectors.slack.entries()) for (const slug of Object.keys(connector.autonomousPullRequestsByRepository ?? {})) if (!repositories.has(slug)) ctx.addIssue({
72
+ code: "custom",
73
+ path: [
74
+ "connectors",
75
+ "slack",
76
+ index,
77
+ "autonomousPullRequestsByRepository",
78
+ slug
79
+ ],
80
+ message: "PR notification destinations must name a configured repository."
81
+ });
82
+ }).readonly();
83
+ /** Validates a Factory configuration and applies its declared defaults. */
84
+ function defineFactory(config) {
85
+ return factoryConfigSchema.parse(config);
86
+ }
87
+ //#endregion
88
+ export { defaultExecutionPolicy, defineFactory, executionPolicySchema, factoryConfigRepositorySchema, factoryConfigSchema };
89
+
90
+ //# sourceMappingURL=factory-config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-config.mjs","names":[],"sources":["../../src/schema/factory-config.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { allowByDefaultApprovalPolicy, approvalPolicySchema } from \"../approval\";\nimport { budgetLimitsSchema } from \"./budget\";\nimport { repositorySlugSchema, type RepositorySlug } from \"./repository\";\nimport { taskKindSchema } from \"./task\";\nimport { slackPrNotificationsSchema } from \"./slack-pr-notifications\";\n\n/** Validates one repository allowlist entry and its configured dependency ordering. */\nexport const factoryConfigRepositorySchema = z\n .strictObject({\n slug: repositorySlugSchema.describe(\"Repository this factory may work on.\"),\n defaultBranch: z\n .string()\n .min(1)\n .default(\"main\")\n .describe(\"Branch changes land on, usually main.\"),\n dependsOn: z\n .array(repositorySlugSchema)\n .readonly()\n .default([])\n .describe(\"Repositories that must land changes before this repository.\"),\n })\n .readonly();\n\nconst githubConnectorSchema = z\n .strictObject({\n owner: z\n .string()\n .regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"GitHub user or organization that owns this connector installation.\"),\n connector: z\n .string()\n .regex(/^github\\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"Vercel Connect UID installed for this GitHub owner.\"),\n })\n .readonly();\n\nconst slackConnectorSchema = z\n .strictObject({\n connector: z\n .string()\n .regex(/^slack\\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"Vercel Connect UID installed for this Slack app.\"),\n operatorDirectMessages: z\n .boolean()\n .default(false)\n .describe(\n \"Opt in to operator DMs for human-action requests, digests, and budget alerts. Independent of operator authorization, PR announcements, and replies in the original conversation.\",\n ),\n approvalChannel: z\n .string()\n .regex(/^[CDG][A-Z0-9]+$/u)\n .optional()\n .describe(\n \"Explicit Slack channel for approval proposals that have no originating Slack thread. Absent disables cross-channel approval notifications.\",\n ),\n autonomousPullRequests: slackPrNotificationsSchema\n .optional()\n .describe(\n \"Channel announcements for every Factory-produced PR, including human-requested work, in addition to the original conversation reply. Saved Slack settings override this default; resetting restores it. Absent disables announcements unless Slack enables them.\",\n ),\n autonomousPullRequestsByRepository: z\n .record(repositorySlugSchema, slackPrNotificationsSchema.nullable())\n .readonly()\n .optional()\n .describe(\n \"Repository-specific PR destinations, taking precedence over the factory-wide default. Null disables announcements for that repository. Saved repository settings override these entries.\",\n ),\n })\n .readonly();\n\nfunction isSupportedCommitIdentityValue(value: string, maxBytes: number): boolean {\n return (\n value.trim() === value &&\n !/[\\0\\r\\n<>]/u.test(value) &&\n new TextEncoder().encode(value).byteLength <= maxBytes\n );\n}\n\nconst commitIdentitySchema = z\n .strictObject({\n name: z\n .string()\n .min(1)\n .refine((value) => isSupportedCommitIdentityValue(value, 256))\n .describe(\"Name recorded on Factory-authored commits.\"),\n email: z\n .string()\n .email()\n .refine((value) => isSupportedCommitIdentityValue(value, 320))\n .describe(\"Email recorded on Factory-authored commits.\"),\n })\n .readonly();\n\n/** Validates stall detection and replacement-attempt limits for running Tasks. */\nexport const executionPolicySchema = z\n .strictObject({\n maxAttempts: z\n .number()\n .int()\n .min(1)\n .describe(\"Attempts a task may consume before a stall fails it for good.\"),\n stallMinutes: z\n .number()\n .int()\n .min(1)\n .describe(\"Minutes without progress before a running task is marked stalled.\"),\n stallMinutesByKind: z\n .partialRecord(taskKindSchema, z.number().int().min(1))\n .readonly()\n .default({})\n .describe(\"Per-kind stall windows for long single-step work, e.g. security_scan: 300.\"),\n })\n .readonly();\n\n/** Stall detection and retry limits applied to running Tasks. */\nexport type ExecutionPolicy = z.infer<typeof executionPolicySchema>;\n\n/** Conservative default stall window and three-attempt execution policy. */\nexport const defaultExecutionPolicy = executionPolicySchema.parse({\n maxAttempts: 3,\n stallMinutes: 45,\n stallMinutesByKind: {},\n});\n\n/** Validates the repositories, operators, connectors, budget, and policies of a Factory. */\nexport const factoryConfigSchema = z\n .strictObject({\n connectors: z\n .strictObject({\n github: z\n .array(githubConnectorSchema)\n .readonly()\n .refine(\n (connectors) =>\n new Set(connectors.map(({ owner }) => owner)).size === connectors.length,\n \"GitHub connector owners must be unique.\",\n ),\n slack: z\n .array(slackConnectorSchema)\n .max(1, \"A factory may configure one Slack connector.\")\n .readonly()\n .default([]),\n })\n .readonly()\n .default({ github: [], slack: [] })\n .describe(\"Provider connections available to this factory.\"),\n repositories: z\n .array(factoryConfigRepositorySchema)\n .min(1)\n .readonly()\n .describe(\"Repositories this factory is allowed to inspect and change.\"),\n operators: z\n .array(z.string().min(1))\n .min(1)\n .readonly()\n .describe(\"Provider-qualified identities allowed to operate this factory.\"),\n sandboxGitHubCredentials: z\n .enum([\"connect\", \"vercel\"])\n .default(\"connect\")\n .describe(\"Credential source selected for trusted GitHub Sandbox operations.\"),\n commitIdentity: commitIdentitySchema\n .default({ name: \"Vercel Factory\", email: \"not+real@example.org\" })\n .describe(\"Replaceable attribution metadata for Factory-authored commits.\"),\n approval: approvalPolicySchema\n .default(allowByDefaultApprovalPolicy)\n .describe(\"Which Tasks wait for a human before they run. First match wins.\"),\n budget: budgetLimitsSchema\n .default({\n totalUsd: 500,\n investigationUsd: 100,\n perTaskReservationUsd: 5,\n warningPercent: 80,\n })\n .describe(\"Monthly spending thresholds and per-task accounting reservations.\"),\n enforceBudget: z\n .boolean()\n .default(true)\n .describe(\n \"Refuse new work above the monthly budget. False keeps cost accounting without spending limits or budget alerts.\",\n ),\n execution: executionPolicySchema\n .default(defaultExecutionPolicy)\n .describe(\"Stall detection and retry limits for running tasks.\"),\n })\n .superRefine((config, ctx) => {\n const repositories = new Set<string>(config.repositories.map(({ slug }) => slug));\n for (const [index, connector] of config.connectors.slack.entries()) {\n for (const slug of Object.keys(connector.autonomousPullRequestsByRepository ?? {})) {\n if (!repositories.has(slug))\n ctx.addIssue({\n code: \"custom\",\n path: [\"connectors\", \"slack\", index, \"autonomousPullRequestsByRepository\", slug],\n message: \"PR notification destinations must name a configured repository.\",\n });\n }\n }\n })\n .readonly();\n\n/** Fully resolved repository allowlist entry in a Factory configuration. */\nexport type FactoryConfigRepository = z.infer<typeof factoryConfigRepositorySchema>;\n\n/** Fully resolved and validated Factory configuration. */\nexport type FactoryConfig = z.infer<typeof factoryConfigSchema>;\ntype FactoryConfigSchemaInput = z.input<typeof factoryConfigSchema>;\ntype FactoryConfigConnectorsInput = Readonly<{\n github: readonly Readonly<z.input<typeof githubConnectorSchema>>[];\n slack?: readonly Readonly<z.input<typeof slackConnectorSchema>>[];\n}>;\n/** Repository allowlist entry accepted when defining a Factory, before defaults are applied. */\nexport type FactoryConfigRepositoryInput = Readonly<{\n slug: RepositorySlug;\n defaultBranch?: string;\n dependsOn?: readonly RepositorySlug[];\n}>;\n/** Caller input accepted when defining a Factory, before schema defaults are applied. */\nexport type FactoryConfigInput = Readonly<\n Omit<FactoryConfigSchemaInput, \"connectors\" | \"repositories\" | \"operators\"> & {\n connectors?: FactoryConfigConnectorsInput;\n repositories: readonly FactoryConfigRepositoryInput[];\n operators: readonly string[];\n }\n>;\n\n/** Validates a Factory configuration and applies its declared defaults. */\nexport function defineFactory(config: FactoryConfigInput): FactoryConfig {\n return factoryConfigSchema.parse(config);\n}\n"],"mappings":"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"}
@@ -0,0 +1,125 @@
1
+ import { z } from "zod";
2
+ //#region src/schema/finding.d.ts
3
+ /** Validates the operational urgency assigned to a repository finding. */
4
+ declare const findingPrioritySchema: z.ZodEnum<{
5
+ P0: "P0";
6
+ P1: "P1";
7
+ P2: "P2";
8
+ P3: "P3";
9
+ }>;
10
+ /** Validates the engineering concern category assigned to a finding. */
11
+ declare const findingCategorySchema: z.ZodEnum<{
12
+ security: "security";
13
+ correctness: "correctness";
14
+ reliability: "reliability";
15
+ performance: "performance";
16
+ compatibility: "compatibility";
17
+ accessibility: "accessibility";
18
+ documentation: "documentation";
19
+ maintainability: "maintainability";
20
+ testing: "testing";
21
+ usability: "usability";
22
+ }>;
23
+ /** Validates how strongly the available evidence supports a finding. */
24
+ declare const findingVerificationLevelSchema: z.ZodEnum<{
25
+ unverified: "unverified";
26
+ supported: "supported";
27
+ confirmed: "confirmed";
28
+ }>;
29
+ /** Validates the method used to investigate or demonstrate a finding. */
30
+ declare const findingVerificationMethodSchema: z.ZodEnum<{
31
+ documentation: "documentation";
32
+ code_inspection: "code_inspection";
33
+ static_analysis: "static_analysis";
34
+ manual_reproduction: "manual_reproduction";
35
+ unit_test: "unit_test";
36
+ integration_test: "integration_test";
37
+ e2e_test: "e2e_test";
38
+ runtime_observation: "runtime_observation";
39
+ }>;
40
+ /**
41
+ * What was done to check the finding. Forces a reporter to distinguish "I
42
+ * think this is a problem" from "I demonstrated it", which is the axis a human
43
+ * approving fixes cares about most.
44
+ */
45
+ declare const findingVerificationSchema: z.ZodObject<{
46
+ level: z.ZodEnum<{
47
+ unverified: "unverified";
48
+ supported: "supported";
49
+ confirmed: "confirmed";
50
+ }>;
51
+ method: z.ZodEnum<{
52
+ documentation: "documentation";
53
+ code_inspection: "code_inspection";
54
+ static_analysis: "static_analysis";
55
+ manual_reproduction: "manual_reproduction";
56
+ unit_test: "unit_test";
57
+ integration_test: "integration_test";
58
+ e2e_test: "e2e_test";
59
+ runtime_observation: "runtime_observation";
60
+ }>;
61
+ summary: z.ZodString;
62
+ limitations: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strict>;
64
+ /** A single problem found in a repository, as a scanner or agent reports it. */
65
+ declare const findingSchema: z.ZodObject<{
66
+ title: z.ZodString;
67
+ body: z.ZodString;
68
+ path: z.ZodOptional<z.ZodString>;
69
+ line: z.ZodOptional<z.ZodNumber>;
70
+ endLine: z.ZodOptional<z.ZodNumber>;
71
+ priority: z.ZodEnum<{
72
+ P0: "P0";
73
+ P1: "P1";
74
+ P2: "P2";
75
+ P3: "P3";
76
+ }>;
77
+ category: z.ZodEnum<{
78
+ security: "security";
79
+ correctness: "correctness";
80
+ reliability: "reliability";
81
+ performance: "performance";
82
+ compatibility: "compatibility";
83
+ accessibility: "accessibility";
84
+ documentation: "documentation";
85
+ maintainability: "maintainability";
86
+ testing: "testing";
87
+ usability: "usability";
88
+ }>;
89
+ verification: z.ZodObject<{
90
+ level: z.ZodEnum<{
91
+ unverified: "unverified";
92
+ supported: "supported";
93
+ confirmed: "confirmed";
94
+ }>;
95
+ method: z.ZodEnum<{
96
+ documentation: "documentation";
97
+ code_inspection: "code_inspection";
98
+ static_analysis: "static_analysis";
99
+ manual_reproduction: "manual_reproduction";
100
+ unit_test: "unit_test";
101
+ integration_test: "integration_test";
102
+ e2e_test: "e2e_test";
103
+ runtime_observation: "runtime_observation";
104
+ }>;
105
+ summary: z.ZodString;
106
+ limitations: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strict>;
108
+ tool: z.ZodOptional<z.ZodString>;
109
+ ruleId: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$strict>;
111
+ /** Operational urgency of a repository finding, from P0 through P3. */
112
+ type FindingPriority = z.infer<typeof findingPrioritySchema>;
113
+ /** Engineering concern category used to group a repository finding. */
114
+ type FindingCategory = z.infer<typeof findingCategorySchema>;
115
+ /** Strength of evidence supporting a reported finding. */
116
+ type FindingVerificationLevel = z.infer<typeof findingVerificationLevelSchema>;
117
+ /** Investigation method used to support a reported finding. */
118
+ type FindingVerificationMethod = z.infer<typeof findingVerificationMethodSchema>;
119
+ /** Evidence level, method, and limitations recorded for a finding. */
120
+ type FindingVerification = z.infer<typeof findingVerificationSchema>;
121
+ /** Structured repository problem reported by a scanner or agent. */
122
+ type Finding = z.infer<typeof findingSchema>;
123
+ //#endregion
124
+ export { Finding, FindingCategory, FindingPriority, FindingVerification, FindingVerificationLevel, FindingVerificationMethod, findingCategorySchema, findingPrioritySchema, findingSchema, findingVerificationLevelSchema, findingVerificationMethodSchema, findingVerificationSchema };
125
+ //# sourceMappingURL=finding.d.mts.map
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ //#region src/schema/finding.ts
3
+ /** Validates the operational urgency assigned to a repository finding. */
4
+ const findingPrioritySchema = z.enum([
5
+ "P0",
6
+ "P1",
7
+ "P2",
8
+ "P3"
9
+ ]).describe("Urgency of a finding: P0 is drop-everything, P3 is nice-to-have.");
10
+ /** Validates the engineering concern category assigned to a finding. */
11
+ const findingCategorySchema = z.enum([
12
+ "security",
13
+ "correctness",
14
+ "reliability",
15
+ "performance",
16
+ "compatibility",
17
+ "accessibility",
18
+ "documentation",
19
+ "maintainability",
20
+ "testing",
21
+ "usability"
22
+ ]);
23
+ /** Validates how strongly the available evidence supports a finding. */
24
+ const findingVerificationLevelSchema = z.enum([
25
+ "unverified",
26
+ "supported",
27
+ "confirmed"
28
+ ]).describe("How sure the reporter is: unverified = suspected from reading; supported = evidence points to it; confirmed = demonstrated.");
29
+ /** Validates the method used to investigate or demonstrate a finding. */
30
+ const findingVerificationMethodSchema = z.enum([
31
+ "code_inspection",
32
+ "static_analysis",
33
+ "manual_reproduction",
34
+ "unit_test",
35
+ "integration_test",
36
+ "e2e_test",
37
+ "runtime_observation",
38
+ "documentation"
39
+ ]);
40
+ /**
41
+ * What was done to check the finding. Forces a reporter to distinguish "I
42
+ * think this is a problem" from "I demonstrated it", which is the axis a human
43
+ * approving fixes cares about most.
44
+ */
45
+ const findingVerificationSchema = z.strictObject({
46
+ level: findingVerificationLevelSchema,
47
+ method: findingVerificationMethodSchema,
48
+ summary: z.string().min(1).max(2e3).describe("What was checked and what it showed."),
49
+ limitations: z.string().min(1).max(2e3).optional().describe("What could not be checked.")
50
+ });
51
+ /** A single problem found in a repository, as a scanner or agent reports it. */
52
+ const findingSchema = z.strictObject({
53
+ title: z.string().min(1).max(200),
54
+ body: z.string().min(1).max(8e3).describe("The problem, its impact, and how to fix it. Markdown."),
55
+ path: z.string().min(1).max(500).optional().describe("Repository-relative file path."),
56
+ line: z.number().int().min(1).optional(),
57
+ endLine: z.number().int().min(1).optional(),
58
+ priority: findingPrioritySchema,
59
+ category: findingCategorySchema,
60
+ verification: findingVerificationSchema,
61
+ tool: z.string().min(1).max(100).optional().describe("Scanner that produced it, e.g. deepsec."),
62
+ ruleId: z.string().min(1).max(200).optional().describe("Scanner rule or check id, when there is one.")
63
+ });
64
+ //#endregion
65
+ export { findingCategorySchema, findingPrioritySchema, findingSchema, findingVerificationLevelSchema, findingVerificationMethodSchema, findingVerificationSchema };
66
+
67
+ //# sourceMappingURL=finding.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finding.mjs","names":[],"sources":["../../src/schema/finding.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/** Validates the operational urgency assigned to a repository finding. */\nexport const findingPrioritySchema = z\n .enum([\"P0\", \"P1\", \"P2\", \"P3\"])\n .describe(\"Urgency of a finding: P0 is drop-everything, P3 is nice-to-have.\");\n\n/** Validates the engineering concern category assigned to a finding. */\nexport const findingCategorySchema = z.enum([\n \"security\",\n \"correctness\",\n \"reliability\",\n \"performance\",\n \"compatibility\",\n \"accessibility\",\n \"documentation\",\n \"maintainability\",\n \"testing\",\n \"usability\",\n]);\n\n/** Validates how strongly the available evidence supports a finding. */\nexport const findingVerificationLevelSchema = z\n .enum([\"unverified\", \"supported\", \"confirmed\"])\n .describe(\n \"How sure the reporter is: unverified = suspected from reading; supported = evidence points to it; confirmed = demonstrated.\",\n );\n\n/** Validates the method used to investigate or demonstrate a finding. */\nexport const findingVerificationMethodSchema = z.enum([\n \"code_inspection\",\n \"static_analysis\",\n \"manual_reproduction\",\n \"unit_test\",\n \"integration_test\",\n \"e2e_test\",\n \"runtime_observation\",\n \"documentation\",\n]);\n\n/**\n * What was done to check the finding. Forces a reporter to distinguish \"I\n * think this is a problem\" from \"I demonstrated it\", which is the axis a human\n * approving fixes cares about most.\n */\nexport const findingVerificationSchema = z.strictObject({\n level: findingVerificationLevelSchema,\n method: findingVerificationMethodSchema,\n summary: z.string().min(1).max(2000).describe(\"What was checked and what it showed.\"),\n limitations: z.string().min(1).max(2000).optional().describe(\"What could not be checked.\"),\n});\n\n/** A single problem found in a repository, as a scanner or agent reports it. */\nexport const findingSchema = z.strictObject({\n title: z.string().min(1).max(200),\n body: z\n .string()\n .min(1)\n .max(8000)\n .describe(\"The problem, its impact, and how to fix it. Markdown.\"),\n path: z.string().min(1).max(500).optional().describe(\"Repository-relative file path.\"),\n line: z.number().int().min(1).optional(),\n endLine: z.number().int().min(1).optional(),\n priority: findingPrioritySchema,\n category: findingCategorySchema,\n verification: findingVerificationSchema,\n tool: z.string().min(1).max(100).optional().describe(\"Scanner that produced it, e.g. deepsec.\"),\n ruleId: z\n .string()\n .min(1)\n .max(200)\n .optional()\n .describe(\"Scanner rule or check id, when there is one.\"),\n});\n\n/** Operational urgency of a repository finding, from P0 through P3. */\nexport type FindingPriority = z.infer<typeof findingPrioritySchema>;\n/** Engineering concern category used to group a repository finding. */\nexport type FindingCategory = z.infer<typeof findingCategorySchema>;\n/** Strength of evidence supporting a reported finding. */\nexport type FindingVerificationLevel = z.infer<typeof findingVerificationLevelSchema>;\n/** Investigation method used to support a reported finding. */\nexport type FindingVerificationMethod = z.infer<typeof findingVerificationMethodSchema>;\n/** Evidence level, method, and limitations recorded for a finding. */\nexport type FindingVerification = z.infer<typeof findingVerificationSchema>;\n/** Structured repository problem reported by a scanner or agent. */\nexport type Finding = z.infer<typeof findingSchema>;\n"],"mappings":";;;AAGA,MAAa,wBAAwB,EAClC,KAAK;CAAC;CAAM;CAAM;CAAM;AAAI,CAAC,CAAC,CAC9B,SAAS,kEAAkE;;AAG9E,MAAa,wBAAwB,EAAE,KAAK;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,MAAa,iCAAiC,EAC3C,KAAK;CAAC;CAAc;CAAa;AAAW,CAAC,CAAC,CAC9C,SACC,6HACF;;AAGF,MAAa,kCAAkC,EAAE,KAAK;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;AAOD,MAAa,4BAA4B,EAAE,aAAa;CACtD,OAAO;CACP,QAAQ;CACR,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS,sCAAsC;CACpF,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,4BAA4B;AAC3F,CAAC;;AAGD,MAAa,gBAAgB,EAAE,aAAa;CAC1C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAChC,MAAM,EACH,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAI,CAAC,CACT,SAAS,uDAAuD;CACnE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,gCAAgC;CACrF,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CACvC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CAC1C,UAAU;CACV,UAAU;CACV,cAAc;CACd,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,yCAAyC;CAC9F,QAAQ,EACL,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SAAS,CAAC,CACV,SAAS,8CAA8C;AAC5D,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ //#region src/schema/id.d.ts
3
+ /** Validates a stable Factory identifier. */
4
+ declare const factoryIdSchema: z.ZodType<`fac_${string}`, string, z.core.$ZodTypeInternals<`fac_${string}`, string>>;
5
+ /** Validates a stable repository identifier. */
6
+ declare const repositoryIdSchema: z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>;
7
+ /** Validates a stable inbound Signal identifier. */
8
+ declare const signalIdSchema: z.ZodType<`sig_${string}`, string, z.core.$ZodTypeInternals<`sig_${string}`, string>>;
9
+ /** Validates a stable Task identifier. */
10
+ declare const taskIdSchema: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
11
+ /** Validates a stable Change identifier. */
12
+ declare const changeIdSchema: z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>;
13
+ /** Validates a stable immutable Receipt identifier. */
14
+ declare const receiptIdSchema: z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>;
15
+ /** Validates a stable communication outbox identifier. */
16
+ declare const outboxIdSchema: z.ZodType<`out_${string}`, string, z.core.$ZodTypeInternals<`out_${string}`, string>>;
17
+ /** Validates a stable immutable answer-event identifier. */
18
+ declare const answerIdSchema: z.ZodType<`ans_${string}`, string, z.core.$ZodTypeInternals<`ans_${string}`, string>>;
19
+ /** Validates a nonempty repository scope expressed as repository identifiers. */
20
+ declare const repositoryIdsSchema: 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>>>>;
21
+ /** Constructs a validated nonempty repository scope from typed identifiers. */
22
+ declare function repositoryScope(first: RepositoryId, ...rest: readonly RepositoryId[]): RepositoryIds;
23
+ /** Stable identifier for one configured Factory. */
24
+ type FactoryId = z.infer<typeof factoryIdSchema>;
25
+ /** Stable identifier for one configured repository. */
26
+ type RepositoryId = z.infer<typeof repositoryIdSchema>;
27
+ /** Nonempty ordered repository scope attached to one Task or event. */
28
+ type RepositoryIds = z.infer<typeof repositoryIdsSchema>;
29
+ /** Stable identifier for one normalized inbound Signal. */
30
+ type SignalId = z.infer<typeof signalIdSchema>;
31
+ /** Stable identifier for one durable unit of workflow work. */
32
+ type TaskId = z.infer<typeof taskIdSchema>;
33
+ /** Stable identifier for one human-visible pull-request Change. */
34
+ type ChangeId = z.infer<typeof changeIdSchema>;
35
+ /** Stable identifier for one immutable audit Receipt. */
36
+ type ReceiptId = z.infer<typeof receiptIdSchema>;
37
+ /** Stable identifier for one communication outbox event. */
38
+ type OutboxId = z.infer<typeof outboxIdSchema>;
39
+ /** Stable identifier for one immutable authenticated answer event. */
40
+ type AnswerId = z.infer<typeof answerIdSchema>;
41
+ //#endregion
42
+ export { AnswerId, ChangeId, FactoryId, OutboxId, ReceiptId, RepositoryId, RepositoryIds, SignalId, TaskId, answerIdSchema, changeIdSchema, factoryIdSchema, outboxIdSchema, receiptIdSchema, repositoryIdSchema, repositoryIdsSchema, repositoryScope, signalIdSchema, taskIdSchema };
43
+ //# sourceMappingURL=id.d.mts.map
@@ -0,0 +1,32 @@
1
+ import { z } from "zod";
2
+ //#region src/schema/id.ts
3
+ function idSchema(prefix) {
4
+ const pattern = new RegExp(`^${prefix}_[a-z0-9]{6,64}$`);
5
+ return z.string().regex(pattern, `Expected ${prefix}_ followed by 6 to 64 lowercase letters or digits`);
6
+ }
7
+ /** Validates a stable Factory identifier. */
8
+ const factoryIdSchema = idSchema("fac");
9
+ /** Validates a stable repository identifier. */
10
+ const repositoryIdSchema = idSchema("repo");
11
+ /** Validates a stable inbound Signal identifier. */
12
+ const signalIdSchema = idSchema("sig");
13
+ /** Validates a stable Task identifier. */
14
+ const taskIdSchema = idSchema("task");
15
+ /** Validates a stable Change identifier. */
16
+ const changeIdSchema = idSchema("chg");
17
+ /** Validates a stable immutable Receipt identifier. */
18
+ const receiptIdSchema = idSchema("rcpt");
19
+ /** Validates a stable communication outbox identifier. */
20
+ const outboxIdSchema = idSchema("out");
21
+ /** Validates a stable immutable answer-event identifier. */
22
+ const answerIdSchema = idSchema("ans");
23
+ /** Validates a nonempty repository scope expressed as repository identifiers. */
24
+ const repositoryIdsSchema = z.tuple([repositoryIdSchema], repositoryIdSchema).readonly();
25
+ /** Constructs a validated nonempty repository scope from typed identifiers. */
26
+ function repositoryScope(first, ...rest) {
27
+ return repositoryIdsSchema.parse([first, ...rest]);
28
+ }
29
+ //#endregion
30
+ export { answerIdSchema, changeIdSchema, factoryIdSchema, outboxIdSchema, receiptIdSchema, repositoryIdSchema, repositoryIdsSchema, repositoryScope, signalIdSchema, taskIdSchema };
31
+
32
+ //# sourceMappingURL=id.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.mjs","names":[],"sources":["../../src/schema/id.ts"],"sourcesContent":["import { z } from \"zod\";\n\nfunction idSchema<const Prefix extends string>(prefix: Prefix) {\n const pattern = new RegExp(`^${prefix}_[a-z0-9]{6,64}$`);\n return z\n .string()\n .regex(\n pattern,\n `Expected ${prefix}_ followed by 6 to 64 lowercase letters or digits`,\n ) as z.ZodType<`${Prefix}_${string}`, string>;\n}\n\n/** Validates a stable Factory identifier. */\nexport const factoryIdSchema = idSchema(\"fac\");\n/** Validates a stable repository identifier. */\nexport const repositoryIdSchema = idSchema(\"repo\");\n/** Validates a stable inbound Signal identifier. */\nexport const signalIdSchema = idSchema(\"sig\");\n/** Validates a stable Task identifier. */\nexport const taskIdSchema = idSchema(\"task\");\n/** Validates a stable Change identifier. */\nexport const changeIdSchema = idSchema(\"chg\");\n/** Validates a stable immutable Receipt identifier. */\nexport const receiptIdSchema = idSchema(\"rcpt\");\n/** Validates a stable communication outbox identifier. */\nexport const outboxIdSchema = idSchema(\"out\");\n/** Validates a stable immutable answer-event identifier. */\nexport const answerIdSchema = idSchema(\"ans\");\n\n/** Validates a nonempty repository scope expressed as repository identifiers. */\nexport const repositoryIdsSchema = z.tuple([repositoryIdSchema], repositoryIdSchema).readonly();\n\n/** Constructs a validated nonempty repository scope from typed identifiers. */\nexport function repositoryScope(\n first: RepositoryId,\n ...rest: readonly RepositoryId[]\n): RepositoryIds {\n return repositoryIdsSchema.parse([first, ...rest]);\n}\n\n/** Stable identifier for one configured Factory. */\nexport type FactoryId = z.infer<typeof factoryIdSchema>;\n/** Stable identifier for one configured repository. */\nexport type RepositoryId = z.infer<typeof repositoryIdSchema>;\n/** Nonempty ordered repository scope attached to one Task or event. */\nexport type RepositoryIds = z.infer<typeof repositoryIdsSchema>;\n/** Stable identifier for one normalized inbound Signal. */\nexport type SignalId = z.infer<typeof signalIdSchema>;\n/** Stable identifier for one durable unit of workflow work. */\nexport type TaskId = z.infer<typeof taskIdSchema>;\n/** Stable identifier for one human-visible pull-request Change. */\nexport type ChangeId = z.infer<typeof changeIdSchema>;\n/** Stable identifier for one immutable audit Receipt. */\nexport type ReceiptId = z.infer<typeof receiptIdSchema>;\n/** Stable identifier for one communication outbox event. */\nexport type OutboxId = z.infer<typeof outboxIdSchema>;\n/** Stable identifier for one immutable authenticated answer event. */\nexport type AnswerId = z.infer<typeof answerIdSchema>;\n"],"mappings":";;AAEA,SAAS,SAAsC,QAAgB;CAC7D,MAAM,UAAU,IAAI,OAAO,IAAI,OAAO,iBAAiB;CACvD,OAAO,EACJ,OAAO,CAAC,CACR,MACC,SACA,YAAY,OAAO,kDACrB;AACJ;;AAGA,MAAa,kBAAkB,SAAS,KAAK;;AAE7C,MAAa,qBAAqB,SAAS,MAAM;;AAEjD,MAAa,iBAAiB,SAAS,KAAK;;AAE5C,MAAa,eAAe,SAAS,MAAM;;AAE3C,MAAa,iBAAiB,SAAS,KAAK;;AAE5C,MAAa,kBAAkB,SAAS,MAAM;;AAE9C,MAAa,iBAAiB,SAAS,KAAK;;AAE5C,MAAa,iBAAiB,SAAS,KAAK;;AAG5C,MAAa,sBAAsB,EAAE,MAAM,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,CAAC,SAAS;;AAG9F,SAAgB,gBACd,OACA,GAAG,MACY;CACf,OAAO,oBAAoB,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;AACnD"}