@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
@@ -10,3 +10,16 @@ export const nullableNumberSchema = z
10
10
  .number()
11
11
  .nullable()
12
12
  .meta({ anyOf: undefined, type: ['number', 'null'] });
13
+
14
+ /** Monotonic token for optimistic concurrency on mutable, user-authored resources. */
15
+ export const EditRevisionSchema = z
16
+ .number()
17
+ .int()
18
+ .min(1)
19
+ .meta({ description: 'Monotonic edit revision used to detect concurrent updates.' });
20
+
21
+ /** Revision a caller last observed and expects to replace. */
22
+ export const ExpectedEditRevisionSchema = EditRevisionSchema.optional().meta({
23
+ description:
24
+ 'Edit revision returned by the last read. Stale revisions are rejected with HTTP 409. Omit for legacy last-write-wins behavior.',
25
+ });
@@ -374,6 +374,11 @@ describe('runtime tightenings — recorded as operation 25 of the 1.5 runbook',
374
374
  // carrying an undeclared key there is now rejected at write time.
375
375
  expect(ApiSchemaComponents.InteractionExecutionConfiguration.additionalProperties).toBe(false);
376
376
  expect(validate({ extraction: { config: { model: 'claude-sonnet-4-5' } } }), errors()).toBe(true);
377
+ expect(
378
+ validate({ extraction: { config: { prompt_cache_mode: 'required', prompt_cache_ttl_seconds: 3600 } } }),
379
+ errors(),
380
+ ).toBe(true);
381
+ expect(validate({ extraction: { config: { prompt_cache_ttl_seconds: 59 } } })).toBe(false);
377
382
  expect(validate({ extraction: { config: { temperature: 0.5 } } })).toBe(false);
378
383
  expect(validate({ extraction: { config: { http_timeout: { socketTimeout: 1000 } } } })).toBe(false);
379
384
  });
@@ -430,7 +435,7 @@ describe('the five content-type shapes are composed, not repeated', () => {
430
435
  // Order is contract: it decides the order of the generated clients' constructor arguments and
431
436
  // model fields. The five orders differ because they were derived from five different types.
432
437
  expect(properties('ContentObjectTypeItem')).toEqual(properties('ContentObjectType'));
433
- expect(properties('ContentObjectTypeCatalogEntry').slice(0, 11)).toEqual(properties('InCodeTypeDefinition'));
438
+ expect(properties('ContentObjectTypeCatalogEntry').slice(0, 12)).toEqual(properties('InCodeTypeDefinition'));
434
439
  expect(properties('CreateContentObjectTypePayload')).toEqual([
435
440
  'status',
436
441
  'is_chunkable',
@@ -468,4 +473,28 @@ describe('the five content-type shapes are composed, not repeated', () => {
468
473
  }).valid,
469
474
  ).toBe(true);
470
475
  });
476
+
477
+ it('publishes `title` on the app-contribution shapes and withholds it from the stored ones', () => {
478
+ // An app package contributes a display title alongside the app-local `name`, exactly as
479
+ // `InCodeViewDefinition` and `InCodeProcessDefinition` do. Only the two shapes that carry a
480
+ // contribution get it; a type someone stored through the API has no `title` to publish.
481
+ for (const shape of ['InCodeTypeDefinition', 'ContentObjectTypeCatalogEntry']) {
482
+ expect(property(shape, 'title'), `${shape} should publish title`).toBeDefined();
483
+ }
484
+ for (const shape of ['ContentObjectTypeItem', 'ContentObjectType', 'CreateContentObjectTypePayload']) {
485
+ expect(property(shape, 'title'), `${shape} should not publish title`).toBeUndefined();
486
+ }
487
+ });
488
+
489
+ it('accepts an app-contributed type that carries a title', () => {
490
+ // The regression: deployed app packages send `title`, the shape was strict and did not
491
+ // declare it, so every `GET /projects/:projectId/app-types` failed its own response contract.
492
+ expect(
493
+ validateApiResponse('InCodeTypeDefinition', {
494
+ id: 'invoice',
495
+ name: 'invoice',
496
+ title: 'Invoice',
497
+ }).valid,
498
+ ).toBe(true);
499
+ });
471
500
  });
@@ -1,7 +1,8 @@
1
- import { HttpTimeoutOptionsSchema, ModelOptionsSchema } from '@llumiverse/common/schemas';
1
+ import { HttpTimeoutOptionsSchema, ModelOptionsSchema, PromptCacheModeSchema } from '@llumiverse/common/schemas';
2
2
  import { z } from 'zod';
