@vertesia/common 1.5.0-dev.20260807.073259Z → 1.5.0-dev.20260901.005903Z

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 (451) hide show
  1. package/lib/access-control.d.ts +0 -14
  2. package/lib/access-control.d.ts.map +1 -1
  3. package/lib/access-control.js +0 -23
  4. package/lib/access-control.js.map +1 -1
  5. package/lib/account-values.d.ts +0 -10
  6. package/lib/account-values.d.ts.map +1 -1
  7. package/lib/account-values.js +0 -44
  8. package/lib/account-values.js.map +1 -1
  9. package/lib/api-contract/components.generated.json +40405 -0
  10. package/lib/api-contract/index.d.ts +186 -0
  11. package/lib/api-contract/index.d.ts.map +1 -0
  12. package/lib/api-contract/index.js +554 -0
  13. package/lib/api-contract/index.js.map +1 -0
  14. package/lib/api-schemas/agent-communication.d.ts +199 -0
  15. package/lib/api-schemas/agent-communication.d.ts.map +1 -0
  16. package/lib/api-schemas/agent-communication.js +150 -0
  17. package/lib/api-schemas/agent-communication.js.map +1 -0
  18. package/lib/api-schemas/agent-runs.d.ts +593 -0
  19. package/lib/api-schemas/agent-runs.d.ts.map +1 -1
  20. package/lib/api-schemas/agent-runs.js +44 -2
  21. package/lib/api-schemas/agent-runs.js.map +1 -1
  22. package/lib/api-schemas/app-lifecycle.d.ts +19 -0
  23. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
  24. package/lib/api-schemas/app-lifecycle.js +34 -4
  25. package/lib/api-schemas/app-lifecycle.js.map +1 -1
  26. package/lib/api-schemas/app-runtime.d.ts +9871 -9257
  27. package/lib/api-schemas/app-runtime.d.ts.map +1 -1
  28. package/lib/api-schemas/app-runtime.js +7 -0
  29. package/lib/api-schemas/app-runtime.js.map +1 -1
  30. package/lib/api-schemas/apps.d.ts +1 -0
  31. package/lib/api-schemas/apps.d.ts.map +1 -1
  32. package/lib/api-schemas/apps.js +4 -3
  33. package/lib/api-schemas/apps.js.map +1 -1
  34. package/lib/api-schemas/content-query.d.ts +39 -0
  35. package/lib/api-schemas/content-query.d.ts.map +1 -0
  36. package/lib/api-schemas/content-query.js +30 -0
  37. package/lib/api-schemas/content-query.js.map +1 -0
  38. package/lib/api-schemas/content.d.ts +835 -29
  39. package/lib/api-schemas/content.d.ts.map +1 -1
  40. package/lib/api-schemas/content.js +82 -15
  41. package/lib/api-schemas/content.js.map +1 -1
  42. package/lib/api-schemas/dashboard.d.ts +4 -0
  43. package/lib/api-schemas/dashboard.d.ts.map +1 -1
  44. package/lib/api-schemas/dashboard.js +3 -0
  45. package/lib/api-schemas/dashboard.js.map +1 -1
  46. package/lib/api-schemas/document-processing.d.ts +333 -0
  47. package/lib/api-schemas/document-processing.d.ts.map +1 -1
  48. package/lib/api-schemas/events.d.ts +1007 -4
  49. package/lib/api-schemas/events.d.ts.map +1 -1
  50. package/lib/api-schemas/events.js +4 -1
  51. package/lib/api-schemas/events.js.map +1 -1
  52. package/lib/api-schemas/files.d.ts +17 -0
  53. package/lib/api-schemas/files.d.ts.map +1 -1
  54. package/lib/api-schemas/files.js +23 -0
  55. package/lib/api-schemas/files.js.map +1 -1
  56. package/lib/api-schemas/group.d.ts +7 -0
  57. package/lib/api-schemas/group.d.ts.map +1 -1
  58. package/lib/api-schemas/group.js +9 -0
  59. package/lib/api-schemas/group.js.map +1 -1
  60. package/lib/api-schemas/index.d.ts +4 -0
  61. package/lib/api-schemas/index.d.ts.map +1 -1
  62. package/lib/api-schemas/index.js +4 -0
  63. package/lib/api-schemas/index.js.map +1 -1
  64. package/lib/api-schemas/integrations.d.ts +19 -5
  65. package/lib/api-schemas/integrations.d.ts.map +1 -1
  66. package/lib/api-schemas/integrations.js +25 -2
  67. package/lib/api-schemas/integrations.js.map +1 -1
  68. package/lib/api-schemas/interaction.d.ts +8399 -1076
  69. package/lib/api-schemas/interaction.d.ts.map +1 -1
  70. package/lib/api-schemas/interaction.js +161 -9
  71. package/lib/api-schemas/interaction.js.map +1 -1
  72. package/lib/api-schemas/oauth-server.d.ts +131 -3
  73. package/lib/api-schemas/oauth-server.d.ts.map +1 -1
  74. package/lib/api-schemas/oauth-server.js +137 -3
  75. package/lib/api-schemas/oauth-server.js.map +1 -1
  76. package/lib/api-schemas/process.d.ts +1295 -0
  77. package/lib/api-schemas/process.d.ts.map +1 -1
  78. package/lib/api-schemas/process.js +318 -2
  79. package/lib/api-schemas/process.js.map +1 -1
  80. package/lib/api-schemas/project-configuration.d.ts +1118 -1
  81. package/lib/api-schemas/project-configuration.d.ts.map +1 -1
  82. package/lib/api-schemas/project-configuration.js +6 -2
  83. package/lib/api-schemas/project-configuration.js.map +1 -1
  84. package/lib/api-schemas/project.d.ts +1680 -6
  85. package/lib/api-schemas/project.d.ts.map +1 -1
  86. package/lib/api-schemas/registry.d.ts +87529 -69142
  87. package/lib/api-schemas/registry.d.ts.map +1 -1
  88. package/lib/api-schemas/registry.js +234 -413
  89. package/lib/api-schemas/registry.js.map +1 -1
  90. package/lib/api-schemas/schema-primitives.d.ts +4 -0
  91. package/lib/api-schemas/schema-primitives.d.ts.map +1 -1
  92. package/lib/api-schemas/schema-primitives.js +10 -0
  93. package/lib/api-schemas/schema-primitives.js.map +1 -1
  94. package/lib/api-schemas/store.d.ts +5596 -37
  95. package/lib/api-schemas/store.d.ts.map +1 -1
  96. package/lib/api-schemas/store.js +53 -8
  97. package/lib/api-schemas/store.js.map +1 -1
  98. package/lib/api-schemas/tools.d.ts +115 -0
  99. package/lib/api-schemas/tools.d.ts.map +1 -1
  100. package/lib/api-schemas/tools.js +55 -0
  101. package/lib/api-schemas/tools.js.map +1 -1
  102. package/lib/api-schemas/view-execution.d.ts +330 -854
  103. package/lib/api-schemas/view-execution.d.ts.map +1 -1
  104. package/lib/api-schemas/view-execution.js +26 -2
  105. package/lib/api-schemas/view-execution.js.map +1 -1
  106. package/lib/api-schemas/views.d.ts +452 -2562
  107. package/lib/api-schemas/views.d.ts.map +1 -1
  108. package/lib/api-schemas/views.js +119 -3
  109. package/lib/api-schemas/views.js.map +1 -1
  110. package/lib/api-schemas/workflow-runs.d.ts +344 -5
  111. package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
  112. package/lib/api-schemas/workflow-runs.js +9 -7
  113. package/lib/api-schemas/workflow-runs.js.map +1 -1
  114. package/lib/apps.d.ts +8 -145
  115. package/lib/apps.d.ts.map +1 -1
  116. package/lib/apps.js +1 -54
  117. package/lib/apps.js.map +1 -1
  118. package/lib/ask-user.d.ts +2 -1
  119. package/lib/ask-user.d.ts.map +1 -1
  120. package/lib/audit-trail.d.ts +2 -2
  121. package/lib/audit-trail.d.ts.map +1 -1
  122. package/lib/audit-trail.js +2 -2
  123. package/lib/audit-trail.js.map +1 -1
  124. package/lib/browser-credentials.d.ts +2 -7
  125. package/lib/browser-credentials.d.ts.map +1 -1
  126. package/lib/common.d.ts +4 -1
  127. package/lib/common.d.ts.map +1 -1
  128. package/lib/content-query.d.ts +5 -0
  129. package/lib/content-query.d.ts.map +1 -0
  130. package/lib/content-query.js +2 -0
  131. package/lib/content-query.js.map +1 -0
  132. package/lib/data-platform.d.ts +4 -46
  133. package/lib/data-platform.d.ts.map +1 -1
  134. package/lib/data-platform.js.map +1 -1
  135. package/lib/email.d.ts +12 -18
  136. package/lib/email.d.ts.map +1 -1
  137. package/lib/email.js.map +1 -1
  138. package/lib/environment.d.ts +0 -10
  139. package/lib/environment.d.ts.map +1 -1
  140. package/lib/environment.js +1 -12
  141. package/lib/environment.js.map +1 -1
  142. package/lib/facets.d.ts +0 -4
  143. package/lib/facets.d.ts.map +1 -1
  144. package/lib/group.d.ts +2 -12
  145. package/lib/group.d.ts.map +1 -1
  146. package/lib/group.js.map +1 -1
  147. package/lib/index.d.ts +3 -10
  148. package/lib/index.d.ts.map +1 -1
  149. package/lib/index.js +2 -10
  150. package/lib/index.js.map +1 -1
  151. package/lib/integrations.d.ts +1 -27
  152. package/lib/integrations.d.ts.map +1 -1
  153. package/lib/integrations.js +0 -6
  154. package/lib/integrations.js.map +1 -1
  155. package/lib/interaction.d.ts +10 -222
  156. package/lib/interaction.d.ts.map +1 -1
  157. package/lib/interaction.js +0 -31
  158. package/lib/interaction.js.map +1 -1
  159. package/lib/meters.d.ts +5 -10
  160. package/lib/meters.d.ts.map +1 -1
  161. package/lib/meters.js +1 -9
  162. package/lib/meters.js.map +1 -1
  163. package/lib/oauth-scopes.d.ts +2 -16
  164. package/lib/oauth-scopes.d.ts.map +1 -1
  165. package/lib/oauth-scopes.js +9 -49
  166. package/lib/oauth-scopes.js.map +1 -1
  167. package/lib/oauth-server.d.ts +16 -195
  168. package/lib/oauth-server.d.ts.map +1 -1
  169. package/lib/payload.d.ts +2 -5
  170. package/lib/payload.d.ts.map +1 -1
  171. package/lib/pending-asks.d.ts +9 -41
  172. package/lib/pending-asks.d.ts.map +1 -1
  173. package/lib/platform-event.d.ts +4 -142
  174. package/lib/platform-event.d.ts.map +1 -1
  175. package/lib/platform-event.js.map +1 -1
  176. package/lib/project.d.ts +7 -46
  177. package/lib/project.d.ts.map +1 -1
  178. package/lib/project.js +2 -132
  179. package/lib/project.js.map +1 -1
  180. package/lib/prompt.d.ts +4 -7
  181. package/lib/prompt.d.ts.map +1 -1
  182. package/lib/prompt.js.map +1 -1
  183. package/lib/query.d.ts +0 -8
  184. package/lib/query.d.ts.map +1 -1
  185. package/lib/rate-limiter.d.ts +4 -3
  186. package/lib/rate-limiter.d.ts.map +1 -1
  187. package/lib/runs.d.ts +5 -1
  188. package/lib/runs.d.ts.map +1 -1
  189. package/lib/schema-for-extraction.d.ts +0 -1
  190. package/lib/schema-for-extraction.d.ts.map +1 -1
  191. package/lib/schema-for-extraction.js +1 -1
  192. package/lib/schema-for-extraction.js.map +1 -1
  193. package/lib/secrets.d.ts +2 -1
  194. package/lib/secrets.d.ts.map +1 -1
  195. package/lib/skill.d.ts +0 -13
  196. package/lib/skill.d.ts.map +1 -1
  197. package/lib/store/activity-catalog.d.ts +2 -0
  198. package/lib/store/activity-catalog.d.ts.map +1 -1
  199. package/lib/store/agent-approval.d.ts +0 -1
  200. package/lib/store/agent-approval.d.ts.map +1 -1
  201. package/lib/store/agent-approval.js +0 -3
  202. package/lib/store/agent-approval.js.map +1 -1
  203. package/lib/store/agent-run.d.ts +32 -69
  204. package/lib/store/agent-run.d.ts.map +1 -1
  205. package/lib/store/collections.d.ts +2 -6
  206. package/lib/store/collections.d.ts.map +1 -1
  207. package/lib/store/collections.js.map +1 -1
  208. package/lib/store/conversation-state.d.ts +11 -12
  209. package/lib/store/conversation-state.d.ts.map +1 -1
  210. package/lib/store/conversation-state.js +0 -18
  211. package/lib/store/conversation-state.js.map +1 -1
  212. package/lib/store/doc-analyzer.d.ts +0 -22
  213. package/lib/store/doc-analyzer.d.ts.map +1 -1
  214. package/lib/store/dsl-workflow.d.ts +22 -5
  215. package/lib/store/dsl-workflow.d.ts.map +1 -1
  216. package/lib/store/dsl-workflow.js.map +1 -1
  217. package/lib/store/grounded-extraction.d.ts +0 -14
  218. package/lib/store/grounded-extraction.d.ts.map +1 -1
  219. package/lib/store/grounded-extraction.js +1 -7
  220. package/lib/store/grounded-extraction.js.map +1 -1
  221. package/lib/store/index.d.ts +0 -5
  222. package/lib/store/index.d.ts.map +1 -1
  223. package/lib/store/index.js +0 -6
  224. package/lib/store/index.js.map +1 -1
  225. package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
  226. package/lib/store/intake-policy-schema.generated.js +279 -1
  227. package/lib/store/intake-policy-schema.generated.js.map +1 -1
  228. package/lib/store/process.d.ts +43 -1
  229. package/lib/store/process.d.ts.map +1 -1
  230. package/lib/store/process.js.map +1 -1
  231. package/lib/store/rendering.d.ts +3 -5
  232. package/lib/store/rendering.d.ts.map +1 -1
  233. package/lib/store/rendering.js +0 -4
  234. package/lib/store/rendering.js.map +1 -1
  235. package/lib/store/schedule.d.ts +0 -16
  236. package/lib/store/schedule.d.ts.map +1 -1
  237. package/lib/store/schedule.js.map +1 -1
  238. package/lib/store/signals.d.ts +12 -0
  239. package/lib/store/signals.d.ts.map +1 -1
  240. package/lib/store/store.d.ts +80 -94
  241. package/lib/store/store.d.ts.map +1 -1
  242. package/lib/store/store.js +5 -25
  243. package/lib/store/store.js.map +1 -1
  244. package/lib/store/workflow.d.ts +35 -86
  245. package/lib/store/workflow.d.ts.map +1 -1
  246. package/lib/store/workflow.js +0 -47
  247. package/lib/store/workflow.js.map +1 -1
  248. package/lib/sts-errors.d.ts +0 -1
  249. package/lib/sts-errors.d.ts.map +1 -1
  250. package/lib/sts-token-types.d.ts +2 -8
  251. package/lib/sts-token-types.d.ts.map +1 -1
  252. package/lib/sts-token-types.js +1 -19
  253. package/lib/sts-token-types.js.map +1 -1
  254. package/lib/tools.d.ts +6 -1
  255. package/lib/tools.d.ts.map +1 -1
  256. package/lib/transient-tokens.d.ts +0 -2
  257. package/lib/transient-tokens.d.ts.map +1 -1
  258. package/lib/user.d.ts +0 -17
  259. package/lib/user.d.ts.map +1 -1
  260. package/lib/user.js.map +1 -1
  261. package/lib/utils/schemas.d.ts +2 -24
  262. package/lib/utils/schemas.d.ts.map +1 -1
  263. package/lib/utils/schemas.js +0 -151
  264. package/lib/utils/schemas.js.map +1 -1
  265. package/lib/vertesia-common.js +3 -4
  266. package/lib/vertesia-common.js.map +1 -1
  267. package/lib/views.d.ts +23 -27
  268. package/lib/views.d.ts.map +1 -1
  269. package/lib/views.js +5 -26
  270. package/lib/views.js.map +1 -1
  271. package/lib/workflow-analytics.d.ts +12 -34
  272. package/lib/workflow-analytics.d.ts.map +1 -1
  273. package/package.json +12 -6
  274. package/src/access-control.ts +0 -26
  275. package/src/account-values.ts +0 -49
  276. package/src/agent-resources.test.ts +1 -12
  277. package/src/api-contract/components.contract.test.ts +99 -0
  278. package/src/api-contract/components.generated.json +40405 -0
  279. package/src/api-contract/index.ts +664 -0
  280. package/src/api-schemas/agent-communication.contract.test.ts +90 -0
  281. package/src/api-schemas/agent-communication.ts +169 -0
  282. package/src/api-schemas/agent-runs.ts +46 -1
  283. package/src/api-schemas/api-discriminators.test.ts +101 -0
  284. package/src/api-schemas/app-lifecycle.ts +39 -4
  285. package/src/api-schemas/app-runtime.ts +8 -0
  286. package/src/api-schemas/apps.ts +4 -3
  287. package/src/api-schemas/content-query.ts +31 -0
  288. package/src/api-schemas/content.ts +88 -15
  289. package/src/api-schemas/dashboard.contract.test.ts +16 -5
  290. package/src/api-schemas/dashboard.ts +3 -0
  291. package/src/api-schemas/events.ts +9 -1
  292. package/src/api-schemas/files.ts +27 -0
  293. package/src/api-schemas/group.ts +10 -0
  294. package/src/api-schemas/index.ts +4 -0
  295. package/src/api-schemas/integrations.ts +27 -2
  296. package/src/api-schemas/interaction.contract.test.ts +204 -1
  297. package/src/api-schemas/interaction.ts +176 -8
  298. package/src/api-schemas/llumiverse.contract.test.ts +33 -2
  299. package/src/api-schemas/oauth-server.ts +152 -3
  300. package/src/api-schemas/oauth.contract.test.ts +64 -1
  301. package/src/api-schemas/process.ts +352 -2
  302. package/src/api-schemas/project-configuration.ts +11 -7
  303. package/src/api-schemas/project.contract.test.ts +83 -6
  304. package/src/api-schemas/registry.ts +290 -457
  305. package/src/api-schemas/schema-primitives.ts +13 -0
  306. package/src/api-schemas/store.contract.test.ts +30 -1
  307. package/src/api-schemas/store.ts +58 -11
  308. package/src/api-schemas/tools.ts +62 -0
  309. package/src/api-schemas/view-execution.ts +28 -2
  310. package/src/api-schemas/views.contract.test.ts +119 -0
  311. package/src/api-schemas/views.ts +142 -3
  312. package/src/api-schemas/workflow-runs.ts +9 -7
  313. package/src/api-schemas/zeno-response-contracts.test.ts +344 -0
  314. package/src/apps.test.ts +2 -40
  315. package/src/apps.ts +14 -181
  316. package/src/ask-user.ts +1 -1
  317. package/src/audit-trail.ts +3 -3
  318. package/src/browser-credentials.ts +3 -7
  319. package/src/common.ts +13 -1
  320. package/src/content-query.ts +5 -0
  321. package/src/data-platform.ts +4 -51
  322. package/src/email.ts +24 -18
  323. package/src/environment.ts +1 -14
  324. package/src/facets.ts +0 -6
  325. package/src/group.ts +2 -12
  326. package/src/index.ts +3 -15
  327. package/src/integrations.ts +1 -52
  328. package/src/interaction.ts +12 -271
  329. package/src/meters.ts +10 -11
  330. package/src/oauth-scopes.test.ts +15 -0
  331. package/src/oauth-scopes.ts +10 -64
  332. package/src/oauth-server.ts +28 -215
  333. package/src/payload.ts +1 -6
  334. package/src/pending-asks.ts +17 -42
  335. package/src/platform-event.ts +3 -156
  336. package/src/project.ts +12 -160
  337. package/src/prompt.ts +9 -8
  338. package/src/query.ts +0 -9
  339. package/src/rate-limiter.ts +3 -3
  340. package/src/runs.ts +8 -0
  341. package/src/schema-for-extraction.ts +1 -1
  342. package/src/secrets.ts +3 -0
  343. package/src/skill.ts +0 -15
  344. package/src/store/activity-catalog.ts +3 -0
  345. package/src/store/agent-approval.ts +0 -4
  346. package/src/store/agent-run.ts +39 -93
  347. package/src/store/collections.ts +3 -6
  348. package/src/store/conversation-state.ts +12 -25
  349. package/src/store/doc-analyzer.ts +0 -26
  350. package/src/store/dsl-workflow.ts +28 -5
  351. package/src/store/grounded-extraction.ts +0 -18
  352. package/src/store/index.ts +0 -6
  353. package/src/store/intake-policy-schema.generated.ts +293 -1
  354. package/src/store/process.ts +84 -0
  355. package/src/store/rendering.ts +3 -8
  356. package/src/store/schedule.ts +0 -19
  357. package/src/store/signals.ts +14 -0
  358. package/src/store/store.ts +118 -127
  359. package/src/store/workflow.ts +32 -120
  360. package/src/sts-errors.ts +0 -2
  361. package/src/sts-token-types.ts +3 -28
  362. package/src/tools.ts +15 -0
  363. package/src/transient-tokens.ts +0 -2
  364. package/src/user.ts +0 -20
  365. package/src/utils/schemas.ts +2 -159
  366. package/src/views.ts +50 -47
  367. package/src/workflow-analytics.ts +12 -40
  368. package/tsconfig.dist.json +4 -1
  369. package/lib/Progress.d.ts +0 -22
  370. package/lib/Progress.d.ts.map +0 -1
  371. package/lib/Progress.js +0 -57
  372. package/lib/Progress.js.map +0 -1
  373. package/lib/agent-request-template.d.ts +0 -4
  374. package/lib/agent-request-template.d.ts.map +0 -1
  375. package/lib/agent-request-template.js +0 -46
  376. package/lib/agent-request-template.js.map +0 -1
  377. package/lib/channels.d.ts +0 -22
  378. package/lib/channels.d.ts.map +0 -1
  379. package/lib/channels.js +0 -57
  380. package/lib/channels.js.map +0 -1
  381. package/lib/host-utils.d.ts +0 -8
  382. package/lib/host-utils.d.ts.map +0 -1
  383. package/lib/host-utils.js +0 -84
  384. package/lib/host-utils.js.map +0 -1
  385. package/lib/platform-event-validation.d.ts +0 -45
  386. package/lib/platform-event-validation.d.ts.map +0 -1
  387. package/lib/platform-event-validation.js +0 -336
  388. package/lib/platform-event-validation.js.map +0 -1
  389. package/lib/store/hive-memory.d.ts +0 -117
  390. package/lib/store/hive-memory.d.ts.map +0 -1
  391. package/lib/store/hive-memory.js +0 -2
  392. package/lib/store/hive-memory.js.map +0 -1
  393. package/lib/store/object-types.d.ts +0 -24
  394. package/lib/store/object-types.d.ts.map +0 -1
  395. package/lib/store/object-types.js +0 -95
  396. package/lib/store/object-types.js.map +0 -1
  397. package/lib/store/process-schema.d.ts +0 -561
  398. package/lib/store/process-schema.d.ts.map +0 -1
  399. package/lib/store/process-schema.js +0 -561
  400. package/lib/store/process-schema.js.map +0 -1
  401. package/lib/store/process-validation.d.ts +0 -17
  402. package/lib/store/process-validation.d.ts.map +0 -1
  403. package/lib/store/process-validation.js +0 -515
  404. package/lib/store/process-validation.js.map +0 -1
  405. package/lib/store/temporalio.d.ts +0 -17
  406. package/lib/store/temporalio.d.ts.map +0 -1
  407. package/lib/store/temporalio.js +0 -41
  408. package/lib/store/temporalio.js.map +0 -1
  409. package/lib/view-configuration-validation.d.ts +0 -15
  410. package/lib/view-configuration-validation.d.ts.map +0 -1
  411. package/lib/view-configuration-validation.js +0 -63
  412. package/lib/view-configuration-validation.js.map +0 -1
  413. package/lib/view-query-validation.d.ts +0 -13
  414. package/lib/view-query-validation.d.ts.map +0 -1
  415. package/lib/view-query-validation.js +0 -266
  416. package/lib/view-query-validation.js.map +0 -1
  417. package/lib/view-validation-helpers.d.ts +0 -15
  418. package/lib/view-validation-helpers.d.ts.map +0 -1
  419. package/lib/view-validation-helpers.js +0 -25
  420. package/lib/view-validation-helpers.js.map +0 -1
  421. package/lib/views-schema.d.ts +0 -1992
  422. package/lib/views-schema.d.ts.map +0 -1
  423. package/lib/views-schema.js +0 -674
  424. package/lib/views-schema.js.map +0 -1
  425. package/lib/views-validation.d.ts +0 -21
  426. package/lib/views-validation.d.ts.map +0 -1
  427. package/lib/views-validation.js +0 -164
  428. package/lib/views-validation.js.map +0 -1
  429. package/src/Progress.ts +0 -59
  430. package/src/agent-request-template.test.ts +0 -40
  431. package/src/agent-request-template.ts +0 -45
  432. package/src/channels.ts +0 -70
  433. package/src/host-utils.test.ts +0 -61
  434. package/src/host-utils.ts +0 -93
  435. package/src/platform-event-validation.test.ts +0 -251
  436. package/src/platform-event-validation.ts +0 -372
  437. package/src/project.test.ts +0 -44
  438. package/src/store/hive-memory.ts +0 -167
  439. package/src/store/object-types.ts +0 -123
  440. package/src/store/process-schema.test.ts +0 -149
  441. package/src/store/process-schema.ts +0 -564
  442. package/src/store/process-validation.test.ts +0 -635
  443. package/src/store/process-validation.ts +0 -646
  444. package/src/store/temporalio.ts +0 -54
  445. package/src/view-configuration-validation.ts +0 -74
  446. package/src/view-query-validation.test.ts +0 -21
  447. package/src/view-query-validation.ts +0 -319
  448. package/src/view-validation-helpers.ts +0 -28
  449. package/src/views-schema.test.ts +0 -372
  450. package/src/views-schema.ts +0 -689
  451. package/src/views-validation.ts +0 -234
