@wildo-ai/saas-models 1.1.5 → 1.1.6

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 (888) hide show
  1. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
  2. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js +2 -1
  3. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  4. package/dist/esm/applications/applications-context.schemas.d.ts +176 -2
  5. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  7. package/dist/esm/applications/applications.shared.resources-config.schemas.js +3 -2
  8. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  9. package/dist/esm/applications/applications.shared.schemas.d.ts +7 -5
  10. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  11. package/dist/esm/applications/applications.shared.schemas.js +6 -4
  12. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  13. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +10 -1
  14. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  15. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +49 -15
  16. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-account.shared.schemas.js +2 -2
  18. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  19. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +25 -0
  20. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  21. package/dist/esm/billing/billing-configuration.shared.schemas.js +19 -0
  22. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  23. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +27 -5
  24. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  25. package/dist/esm/billing/billing-enums.shared.schemas.js +30 -4
  26. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/billing-types.shared.schemas.d.ts +37 -11
  28. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  29. package/dist/esm/billing/billing-types.shared.schemas.js +31 -19
  30. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  31. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +2 -0
  32. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  33. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js +18 -7
  34. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  35. package/dist/esm/billing/credit-pool.shared.schemas.d.ts +2 -0
  36. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  37. package/dist/esm/billing/credit-pool.shared.schemas.js +7 -1
  38. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  39. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +6 -6
  40. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  41. package/dist/esm/billing/invoice-ref.shared.schemas.js +1 -1
  42. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  43. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  44. package/dist/esm/billing/price.shared.schemas.js +5 -3
  45. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  46. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts +11 -1
  47. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +39 -23
  49. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  50. package/dist/esm/billing/product-definition.shared.schemas.d.ts +30 -2
  51. package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
  52. package/dist/esm/billing/product-definition.shared.schemas.js +35 -0
  53. package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
  54. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +6 -3
  55. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/product.shared.schemas.d.ts +7 -3
  57. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  58. package/dist/esm/billing/product.shared.schemas.js +22 -7
  59. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  60. package/dist/esm/billing/promotions.shared.resources-config.schemas.js +8 -8
  61. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  62. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts +135 -0
  63. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -0
  64. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js +112 -0
  65. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -0
  66. package/dist/esm/billing/public-pricing-catalog.shared.d.ts +30 -0
  67. package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -0
  68. package/dist/esm/billing/public-pricing-catalog.shared.js +53 -0
  69. package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -0
  70. package/dist/esm/billing/referral-reward.shared.schemas.d.ts +51 -0
  71. package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -0
  72. package/dist/esm/billing/referral-reward.shared.schemas.js +92 -0
  73. package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -0
  74. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts +54 -33
  75. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  76. package/dist/esm/billing/referral.shared.resources-config.schemas.js +56 -2
  77. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  78. package/dist/esm/billing/referral.shared.schemas.d.ts +22 -37
  79. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  80. package/dist/esm/billing/referral.shared.schemas.js +24 -44
  81. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  82. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +9 -1
  83. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  84. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +55 -22
  85. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  86. package/dist/esm/billing/subscription.shared.schemas.d.ts +80 -5
  87. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/billing/subscription.shared.schemas.js +85 -25
  89. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  90. package/dist/esm/billing/usage-record.shared.schemas.js +5 -5
  91. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  92. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +143 -2
  93. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  94. package/dist/esm/companion/provider-discovery.shared.schemas.js +84 -1
  95. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  96. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +14 -1
  97. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  98. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +4 -0
  99. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  100. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts +70 -0
  101. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
  102. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js +87 -0
  103. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
  104. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts +34 -0
  105. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
  106. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js +137 -3
  107. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
  108. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts +7 -0
  109. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
  110. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +28 -2
  112. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  113. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +29 -8
  114. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  115. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +29 -6
  116. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  117. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +38 -9
  118. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  119. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +1822 -146
  120. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  121. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +1777 -87
  122. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  123. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts +10 -0
  124. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  125. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +148 -7
  126. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  127. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts +2 -0
  128. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  129. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js +2 -0
  130. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  131. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts +0 -8
  132. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts.map +0 -1
  133. package/dist/esm/compliance/privacy/data-retention.shared.schemas.js.map +0 -1
  134. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts +17 -8
  135. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
  136. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +43 -20
  137. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
  138. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +38 -0
  139. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  140. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +39 -0
  141. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  142. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts +35 -0
  143. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -0
  144. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js +82 -0
  145. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -0
  146. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts +37 -0
  147. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -0
  148. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js +223 -0
  149. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -0
  150. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts +222 -0
  151. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -0
  152. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js +331 -0
  153. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -0
  154. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +37 -3
  155. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  156. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +33 -4
  157. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  158. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts +52 -0
  159. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -0
  160. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js +116 -0
  161. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -0
  162. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts +11 -0
  163. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -0
  164. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js +11 -0
  165. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -0
  166. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts +93 -0
  167. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -0
  168. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js +149 -0
  169. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -0
  170. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts +43 -0
  171. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -0
  172. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js +106 -0
  173. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -0
  174. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts +209 -0
  175. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -0
  176. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js +226 -0
  177. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -0
  178. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts +129 -5
  179. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
  180. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js +128 -4
  181. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
  182. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts +53 -0
  183. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -0
  184. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js +74 -0
  185. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -0
  186. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts +311 -0
  187. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -0
  188. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js +355 -0
  189. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -0
  190. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts +178 -39
  191. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  192. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js +145 -35
  193. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  194. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
  195. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js +26 -0
  196. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
  197. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts +9 -0
  198. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  199. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  200. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +109 -1
  201. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  202. package/dist/esm/config/app-configuration-shared.shared.schemas.js +57 -0
  203. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  204. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +69 -0
  205. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  206. package/dist/esm/config/entity-identity-config.shared.schemas.js +93 -0
  207. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  208. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +16 -16
  209. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +160 -61
  210. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  211. package/dist/esm/config/frontend/navigation.shared.schemas.js +297 -65
  212. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  213. package/dist/esm/errors/caught-error-description.shared.utils.d.ts +69 -0
  214. package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -0
  215. package/dist/esm/errors/caught-error-description.shared.utils.js +77 -0
  216. package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -0
  217. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +76 -3
  218. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  219. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +76 -2
  220. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  221. package/dist/esm/errors/errors.shared.schemas.d.ts +20 -1
  222. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  223. package/dist/esm/errors/errors.shared.schemas.js +16 -9
  224. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  225. package/dist/esm/errors/errors.shared.utils.d.ts +0 -24
  226. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  227. package/dist/esm/errors/errors.shared.utils.js +0 -39
  228. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  229. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts +6 -7
  230. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
  231. package/dist/esm/errors/thrown-value-description.shared.utils.js +6 -7
  232. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
  233. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts +70 -0
  234. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -0
  235. package/dist/esm/external-data/external-data-pipeline-description.shared.js +92 -0
  236. package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -0
  237. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts +154 -0
  238. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -0
  239. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js +161 -0
  240. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -0
  241. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +1071 -23
  242. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  243. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js +1065 -17
  244. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  245. package/dist/esm/external-data/external-data-provenance.shared.d.ts +71 -0
  246. package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -0
  247. package/dist/esm/external-data/external-data-provenance.shared.js +88 -0
  248. package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -0
  249. package/dist/esm/external-data.exports.d.ts +5 -0
  250. package/dist/esm/external-data.exports.d.ts.map +1 -1
  251. package/dist/esm/external-data.exports.js +11 -0
  252. package/dist/esm/external-data.exports.js.map +1 -1
  253. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +17 -2
  254. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  255. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +22 -4
  256. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  257. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  258. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +3 -0
  259. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  260. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
  261. package/dist/esm/external-providers/engine-capability-surface.shared.js +2 -0
  262. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
  263. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +152 -1
  264. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  265. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +4 -3
  266. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  267. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +4 -3
  268. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  269. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts +45 -0
  270. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
  271. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js +14 -0
  272. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
  273. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +188 -4
  274. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  275. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +76 -9
  276. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  277. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts +175 -33
  278. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
  279. package/dist/esm/external-providers/frontend-provider-public-config.shared.js +247 -42
  280. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
  281. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts +53 -0
  282. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -0
  283. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js +41 -0
  284. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -0
  285. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts +150 -0
  286. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -0
  287. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js +22 -0
  288. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -0
  289. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts +42 -0
  290. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -0
  291. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js +49 -0
  292. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -0
  293. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts +53 -0
  294. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
  295. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js +56 -0
  296. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
  297. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +34 -0
  298. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  299. package/dist/esm/external-providers/provider-capability.shared.schemas.js +34 -0
  300. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  301. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +341 -4
  302. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  303. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +270 -20
  304. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  305. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts +6 -2
  306. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
  307. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js +6 -2
  308. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
  309. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +174 -1
  310. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  311. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +125 -0
  312. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  313. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +3 -3
  314. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts +42 -0
  315. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -0
  316. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js +57 -0
  317. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -0
  318. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +6 -0
  319. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  320. package/dist/esm/external-providers/provider-protocol.shared.schemas.js +6 -0
  321. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  322. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts +58 -0
  323. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -0
  324. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js +35 -0
  325. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -0
  326. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts +115 -0
  327. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -0
  328. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js +137 -0
  329. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -0
  330. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts +73 -0
  331. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -0
  332. package/dist/esm/external-providers/provider-usage-cost.shared.js +171 -0
  333. package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -0
  334. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts +12 -0
  335. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -0
  336. package/dist/esm/external-providers/provider-usage-pricing.example.js +40 -0
  337. package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -0
  338. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts +68 -32
  339. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
  340. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js +63 -52
  341. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
  342. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts +5 -5
  343. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  344. package/dist/esm/features/application-features.shared.resources-config.schemas.js +13 -5
  345. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  346. package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
  347. package/dist/esm/features/connected-feature.example.js +2 -1
  348. package/dist/esm/features/connected-feature.example.js.map +1 -1
  349. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  350. package/dist/esm/features/core-feature-definitions.shared.js +2 -1
  351. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  352. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  353. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  354. package/dist/esm/features/feature-definition.shared.schemas.d.ts +2 -11
  355. package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
  356. package/dist/esm/features/feature-definition.shared.schemas.js +0 -12
  357. package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
  358. package/dist/esm/features/scope-features.shared.schemas.d.ts +31 -17
  359. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  360. package/dist/esm/features/scope-features.shared.schemas.js +27 -5
  361. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  362. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +5 -5
  363. package/dist/esm/flows-actors/actors.shared.schemas.d.ts +127 -11
  364. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  365. package/dist/esm/flows-actors/actors.shared.schemas.js +32 -1
  366. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  367. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts +16 -0
  368. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  369. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js +7 -0
  370. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
  371. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts +68 -0
  372. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -0
  373. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js +276 -0
  374. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -0
  375. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts +468 -0
  376. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -0
  377. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js +472 -0
  378. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -0
  379. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts +118 -0
  380. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -0
  381. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js +144 -0
  382. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -0
  383. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +142 -8
  384. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  385. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +209 -11
  386. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  387. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +37 -2
  388. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  389. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +30 -2
  390. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  391. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts +0 -11
  392. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  393. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js +12 -5
  394. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  395. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts +45 -6
  396. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  397. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js +31 -5
  398. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  399. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js +30 -30
  400. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  401. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts +15 -7
  402. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  403. package/dist/esm/flows-actors/flows.shared.schemas.d.ts +15 -0
  404. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  405. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts +506 -0
  406. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
  407. package/dist/esm/flows-actors/human-decision.shared.schemas.js +502 -0
  408. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
  409. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts +46 -0
  410. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -0
  411. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js +65 -0
  412. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -0
  413. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts +120 -0
  414. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -0
  415. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js +165 -0
  416. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -0
  417. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts +45 -0
  418. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -0
  419. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js +127 -0
  420. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -0
  421. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts +83 -0
  422. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -0
  423. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js +97 -0
  424. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -0
  425. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts +136 -0
  426. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -0
  427. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js +90 -0
  428. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -0
  429. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts +5 -1
  430. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
  431. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js +19 -4
  432. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
  433. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts +13 -15
  434. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
  435. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js +30 -17
  436. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
  437. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts +268 -0
  438. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -0
  439. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js +576 -0
  440. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -0
  441. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts +30 -0
  442. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  443. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts +129 -0
  444. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -0
  445. package/dist/esm/flows-actors/work-attribution.shared.schemas.js +141 -0
  446. package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -0
  447. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts +22 -1
  448. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
  449. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js +23 -0
  450. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
  451. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts +61 -0
  452. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
  453. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +61 -0
  454. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
  455. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  456. package/dist/esm/guidance/guidance-state.shared.schemas.js +11 -10
  457. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  458. package/dist/esm/guidance/lifecycle-state.shared.schemas.js +6 -6
  459. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  460. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  461. package/dist/esm/guidance/progression-state.shared.schemas.js +8 -7
  462. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  463. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js +1 -1
  464. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  465. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +550 -30
  466. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  467. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +498 -34
  468. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  469. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts +62 -0
  470. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -0
  471. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js +66 -0
  472. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -0
  473. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts +133 -0
  474. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -0
  475. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js +191 -0
  476. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -0
  477. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts +37 -6
  478. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
  479. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js +37 -6
  480. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
  481. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts +36 -0
  482. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -0
  483. package/dist/esm/i18n/application-config-vocabulary.shared.js +39 -0
  484. package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -0
  485. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts +11 -0
  486. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -0
  487. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js +14 -0
  488. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -0
  489. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts +20 -0
  490. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -0
  491. package/dist/esm/i18n/engine-open-vocabulary.shared.js +21 -0
  492. package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -0
  493. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts +94 -0
  494. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -0
  495. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js +206 -0
  496. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -0
  497. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts +169 -0
  498. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -0
  499. package/dist/esm/inbound/conversation-threads.shared.schemas.js +231 -0
  500. package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -0
  501. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts +195 -0
  502. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -0
  503. package/dist/esm/inbound/inbound-channels.shared.schemas.js +244 -0
  504. package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -0
  505. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts +36 -0
  506. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -0
  507. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js +169 -0
  508. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -0
  509. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts +404 -0
  510. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -0
  511. package/dist/esm/inbound/inbound-delivery.shared.schemas.js +449 -0
  512. package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -0
  513. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts +46 -0
  514. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -0
  515. package/dist/esm/inbound/inbound-endpoint-env.shared.js +57 -0
  516. package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -0
  517. package/dist/esm/index.d.ts +58 -1
  518. package/dist/esm/index.d.ts.map +1 -1
  519. package/dist/esm/index.js +67 -1
  520. package/dist/esm/index.js.map +1 -1
  521. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +28 -0
  522. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
  523. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js +29 -0
  524. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  525. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +95 -1
  526. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
  527. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +121 -0
  528. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
  529. package/dist/esm/meta-workflows.exports.d.ts +0 -1
  530. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  531. package/dist/esm/meta-workflows.exports.js +0 -1
  532. package/dist/esm/meta-workflows.exports.js.map +1 -1
  533. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +7 -1
  534. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  535. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js +35 -0
  536. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  537. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts +131 -0
  538. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -0
  539. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js +258 -0
  540. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -0
  541. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts +448 -0
  542. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -0
  543. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js +530 -0
  544. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -0
  545. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  546. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js +4 -3
  547. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  548. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +16 -1
  549. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  550. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +46 -16
  551. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  552. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts +19 -12
  553. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  554. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +77 -12
  555. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  556. package/dist/esm/notifications/notification-badges.schemas.d.ts +35 -3
  557. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  558. package/dist/esm/notifications/notification-badges.schemas.js +43 -3
  559. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  560. package/dist/esm/notifications/notifications.shared.schemas.d.ts +66 -399
  561. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  562. package/dist/esm/notifications/notifications.shared.schemas.js +111 -58
  563. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  564. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts +5 -5
  565. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +6 -6
  566. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  567. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +3 -0
  568. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  569. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +60 -14
  570. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  571. package/dist/esm/organizations/organization-members.shared.schemas.d.ts +3 -0
  572. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  573. package/dist/esm/organizations/organization-members.shared.schemas.js +30 -0
  574. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  575. package/dist/esm/organizations/organization-notifications.shared.schemas.js +9 -9
  576. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  577. package/dist/esm/organizations/organization-preferences.shared.schemas.js +4 -4
  578. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  579. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts +0 -1
  580. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
  581. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +5 -5
  582. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  583. package/dist/esm/organizations/organization-profile.shared.schemas.js +15 -10
  584. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  585. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js +1 -1
  586. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
  587. package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
  588. package/dist/esm/organizations/organization-unit-members.shared.schemas.js +2 -1
  589. package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
  590. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts +63 -1
  591. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
  592. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js +106 -5
  593. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
  594. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  595. package/dist/esm/organizations/organization-unit-narrowing.shared.js +9 -0
  596. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  597. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  598. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js +7 -2
  599. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  600. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts +3 -1
  601. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  602. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +12 -8
  603. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  604. package/dist/esm/organizations/organizations.shared.schemas.d.ts +7 -2
  605. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  606. package/dist/esm/organizations/organizations.shared.schemas.js +51 -1
  607. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  608. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts +58 -0
  609. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -0
  610. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js +188 -0
  611. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -0
  612. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts +122 -0
  613. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -0
  614. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js +136 -0
  615. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -0
  616. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts +36 -0
  617. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -0
  618. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js +155 -0
  619. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -0
  620. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts +229 -0
  621. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -0
  622. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js +290 -0
  623. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -0
  624. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts +48 -0
  625. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -0
  626. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js +50 -0
  627. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -0
  628. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts +97 -0
  629. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -0
  630. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js +572 -0
  631. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -0
  632. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts +590 -0
  633. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -0
  634. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js +869 -0
  635. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -0
  636. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts +36 -6
  637. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  638. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js +57 -16
  639. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  640. package/dist/esm/provider-registration-runtime.exports.d.ts +0 -1
  641. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  642. package/dist/esm/provider-registration-runtime.exports.js +0 -1
  643. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  644. package/dist/esm/public-runtime/index.d.ts +30 -11
  645. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  646. package/dist/esm/public-runtime/index.js +30 -11
  647. package/dist/esm/public-runtime/index.js.map +1 -1
  648. package/dist/esm/queue/jobs.shared.schemas.d.ts +36 -8
  649. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  650. package/dist/esm/queue/jobs.shared.schemas.js +12 -0
  651. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  652. package/dist/esm/requests/header-keys.shared.d.ts +6 -0
  653. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  654. package/dist/esm/requests/header-keys.shared.js +7 -0
  655. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  656. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  657. package/dist/esm/requests/manual-controllers-routes-documentation.js +147 -8
  658. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  659. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +51 -23
  660. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  661. package/dist/esm/requests/manual-controllers-routes-urls.js +64 -0
  662. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  663. package/dist/esm/requests/websocket.shared.schemas.d.ts +78 -13
  664. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  665. package/dist/esm/requests/websocket.shared.schemas.js +91 -18
  666. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  667. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts +21 -0
  668. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -0
  669. package/dist/esm/resources/embedded-resource-mark.shared.utils.js +22 -0
  670. package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -0
  671. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  672. package/dist/esm/resources/resources-config.shared.factory.js +812 -32
  673. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  674. package/dist/esm/resources/resources-config.shared.schemas.d.ts +244 -48
  675. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  676. package/dist/esm/resources/resources-config.shared.schemas.js +151 -17
  677. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  678. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  679. package/dist/esm/resources/resources-registry.shared.core.definitions.js +353 -12
  680. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  681. package/dist/esm/resources/resources.shared.core.definitions.d.ts +45 -0
  682. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  683. package/dist/esm/resources/resources.shared.core.definitions.js +92 -0
  684. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  685. package/dist/esm/resources/resources.shared.schemas.d.ts +2 -17
  686. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  687. package/dist/esm/resources/resources.shared.schemas.js +24 -20
  688. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  689. package/dist/esm/resources/resources.shared.utils.d.ts +16 -8
  690. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  691. package/dist/esm/resources/resources.shared.utils.js +16 -8
  692. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  693. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts +2 -2
  694. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
  695. package/dist/esm/resources/utils/collection-export.shared.utils.js +4 -2
  696. package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
  697. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts +103 -0
  698. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -0
  699. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js +275 -0
  700. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -0
  701. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts +51 -0
  702. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -0
  703. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js +28 -0
  704. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -0
  705. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
  706. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js +30 -19
  707. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
  708. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts +2 -0
  709. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -0
  710. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js +33 -0
  711. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -0
  712. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts +15 -0
  713. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
  714. package/dist/esm/resources/utils/resource-polymorphism.factory.js +6 -1
  715. package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
  716. package/dist/esm/resources/utils/resource-polymorphism.schemas.js +30 -4
  717. package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
  718. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +46 -0
  719. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  720. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +205 -22
  721. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  722. package/dist/esm/resources/utils/resources-serialization.utils.d.ts +19 -2
  723. package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
  724. package/dist/esm/resources/utils/resources-serialization.utils.js +4 -0
  725. package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
  726. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  727. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +15 -9
  728. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  729. package/dist/esm/resources/work-unit.shared.schemas.d.ts +20 -0
  730. package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -0
  731. package/dist/esm/resources/work-unit.shared.schemas.js +19 -0
  732. package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -0
  733. package/dist/esm/runtime/execution-context.shared.schemas.d.ts +48 -1
  734. package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
  735. package/dist/esm/runtime/execution-context.shared.schemas.js +101 -9
  736. package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
  737. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
  738. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  739. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +37 -20
  740. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  741. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts +1 -0
  742. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  743. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +61 -48
  744. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  745. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts +26 -0
  746. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
  747. package/dist/esm/security/api-keys/api-keys.shared.schemas.js +39 -5
  748. package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
  749. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +5 -3
  750. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  751. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +6 -0
  752. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  753. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js +2 -2
  754. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  755. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts +11 -0
  756. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  757. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js +19 -8
  758. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  759. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +1 -1
  760. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +5 -5
  761. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  762. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js +11 -11
  763. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  764. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts +2 -0
  765. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
  766. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js +9 -0
  767. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
  768. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts +169 -0
  769. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -0
  770. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js +162 -0
  771. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -0
  772. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  773. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js +10 -8
  774. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  775. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js +8 -8
  776. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  777. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  778. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +17 -16
  779. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  780. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  781. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +28 -25
  782. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  783. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts +17 -6
  784. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  785. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js +90 -38
  786. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  787. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +0 -24
  788. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  789. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +79 -68
  790. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  791. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts +8 -1
  792. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  793. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js +7 -0
  794. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  795. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js +1 -1
  796. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
  797. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +7 -7
  798. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  799. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  800. package/dist/esm/security/authorizations/roles.shared.defaults.js +56 -0
  801. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  802. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +77 -1
  803. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  804. package/dist/esm/security/authorizations/roles.shared.schemas.js +90 -0
  805. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  806. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts +86 -0
  807. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -0
  808. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js +40 -0
  809. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -0
  810. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +2 -1
  811. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  812. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js +2 -1
  813. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
  814. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +2 -1
  815. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  816. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +2 -1
  817. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  818. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +46 -14
  819. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  820. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +81 -21
  821. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  822. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts +69 -0
  823. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -0
  824. package/dist/esm/security/credential-rotation-grace.shared.utils.js +77 -0
  825. package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -0
  826. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  827. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +28 -8
  828. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  829. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +3 -1
  830. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  831. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +89 -14
  832. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  833. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +1 -0
  834. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  835. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +25 -4
  836. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  837. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts +7 -1
  838. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
  839. package/dist/esm/security/outbound-target-control.shared.schemas.js +6 -0
  840. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
  841. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts +143 -0
  842. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -0
  843. package/dist/esm/security/submission-challenge/submission-challenge.shared.js +123 -0
  844. package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -0
  845. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts +384 -0
  846. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -0
  847. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js +327 -0
  848. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -0
  849. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts +121 -8
  850. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
  851. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js +83 -4
  852. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
  853. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts +266 -8
  854. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
  855. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js +291 -7
  856. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
  857. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts +313 -3
  858. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
  859. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js +369 -3
  860. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
  861. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
  862. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js +2 -1
  863. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
  864. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts +5 -3
  865. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  866. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js +19 -10
  867. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  868. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  869. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +6 -0
  870. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  871. package/dist/esm/users/user-preferences-reset.shared.utils.js +2 -2
  872. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  873. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +0 -3
  874. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  875. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +0 -3
  876. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  877. package/dist/esm/users/user-self.shared.resources-config.schemas.js +1 -1
  878. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  879. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  880. package/dist/esm/users/users.shared.resources-config.schemas.js +82 -20
  881. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  882. package/dist/esm/users/users.shared.schemas.d.ts +12 -9
  883. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  884. package/dist/esm/users/users.shared.schemas.js +49 -18
  885. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  886. package/package.json +4 -4
  887. package/dist/esm/compliance/privacy/data-retention.shared.schemas.js +0 -7
  888. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -32,7 +32,10 @@