3
3
  // From the values module, for the reason `./apikey.js` gives.
4
4
  import { ConfigModes, RunDataStorageLevel } from '../interaction-values.js';
5
+ import { EditRevisionSchema, ExpectedEditRevisionSchema } from './schema-primitives.js';
5
6
 
6
7
  /**
7
8
  * Runtime API schemas for the content-intake policy tree.
@@ -87,6 +88,21 @@ export const InteractionExecutionConfigurationSchema = z
87
88
  .string()
88
89
  .optional()
89
90
  .meta({ description: 'Stable provider-side routing key for automatic prompt caching.' }),
91
+ prompt_cache_mode: PromptCacheModeSchema.optional().meta({
92
+ description:
93
+ 'Controls provider-side explicit caching: auto falls back safely, off disables it, and required ' +
94
+ 'surfaces cache preparation failures for diagnostics.',
95
+ }),
96
+ prompt_cache_ttl_seconds: z
97
+ .number()
98
+ .int()
99
+ .min(60)
100
+ .optional()
101
+ .meta({
102
+ description:
103
+ 'Caller-selected explicit cache lifetime in seconds. Defaults remain provider-specific; ' +
104
+ 'Vertex Gemini requires at least 60 seconds.',
105
+ }),
90
106
  prompt_cache_schema_suffix: z
91
107
  .boolean()
92
108
  .optional()
@@ -396,7 +412,10 @@ export const ColumnLayoutSchema = z
396
412
  'The type of the field specifies how the rendering will be done. If not specified the string type will be used. The type may contain additional parameters prepended using a web-like query string syntax: date?LLL',
397
413
  })
398
414
  .optional(),
399
- fallback: z.string().optional(),
415
+ fallback: z
416
+ .string()
417
+ .meta({ description: 'Path of an alternate field to display when the primary field is absent' })
418
+ .optional(),
400
419
  default: z
401
420
  .unknown()
402
421
  .meta({ description: 'A default value to be used if the field is not present in the object' })
@@ -442,17 +461,22 @@ const contentTypeFields = {
442
461
  .looseObject({})
443
462
  .meta({
444
463
  description:
445
- 'this is only included in ContentObjectTypeItem if explicitly requested It is always included in ContentObjectType',
464
+ 'JSON Schema for the structured properties extracted into documents of this type. ' +
465
+ 'Only included in ContentObjectTypeItem if explicitly requested; always included in ContentObjectType.',
446
466
  })
447
467
  .optional(),
448
468
  table_layout: z
449
469
  .array(ColumnLayoutSchema)
450
470
  .meta({
451
471
  description:
452
- 'This is only included in ContentObjectTypeItem if explicitly requested It is always included in ContentObjectType',
472
+ 'Column layout used when listing documents of this type. ' +
473
+ 'Only included in ContentObjectTypeItem if explicitly requested; always included in ContentObjectType.',
453
474
  })
454
475
  .optional(),
455
- is_chunkable: z.boolean().optional(),
476
+ is_chunkable: z
477
+ .boolean()
478
+ .meta({ description: 'Whether documents of this type can be split into chunks' })
479
+ .optional(),
456
480
  strict_mode: z
457
481
  .boolean()
458
482
  .meta({
@@ -463,6 +487,23 @@ const contentTypeFields = {
463
487
  status: ContentObjectTypeStatusSchema.optional(),
464
488
  intake: ContentTypeIntakePolicySchema.optional(),
465
489
  editing: ContentTypeEditingPolicySchema.optional(),
490
+ /**
491
+ * Display title, as every OTHER app-contribution shape already publishes it:
492
+ * `InCodeViewDefinition`, `InCodeProcessDefinition` and `AppDashboardDefinition` all pair the
493
+ * app-local `name` used for lookup with an optional human-readable `title`. A contributed type
494
+ * was the one shape missing it, so deployed app packages sent `title` into a `strictObject` that
495
+ * forbade it and `GET /projects/:projectId/app-types` and `GET /types/catalog` failed their own
496
+ * response contract on every call.
497
+ *
498
+ * Appended last on purpose: property order decides the generated clients' constructor argument
499
+ * order, so a new field goes on the end rather than next to `name` where it reads better.
500
+ *
501
+ * Note this key reaches only the two shapes that spread the whole dictionary —
502
+ * `InCodeTypeDefinition` and `ContentObjectTypeCatalogEntry`, the two that carry app
503
+ * contributions. The stored shapes and the create payload list their keys explicitly, so a
504
+ * stored type still has no `title`.
505
+ */
506
+ title: z.string().meta({ description: 'Display title. Defaults to `name` or `id`.' }).optional(),
466
507
  };
