@vertesia/common 1.5.0-dev.20260725.083715Z → 1.5.0-dev.20260806.125520Z

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 (552) hide show
  1. package/lib/Progress.d.ts.map +1 -1
  2. package/lib/Progress.js.map +1 -1
  3. package/lib/access-control-values.d.ts +98 -0
  4. package/lib/access-control-values.d.ts.map +1 -0
  5. package/lib/access-control-values.js +101 -0
  6. package/lib/access-control-values.js.map +1 -0
  7. package/lib/access-control.d.ts +22 -119
  8. package/lib/access-control.d.ts.map +1 -1
  9. package/lib/access-control.js +6 -78
  10. package/lib/access-control.js.map +1 -1
  11. package/lib/account-values.d.ts +53 -0
  12. package/lib/account-values.d.ts.map +1 -0
  13. package/lib/account-values.js +91 -0
  14. package/lib/account-values.js.map +1 -0
  15. package/lib/analytics.d.ts +12 -38
  16. package/lib/analytics.d.ts.map +1 -1
  17. package/lib/api-schemas/access-control.d.ts +215 -0
  18. package/lib/api-schemas/access-control.d.ts.map +1 -0
  19. package/lib/api-schemas/access-control.js +165 -0
  20. package/lib/api-schemas/access-control.js.map +1 -0
  21. package/lib/api-schemas/account.d.ts +101 -0
  22. package/lib/api-schemas/account.d.ts.map +1 -0
  23. package/lib/api-schemas/account.js +136 -0
  24. package/lib/api-schemas/account.js.map +1 -0
  25. package/lib/api-schemas/adapter.d.ts +80 -0
  26. package/lib/api-schemas/adapter.d.ts.map +1 -0
  27. package/lib/api-schemas/adapter.js +726 -0
  28. package/lib/api-schemas/adapter.js.map +1 -0
  29. package/lib/api-schemas/agent-runs.d.ts +3786 -0
  30. package/lib/api-schemas/agent-runs.d.ts.map +1 -0
  31. package/lib/api-schemas/agent-runs.js +1000 -0
  32. package/lib/api-schemas/agent-runs.js.map +1 -0
  33. package/lib/api-schemas/analytics.d.ts +86 -0
  34. package/lib/api-schemas/analytics.d.ts.map +1 -0
  35. package/lib/api-schemas/analytics.js +58 -0
  36. package/lib/api-schemas/analytics.js.map +1 -0
  37. package/lib/api-schemas/apikey.d.ts +231 -0
  38. package/lib/api-schemas/apikey.d.ts.map +1 -0
  39. package/lib/api-schemas/apikey.js +172 -0
  40. package/lib/api-schemas/apikey.js.map +1 -0
  41. package/lib/api-schemas/app-lifecycle.d.ts +1148 -0
  42. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -0
  43. package/lib/api-schemas/app-lifecycle.js +801 -0
  44. package/lib/api-schemas/app-lifecycle.js.map +1 -0
  45. package/lib/api-schemas/app-runtime.d.ts +10951 -0
  46. package/lib/api-schemas/app-runtime.d.ts.map +1 -0
  47. package/lib/api-schemas/app-runtime.js +874 -0
  48. package/lib/api-schemas/app-runtime.js.map +1 -0
  49. package/lib/api-schemas/apps.d.ts +271 -0
  50. package/lib/api-schemas/apps.d.ts.map +1 -0
  51. package/lib/api-schemas/apps.js +426 -0
  52. package/lib/api-schemas/apps.js.map +1 -0
  53. package/lib/api-schemas/audit-trail.d.ts +465 -0
  54. package/lib/api-schemas/audit-trail.d.ts.map +1 -0
  55. package/lib/api-schemas/audit-trail.js +218 -0
  56. package/lib/api-schemas/audit-trail.js.map +1 -0
  57. package/lib/api-schemas/bulk-operation.d.ts +104 -0
  58. package/lib/api-schemas/bulk-operation.d.ts.map +1 -0
  59. package/lib/api-schemas/bulk-operation.js +66 -0
  60. package/lib/api-schemas/bulk-operation.js.map +1 -0
  61. package/lib/api-schemas/commands.d.ts +50 -0
  62. package/lib/api-schemas/commands.d.ts.map +1 -0
  63. package/lib/api-schemas/commands.js +58 -0
  64. package/lib/api-schemas/commands.js.map +1 -0
  65. package/lib/api-schemas/content.d.ts +3565 -0
  66. package/lib/api-schemas/content.d.ts.map +1 -0
  67. package/lib/api-schemas/content.js +854 -0
  68. package/lib/api-schemas/content.js.map +1 -0
  69. package/lib/api-schemas/cost-analytics.d.ts +300 -0
  70. package/lib/api-schemas/cost-analytics.d.ts.map +1 -0
  71. package/lib/api-schemas/cost-analytics.js +218 -0
  72. package/lib/api-schemas/cost-analytics.js.map +1 -0
  73. package/lib/api-schemas/dashboard.d.ts +408 -0
  74. package/lib/api-schemas/dashboard.d.ts.map +1 -0
  75. package/lib/api-schemas/dashboard.js +311 -0
  76. package/lib/api-schemas/dashboard.js.map +1 -0
  77. package/lib/api-schemas/data-store.d.ts +1650 -0
  78. package/lib/api-schemas/data-store.d.ts.map +1 -0
  79. package/lib/api-schemas/data-store.js +504 -0
  80. package/lib/api-schemas/data-store.js.map +1 -0
  81. package/lib/api-schemas/document-processing.d.ts +1501 -0
  82. package/lib/api-schemas/document-processing.d.ts.map +1 -0
  83. package/lib/api-schemas/document-processing.js +312 -0
  84. package/lib/api-schemas/document-processing.js.map +1 -0
  85. package/lib/api-schemas/embeddings.d.ts +184 -0
  86. package/lib/api-schemas/embeddings.d.ts.map +1 -0
  87. package/lib/api-schemas/embeddings.js +102 -0
  88. package/lib/api-schemas/embeddings.js.map +1 -0
  89. package/lib/api-schemas/environment.d.ts +412 -0
  90. package/lib/api-schemas/environment.d.ts.map +1 -0
  91. package/lib/api-schemas/environment.js +170 -0
  92. package/lib/api-schemas/environment.js.map +1 -0
  93. package/lib/api-schemas/events.d.ts +4918 -0
  94. package/lib/api-schemas/events.d.ts.map +1 -0
  95. package/lib/api-schemas/events.js +888 -0
  96. package/lib/api-schemas/events.js.map +1 -0
  97. package/lib/api-schemas/files.d.ts +107 -0
  98. package/lib/api-schemas/files.d.ts.map +1 -0
  99. package/lib/api-schemas/files.js +137 -0
  100. package/lib/api-schemas/files.js.map +1 -0
  101. package/lib/api-schemas/group.d.ts +122 -0
  102. package/lib/api-schemas/group.d.ts.map +1 -0
  103. package/lib/api-schemas/group.js +142 -0
  104. package/lib/api-schemas/group.js.map +1 -0
  105. package/lib/api-schemas/index.d.ts +36 -0
  106. package/lib/api-schemas/index.d.ts.map +1 -0
  107. package/lib/api-schemas/index.js +36 -0
  108. package/lib/api-schemas/index.js.map +1 -0
  109. package/lib/api-schemas/indexing.d.ts +144 -0
  110. package/lib/api-schemas/indexing.d.ts.map +1 -0
  111. package/lib/api-schemas/indexing.js +217 -0
  112. package/lib/api-schemas/indexing.js.map +1 -0
  113. package/lib/api-schemas/integrations.d.ts +269 -0
  114. package/lib/api-schemas/integrations.d.ts.map +1 -0
  115. package/lib/api-schemas/integrations.js +335 -0
  116. package/lib/api-schemas/integrations.js.map +1 -0
  117. package/lib/api-schemas/interaction.d.ts +22456 -0
  118. package/lib/api-schemas/interaction.d.ts.map +1 -0
  119. package/lib/api-schemas/interaction.js +2071 -0
  120. package/lib/api-schemas/interaction.js.map +1 -0
  121. package/lib/api-schemas/invites.d.ts +162 -0
  122. package/lib/api-schemas/invites.d.ts.map +1 -0
  123. package/lib/api-schemas/invites.js +106 -0
  124. package/lib/api-schemas/invites.js.map +1 -0
  125. package/lib/api-schemas/oauth-server.d.ts +415 -0
  126. package/lib/api-schemas/oauth-server.d.ts.map +1 -0
  127. package/lib/api-schemas/oauth-server.js +193 -0
  128. package/lib/api-schemas/oauth-server.js.map +1 -0
  129. package/lib/api-schemas/oauth.d.ts +150 -0
  130. package/lib/api-schemas/oauth.d.ts.map +1 -0
  131. package/lib/api-schemas/oauth.js +148 -0
  132. package/lib/api-schemas/oauth.js.map +1 -0
  133. package/lib/api-schemas/parameters.d.ts +64 -0
  134. package/lib/api-schemas/parameters.d.ts.map +1 -0
  135. package/lib/api-schemas/parameters.js +246 -0
  136. package/lib/api-schemas/parameters.js.map +1 -0
  137. package/lib/api-schemas/process.d.ts +499 -0
  138. package/lib/api-schemas/process.d.ts.map +1 -0
  139. package/lib/api-schemas/process.js +817 -0
  140. package/lib/api-schemas/process.js.map +1 -0
  141. package/lib/api-schemas/project-configuration.d.ts +4900 -0
  142. package/lib/api-schemas/project-configuration.d.ts.map +1 -0
  143. package/lib/api-schemas/project-configuration.js +425 -0
  144. package/lib/api-schemas/project-configuration.js.map +1 -0
  145. package/lib/api-schemas/project.d.ts +7247 -0
  146. package/lib/api-schemas/project.d.ts.map +1 -0
  147. package/lib/api-schemas/project.js +185 -0
  148. package/lib/api-schemas/project.js.map +1 -0
  149. package/lib/api-schemas/prompt.d.ts +70 -0
  150. package/lib/api-schemas/prompt.d.ts.map +1 -0
  151. package/lib/api-schemas/prompt.js +77 -0
  152. package/lib/api-schemas/prompt.js.map +1 -0
  153. package/lib/api-schemas/quota.d.ts +90 -0
  154. package/lib/api-schemas/quota.d.ts.map +1 -0
  155. package/lib/api-schemas/quota.js +95 -0
  156. package/lib/api-schemas/quota.js.map +1 -0
  157. package/lib/api-schemas/registry.d.ts +98506 -0
  158. package/lib/api-schemas/registry.d.ts.map +1 -0
  159. package/lib/api-schemas/registry.js +2606 -0
  160. package/lib/api-schemas/registry.js.map +1 -0
  161. package/lib/api-schemas/schema-primitives.d.ts +5 -0
  162. package/lib/api-schemas/schema-primitives.d.ts.map +1 -0
  163. package/lib/api-schemas/schema-primitives.js +11 -0
  164. package/lib/api-schemas/schema-primitives.js.map +1 -0
  165. package/lib/api-schemas/secrets.d.ts +497 -0
  166. package/lib/api-schemas/secrets.d.ts.map +1 -0
  167. package/lib/api-schemas/secrets.js +298 -0
  168. package/lib/api-schemas/secrets.js.map +1 -0
  169. package/lib/api-schemas/store.d.ts +22140 -0
  170. package/lib/api-schemas/store.d.ts.map +1 -0
  171. package/lib/api-schemas/store.js +557 -0
  172. package/lib/api-schemas/store.js.map +1 -0
  173. package/lib/api-schemas/sts.d.ts +166 -0
  174. package/lib/api-schemas/sts.d.ts.map +1 -0
  175. package/lib/api-schemas/sts.js +107 -0
  176. package/lib/api-schemas/sts.js.map +1 -0
  177. package/lib/api-schemas/task.d.ts +215 -0
  178. package/lib/api-schemas/task.d.ts.map +1 -0
  179. package/lib/api-schemas/task.js +95 -0
  180. package/lib/api-schemas/task.js.map +1 -0
  181. package/lib/api-schemas/tools.d.ts +111 -0
  182. package/lib/api-schemas/tools.d.ts.map +1 -0
  183. package/lib/api-schemas/tools.js +122 -0
  184. package/lib/api-schemas/tools.js.map +1 -0
  185. package/lib/api-schemas/user.d.ts +208 -0
  186. package/lib/api-schemas/user.d.ts.map +1 -0
  187. package/lib/api-schemas/user.js +180 -0
  188. package/lib/api-schemas/user.js.map +1 -0
  189. package/lib/api-schemas/view-execution.d.ts +3163 -0
  190. package/lib/api-schemas/view-execution.d.ts.map +1 -0
  191. package/lib/api-schemas/view-execution.js +172 -0
  192. package/lib/api-schemas/view-execution.js.map +1 -0
  193. package/lib/api-schemas/views.d.ts +5990 -0
  194. package/lib/api-schemas/views.d.ts.map +1 -0
  195. package/lib/api-schemas/views.js +396 -0
  196. package/lib/api-schemas/views.js.map +1 -0
  197. package/lib/api-schemas/workflow-runs.d.ts +2210 -0
  198. package/lib/api-schemas/workflow-runs.d.ts.map +1 -0
  199. package/lib/api-schemas/workflow-runs.js +589 -0
  200. package/lib/api-schemas/workflow-runs.js.map +1 -0
  201. package/lib/apikey-values.d.ts +10 -0
  202. package/lib/apikey-values.d.ts.map +1 -0
  203. package/lib/apikey-values.js +11 -0
  204. package/lib/apikey-values.js.map +1 -0
  205. package/lib/apikey.d.ts +37 -36
  206. package/lib/apikey.d.ts.map +1 -1
  207. package/lib/apikey.js +5 -4
  208. package/lib/apikey.js.map +1 -1
  209. package/lib/apps.d.ts +142 -1172
  210. package/lib/apps.d.ts.map +1 -1
  211. package/lib/apps.js +4 -0
  212. package/lib/apps.js.map +1 -1
  213. package/lib/ask-user.d.ts +8 -1
  214. package/lib/ask-user.d.ts.map +1 -1
  215. package/lib/audit-trail.d.ts +20 -131
  216. package/lib/audit-trail.d.ts.map +1 -1
  217. package/lib/audit-trail.js.map +1 -1
  218. package/lib/browser-credentials.d.ts +11 -106
  219. package/lib/browser-credentials.d.ts.map +1 -1
  220. package/lib/common.d.ts +59 -81
  221. package/lib/common.d.ts.map +1 -1
  222. package/lib/cost-analytics.d.ts +14 -167
  223. package/lib/cost-analytics.d.ts.map +1 -1
  224. package/lib/cost-analytics.js.map +1 -1
  225. package/lib/data-platform.d.ts +122 -786
  226. package/lib/data-platform.d.ts.map +1 -1
  227. package/lib/data-platform.js +41 -61
  228. package/lib/data-platform.js.map +1 -1
  229. package/lib/email.d.ts +5 -17
  230. package/lib/email.d.ts.map +1 -1
  231. package/lib/email.js +0 -3
  232. package/lib/email.js.map +1 -1
  233. package/lib/embeddings.d.ts +14 -56
  234. package/lib/embeddings.d.ts.map +1 -1
  235. package/lib/environment.d.ts +22 -118
  236. package/lib/environment.d.ts.map +1 -1
  237. package/lib/environment.js +3 -0
  238. package/lib/environment.js.map +1 -1
  239. package/lib/facets.d.ts +4 -7
  240. package/lib/facets.d.ts.map +1 -1
  241. package/lib/group.d.ts +33 -39
  242. package/lib/group.d.ts.map +1 -1
  243. package/lib/group.js +0 -1
  244. package/lib/group.js.map +1 -1
  245. package/lib/index.d.ts +8 -0
  246. package/lib/index.d.ts.map +1 -1
  247. package/lib/index.js +1 -0
  248. package/lib/index.js.map +1 -1
  249. package/lib/integrations.d.ts +20 -108
  250. package/lib/integrations.d.ts.map +1 -1
  251. package/lib/integrations.js.map +1 -1
  252. package/lib/interaction-values.d.ts +11 -0
  253. package/lib/interaction-values.d.ts.map +1 -0
  254. package/lib/interaction-values.js +24 -0
  255. package/lib/interaction-values.js.map +1 -0
  256. package/lib/interaction.d.ts +88 -778
  257. package/lib/interaction.d.ts.map +1 -1
  258. package/lib/interaction.js +8 -12
  259. package/lib/interaction.js.map +1 -1
  260. package/lib/meters.d.ts +11 -7
  261. package/lib/meters.d.ts.map +1 -1
  262. package/lib/meters.js.map +1 -1
  263. package/lib/oauth-server.d.ts +33 -119
  264. package/lib/oauth-server.d.ts.map +1 -1
  265. package/lib/oauth.d.ts +14 -96
  266. package/lib/oauth.d.ts.map +1 -1
  267. package/lib/oauth.js +0 -4
  268. package/lib/oauth.js.map +1 -1
  269. package/lib/payload.d.ts +15 -38
  270. package/lib/payload.d.ts.map +1 -1
  271. package/lib/platform-event-validation.d.ts.map +1 -1
  272. package/lib/platform-event-validation.js +15 -2
  273. package/lib/platform-event-validation.js.map +1 -1
  274. package/lib/platform-event.d.ts +79 -464
  275. package/lib/platform-event.d.ts.map +1 -1
  276. package/lib/platform-event.js.map +1 -1
  277. package/lib/principal-context.d.ts +10 -15
  278. package/lib/principal-context.d.ts.map +1 -1
  279. package/lib/project-values.d.ts +24 -0
  280. package/lib/project-values.d.ts.map +1 -0
  281. package/lib/project-values.js +42 -0
  282. package/lib/project-values.js.map +1 -0
  283. package/lib/project.d.ts +56 -504
  284. package/lib/project.d.ts.map +1 -1
  285. package/lib/project.js +6 -76
  286. package/lib/project.js.map +1 -1
  287. package/lib/prompt.d.ts +20 -51
  288. package/lib/prompt.d.ts.map +1 -1
  289. package/lib/prompt.js.map +1 -1
  290. package/lib/query.d.ts +27 -88
  291. package/lib/query.d.ts.map +1 -1
  292. package/lib/rate-limiter.d.ts +19 -70
  293. package/lib/rate-limiter.d.ts.map +1 -1
  294. package/lib/rate-limiter.js +0 -3
  295. package/lib/rate-limiter.js.map +1 -1
  296. package/lib/refs.d.ts +3 -11
  297. package/lib/refs.d.ts.map +1 -1
  298. package/lib/refs.js.map +1 -1
  299. package/lib/roles/types.d.ts +14 -20
  300. package/lib/roles/types.d.ts.map +1 -1
  301. package/lib/roles/types.js +5 -9
  302. package/lib/roles/types.js.map +1 -1
  303. package/lib/runs.d.ts +6 -25
  304. package/lib/runs.d.ts.map +1 -1
  305. package/lib/schema-for-extraction.js.map +1 -1
  306. package/lib/secrets.d.ts +20 -105
  307. package/lib/secrets.d.ts.map +1 -1
  308. package/lib/store/agent-approval.d.ts +6 -15
  309. package/lib/store/agent-approval.d.ts.map +1 -1
  310. package/lib/store/agent-approval.js.map +1 -1
  311. package/lib/store/agent-run.d.ts +57 -358
  312. package/lib/store/agent-run.d.ts.map +1 -1
  313. package/lib/store/collections.d.ts +11 -63
  314. package/lib/store/collections.d.ts.map +1 -1
  315. package/lib/store/collections.js.map +1 -1
  316. package/lib/store/conversation-state.d.ts +61 -61
  317. package/lib/store/conversation-state.d.ts.map +1 -1
  318. package/lib/store/conversation-state.js +2 -0
  319. package/lib/store/conversation-state.js.map +1 -1
  320. package/lib/store/doc-analyzer.d.ts +9 -32
  321. package/lib/store/doc-analyzer.d.ts.map +1 -1
  322. package/lib/store/dsl-workflow.d.ts +37 -151
  323. package/lib/store/dsl-workflow.d.ts.map +1 -1
  324. package/lib/store/dsl-workflow.js.map +1 -1
  325. package/lib/store/editing-policy-schema.generated.d.ts +3 -0
  326. package/lib/store/editing-policy-schema.generated.d.ts.map +1 -0
  327. package/lib/store/editing-policy-schema.generated.js +28 -0
  328. package/lib/store/editing-policy-schema.generated.js.map +1 -0
  329. package/lib/store/grounded-extraction.d.ts +7 -104
  330. package/lib/store/grounded-extraction.d.ts.map +1 -1
  331. package/lib/store/grounded-extraction.js.map +1 -1
  332. package/lib/store/index.d.ts +2 -0
  333. package/lib/store/index.d.ts.map +1 -1
  334. package/lib/store/index.js +3 -0
  335. package/lib/store/index.js.map +1 -1
  336. package/lib/store/intake-policy-schema.generated.d.ts +3 -0
  337. package/lib/store/intake-policy-schema.generated.d.ts.map +1 -0
  338. package/lib/store/intake-policy-schema.generated.js +1425 -0
  339. package/lib/store/intake-policy-schema.generated.js.map +1 -0
  340. package/lib/store/process-schema.d.ts +81 -1
  341. package/lib/store/process-schema.d.ts.map +1 -1
  342. package/lib/store/process-schema.js +79 -0
  343. package/lib/store/process-schema.js.map +1 -1
  344. package/lib/store/process-validation.d.ts.map +1 -1
  345. package/lib/store/process-validation.js +70 -2
  346. package/lib/store/process-validation.js.map +1 -1
  347. package/lib/store/process.d.ts +36 -125
  348. package/lib/store/process.d.ts.map +1 -1
  349. package/lib/store/process.js.map +1 -1
  350. package/lib/store/rendering.d.ts +9 -64
  351. package/lib/store/rendering.d.ts.map +1 -1
  352. package/lib/store/rendering.js.map +1 -1
  353. package/lib/store/schedule.d.ts +6 -6
  354. package/lib/store/schedule.d.ts.map +1 -1
  355. package/lib/store/store.d.ts +99 -701
  356. package/lib/store/store.d.ts.map +1 -1
  357. package/lib/store/store.js +4 -456
  358. package/lib/store/store.js.map +1 -1
  359. package/lib/store/task.d.ts +15 -59
  360. package/lib/store/task.d.ts.map +1 -1
  361. package/lib/store/task.js +0 -3
  362. package/lib/store/task.js.map +1 -1
  363. package/lib/store/workflow.d.ts +58 -516
  364. package/lib/store/workflow.d.ts.map +1 -1
  365. package/lib/store/workflow.js +31 -11
  366. package/lib/store/workflow.js.map +1 -1
  367. package/lib/sts-errors.d.ts +7 -0
  368. package/lib/sts-errors.d.ts.map +1 -0
  369. package/lib/sts-errors.js +11 -0
  370. package/lib/sts-errors.js.map +1 -0
  371. package/lib/sts-token-types.d.ts +13 -66
  372. package/lib/sts-token-types.d.ts.map +1 -1
  373. package/lib/sts-token-types.js.map +1 -1
  374. package/lib/tools.d.ts +8 -100
  375. package/lib/tools.d.ts.map +1 -1
  376. package/lib/transient-tokens-values.d.ts +11 -0
  377. package/lib/transient-tokens-values.d.ts.map +1 -0
  378. package/lib/transient-tokens-values.js +12 -0
  379. package/lib/transient-tokens-values.js.map +1 -0
  380. package/lib/transient-tokens.d.ts +15 -13
  381. package/lib/transient-tokens.d.ts.map +1 -1
  382. package/lib/transient-tokens.js +5 -5
  383. package/lib/transient-tokens.js.map +1 -1
  384. package/lib/user.d.ts +55 -156
  385. package/lib/user.d.ts.map +1 -1
  386. package/lib/user.js +2 -79
  387. package/lib/user.js.map +1 -1
  388. package/lib/versions.d.ts +34 -1
  389. package/lib/versions.d.ts.map +1 -1
  390. package/lib/versions.js +33 -0
  391. package/lib/versions.js.map +1 -1
  392. package/lib/vertesia-common.js +6 -2
  393. package/lib/vertesia-common.js.map +1 -1
  394. package/lib/view-configuration-validation.js.map +1 -1
  395. package/lib/view-query-validation.js.map +1 -1
  396. package/lib/view-validation-helpers.d.ts +1 -1
  397. package/lib/view-validation-helpers.d.ts.map +1 -1
  398. package/lib/views-schema.d.ts +51 -51
  399. package/lib/views-schema.d.ts.map +1 -1
  400. package/lib/views-validation.js.map +1 -1
  401. package/lib/views.d.ts +58 -314
  402. package/lib/views.d.ts.map +1 -1
  403. package/lib/views.js.map +1 -1
  404. package/lib/workflow-analytics.d.ts +10 -3
  405. package/lib/workflow-analytics.d.ts.map +1 -1
  406. package/package.json +14 -5
  407. package/src/access-control-values.ts +113 -0
  408. package/src/access-control.ts +33 -138
  409. package/src/account-values.ts +95 -0
  410. package/src/analytics.ts +18 -42
  411. package/src/api-schemas/access-control.contract.test.ts +209 -0
  412. package/src/api-schemas/access-control.ts +208 -0
  413. package/src/api-schemas/account.contract.test.ts +318 -0
  414. package/src/api-schemas/account.ts +150 -0
  415. package/src/api-schemas/adapter-edge-cases.test.ts +480 -0
  416. package/src/api-schemas/adapter.ts +778 -0
  417. package/src/api-schemas/agent-runs.ts +1091 -0
  418. package/src/api-schemas/analytics.ts +65 -0
  419. package/src/api-schemas/apikey.contract.test.ts +270 -0
  420. package/src/api-schemas/apikey.ts +199 -0
  421. package/src/api-schemas/app-delete-summary.contract.test.ts +67 -0
  422. package/src/api-schemas/app-lifecycle.ts +900 -0
  423. package/src/api-schemas/app-runtime.ts +1022 -0
  424. package/src/api-schemas/apps.ts +484 -0
  425. package/src/api-schemas/audit-trail.ts +243 -0
  426. package/src/api-schemas/bulk-operation.contract.test.ts +39 -0
  427. package/src/api-schemas/bulk-operation.ts +75 -0
  428. package/src/api-schemas/bundle-isolation.test.ts +80 -0
  429. package/src/api-schemas/commands.contract.test.ts +51 -0
  430. package/src/api-schemas/commands.ts +62 -0
  431. package/src/api-schemas/content.ts +952 -0
  432. package/src/api-schemas/cost-analytics.contract.test.ts +64 -0
  433. package/src/api-schemas/cost-analytics.ts +235 -0
  434. package/src/api-schemas/dashboard.contract.test.ts +127 -0
  435. package/src/api-schemas/dashboard.ts +351 -0
  436. package/src/api-schemas/data-store.contract.test.ts +91 -0
  437. package/src/api-schemas/data-store.ts +571 -0
  438. package/src/api-schemas/document-processing.contract.test.ts +76 -0
  439. package/src/api-schemas/document-processing.ts +344 -0
  440. package/src/api-schemas/embeddings.ts +113 -0
  441. package/src/api-schemas/environment.contract.test.ts +184 -0
  442. package/src/api-schemas/environment.ts +190 -0
  443. package/src/api-schemas/events.ts +981 -0
  444. package/src/api-schemas/files.ts +159 -0
  445. package/src/api-schemas/group.contract.test.ts +205 -0
  446. package/src/api-schemas/group.ts +155 -0
  447. package/src/api-schemas/index.ts +35 -0
  448. package/src/api-schemas/indexing.contract.test.ts +83 -0
  449. package/src/api-schemas/indexing.ts +234 -0
  450. package/src/api-schemas/integrations.ts +369 -0
  451. package/src/api-schemas/interaction.contract.test.ts +27 -0
  452. package/src/api-schemas/interaction.ts +2364 -0
  453. package/src/api-schemas/invites.contract.test.ts +268 -0
  454. package/src/api-schemas/invites.ts +127 -0
  455. package/src/api-schemas/llumiverse.contract.test.ts +108 -0
  456. package/src/api-schemas/mcp-api-key.contract.test.ts +86 -0
  457. package/src/api-schemas/oauth-server.ts +219 -0
  458. package/src/api-schemas/oauth.contract.test.ts +118 -0
  459. package/src/api-schemas/oauth.ts +166 -0
  460. package/src/api-schemas/parameters.test.ts +402 -0
  461. package/src/api-schemas/parameters.ts +310 -0
  462. package/src/api-schemas/process.ts +929 -0
  463. package/src/api-schemas/project-configuration.ts +478 -0
  464. package/src/api-schemas/project.contract.test.ts +365 -0
  465. package/src/api-schemas/project.ts +214 -0
  466. package/src/api-schemas/prompt.ts +88 -0
  467. package/src/api-schemas/pruning-limits.test.ts +189 -0
  468. package/src/api-schemas/quota.contract.test.ts +147 -0
  469. package/src/api-schemas/quota.ts +122 -0
  470. package/src/api-schemas/registry-groups.test.ts +91 -0
  471. package/src/api-schemas/registry.ts +3512 -0
  472. package/src/api-schemas/response-pruning.test.ts +260 -0
  473. package/src/api-schemas/schema-primitives.ts +12 -0
  474. package/src/api-schemas/secrets.ts +332 -0
  475. package/src/api-schemas/store.contract.test.ts +471 -0
  476. package/src/api-schemas/store.ts +604 -0
  477. package/src/api-schemas/sts.contract.test.ts +112 -0
  478. package/src/api-schemas/sts.ts +123 -0
  479. package/src/api-schemas/task.ts +104 -0
  480. package/src/api-schemas/tools.ts +140 -0
  481. package/src/api-schemas/user.contract.test.ts +191 -0
  482. package/src/api-schemas/user.ts +204 -0
  483. package/src/api-schemas/view-execution.ts +200 -0
  484. package/src/api-schemas/views.ts +437 -0
  485. package/src/api-schemas/workflow-runs.ts +653 -0
  486. package/src/apikey-values.ts +10 -0
  487. package/src/apikey.ts +49 -40
  488. package/src/apps.test.ts +82 -0
  489. package/src/apps.ts +283 -1228
  490. package/src/ask-user.ts +9 -1
  491. package/src/audit-trail.ts +45 -137
  492. package/src/browser-credentials.ts +21 -106
  493. package/src/common.ts +67 -78
  494. package/src/cost-analytics.ts +37 -176
  495. package/src/data-platform.ts +205 -776
  496. package/src/email.ts +5 -17
  497. package/src/embeddings.ts +22 -60
  498. package/src/environment.ts +52 -126
  499. package/src/facets.ts +4 -7
  500. package/src/group.ts +38 -42
  501. package/src/index.ts +12 -0
  502. package/src/integrations.ts +39 -129
  503. package/src/interaction-values.ts +23 -0
  504. package/src/interaction.ts +162 -902
  505. package/src/meters.ts +11 -7
  506. package/src/oauth-server.ts +58 -127
  507. package/src/oauth.ts +24 -108
  508. package/src/payload.ts +25 -40
  509. package/src/platform-event-validation.test.ts +26 -0
  510. package/src/platform-event-validation.ts +15 -2
  511. package/src/platform-event.ts +141 -484
  512. package/src/principal-context.ts +11 -15
  513. package/src/project-values.ts +41 -0
  514. package/src/project.ts +116 -588
  515. package/src/prompt.ts +34 -61
  516. package/src/query.ts +34 -93
  517. package/src/rate-limiter.ts +27 -75
  518. package/src/refs.ts +4 -11
  519. package/src/roles/types.ts +20 -20
  520. package/src/runs.ts +11 -24
  521. package/src/secrets.ts +38 -117
  522. package/src/store/agent-approval.ts +9 -14
  523. package/src/store/agent-run.ts +93 -450
  524. package/src/store/collections.ts +21 -63
  525. package/src/store/content-type-editing.test.ts +1 -1
  526. package/src/store/conversation-state.ts +75 -64
  527. package/src/store/doc-analyzer.ts +17 -33
  528. package/src/store/dsl-workflow.ts +62 -158
  529. package/src/store/editing-policy-schema.generated.ts +30 -0
  530. package/src/store/grounded-extraction.ts +13 -104
  531. package/src/store/index.ts +3 -0
  532. package/src/store/intake-policy-schema.generated.ts +1442 -0
  533. package/src/store/process-schema.test.ts +43 -0
  534. package/src/store/process-schema.ts +79 -0
  535. package/src/store/process-validation.test.ts +141 -0
  536. package/src/store/process-validation.ts +82 -2
  537. package/src/store/process.ts +70 -146
  538. package/src/store/rendering.ts +15 -64
  539. package/src/store/store.ts +197 -1204
  540. package/src/store/task.ts +25 -59
  541. package/src/store/workflow.ts +103 -554
  542. package/src/sts-errors.ts +13 -0
  543. package/src/sts-token-types.ts +26 -75
  544. package/src/tools.ts +18 -97
  545. package/src/transient-tokens-values.ts +11 -0
  546. package/src/transient-tokens.ts +16 -13
  547. package/src/user.ts +75 -215
  548. package/src/versions.test.ts +13 -0
  549. package/src/versions.ts +36 -0
  550. package/src/views-schema.test.ts +9 -1
  551. package/src/views.ts +106 -329
  552. package/src/workflow-analytics.ts +10 -3