@@ -300,27 +300,54 @@ export const EmbeddingMapSchema = z.object({}).catchall(EmbeddingSchema).meta({
300
300
  * keeps emitting under the base's `id` and collides with it in the published document.
301
301
  */
302
302
  const collectionPayloadFields = {
303
- description: z.string().optional(),
304
- skip_head_sync: z.boolean().optional(),
305
- tags: z.array(z.string()).optional(),
306
- type: nullableStringSchema.optional(),
307
- query: z.looseObject({}).optional(),
308
- properties: z.looseObject({}).optional(),
309
- parent: nullableStringSchema.optional(),
303
+ description: z.string().meta({ description: 'Description of the collection and its purpose' }).optional(),
304
+ skip_head_sync: z
305
+ .boolean()
306
+ .meta({
307
+ description: 'When true the collection does not track and sync member HEAD revisions. Defaults to false.',
308
+ })
309
+ .optional(),
310
+ tags: z.array(z.string()).meta({ description: 'Categorization tags for the collection' }).optional(),
311
+ type: nullableStringSchema
312
+ .meta({ description: 'Default content type ID for documents in the collection' })
313
+ .optional(),
314
+ query: z
315
+ .looseObject({})
316
+ .meta({ description: 'MongoDB query that determines membership of a dynamic collection' })
317
+ .optional(),
318
+ properties: z.looseObject({}).meta({ description: 'Metadata properties attached to the collection' }).optional(),
319
+ parent: nullableStringSchema.meta({ description: 'Parent collection ID when the collection is nested' }).optional(),
310
320
  table_layout: z
311
321
  .array(ColumnLayoutSchema)
312
322
  .nullable()
313
- .meta({ anyOf: undefined, type: ['array', 'null'], items: { $ref: 'ColumnLayout' } })
323
+ .meta({
324
+ anyOf: undefined,
325
+ type: ['array', 'null'],
326
+ items: { $ref: 'ColumnLayout' },
327
+ description: 'Column layout used when listing collection members',
328
+ })
329
+ .optional(),
330
+ allowed_types: z
331
+ .array(z.string())
332
+ .meta({ description: 'Content type IDs allowed to be added to the collection' })
333
+ .optional(),
334
+ updated_by: z.string().meta({ description: 'Identity recorded as the updater of the collection' }).optional(),
335
+ shared_properties: z
336
+ .array(z.string())
337
+ .meta({ description: 'Names of collection properties whose values are propagated to member documents' })
314
338
  .optional(),
315
- allowed_types: z.array(z.string()).optional(),
316
- updated_by: z.string().optional(),
317
- shared_properties: z.array(z.string()).optional(),
318
339
  sensitivity: z.number().meta({ description: 'BLP sensitivity level for member documents' }).optional(),
319
340
  compartments: z.array(z.string()).meta({ description: 'Compartments for member documents' }).optional(),
320
341
  };
321
342
 
322
343
  export const CreateCollectionPayloadSchema = z
323
- .strictObject({ ...collectionPayloadFields, name: z.string(), dynamic: z.boolean() })
344
+ .strictObject({
345
+ ...collectionPayloadFields,
346
+ name: z.string().meta({ description: 'Name of the collection' }),
347
+ dynamic: z.boolean().meta({
348
+ description: 'When true, membership is determined by `query`; when false, members are added explicitly',
349
+ }),
350
+ })
324
351
  .meta({ id: 'CreateCollectionPayload' });
325
352
 
326
353
  /**
@@ -331,8 +358,13 @@ export const CreateCollectionPayloadSchema = z
331
358
  export const UpdateCollectionPayloadSchema = z
332
359
  .strictObject({
333
360
  ...collectionPayloadFields,
334
- name: z.string().optional(),
335
- dynamic: z.boolean().optional(),
361
+ name: z.string().meta({ description: 'Name of the collection' }).optional(),
362
+ dynamic: z
363
+ .boolean()
364
+ .meta({
365
+ description: 'When true, membership is determined by `query`; when false, members are added explicitly',
366
+ })
367
+ .optional(),
336
368
  })
337
369
  .meta({ id: 'UpdateCollectionPayload', description: 'Fields to change on a collection. All optional.' });
338
370
 
@@ -780,6 +812,15 @@ export const ContentObjectApiResponseSchema = z
780
812
  is_locked: z.boolean().optional(),
781
813
  score: z.number().optional(),
782
814
  user_permissions: ContentObjectUserPermissionsSchema.optional(),
815
+ searchTypeResult: z
816
+ .array(
817
+ z.strictObject({
818
+ type: z.string(),
819
+ score: z.number(),
820
+ rank: z.number(),
821
+ }),
822
+ )
823
+ .optional(),
783
824
  text: z.string().optional(),
784
825
  text_etag: z.string().optional(),
785
826
  embeddings: EmbeddingMapSchema.optional(),
@@ -793,6 +834,7 @@ export const ContentObjectApiResponseSchema = z
793
834
  description:
794
835
  'BLP sensitivity level — set directly or inherited from collections (max across collections).',
795
836
  })
837
+ .nullable()
796
838
  .optional(),
797
839
  compartments: z
798
840
  .array(z.string())
@@ -804,6 +846,18 @@ export const ContentObjectApiResponseSchema = z
804
846
  })
805
847
  .meta({ id: 'ContentObjectApiResponse' });
806
848
 
849
+ /**
850
+ * Read shape for field-projected objects. Projection intentionally changes requiredness without
851
+ * weakening the full object or any create/update payload.
852
+ */
853
+ export const ProjectedContentObjectApiResponseSchema = ContentObjectApiResponseSchema.partial().meta({
854
+ id: 'ProjectedContentObjectApiResponse',
855
+ });
856
+
857
+ export const ProjectedContentObjectApiResponseArraySchema = z
858
+ .array(ProjectedContentObjectApiResponseSchema)
859
+ .meta({ id: 'ProjectedContentObjectApiResponseArray' });
860
+
807
861
  export const ComputeObjectFacetPayloadSchema = z
808
862
  .strictObject({
809
863
  facets: z.array(FacetSpecSchema),
@@ -841,6 +895,25 @@ export const ContentObjectItemApiResponseSchema = z
841
895
  is_locked: z.boolean().optional(),
842
896
  score: z.number().optional(),
843
897
  user_permissions: ContentObjectUserPermissionsSchema.optional(),
898
+ searchTypeResult: z
899
+ .array(
900
+ z.strictObject({
901
+ type: z.string(),
902
+ score: z.number(),
903
+ rank: z.number(),
904
+ }),
905
+ )
906
+ .optional(),
907
+ text: z.string().optional(),
908
+ text_etag: z.string().optional(),
909
+ embeddings: EmbeddingMapSchema.optional(),
910
+ parts: z.array(z.string()).optional(),
911
+ parts_etag: z.string().optional(),
912
+ transcript: z.looseObject({}).optional(),
913
+ security: StringArrayMapSchema.optional(),
914
+ sensitivity: z.number().nullable().optional(),
915
+ compartments: z.array(z.string()).optional(),
916
+ inherited_properties: z.array(InheritedPropertyMetadataSchema).optional(),
844
917
  })
845
918
  .meta({ id: 'ContentObjectItemApiResponse' });
846
919
 
@@ -882,7 +955,7 @@ export const ContentObjectItemApiResponseArraySchema = z
882
955
 
883
956
  export const ObjectSearchResponseSchema = z
884
957
  .strictObject({
885
- results: z.array(ContentObjectItemApiResponseSchema),
958
+ results: z.array(ProjectedContentObjectApiResponseSchema),
886
959
  facets: ComputedFacetResponseSchema,
887
960
  aggregations: z.looseObject({}).optional(),
888
961
  })
@@ -69,13 +69,23 @@ describe('dashboard request validation', () => {
69
69
  );
70
70
  });
71
71
 
72
- it('derives update as the partial create shape plus skip_versioning', () => {
73
- expect(validateApiRequest('UpdateDashboardPayload', {})).toMatchObject({ valid: true });
74
- expect(validateApiRequest('UpdateDashboardPayload', { spec: { mark: 'line' } })).toMatchObject({
72
+ it('accepts legacy updates without a revision while rejecting undeclared fields', () => {
73
+ expect(validateApiRequest('UpdateDashboardPayload', {}).valid).toBe(true);
74
+ expect(validateApiRequest('UpdateDashboardPayload', { summary: 'Legacy update' }).valid).toBe(true);
75
+ expect(
76
+ validateApiRequest('UpdateDashboardPayload', {
77
+ expected_edit_revision: 1,
78
+ spec: { mark: 'line' },
79
+ }),
80
+ ).toMatchObject({
75
81
  valid: true,
76
82
  });
77
- expect(validateApiRequest('UpdateDashboardPayload', { skip_versioning: true })).toMatchObject({ valid: true });
78
- expect(validateApiRequest('UpdateDashboardPayload', { unknown: true }).valid).toBe(false);
83
+ expect(
84
+ validateApiRequest('UpdateDashboardPayload', { expected_edit_revision: 1, skip_versioning: true }),
85
+ ).toMatchObject({ valid: true });
86
+ expect(validateApiRequest('UpdateDashboardPayload', { expected_edit_revision: 1, unknown: true }).valid).toBe(
87
+ false,
88
+ );
79
89
  });
80
90
 
81
91
  it('keeps the two bulk bodies as the free-form string-array map already published', () => {
@@ -88,6 +98,7 @@ describe('dashboard request validation', () => {
88
98
  describe('dashboard response validation', () => {
89
99
  const item = {
90
100
  id: 'dashboard-1',
101
+ edit_revision: 1,
91
102
  name: 'Revenue',
92
103
  tags: [],
93
104
  updated_by: 'user:editor',
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { DashboardStatus } from '../data-platform.js';
3
3
  import { StringValueMapSchema } from './files.js';
4
+ import { EditRevisionSchema, ExpectedEditRevisionSchema } from './schema-primitives.js';
4
5
 
5
6
  export const DashboardElasticsearchResultMappingSchema = z
6
7
  .discriminatedUnion('type', [
@@ -179,6 +180,7 @@ export const DashboardVersionItemArraySchema = z
179
180
  export const DashboardItemSchema = z
180
181
  .strictObject({
181
182
  id: z.string().meta({ description: 'Unique identifier for the object' }),
183
+ edit_revision: EditRevisionSchema,
182
184
  name: z.string().meta({ description: 'Human-readable name or title' }),
183
185
  description: z.string().meta({ description: 'Optional detailed description of the object' }).optional(),
184
186
  tags: z.array(z.string()).meta({ description: 'Tags for organization' }),
@@ -345,6 +347,7 @@ export const CreateDashboardPayloadSchema = z
345
347
 
346
348
  export const UpdateDashboardPayloadSchema = CreateDashboardPayloadSchema.partial()
347
349
  .extend({
350
+ expected_edit_revision: ExpectedEditRevisionSchema,
348
351
  name: z.string().meta({ description: 'Dashboard name' }).optional(),
349
352
  skip_versioning: z.boolean().meta({ description: 'Skip auto-version creation' }).optional(),
350
353
  })
@@ -8,7 +8,12 @@ import * as AuditTrailSchemas from './audit-trail.js';
8
8
  import { StringValueMapSchema } from './files.js';
9
9
  import { ConversationVisibilitySchema, NumberValueMapSchema } from './interaction.js';
10
10
  import { JsonLogicRuleSchema, ProcessDefinitionBodySchema, ProcessRunTypeSchema } from './process.js';
11
- import { nullableNumberSchema, nullableStringSchema } from './schema-primitives.js';
11
+ import {
12
+ EditRevisionSchema,
13
+ ExpectedEditRevisionSchema,
14
+ nullableNumberSchema,
15
+ nullableStringSchema,
16
+ } from './schema-primitives.js';
12
17
  import { InteractionExecutionConfigurationSchema } from './store.js';
13
18
 
14
19
  export const ServerSentEventsResponseSchema = z.string().meta({ id: 'ServerSentEventsResponse' });
@@ -151,6 +156,7 @@ export const EventDeliverySortFieldSchema = z
151
156
  export const WorkflowRuleItemSchema = z
152
157
  .strictObject({
153
158
  id: z.string().meta({ description: 'Unique identifier for the object' }),
159
+ edit_revision: EditRevisionSchema,
154
160
  name: z.string().meta({ description: 'Human-readable name or title' }),
155
161
  description: z.string().meta({ description: 'Optional detailed description of the object' }).optional(),
156
162
  tags: z.array(z.string()).meta({ description: 'Optional array of categorization tags' }).optional(),
@@ -236,6 +242,7 @@ export const EventDeliveryQueueSortFieldSchema = z
236
242
  export const WorkflowRuleSchema = z
237
243
  .strictObject({
238
244
  id: z.string().meta({ description: 'Unique identifier for the object' }),
245
+ edit_revision: EditRevisionSchema,
239
246
  name: z.string().meta({ description: 'Human-readable name or title' }),
240
247
  description: z.string().meta({ description: 'Optional detailed description of the object' }).optional(),
241
248
  tags: z.array(z.string()).meta({ description: 'Optional array of categorization tags' }).optional(),
@@ -319,6 +326,7 @@ export const CreateWorkflowRulePayloadSchema = z
319
326
  */
320
327
  export const UpdateWorkflowRulePayloadSchema = z
321
328
  .strictObject({
329
+ expected_edit_revision: ExpectedEditRevisionSchema,
322
330
  ...workflowRulePayloadFields,
323
331
  endpoint: z.string().optional(),
324
332
  name: z.string().meta({ description: 'Human-readable name or title' }).optional(),
@@ -31,6 +31,7 @@ export const FileMetadataResponseSchema = z
31
31
  contentType: z.string(),
32
32
  contentDisposition: z.string().optional(),
33
33
  etag: z.string().optional(),
34
+ generation: z.string().optional(),
34
35
  customMetadata: StringValueMapSchema.optional(),
35
36
  })
36
37
  .meta({ id: 'FileMetadataResponse' });
@@ -157,3 +158,29 @@ export const BucketReadAccessStatusResponseSchema = z
157
158
  hasAccess: z.boolean(),
158
159
  })
159
160
  .meta({ id: 'BucketReadAccessStatusResponse' });
161
+
162
+ export const BucketCreateAccessQuerySchema = z
163
+ .strictObject({
164
+ principal: z.string(),
165
+ })
166
+ .meta({ id: 'BucketCreateAccessQuery' });
167
+
168
+ export const EnsureBucketCreateAccessPayloadSchema = BucketCreateAccessQuerySchema.meta({
169
+ id: 'EnsureBucketCreateAccessPayload',
170
+ });
171
+
172
+ export const EnsureBucketCreateAccessResponseSchema = z
173
+ .strictObject({
174
+ bucket: z.string(),
175
+ principal: z.string(),
176
+ granted: z.boolean(),
177
+ })
178
+ .meta({ id: 'EnsureBucketCreateAccessResponse' });
179
+
180
+ export const BucketCreateAccessStatusResponseSchema = z
181
+ .strictObject({
182
+ bucket: z.string(),
183
+ principal: z.string(),
184
+ hasAccess: z.boolean(),
185
+ })
186
+ .meta({ id: 'BucketCreateAccessStatusResponse' });
@@ -64,6 +64,16 @@ export const UserGroupSchema = z
64
64
  */
65
65
  export const UserGroupArraySchema = z.array(UserGroupSchema).meta({ id: 'UserGroupArray' });
66
66
 
67
+ export const ListUserGroupsQuerySchema = z
68
+ .object({
69
+ search: z.string().optional(),
70
+ tags: z.array(z.string()).optional(),
71
+ limit: z.number().optional(),
72
+ offset: z.number().optional(),
73
+ project: z.string().optional(),
74
+ })
75
+ .meta({ id: 'ListUserGroupsQuery' });
76
+
67
77
  /**
68
78
  * Both payloads are picked from {@link UserGroupSchema}, for the same reason `UserRef` is: they are
69
79
  * subsets of the group, not parallel shapes. What each `.pick()` leaves out is the whitelist —
@@ -11,12 +11,14 @@
11
11
  */
12
12
  export * from './account.js';
13
13
  export * from './adapter.js';
14
+ export * from './agent-communication.js';
14
15
  export * from './agent-runs.js';
15
16
  export * from './analytics.js';
16
17
  export * from './apikey.js';
17
18
  export * from './app-runtime.js';
18
19
  export * from './bulk-operation.js';
19
20
  export * from './content.js';
21
+ export * from './content-query.js';
20
22
  export * from './cost-analytics.js';
21
23
  export * from './dashboard.js';
22
24
  export * from './data-store.js';
@@ -26,10 +28,12 @@ export * from './environment.js';
26
28
  export * from './events.js';
27
29
  export * from './indexing.js';
28
30
  export * from './integrations.js';
31
+ export * from './oauth-server.js';
29
32
  export * from './parameters.js';
30
33
  export * from './process.js';
31
34
  export * from './quota.js';
32
35
  export * from './registry.js';
33
36
  export * from './secrets.js';
37
+ export { CreateContentObjectTypePayloadSchema, InteractionExecutionConfigurationSchema } from './store.js';
34
38
  export * from './view-execution.js';
35
39
  export * from './workflow-runs.js';
@@ -5,6 +5,11 @@ import { SupportedIntegrations } from '../integrations.js';
5
5
  import { StringValueMapSchema } from './files.js';
6
6
  import { DSLActivityOptionsSchema } from './process.js';
7
7
 
8
+ const agentOnlyDecryptedSecretSchema = z.string().meta({
9
+ description:
10
+ 'Decrypted credential returned only to authenticated agent principals for runtime use. Human and service-account callers receive null; presence and hint fields report configuration status.',
11
+ });
12
+
8
13
  export const SupportedIntegrations_ask_user_webhookSchema = z
9
14
  .literal(SupportedIntegrations.ask_user_webhook)
10
15
  .meta({ id: 'SupportedIntegrations_ask_user_webhook' });
@@ -45,9 +50,16 @@ export const AskUserWebhookConfigurationSchema = z
45
50
  .strictObject({
46
51
  integration: SupportedIntegrations_ask_user_webhookSchema,
47
52
  enabled: z.boolean(),
48
- webhook_url: z.string().meta({ description: 'Webhook URL to receive ask_user events' }),
53
+ // Optional on the RESPONSE only — `AskUserWebhookConfigurationInputSchema` still requires it,
54
+ // because you cannot configure the integration without one. `getIntegrationConfig` reads
55
+ // `integrations?.[integrationId] ?? {}`, so a project that never set this integration up
56
+ // legitimately answers with the discriminator and `enabled` alone, and a required
57
+ // `webhook_url` made that answer fail its own response contract on every call. Same defect
58
+ // and same fix as `AwsConfiguration.s3_role_arn`.
59
+ webhook_url: z.string().meta({ description: 'Webhook URL to receive ask_user events' }).optional(),
49
60
  has_webhook_secret: z.boolean().optional(),
50
61
  webhook_secret_hint: z.string().optional(),
62
+ webhook_secret: agentOnlyDecryptedSecretSchema.nullable(),
51
63
  events: z
52
64
  .array(z.enum(['requested', 'resolved']))
53
65
  .meta({ description: "Which events to send: ['requested', 'resolved'] or subset (default: both)" })
@@ -68,6 +80,7 @@ export const ResendConfigurationSchema = z
68
80
  enabled: z.boolean(),
69
81
  has_api_key: z.boolean().optional(),
70
82
  api_key_hint: z.string().optional(),
83
+ api_key: agentOnlyDecryptedSecretSchema.nullable(),
71
84
  email_domain: z
72
85
  .string()
73
86
  .meta({ description: 'Domain for email (both sending and receiving). Must be verified in Resend.' }),
@@ -77,6 +90,7 @@ export const ResendConfigurationSchema = z
77
90
  .optional(),
78
91
  has_webhook_secret: z.boolean().optional(),
79
92
  webhook_secret_hint: z.string().optional(),
93
+ webhook_secret: agentOnlyDecryptedSecretSchema.nullable(),
80
94
  allowed_sender_domains: z
81
95
  .array(z.string())
82
96
  .meta({ description: 'Domains allowed to send emails TO start agents (for inbound validation)' })
@@ -98,6 +112,7 @@ export const LinkupConfigurationSchema = z
98
112
  enabled: z.boolean(),
99
113
  has_api_key: z.boolean().optional(),
100
114
  api_key_hint: z.string().optional(),
115
+ api_key: agentOnlyDecryptedSecretSchema.nullable(),
101
116
  })
102
117
  .meta({ id: 'LinkupConfiguration' });
103
118
 
@@ -107,6 +122,7 @@ export const ExaConfigurationSchema = z
107
122
  enabled: z.boolean(),
108
123
  has_api_key: z.boolean().optional(),
109
124
  api_key_hint: z.string().optional(),
125
+ api_key: agentOnlyDecryptedSecretSchema.nullable(),
110
126
  })
111
127
  .meta({ id: 'ExaConfiguration' });
112
128
 
@@ -116,6 +132,7 @@ export const SerperConfigurationSchema = z
116
132
  enabled: z.boolean(),
117
133
  has_api_key: z.boolean().optional(),
118
134
  api_key_hint: z.string().optional(),
135
+ api_key: agentOnlyDecryptedSecretSchema.nullable(),
119
136
  url: z.string().optional(),
120
137
  })
121
138
  .meta({ id: 'SerperConfiguration' });
@@ -145,6 +162,7 @@ export const GladiaConfigurationSchema = z
145
162
  enabled: z.boolean(),
146
163
  has_api_key: z.boolean().optional(),
147
164
  api_key_hint: z.string().optional(),
165
+ api_key: agentOnlyDecryptedSecretSchema.nullable(),
148
166
  url: z.string().optional(),
149
167
  })
150
168
  .meta({ id: 'GladiaConfiguration' });
@@ -269,7 +287,14 @@ export const AwsConfigurationSchema = z
269
287
  .strictObject({
270
288
  integration: SupportedIntegrations_awsSchema,
271
289
  enabled: z.boolean(),
272
- s3_role_arn: z.string(),
290
+ // Optional because "declared but not configured" is a real state, not legacy data:
291
+ // `getIntegrationConfig` reads `integrations?.[integrationId] ?? {}`, so a project that has
292
+ // never set up AWS answers `{ integration: 'aws', enabled: false }` with no role ARN at all.
293
+ // Requiring it here made that answer fail its own response contract. The consumers already
294
+ // agree it is optional — the server guards on `s3_role_arn` being present before assuming a
295
+ // role, and every sibling integration marks its config fields optional for the same reason
296
+ // (`github_app_id`, `url`, ...).
297
+ s3_role_arn: z.string().optional(),
273
298
  })
274
299
  .meta({ id: 'AwsConfiguration' });
275
300
 
@@ -1,8 +1,84 @@
1
1
  import { describe, expect, it } from 'vitest';
2
2
  import type { AsyncConversationExecutionPayload } from '../interaction.js';
3
- import { AsyncConversationExecutionPayloadSchema } from './interaction.js';
3
+ import {
4
+ AsyncConversationExecutionPayloadSchema,
5
+ ComputeRunFacetPayloadSchema,
6
+ ComputeRunFacetsResponseSchema,
7
+ ConversationStateSchema,
8
+ ExecutionRunRefSchema,
9
+ FindRunResultSchema,
10
+ InCodeInteractionSchema,
11
+ InteractionCreatePayloadSchema,
12
+ InteractionPromptSegmentInputSchema,
13
+ InteractionSchema,
14
+ InteractionUpdatePayloadSchema,
15
+ PromptSegmentDefSchema,
16
+ ResolvedCatalogInteractionSchema,
17
+ } from './interaction.js';
18
+
19
+ describe('conversation state contract', () => {
20
+ it('publishes the tool catalog storage scope used to resolve tool references', () => {
21
+ expect(ConversationStateSchema.shape.tool_catalog_storage_id.safeParse('process-run-1').success).toBe(true);
22
+ });
23
+ });
24
+
25
+ describe('in-code interaction contract', () => {
26
+ it('retains prompt schemas when resolving a catalog interaction', () => {
27
+ const interaction = InCodeInteractionSchema.parse({
28
+ type: 'sys',
29
+ id: 'sys:GeneralAgent',
30
+ name: 'GeneralAgent',
31
+ title: 'General Agent',
32
+ tags: ['agent'],
33
+ agent_runner_options: { is_agent: true, request_template: '{{user_prompt}}' },
34
+ prompts: [
35
+ {
36
+ role: 'user',
37
+ content: '{{user_prompt}}',
38
+ content_type: 'handlebars',
39
+ schema: {
40
+ type: 'object',
41
+ properties: { user_prompt: { type: 'string', editor: 'textarea' } },
42
+ },
43
+ },
44
+ ],
45
+ });
46
+
47
+ expect(interaction.prompts[0]?.schema).toMatchObject({
48
+ properties: { user_prompt: { type: 'string' } },
49
+ });
50
+ });
51
+
52
+ it('requires normalized title and tags only on the resolved response', () => {
53
+ const authoringShape = {
54
+ type: 'sys',
55
+ id: 'sys:Untitled',
56
+ name: 'Untitled',
57
+ prompts: [],
58
+ };
59
+
60
+ expect(InCodeInteractionSchema.safeParse(authoringShape).success).toBe(true);
61
+ expect(ResolvedCatalogInteractionSchema.safeParse(authoringShape).success).toBe(false);
62
+ expect(
63
+ ResolvedCatalogInteractionSchema.safeParse({ ...authoringShape, title: 'Untitled', tags: [] }).success,
64
+ ).toBe(true);
65
+ });
66
+ });
4
67
 
5
68
  describe('AsyncConversationExecutionPayload contract', () => {
69
+ it('accepts caller-provided metadata and enrichment controls', () => {
70
+ const payload: AsyncConversationExecutionPayload = {
71
+ type: 'conversation',
72
+ interaction: 'sys:AppTester',
73
+ title: 'Manual title',
74
+ topic: 'Manual topic',
75
+ generate_topic: false,
76
+ generate_lessons: false,
77
+ };
78
+
79
+ expect(AsyncConversationExecutionPayloadSchema.parse(payload)).toMatchObject(payload);
80
+ });
81
+
6
82
  it('retains an immutable app-version execution target', () => {
7
83
  const payload: AsyncConversationExecutionPayload = {
8
84
  type: 'conversation',
@@ -25,3 +101,130 @@ describe('AsyncConversationExecutionPayload contract', () => {
25
101
  ).toThrow();
26
102
  });
27
103
  });
104
+
105
+ describe('run facet contracts', () => {
106
+ const facets = [
107
+ { name: 'environments', field: 'environment' },
108
+ { name: 'interactions', field: 'interaction' },
109
+ { name: 'models', field: 'modelId' },
110
+ { name: 'statuses', field: 'status' },
111
+ { name: 'finish_reason', field: 'finish_reason' },
112
+ ];
113
+
114
+ it('accepts exactly the supported run facet pairs', () => {
115
+ expect(ComputeRunFacetPayloadSchema.parse({ facets })).toEqual({ facets });
116
+ });
117
+
118
+ it.each(['tags', 'created_by', 'start', 'end'])('rejects the removed %s facet', (field) => {
119
+ expect(ComputeRunFacetPayloadSchema.safeParse({ facets: [{ name: field, field }] }).success).toBe(false);
120
+ });
121
+
122
+ it('rejects mismatched and additional facet names', () => {
123
+ expect(ComputeRunFacetPayloadSchema.safeParse({ facets: [{ name: 'models', field: 'status' }] }).success).toBe(
124
+ false,
125
+ );
126
+ expect(ComputeRunFacetPayloadSchema.safeParse({ facets: [{ name: 'custom', field: 'modelId' }] }).success).toBe(
127
+ false,
128
+ );
129
+ });
130
+
131
+ it('keeps removed facet fields available as query filters', () => {
132
+ const query = {
133
+ tags: ['visible'],
134
+ created_by: 'user:123',
135
+ start: '2026-08-01T00:00:00.000Z',
136
+ end: '2026-08-02T00:00:00.000Z',
137
+ };
138
+
139
+ expect(ComputeRunFacetPayloadSchema.parse({ facets: [], query })).toEqual({ facets: [], query });
140
+ });
141
+
142
+ it('rejects removed and custom response facets', () => {
143
+ expect(ComputeRunFacetsResponseSchema.safeParse({ tags: [] }).success).toBe(false);
144
+ expect(ComputeRunFacetsResponseSchema.safeParse({ custom: [] }).success).toBe(false);
145
+ });
146
+ });
147
+
148
+ describe('run response contracts', () => {
149
+ it('retains an environment ID when a run references a deleted environment', () => {
150
+ expect(ExecutionRunRefSchema.shape.environment.parse('env-deleted')).toBe('env-deleted');
151
+ expect(ExecutionRunRefSchema.shape.environment.parse(null)).toBeNull();
152
+ });
153
+
154
+ it('models the arbitrary stored-field projection returned by /runs/find', () => {
155
+ expect(
156
+ FindRunResultSchema.parse({
157
+ id: 'run-1',
158
+ environment: 'env-1',
159
+ account: 'account-1',
160
+ project: 'project-1',
161
+ interaction: 'interaction-1',
162
+ result: [],
163
+ parameters: { query: 'test' },
164
+ }),
165
+ ).toMatchObject({ environment: 'env-1', account: 'account-1', project: 'project-1' });
166
+ });
167
+
168
+ it('does not publish run persistence-only fields', () => {
169
+ expect(() => FindRunResultSchema.parse({ interaction_code: 'sys:Example' })).toThrow();
170
+ expect(() => FindRunResultSchema.parse({ tmp_prompt: [] })).toThrow();
171
+ });
172
+
173
+ it('models enriched supported run facet buckets', () => {
174
+ expect(
175
+ ComputeRunFacetsResponseSchema.parse({
176
+ environments: [{ _id: 'env-1', count: 2, name: 'Default' }],
177
+ interactions: [{ _id: 'interaction-1', count: 1, name: 'Example', status: 'published', version: 3 }],
178
+ models: [{ _id: 'gpt', count: 2 }],
179
+ total: 2,
180
+ }),
181
+ ).toMatchObject({ total: 2 });
182
+ });
183
+ });
184
+
185
+ describe('interaction contracts', () => {
186
+ const populatedPrompt = {
187
+ role: 'user',
188
+ content: 'Hello',
189
+ content_type: 'text',
190
+ id: 'prompt-1',
191
+ name: 'Greeting',
192
+ status: 'draft',
193
+ version: 1,
194
+ project: 'project-1',
195
+ created_by: 'user-1',
196
+ updated_by: 'user-1',
197
+ created_at: '2026-08-20T00:00:00.000Z',
198
+ updated_at: '2026-08-20T00:00:00.000Z',
199
+ };
200
+
201
+ it('accepts the media-result storage setting on interaction payloads and responses', () => {
202
+ expect(InteractionSchema.shape.store_media_results.parse(true)).toBe(true);
203
+ expect(InteractionCreatePayloadSchema.shape.store_media_results.parse(false)).toBe(false);
204
+ expect(InteractionUpdatePayloadSchema.shape.store_media_results.parse(true)).toBe(true);
205
+ });
206
+
207
+ it('keeps legacy populated prompts valid in interaction write payloads', () => {
208
+ const segment = { type: 'template', template: populatedPrompt };
209
+
210
+ expect(InteractionPromptSegmentInputSchema.safeParse(segment).success).toBe(true);
211
+ expect(
212
+ InteractionPromptSegmentInputSchema.safeParse({
213
+ ...segment,
214
+ template: { ...populatedPrompt, edit_revision: 3 },
215
+ }).success,
216
+ ).toBe(true);
217
+ });
218
+
219
+ it('still requires edit revisions on populated prompts returned by the API', () => {
220
+ const segment = { type: 'template', template: populatedPrompt };
221
+
222
+ expect(PromptSegmentDefSchema.safeParse(segment).success).toBe(false);
223
+ expect(
224
+ PromptSegmentDefSchema.safeParse({
225
+ ...segment,
226
+ template: { ...populatedPrompt, edit_revision: 3 },
227
+ }).success,
228
+ ).toBe(true);
229
+ });
230
+ });