467
508
 
468
509
  /**
@@ -492,6 +533,9 @@ export const ContentObjectTypeCatalogEntrySchema = z
492
533
  .strictObject({
493
534
  ...contentTypeFields,
494
535
  ...catalogAuditFields,
536
+ edit_revision: EditRevisionSchema.optional().meta({
537
+ description: 'Stored-resource revision. Omitted for app-contributed in-code types.',
538
+ }),
495
539
  })
496
540
  .meta({ id: 'ContentObjectTypeCatalogEntry' });
497
541
 
@@ -509,6 +553,7 @@ export const ContentObjectTypeCatalogEntryArraySchema = z
509
553
  */
510
554
  const storedContentTypeShape = {
511
555
  id: contentTypeFields.id,
556
+ edit_revision: EditRevisionSchema,
512
557
  name: contentTypeFields.name,
513
558
  description: contentTypeFields.description,
514
559
  tags: contentTypeFields.tags,
@@ -564,12 +609,14 @@ export const CreateContentObjectTypePayloadSchema = z
564
609
  * the fields it changes, which is what `.partial()` says and what the handler has always done. The
565
610
  * property order is the create payload's, so the generated clients' argument order does not move.
566
611
  */
567
- export const UpdateContentObjectTypePayloadSchema = CreateContentObjectTypePayloadSchema.partial().meta({
568
- id: 'UpdateContentObjectTypePayload',
569
- description:
570
- 'Fields to change on a content object type. Every field is optional — only the ones present ' +
571
- 'are written, and the rest are left as they are.',
572
- });
612
+ export const UpdateContentObjectTypePayloadSchema = CreateContentObjectTypePayloadSchema.partial()
613
+ .extend({ expected_edit_revision: ExpectedEditRevisionSchema })
614
+ .meta({
615
+ id: 'UpdateContentObjectTypePayload',
616
+ description:
617
+ 'Fields to change on a content object type. Only fields present are written; ' +
618
+ 'expected_edit_revision prevents overwriting a concurrent edit.',
619
+ });
573
620
 
574
621
  export const ContentObjectTypeSchema = z.strictObject(storedContentTypeShape).meta({ id: 'ContentObjectType' });
575
622
 
@@ -1,4 +1,6 @@
1
+ import { JSONSchemaSchema } from '@llumiverse/common/schemas';
1
2
  import { z } from 'zod';
3
+ import { AgentToolApprovalClassSchema } from './app-lifecycle.js';
2
4
  import { MCPToolAnnotationsSchema } from './apps.js';
3
5
 
4
6
  // The unified project-scoped tool registry as `GET /tools` and `POST /tools/validate` publish it.
@@ -13,6 +15,30 @@ export const ToolSourceSchema = z.enum(['builtin', 'app', 'interaction']).meta({
13
15
  'Origin of a tool in the unified project-scoped tool registry.\n\n- `builtin`: anything statically registered on the worker — workflow builtins, studio agent tools, and sys skills\n- `app`: tools contributed by an installed app for the project\n- `interaction`: a project interaction exposed via `tag=tool` / `is_tool=true` / `is_skill=true`\n\nSkill semantics (the tool unlocks others when invoked) are NOT part of the source. They are identified universally by the `learn_` prefix in the tool name. This matches how the runtime registry stores them and avoids splitting one logical origin into two sources.',
14
16
  });
15
17
 
18
+ export const ToolRuntimeContextSchema = z.enum(['conversation', 'process']).meta({
19
+ id: 'ToolRuntimeContext',
20
+ description: 'The runtime context in which a caller intends to use a tool.',
21
+ });
22
+
23
+ export const ProcessToolCompatibilityReasonSchema = z
24
+ .enum([
25
+ 'skill_not_supported',
26
+ 'interaction_not_supported',
27
+ 'agent_not_supported',
28
+ 'confirmation_not_supported',
29
+ 'control_tool_not_supported',
30
+ 'approval_metadata_unavailable',
31
+ 'ambiguous_name',
32
+ ])
33
+ .meta({ id: 'ProcessToolCompatibilityReason' });
34
+
35
+ export const ProcessToolCompatibilitySchema = z
36
+ .strictObject({
37
+ compatible: z.boolean(),
38
+ reason: ProcessToolCompatibilityReasonSchema.optional(),
39
+ })
40
+ .meta({ id: 'ProcessToolCompatibility' });
41
+
16
42
  export const ValidateToolNamesPayloadSchema = z
17
43
  .strictObject({
18
44
  names: z.array(z.string()).meta({
@@ -76,6 +102,8 @@ export const AggregatedToolSchema = z
76
102
  })
77
103
  .optional(),
78
104
  annotations: MCPToolAnnotationsSchema.optional(),
105
+ approval_class: AgentToolApprovalClassSchema.optional(),
106
+ process_compatibility: ProcessToolCompatibilitySchema.optional(),
79
107
  unlocked_tools: z
80
108
  .array(z.string())
81
109
  .meta({ description: 'For skills (`learn_*`): tool names this skill unlocks when invoked.' })
@@ -126,6 +154,39 @@ export const ValidateToolNamesResponseSchema = z
126
154
 
127
155
  export const AggregatedToolArraySchema = z.array(AggregatedToolSchema).meta({ id: 'AggregatedToolArray' });
128
156
 
157
+ export const InspectProjectToolQuerySchema = z
158
+ .strictObject({ context: ToolRuntimeContextSchema.optional() })
159
+ .meta({ id: 'InspectProjectToolQuery' });
160
+
161
+ export const ToolInspectionSchema = z
162
+ .strictObject({
163
+ name: z.string(),
164
+ source: ToolSourceSchema,
165
+ description: z.string().optional(),
166
+ title: z.string().optional(),
167
+ input_schema: JSONSchemaSchema.optional().meta({
168
+ description: 'Exact input schema when the provider supplied one. Omitted rather than fabricated.',
169
+ }),
170
+ output_schema: JSONSchemaSchema.optional().meta({
171
+ description:
172
+ 'MCP outputSchema advertised by the provider. It does not describe the process node result transport.',
173
+ }),
174
+ output_contract_status: z
175
+ .enum(['provider_supplied', 'unknown'])
176
+ .meta({
177
+ description:
178
+ 'For app tools, whether the provider advertised output schema metadata. Omitted for builtin and interaction tools.',
179
+ })
180
+ .optional(),
181
+ approval_class: AgentToolApprovalClassSchema.optional(),
182
+ annotations: MCPToolAnnotationsSchema.optional(),
183
+ app_install_id: z.string().optional(),
184
+ app_name: z.string().optional(),
185
+ ready: z.boolean().meta({ description: 'True only when an exact input schema was resolved.' }),
186
+ process_compatibility: ProcessToolCompatibilitySchema.optional(),
187
+ })
188
+ .meta({ id: 'ToolInspection' });
189
+
129
190
  // Query contracts are registry components even though the scanner expands them into parameters.
130
191
  export const ListProjectToolsQuerySchema = z
131
192
  .strictObject({
@@ -136,5 +197,6 @@ export const ListProjectToolsQuerySchema = z
136
197
  description: 'Drop these sources from the result (and skip their fetch). Applied after `sources`.',
137
198
  })
138
199
  .optional(),
200
+ context: ToolRuntimeContextSchema.optional(),
139
201
  })
140
202
  .meta({ id: 'ListProjectToolsQuery' });
@@ -4,6 +4,7 @@ import { z } from 'zod';
4
4
  import type { ViewNavigationNode } from '../views.js';
5
5
  import { ContentObjectItemApiResponseSchema } from './content.js';
6
6
  import { StringArrayMapSchema } from './dashboard.js';
7
+ import { StringValueMapSchema } from './files.js';
7
8
  import * as ViewSchemas from './views.js';
8
9
 
9
10
  const ViewSearchFieldDefinitionSchema = ViewSchemas.ViewSearchFieldDefinitionSchema;
@@ -49,6 +50,9 @@ export const ExecuteViewRequestSchema = z
49
50
  query: z.string().optional(),
50
51
  key_terms: StringArrayMapSchema.optional(),
51
52
  navigation: StringArrayMapSchema.optional(),
53
+ navigation_queries: StringValueMapSchema.meta({
54
+ description: 'Server-side text filters for large navigation sources, keyed by navigation id.',
55
+ }).optional(),
52
56
  display: z.string().optional(),
53
57
  sort: z.string().optional(),
54
58
  offset: z.number().optional(),
@@ -65,9 +69,13 @@ export const ViewNavigationResultSchema = z
65
69
  id: z.string(),
66
70
  selected: z.array(z.string()),
67
71
  nodes: z.array(ViewNavigationNodeSchema),
72
+ query: z
73
+ .string()
74
+ .meta({ description: 'Applied server-side node filter, when the navigation source supports it.' })
75
+ .optional(),
68
76
  breadcrumbs: z
69
77
  .array(ViewNavigationNodeSchema)
70
- .meta({ description: 'Selected hierarchy path from its root through the current value.' })
78
+ .meta({ description: 'Selected drill-down path from its root through the current value.' })
71
79
  .optional(),
72
80
  truncated: z.boolean().optional(),
73
81
  })