@@ -0,0 +1,888 @@
1
+ // Runtime schemas for the events API domain.
2
+ import { z } from 'zod';
3
+ import { SystemRolesSchema } from './apikey.js';
4
+ import { AgentRunStatusSchema } from './app-lifecycle.js';
5
+ import * as AuditTrailSchemas from './audit-trail.js';
6
+ import { StringValueMapSchema } from './files.js';
7
+ import { ConversationVisibilitySchema, NumberValueMapSchema } from './interaction.js';
8
+ import { JsonLogicRuleSchema, ProcessDefinitionBodySchema, ProcessRunTypeSchema } from './process.js';
9
+ import { nullableNumberSchema, nullableStringSchema } from './schema-primitives.js';
10
+ import { InteractionExecutionConfigurationSchema } from './store.js';
11
+ export const ServerSentEventsResponseSchema = z.string().meta({ id: 'ServerSentEventsResponse' });
12
+ export const EventPrioritySchema = z.enum(['high', 'normal', 'low']).meta({ id: 'EventPriority' });
13
+ export const AgentDeliveryMatchModeSchema = z.enum(['start', 'signal', 'ensure']).meta({
14
+ id: 'AgentDeliveryMatchMode',
15
+ description: "How a matching event is applied to the external work-item thread's agent run:\n- `start` (default): always start a new run. Gating is done by the subscription filter; no `message_path` is needed.\n- `signal`: deliver only to an *existing* run on the thread (never start) — the follow-up path. `missing_thread` governs the no-run case.\n- `ensure`: deliver to the run on the thread, **starting one if none exists**.\n\nFor `signal`/`ensure` the message is delivered **exactly once**: as the run's initial instruction when starting, or as a signal to an existing/restarted run. Correlation is the provider-neutral `eventThreadTag(event_ref)` — the started run is auto-tagged with it and follow-ups recompute the same tag to find the run.",
16
+ });
17
+ export const WebhookPayloadModeSchema = z
18
+ .enum(['event_envelope', 'legacy_notify_endpoint', 'workflow_notification'])
19
+ .meta({
20
+ id: 'WebhookPayloadMode',
21
+ description: 'Webhook delivery body format:\n- event_envelope: the full platform event + delivery metadata (default for new subscriptions)\n- legacy_notify_endpoint: pre-2025-10 notify_endpoints body {workflowId, runId, status, result}\n- workflow_notification: post-COMPLETION_RESULT_V1 notify_endpoints body {workflow_id, workflow_name, workflow_run_id, event_name, detail}',
22
+ });
23
+ export const WebhookSigningModeSchema = z.enum(['signed', 'legacy_unsigned']).meta({ id: 'WebhookSigningMode' });
24
+ export const WorkflowRuleInputTypeSchema = z
25
+ .enum(['single', 'multiple', 'none'])
26
+ .meta({ id: 'WorkflowRuleInputType' });
27
+ export const SemanticConditionOnErrorSchema = z
28
+ .enum(['fail_open', 'fail_closed'])
29
+ .meta({ id: 'SemanticConditionOnError' });
30
+ export const SemanticConditionModeSchema = z.enum(['enforce', 'shadow']).meta({ id: 'SemanticConditionMode' });
31
+ export const AgentSemanticEvaluatorSchema = z
32
+ .strictObject({
33
+ type: z.literal('agent'),
34
+ interaction_ref: z
35
+ .string()
36
+ .meta({ description: 'Agent interaction ref. Defaults to the general-purpose system agent.' })
37
+ .optional(),
38
+ tool_names: z.array(z.string()).optional(),
39
+ max_iterations: z.number().optional(),
40
+ config: InteractionExecutionConfigurationSchema.optional(),
41
+ })
42
+ .meta({
43
+ id: 'AgentSemanticEvaluator',
44
+ description: 'Evaluates the semantic condition with a non-interactive agent run that may use tools to enrich its decision (fetch documents, inspect processes, ...). Slower and more expensive than the interaction evaluator; the delivery intent stays in `evaluating` until the agent completes.',
45
+ });
46
+ export const InteractionSemanticEvaluatorSchema = z
47
+ .strictObject({
48
+ type: z.literal('interaction'),
49
+ interaction_ref: z
50
+ .string()
51
+ .meta({
52
+ description: 'Optional stored interaction ref used as the classifier. When omitted a built-in ad-hoc classifier prompt is used.',
53
+ })
54
+ .optional(),
55
+ config: InteractionExecutionConfigurationSchema.optional(),
56
+ enrich_with_content: z
57
+ .boolean()
58
+ .meta({
59
+ description: 'Include an excerpt of the content object text when the event resource is a content object.',
60
+ })
61
+ .optional(),
62
+ max_content_chars: z
63
+ .number()
64
+ .meta({ description: 'Maximum characters of content text included in the classifier prompt.' })
65
+ .optional(),
66
+ })
67
+ .meta({
68
+ id: 'InteractionSemanticEvaluator',
69
+ description: 'Evaluates the semantic condition with a single LLM call (no tools). The event envelope — optionally enriched with an excerpt of the content object text — is classified against the instruction.',
70
+ });
71
+ const EventCategorySchema = AuditTrailSchemas.EventCategorySchema;
72
+ export const EventIngestSignatureEncodingSchema = z
73
+ .enum(['hex', 'base64'])
74
+ .meta({ id: 'EventIngestSignatureEncoding' });
75
+ export const EventIngestSignatureAlgorithmSchema = z.enum(['sha256', 'sha1']).meta({
76
+ id: 'EventIngestSignatureAlgorithm',
77
+ description: 'How an ingest channel authenticates inbound requests in addition to the channel ingest token:\n- none (default): token only.\n- hmac: the sender signs the raw request body with a shared secret (GitHub/Stripe style) and the server verifies the signature. The token may then be optional (`token_optional`).',
78
+ });
79
+ export const EventIngestResourceRuleSchema = z
80
+ .strictObject({
81
+ event_type: z
82
+ .array(z.string())
83
+ .meta({ description: 'Match when the captured `event_type` (see `event_type_header`) is one of these.' })
84
+ .optional(),
85
+ when_path_exists: z
86
+ .string()
87
+ .meta({
88
+ description: 'Match only when this dot-path resolves to a defined, non-null value (e.g. `issue.pull_request`).',
89
+ })
90
+ .optional(),
91
+ when_path_absent: z
92
+ .string()
93
+ .meta({ description: 'Match only when this dot-path is undefined/null.' })
94
+ .optional(),
95
+ resource_type: z.string().meta({ description: '`resource_type` to set when this rule matches.' }).optional(),
96
+ resource_id_path: z.string().meta({ description: '`resource_id` from a single dot-path.' }).optional(),
97
+ resource_id_template: z
98
+ .string()
99
+ .meta({
100
+ description: '...or a composed `resource_id` from a `{{dot.path}}` template against the body, e.g. `{{repository.full_name}}#{{pull_request.number}}`. Takes precedence over `resource_id_path`.',
101
+ })
102
+ .optional(),
103
+ })
104
+ .meta({
105
+ id: 'EventIngestResourceRule',
106
+ description: "A conditional rule for deriving `resource_type` + `resource_id` from the body, evaluated in order (first match wins) when a single dot-path can't serve every payload shape a channel receives. A sender whose one webhook delivers heterogeneous events (e.g. a GitHub App: issues, issue comments, PR reviews) needs different thread identities per event family; these rules express that without baking provider knowledge into the server.",
107
+ });
108
+ export const SemanticEvaluationStatusSchema = z
109
+ .enum(['pending', 'running', 'matched', 'not_matched', 'error'])
110
+ .meta({ id: 'SemanticEvaluationStatus' });
111
+ export const EventDeliveryIntentStatusSchema = z
112
+ .enum(['pending', 'evaluating', 'starting', 'running', 'succeeded', 'retrying', 'failed', 'cancelled', 'skipped'])
113
+ .meta({ id: 'EventDeliveryIntentStatus' });
114
+ export const EventOutboxStatusSchema = z
115
+ .enum(['pending', 'routing', 'routed', 'partially_routed', 'failed', 'dropped'])
116
+ .meta({ id: 'EventOutboxStatus' });
117
+ export const EventDeliverySortFieldSchema = z
118
+ .enum(['created_at', 'status', 'resource_type', 'event_category', 'action'])
119
+ .meta({ id: 'EventDeliverySortField' });
120
+ export const WorkflowRuleItemSchema = z
121
+ .strictObject({
122
+ id: z.string().meta({ description: 'Unique identifier for the object' }),
123
+ name: z.string().meta({ description: 'Human-readable name or title' }),
124
+ description: z.string().meta({ description: 'Optional detailed description of the object' }).optional(),
125
+ tags: z.array(z.string()).meta({ description: 'Optional array of categorization tags' }).optional(),
126
+ updated_by: z.string().meta({ description: 'Identifier of the user who last modified the object' }),
127
+ created_by: z.string().meta({ description: 'Identifier of the user who created the object' }),
128
+ created_at: z.string().meta({ description: 'ISO timestamp of when the object was created' }),
129
+ updated_at: z.string().meta({ description: 'ISO timestamp of when the object was last updated' }),
130
+ endpoint: z.string(),
131
+ input_type: WorkflowRuleInputTypeSchema,
132
+ })
133
+ .meta({ id: 'WorkflowRuleItem' });
134
+ export const WebhookEventDeliveryTargetSchema = z
135
+ .strictObject({
136
+ type: z.literal('webhook'),
137
+ url: z.string(),
138
+ has_secret: z.boolean().meta({
139
+ description: 'Server-managed: whether a signing secret is stored. Set by the server, never by callers.',
140
+ }),
141
+ secret_label: z
142
+ .string()
143
+ .meta({ description: 'Server-managed: label of the active signing secret.' })
144
+ .optional(),
145
+ signing_mode: WebhookSigningModeSchema.optional(),
146
+ payload_mode: WebhookPayloadModeSchema.optional(),
147
+ headers: StringValueMapSchema.optional(),
148
+ encrypted_headers: z.boolean().optional(),
149
+ timeout_ms: z.number().optional(),
150
+ result_path: z.string().optional(),
151
+ custom_data: z.looseObject({}).optional(),
152
+ })
153
+ .meta({ id: 'WebhookEventDeliveryTarget' });
154
+ export const AppEventDeliveryTargetSchema = z
155
+ .strictObject({
156
+ type: z.literal('app'),
157
+ app_id: z.string(),
158
+ installation_id: z.string(),
159
+ hook: z.string(),
160
+ url: z.string(),
161
+ timeout_ms: z.number().optional(),
162
+ })
163
+ .meta({ id: 'AppEventDeliveryTarget' });
164
+ export const WorkflowEventDeliveryTargetSchema = z
165
+ .strictObject({
166
+ type: z.literal('workflow'),
167
+ endpoint: z.string(),
168
+ workflow_class: z.string().optional(),
169
+ task_queue: z.string().optional(),
170
+ vars: z.looseObject({}).optional(),
171
+ input_type: WorkflowRuleInputTypeSchema.optional(),
172
+ migrated_rule_name: z.string().optional(),
173
+ })
174
+ .meta({ id: 'WorkflowEventDeliveryTarget' });
175
+ export const EventDeliveryQueueFailureSummarySchema = z
176
+ .strictObject({
177
+ intent_id: z.string(),
178
+ event_id: z.string(),
179
+ status: EventDeliveryIntentStatusSchema,
180
+ attempt_count: z.number(),
181
+ last_error: nullableStringSchema.optional(),
182
+ updated_at: z.string(),
183
+ })
184
+ .meta({ id: 'EventDeliveryQueueFailureSummary' });
185
+ export const EventOutboxQueueSummarySchema = z
186
+ .strictObject({
187
+ total: z.number(),
188
+ active: z.number(),
189
+ failed: z.number(),
190
+ dropped: z.number(),
191
+ by_status: NumberValueMapSchema,
192
+ oldest_active_at: z.string().optional(),
193
+ })
194
+ .meta({ id: 'EventOutboxQueueSummary' });
195
+ export const EventDeliveryQueueSortFieldSchema = z
196
+ .enum(['subscription_name', 'queued', 'active', 'failed', 'oldest'])
197
+ .meta({ id: 'EventDeliveryQueueSortField' });
198
+ export const WorkflowRuleSchema = z
199
+ .strictObject({
200
+ id: z.string().meta({ description: 'Unique identifier for the object' }),
201
+ name: z.string().meta({ description: 'Human-readable name or title' }),
202
+ description: z.string().meta({ description: 'Optional detailed description of the object' }).optional(),
203
+ tags: z.array(z.string()).meta({ description: 'Optional array of categorization tags' }).optional(),
204
+ updated_by: z.string().meta({ description: 'Identifier of the user who last modified the object' }),
205
+ created_by: z.string().meta({ description: 'Identifier of the user who created the object' }),
206
+ created_at: z.string().meta({ description: 'ISO timestamp of when the object was created' }),
207
+ updated_at: z.string().meta({ description: 'ISO timestamp of when the object was last updated' }),
208
+ endpoint: z.string(),
209
+ input_type: WorkflowRuleInputTypeSchema,
210
+ match: z.looseObject({}).optional(),
211
+ config: z.looseObject({}).meta({ description: 'Activities configuration if any.' }).optional(),
212
+ debug: z.boolean().meta({ description: 'Debug mode for the rule', default: false }).optional(),
213
+ customer_override: z
214
+ .boolean()
215
+ .meta({
216
+ description: 'Customer override for the rule When set to true the rule will not be updated by the system',
217
+ })
218
+ .optional(),
219
+ task_queue: z
220
+ .string()
221
+ .meta({ description: 'Optional task queue name to use when starting workflows for this rule' })
222
+ .optional(),
223
+ event_subscription_migration_status: z
224
+ .enum(['migrated', 'unsupported_match', 'failed'])
225
+ .meta({ description: 'Event subscription migration status for legacy workflow-rule cutover.' })
226
+ .optional(),
227
+ event_subscription_migration_error: z
228
+ .string()
229
+ .meta({ description: 'Migration failure or unsupported-match reason, when applicable.' })
230
+ .optional(),
231
+ })
232
+ .meta({ id: 'WorkflowRule' });
233
+ /**
234
+ * Everything a workflow-rule write accepts beyond `endpoint` and `name`. Shared so the update
235
+ * payload below cannot drift from the create payload; spread rather than `.partial()`, because Zod
236
+ * clones a schema's registry metadata and a derived component would collide with its base.
237
+ */
238
+ const workflowRulePayloadFields = {
239
+ match: z.looseObject({}).optional(),
240
+ config: z.looseObject({}).meta({ description: 'Activities configuration if any.' }).optional(),
241
+ debug: z.boolean().meta({ description: 'Debug mode for the rule', default: false }).optional(),
242
+ customer_override: z
243
+ .boolean()
244
+ .meta({
245
+ description: 'Customer override for the rule When set to true the rule will not be updated by the system',
246
+ })
247
+ .optional(),
248
+ task_queue: z
249
+ .string()
250
+ .meta({ description: 'Optional task queue name to use when starting workflows for this rule' })
251
+ .optional(),
252
+ event_subscription_migration_status: z
253
+ .enum(['migrated', 'unsupported_match', 'failed'])
254
+ .meta({ description: 'Event subscription migration status for legacy workflow-rule cutover.' })
255
+ .optional(),
256
+ event_subscription_migration_error: z
257
+ .string()
258
+ .meta({ description: 'Migration failure or unsupported-match reason, when applicable.' })
259
+ .optional(),
260
+ input_type: WorkflowRuleInputTypeSchema.optional(),
261
+ description: z.string().meta({ description: 'Optional detailed description of the object' }).optional(),
262
+ tags: z.array(z.string()).meta({ description: 'Optional array of categorization tags' }).optional(),
263
+ updated_by: z.string().meta({ description: 'Identifier of the user who last modified the object' }).optional(),
264
+ created_by: z.string().meta({ description: 'Identifier of the user who created the object' }).optional(),
265
+ };
266
+ export const CreateWorkflowRulePayloadSchema = z
267
+ .strictObject({
268
+ ...workflowRulePayloadFields,
269
+ endpoint: z.string(),
270
+ name: z.string().meta({ description: 'Human-readable name or title' }),
271
+ })
272
+ .meta({ id: 'CreateWorkflowRulePayload' });
273
+ /**
274
+ * `PUT /workflows/rules/:id` applies whatever fields the body carries. The create payload's required
275
+ * `endpoint` and `name` would force every edit to restate them — the same defect the collection
276
+ * update had, caught here by inspection rather than by a test.
277
+ */
278
+ export const UpdateWorkflowRulePayloadSchema = z
279
+ .strictObject({
280
+ ...workflowRulePayloadFields,
281
+ endpoint: z.string().optional(),
282
+ name: z.string().meta({ description: 'Human-readable name or title' }).optional(),
283
+ })
284
+ .meta({ id: 'UpdateWorkflowRulePayload', description: 'Fields to change on a workflow rule. All optional.' });
285
+ export const AgentEventDeliveryTargetSchema = z
286
+ .strictObject({
287
+ type: z.literal('agent'),
288
+ on_match: AgentDeliveryMatchModeSchema.meta({
289
+ description: 'Behavior when an event matches. Defaults to `start`.',
290
+ }).optional(),
291
+ interaction_ref: z
292
+ .string()
293
+ .meta({
294
+ description: 'Interaction ID, app ref, or system ref. Defaults to the general-purpose system agent.',
295
+ })
296
+ .optional(),
297
+ data: z.looseObject({}).optional(),
298
+ config: InteractionExecutionConfigurationSchema.optional(),
299
+ interactive: z.boolean().optional(),
300
+ visibility: ConversationVisibilitySchema.optional(),
301
+ tags: z.array(z.string()).optional(),
302
+ categories: z.array(z.string()).optional(),
303
+ tool_names: z.array(z.string()).optional(),
304
+ max_iterations: z.number().optional(),
305
+ debug_mode: z.boolean().optional(),
306
+ signal_name: z
307
+ .literal('UserInput')
308
+ .meta({ description: 'Signal sent to an existing/restarted run. Only `UserInput` is implemented.' })
309
+ .optional(),
310
+ message_path: z
311
+ .string()
312
+ .meta({
313
+ description: 'Dot-path to the message (initial instruction when starting, else the signal). Required for signal/ensure.',
314
+ })
315
+ .optional(),
316
+ client_message_id_path: z
317
+ .string()
318
+ .meta({
319
+ description: 'Dot-path to a stable per-message id, carried on the signal for (future) exactly-once dedupe.',
320
+ })
321
+ .optional(),
322
+ statuses: z
323
+ .array(AgentRunStatusSchema)
324
+ .meta({
325
+ description: "Run statuses eligible to receive the signal when a run exists. Defaults to ['running'].",
326
+ })
327
+ .optional(),
328
+ skip_if_path_exists: z
329
+ .string()
330
+ .meta({ description: 'If this dot-path resolves to a value, the delivery is skipped.' })
331
+ .optional(),
332
+ author_path: z.string().meta({ description: 'Dot-path to the message author, for the loop guard.' }).optional(),
333
+ ignore_author_patterns: z
334
+ .array(z.string())
335
+ .meta({
336
+ description: 'Regex patterns matched against the resolved author; a match skips the delivery (loop guard).',
337
+ })
338
+ .optional(),
339
+ require_command_prefixes: z
340
+ .array(z.string())
341
+ .meta({ description: 'The message must start with one of these prefixes to be delivered.' })
342
+ .optional(),
343
+ require_mentions: z
344
+ .array(z.string())
345
+ .meta({ description: '...or contain one of these mentions. Combined with prefixes as OR.' })
346
+ .optional(),
347
+ missing_thread: z
348
+ .enum(['retry', 'skip'])
349
+ .meta({
350
+ description: "`signal` mode only — no run yet (open/follow-up race): 'retry' (default) or 'skip'. Ignored for `ensure`.",
351
+ })
352
+ .optional(),
353
+ on_terminal: z
354
+ .enum(['skip', 'restart'])
355
+ .meta({
356
+ description: 'Behaviour when only terminal runs match: `skip` (default) or `restart` then signal.',
357
+ })
358
+ .optional(),
359
+ metadata: z
360
+ .looseObject({})
361
+ .meta({
362
+ description: "Extra fields merged into the signal's metadata; same `{{event.*}}` / `$event.x` templating as `data`.",
363
+ })
364
+ .optional(),
365
+ })
366
+ .meta({ id: 'AgentEventDeliveryTarget' });
367
+ export const WebhookEventDeliveryTargetInputSchema = z
368
+ .strictObject({
369
+ rotate_signing_secret: z
370
+ .boolean()
371
+ .meta({ description: 'Request rotation of the stored signing secret on update.' })
372
+ .optional(),
373
+ type: z.literal('webhook'),
374
+ url: z.string(),
375
+ // Accepted and ignored, not writable. Editing a webhook subscription means reading it and
376
+ // sending the target back with one field changed, and the read target carries these two;
377
+ // `normalizeEventSubscriptionTarget` strips them server-side, so rejecting them here would
378
+ // only break that round-trip. The stored values are derived from the secret store.
379
+ has_secret: z
380
+ .boolean()
381
+ .meta({ description: 'Server-managed: ignored on write, echoed back from a read.' })
382
+ .optional(),
383
+ secret_label: z
384
+ .string()
385
+ .meta({ description: 'Server-managed: ignored on write, echoed back from a read.' })
386
+ .optional(),
387
+ signing_mode: WebhookSigningModeSchema.optional(),
388
+ payload_mode: WebhookPayloadModeSchema.optional(),
389
+ headers: StringValueMapSchema.optional(),
390
+ encrypted_headers: z.boolean().optional(),
391
+ timeout_ms: z.number().optional(),
392
+ result_path: z.string().optional(),
393
+ custom_data: z.looseObject({}).optional(),
394
+ })
395
+ .meta({ id: 'WebhookEventDeliveryTargetInput' });
396
+ export const AppEventDeliveryTargetInputSchema = z
397
+ .strictObject({
398
+ type: z.literal('app'),
399
+ app_id: z.string(),
400
+ installation_id: z.string(),
401
+ hook: z.string(),
402
+ url: z.string(),
403
+ timeout_ms: z.number().optional(),
404
+ })
405
+ .meta({ id: 'AppEventDeliveryTargetInput' });
406
+ export const WorkflowEventDeliveryTargetInputSchema = z
407
+ .strictObject({
408
+ type: z.literal('workflow'),
409
+ endpoint: z.string(),
410
+ workflow_class: z.string().optional(),
411
+ task_queue: z.string().optional(),
412
+ vars: z.looseObject({}).optional(),
413
+ input_type: WorkflowRuleInputTypeSchema.optional(),
414
+ // Same round-trip allowance as the webhook input above: the read target carries this, the
415
+ // update handler re-applies it from the stored target rather than from the body.
416
+ migrated_rule_name: z
417
+ .string()
418
+ .meta({ description: 'Server-managed: ignored on write, echoed back from a read.' })
419
+ .optional(),
420
+ })
421
+ .meta({ id: 'WorkflowEventDeliveryTargetInput' });
422
+ export const SemanticEvaluatorSchema = z
423
+ .discriminatedUnion('type', [InteractionSemanticEvaluatorSchema, AgentSemanticEvaluatorSchema])
424
+ .meta({ id: 'SemanticEvaluator' });
425
+ export const EventIngestSignatureConfigSchema = z
426
+ .strictObject({
427
+ header: z.string().meta({ description: 'Request header carrying the signature, e.g. `x-hub-signature-256`.' }),
428
+ algorithm: EventIngestSignatureAlgorithmSchema.optional(),
429
+ encoding: EventIngestSignatureEncodingSchema.optional(),
430
+ prefix: z
431
+ .string()
432
+ .meta({ description: 'Literal prefix stripped from the header value before comparison, e.g. `sha256=`.' })
433
+ .optional(),
434
+ has_secret: z
435
+ .boolean()
436
+ .meta({ description: 'Server-managed: whether a signing secret is stored for this channel.' })
437
+ .optional(),
438
+ secret_hint: z
439
+ .string()
440
+ .meta({ description: 'Server-managed: label/hint of the stored signing secret.' })
441
+ .optional(),
442
+ })
443
+ .meta({
444
+ id: 'EventIngestSignatureConfig',
445
+ description: 'Optional HMAC signature verification for an ingest channel. When configured, the server recomputes `HMAC(algorithm, signing_secret, rawBody)` and compares it (timing-safe) to the value in `header`, after stripping `prefix`. Covers GitHub-style `X-Hub-Signature-256: sha256=<hex>` and a plain Salesforce Apex-callout HMAC.',
446
+ });
447
+ export const EventIngestTransformSchema = z
448
+ .strictObject({
449
+ action_path: z
450
+ .string()
451
+ .meta({ description: 'Dot-path to the value used as `event.action`, e.g. `event.type`.' })
452
+ .optional(),
453
+ resource_type_path: z
454
+ .string()
455
+ .meta({ description: 'Dot-path to the value used as `event.resource_type`.' })
456
+ .optional(),
457
+ resource_id_path: z
458
+ .string()
459
+ .meta({ description: 'Dot-path to the value used as `event.resource_id`.' })
460
+ .optional(),
461
+ event_type_header: z
462
+ .string()
463
+ .meta({
464
+ description: "Request **header** carrying the event family (e.g. GitHub's `x-github-event`), captured into `event.details.event_type`. Lets subscriptions and `resource_rules` discriminate event shapes when one channel receives heterogeneous payloads whose `action` alone is ambiguous (e.g. `created` for both an issue comment and a PR review comment).",
465
+ })
466
+ .optional(),
467
+ resource_rules: z
468
+ .array(EventIngestResourceRuleSchema)
469
+ .meta({
470
+ description: "Ordered conditional rules for `resource_type` + `resource_id` (first match wins). Used when a single `resource_id_path` can't serve every payload shape. Falls back to `resource_type_path` / `resource_id_path` / channel defaults when no rule matches.",
471
+ })
472
+ .optional(),
473
+ idempotency_key_path: z
474
+ .string()
475
+ .meta({ description: 'Dot-path to a deduplication key (same semantics as `idempotency_key`).' })
476
+ .optional(),
477
+ idempotency_key_header: z
478
+ .string()
479
+ .meta({
480
+ description: "Request **header** to use as the deduplication key when the body has no stable per-delivery id — e.g. GitHub App's `x-github-delivery`, unique per delivery for all event types, which is the only reliable dedup key when one App webhook delivers heterogeneous payloads (issues + comments) to a single channel. Lower precedence than `idempotency_key_path`.",
481
+ })
482
+ .optional(),
483
+ timestamp_path: z.string().meta({ description: 'Dot-path to an ISO 8601 event timestamp.' }).optional(),
484
+ static_details: z
485
+ .looseObject({})
486
+ .meta({ description: 'Static fields merged into `event.details`.' })
487
+ .optional(),
488
+ })
489
+ .meta({
490
+ id: 'EventIngestTransform',
491
+ description: 'Declarative mapping from a raw third-party webhook body to platform event fields, for senders that cannot shape their payload (GitHub, Slack, DocuSign, Salesforce, ...). Each `*_path` is a dot-path into the JSON body (array indices supported, e.g. `commits.0.id`). Extracted values override the channel defaults; the full raw body is always preserved under `event.details.payload`.',
492
+ });
493
+ export const SemanticEvaluationRecordSchema = z
494
+ .strictObject({
495
+ status: SemanticEvaluationStatusSchema,
496
+ evaluator_type: z.enum(['interaction', 'agent']),
497
+ mode: SemanticConditionModeSchema,
498
+ matched: z.boolean().optional(),
499
+ rationale: z.string().optional(),
500
+ error: z.string().optional(),
501
+ workflow_id: z
502
+ .string()
503
+ .meta({ description: 'Temporal workflow id of the evaluation agent run (agent evaluator only).' })
504
+ .optional(),
505
+ agent_run_id: z.string().optional(),
506
+ evaluated_at: z.string().optional(),
507
+ })
508
+ .meta({ id: 'SemanticEvaluationRecord' });
509
+ export const ListEventDeliveriesPayloadSchema = z
510
+ .strictObject({
511
+ limit: z.number().optional(),
512
+ event_id: z.string().optional(),
513
+ resource_id: z.string().optional(),
514
+ subscription_id: z.string().optional(),
515
+ status: z.array(EventDeliveryIntentStatusSchema).optional(),
516
+ outbox_status: z.array(EventOutboxStatusSchema).optional(),
517
+ event_category: z
518
+ .array(EventCategorySchema)
519
+ .meta({ description: 'Filter by outbox event category (e.g. external, content).' })
520
+ .optional(),
521
+ action: z.array(z.string()).meta({ description: 'Filter by outbox action (e.g. opened, created).' }).optional(),
522
+ resource_type: z
523
+ .array(z.string())
524
+ .meta({ description: 'Filter by outbox resource type (e.g. github_issue, content_object).' })
525
+ .optional(),
526
+ sort_by: EventDeliverySortFieldSchema.meta({ description: 'Sort field (default created_at).' }).optional(),
527
+ sort_order: z.enum(['asc', 'desc']).meta({ description: 'Sort order (default desc).' }).optional(),
528
+ })
529
+ .meta({ id: 'ListEventDeliveriesPayload' });
530
+ export const WorkflowRuleItemArraySchema = z.array(WorkflowRuleItemSchema).meta({ id: 'WorkflowRuleItemArray' });
531
+ export const EventIngestChannelSchema = z
532
+ .strictObject({
533
+ id: z.string(),
534
+ name: z.string(),
535
+ description: z.string().optional(),
536
+ account_id: z.string(),
537
+ project_id: z.string(),
538
+ source: z.string().meta({ description: 'Source label stamped on ingested events as `external:<source>`.' }),
539
+ enabled: z.boolean(),
540
+ default_action: z
541
+ .string()
542
+ .meta({ description: 'Action used when the ingest payload does not specify one.' })
543
+ .optional(),
544
+ default_resource_type: z
545
+ .string()
546
+ .meta({ description: 'Resource type used when the ingest payload does not specify one.' })
547
+ .optional(),
548
+ transform: EventIngestTransformSchema.meta({
549
+ description: 'Optional mapping from raw third-party payloads to event fields.',
550
+ }).optional(),
551
+ signature: EventIngestSignatureConfigSchema.meta({
552
+ description: 'Optional HMAC signature verification config.',
553
+ }).optional(),
554
+ priority: EventPrioritySchema,
555
+ has_token: z
556
+ .boolean()
557
+ .meta({ description: 'Server-managed: whether an ingest token is active for this channel.' }),
558
+ token_hint: z
559
+ .string()
560
+ .meta({ description: 'Server-managed: last characters of the active token, for identification.' })
561
+ .optional(),
562
+ created_by: z.string().optional(),
563
+ updated_by: z.string().optional(),
564
+ created_at: z.string().optional(),
565
+ updated_at: z.string().optional(),
566
+ })
567
+ .meta({
568
+ id: 'EventIngestChannel',
569
+ description: "An inbound channel that lets external systems publish events into the platform event bus. Events ingested through a channel get `event_category: 'external'` and `source: 'external:<source>'`, and are matched against event subscriptions like any other platform event.",
570
+ });
571
+ export const EventDeliveryQueueSubscriptionSummarySchema = z
572
+ .strictObject({
573
+ subscription_id: z.string(),
574
+ subscription_name: z.string(),
575
+ target_type: z.enum(['workflow', 'webhook', 'app', 'agent', 'process']),
576
+ total: z.number(),
577
+ queued: z.number(),
578
+ deferred: z.number(),
579
+ active: z.number(),
580
+ failed: z.number(),
581
+ skipped: z.number(),
582
+ max_attempt_count: z.number(),
583
+ oldest_queued_at: z.string().optional(),
584
+ oldest_deferred_at: z.string().optional(),
585
+ latest_failure: EventDeliveryQueueFailureSummarySchema.optional(),
586
+ })
587
+ .meta({ id: 'EventDeliveryQueueSubscriptionSummary' });
588
+ export const EventDeliveryQueueSummaryPayloadSchema = z
589
+ .strictObject({
590
+ subscription_id: z.string().optional(),
591
+ target_type: z.array(z.enum(['workflow', 'webhook', 'app', 'agent', 'process'])).optional(),
592
+ sort_by: EventDeliveryQueueSortFieldSchema.optional(),
593
+ sort_order: z.enum(['asc', 'desc']).optional(),
594
+ })
595
+ .meta({ id: 'EventDeliveryQueueSummaryPayload' });
596
+ export const CancelEventDeliveryIntentsPayloadSchema = z
597
+ .strictObject({
598
+ subscription_id: z
599
+ .string()
600
+ .min(1)
601
+ .meta({ description: 'Restrict cancellation to one subscription.' })
602
+ .optional(),
603
+ target_type: z
604
+ .array(z.enum(['workflow', 'webhook', 'app', 'agent', 'process']))
605
+ .min(1)
606
+ .meta({ description: 'Restrict cancellation to one or more delivery target types.' })
607
+ .optional(),
608
+ })
609
+ .meta({ id: 'CancelEventDeliveryIntentsPayload' });
610
+ export const CancelEventDeliveryIntentsResponseSchema = z
611
+ .strictObject({
612
+ environment: z.string().meta({ description: 'Deployment environment whose queue was changed.' }),
613
+ cleared_through: z.string().meta({
614
+ description: 'Server-side watermark; intents created after this time were not changed.',
615
+ format: 'date-time',
616
+ }),
617
+ cancelled: z
618
+ .number()
619
+ .int()
620
+ .nonnegative()
621
+ .meta({ description: 'Pending or retrying intents moved to the cancelled terminal state.' }),
622
+ active_untouched: z.number().int().nonnegative().meta({
623
+ description: 'Matching evaluating, starting, or running intents left for normal reconciliation.',
624
+ }),
625
+ })
626
+ .meta({ id: 'CancelEventDeliveryIntentsResponse' });
627
+ export const EventIngestChannelMutationResponseSchema = z
628
+ .strictObject({
629
+ channel: EventIngestChannelSchema,
630
+ ingest_token: z
631
+ .string()
632
+ .meta({ description: 'Returned once on creation or rotation; it cannot be retrieved later.' })
633
+ .optional(),
634
+ signing_secret: z
635
+ .string()
636
+ .meta({
637
+ description: 'Returned once on creation or rotation of the signing secret; it cannot be retrieved later.',
638
+ })
639
+ .optional(),
640
+ })
641
+ .meta({ id: 'EventIngestChannelMutationResponse' });
642
+ export const CreateEventIngestChannelPayloadSchema = z
643
+ .strictObject({
644
+ name: z.string(),
645
+ description: z.string().optional(),
646
+ source: z.string().meta({ description: 'Defaults to a slug derived from the name.' }).optional(),
647
+ default_action: z.string().optional(),
648
+ default_resource_type: z.string().optional(),
649
+ transform: EventIngestTransformSchema.optional(),
650
+ signature: EventIngestSignatureConfigSchema.optional(),
651
+ priority: EventPrioritySchema.optional(),
652
+ enabled: z.boolean().optional(),
653
+ })
654
+ .meta({ id: 'CreateEventIngestChannelPayload' });
655
+ export const EventSemanticConditionSchema = z
656
+ .strictObject({
657
+ instruction: z.string().meta({
658
+ description: 'Natural-language predicate, e.g. "the document appears to be a signed contract amendment".',
659
+ }),
660
+ evaluator: SemanticEvaluatorSchema.meta({ description: 'Defaults to the interaction evaluator.' }).optional(),
661
+ mode: SemanticConditionModeSchema.meta({
662
+ description: 'enforce: a negative verdict skips delivery. shadow: the verdict is recorded on the delivery intent but never blocks delivery. Defaults to enforce.',
663
+ }).optional(),
664
+ on_error: SemanticConditionOnErrorSchema.meta({
665
+ description: 'What to do when evaluation errors out after retries: fail_open delivers anyway, fail_closed does not deliver. Defaults to fail_closed.',
666
+ }).optional(),
667
+ })
668
+ .meta({
669
+ id: 'EventSemanticCondition',
670
+ description: 'A natural-language predicate evaluated by an LLM after all structural filters (categories, actions, resource types, JSONLogic condition) have matched.',
671
+ });
672
+ export const UpdateEventIngestChannelPayloadSchema = z
673
+ .strictObject({
674
+ name: z.string().optional(),
675
+ description: z.string().optional(),
676
+ source: z.string().optional(),
677
+ default_action: z.string().optional(),
678
+ default_resource_type: z.string().optional(),
679
+ transform: z
680
+ .union([EventIngestTransformSchema, z.null()])
681
+ .meta({ description: 'Pass null to remove the transform.' })
682
+ .optional(),
683
+ signature: z
684
+ .union([EventIngestSignatureConfigSchema, z.null()])
685
+ .meta({ description: 'Pass null to remove signature verification.' })
686
+ .optional(),
687
+ priority: EventPrioritySchema.optional(),
688
+ enabled: z.boolean().optional(),
689
+ rotate_token: z
690
+ .boolean()
691
+ .meta({ description: 'Request rotation of the channel ingest token on update.' })
692
+ .optional(),
693
+ rotate_signing_secret: z
694
+ .boolean()
695
+ .meta({ description: 'Request rotation of the HMAC signing secret on update.' })
696
+ .optional(),
697
+ })
698
+ .meta({ id: 'UpdateEventIngestChannelPayload' });
699
+ export const EventDeliveryIntentSummarySchema = z
700
+ .strictObject({
701
+ id: z.string(),
702
+ event_id: z.string(),
703
+ subscription_id: z.string(),
704
+ subscription_name: z.string(),
705
+ target_type: z.enum(['workflow', 'webhook', 'app', 'agent', 'process']),
706
+ workflow_class: nullableStringSchema.optional(),
707
+ priority: EventPrioritySchema,
708
+ status: EventDeliveryIntentStatusSchema,
709
+ attempt_count: z.number(),
710
+ workflow_id: nullableStringSchema.optional(),
711
+ workflow_run_id: nullableStringSchema.optional(),
712
+ response_status: nullableNumberSchema.optional(),
713
+ last_error: nullableStringSchema.optional(),
714
+ next_attempt_at: nullableStringSchema.optional(),
715
+ started_at: nullableStringSchema.optional(),
716
+ completed_at: nullableStringSchema.optional(),
717
+ semantic_evaluation: z.union([SemanticEvaluationRecordSchema, z.null()]).optional(),
718
+ created_at: z.string(),
719
+ updated_at: z.string(),
720
+ })
721
+ .meta({ id: 'EventDeliveryIntentSummary' });
722
+ export const EventIngestChannelArraySchema = z.array(EventIngestChannelSchema).meta({ id: 'EventIngestChannelArray' });
723
+ export const EventDeliveryQueueSummaryResponseSchema = z
724
+ .strictObject({
725
+ generated_at: z.string(),
726
+ outbox: EventOutboxQueueSummarySchema,
727
+ deliveries: z.array(EventDeliveryQueueSubscriptionSummarySchema),
728
+ })
729
+ .meta({ id: 'EventDeliveryQueueSummaryResponse' });
730
+ export const EventSubscriptionFilterSchema = z
731
+ .strictObject({
732
+ event_category: z.array(z.union([EventCategorySchema, z.literal('*')])).optional(),
733
+ exclude_event_category: z.array(EventCategorySchema).optional(),
734
+ action: z.array(z.string()).optional(),
735
+ resource_type: z.array(z.string()).optional(),
736
+ condition: JsonLogicRuleSchema.optional(),
737
+ semantic_condition: EventSemanticConditionSchema.meta({
738
+ description: 'LLM-evaluated predicate applied after all structural filters have matched.',
739
+ }).optional(),
740
+ })
741
+ .meta({ id: 'EventSubscriptionFilter' });
742
+ export const EventDeliverySummarySchema = z
743
+ .strictObject({
744
+ event_id: z.string(),
745
+ event_category: EventCategorySchema,
746
+ action: z.string(),
747
+ resource_type: z.string(),
748
+ resource_id: z.string(),
749
+ source: z.string(),
750
+ priority: EventPrioritySchema,
751
+ status: EventOutboxStatusSchema,
752
+ matched_subscription_count: z.number(),
753
+ materialized_intent_count: z.number(),
754
+ routing_attempt_count: z.number(),
755
+ routing_error: nullableStringSchema.optional(),
756
+ routed_at: nullableStringSchema.optional(),
757
+ created_at: z.string(),
758
+ updated_at: z.string(),
759
+ intents: z.array(EventDeliveryIntentSummarySchema),
760
+ })
761
+ .meta({ id: 'EventDeliverySummary' });
762
+ export const ListEventDeliveriesResponseSchema = z
763
+ .strictObject({
764
+ deliveries: z.array(EventDeliverySummarySchema),
765
+ })
766
+ .meta({ id: 'ListEventDeliveriesResponse' });
767
+ export const CreateEventSubscriptionPayloadSchema = z
768
+ .strictObject({
769
+ name: z.string(),
770
+ description: z.string().optional(),
771
+ scope: z.enum(['account', 'project']).optional(),
772
+ filter: EventSubscriptionFilterSchema,
773
+ target: z.lazy(() => EventDeliveryTargetInputSchema),
774
+ run_as_role: SystemRolesSchema.meta({
775
+ description: 'Identity the delivery runs as. Required at creation so a subscription never silently runs as the originating (possibly deleted) user. Use "automation" for the standard identity.',
776
+ }),
777
+ enabled: z.boolean().optional(),
778
+ priority: EventPrioritySchema.optional(),
779
+ })
780
+ .meta({ id: 'CreateEventSubscriptionPayload' });
781
+ export const EventDeliveryTargetSchema = z
782
+ .discriminatedUnion('type', [
783
+ WorkflowEventDeliveryTargetSchema,
784
+ WebhookEventDeliveryTargetSchema,
785
+ AppEventDeliveryTargetSchema,
786
+ AgentEventDeliveryTargetSchema,
787
+ z.lazy(() => ProcessEventDeliveryTargetSchema),
788
+ ])
789
+ .meta({ id: 'EventDeliveryTarget' });
790
+ export const EventDeliveryTargetInputSchema = z
791
+ .discriminatedUnion('type', [
792
+ WorkflowEventDeliveryTargetInputSchema,
793
+ WebhookEventDeliveryTargetInputSchema,
794
+ AppEventDeliveryTargetInputSchema,
795
+ AgentEventDeliveryTargetSchema,
796
+ z.lazy(() => ProcessEventDeliveryTargetSchema),
797
+ ])
798
+ .meta({ id: 'EventDeliveryTargetInput' });
799
+ export const EventSubscriptionSchema = z
800
+ .strictObject({
801
+ id: z.string(),
802
+ name: z.string(),
803
+ description: z.string().optional(),
804
+ account_id: z.string(),
805
+ project_id: z.string().optional(),
806
+ scope: z.enum(['account', 'project']),
807
+ filter: EventSubscriptionFilterSchema,
808
+ target: z.lazy(() => EventDeliveryTargetSchema),
809
+ run_as_role: SystemRolesSchema,
810
+ is_system: z.boolean(),
811
+ protected: z.boolean(),
812
+ enabled: z.boolean(),
813
+ priority: EventPrioritySchema.optional(),
814
+ app_installation_id: z.string().optional(),
815
+ app_id: z.string().optional(),
816
+ app_subscription_id: z.string().optional(),
817
+ created_by: z.string().optional(),
818
+ updated_by: z.string().optional(),
819
+ created_at: z.string().optional(),
820
+ updated_at: z.string().optional(),
821
+ migrated_from_workflow_rule_id: z.string().optional(),
822
+ overrides_system_subscription_id: z
823
+ .string()
824
+ .meta({
825
+ description: 'System subscription ID replaced by this stored subscription. Set only for tenant-specific system overrides created by migrations or platform code.',
826
+ })
827
+ .optional(),
828
+ customer_override: z
829
+ .boolean()
830
+ .meta({ description: 'True when this system subscription was created from a legacy customer override.' })
831
+ .optional(),
832
+ })
833
+ .meta({ id: 'EventSubscription' });
834
+ export const EventSubscriptionArraySchema = z
835
+ .array(z.lazy(() => EventSubscriptionSchema))
836
+ .meta({ id: 'EventSubscriptionArray' });
837
+ export const EventSubscriptionMutationResponseSchema = z
838
+ .strictObject({
839
+ subscription: z.lazy(() => EventSubscriptionSchema),
840
+ webhook_signing_secret: z.string().optional(),
841
+ })
842
+ .meta({ id: 'EventSubscriptionMutationResponse' });
843
+ export const ProcessEventDeliveryTargetSchema = z
844
+ .strictObject({
845
+ type: z.literal('process'),
846
+ process_ref: z
847
+ .string()
848
+ .meta({
849
+ description: 'Stored process ID, app ref, or system ref. Required unless process_definition is supplied.',
850
+ })
851
+ .optional(),
852
+ process_version: z.number().optional(),
853
+ process_definition: z.lazy(() => ProcessDefinitionBodySchema).optional(),
854
+ run_type: ProcessRunTypeSchema.optional(),
855
+ data: z.looseObject({}).optional(),
856
+ config: z.looseObject({}).optional(),
857
+ visibility: ConversationVisibilitySchema.optional(),
858
+ tags: z.array(z.string()).optional(),
859
+ categories: z.array(z.string()).optional(),
860
+ })
861
+ .meta({ id: 'ProcessEventDeliveryTarget' });
862
+ export const UpdateEventSubscriptionPayloadSchema = z
863
+ .strictObject({
864
+ name: z.string().optional(),
865
+ description: z.string().optional(),
866
+ filter: EventSubscriptionFilterSchema.optional(),
867
+ target: z.lazy(() => EventDeliveryTargetInputSchema).optional(),
868
+ run_as_role: SystemRolesSchema.optional(),
869
+ enabled: z.boolean().optional(),
870
+ priority: EventPrioritySchema.optional(),
871
+ })
872
+ .meta({ id: 'UpdateEventSubscriptionPayload' });
873
+ export const StreamEventDeliveriesQuerySchema = z
874
+ .object({
875
+ limit: z.number().optional(),
876
+ event_id: z.string().optional(),
877
+ resource_id: z.string().optional(),
878
+ resource_type: z.array(z.string()).optional(),
879
+ event_category: z.array(EventCategorySchema).optional(),
880
+ action: z.array(z.string()).optional(),
881
+ outbox_status: z.array(EventOutboxStatusSchema).optional(),
882
+ since_event_id: z.string().optional(),
883
+ since_created_at: z.string().optional(),
884
+ include_event: z.boolean().optional(),
885
+ poll_interval_ms: z.number().optional(),
886
+ })
887
+ .meta({ id: 'StreamEventDeliveriesQuery' });
888
+ //# sourceMappingURL=events.js.map