@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
@@ -5,6 +5,7 @@ import {
5
5
  JSONSchemaSchema,
6
6
  ModalitiesSchema,
7
7
  ModelOptionsSchema,
8
+ PromptCacheDiagnosticSchema,
8
9
  PromptRoleSchema,
9
10
  StatelessExecutionOptionsSchema,
10
11
  ToolDefinitionSchema,
@@ -25,6 +26,7 @@ import { ProjectRefSchema } from './apikey.js';
25
26
  import { ExecutionEnvironmentRefSchema } from './environment.js';
26
27
  import { AccountRefSchema } from './invites.js';
27
28
  import { AgentCheckpointConfigurationSchema } from './project-configuration.js';
29
+ import { EditRevisionSchema, ExpectedEditRevisionSchema } from './schema-primitives.js';
28
30
  import { InteractionExecutionConfigurationSchema, RunDataStorageLevelSchema } from './store.js';
29
31
 
30
32
  /**
@@ -40,7 +42,11 @@ export const ExecutionRunStatusSchema = z.enum(ExecutionRunStatus).meta({ id: 'E
40
42
 
41
43
  export const FacetSpecSchema = z
42
44
  .strictObject({
43
- name: z.string(),
45
+ name: z.string().meta({
46
+ description:
47
+ 'Key the buckets are returned under. `total` is reserved for the match count that every facet ' +
48
+ 'response carries, and is rejected with a 400.',
49
+ }),
44
50
  field: z.string(),
45
51
  })
46
52
  .meta({ id: 'FacetSpec' });
@@ -401,6 +407,7 @@ export const PromptTemplateSchema = z
401
407
  name: z.string(),
402
408
  status: PromptStatusSchema,
403
409
  version: z.number(),
410
+ edit_revision: EditRevisionSchema,
404
411
  // The record this one was derived from. On a published version it is the draft it was
405
412
  // published from; on a fork it is the prompt that was forked, and the fork is itself a
406
413
  // draft. So `parent` alone does not tell you which kind of record this is — read `status`.
@@ -424,7 +431,15 @@ export const PromptTemplateSchema = z
424
431
  // The two payloads are projections of `PromptTemplate`, so they are derived from its canonical Zod
425
432
  // schema here. Leaving them as TypeScript utility types would give the generator only aliases with
426
433
  // no runtime properties to publish.
427
- const SERVER_OWNED_PROMPT_FIELDS = ['id', 'created_at', 'updated_at', 'created_by', 'updated_by', 'project'] as const;
434
+ const SERVER_OWNED_PROMPT_FIELDS = [
435
+ 'id',
436
+ 'edit_revision',
437
+ 'created_at',
438
+ 'updated_at',
439
+ 'created_by',
440
+ 'updated_by',
441
+ 'project',
442
+ ] as const;
428
443
  const SERVER_OWNED_PROMPT_FIELD_KEYS = Object.fromEntries(
429
444
  SERVER_OWNED_PROMPT_FIELDS.map((field) => [field, true as const]),
430
445
  ) as Record<(typeof SERVER_OWNED_PROMPT_FIELDS)[number], true>;
@@ -448,6 +463,7 @@ export const PromptTemplateCreatePayloadSchema = PromptTemplateSchema.pick({
448
463
 
449
464
  export const PromptTemplateUpdatePayloadSchema = PromptTemplateSchema.omit(SERVER_OWNED_PROMPT_FIELD_KEYS)
450
465
  .partial()
466
+ .extend({ expected_edit_revision: ExpectedEditRevisionSchema })
451
467
  .meta({ id: 'PromptTemplateUpdatePayload' });
452
468
 
453
469
  export const CachePolicySchema = z
@@ -896,6 +912,13 @@ export const PromptTemplateRefSchema = z
896
912
  })
897
913
  .meta({ id: 'PromptTemplateRef' });
898
914
 
915
+ // Interaction writes may carry a populated prompt copied from an interaction response. New clients
916
+ // preserve its revision while legacy clients never sent one, so the embedded request shape accepts
917
+ // both. The standalone PromptTemplate response keeps the revision required.
918
+ export const InteractionPromptTemplateInputSchema = PromptTemplateSchema.extend({
919
+ edit_revision: EditRevisionSchema.optional(),
920
+ }).meta({ id: 'InteractionPromptTemplateInput' });
921
+
899
922
  export const RunSourceSchema = z
900
923
  .strictObject({
901
924
  type: RunSourceTypesSchema,
@@ -915,6 +938,12 @@ export const PromptSegmentDefSchema = z
915
938
  })
916
939
  .meta({ id: 'PromptSegmentDef' });
917
940
 
941
+ export const InteractionPromptSegmentInputSchema = PromptSegmentDefSchema.extend({
942
+ template: z
943
+ .union([z.string(), PromptTemplateSchema, InteractionPromptTemplateInputSchema, PromptTemplateRefSchema])
944
+ .optional(),
945
+ }).meta({ id: 'InteractionPromptSegmentInput' });
946
+
918
947
  export const InteractionEndpointSchema = z
919
948
  .strictObject({
920
949
  id: z.string(),
@@ -942,7 +971,7 @@ export const InteractionCreatePayloadSchema = z
942
971
  test_data: JSONObjectSchema.optional(),
943
972
  interaction_schema: z.union([JSONSchemaSchema, SchemaRefSchema]).optional(),
944
973
  cache_policy: CachePolicySchema.optional(),
945
- prompts: z.array(PromptSegmentDefSchema),
974
+ prompts: z.array(InteractionPromptSegmentInputSchema),
946
975
  last_published_at: z.string().meta({ format: 'date-time' }).optional(),
947
976
  name: z.string(),
948
977
  description: z.string().optional(),
@@ -951,6 +980,7 @@ export const InteractionCreatePayloadSchema = z
951
980
  environment: z.union([z.string(), ExecutionEnvironmentRefSchema]).optional(),
952
981
  model: z.string().optional(),
953
982
  model_options: ModelOptionsSchema.optional(),
983
+ store_media_results: z.boolean().optional(),
954
984
  restriction: RunDataStorageLevelSchema.optional(),
955
985
  output_modality: ModalitiesSchema.meta({
956
986
  description: 'Deprecated: This is deprecated. Use CompletionResult.type information instead.',
@@ -965,6 +995,7 @@ export const InteractionCreatePayloadSchema = z
965
995
  export const InteractionSchema = z
966
996
  .strictObject({
967
997
  id: z.string(),
998
+ edit_revision: EditRevisionSchema,
968
999
  name: z.string(),
969
1000
  endpoint: z.string(),
970
1001
  description: z.string().optional(),
@@ -975,6 +1006,7 @@ export const InteractionSchema = z
975
1006
  environment: z.union([z.string(), ExecutionEnvironmentRefSchema]).optional(),
976
1007
  model: z.string().optional(),
977
1008
  model_options: ModelOptionsSchema.optional(),
1009
+ store_media_results: z.boolean().optional(),
978
1010
  restriction: RunDataStorageLevelSchema.optional(),
979
1011
  output_modality: ModalitiesSchema.meta({
980
1012
  description: 'Deprecated: This is deprecated. Use CompletionResult.type information instead.',
@@ -1047,6 +1079,43 @@ export const CatalogInteractionRefSchema = z
1047
1079
  'Reference to an interaction in the catalog. Used in catalog listing. The id is composed of the namespace and the interaction name. Stored interactions can use `oid:` prefix. If no prefix is used it fallback on `oid:`.',
1048
1080
  });
1049
1081
 
1082
+ export const InCodeInteractionSchema = z
1083
+ .strictObject({
1084
+ type: z.enum(['sys', 'app', 'stored', 'draft']).meta({ description: 'The interaction type.' }),
1085
+ id: z.string().meta({ description: 'The executable catalog interaction ID.' }),
1086
+ name: z.string().meta({ description: 'The interaction code name.' }),
1087
+ version: z.number().optional(),
1088
+ published: z.boolean().optional(),
1089
+ title: z.string().optional(),
1090
+ description: z.string().optional(),
1091
+ result_schema: z.union([JSONSchemaSchema, SchemaRefSchema]).optional(),
1092
+ output_modality: ModalitiesSchema.optional(),
1093
+ storage: RunDataStorageLevelSchema.optional(),
1094
+ tags: z.array(z.string()).optional(),
1095
+ agent_runner_options: AgentRunnerOptionsSchema.optional(),
1096
+ model_options: ModelOptionsSchema.optional(),
1097
+ prompts: z.array(InCodePromptSchema),
1098
+ externalId: z.string().optional(),
1099
+ runtime: z
1100
+ .strictObject({
1101
+ environment: z.string().optional(),
1102
+ model: z.string().optional(),
1103
+ })
1104
+ .optional(),
1105
+ })
1106
+ .meta({
1107
+ id: 'InCodeInteraction',
1108
+ description: 'An executable interaction definition, including the prompt schemas required by clients.',
1109
+ });
1110
+
1111
+ export const ResolvedCatalogInteractionSchema = InCodeInteractionSchema.extend({
1112
+ title: z.string().meta({ description: 'Display title, normalized from the interaction name when absent.' }),
1113
+ tags: z.array(z.string()).meta({ description: 'Tags, normalized to an empty array when absent.' }),
1114
+ }).meta({
1115
+ id: 'ResolvedCatalogInteraction',
1116
+ description: 'A catalog interaction resolved to its complete executable definition.',
1117
+ });
1118
+
1050
1119
  export const RunSearchPayloadSchema = z
1051
1120
  .strictObject({
1052
1121
  facets: z.array(FacetSpecSchema).optional(),
@@ -1140,6 +1209,7 @@ export const PromptSegmentRef_PromptTemplateRefSchema = z
1140
1209
 
1141
1210
  export const InteractionUpdatePayloadSchema = z
1142
1211
  .strictObject({
1212
+ expected_edit_revision: ExpectedEditRevisionSchema,
1143
1213
  status: InteractionStatusSchema.optional(),
1144
1214
  parent: z.string().optional(),
1145
1215
  visibility: InteractionVisibilitySchema.optional(),
@@ -1147,7 +1217,7 @@ export const InteractionUpdatePayloadSchema = z
1147
1217
  test_data: JSONObjectSchema.optional(),
1148
1218
  interaction_schema: z.union([JSONSchemaSchema, SchemaRefSchema]).optional(),
1149
1219
  cache_policy: CachePolicySchema.optional(),
1150
- prompts: z.array(PromptSegmentDefSchema).optional(),
1220
+ prompts: z.array(InteractionPromptSegmentInputSchema).optional(),
1151
1221
  last_published_at: z.string().meta({ format: 'date-time' }).optional(),
1152
1222
  name: z.string().optional(),
1153
1223
  endpoint: z.string().optional(),
@@ -1157,6 +1227,7 @@ export const InteractionUpdatePayloadSchema = z
1157
1227
  environment: z.union([z.string(), ExecutionEnvironmentRefSchema]).optional(),
1158
1228
  model: z.string().optional(),
1159
1229
  model_options: ModelOptionsSchema.optional(),
1230
+ store_media_results: z.boolean().optional(),
1160
1231
  restriction: RunDataStorageLevelSchema.optional(),
1161
1232
  output_modality: ModalitiesSchema.meta({
1162
1233
  description: 'Deprecated: This is deprecated. Use CompletionResult.type information instead.',
@@ -1364,6 +1435,7 @@ export const ExecutionRunSchema: z.ZodType = z
1364
1435
  finish_reason: z.string().optional(),
1365
1436
  prompt: z.unknown().optional(),
1366
1437
  token_use: ExecutionTokenUsageSchema.optional(),
1438
+ prompt_cache_diagnostics: z.array(PromptCacheDiagnosticSchema).optional(),
1367
1439
  chunks: z.number().optional(),
1368
1440
  execution_time: z.number().optional(),
1369
1441
  created_at: z.string().meta({ format: 'date-time' }),
@@ -1422,6 +1494,7 @@ export const InteractionExecutionResultSchema = z
1422
1494
  finish_reason: z.string().optional(),
1423
1495
  prompt: z.unknown().optional(),
1424
1496
  token_use: ExecutionTokenUsageSchema.optional(),
1497
+ prompt_cache_diagnostics: z.array(PromptCacheDiagnosticSchema).optional(),
1425
1498
  chunks: z.number().optional(),
1426
1499
  execution_time: z.number().optional(),
1427
1500
  created_at: z.string().meta({ format: 'date-time' }),
@@ -1466,6 +1539,27 @@ export const PopulatedExecutionRunResultSchema = InteractionExecutionResultSchem
1466
1539
  description: 'An execution run with its completion result and its interaction reference populated.',
1467
1540
  });
1468
1541
 
1542
+ /**
1543
+ * Stored run fields returned by the internal `/runs/find` projection endpoint.
1544
+ * Callers choose an arbitrary MongoDB projection, so every field is optional and references remain ids.
1545
+ */
1546
+ export const FindRunResultSchema = InteractionExecutionResultSchema.omit({
1547
+ tool_use: true,
1548
+ conversation: true,
1549
+ options: true,
1550
+ })
1551
+ .extend({
1552
+ environment: z.string(),
1553
+ })
1554
+ .partial()
1555
+ .meta({
1556
+ id: 'FindRunResult',
1557
+ description:
1558
+ 'A caller-selected subset of canonical stored run fields. Internal persistence fields are normalized at the API boundary.',
1559
+ });
1560
+
1561
+ export const FindRunResultArraySchema = z.array(FindRunResultSchema).meta({ id: 'FindRunResultArray' });
1562
+
1469
1563
  /**
1470
1564
  * `result` in the shape the pre-`COMPLETION_RESULT_V1` endpoints report it.
1471
1565
  *
@@ -1521,8 +1615,10 @@ export const ExecutionRunRefSchema = z
1521
1615
  })
1522
1616
  .optional(),
1523
1617
  tags: z.array(z.string()).optional(),
1524
- environment: ExecutionEnvironmentRefSchema.meta({
1525
- description: 'Environment reference - populated with full object in API responses',
1618
+ environment: z.union([ExecutionEnvironmentRefSchema, z.string(), z.null()]).meta({
1619
+ description:
1620
+ 'Environment reference. API responses normally contain the populated environment object; the ' +
1621
+ 'stored environment ID or null is retained when the referenced environment no longer exists.',
1526
1622
  }),
1527
1623
  modelId: z.string().optional(),
1528
1624
  result_schema: JSONSchemaSchema.optional(),
@@ -1531,6 +1627,7 @@ export const ExecutionRunRefSchema = z
1531
1627
  finish_reason: z.string().optional(),
1532
1628
  prompt: z.unknown().optional(),
1533
1629
  token_use: ExecutionTokenUsageSchema.optional(),
1630
+ prompt_cache_diagnostics: z.array(PromptCacheDiagnosticSchema).optional(),
1534
1631
  chunks: z.number().optional(),
1535
1632
  execution_time: z.number().optional(),
1536
1633
  created_at: z.string().meta({ format: 'date-time' }),
@@ -1552,6 +1649,8 @@ export const ExecutionRunRefSchema = z
1552
1649
  'The Vertesia Workflow related to this Interaction Run.\n\nThis is only set when the interaction is executed as part of a workflow.',
1553
1650
  }).optional(),
1554
1651
  interaction: InteractionRefSchema.optional(),
1652
+ result: z.array(CompletionResultSchema).optional(),
1653
+ parameters: z.unknown().optional(),
1555
1654
  })
1556
1655
  .meta({ id: 'ExecutionRunRef' });
1557
1656
 
@@ -1604,6 +1703,10 @@ export const ConversationStateSchema = z
1604
1703
  tool_reference: ToolReferenceSchema.meta({
1605
1704
  description: 'Reference to tools stored in GCP instead of embedding full tool definitions',
1606
1705
  }).optional(),
1706
+ tool_catalog_storage_id: z
1707
+ .string()
1708
+ .meta({ description: 'Artifact-storage scope containing the referenced tool catalog.' })
1709
+ .optional(),
1607
1710
  active_tool_names: z
1608
1711
  .array(z.string())
1609
1712
  .meta({
@@ -1687,7 +1790,7 @@ export const ConversationStateSchema = z
1687
1790
  .array(z.string())
1688
1791
  .meta({
1689
1792
  description:
1690
- 'Names of skills whose full instructions are already present in the live conversation history (i.e. were delivered by a prior `learn_<skill>` call). Used to make skill re-activation idempotent: a repeat call returns a short "already active" acknowledgement instead of re-dumping the instructions.\n\nUnlike `unlocked_tools` (which must survive a checkpoint so tools stay unlocked), this list is reset when a checkpoint compacts the conversation, because the summary no longer carries the skill instructions and the next call must re-deliver them.',
1793
+ 'Names of skills whose full instructions are already present in the live conversation history (i.e. were delivered by a prior `learn_<skill>` call). Used to make skill re-activation idempotent: a repeat call returns a short "already active" acknowledgement instead of re-dumping the instructions.\n\nUnlike `unlocked_tools` (which must survive a checkpoint so tools stay unlocked), this list tracks only instructions present in the current compacted conversation. Checkpoints restore active builtin skill bodies and preserve their names; skills that cannot be restored are removed so the next call can re-deliver them.',
1691
1794
  })
1692
1795
  .optional(),
1693
1796
  initialization_call_ids: z
@@ -1775,6 +1878,7 @@ export const UpdateExecutionRunPayloadSchema = z
1775
1878
  finish_reason: z.string().optional(),
1776
1879
  prompt: z.unknown().optional(),
1777
1880
  token_use: ExecutionTokenUsageSchema.optional(),
1881
+ prompt_cache_diagnostics: z.array(PromptCacheDiagnosticSchema).optional(),
1778
1882
  chunks: z.number().optional(),
1779
1883
  execution_time: z.number().optional(),
1780
1884
  created_at: z.string().meta({ format: 'date-time' }).optional(),
@@ -1990,12 +2094,36 @@ export const AsyncInteractionExecutionPayloadSchema = z
1990
2094
  })
1991
2095
  .meta({ id: 'AsyncInteractionExecutionPayload' });
1992
2096
 
2097
+ export const ConversationEnrichmentFields = {
2098
+ title: z.string().min(1).meta({ description: 'Caller-provided conversation title.' }).optional(),
2099
+ topic: z
2100
+ .string()
2101
+ .min(1)
2102
+ .meta({ description: 'Caller-provided conversation topic. Suppresses automatic topic generation.' })
2103
+ .optional(),
2104
+ generate_topic: z
2105
+ .boolean()
2106
+ .meta({
2107
+ description:
2108
+ 'Whether to generate a conversation title and topic automatically. Defaults to true; a caller-provided topic always suppresses generation.',
2109
+ })
2110
+ .optional(),
2111
+ generate_lessons: z
2112
+ .boolean()
2113
+ .meta({
2114
+ description:
2115
+ 'Whether to generate lessons automatically at completion. Defaults to true; conversation content remains searchable when disabled.',
2116
+ })
2117
+ .optional(),
2118
+ };
2119
+
1993
2120
  export const AsyncConversationExecutionPayloadSchema = z
1994
2121
  .object({
1995
2122
  interaction: z.string().meta({
1996
2123
  description:
1997
2124
  'The interaction name and suffixed by an optional tag or version separated from the name using a @ character If no version/tag part is specified then the latest version is used. Example: ReviewContract, ReviewContract@draft, ReviewContract@1, ReviewContract@some-tag',
1998
2125
  }),
2126
+ ...ConversationEnrichmentFields,
1999
2127
  app_version: z
2000
2128
  .string()
2001
2129
  .meta({
@@ -2290,6 +2418,15 @@ export const ResolveInteractionQuerySchema = z
2290
2418
  // a union here would publish `anyOf` on an additionalProperties value, which the generated-client
2291
2419
  // rules rule out for a primitive-or-collection value. The emitted schema is what AJV compiles, so
2292
2420
  // array-or-number is enforced either way.
2421
+ // `total` is RESERVED: it is the match count and nothing else. The buckets live beside it under the
2422
+ // facet's own name, so the two never need the same slot. `computeFacets` used to seed the count and
2423
+ // then write the requested facets over it, so a caller who named a facet `total` got that facet's
2424
+ // buckets where the count belonged — an array in a field this schema types as a number. The server
2425
+ // now rejects that name with a 400 instead, which is why `total` can stay a plain number here.
2426
+ //
2427
+ // Widening it to the catchall's `['array', 'number']` is not an option regardless: a NAMED property
2428
+ // with a type array makes the Java generator reference a class it never writes (`AnyOfnumber`) and
2429
+ // the client stops compiling. The catchall gets away with it by becoming a map value, not a field.
2293
2430
  export const ComputedFacetResponseSchema = z
2294
2431
  .object({
2295
2432
  total: z.number().optional(),
@@ -2323,6 +2460,7 @@ export const ExecutionResponseSchema = z
2323
2460
  .strictObject({
2324
2461
  result: z.array(CompletionResultSchema),
2325
2462
  token_usage: ExecutionTokenUsageSchema.optional(),
2463
+ prompt_cache_diagnostic: PromptCacheDiagnosticSchema.optional(),
2326
2464
  tool_use: z.array(ToolUseSchema).optional(),
2327
2465
  finish_reason: z.string().optional(),
2328
2466
  error: z
@@ -2340,8 +2478,16 @@ export const ExecutionResponseSchema = z
2340
2478
  })
2341
2479
  .meta({ id: 'ExecutionResponse' });
2342
2480
 
2481
+ const RunFacetSpecSchema = z.discriminatedUnion('name', [
2482
+ z.strictObject({ name: z.literal('environments'), field: z.literal('environment') }),
2483
+ z.strictObject({ name: z.literal('interactions'), field: z.literal('interaction') }),
2484
+ z.strictObject({ name: z.literal('models'), field: z.literal('modelId') }),
2485
+ z.strictObject({ name: z.literal('statuses'), field: z.literal('status') }),
2486
+ z.strictObject({ name: z.literal('finish_reason'), field: z.literal('finish_reason') }),
2487
+ ]);
2488
+
2343
2489
  export const ComputeRunFacetPayloadSchema = z
2344
- .strictObject({ facets: z.array(FacetSpecSchema), query: RunSearchQuerySchema.optional() })
2490
+ .strictObject({ facets: z.array(RunFacetSpecSchema).max(5), query: RunSearchQuerySchema.optional() })
2345
2491
  .meta({ id: 'ComputeRunFacetPayload' });
2346
2492
 
2347
2493
  export const RunSearchMetaResponseSchema = z
@@ -2356,6 +2502,28 @@ export const RunSearchMetaResponseSchema = z
2356
2502
  })
2357
2503
  .meta({ id: 'RunSearchMetaResponse' });
2358
2504
 
2505
+ const RunFacetBucketSchema = z.strictObject({
2506
+ _id: z.string().nullable(),
2507
+ count: z.number(),
2508
+ name: z.string().optional(),
2509
+ status: InteractionStatusSchema.optional(),
2510
+ version: z.number().optional(),
2511
+ });
2512
+
2513
+ /**
2514
+ * Response returned by POST /runs/facets.
2515
+ */
2516
+ export const ComputeRunFacetsResponseSchema = z
2517
+ .strictObject({
2518
+ environments: z.array(RunFacetBucketSchema).optional(),
2519
+ interactions: z.array(RunFacetBucketSchema).optional(),
2520
+ models: z.array(RunFacetBucketSchema).optional(),
2521
+ statuses: z.array(RunFacetBucketSchema).optional(),
2522
+ finish_reason: z.array(RunFacetBucketSchema).optional(),
2523
+ total: z.number().optional(),
2524
+ })
2525
+ .meta({ id: 'ComputeRunFacetsResponse' });
2526
+
2359
2527
  export const RunClonePayloadSchema = z
2360
2528
  .strictObject({
2361
2529
  source_run_id: z.string(),
@@ -5,8 +5,8 @@ import type { JsonObject } from './adapter.js';
5
5
  import { ApiSchemaComponents, apiComponentRef, validateApiRequest } from './registry.js';
6
6
 
7
7
  /**
8
- * The two llumiverse closures the registry publishes: `ModelOptions` with its twenty-three driver
9
- * option sets and four enums, and `JSONSchema` with its property map.
8
+ * The two llumiverse closures the registry publishes: `ModelOptions` with its driver option sets
9
+ * and enums, and `JSONSchema` with its property map.
10
10
  *
11
11
  * Their schemas live in `@llumiverse/common/schemas` — they describe llumiverse's types, and a copy
12
12
  * here would be exactly the drift this migration removes. What is checked HERE is the half that
@@ -21,9 +21,11 @@ function compile(name: string) {
21
21
 
22
22
  const UNION_MEMBERS = [
23
23
  'TextFallbackOptions',
24
+ 'AzureFoundryChatOptions',
24
25
  'ImagenOptions',
25
26
  'VertexAIClaudeOptions',
26
27
  'VertexAIGeminiOptions',
28
+ 'VertexAIGeminiOmniVideoOptions',
27
29
  'VertexAIGrokOptions',
28
30
  'NovaCanvasOptions',
29
31
  'BedrockConverseOptions',
@@ -42,7 +44,9 @@ const UNION_MEMBERS = [
42
44
  'OpenAiTextOptions',
43
45
  'OpenAiDalleOptions',
44
46
  'OpenAiGptImageOptions',
47
+ 'XAIGrokImageOptions',
45
48
  'GroqOptions',
49
+ 'MistralTextOptions',
46
50
  ];
47
51
 
48
52
  describe('the ModelOptions closure is published whole and enforced closed', () => {
@@ -78,8 +82,35 @@ describe('the ModelOptions closure is published whole and enforced closed', () =
78
82
  // published byte alone would not catch it.
79
83
  expect((ApiSchemaComponents.TextFallbackOptions as JsonObject).additionalProperties).toBe(false);
80
84
  expect(validate({ _option_id: 'text-fallback', top_p: 0.9, unknown_option: 1 })).toBe(false);
85
+ expect((ApiSchemaComponents.XAIGrokImageOptions as JsonObject).additionalProperties).toBe(false);
86
+ expect(validate({ _option_id: 'xai-grok-image', quality: 'medium', unknown_option: 1 })).toBe(false);
87
+ expect(
88
+ validate({
89
+ _option_id: 'mistral-text',
90
+ effort: 'high',
91
+ random_seed: 42,
92
+ safe_prompt: true,
93
+ include_thoughts: false,
94
+ }),
95
+ JSON.stringify(validate.errors),
96
+ ).toBe(true);
81
97
  expect(validate({ _option_id: 'not-a-driver' })).toBe(false);
82
98
  });
99
+
100
+ it('allows provider-specific objects only inside OpenAI-compatible extra_body', () => {
101
+ const validate = compile('ModelOptions');
102
+ expect(
103
+ validate({
104
+ _option_id: 'openai-text',
105
+ extra_body: {
106
+ provider: { sort: 'throughput', allow_fallbacks: false },
107
+ baseten: { performance: 'max' },
108
+ },
109
+ }),
110
+ JSON.stringify(validate.errors),
111
+ ).toBe(true);
112
+ expect(validate({ _option_id: 'openai-text', extra_body: ['invalid'] })).toBe(false);
113
+ });
83
114
  });
84
115
 
85
116
  describe('the JSONSchema closure is published open, because a JSON Schema is open', () => {
@@ -5,9 +5,10 @@ import { z } from 'zod';
5
5
  * their users have approved. Vertesia acting as a client of someone else's authorization server is
6
6
  * `./oauth.js`.
7
7
  *
8
- * Only the three resources backed by the studio API have slots here. The token server's own surface
9
- * — authorize, token, device code, consent — is still TypeScript-derived and has not been converted,
10
- * so the types it uses stay declared in `../oauth-server.ts` rather than moving here.
8
+ * This module also owns the token server's public authorize, token, device-code, consent, and
9
+ * discovery wire contracts. Standard OAuth responses remain extensible so clients can ignore
10
+ * additional response parameters as required by OAuth; Vertesia-specific request and response
11
+ * objects are strict.
11
12
  */
12
13
 
13
14
  export const OAuthClientTypeSchema = z.enum(['public', 'confidential']).meta({ id: 'OAuthClientType' });
@@ -28,6 +29,14 @@ export const OAuthGrantTypeSchema = z
28
29
 
29
30
  export const OAuthResponseTypeSchema = z.literal('code').meta({ id: 'OAuthResponseType' });
30
31
 
32
+ export const OAuthAuthorizationRequestStatusSchema = z
33
+ .enum(['pending', 'denied', 'consumed'])
34
+ .meta({ id: 'OAuthAuthorizationRequestStatus' });
35
+
36
+ export const OAuthClientRegistrationModeSchema = z
37
+ .enum(['registered', 'client_id_metadata_document'])
38
+ .meta({ id: 'OAuthClientRegistrationMode' });
39
+
31
40
  export const OAuthGrantStatusSchema = z.enum(['active', 'revoked', 'expired']).meta({ id: 'OAuthGrantStatus' });
32
41
 
33
42
  export const OAuthGrantSortFieldSchema = z
@@ -36,6 +45,146 @@ export const OAuthGrantSortFieldSchema = z
36
45
 
37
46
  export const OAuthGrantSortOrderSchema = z.enum(['asc', 'desc']).meta({ id: 'OAuthGrantSortOrder' });
38
47
 
48
+ /** RFC 8414 metadata is extensible; parsing keeps the standardized fields and ignores extensions. */
49
+ export const OAuthAuthorizationServerMetadataSchema = z
50
+ .object({
51
+ issuer: z.string(),
52
+ authorization_endpoint: z.string(),
53
+ token_endpoint: z.string(),
54
+ jwks_uri: z.string(),
55
+ registration_endpoint: z.string().optional(),
56
+ revocation_endpoint: z.string().optional(),
57
+ response_types_supported: z.array(z.string()),
58
+ grant_types_supported: z.array(z.string()),
59
+ code_challenge_methods_supported: z.array(z.string()),
60
+ token_endpoint_auth_methods_supported: z.array(z.string()),
61
+ scopes_supported: z.array(z.string()),
62
+ client_id_metadata_document_supported: z.boolean().optional(),
63
+ authorization_response_iss_parameter_supported: z.boolean().optional(),
64
+ device_authorization_endpoint: z.string().optional(),
65
+ })
66
+ .meta({ id: 'OAuthAuthorizationServerMetadata' });
67
+
68
+ export const OAuthClientDisplayMetadataSchema = z
69
+ .strictObject({
70
+ client_uri: z.string().optional(),
71
+ logo_uri: z.string().optional(),
72
+ tos_uri: z.string().optional(),
73
+ policy_uri: z.string().optional(),
74
+ })
75
+ .meta({ id: 'OAuthClientDisplayMetadata' });
76
+
77
+ const oauthAuthorizeQueryFields = {
78
+ response_type: OAuthResponseTypeSchema,
79
+ client_id: z.string(),
80
+ redirect_uri: z.string(),
81
+ resource: z.string().optional(),
82
+ scope: z.string().optional(),
83
+ state: z.string().optional(),
84
+ code_challenge: z.string(),
85
+ code_challenge_method: z.literal('S256'),
86
+ project_id: z.string().optional(),
87
+ };
88
+
89
+ export const OAuthAuthorizeQuerySchema = z.strictObject(oauthAuthorizeQueryFields).meta({ id: 'OAuthAuthorizeQuery' });
90
+
91
+ export const CreateOAuthAuthorizationRequestPayloadSchema = z
92
+ .strictObject(oauthAuthorizeQueryFields)
93
+ .meta({ id: 'CreateOAuthAuthorizationRequestPayload' });
94
+
95
+ export const OAuthAuthorizationRequestSchema = z
96
+ .strictObject({
97
+ request_id: z.string(),
98
+ client_id: z.string(),
99
+ client_name: z.string(),
100
+ client_metadata: OAuthClientDisplayMetadataSchema.optional(),
101
+ client_registration_mode: OAuthClientRegistrationModeSchema.optional(),
102
+ redirect_uri: z.string(),
103
+ redirect_origin: z.string(),
104
+ resource: z.string().optional(),
105
+ requested_scopes: z.array(z.string()),
106
+ optional_scopes: z.array(z.string()).optional(),
107
+ requested_project_id: z.string().optional(),
108
+ project_binding_mode: OAuthProjectBindingModeSchema,
109
+ fixed_project_id: z.string().optional(),
110
+ restrict_to_owner_account: z.boolean().optional().meta({
111
+ description:
112
+ 'When true, consent must be limited to projects in the OAuth client owning account. False allows any project the approving user can access.',
113
+ }),
114
+ owner_account_id: z
115
+ .string()
116
+ .optional()
117
+ .meta({ description: 'Owning account enforced when restrict_to_owner_account is true.' }),
118
+ status: OAuthAuthorizationRequestStatusSchema,
119
+ created_at: z.string(),
120
+ expires_at: z.string(),
121
+ })
122
+ .meta({ id: 'OAuthAuthorizationRequest' });
123
+
124
+ export const ApproveOAuthAuthorizationRequestPayloadSchema = z
125
+ .strictObject({
126
+ project_id: z.string().optional(),
127
+ granted_scopes: z.array(z.string()),
128
+ })
129
+ .meta({ id: 'ApproveOAuthAuthorizationRequestPayload' });
130
+
131
+ export const OAuthGrantableScopesResponseSchema = z
132
+ .strictObject({
133
+ project_id: z.string(),
134
+ requested_permission_scopes: z.array(z.string()),
135
+ grantable_permission_scopes: z.array(z.string()),
136
+ unavailable_permission_scopes: z.array(z.string()),
137
+ })
138
+ .meta({ id: 'OAuthGrantableScopesResponse' });
139
+
140
+ export const OAuthAuthorizationDecisionResponseSchema = z
141
+ .strictObject({
142
+ redirect_url: z.string(),
143
+ })
144
+ .meta({ id: 'OAuthAuthorizationDecisionResponse' });
145
+
146
+ export const OAuthDeviceAuthorizationRequestSchema = z
147
+ .strictObject({
148
+ client_id: z.string(),
149
+ resource: z.string().optional(),
150
+ scope: z.string().optional(),
151
+ project_id: z.string().optional(),
152
+ })
153
+ .meta({ id: 'OAuthDeviceAuthorizationRequest' });
154
+
155
+ /** RFC 8628 responses can gain extension parameters; consumers parse the standardized fields. */
156
+ export const OAuthDeviceAuthorizationResponseSchema = z
157
+ .object({
158
+ device_code: z.string(),
159
+ user_code: z.string(),
160
+ verification_uri: z.string(),
161
+ verification_uri_complete: z.string(),
162
+ expires_in: z.number(),
163
+ interval: z.number(),
164
+ })
165
+ .meta({ id: 'OAuthDeviceAuthorizationResponse' });
166
+
167
+ /** RFC 6749 requires clients to ignore unrecognized token response parameters. */
168
+ export const OAuthTokenResponseSchema = z
169
+ .object({
170
+ access_token: z.string(),
171
+ token_type: z.string().regex(/^bearer$/i),
172
+ expires_in: z.number(),
173
+ scope: z.string().optional(),
174
+ refresh_token: z.string().optional(),
175
+ /**
176
+ * Lifetime in seconds of `refresh_token`, from the moment this response was issued.
177
+ *
178
+ * Not an RFC 6749 parameter — refresh tokens there are opaque and undated — but clients that
179
+ * persist the token need it to report when the stored credential dies. Every refresh token
180
+ * this server returns is newly minted (the refresh grant rotates), so this is always the full
181
+ * lifetime and never a remaining one.
182
+ */
183
+ refresh_token_expires_in: z.number().optional(),
184
+ id_token: z.string().optional(),
185
+ })
186
+ .meta({ id: 'OAuthTokenResponse' });
187
+
39
188
  /**
40
189
  * A client's registration, without its issued id.
41
190
  *