@@ -87,6 +95,20 @@ export const ViewExecutionQueryPlanSchema = z
87
95
  'Safe query-planning diagnostics. The query contains only the model-authored subtree; server-owned scope and content-security filters are never exposed.',
88
96
  });
89
97
 
98
+ export const ViewRerankFailureCodeSchema = z
99
+ .enum(['interaction_failed', 'invalid_output', 'timeout', 'unknown'])
100
+ .meta({ id: 'ViewRerankFailureCode' });
101
+
102
+ export const ViewExecutionRerankResultSchema = z
103
+ .strictObject({
104
+ status: z.enum(['applied', 'fallback', 'skipped']),
105
+ candidate_count: z.number(),
106
+ skip_reason: z.enum(['not_enough_candidates', 'query_fallback', 'explicit_sort', 'configured_sort']).optional(),
107
+ error_code: ViewRerankFailureCodeSchema.optional(),
108
+ error_message: z.string().optional(),
109
+ })
110
+ .meta({ id: 'ViewExecutionRerankResult' });
111
+
90
112
  export const ViewExecutionSearchConfigurationSchema = z
91
113
  .strictObject({
92
114
  renderer: z.string().optional(),
@@ -116,8 +138,9 @@ export const ViewExecutionSearchResultSchema = z
116
138
  interpretation: z.string().optional(),
117
139
  key_terms: StringArrayMapSchema.optional(),
118
140
  plan: ViewExecutionQueryPlanSchema.optional(),
141
+ rerank: ViewExecutionRerankResultSchema.optional(),
119
142
  requested_mode: z.enum(['browse', 'deterministic', 'agentic']),
120
- applied_mode: z.enum(['browse', 'deterministic', 'query']),
143
+ applied_mode: z.enum(['browse', 'deterministic', 'query', 'query_and_view']),
121
144
  fallback_reason: z.string().optional(),
122
145
  warnings: z.array(ViewExecutionWarningSchema),
123
146
  })