32
32
  */
33
33
  import { z } from 'zod';
34
34
  import { initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';
35
- import { FlowsActors_Status } from './flows-actors.commons.shared.schemas.js';
35
+ import { FlowsActors_InitiationKind, FlowsActors_Status, describeFlowsActorsStatus } from './flows-actors.commons.shared.schemas.js';
36
+ import { HumanDecision_Outcome, HumanDecision_RequesterKind, HumanDecision_RouteKind, ReviewClockBasis } from './human-decision.shared.schemas.js';
37
+ import { AutonomousPrincipalSource, AutonomousTurnTrigger } from './autonomous-agents.shared.schemas.js';
38
+ import { WorkUnitRefSchema } from '../resources/work-unit.shared.schemas.js';
36
39
  import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
37
40
  import { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas.js';
38
41
  import { FlowActorSystem_Kind } from './flows-actors.system.shared.schemas.js';
@@ -71,7 +74,7 @@ export var FlowsActors_MessageContentType;
71
74
  })(FlowsActors_MessageContentType || (FlowsActors_MessageContentType = {}));
72
75
  export const FlowActorExecution_MessageSchema = z.object({
73
76
  /** Stable per-message id (client-correlatable across stream deltas). */
74
- id: z.uuid(),
77
+ id: z.uuid().describe("The message's id (a UUID). For an agent reply it is the same `messageId` the live stream used, so a streamed reply can be matched to the stored one."),
75
78
  role: z.enum(FlowsActors_ConversationRole)
76
79
  .describe('Who produced this message.\n\nValues:\n'
77
80
  + '- `user`: the person, or the client acting for them.\n'
@@ -85,7 +88,7 @@ export const FlowActorExecution_MessageSchema = z.object({
85
88
  + '- `progress`: an interim note about work in flight; `data` carries the detail.\n'
86
89
  + '- `data`: a structured payload rather than prose; read `data`, not `content`.'),
87
90
  /** Rendered text content (may be assembled from streamed deltas). */
88
- content: z.string(),
91
+ content: z.string().describe('The text of the message, rendered as `contentType` says. An agent reply is the full text assembled from what was streamed.'),
89
92
  /** Structured payload for `DATA`/`PROGRESS` messages (tool results, progress). */
90
93
  data: z.record(z.string(), z.unknown()).optional(),
91
94
  createdAt: z.date().default(() => new Date()),
@@ -137,7 +140,7 @@ export const FlowActorExecution_PausedApprovalSchema = z.object({
137
140
  * The terminal state on expiry is `FlowsActors_Status.FAILED`, which the status vocabulary already
138
141
  * names for it. Nothing new was invented. Two producers write it and both read "lapsed" from
139
142
  * {@link isFlowActorPausedApprovalLapsed}: the refusal of a decision that arrives too late, and the
140
- * hourly sweep that fails a pause nobody answered (#484).
143
+ * scheduled sweep that fails a pause nobody answered (#484), every minute since gates declare their own lapse (#1628).
141
144
  *
142
145
  * (That vocabulary's doc used to say a DENIAL was terminal too. It is not — a denial resumes the
143
146
  * turn so the model can answer the refusal — and the doc was corrected in the same change.)
@@ -156,9 +159,10 @@ export const FlowActorExecution_PausedApprovalSchema = z.object({
156
159
  * against a conversation, a world and an intent that have all moved on, and "do you approve this?"
157
160
  * with no memory of the question is a prompt people click through.
158
161
  *
159
- * A framework default rather than an operator knob, for now. If an application ever needs its own,
160
- * the knob goes beside the consent lifetime in the auth config — but nobody has asked, and a
161
- * timeout that every application authors identically is a default wearing a config field.
162
+ * The DEFAULT, not a fixed rule: since #1628 a gate may declare its own lapse
163
+ * (`humanApproval.deadlines.lapseAfter`, always elapsed time), and this is what a gate declaring none
164
+ * gets. The gate is the right owner — how long "do you approve deleting this customer?" stays
165
+ * meaningful depends on the action, not on the application.
162
166
  */
163
167
  export const FLOW_ACTOR_APPROVAL_DEFAULT_TIMEOUT_MS = 24 * 60 * 60 * 1000;
164
168
  /** Serialize paused-approval state for the scalar `pausedApproval` string column. */
@@ -283,8 +287,9 @@ export const FlowActorExecutionBaseSchema = z.object({
283
287
  contextRef: z.string().isDBIndexed().excludeFromUpdate().default(''),
284
288
  status: z.enum(FlowsActors_Status).isDBIndexed().isSummaryField(),
285
289
  statusChanges: z.array(z.object({
286
- status: z.enum(FlowsActors_Status),
287
- timestamp: z.date(),
290
+ status: z.enum(FlowsActors_Status)
291
+ .describe(describeFlowsActorsStatus("The state this run moved into at `timestamp`. The list is the run's history, oldest first.")),
292
+ timestamp: z.date().describe('When the run moved into `status`.'),
288
293
  })).default([]),
289
294
  // === Conversational log (chat history) ===
290
295
  /**
@@ -354,6 +359,146 @@ export const FlowActorExecutionBaseSchema = z.object({
354
359
  // runtime continuation state, not conversation content: generic client reads,
355
360
  // summaries and generated API schemas must never disclose it.
356
361
  pausedApproval: z.string().nullish().excludeFromCreate().isBackendOnly(),
362
+ /** Which door opened the turn (#1594). Set on create by the backend; absent on rows older than the column. */
363
+ initiationKind: z.enum(FlowsActors_InitiationKind).systemEnum('FlowsActors_InitiationKind').isBackendOnly().nullish(),
364
+ // === Autonomous turn (#1611) ===
365
+ //
366
+ // Written on CREATE by the autonomous entry point (`startAutonomousAgentTurn`) and by nothing else,
367
+ // and never updated: a turn keeps the agent, trigger and principal source it was opened with for its
368
+ // whole life, including after a reviewer's decision resumes it.
369
+ /**
370
+ * The declared autonomous agent this turn runs as. The resume re-resolves the machine principal from
371
+ * it (with the row's organization), so a binding removed while a decision waits stops the work.
372
+ */
373
+ autonomousAgentRef: z.string().min(1).isDBIndexed().excludeFromUpdate().optional(),
374
+ /** What started the turn. An INBOUND_DELIVERY turn is offered only read or reviewer-gated tools, for its whole life. */
375
+ autonomousTrigger: z.enum(AutonomousTurnTrigger).systemEnum('AutonomousTurnTrigger').excludeFromUpdate().optional(),
376
+ /** Where the machine principal came from when the turn started: the tenant's own client, or a firm's admitted one. */
377
+ autonomousPrincipalSource: z.enum(AutonomousPrincipalSource).systemEnum('AutonomousPrincipalSource').excludeFromUpdate().optional(),
378
+ /**
379
+ * The case the turn works on (#1598 attributes its model calls to it). Accepted at start only when the
380
+ * turn's own principal can READ that row.
381
+ */
382
+ caseRef: WorkUnitRefSchema.excludeFromUpdate().optional(),
383
+ /**
384
+ * The concurrency slot of a `SKIP_IF_ACTIVE` agent: `<agentRef>|<organizationId>` while the turn is
385
+ * active, absent otherwise. The unique index is what makes a second active turn's CREATE fail, which the
386
+ * entry point turns into a skip — the check is the store's, so two occurrences arriving at once cannot
387
+ * both see "none active".
388
+ *
389
+ * Released by the entry point, not by every terminal write: a terminal row still holding its key is
390
+ * reclaimed with a compare-and-swap (on the key AND a terminal status) the next time the slot is
391
+ * wanted. So a turn ended by a sweep, a lapse or an escalation lane needs no knowledge of the slot, and
392
+ * a live turn's key can never be taken. `.optional()` (not nullish) so a clear REMOVES the field: a
393
+ * stored null would be indexed by MongoDB's sparse index and collide with the next clear.
394
+ */
395
+ autonomousActiveSlotKey: z.string().min(1).isUnique({ scope: 'global', sparse: true }).isBackendOnly().optional(),
396
+ // === Pending human decision (#1594) ===
397
+ //
398
+ // Real COLUMNS, on the row that holds the resume compare-and-swap, never in a second store: #1360
399
+ // measured what a store beside the row costs (a second handle, drift, and a two-row write with no
400
+ // transaction, which lets a reassignment and an answer both win). Present only while `status` is
401
+ // AWAITING_APPROVAL; cleared by the CAS that releases the pause. All backend-only: the route says who
402
+ // may answer, and listing it to a generic reader would reveal that a decision exists.
403
+ //
404
+ // DEVIATION from the issue's column list, deliberately: it named a `pendingDecisionRole` beside
405
+ // `pendingDecisionEligibleRole`. For a ROLE route the route's role IS the eligible role, and a claimed
406
+ // decision recovers its role from `pendingDecisionClaimedAt` plus the unchanged eligible role — so a
407
+ // second column could only ever hold a copy that drifts.
408
+ /** The one decision id, shared by both planes and every audit row (`HumanDecision_Request.decisionId`). Minted by the engine at pause. */
409
+ pendingDecisionRef: z.string().min(1).isUnique({ scope: 'global', sparse: true }).isBackendOnly().nullish(),
410
+ pendingDecisionRouteKind: z.enum(HumanDecision_RouteKind).systemEnum('HumanDecision_RouteKind').isDBIndexed().isBackendOnly().nullish(),
411
+ /** The role every holder must meet (ROLE and ASSIGNEE). The listing's role filter. */
412
+ pendingDecisionEligibleRole: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),
413
+ /** The organization the role is matched in. The listing's organization filter. */
414
+ pendingDecisionOrganizationId: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),
415
+ /** Stamped from the requester's unit scope, so a unit-scoped holder can be matched (#1597). */
416
+ pendingDecisionOrganizationUnitId: z.string().min(1).isBackendOnly().nullish(),
417
+ /** ASSIGNEE only. The listing's "assigned to me" filter. */
418
+ pendingDecisionAssigneeUserId: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),
419
+ /** Set when an ASSIGNEE route came from claiming a ROLE route; UNCLAIM restores ROLE. */
420
+ pendingDecisionClaimedAt: z.date().isBackendOnly().nullish(),
421
+ pendingDecisionRequesterKind: z.enum(HumanDecision_RequesterKind).systemEnum('HumanDecision_RequesterKind').isBackendOnly().nullish(),
422
+ /** The user id for USER and DELEGATED_CLIENT; the credential id for MACHINE. What the resume rebuilds authority from. */
423
+ pendingDecisionRequesterRef: z.string().min(1).isBackendOnly().nullish(),
424
+ /** DELEGATED_CLIENT only: the client the person delegated to, re-checked at resume. */
425
+ pendingDecisionRequesterClientId: z.string().min(1).isBackendOnly().nullish(),
426
+ pendingDecisionRequestedAt: z.date().isBackendOnly().nullish(),
427
+ /** When answering is refused. The expiry sweep selects on this column instead of parsing every blob. */
428
+ pendingDecisionExpiresAt: z.date().isDBIndexed().isBackendOnly().nullish(),
429
+ /** Incremented by every reassign, claim, unclaim and escalate; the answer's release CAS includes it, so an answer read under an older route loses. */
430
+ pendingDecisionRouteVersion: z.number().int().nonnegative().isBackendOnly().nullish(),
431
+ // === Pending decision deadlines (#1628) ===
432
+ //
433
+ // The two SERVICE-TARGET clocks (CLAIM, DECISION) beside the lapse above, armed at pause from the gate's
434
+ // `humanApproval.deadlines`. Each stage's due instant is stored, so the sweep never depends on the gate
435
+ // still resolving and a deployment never reshapes a running clock. Cleared with the rest of the pending
436
+ // decision. Backend-only, like the route.
437
+ //
438
+ // DEVIATION from #1628's column list, deliberately: it named the two deadlines and the next-due instant.
439
+ // The two WARNING instants and the two clock bases are stored too — a warning is `warnBefore` earlier on
440
+ // its own basis, and a resume must count the paused time on that basis; recomputing either would read the
441
+ // gate again, which is exactly the dependency storing the deadlines avoids.
442
+ pendingDecisionClaimDeadlineAt: z.date().isBackendOnly().nullish(),
443
+ /** Armed only when the gate's `claim.warnBefore` is declared. */
444
+ pendingDecisionClaimWarningAt: z.date().isBackendOnly().nullish(),
445
+ pendingDecisionClaimClockBasis: z.enum(ReviewClockBasis).systemEnum('ReviewClockBasis').isBackendOnly().nullish(),
446
+ pendingDecisionDecisionDeadlineAt: z.date().isBackendOnly().nullish(),
447
+ /** Armed only when the gate's `decision.warnBefore` is declared. */
448
+ pendingDecisionDecisionWarningAt: z.date().isBackendOnly().nullish(),
449
+ pendingDecisionDecisionClockBasis: z.enum(ReviewClockBasis).systemEnum('ReviewClockBasis').isBackendOnly().nullish(),
450
+ /**
451
+ * The earliest instant a stage may still fire at; `null` while the clocks are paused and once nothing is
452
+ * left to fire. The deadline sweep selects on this indexed column. Every write that fires a stage, pauses,
453
+ * resumes, claims or unclaims recomputes it in the same statement.
454
+ */
455
+ pendingDecisionNextDueAt: z.date().isDBIndexed().isBackendOnly().nullish(),
456
+ /** Set while the CLAIM and DECISION clocks are paused. Never stops the lapse. */
457
+ pendingDecisionClockPausedAt: z.date().isBackendOnly().nullish(),
458
+ /** The gate-declared pause state the clocks are paused in. */
459
+ pendingDecisionClockPauseStateRef: z.string().min(1).isBackendOnly().nullish(),
460
+ /** Paused time accumulated over every completed pause, in milliseconds of wall time. */
461
+ pendingDecisionClockPausedMs: z.number().int().nonnegative().isBackendOnly().nullish(),
462
+ /*
463
+ * One fired marker per stage. Each is written by a compare-and-swap on `(pendingDecisionRef, <marker> IS
464
+ * NULL)`, so a stage fires once however many hosts run the sweep, and only the writer that won runs the
465
+ * stage's actions. Four nullable timestamps rather than one "fired stages" array: an add-if-absent array
466
+ * swap is expressed differently on MongoDB and PostgreSQL, a null check is the same predicate on both.
467
+ */
468
+ pendingDecisionClaimWarningFiredAt: z.date().isBackendOnly().nullish(),
469
+ pendingDecisionClaimMissedFiredAt: z.date().isBackendOnly().nullish(),
470
+ pendingDecisionDecisionWarningFiredAt: z.date().isBackendOnly().nullish(),
471
+ pendingDecisionDecisionMissedFiredAt: z.date().isBackendOnly().nullish(),
472
+ // === Last resolved decision (#1594) ===
473
+ //
474
+ // Written INSIDE the CAS that releases the pause, so a crash after it still leaves a complete record
475
+ // of who decided what — the record #1599's corrections repair from.
476
+ /** The decision these fields describe. Also what a failed release write is re-read against (D10). */
477
+ lastResolvedDecisionRef: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),
478
+ /** Absent for a lapse and for a withdrawal nobody answered. */
479
+ decidedByUserId: z.string().min(1).isBackendOnly().nullish(),
480
+ decidedAt: z.date().isBackendOnly().nullish(),
481
+ decisionOutcome: z.enum(HumanDecision_Outcome).systemEnum('HumanDecision_Outcome').isBackendOnly().nullish(),
482
+ decisionToolName: z.string().min(1).isBackendOnly().nullish(),
483
+ /** The argument NAMES a decider changed. Never their values. */
484
+ decisionModifiedArgumentNames: z.array(z.string()).isBackendOnly().nullish(),
485
+ // === Agent-work review record (#1599): the crash-repair marker ===
486
+ /**
487
+ * The decision whose agent-work record is still OWED. Set by the very write that settles a decision on an agent's
488
+ * proposal (the release, a lapse, a withdrawal) — so a process that dies before the record is written leaves the
489
+ * debt on the row — and cleared by a compare-and-swap once the record exists. The repair sweep selects on it.
490
+ */
491
+ pendingCorrectionRecordRef: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),
492
+ /** When the settled proposal was PUT BEFORE the decider (#1594's claim instant, else its request instant). */
493
+ pendingCorrectionPresentedAt: z.date().isBackendOnly().nullish(),
494
+ /**
495
+ * The organization the owed decision was ROUTED in. The settling write clears the route columns
496
+ * (`pendingDecisionOrganizationId`), so without this a repaired record of a user thread with no case would name no
497
+ * tenant and fall out of that organization's override rate and export.
498
+ */
499
+ pendingCorrectionOrganizationId: z.string().min(1).isBackendOnly().nullish(),
500
+ /** The route role that admitted the decider of the owed decision, cleared by the settle for the same reason. */
501
+ pendingCorrectionAdmittedByRole: z.string().min(1).isBackendOnly().nullish(),
357
502
  // === Timing (system-managed; defaults are load-bearing — the create pipeline
358
503
  // strips these then date-coerces, so a missing default → Invalid Date) ===
359
504
  createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),
@@ -398,8 +543,17 @@ export const flowActorExecutionsPolymorphicDeclaration = declarePolymorphicSchem
398
543
  */
399
544
  export const FlowActorExecutionUpdateInternalSchema = z.object({
400
545
  status: FlowActorExecutionBaseSchema.shape.status.optional(),
401
- statusChanges: FlowActorExecutionBaseSchema.shape.statusChanges.optional(),
402
- messages: FlowActorExecutionBaseSchema.shape.messages.optional(),
546
+ /*
547
+ * `.unwrap()` takes each field's `.default([])` off, and it must stay off. Zod 4 applies an inner
548
+ * default under `.optional()`, so `{ status: FAILED }` parsed to `{ status, statusChanges: [],
549
+ * messages: [] }`, and every partial update of a row reset its transcript and status history.
550
+ * Measured 2026-09-25 on Wonder Todos: a turn cut off by a companion restart was settled FAILED and
551
+ * lost the creator's message, and the page read "Nothing has been said yet". The same held for the
552
+ * resume claim, the pause and the lapsed-approval fail. A default belongs to CREATE; an absent
553
+ * field on an update means "unchanged".
554
+ */
555
+ statusChanges: FlowActorExecutionBaseSchema.shape.statusChanges.unwrap().optional(),
556
+ messages: FlowActorExecutionBaseSchema.shape.messages.unwrap().optional(),
403
557
  finishedAt: FlowActorExecutionBaseSchema.shape.finishedAt,
404
558
  /**
405
559
  * The suspended-turn state, written when a turn pauses for a human decision and cleared when one
@@ -417,6 +571,50 @@ export const FlowActorExecutionUpdateInternalSchema = z.object({
417
571
  * would leave a resumed turn still advertising a decision nobody can answer.
418
572
  */
419
573
  pausedApproval: FlowActorExecutionBaseSchema.shape.pausedApproval.nullish(),
574
+ // #1594 — the pending decision and the last resolution. Allow-listed here for the reason above: a field
575
+ // missing from this contract is a write that succeeds and persists nothing.
576
+ initiationKind: FlowActorExecutionBaseSchema.shape.initiationKind,
577
+ // #1611 — the slot is released by the autonomous entry point; `null` removes it (see the field).
578
+ autonomousActiveSlotKey: FlowActorExecutionBaseSchema.shape.autonomousActiveSlotKey.nullable(),
579
+ pendingDecisionRef: FlowActorExecutionBaseSchema.shape.pendingDecisionRef,
580
+ pendingDecisionRouteKind: FlowActorExecutionBaseSchema.shape.pendingDecisionRouteKind,
581
+ pendingDecisionEligibleRole: FlowActorExecutionBaseSchema.shape.pendingDecisionEligibleRole,
582
+ pendingDecisionOrganizationId: FlowActorExecutionBaseSchema.shape.pendingDecisionOrganizationId,
583
+ pendingDecisionOrganizationUnitId: FlowActorExecutionBaseSchema.shape.pendingDecisionOrganizationUnitId,
584
+ pendingDecisionAssigneeUserId: FlowActorExecutionBaseSchema.shape.pendingDecisionAssigneeUserId,
585
+ pendingDecisionClaimedAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimedAt,
586
+ pendingDecisionRequesterKind: FlowActorExecutionBaseSchema.shape.pendingDecisionRequesterKind,
587
+ pendingDecisionRequesterRef: FlowActorExecutionBaseSchema.shape.pendingDecisionRequesterRef,
588
+ pendingDecisionRequesterClientId: FlowActorExecutionBaseSchema.shape.pendingDecisionRequesterClientId,
589
+ pendingDecisionRequestedAt: FlowActorExecutionBaseSchema.shape.pendingDecisionRequestedAt,
590
+ pendingDecisionExpiresAt: FlowActorExecutionBaseSchema.shape.pendingDecisionExpiresAt,
591
+ pendingDecisionRouteVersion: FlowActorExecutionBaseSchema.shape.pendingDecisionRouteVersion,
592
+ // #1628 — the deadline clocks, allow-listed for the same reason.
593
+ pendingDecisionClaimDeadlineAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimDeadlineAt,
594
+ pendingDecisionClaimWarningAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimWarningAt,
595
+ pendingDecisionClaimClockBasis: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimClockBasis,
596
+ pendingDecisionDecisionDeadlineAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionDeadlineAt,
597
+ pendingDecisionDecisionWarningAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionWarningAt,
598
+ pendingDecisionDecisionClockBasis: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionClockBasis,
599
+ pendingDecisionNextDueAt: FlowActorExecutionBaseSchema.shape.pendingDecisionNextDueAt,
600
+ pendingDecisionClockPausedAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClockPausedAt,
601
+ pendingDecisionClockPauseStateRef: FlowActorExecutionBaseSchema.shape.pendingDecisionClockPauseStateRef,
602
+ pendingDecisionClockPausedMs: FlowActorExecutionBaseSchema.shape.pendingDecisionClockPausedMs,
603
+ pendingDecisionClaimWarningFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimWarningFiredAt,
604
+ pendingDecisionClaimMissedFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimMissedFiredAt,
605
+ pendingDecisionDecisionWarningFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionWarningFiredAt,
606
+ pendingDecisionDecisionMissedFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionMissedFiredAt,
607
+ lastResolvedDecisionRef: FlowActorExecutionBaseSchema.shape.lastResolvedDecisionRef,
608
+ decidedByUserId: FlowActorExecutionBaseSchema.shape.decidedByUserId,
609
+ decidedAt: FlowActorExecutionBaseSchema.shape.decidedAt,
610
+ decisionOutcome: FlowActorExecutionBaseSchema.shape.decisionOutcome,
611
+ decisionToolName: FlowActorExecutionBaseSchema.shape.decisionToolName,
612
+ decisionModifiedArgumentNames: FlowActorExecutionBaseSchema.shape.decisionModifiedArgumentNames,
613
+ // #1599 — the agent-work record the settlement owes; allow-listed for the reason above.
614
+ pendingCorrectionRecordRef: FlowActorExecutionBaseSchema.shape.pendingCorrectionRecordRef,
615
+ pendingCorrectionPresentedAt: FlowActorExecutionBaseSchema.shape.pendingCorrectionPresentedAt,
616
+ pendingCorrectionOrganizationId: FlowActorExecutionBaseSchema.shape.pendingCorrectionOrganizationId,
617
+ pendingCorrectionAdmittedByRole: FlowActorExecutionBaseSchema.shape.pendingCorrectionAdmittedByRole,
420
618
  });
421
619
  /**
422
620
  * One string for a set of context resource identifiers — `key=value` pairs sorted by key, joined
@@ -1 +1 @@
1
- {"version":3,"file":"flows-actors-execution.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAA2E,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACpJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,gDAAgD,CAAC;AACxD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M,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,MAAM,EAAE,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC5D,aAAa,EAAE,4BAA4B,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;IAC1E,QAAQ,EAAE,4BAA4B,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE;IAChE,UAAU,EAAE,4BAA4B,CAAC,KAAK,CAAC,UAAU;IACzD;;;;;;;;;;;;;;OAcG;IACH,cAAc,EAAE,4BAA4B,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE;CAC5E,CAAC,CAAC;AAaH;;;;;;;GAOG;AACH,MAAM,UAAU,iCAAiC,CAAC,WAAyD;IACzG,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;SAC5B,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;SAC1C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["/**\n * Flows-Actors Execution — Persisted Resource Schema (POLYMORPHIC)\n * ================================================================\n *\n * A persisted record of a single flow/actor **system execution** — in v1 the\n * durable source of truth for a conversational chat log (`messages[]`) plus the\n * execution's lifecycle status.\n *\n * POLYMORPHIC ACROSS OWNER SCOPE. The SAME base envelope is stamped out as THREE\n * genuine single-scope resources by `declarePolymorphicSchemas()`, one owner FK\n * injected per variant:\n * - `userFlowActorExecutions` (USER_SELF — `userId`) ← WS chat + user-delegated A2A\n * - `organizationFlowActorExecutions` (ORGANIZATIONS — `organizationId`) ← org-machine A2A\n * - `applicationFlowActorExecutions` (APPLICATION — `applicationId`) ← app-machine A2A\n *\n * A conversation is owned by EXACTLY ONE scope (its injected owner FK). There is\n * no cross-scope audit dimension on the base — ownership IS the scope. This is the\n * honest \"one concept, N owners\" model (mirrors billing accounts / subscriptions)\n * and needs ZERO core-authorizer change: each variant satisfies its own scope\n * authorizer, and `polymorphicRole` resolves the operation roles per scope. A\n * machine (API key / OIDC client) reaches its org/app variant exactly as it\n * reaches any other org/app resource — standard RBAC via its granted roles.\n *\n * KIND-AGNOSTIC BY DESIGN. A `FlowActorSystem_Kind` discriminant lets the SAME\n * resource persist both flow and actor executions. v1 implements the ACTOR\n * conversational path; the FLOW path drops in without reshaping the base envelope.\n *\n * @see flows-actors.system.shared.schemas.ts — the base execution envelope\n * @see billing-account.shared.schemas.ts — the polymorphic-scope precedent\n * @see requests/websocket.shared.schemas.ts — the streamed message payload this\n * log mirrors (`WS_FlowsActorsMessagePayloadSchema`)\n */\n\nimport { z } from 'zod';\nimport { initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\nimport { FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE, FLOWS_ACTORS_NO_MACHINE_CREDENTIAL, FlowsActors_Status } from './flows-actors.commons.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { FlowActorSystem_Kind } from './flows-actors.system.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n//===============================================================\n// Conversational message log\n//===============================================================\n\n/**\n * Author of a persisted conversational message. `TOOL` records a tool-call /\n * tool-result turn (grounding retrieval); `SYSTEM` records a system/status note.\n * WS-streamed messages are always server→client, so the transport shape carries\n * no role — the persisted log adds it to reconstruct a full transcript.\n */\nexport enum FlowsActors_ConversationRole {\n USER = 'user',\n ASSISTANT = 'assistant',\n SYSTEM = 'system',\n TOOL = 'tool',\n}\n\n/**\n * Rendering hint for a message body. Mirrors the streamed\n * `WS_FlowsActorsMessagePayloadSchema.messageType` literal union exactly\n * (`text | markdown | progress | data`) as an enum so the persisted log and the\n * live stream share one vocabulary (framework rule: enums over literal unions).\n */\nexport enum FlowsActors_MessageContentType {\n TEXT = 'text',\n MARKDOWN = 'markdown',\n PROGRESS = 'progress',\n DATA = 'data',\n}\n\nexport const FlowActorExecution_MessageSchema = z.object({\n /** Stable per-message id (client-correlatable across stream deltas). */\n id: z.uuid(),\n role: z.enum(FlowsActors_ConversationRole)\n .describe(\n 'Who produced this message.\\n\\nValues:\\n'\n + '- `user`: the person, or the client acting for them.\\n'\n + '- `assistant`: the agent.\\n'\n + '- `system`: instructions the agent was given, not part of the conversation a person sees.\\n'\n + '- `tool`: the result of something the agent called.',\n ),\n contentType: z.enum(FlowsActors_MessageContentType).default(FlowsActors_MessageContentType.TEXT)\n .describe(\n 'How to render `content`.\\n\\nValues:\\n'\n + '- `text`: plain text.\\n'\n + '- `markdown`: text with Markdown formatting.\\n'\n + '- `progress`: an interim note about work in flight; `data` carries the detail.\\n'\n + '- `data`: a structured payload rather than prose; read `data`, not `content`.',\n ),\n /** Rendered text content (may be assembled from streamed deltas). */\n content: z.string(),\n /** Structured payload for `DATA`/`PROGRESS` messages (tool results, progress). */\n data: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.date().default(() => new Date()),\n});\nexport type FlowActorExecution_Message = z.infer<typeof FlowActorExecution_MessageSchema>;\n\n/**\n * The SUSPENDED-TURN state persisted when an agent turn pauses at a human-in-the-loop\n * approval boundary (execution `status` = `AWAITING_APPROVAL`). It is stored SERIALIZED as a\n * JSON string in the `pausedApproval` scalar field — NOT as a nested Zod object — because heavy\n * nested sub-structures do not round-trip through the Zod→Mongoose embedded-subdocument\n * conversion (see the per-kind state note below). Parse/serialize ONLY via the helpers below at\n * the persistence boundary; the record column itself stays a plain string.\n */\nexport const FlowActorExecution_PausedApprovalSchema = z.object({\n /**\n * Correlates the emitted approval REQUEST with the inbound decision (idempotency key).\n *\n * An OPAQUE identifier minted by the model SDK — NOT a Wildo id and NOT a UUID. It was typed\n * `z.uuid()` on the reasonable-looking assumption that an id is a uuid, and the SDK produces\n * values like `aitxt-3Xfhq68r7GTRXEuV1YzU4eEc`.\n *\n * That single wrong assumption made EVERY paused turn unresumable, and hid completely: serializing\n * is `JSON.stringify` and does not validate, so the pause persisted perfectly; only the resume's\n * `parse` rejected it, as a CORRUPTED blob. The turn then stayed paused forever with a\n * \"state is unreadable\" error naming the wrong cause. Unit fixtures used a real uuid, so they were\n * more conformant than production and could never reproduce it — the live lane found it.\n *\n * Validate it as an opaque non-empty string. We do not own the format and must not assert one.\n */\n approvalId: z.string().min(1),\n /**\n * The AI-SDK model-message array to RESUME from — opaque to us (the SDK's own resume\n * contract). Captured when the approval-gated tool call suspended the stream; on the human\n * decision the runtime appends a tool-approval-response and re-invokes with these messages.\n */\n sdkModelMessages: z.array(z.record(z.string(), z.unknown())),\n /** The approval-gated tool the model wants to call (drives the human-facing prompt). */\n pendingToolName: z.string(),\n /** The pending tool call's arguments (drives the human-facing action description). */\n pendingToolArgs: z.record(z.string(), z.unknown()).optional(),\n /** ISO timestamp when the approval was requested. */\n requestedAt: z.string(),\n /**\n * ISO instant after which the paused turn must not be resumed.\n *\n * SET ON EVERY SUSPENSION since 2026-09-08 (#465). It was declared here, carried on the\n * approval-request WebSocket payload and read and converted by the browser, and NO WRITER EVER SET\n * IT — so a pending approval never expired and the field described a timeout that did not exist.\n *\n * The terminal state on expiry is `FlowsActors_Status.FAILED`, which the status vocabulary already\n * names for it. Nothing new was invented. Two producers write it and both read \"lapsed\" from\n * {@link isFlowActorPausedApprovalLapsed}: the refusal of a decision that arrives too late, and the\n * hourly sweep that fails a pause nobody answered (#484).\n *\n * (That vocabulary's doc used to say a DENIAL was terminal too. It is not — a denial resumes the\n * turn so the model can answer the refusal — and the doc was corrected in the same change.)\n *\n * Still optional: a suspension persisted before that date carries none, and an absent expiry means\n * the pause does not lapse — which is what those turns were paused under.\n */\n expiresAt: z.string().optional(),\n});\nexport type FlowActorExecution_PausedApproval = z.infer<typeof FlowActorExecution_PausedApprovalSchema>;\n\n/**\n * How long a human has to answer an approval-gated tool call before the turn is refused.\n *\n * **24 hours.** An agent pausing for a person should span a working day plus a night, so a request\n * raised late in the afternoon is still answerable the next morning. Much beyond that and the\n * decision stops being meaningful rather than merely late: the person is approving a tool call made\n * against a conversation, a world and an intent that have all moved on, and \"do you approve this?\"\n * with no memory of the question is a prompt people click through.\n *\n * A framework default rather than an operator knob, for now. If an application ever needs its own,\n * the knob goes beside the consent lifetime in the auth config — but nobody has asked, and a\n * timeout that every application authors identically is a default wearing a config field.\n */\nexport const FLOW_ACTOR_APPROVAL_DEFAULT_TIMEOUT_MS = 24 * 60 * 60 * 1000;\n\n/** Serialize paused-approval state for the scalar `pausedApproval` string column. */\nexport function serializeFlowActorPausedApproval(state: FlowActorExecution_PausedApproval): string {\n return JSON.stringify(state);\n}\n\n/**\n * Parse the scalar `pausedApproval` string column back to typed state. Throws (ZodError /\n * SyntaxError) on a malformed blob — a corrupted paused record must fail loudly at resume,\n * never silently resume from garbage.\n */\nexport function parseFlowActorPausedApproval(raw: string): FlowActorExecution_PausedApproval {\n return FlowActorExecution_PausedApprovalSchema.parse(JSON.parse(raw));\n}\n\n/**\n * Whether a paused turn's approval window has CLOSED at `now` — the ONE definition of \"lapsed\".\n *\n * Two consumers act on it and neither may re-derive it (#484): the approval-response path, which\n * refuses a decision that arrives too late, and the scheduled sweep that fails a pause nobody ever\n * answered. Written twice, they would drift at exactly the boundary that matters — one inclusive,\n * one exclusive — and a decision arriving on the instant would be refused by one and resumed by the\n * other.\n *\n * - **Inclusive at the instant.** `expiresAt` is the moment after which the turn \"must not be\n * resumed\", so at `expiresAt` itself the window is already closed.\n * - **An absent expiry never lapses.** A suspension persisted before #465 carries none, and those\n * turns were paused under a contract with no timeout. Inventing one retroactively would fail them\n * on a rule they were never given.\n * - **An unparseable instant never lapses.** `new Date('garbage')` is `NaN`, every comparison with\n * which is false. Failing a turn on a value nobody can read would turn a corrupted field into a\n * destroyed conversation; leaving it paused keeps it recoverable, and the resume path already\n * refuses a blob it cannot parse.\n */\nexport function isFlowActorPausedApprovalLapsed(paused: Pick<FlowActorExecution_PausedApproval, 'expiresAt'>, now: Date): boolean {\n if (paused.expiresAt === undefined) return false;\n const expiresAtMs = new Date(paused.expiresAt).getTime();\n return Number.isFinite(expiresAtMs) && expiresAtMs <= now.getTime();\n}\n\n//===============================================================\n// Per-kind execution state (reused from the shared execution types)\n//===============================================================\n\n// NOTE (v1 scope): the persisted record is the CONVERSATIONAL envelope only —\n// `kind` + `status`/`statusChanges` + the `messages[]` chat log. The richer\n// per-kind graph-state slots (`flowState` node-states / `actorState` plan+tasks,\n// sliced from `FlowSystem_Execution` / `ActorSystem_Execution`) are intentionally\n// NOT persisted yet: the v1 conversational runtime never writes them, and those\n// heavy nested sub-structures (required `plan`/`standaloneTasks`\n// with embedded `_id`s) do not round-trip through the Zod→Mongoose embedded-\n// subdocument conversion as optional slots (empty subdocs get instantiated and\n// fail required-path validation). When the flow/actor orchestration runtime\n// actually produces graph state, add typed `flowState`/`actorState` back WITH the\n// embedded-subdocument treatment (see the zod↔mongoose nested-union / embedded-id\n// notes) rather than a raw `.pick()`. `kind` already preserves discrimination.\n\n//===============================================================\n// Base execution record — NO owner scope FK (injected per variant)\n//===============================================================\n\n/**\n * The conversation envelope shared by every scope variant. It carries NO owner\n * scope FK: `declarePolymorphicSchemas()` injects exactly ONE (`userId` /\n * `organizationId` / `applicationId`) per variant. Do NOT add an `initiator`\n * snapshot here — a nested `initiator.userId`/`.organizationId` collides with the\n * contextual scope filter (it matches the field identifier at every schema path\n * and injects an exact-subdocument clause that never equals the stored snapshot,\n * so every scoped read/update silently matches zero rows). Ownership lives ONLY on\n * the single injected top-level owner FK.\n */\nexport const FlowActorExecutionBaseSchema = z.object({\n /** MongoDB document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey(),\n\n /**\n * Stable business id of the execution, generated by the conversational runtime\n * and echoed over the WebSocket channel (`WS_FlowsActors*.executionId`). Unique\n * per variant collection (a UUID — no cross-collection collision). Immutable\n * once created.\n */\n executionId: z.uuid().isUnique({ scope: 'global', sparse: false }).excludeFromUpdate().isSummaryField(),\n\n // === System identity (set on create, immutable) ===\n /** Ref of the executed flow/actor system (`FlowActorSystem.ref`). */\n systemRef: z.string().isDBIndexed().excludeFromUpdate().isSummaryField(),\n /** Discriminant selecting which state slot is populated. */\n kind: z.enum(FlowActorSystem_Kind).isDBIndexed().excludeFromUpdate().isSummaryField(),\n\n // === Runtime status ===\n /**\n * WHICH agent this conversation was opened through — part of the read filter, not metadata.\n *\n * The task family carried this from gate #3; executions did not, so a caller holding a\n * `contextId` could continue that thread through a DIFFERENT declared agent and load the prior\n * transcript into the other agent's context. A2A agents are declared as separate resource servers\n * with per-instance token audiences, and the plane at risk here holds the full message log — not\n * a 120-character title (review finding G5-8).\n *\n * The WebSocket surface has no agent, and the default A2A agent is an identity of its own; both\n * store {@link FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE}.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH machine credential opened this conversation — part of the read filter, not metadata.\n *\n * Identical axis and identical reasoning to the task family: the injected scope FK does not\n * identify the principal on the machine variants (`applicationId` is a deployment singleton;\n * `organizationId` is shared by every machine client of one tenant), so without it a\n * separately-credentialed client could read and continue another client's conversation — which\n * carries the full message log, not merely a title.\n *\n * User-delegated turns store {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL}: the human is the\n * principal there and the `userId` owner FK already discriminates.\n */\n machineCredentialId: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH context this conversation was opened in — the client's `contextResourceIdentifiers` on\n * `FLOWS_ACTORS_START`, folded into one indexed string by {@link canonicalizeFlowsActorsContextRef}\n * so history can list by it with plain equality on every adapter. Set on create, immutable.\n *\n * It is a PARTITION, not an access filter: the owner FK, the agent instance and the machine\n * credential above decide who may read a row; this decides which of a caller's own threads belong\n * to the surface asking. Without it every thread a user ever opened against a system lists\n * together, whatever it was about — measured 2026-09-22 on a tool that hosts one system for\n * several applications sharing one database, where the threads of one application appeared in\n * the next (#1454). `''` is \"no context\", never absent, so the equality filter can name it.\n */\n contextRef: z.string().isDBIndexed().excludeFromUpdate().default(''),\n\n status: z.enum(FlowsActors_Status).isDBIndexed().isSummaryField(),\n statusChanges: z.array(z.object({\n status: z.enum(FlowsActors_Status),\n timestamp: z.date(),\n })).default([]),\n\n // === Conversational log (chat history) ===\n /**\n * The conversation transcript.\n *\n * ## Provenance: SUBJECT_PROVIDED, and the asymmetry is the reason (review finding F5-6)\n *\n * This array MIXES subject-authored turns (`role: USER`) with model-generated ones\n * (`role: ASSISTANT`), and provenance is declared per FIELD — there is no per-element mechanism,\n * so one classification must cover both. The two ways of being wrong are not equally bad:\n *\n * • Classifying DERIVED would EXCLUDE the subject's own words from an Art. 20 bundle. That is a\n * failure of the right the article exists to serve.\n * • Classifying SUBJECT_PROVIDED includes the assistant's replies alongside them. That is\n * over-delivery — but of a transcript the subject was a party to and already saw, which is the\n * natural unit a person means by \"my conversation\".\n *\n * So the classification follows the ASYMMETRY, not a per-element truth we cannot express. Revisit\n * only if per-element provenance ever exists; splitting the array by role at export time was\n * considered and rejected as inventing a second mechanism for one field.\n *\n * ⚠️ **This is a LABELLING change, not a behaviour change**, and the first version of this note\n * failed to say so. `resolvePortabilityFieldScope` maps `SUBJECT_PROVIDED` *and* `OBSERVED` to\n * `INCLUDED`, and the resource default was already `OBSERVED` — so `messages` was in the Art. 20\n * bundle before and after. Nothing about an export changes.\n *\n * The rejected alternative the first version omitted is the one that was actually in force:\n * **`OBSERVED`** — \"data generated by the subject's USE of the service\", a defensible reading of a\n * mixed transcript. It is rejected for precision rather than effect: the USER turns are authored\n * BY the subject, not merely observed of them, and a classification should say the truest thing\n * available even when two values resolve alike today.\n *\n * The task family's `output`/`artifacts` are DERIVED by contrast, and that is not an\n * inconsistency: those are model output ABOUT the work, with no subject-authored content mixed in.\n */\n // RESET on erasure — returns this field to its schema default. It holds the conversation itself,\n // which the category above correctly declares as personal data. RESET rather than REMOVE or MASK\n // because the field is non-nullable WITH a `.default()`: REMOVE needs a clearable field and MASK\n // needs a string. The value comes from the schema, so there is no second copy to drift.\n messages: addImpersonalizeWith(\n FlowActorExecution_MessageSchema.array().default([])\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n // The conversation itself. Category as well as provenance, so a notice can enumerate it: the two\n // axes answer different questions and a provenance alone leaves the field an OUTSTANDING gap.\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.RESET,\n ),\n\n // === HITL (human-in-the-loop) suspension ===\n /**\n * Serialized {@link FlowActorExecution_PausedApproval} — present ONLY while `status` is\n * `AWAITING_APPROVAL`. A scalar JSON string (see that schema's doc for why it is NOT a nested\n * object: the Zod→Mongoose round-trip). Set on pause, cleared on resume / terminal completion;\n * never authored on create.\n */\n /**\n * Serialized suspended-turn state; `null` once a decision releases the pause.\n *\n * `.nullish()`, not `.optional()`, and the difference is load-bearing at the READ. Clearing writes\n * an explicit `null`; the write then re-parses the row to project its response, and under\n * `.optional()` that projection throws `expected string, received null`. The clear PERSISTS (there\n * is no transaction to roll back) and the operation still fails — so the pause was released and\n * the resume aborted, leaving the turn `failed` with its work never done, reported as a resource\n * transformation error that names nothing about approvals.\n *\n * The input contract needing `.nullish()` (see `FlowActorExecutionUpdateInternalSchema`) is a\n * SEPARATE surface from this one. Fixing only that gets the value written and still throws on the\n * way out — both must admit null or neither does.\n */\n // This blob contains SDK resume messages and pending tool arguments. It is\n // runtime continuation state, not conversation content: generic client reads,\n // summaries and generated API schemas must never disclose it.\n pausedApproval: z.string().nullish().excludeFromCreate().isBackendOnly(),\n\n // === Timing (system-managed; defaults are load-bearing — the create pipeline\n // strips these then date-coerces, so a missing default → Invalid Date) ===\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate().isSummaryField(),\n /** Set on terminal completion (via UPDATE); never on create. */\n finishedAt: z.date().optional().excludeFromCreate().isSummaryField(),\n});\nexport type FlowActorExecutionBase = z.infer<typeof FlowActorExecutionBaseSchema>;\n\n//===============================================================\n// Polymorphic declaration — one owner-scope variant per scope\n//===============================================================\n\n/**\n * The three owner-scope variants a flows-actors execution is stamped out for.\n * Each is `isPrimaryScope: true` (the injected owner FK is the primary scope), and\n * each opts OUT of the singleton auto-business-key: a conversation is MULTI-ROW\n * per scope (many discussions per user/org/app), so the injected owner FK must NOT\n * be marked `.isUnique()` — otherwise the second conversation per scope would fail\n * with a duplicate-key error. Mirrors subscriptions / usage-records / SSO\n * connections (all multi-row polymorphic resources).\n */\nexport const FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n].map(optOutPolymorphicAutoBusinessKey);\n\n/**\n * Polymorphic declaration for flows-actors executions. Produces 3 variants:\n * - users → `userFlowActorExecutions` (`userId` injected)\n * - organizations→ `organizationFlowActorExecutions` (`organizationId` injected)\n * - applications → `applicationFlowActorExecutions` (`applicationId` injected)\n */\nexport const flowActorExecutionsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'flowActorExecutions',\n baseFieldIdentifier: 'flowActorExecutionId',\n baseEnumKey: 'FLOW_ACTOR_EXECUTIONS',\n baseSchema: FlowActorExecutionBaseSchema,\n variants: FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS,\n});\n\n/**\n * Owner-agnostic UPDATE DTO — status transitions, appended messages, completion\n * time. Shared across all variants because it references NO owner FK (owner is\n * immutable). `updatedAt` is system-managed; identity fields are `.excludeFromUpdate()`.\n */\nexport const FlowActorExecutionUpdateInternalSchema = z.object({\n status: FlowActorExecutionBaseSchema.shape.status.optional(),\n statusChanges: FlowActorExecutionBaseSchema.shape.statusChanges.optional(),\n messages: FlowActorExecutionBaseSchema.shape.messages.optional(),\n finishedAt: FlowActorExecutionBaseSchema.shape.finishedAt,\n /**\n * The suspended-turn state, written when a turn pauses for a human decision and cleared when one\n * arrives.\n *\n * ⚠️ THIS SCHEMA IS AN ALLOW-LIST, and omitting a field here does not fail — it makes the write\n * SUCCEED and persist nothing. `pausedApproval` was added to the base envelope when the column was\n * introduced but never here, so every approval pause wrote its status and its messages and\n * silently dropped the one field that makes the turn resumable. The row read back as\n * `AWAITING_APPROVAL` with no state to resume from: a turn stuck forever, with no error anywhere.\n * Adding a persisted field is therefore never done without adding it to this contract.\n *\n * `.nullish()` rather than `.optional()` because clearing is a real transition: the resume writes\n * an explicit `null` to release the pause, and under `.optional()` that null is rejected — which\n * would leave a resumed turn still advertising a decision nobody can answer.\n */\n pausedApproval: FlowActorExecutionBaseSchema.shape.pausedApproval.nullish(),\n});\n\n//===============================================================\n// Exported runtime type\n//===============================================================\n\n/**\n * Runtime shape of a persisted execution (the base envelope). The owner FK is\n * variant-specific (`userId` | `organizationId` | `applicationId`) and read from\n * the concrete variant; the conversational runtime supplies it explicitly on create.\n */\nexport type FlowActorExecution = z.infer<typeof FlowActorExecutionBaseSchema>;\n\n/**\n * One string for a set of context resource identifiers — `key=value` pairs sorted by key, joined\n * with `;`. Deterministic, so the transport that opens a conversation and the surface that lists\n * history compute the same value from the same identifiers; `''` for none.\n *\n * Keys and values carry no `=` or `;` in practice (they are resource types and ids); the function\n * does not escape, so a value that did would fold two contexts into one, never split one in two.\n */\nexport function canonicalizeFlowsActorsContextRef(identifiers: Readonly<Record<string, string>> | undefined): string {\n if (!identifiers) return '';\n return Object.keys(identifiers)\n .sort()\n .map((key) => `${key}=${identifiers[key]}`)\n .join(';');\n}\n"]}
1
+ {"version":3,"file":"flows-actors-execution.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAA2E,0BAA0B,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAC3M,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChJ,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kDAAkD,CAAC;AAE1D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,iEAAiE;AACjE,8BAA8B;AAC9B,iEAAiE;AAEjE;;;;;GAKG;AACH,MAAM,CA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AAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;SAC1C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["/**\n * Flows-Actors Execution — Persisted Resource Schema (POLYMORPHIC)\n * ================================================================\n *\n * A persisted record of a single flow/actor **system execution** — in v1 the\n * durable source of truth for a conversational chat log (`messages[]`) plus the\n * execution's lifecycle status.\n *\n * POLYMORPHIC ACROSS OWNER SCOPE. The SAME base envelope is stamped out as THREE\n * genuine single-scope resources by `declarePolymorphicSchemas()`, one owner FK\n * injected per variant:\n * - `userFlowActorExecutions` (USER_SELF — `userId`) ← WS chat + user-delegated A2A\n * - `organizationFlowActorExecutions` (ORGANIZATIONS — `organizationId`) ← org-machine A2A\n * - `applicationFlowActorExecutions` (APPLICATION — `applicationId`) ← app-machine A2A\n *\n * A conversation is owned by EXACTLY ONE scope (its injected owner FK). There is\n * no cross-scope audit dimension on the base — ownership IS the scope. This is the\n * honest \"one concept, N owners\" model (mirrors billing accounts / subscriptions)\n * and needs ZERO core-authorizer change: each variant satisfies its own scope\n * authorizer, and `polymorphicRole` resolves the operation roles per scope. A\n * machine (API key / OIDC client) reaches its org/app variant exactly as it\n * reaches any other org/app resource — standard RBAC via its granted roles.\n *\n * KIND-AGNOSTIC BY DESIGN. A `FlowActorSystem_Kind` discriminant lets the SAME\n * resource persist both flow and actor executions. v1 implements the ACTOR\n * conversational path; the FLOW path drops in without reshaping the base envelope.\n *\n * @see flows-actors.system.shared.schemas.ts — the base execution envelope\n * @see billing-account.shared.schemas.ts — the polymorphic-scope precedent\n * @see requests/websocket.shared.schemas.ts — the streamed message payload this\n * log mirrors (`WS_FlowsActorsMessagePayloadSchema`)\n */\n\nimport { z } from 'zod';\nimport { initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\nimport { FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE, FLOWS_ACTORS_NO_MACHINE_CREDENTIAL, FlowsActors_InitiationKind, FlowsActors_Status, describeFlowsActorsStatus } from './flows-actors.commons.shared.schemas';\nimport { HumanDecision_Outcome, HumanDecision_RequesterKind, HumanDecision_RouteKind, ReviewClockBasis } from './human-decision.shared.schemas';\nimport { AutonomousPrincipalSource, AutonomousTurnTrigger } from './autonomous-agents.shared.schemas';\nimport { WorkUnitRefSchema } from '../resources/work-unit.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { FlowActorSystem_Kind } from './flows-actors.system.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n//===============================================================\n// Conversational message log\n//===============================================================\n\n/**\n * Author of a persisted conversational message. `TOOL` records a tool-call /\n * tool-result turn (grounding retrieval); `SYSTEM` records a system/status note.\n * WS-streamed messages are always server→client, so the transport shape carries\n * no role — the persisted log adds it to reconstruct a full transcript.\n */\nexport enum FlowsActors_ConversationRole {\n USER = 'user',\n ASSISTANT = 'assistant',\n SYSTEM = 'system',\n TOOL = 'tool',\n}\n\n/**\n * Rendering hint for a message body. Mirrors the streamed\n * `WS_FlowsActorsMessagePayloadSchema.messageType` literal union exactly\n * (`text | markdown | progress | data`) as an enum so the persisted log and the\n * live stream share one vocabulary (framework rule: enums over literal unions).\n */\nexport enum FlowsActors_MessageContentType {\n TEXT = 'text',\n MARKDOWN = 'markdown',\n PROGRESS = 'progress',\n DATA = 'data',\n}\n\nexport const FlowActorExecution_MessageSchema = z.object({\n /** Stable per-message id (client-correlatable across stream deltas). */\n id: z.uuid().describe(\"The message's id (a UUID). For an agent reply it is the same `messageId` the live stream used, so a streamed reply can be matched to the stored one.\"),\n role: z.enum(FlowsActors_ConversationRole)\n .describe(\n 'Who produced this message.\\n\\nValues:\\n'\n + '- `user`: the person, or the client acting for them.\\n'\n + '- `assistant`: the agent.\\n'\n + '- `system`: instructions the agent was given, not part of the conversation a person sees.\\n'\n + '- `tool`: the result of something the agent called.',\n ),\n contentType: z.enum(FlowsActors_MessageContentType).default(FlowsActors_MessageContentType.TEXT)\n .describe(\n 'How to render `content`.\\n\\nValues:\\n'\n + '- `text`: plain text.\\n'\n + '- `markdown`: text with Markdown formatting.\\n'\n + '- `progress`: an interim note about work in flight; `data` carries the detail.\\n'\n + '- `data`: a structured payload rather than prose; read `data`, not `content`.',\n ),\n /** Rendered text content (may be assembled from streamed deltas). */\n content: z.string().describe('The text of the message, rendered as `contentType` says. An agent reply is the full text assembled from what was streamed.'),\n /** Structured payload for `DATA`/`PROGRESS` messages (tool results, progress). */\n data: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.date().default(() => new Date()),\n});\nexport type FlowActorExecution_Message = z.infer<typeof FlowActorExecution_MessageSchema>;\n\n/**\n * The SUSPENDED-TURN state persisted when an agent turn pauses at a human-in-the-loop\n * approval boundary (execution `status` = `AWAITING_APPROVAL`). It is stored SERIALIZED as a\n * JSON string in the `pausedApproval` scalar field — NOT as a nested Zod object — because heavy\n * nested sub-structures do not round-trip through the Zod→Mongoose embedded-subdocument\n * conversion (see the per-kind state note below). Parse/serialize ONLY via the helpers below at\n * the persistence boundary; the record column itself stays a plain string.\n */\nexport const FlowActorExecution_PausedApprovalSchema = z.object({\n /**\n * Correlates the emitted approval REQUEST with the inbound decision (idempotency key).\n *\n * An OPAQUE identifier minted by the model SDK — NOT a Wildo id and NOT a UUID. It was typed\n * `z.uuid()` on the reasonable-looking assumption that an id is a uuid, and the SDK produces\n * values like `aitxt-3Xfhq68r7GTRXEuV1YzU4eEc`.\n *\n * That single wrong assumption made EVERY paused turn unresumable, and hid completely: serializing\n * is `JSON.stringify` and does not validate, so the pause persisted perfectly; only the resume's\n * `parse` rejected it, as a CORRUPTED blob. The turn then stayed paused forever with a\n * \"state is unreadable\" error naming the wrong cause. Unit fixtures used a real uuid, so they were\n * more conformant than production and could never reproduce it — the live lane found it.\n *\n * Validate it as an opaque non-empty string. We do not own the format and must not assert one.\n */\n approvalId: z.string().min(1),\n /**\n * The AI-SDK model-message array to RESUME from — opaque to us (the SDK's own resume\n * contract). Captured when the approval-gated tool call suspended the stream; on the human\n * decision the runtime appends a tool-approval-response and re-invokes with these messages.\n */\n sdkModelMessages: z.array(z.record(z.string(), z.unknown())),\n /** The approval-gated tool the model wants to call (drives the human-facing prompt). */\n pendingToolName: z.string(),\n /** The pending tool call's arguments (drives the human-facing action description). */\n pendingToolArgs: z.record(z.string(), z.unknown()).optional(),\n /** ISO timestamp when the approval was requested. */\n requestedAt: z.string(),\n /**\n * ISO instant after which the paused turn must not be resumed.\n *\n * SET ON EVERY SUSPENSION since 2026-09-08 (#465). It was declared here, carried on the\n * approval-request WebSocket payload and read and converted by the browser, and NO WRITER EVER SET\n * IT — so a pending approval never expired and the field described a timeout that did not exist.\n *\n * The terminal state on expiry is `FlowsActors_Status.FAILED`, which the status vocabulary already\n * names for it. Nothing new was invented. Two producers write it and both read \"lapsed\" from\n * {@link isFlowActorPausedApprovalLapsed}: the refusal of a decision that arrives too late, and the\n * scheduled sweep that fails a pause nobody answered (#484), every minute since gates declare their own lapse (#1628).\n *\n * (That vocabulary's doc used to say a DENIAL was terminal too. It is not — a denial resumes the\n * turn so the model can answer the refusal — and the doc was corrected in the same change.)\n *\n * Still optional: a suspension persisted before that date carries none, and an absent expiry means\n * the pause does not lapse — which is what those turns were paused under.\n */\n expiresAt: z.string().optional(),\n});\nexport type FlowActorExecution_PausedApproval = z.infer<typeof FlowActorExecution_PausedApprovalSchema>;\n\n/**\n * How long a human has to answer an approval-gated tool call before the turn is refused.\n *\n * **24 hours.** An agent pausing for a person should span a working day plus a night, so a request\n * raised late in the afternoon is still answerable the next morning. Much beyond that and the\n * decision stops being meaningful rather than merely late: the person is approving a tool call made\n * against a conversation, a world and an intent that have all moved on, and \"do you approve this?\"\n * with no memory of the question is a prompt people click through.\n *\n * The DEFAULT, not a fixed rule: since #1628 a gate may declare its own lapse\n * (`humanApproval.deadlines.lapseAfter`, always elapsed time), and this is what a gate declaring none\n * gets. The gate is the right owner — how long \"do you approve deleting this customer?\" stays\n * meaningful depends on the action, not on the application.\n */\nexport const FLOW_ACTOR_APPROVAL_DEFAULT_TIMEOUT_MS = 24 * 60 * 60 * 1000;\n\n/** Serialize paused-approval state for the scalar `pausedApproval` string column. */\nexport function serializeFlowActorPausedApproval(state: FlowActorExecution_PausedApproval): string {\n return JSON.stringify(state);\n}\n\n/**\n * Parse the scalar `pausedApproval` string column back to typed state. Throws (ZodError /\n * SyntaxError) on a malformed blob — a corrupted paused record must fail loudly at resume,\n * never silently resume from garbage.\n */\nexport function parseFlowActorPausedApproval(raw: string): FlowActorExecution_PausedApproval {\n return FlowActorExecution_PausedApprovalSchema.parse(JSON.parse(raw));\n}\n\n/**\n * Whether a paused turn's approval window has CLOSED at `now` — the ONE definition of \"lapsed\".\n *\n * Two consumers act on it and neither may re-derive it (#484): the approval-response path, which\n * refuses a decision that arrives too late, and the scheduled sweep that fails a pause nobody ever\n * answered. Written twice, they would drift at exactly the boundary that matters — one inclusive,\n * one exclusive — and a decision arriving on the instant would be refused by one and resumed by the\n * other.\n *\n * - **Inclusive at the instant.** `expiresAt` is the moment after which the turn \"must not be\n * resumed\", so at `expiresAt` itself the window is already closed.\n * - **An absent expiry never lapses.** A suspension persisted before #465 carries none, and those\n * turns were paused under a contract with no timeout. Inventing one retroactively would fail them\n * on a rule they were never given.\n * - **An unparseable instant never lapses.** `new Date('garbage')` is `NaN`, every comparison with\n * which is false. Failing a turn on a value nobody can read would turn a corrupted field into a\n * destroyed conversation; leaving it paused keeps it recoverable, and the resume path already\n * refuses a blob it cannot parse.\n */\nexport function isFlowActorPausedApprovalLapsed(paused: Pick<FlowActorExecution_PausedApproval, 'expiresAt'>, now: Date): boolean {\n if (paused.expiresAt === undefined) return false;\n const expiresAtMs = new Date(paused.expiresAt).getTime();\n return Number.isFinite(expiresAtMs) && expiresAtMs <= now.getTime();\n}\n\n//===============================================================\n// Per-kind execution state (reused from the shared execution types)\n//===============================================================\n\n// NOTE (v1 scope): the persisted record is the CONVERSATIONAL envelope only —\n// `kind` + `status`/`statusChanges` + the `messages[]` chat log. The richer\n// per-kind graph-state slots (`flowState` node-states / `actorState` plan+tasks,\n// sliced from `FlowSystem_Execution` / `ActorSystem_Execution`) are intentionally\n// NOT persisted yet: the v1 conversational runtime never writes them, and those\n// heavy nested sub-structures (required `plan`/`standaloneTasks`\n// with embedded `_id`s) do not round-trip through the Zod→Mongoose embedded-\n// subdocument conversion as optional slots (empty subdocs get instantiated and\n// fail required-path validation). When the flow/actor orchestration runtime\n// actually produces graph state, add typed `flowState`/`actorState` back WITH the\n// embedded-subdocument treatment (see the zod↔mongoose nested-union / embedded-id\n// notes) rather than a raw `.pick()`. `kind` already preserves discrimination.\n\n//===============================================================\n// Base execution record — NO owner scope FK (injected per variant)\n//===============================================================\n\n/**\n * The conversation envelope shared by every scope variant. It carries NO owner\n * scope FK: `declarePolymorphicSchemas()` injects exactly ONE (`userId` /\n * `organizationId` / `applicationId`) per variant. Do NOT add an `initiator`\n * snapshot here — a nested `initiator.userId`/`.organizationId` collides with the\n * contextual scope filter (it matches the field identifier at every schema path\n * and injects an exact-subdocument clause that never equals the stored snapshot,\n * so every scoped read/update silently matches zero rows). Ownership lives ONLY on\n * the single injected top-level owner FK.\n */\nexport const FlowActorExecutionBaseSchema = z.object({\n /** MongoDB document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey(),\n\n /**\n * Stable business id of the execution, generated by the conversational runtime\n * and echoed over the WebSocket channel (`WS_FlowsActors*.executionId`). Unique\n * per variant collection (a UUID — no cross-collection collision). Immutable\n * once created.\n */\n executionId: z.uuid().isUnique({ scope: 'global', sparse: false }).excludeFromUpdate().isSummaryField(),\n\n // === System identity (set on create, immutable) ===\n /** Ref of the executed flow/actor system (`FlowActorSystem.ref`). */\n systemRef: z.string().isDBIndexed().excludeFromUpdate().isSummaryField(),\n /** Discriminant selecting which state slot is populated. */\n kind: z.enum(FlowActorSystem_Kind).isDBIndexed().excludeFromUpdate().isSummaryField(),\n\n // === Runtime status ===\n /**\n * WHICH agent this conversation was opened through — part of the read filter, not metadata.\n *\n * The task family carried this from gate #3; executions did not, so a caller holding a\n * `contextId` could continue that thread through a DIFFERENT declared agent and load the prior\n * transcript into the other agent's context. A2A agents are declared as separate resource servers\n * with per-instance token audiences, and the plane at risk here holds the full message log — not\n * a 120-character title (review finding G5-8).\n *\n * The WebSocket surface has no agent, and the default A2A agent is an identity of its own; both\n * store {@link FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE}.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH machine credential opened this conversation — part of the read filter, not metadata.\n *\n * Identical axis and identical reasoning to the task family: the injected scope FK does not\n * identify the principal on the machine variants (`applicationId` is a deployment singleton;\n * `organizationId` is shared by every machine client of one tenant), so without it a\n * separately-credentialed client could read and continue another client's conversation — which\n * carries the full message log, not merely a title.\n *\n * User-delegated turns store {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL}: the human is the\n * principal there and the `userId` owner FK already discriminates.\n */\n machineCredentialId: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH context this conversation was opened in — the client's `contextResourceIdentifiers` on\n * `FLOWS_ACTORS_START`, folded into one indexed string by {@link canonicalizeFlowsActorsContextRef}\n * so history can list by it with plain equality on every adapter. Set on create, immutable.\n *\n * It is a PARTITION, not an access filter: the owner FK, the agent instance and the machine\n * credential above decide who may read a row; this decides which of a caller's own threads belong\n * to the surface asking. Without it every thread a user ever opened against a system lists\n * together, whatever it was about — measured 2026-09-22 on a tool that hosts one system for\n * several applications sharing one database, where the threads of one application appeared in\n * the next (#1454). `''` is \"no context\", never absent, so the equality filter can name it.\n */\n contextRef: z.string().isDBIndexed().excludeFromUpdate().default(''),\n\n status: z.enum(FlowsActors_Status).isDBIndexed().isSummaryField(),\n statusChanges: z.array(z.object({\n status: z.enum(FlowsActors_Status)\n .describe(describeFlowsActorsStatus(\"The state this run moved into at `timestamp`. The list is the run's history, oldest first.\")),\n timestamp: z.date().describe('When the run moved into `status`.'),\n })).default([]),\n\n // === Conversational log (chat history) ===\n /**\n * The conversation transcript.\n *\n * ## Provenance: SUBJECT_PROVIDED, and the asymmetry is the reason (review finding F5-6)\n *\n * This array MIXES subject-authored turns (`role: USER`) with model-generated ones\n * (`role: ASSISTANT`), and provenance is declared per FIELD — there is no per-element mechanism,\n * so one classification must cover both. The two ways of being wrong are not equally bad:\n *\n * • Classifying DERIVED would EXCLUDE the subject's own words from an Art. 20 bundle. That is a\n * failure of the right the article exists to serve.\n * • Classifying SUBJECT_PROVIDED includes the assistant's replies alongside them. That is\n * over-delivery — but of a transcript the subject was a party to and already saw, which is the\n * natural unit a person means by \"my conversation\".\n *\n * So the classification follows the ASYMMETRY, not a per-element truth we cannot express. Revisit\n * only if per-element provenance ever exists; splitting the array by role at export time was\n * considered and rejected as inventing a second mechanism for one field.\n *\n * ⚠️ **This is a LABELLING change, not a behaviour change**, and the first version of this note\n * failed to say so. `resolvePortabilityFieldScope` maps `SUBJECT_PROVIDED` *and* `OBSERVED` to\n * `INCLUDED`, and the resource default was already `OBSERVED` — so `messages` was in the Art. 20\n * bundle before and after. Nothing about an export changes.\n *\n * The rejected alternative the first version omitted is the one that was actually in force:\n * **`OBSERVED`** — \"data generated by the subject's USE of the service\", a defensible reading of a\n * mixed transcript. It is rejected for precision rather than effect: the USER turns are authored\n * BY the subject, not merely observed of them, and a classification should say the truest thing\n * available even when two values resolve alike today.\n *\n * The task family's `output`/`artifacts` are DERIVED by contrast, and that is not an\n * inconsistency: those are model output ABOUT the work, with no subject-authored content mixed in.\n */\n // RESET on erasure — returns this field to its schema default. It holds the conversation itself,\n // which the category above correctly declares as personal data. RESET rather than REMOVE or MASK\n // because the field is non-nullable WITH a `.default()`: REMOVE needs a clearable field and MASK\n // needs a string. The value comes from the schema, so there is no second copy to drift.\n messages: addImpersonalizeWith(\n FlowActorExecution_MessageSchema.array().default([])\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n // The conversation itself. Category as well as provenance, so a notice can enumerate it: the two\n // axes answer different questions and a provenance alone leaves the field an OUTSTANDING gap.\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.RESET,\n ),\n\n // === HITL (human-in-the-loop) suspension ===\n /**\n * Serialized {@link FlowActorExecution_PausedApproval} — present ONLY while `status` is\n * `AWAITING_APPROVAL`. A scalar JSON string (see that schema's doc for why it is NOT a nested\n * object: the Zod→Mongoose round-trip). Set on pause, cleared on resume / terminal completion;\n * never authored on create.\n */\n /**\n * Serialized suspended-turn state; `null` once a decision releases the pause.\n *\n * `.nullish()`, not `.optional()`, and the difference is load-bearing at the READ. Clearing writes\n * an explicit `null`; the write then re-parses the row to project its response, and under\n * `.optional()` that projection throws `expected string, received null`. The clear PERSISTS (there\n * is no transaction to roll back) and the operation still fails — so the pause was released and\n * the resume aborted, leaving the turn `failed` with its work never done, reported as a resource\n * transformation error that names nothing about approvals.\n *\n * The input contract needing `.nullish()` (see `FlowActorExecutionUpdateInternalSchema`) is a\n * SEPARATE surface from this one. Fixing only that gets the value written and still throws on the\n * way out — both must admit null or neither does.\n */\n // This blob contains SDK resume messages and pending tool arguments. It is\n // runtime continuation state, not conversation content: generic client reads,\n // summaries and generated API schemas must never disclose it.\n pausedApproval: z.string().nullish().excludeFromCreate().isBackendOnly(),\n\n /** Which door opened the turn (#1594). Set on create by the backend; absent on rows older than the column. */\n initiationKind: z.enum(FlowsActors_InitiationKind).systemEnum('FlowsActors_InitiationKind').isBackendOnly().nullish(),\n\n // === Autonomous turn (#1611) ===\n //\n // Written on CREATE by the autonomous entry point (`startAutonomousAgentTurn`) and by nothing else,\n // and never updated: a turn keeps the agent, trigger and principal source it was opened with for its\n // whole life, including after a reviewer's decision resumes it.\n\n /**\n * The declared autonomous agent this turn runs as. The resume re-resolves the machine principal from\n * it (with the row's organization), so a binding removed while a decision waits stops the work.\n */\n autonomousAgentRef: z.string().min(1).isDBIndexed().excludeFromUpdate().optional(),\n /** What started the turn. An INBOUND_DELIVERY turn is offered only read or reviewer-gated tools, for its whole life. */\n autonomousTrigger: z.enum(AutonomousTurnTrigger).systemEnum('AutonomousTurnTrigger').excludeFromUpdate().optional(),\n /** Where the machine principal came from when the turn started: the tenant's own client, or a firm's admitted one. */\n autonomousPrincipalSource: z.enum(AutonomousPrincipalSource).systemEnum('AutonomousPrincipalSource').excludeFromUpdate().optional(),\n /**\n * The case the turn works on (#1598 attributes its model calls to it). Accepted at start only when the\n * turn's own principal can READ that row.\n */\n caseRef: WorkUnitRefSchema.excludeFromUpdate().optional(),\n /**\n * The concurrency slot of a `SKIP_IF_ACTIVE` agent: `<agentRef>|<organizationId>` while the turn is\n * active, absent otherwise. The unique index is what makes a second active turn's CREATE fail, which the\n * entry point turns into a skip — the check is the store's, so two occurrences arriving at once cannot\n * both see \"none active\".\n *\n * Released by the entry point, not by every terminal write: a terminal row still holding its key is\n * reclaimed with a compare-and-swap (on the key AND a terminal status) the next time the slot is\n * wanted. So a turn ended by a sweep, a lapse or an escalation lane needs no knowledge of the slot, and\n * a live turn's key can never be taken. `.optional()` (not nullish) so a clear REMOVES the field: a\n * stored null would be indexed by MongoDB's sparse index and collide with the next clear.\n */\n autonomousActiveSlotKey: z.string().min(1).isUnique({ scope: 'global', sparse: true }).isBackendOnly().optional(),\n\n // === Pending human decision (#1594) ===\n //\n // Real COLUMNS, on the row that holds the resume compare-and-swap, never in a second store: #1360\n // measured what a store beside the row costs (a second handle, drift, and a two-row write with no\n // transaction, which lets a reassignment and an answer both win). Present only while `status` is\n // AWAITING_APPROVAL; cleared by the CAS that releases the pause. All backend-only: the route says who\n // may answer, and listing it to a generic reader would reveal that a decision exists.\n //\n // DEVIATION from the issue's column list, deliberately: it named a `pendingDecisionRole` beside\n // `pendingDecisionEligibleRole`. For a ROLE route the route's role IS the eligible role, and a claimed\n // decision recovers its role from `pendingDecisionClaimedAt` plus the unchanged eligible role — so a\n // second column could only ever hold a copy that drifts.\n\n /** The one decision id, shared by both planes and every audit row (`HumanDecision_Request.decisionId`). Minted by the engine at pause. */\n pendingDecisionRef: z.string().min(1).isUnique({ scope: 'global', sparse: true }).isBackendOnly().nullish(),\n pendingDecisionRouteKind: z.enum(HumanDecision_RouteKind).systemEnum('HumanDecision_RouteKind').isDBIndexed().isBackendOnly().nullish(),\n /** The role every holder must meet (ROLE and ASSIGNEE). The listing's role filter. */\n pendingDecisionEligibleRole: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),\n /** The organization the role is matched in. The listing's organization filter. */\n pendingDecisionOrganizationId: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),\n /** Stamped from the requester's unit scope, so a unit-scoped holder can be matched (#1597). */\n pendingDecisionOrganizationUnitId: z.string().min(1).isBackendOnly().nullish(),\n /** ASSIGNEE only. The listing's \"assigned to me\" filter. */\n pendingDecisionAssigneeUserId: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),\n /** Set when an ASSIGNEE route came from claiming a ROLE route; UNCLAIM restores ROLE. */\n pendingDecisionClaimedAt: z.date().isBackendOnly().nullish(),\n pendingDecisionRequesterKind: z.enum(HumanDecision_RequesterKind).systemEnum('HumanDecision_RequesterKind').isBackendOnly().nullish(),\n /** The user id for USER and DELEGATED_CLIENT; the credential id for MACHINE. What the resume rebuilds authority from. */\n pendingDecisionRequesterRef: z.string().min(1).isBackendOnly().nullish(),\n /** DELEGATED_CLIENT only: the client the person delegated to, re-checked at resume. */\n pendingDecisionRequesterClientId: z.string().min(1).isBackendOnly().nullish(),\n pendingDecisionRequestedAt: z.date().isBackendOnly().nullish(),\n /** When answering is refused. The expiry sweep selects on this column instead of parsing every blob. */\n pendingDecisionExpiresAt: z.date().isDBIndexed().isBackendOnly().nullish(),\n /** Incremented by every reassign, claim, unclaim and escalate; the answer's release CAS includes it, so an answer read under an older route loses. */\n pendingDecisionRouteVersion: z.number().int().nonnegative().isBackendOnly().nullish(),\n\n // === Pending decision deadlines (#1628) ===\n //\n // The two SERVICE-TARGET clocks (CLAIM, DECISION) beside the lapse above, armed at pause from the gate's\n // `humanApproval.deadlines`. Each stage's due instant is stored, so the sweep never depends on the gate\n // still resolving and a deployment never reshapes a running clock. Cleared with the rest of the pending\n // decision. Backend-only, like the route.\n //\n // DEVIATION from #1628's column list, deliberately: it named the two deadlines and the next-due instant.\n // The two WARNING instants and the two clock bases are stored too — a warning is `warnBefore` earlier on\n // its own basis, and a resume must count the paused time on that basis; recomputing either would read the\n // gate again, which is exactly the dependency storing the deadlines avoids.\n\n pendingDecisionClaimDeadlineAt: z.date().isBackendOnly().nullish(),\n /** Armed only when the gate's `claim.warnBefore` is declared. */\n pendingDecisionClaimWarningAt: z.date().isBackendOnly().nullish(),\n pendingDecisionClaimClockBasis: z.enum(ReviewClockBasis).systemEnum('ReviewClockBasis').isBackendOnly().nullish(),\n pendingDecisionDecisionDeadlineAt: z.date().isBackendOnly().nullish(),\n /** Armed only when the gate's `decision.warnBefore` is declared. */\n pendingDecisionDecisionWarningAt: z.date().isBackendOnly().nullish(),\n pendingDecisionDecisionClockBasis: z.enum(ReviewClockBasis).systemEnum('ReviewClockBasis').isBackendOnly().nullish(),\n /**\n * The earliest instant a stage may still fire at; `null` while the clocks are paused and once nothing is\n * left to fire. The deadline sweep selects on this indexed column. Every write that fires a stage, pauses,\n * resumes, claims or unclaims recomputes it in the same statement.\n */\n pendingDecisionNextDueAt: z.date().isDBIndexed().isBackendOnly().nullish(),\n /** Set while the CLAIM and DECISION clocks are paused. Never stops the lapse. */\n pendingDecisionClockPausedAt: z.date().isBackendOnly().nullish(),\n /** The gate-declared pause state the clocks are paused in. */\n pendingDecisionClockPauseStateRef: z.string().min(1).isBackendOnly().nullish(),\n /** Paused time accumulated over every completed pause, in milliseconds of wall time. */\n pendingDecisionClockPausedMs: z.number().int().nonnegative().isBackendOnly().nullish(),\n /*\n * One fired marker per stage. Each is written by a compare-and-swap on `(pendingDecisionRef, <marker> IS\n * NULL)`, so a stage fires once however many hosts run the sweep, and only the writer that won runs the\n * stage's actions. Four nullable timestamps rather than one \"fired stages\" array: an add-if-absent array\n * swap is expressed differently on MongoDB and PostgreSQL, a null check is the same predicate on both.\n */\n pendingDecisionClaimWarningFiredAt: z.date().isBackendOnly().nullish(),\n pendingDecisionClaimMissedFiredAt: z.date().isBackendOnly().nullish(),\n pendingDecisionDecisionWarningFiredAt: z.date().isBackendOnly().nullish(),\n pendingDecisionDecisionMissedFiredAt: z.date().isBackendOnly().nullish(),\n\n // === Last resolved decision (#1594) ===\n //\n // Written INSIDE the CAS that releases the pause, so a crash after it still leaves a complete record\n // of who decided what — the record #1599's corrections repair from.\n\n /** The decision these fields describe. Also what a failed release write is re-read against (D10). */\n lastResolvedDecisionRef: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),\n /** Absent for a lapse and for a withdrawal nobody answered. */\n decidedByUserId: z.string().min(1).isBackendOnly().nullish(),\n decidedAt: z.date().isBackendOnly().nullish(),\n decisionOutcome: z.enum(HumanDecision_Outcome).systemEnum('HumanDecision_Outcome').isBackendOnly().nullish(),\n decisionToolName: z.string().min(1).isBackendOnly().nullish(),\n /** The argument NAMES a decider changed. Never their values. */\n decisionModifiedArgumentNames: z.array(z.string()).isBackendOnly().nullish(),\n\n // === Agent-work review record (#1599): the crash-repair marker ===\n /**\n * The decision whose agent-work record is still OWED. Set by the very write that settles a decision on an agent's\n * proposal (the release, a lapse, a withdrawal) — so a process that dies before the record is written leaves the\n * debt on the row — and cleared by a compare-and-swap once the record exists. The repair sweep selects on it.\n */\n pendingCorrectionRecordRef: z.string().min(1).isDBIndexed().isBackendOnly().nullish(),\n /** When the settled proposal was PUT BEFORE the decider (#1594's claim instant, else its request instant). */\n pendingCorrectionPresentedAt: z.date().isBackendOnly().nullish(),\n /**\n * The organization the owed decision was ROUTED in. The settling write clears the route columns\n * (`pendingDecisionOrganizationId`), so without this a repaired record of a user thread with no case would name no\n * tenant and fall out of that organization's override rate and export.\n */\n pendingCorrectionOrganizationId: z.string().min(1).isBackendOnly().nullish(),\n /** The route role that admitted the decider of the owed decision, cleared by the settle for the same reason. */\n pendingCorrectionAdmittedByRole: z.string().min(1).isBackendOnly().nullish(),\n\n // === Timing (system-managed; defaults are load-bearing — the create pipeline\n // strips these then date-coerces, so a missing default → Invalid Date) ===\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate().isSummaryField(),\n /** Set on terminal completion (via UPDATE); never on create. */\n finishedAt: z.date().optional().excludeFromCreate().isSummaryField(),\n});\nexport type FlowActorExecutionBase = z.infer<typeof FlowActorExecutionBaseSchema>;\n\n//===============================================================\n// Polymorphic declaration — one owner-scope variant per scope\n//===============================================================\n\n/**\n * The three owner-scope variants a flows-actors execution is stamped out for.\n * Each is `isPrimaryScope: true` (the injected owner FK is the primary scope), and\n * each opts OUT of the singleton auto-business-key: a conversation is MULTI-ROW\n * per scope (many discussions per user/org/app), so the injected owner FK must NOT\n * be marked `.isUnique()` — otherwise the second conversation per scope would fail\n * with a duplicate-key error. Mirrors subscriptions / usage-records / SSO\n * connections (all multi-row polymorphic resources).\n */\nexport const FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n].map(optOutPolymorphicAutoBusinessKey);\n\n/**\n * Polymorphic declaration for flows-actors executions. Produces 3 variants:\n * - users → `userFlowActorExecutions` (`userId` injected)\n * - organizations→ `organizationFlowActorExecutions` (`organizationId` injected)\n * - applications → `applicationFlowActorExecutions` (`applicationId` injected)\n */\nexport const flowActorExecutionsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'flowActorExecutions',\n baseFieldIdentifier: 'flowActorExecutionId',\n baseEnumKey: 'FLOW_ACTOR_EXECUTIONS',\n baseSchema: FlowActorExecutionBaseSchema,\n variants: FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS,\n});\n\n/**\n * Owner-agnostic UPDATE DTO — status transitions, appended messages, completion\n * time. Shared across all variants because it references NO owner FK (owner is\n * immutable). `updatedAt` is system-managed; identity fields are `.excludeFromUpdate()`.\n */\nexport const FlowActorExecutionUpdateInternalSchema = z.object({\n status: FlowActorExecutionBaseSchema.shape.status.optional(),\n /*\n * `.unwrap()` takes each field's `.default([])` off, and it must stay off. Zod 4 applies an inner\n * default under `.optional()`, so `{ status: FAILED }` parsed to `{ status, statusChanges: [],\n * messages: [] }`, and every partial update of a row reset its transcript and status history.\n * Measured 2026-09-25 on Wonder Todos: a turn cut off by a companion restart was settled FAILED and\n * lost the creator's message, and the page read \"Nothing has been said yet\". The same held for the\n * resume claim, the pause and the lapsed-approval fail. A default belongs to CREATE; an absent\n * field on an update means \"unchanged\".\n */\n statusChanges: FlowActorExecutionBaseSchema.shape.statusChanges.unwrap().optional(),\n messages: FlowActorExecutionBaseSchema.shape.messages.unwrap().optional(),\n finishedAt: FlowActorExecutionBaseSchema.shape.finishedAt,\n /**\n * The suspended-turn state, written when a turn pauses for a human decision and cleared when one\n * arrives.\n *\n * ⚠️ THIS SCHEMA IS AN ALLOW-LIST, and omitting a field here does not fail — it makes the write\n * SUCCEED and persist nothing. `pausedApproval` was added to the base envelope when the column was\n * introduced but never here, so every approval pause wrote its status and its messages and\n * silently dropped the one field that makes the turn resumable. The row read back as\n * `AWAITING_APPROVAL` with no state to resume from: a turn stuck forever, with no error anywhere.\n * Adding a persisted field is therefore never done without adding it to this contract.\n *\n * `.nullish()` rather than `.optional()` because clearing is a real transition: the resume writes\n * an explicit `null` to release the pause, and under `.optional()` that null is rejected — which\n * would leave a resumed turn still advertising a decision nobody can answer.\n */\n pausedApproval: FlowActorExecutionBaseSchema.shape.pausedApproval.nullish(),\n // #1594 — the pending decision and the last resolution. Allow-listed here for the reason above: a field\n // missing from this contract is a write that succeeds and persists nothing.\n initiationKind: FlowActorExecutionBaseSchema.shape.initiationKind,\n // #1611 — the slot is released by the autonomous entry point; `null` removes it (see the field).\n autonomousActiveSlotKey: FlowActorExecutionBaseSchema.shape.autonomousActiveSlotKey.nullable(),\n pendingDecisionRef: FlowActorExecutionBaseSchema.shape.pendingDecisionRef,\n pendingDecisionRouteKind: FlowActorExecutionBaseSchema.shape.pendingDecisionRouteKind,\n pendingDecisionEligibleRole: FlowActorExecutionBaseSchema.shape.pendingDecisionEligibleRole,\n pendingDecisionOrganizationId: FlowActorExecutionBaseSchema.shape.pendingDecisionOrganizationId,\n pendingDecisionOrganizationUnitId: FlowActorExecutionBaseSchema.shape.pendingDecisionOrganizationUnitId,\n pendingDecisionAssigneeUserId: FlowActorExecutionBaseSchema.shape.pendingDecisionAssigneeUserId,\n pendingDecisionClaimedAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimedAt,\n pendingDecisionRequesterKind: FlowActorExecutionBaseSchema.shape.pendingDecisionRequesterKind,\n pendingDecisionRequesterRef: FlowActorExecutionBaseSchema.shape.pendingDecisionRequesterRef,\n pendingDecisionRequesterClientId: FlowActorExecutionBaseSchema.shape.pendingDecisionRequesterClientId,\n pendingDecisionRequestedAt: FlowActorExecutionBaseSchema.shape.pendingDecisionRequestedAt,\n pendingDecisionExpiresAt: FlowActorExecutionBaseSchema.shape.pendingDecisionExpiresAt,\n pendingDecisionRouteVersion: FlowActorExecutionBaseSchema.shape.pendingDecisionRouteVersion,\n // #1628 — the deadline clocks, allow-listed for the same reason.\n pendingDecisionClaimDeadlineAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimDeadlineAt,\n pendingDecisionClaimWarningAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimWarningAt,\n pendingDecisionClaimClockBasis: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimClockBasis,\n pendingDecisionDecisionDeadlineAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionDeadlineAt,\n pendingDecisionDecisionWarningAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionWarningAt,\n pendingDecisionDecisionClockBasis: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionClockBasis,\n pendingDecisionNextDueAt: FlowActorExecutionBaseSchema.shape.pendingDecisionNextDueAt,\n pendingDecisionClockPausedAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClockPausedAt,\n pendingDecisionClockPauseStateRef: FlowActorExecutionBaseSchema.shape.pendingDecisionClockPauseStateRef,\n pendingDecisionClockPausedMs: FlowActorExecutionBaseSchema.shape.pendingDecisionClockPausedMs,\n pendingDecisionClaimWarningFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimWarningFiredAt,\n pendingDecisionClaimMissedFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionClaimMissedFiredAt,\n pendingDecisionDecisionWarningFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionWarningFiredAt,\n pendingDecisionDecisionMissedFiredAt: FlowActorExecutionBaseSchema.shape.pendingDecisionDecisionMissedFiredAt,\n lastResolvedDecisionRef: FlowActorExecutionBaseSchema.shape.lastResolvedDecisionRef,\n decidedByUserId: FlowActorExecutionBaseSchema.shape.decidedByUserId,\n decidedAt: FlowActorExecutionBaseSchema.shape.decidedAt,\n decisionOutcome: FlowActorExecutionBaseSchema.shape.decisionOutcome,\n decisionToolName: FlowActorExecutionBaseSchema.shape.decisionToolName,\n decisionModifiedArgumentNames: FlowActorExecutionBaseSchema.shape.decisionModifiedArgumentNames,\n // #1599 — the agent-work record the settlement owes; allow-listed for the reason above.\n pendingCorrectionRecordRef: FlowActorExecutionBaseSchema.shape.pendingCorrectionRecordRef,\n pendingCorrectionPresentedAt: FlowActorExecutionBaseSchema.shape.pendingCorrectionPresentedAt,\n pendingCorrectionOrganizationId: FlowActorExecutionBaseSchema.shape.pendingCorrectionOrganizationId,\n pendingCorrectionAdmittedByRole: FlowActorExecutionBaseSchema.shape.pendingCorrectionAdmittedByRole,\n});\n\n//===============================================================\n// Exported runtime type\n//===============================================================\n\n/**\n * Runtime shape of a persisted execution (the base envelope). The owner FK is\n * variant-specific (`userId` | `organizationId` | `applicationId`) and read from\n * the concrete variant; the conversational runtime supplies it explicitly on create.\n */\nexport type FlowActorExecution = z.infer<typeof FlowActorExecutionBaseSchema>;\n\n/**\n * One string for a set of context resource identifiers — `key=value` pairs sorted by key, joined\n * with `;`. Deterministic, so the transport that opens a conversation and the surface that lists\n * history compute the same value from the same identifiers; `''` for none.\n *\n * Keys and values carry no `=` or `;` in practice (they are resource types and ids); the function\n * does not escape, so a value that did would fold two contexts into one, never split one in two.\n */\nexport function canonicalizeFlowsActorsContextRef(identifiers: Readonly<Record<string, string>> | undefined): string {\n if (!identifiers) return '';\n return Object.keys(identifiers)\n .sort()\n .map((key) => `${key}=${identifiers[key]}`)\n .join(';');\n}\n"]}
@@ -8,9 +8,29 @@ export declare enum FlowsActors_ElementKind {
8
8
  PLAN = "actor.plan",
9
9
  PLAN_STEP = "actor.plan.step"
10
10
  }
11
+ /**
12
+ * Which door opened a conversational turn — persisted at turn start, because a decision raised later
13
+ * in the turn is routed and re-authorized differently depending on it (#1594), and the door is not
14
+ * recoverable from the row afterwards.
15
+ */
16
+ export declare enum FlowsActors_InitiationKind {
17
+ /** A signed-in person over the application's WebSocket. */
18
+ WEBSOCKET_SESSION = "websocket_session",
19
+ /** An A2A client — a machine principal, or a person through a client they delegated to. */
20
+ A2A_REQUEST = "a2a_request",
21
+ /** Background work with nobody at the keyboard. Written only by #1611's autonomous entry point. */
22
+ AUTONOMOUS = "autonomous"
23
+ }
11
24
  export declare enum FlowsActors_Status {
12
25
  READY = "ready",
13
26
  PENDING = "pending",
27
+ /**
28
+ * Work is running in some process right now, and only that process can settle it. True only while that
29
+ * process lives, so a conversational turn holds a liveness lease for exactly as long as its row says
30
+ * PROCESSING; a row left PROCESSING by a process that died is failed by the five-minutely
31
+ * `interrupted-turn-sweep` once its lease has lapsed (#1780), and an A2A task by the hourly
32
+ * `a2a-abandoned-task-sweep`.
33
+ */
14
34
  PROCESSING = "processing",
15
35
  /**
16
36
  * The turn is SUSPENDED at a human-in-the-loop approval boundary: the agent called
@@ -20,7 +40,7 @@ export declare enum FlowsActors_Status {
20
40
  * resolution. NON-terminal. A decision — approval OR denial — resumes it to PROCESSING
21
41
  * (a denial resumes so the agent can answer the refusal; it is not a cancellation). A
22
42
  * pause whose `expiresAt` passes unanswered becomes FAILED: refused at a late decision,
23
- * or failed by the hourly `approval-pause-expiry-sweep` (#484). Machine (org/app) turns never enter this state —
43
+ * or failed by the per-minute `approval-pause-expiry-sweep` (#484). Machine (org/app) turns never enter this state —
24
44
  * approval-gated tools are auto-denied for them (HITL is user-delegated-only in v1).
25
45
  *
26
46
  * ## The same status on the ACTOR-SYSTEM plane, where the decision is a `HumanDecision_Request` (#1360)
@@ -31,7 +51,7 @@ export declare enum FlowsActors_Status {
31
51
  * not two: an approval is the special case of a human decision with no fields and approve/deny
32
52
  * options (#1269), and A2A already projects this member to `input-required`, which is the general
33
53
  * meaning. What differs by plane is the MECHANISM, not the state: the conversational plane resumes
34
- * an agent stream from `pausedApproval` and sweeps lapsed windows hourly; the actor-system plane
54
+ * an agent stream from `pausedApproval` and sweeps lapsed windows every minute; the actor-system plane
35
55
  * resumes a host executor from a checkpoint and is swept by nothing, because its decisions carry no
36
56
  * window unless the request declares one. The member's NAME is narrower than its meaning.
37
57
  */
@@ -274,12 +294,20 @@ export declare const FlowsActors_Error_State_BaseSchema: z.ZodObject<{
274
294
  consumableTokenId: z.ZodOptional<z.ZodString>;
275
295
  webhookProviderId: z.ZodOptional<z.ZodString>;
276
296
  anonymousUserId: z.ZodOptional<z.ZodString>;
297
+ inboundDeliveryId: z.ZodOptional<z.ZodString>;
298
+ inboundHandlerRef: z.ZodOptional<z.ZodString>;
299
+ inboundScopeUserId: z.ZodOptional<z.ZodString>;
300
+ inboundSender: z.ZodOptional<z.ZodObject<{
301
+ channel: z.ZodEnum<typeof import("..").InboundChannelKind>;
302
+ assurance: z.ZodEnum<typeof import("..").InboundSenderAssurance>;
303
+ }, z.core.$strict>>;
277
304
  }, z.core.$strip>>>;
278
305
  executionType: z.ZodOptional<z.ZodEnum<typeof import("..").ExecutionContext_ExecutionType>>;
279
306
  userGuidance: z.ZodOptional<z.ZodObject<{
280
307
  guidanceKey: z.ZodOptional<z.ZodString>;
281
308
  explanation: z.ZodOptional<z.ZodString>;
282
309
  resolution: z.ZodOptional<z.ZodString>;
310
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
283
311
  completedSteps: z.ZodOptional<z.ZodArray<z.ZodString>>;
284
312
  nextAction: z.ZodOptional<z.ZodObject<{
285
313
  label: z.ZodString;
@@ -351,4 +379,11 @@ export declare const FLOWS_ACTORS_NO_MACHINE_CREDENTIAL = "*user-delegated*";
351
379
  * drift apart.
352
380
  */
353
381
  export declare const FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE = "*default*";
382
+ /**
383
+ * The stored agent instance of an AUTONOMOUS turn (#1611), opened by the autonomous entry point with no
384
+ * transport at all. Part of every owner filter like the other sentinels, and unreachable by a declared
385
+ * A2A instance ref (`^[a-z0-9][a-z0-9-]*$`), so no A2A read, continuation or cancel can ever match an
386
+ * autonomous row: those rows are reached only through the decision verbs, which read by decision id.
387
+ */
388
+ export declare const FLOWS_ACTORS_AUTONOMOUS_AGENT_INSTANCE = "*autonomous*";
354
389
  //# sourceMappingURL=flows-actors.commons.shared.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flows-actors.commons.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors.commons.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,IAAI,eAAe;IACnB,IAAI,eAAe;IACnB,SAAS,oBAAoB;CAC9B;AAED,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CASrF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK9D;AAOD,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;2BAsBtD,CAAC;AACH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAGhH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAoC/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAGlG,oBAAY,oBAAoB;IAC9B,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,UA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AqBG;AACH,eAAO,MAAM,kCAAkC,qBAAqB,CAAC;AAErE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mCAAmC,cAAc,CAAC"}
1
+ {"version":3,"file":"flows-actors.commons.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors.commons.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,IAAI,eAAe;IACnB,IAAI,eAAe;IACnB,SAAS,oBAAoB;CAC9B;AAED;;;;GAIG;AACH,oBAAY,0BAA0B;IACpC,2DAA2D;IAC3D,iBAAiB,sBAAsB;IACvC,2FAA2F;IAC3F,WAAW,gBAAgB;IAC3B,mGAAmG;IACnG,UAAU,eAAe;CAC1B;AAED,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB;;;;;;OAMG;IACH,UAAU,eAAe;IACzB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CASrF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK9D;AAOD,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;2BAsBtD,CAAC;AACH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAGhH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAoC/C,CAAC;AACH,MAA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