@@ -185,6 +208,9 @@ export const PreviewViewExperienceRequestSchema = z
185
208
  query: z.string().optional(),
186
209
  key_terms: StringArrayMapSchema.optional(),
187
210
  navigation: StringArrayMapSchema.optional(),
211
+ navigation_queries: StringValueMapSchema.meta({
212
+ description: 'Server-side text filters for large navigation sources, keyed by navigation id.',
213
+ }).optional(),
188
214
  display: z.string().optional(),
189
215
  sort: z.string().optional(),
190
216
  offset: z.number().optional(),
@@ -0,0 +1,119 @@
1
+ import { assertType, describe, expect, it } from 'vitest';
2
+ import type { z } from 'zod';
3
+ import { type ViewExperienceConfiguration, viewExperienceRoute } from '../views.js';
4
+ import { ApiSchemaComponents, validateApiRequest, validateApiResponse } from './registry.js';
5
+ import type { ViewExperienceConfigurationSchema } from './view-execution.js';
6
+
7
+ type Equals<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
8
+
9
+ /**
10
+ * Lives here rather than next to the JSON Schema artifact that consumes it. Both subjects are
11
+ * declarations of THIS package — the public TypeScript type and the Zod schema it must mirror — and
12
+ * asserting it from the consuming package would have made that package depend on Zod, which it must
13
+ * not: it is loaded in the browser.
14
+ */
15
+ describe('ViewExperienceConfiguration', () => {
16
+ it('keeps the temporary named TypeScript bridge identical to the runtime schema', () => {
17
+ assertType<Equals<ViewExperienceConfiguration, z.infer<typeof ViewExperienceConfigurationSchema>>>(true);
18
+ });
19
+
20
+ it('publishes selection, app actions, upload drops, generated presentation mode, and reranking', () => {
21
+ expect(Object.keys(ApiSchemaComponents)).toEqual(
22
+ expect.arrayContaining([
23
+ 'AgenticViewRerankConfiguration',
24
+ 'ViewActionConfiguration',
25
+ 'ViewActionsConfiguration',
26
+ 'ViewDropConfiguration',
27
+ 'ViewExecutionRerankResult',
28
+ 'ViewSelectionConfiguration',
29
+ ]),
30
+ );
31
+
32
+ expect(
33
+ validateApiRequest('PreviewViewExperienceRequest', {
34
+ configuration: {
35
+ name: 'Orders',
36
+ search: {
37
+ mode: 'agentic',
38
+ agentic: {
39
+ mode: 'query_and_view',
40
+ rerank: { max_candidates: 24, include_why_match: true, timeout_ms: 30_000 },
41
+ },
42
+ },
43
+ results: {
44
+ default_display: 'table',
45
+ displays: [{ id: 'table', label: 'Orders', type: 'table', columns: [] }],
46
+ selection: { mode: 'multiple', select_all: 'page' },
47
+ actions: {
48
+ include_defaults: true,
49
+ items: [{ id: 'approve', label: 'Approve', handler: 'approve-orders' }],
50
+ },
51
+ drop: { handler: 'upload', accept: ['files'], params: { type_id: 'sales-order' } },
52
+ },
53
+ },
54
+ }).valid,
55
+ ).toBe(true);
56
+ });
57
+
58
+ it('keeps executable custom drop handlers out of the persisted wire contract', () => {
59
+ expect(
60
+ validateApiRequest('PreviewViewExperienceRequest', {
61
+ configuration: {
62
+ name: 'Orders',
63
+ results: {
64
+ default_display: 'table',
65
+ displays: [{ id: 'table', label: 'Orders', type: 'table', columns: [] }],
66
+ drop: { handler: 'custom-drop' },
67
+ },
68
+ },
69
+ }).valid,
70
+ ).toBe(false);
71
+ });
72
+
73
+ it('accepts View model options that name no driver, while the shared config still requires one', () => {
74
+ // The regression: a View's `model_options` are authored in the editor and saved before any
75
+ // driver is resolved, so they carry no `_option_id`. Validating them against the
76
+ // `ModelOptions` driver union — every branch of which requires that discriminator — meant a
77
+ // stored View could not satisfy its own response schema, and `GET /views` logged a contract
78
+ // violation on every call.
79
+ const authored = { model_options: { temperature: 0.2, max_tokens: 1024 } };
80
+ expect(validateApiResponse('ViewAgenticExecutionConfiguration', authored).valid).toBe(true);
81
+
82
+ // The split is the point: agent runs, events and workflow runs record options a driver
83
+ // already resolved, so the shared component keeps the union. Asserted on the published
84
+ // schema because `InteractionExecutionConfiguration` is not itself a response slot — if it
85
+ // ever stops pointing at `ModelOptions`, the relaxation leaked out of Views.
86
+ const modelOptions = (name: string) =>
87
+ (ApiSchemaComponents[name] as { properties: Record<string, unknown> }).properties.model_options;
88
+ expect(modelOptions('InteractionExecutionConfiguration')).toEqual({
89
+ $ref: '#/components/schemas/ModelOptions',
90
+ });
91
+ expect(modelOptions('ViewAgenticExecutionConfiguration')).toMatchObject({
92
+ type: 'object',
93
+ additionalProperties: true,
94
+ });
95
+ });
96
+
97
+ it('keeps the View config otherwise identical to the shared execution configuration', () => {
98
+ // Only `model_options` may differ. Anything else diverging means the two drifted apart
99
+ // rather than the union being deliberately relaxed for authored options.
100
+ const properties = (name: string) =>
101
+ (ApiSchemaComponents[name] as { properties: Record<string, unknown> }).properties;
102
+ const view = properties('ViewAgenticExecutionConfiguration');
103
+ const shared = properties('InteractionExecutionConfiguration');
104
+
105
+ expect(Object.keys(view)).toEqual(Object.keys(shared));
106
+ for (const key of Object.keys(shared)) {
107
+ if (key === 'model_options') continue;
108
+ expect(JSON.stringify(view[key]), `${key} drifted from the shared configuration`).toBe(
109
+ JSON.stringify(shared[key]),
110
+ );
111
+ }
112
+ });
113
+
114
+ it('builds generic routes for system and app-contributed Views without exposing path material', () => {
115
+ expect(viewExperienceRoute('app:content:document-library')).toBe('/view/app%3Acontent%3Adocument-library');
116
+ expect(viewExperienceRoute('sys:AgenticDocumentExplorer')).toBe('/view/sys%3AAgenticDocumentExplorer');
117
+ expect(viewExperienceRoute('unsafe/id')).toBe('/view/unsafe%2Fid');
118
+ });
119
+ });
@@ -1,5 +1,14 @@
1
+ import { JSONObjectSchema } from '@llumiverse/common/schemas';
1
2
  import { z } from 'zod';
2
- import { VIEW_EXPERIENCE_SCHEMA_VERSION, VIEW_RESULT_FIELD_FORMATS, VIEW_SEARCH_FIELD_TYPES } from '../views.js';
3
+ import {
4
+ VIEW_ACTION_PLACEMENTS,
5
+ VIEW_ACTION_SELECTION_REQUIREMENTS,
6
+ VIEW_AGENTIC_SEARCH_MODES,
7
+ VIEW_EXPERIENCE_SCHEMA_VERSION,
8
+ VIEW_RESULT_FIELD_FORMATS,
9
+ VIEW_SEARCH_FIELD_TYPES,
10
+ VIEW_SELECTION_MODES,
11
+ } from '../views.js';
3
12
  import { InteractionExecutionConfigurationSchema } from './store.js';
4
13
 
5
14
  // The view experiences a project publishes: the search, navigation, results and display
@@ -54,17 +63,68 @@ export const ViewTableColumnSchema = z
54
63
  })
55
64
  .meta({ id: 'ViewTableColumn' });
56
65
 
66
+ export const ViewAgenticSearchModeSchema = z.enum(VIEW_AGENTIC_SEARCH_MODES).meta({ id: 'ViewAgenticSearchMode' });
67
+
68
+ export const AgenticViewRerankConfigurationSchema = z
69
+ .strictObject({
70
+ interaction: z
71
+ .string()
72
+ .meta({
73
+ description: 'Interaction used only for candidate reranking. Defaults to sys:ContentSearchReranker.',
74
+ })
75
+ .optional(),
76
+ max_candidates: z
77
+ .number()
78
+ .meta({ description: 'Maximum candidates from the current result page sent to the model.' })
79
+ .optional(),
80
+ include_why_match: z
81
+ .boolean()
82
+ .meta({ description: 'Ask the model for a short per-result explanation. Defaults to true.' })
83
+ .optional(),
84
+ timeout_ms: z.number().meta({ description: 'Reranking-stage timeout.' }).optional(),
85
+ })
86
+ .meta({ id: 'AgenticViewRerankConfiguration' });
87
+
88
+ /**
89
+ * The model configuration a View stores for its agentic search.
90
+ *
91
+ * Identical to `InteractionExecutionConfiguration` apart from `model_options`, which is an open
92
+ * object here rather than the `ModelOptions` driver union. A View's options are authored in the view
93
+ * editor and saved before any driver is chosen, so they carry no `_option_id`; every branch of the
94
+ * union requires one, so a stored View could not satisfy it and `GET /views` failed its own response
95
+ * contract on every call.
96
+ *
97
+ * Only the View usage changes. The shared component keeps the strict union because agent runs,
98
+ * events and workflow runs record options a driver already resolved, and those are in production.
99
+ */
100
+ export const ViewAgenticExecutionConfigurationSchema = InteractionExecutionConfigurationSchema.extend({
101
+ model_options: z
102
+ .looseObject({})
103
+ .meta({
104
+ description:
105
+ 'Model options as authored for this View. Open rather than the driver-discriminated ' +
106
+ '`ModelOptions` union, because a View is saved before a driver is resolved.',
107
+ })
108
+ .optional(),
109
+ }).meta({ id: 'ViewAgenticExecutionConfiguration' });
110
+
57
111
  export const AgenticViewSearchConfigurationSchema = z
58
112
  .strictObject({
59
113
  interaction: z.string().optional(),
60
- config: InteractionExecutionConfigurationSchema.optional(),
114
+ config: ViewAgenticExecutionConfigurationSchema.optional(),
61
115
  instructions: z
62
116
  .string()
63
117
  .meta({ description: 'View-specific guidance for Elasticsearch query planning.' })
64
118
  .optional(),
65
- mode: z.literal('query').optional(),
119
+ mode: ViewAgenticSearchModeSchema.meta({
120
+ description: 'Generate only Elasticsearch DSL, or generate DSL plus a safe ephemeral result presentation.',
121
+ }).optional(),
66
122
  timeout_ms: z.number().optional(),
67
123
  minimum_confidence: z.number().optional(),
124
+ rerank: AgenticViewRerankConfigurationSchema.meta({
125
+ description:
126
+ 'Optional second stage that reorders an authorized candidate page using the same model configuration.',
127
+ }).optional(),
68
128
  })
69
129
  .meta({ id: 'AgenticViewSearchConfiguration' });
70
130
 
@@ -357,6 +417,82 @@ export const ViewDisplayConfigurationSchema = z
357
417
  ])
358
418
  .meta({ id: 'ViewDisplayConfiguration', type: 'object' });
359
419
 
420
+ export const ViewSelectionModeSchema = z.enum(VIEW_SELECTION_MODES).meta({ id: 'ViewSelectionMode' });
421
+
422
+ export const ViewSelectionConfigurationSchema = z
423
+ .strictObject({
424
+ mode: ViewSelectionModeSchema,
425
+ select_all: z
426
+ .literal('page')
427
+ .meta({ description: 'Select-all applies to the currently rendered page.' })
428
+ .optional(),
429
+ })
430
+ .meta({
431
+ id: 'ViewSelectionConfiguration',
432
+ description: 'Client-side selection behavior for normalized View hits.',
433
+ });
434
+
435
+ export const ViewActionPlacementSchema = z.enum(VIEW_ACTION_PLACEMENTS).meta({ id: 'ViewActionPlacement' });
436
+
437
+ export const ViewActionSelectionRequirementSchema = z
438
+ .enum(VIEW_ACTION_SELECTION_REQUIREMENTS)
439
+ .meta({ id: 'ViewActionSelectionRequirement' });
440
+
441
+ export const ViewActionConfigurationSchema = z
442
+ .strictObject({
443
+ id: z.string(),
444
+ label: z.string(),
445
+ handler: z.string(),
446
+ placement: ViewActionPlacementSchema.optional(),
447
+ requires_selection: ViewActionSelectionRequirementSchema.optional(),
448
+ destructive: z.boolean().optional(),
449
+ confirm: z.boolean().optional(),
450
+ params: JSONObjectSchema.optional(),
451
+ })
452
+ .meta({
453
+ id: 'ViewActionConfiguration',
454
+ description:
455
+ 'Declarative action exposed by a View. The handler name is resolved by the embedding application; persisted configuration never contains executable code.',
456
+ });
457
+
458
+ export const ViewActionsConfigurationSchema = z
459
+ .strictObject({
460
+ include_defaults: z
461
+ .boolean()
462
+ .meta({
463
+ description:
464
+ 'Include the standard content export and delete actions. Defaults to true when selection is enabled.',
465
+ })
466
+ .optional(),
467
+ exclude_defaults: z
468
+ .array(z.enum(['export', 'delete']))
469
+ .meta({ description: 'Hide individual standard actions while keeping the remaining defaults.' })
470
+ .optional(),
471
+ items: z.array(ViewActionConfigurationSchema).optional(),
472
+ })
473
+ .meta({ id: 'ViewActionsConfiguration' });
474
+
475
+ export const ViewUploadDropParametersSchema = z
476
+ .strictObject({
477
+ type_id: z.string().optional(),
478
+ collection_id: z.string().optional(),
479
+ location: z.string().optional(),
480
+ properties: JSONObjectSchema.optional(),
481
+ allow_folders: z.boolean().optional(),
482
+ })
483
+ .meta({ id: 'ViewUploadDropParameters' });
484
+
485
+ export const ViewDropConfigurationSchema = z
486
+ .strictObject({
487
+ handler: z.literal('upload'),
488
+ accept: z.array(z.literal('files')).optional(),
489
+ params: ViewUploadDropParametersSchema.optional(),
490
+ })
491
+ .meta({
492
+ id: 'ViewDropConfiguration',
493
+ description: 'A declarative result-area drop target. Stored JSON supports the built-in upload action only.',
494
+ });
495
+
360
496
  export const ViewResultsConfigurationSchema = z
361
497
  .strictObject({
362
498
  default_display: z.string(),
@@ -364,6 +500,9 @@ export const ViewResultsConfigurationSchema = z
364
500
  displays: z.array(ViewDisplayConfigurationSchema),
365
501
  default_sort: z.string().optional(),
366
502
  sort_options: z.array(ViewSortOptionSchema).optional(),
503
+ selection: ViewSelectionConfigurationSchema.optional(),
504
+ actions: ViewActionsConfigurationSchema.optional(),
505
+ drop: ViewDropConfigurationSchema.optional(),
367
506
  })
368
507
  .meta({ id: 'ViewResultsConfiguration' });
369
508