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

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 (521) hide show
  1. package/lib/access-control-values.d.ts +98 -0
  2. package/lib/access-control-values.d.ts.map +1 -0
  3. package/lib/access-control-values.js +101 -0
  4. package/lib/access-control-values.js.map +1 -0
  5. package/lib/access-control.d.ts +22 -119
  6. package/lib/access-control.d.ts.map +1 -1
  7. package/lib/access-control.js +6 -78
  8. package/lib/access-control.js.map +1 -1
  9. package/lib/account-values.d.ts +53 -0
  10. package/lib/account-values.d.ts.map +1 -0
  11. package/lib/account-values.js +91 -0
  12. package/lib/account-values.js.map +1 -0
  13. package/lib/analytics.d.ts +12 -38
  14. package/lib/analytics.d.ts.map +1 -1
  15. package/lib/api-schemas/access-control.d.ts +215 -0
  16. package/lib/api-schemas/access-control.d.ts.map +1 -0
  17. package/lib/api-schemas/access-control.js +165 -0
  18. package/lib/api-schemas/access-control.js.map +1 -0
  19. package/lib/api-schemas/account.d.ts +101 -0
  20. package/lib/api-schemas/account.d.ts.map +1 -0
  21. package/lib/api-schemas/account.js +136 -0
  22. package/lib/api-schemas/account.js.map +1 -0
  23. package/lib/api-schemas/adapter.d.ts +80 -0
  24. package/lib/api-schemas/adapter.d.ts.map +1 -0
  25. package/lib/api-schemas/adapter.js +726 -0
  26. package/lib/api-schemas/adapter.js.map +1 -0
  27. package/lib/api-schemas/agent-runs.d.ts +3781 -0
  28. package/lib/api-schemas/agent-runs.d.ts.map +1 -0
  29. package/lib/api-schemas/agent-runs.js +991 -0
  30. package/lib/api-schemas/agent-runs.js.map +1 -0
  31. package/lib/api-schemas/analytics.d.ts +86 -0
  32. package/lib/api-schemas/analytics.d.ts.map +1 -0
  33. package/lib/api-schemas/analytics.js +58 -0
  34. package/lib/api-schemas/analytics.js.map +1 -0
  35. package/lib/api-schemas/apikey.d.ts +231 -0
  36. package/lib/api-schemas/apikey.d.ts.map +1 -0
  37. package/lib/api-schemas/apikey.js +172 -0
  38. package/lib/api-schemas/apikey.js.map +1 -0
  39. package/lib/api-schemas/app-lifecycle.d.ts +1114 -0
  40. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -0
  41. package/lib/api-schemas/app-lifecycle.js +750 -0
  42. package/lib/api-schemas/app-lifecycle.js.map +1 -0
  43. package/lib/api-schemas/app-runtime.d.ts +9056 -0
  44. package/lib/api-schemas/app-runtime.d.ts.map +1 -0
  45. package/lib/api-schemas/app-runtime.js +782 -0
  46. package/lib/api-schemas/app-runtime.js.map +1 -0
  47. package/lib/api-schemas/apps.d.ts +247 -0
  48. package/lib/api-schemas/apps.d.ts.map +1 -0
  49. package/lib/api-schemas/apps.js +366 -0
  50. package/lib/api-schemas/apps.js.map +1 -0
  51. package/lib/api-schemas/audit-trail.d.ts +465 -0
  52. package/lib/api-schemas/audit-trail.d.ts.map +1 -0
  53. package/lib/api-schemas/audit-trail.js +218 -0
  54. package/lib/api-schemas/audit-trail.js.map +1 -0
  55. package/lib/api-schemas/bulk-operation.d.ts +104 -0
  56. package/lib/api-schemas/bulk-operation.d.ts.map +1 -0
  57. package/lib/api-schemas/bulk-operation.js +66 -0
  58. package/lib/api-schemas/bulk-operation.js.map +1 -0
  59. package/lib/api-schemas/commands.d.ts +50 -0
  60. package/lib/api-schemas/commands.d.ts.map +1 -0
  61. package/lib/api-schemas/commands.js +58 -0
  62. package/lib/api-schemas/commands.js.map +1 -0
  63. package/lib/api-schemas/content.d.ts +3561 -0
  64. package/lib/api-schemas/content.d.ts.map +1 -0
  65. package/lib/api-schemas/content.js +842 -0
  66. package/lib/api-schemas/content.js.map +1 -0
  67. package/lib/api-schemas/cost-analytics.d.ts +300 -0
  68. package/lib/api-schemas/cost-analytics.d.ts.map +1 -0
  69. package/lib/api-schemas/cost-analytics.js +218 -0
  70. package/lib/api-schemas/cost-analytics.js.map +1 -0
  71. package/lib/api-schemas/dashboard.d.ts +408 -0
  72. package/lib/api-schemas/dashboard.d.ts.map +1 -0
  73. package/lib/api-schemas/dashboard.js +311 -0
  74. package/lib/api-schemas/dashboard.js.map +1 -0
  75. package/lib/api-schemas/data-store.d.ts +1650 -0
  76. package/lib/api-schemas/data-store.d.ts.map +1 -0
  77. package/lib/api-schemas/data-store.js +504 -0
  78. package/lib/api-schemas/data-store.js.map +1 -0
  79. package/lib/api-schemas/document-processing.d.ts +1501 -0
  80. package/lib/api-schemas/document-processing.d.ts.map +1 -0
  81. package/lib/api-schemas/document-processing.js +312 -0
  82. package/lib/api-schemas/document-processing.js.map +1 -0
  83. package/lib/api-schemas/embeddings.d.ts +184 -0
  84. package/lib/api-schemas/embeddings.d.ts.map +1 -0
  85. package/lib/api-schemas/embeddings.js +102 -0
  86. package/lib/api-schemas/embeddings.js.map +1 -0
  87. package/lib/api-schemas/environment.d.ts +412 -0
  88. package/lib/api-schemas/environment.d.ts.map +1 -0
  89. package/lib/api-schemas/environment.js +170 -0
  90. package/lib/api-schemas/environment.js.map +1 -0
  91. package/lib/api-schemas/events.d.ts +4880 -0
  92. package/lib/api-schemas/events.d.ts.map +1 -0
  93. package/lib/api-schemas/events.js +832 -0
  94. package/lib/api-schemas/events.js.map +1 -0
  95. package/lib/api-schemas/files.d.ts +107 -0
  96. package/lib/api-schemas/files.d.ts.map +1 -0
  97. package/lib/api-schemas/files.js +137 -0
  98. package/lib/api-schemas/files.js.map +1 -0
  99. package/lib/api-schemas/group.d.ts +122 -0
  100. package/lib/api-schemas/group.d.ts.map +1 -0
  101. package/lib/api-schemas/group.js +142 -0
  102. package/lib/api-schemas/group.js.map +1 -0
  103. package/lib/api-schemas/index.d.ts +36 -0
  104. package/lib/api-schemas/index.d.ts.map +1 -0
  105. package/lib/api-schemas/index.js +36 -0
  106. package/lib/api-schemas/index.js.map +1 -0
  107. package/lib/api-schemas/indexing.d.ts +144 -0
  108. package/lib/api-schemas/indexing.d.ts.map +1 -0
  109. package/lib/api-schemas/indexing.js +217 -0
  110. package/lib/api-schemas/indexing.js.map +1 -0
  111. package/lib/api-schemas/integrations.d.ts +269 -0
  112. package/lib/api-schemas/integrations.d.ts.map +1 -0
  113. package/lib/api-schemas/integrations.js +335 -0
  114. package/lib/api-schemas/integrations.js.map +1 -0
  115. package/lib/api-schemas/interaction.d.ts +22454 -0
  116. package/lib/api-schemas/interaction.d.ts.map +1 -0
  117. package/lib/api-schemas/interaction.js +2065 -0
  118. package/lib/api-schemas/interaction.js.map +1 -0
  119. package/lib/api-schemas/invites.d.ts +162 -0
  120. package/lib/api-schemas/invites.d.ts.map +1 -0
  121. package/lib/api-schemas/invites.js +106 -0
  122. package/lib/api-schemas/invites.js.map +1 -0
  123. package/lib/api-schemas/oauth-server.d.ts +415 -0
  124. package/lib/api-schemas/oauth-server.d.ts.map +1 -0
  125. package/lib/api-schemas/oauth-server.js +193 -0
  126. package/lib/api-schemas/oauth-server.js.map +1 -0
  127. package/lib/api-schemas/oauth.d.ts +150 -0
  128. package/lib/api-schemas/oauth.d.ts.map +1 -0
  129. package/lib/api-schemas/oauth.js +148 -0
  130. package/lib/api-schemas/oauth.js.map +1 -0
  131. package/lib/api-schemas/parameters.d.ts +64 -0
  132. package/lib/api-schemas/parameters.d.ts.map +1 -0
  133. package/lib/api-schemas/parameters.js +246 -0
  134. package/lib/api-schemas/parameters.js.map +1 -0
  135. package/lib/api-schemas/process.d.ts +499 -0
  136. package/lib/api-schemas/process.d.ts.map +1 -0
  137. package/lib/api-schemas/process.js +817 -0
  138. package/lib/api-schemas/process.js.map +1 -0
  139. package/lib/api-schemas/project-configuration.d.ts +4900 -0
  140. package/lib/api-schemas/project-configuration.d.ts.map +1 -0
  141. package/lib/api-schemas/project-configuration.js +425 -0
  142. package/lib/api-schemas/project-configuration.js.map +1 -0
  143. package/lib/api-schemas/project.d.ts +7247 -0
  144. package/lib/api-schemas/project.d.ts.map +1 -0
  145. package/lib/api-schemas/project.js +185 -0
  146. package/lib/api-schemas/project.js.map +1 -0
  147. package/lib/api-schemas/prompt.d.ts +70 -0
  148. package/lib/api-schemas/prompt.d.ts.map +1 -0
  149. package/lib/api-schemas/prompt.js +77 -0
  150. package/lib/api-schemas/prompt.js.map +1 -0
  151. package/lib/api-schemas/quota.d.ts +90 -0
  152. package/lib/api-schemas/quota.d.ts.map +1 -0
  153. package/lib/api-schemas/quota.js +95 -0
  154. package/lib/api-schemas/quota.js.map +1 -0
  155. package/lib/api-schemas/registry.d.ts +97458 -0
  156. package/lib/api-schemas/registry.d.ts.map +1 -0
  157. package/lib/api-schemas/registry.js +2586 -0
  158. package/lib/api-schemas/registry.js.map +1 -0
  159. package/lib/api-schemas/schema-primitives.d.ts +5 -0
  160. package/lib/api-schemas/schema-primitives.d.ts.map +1 -0
  161. package/lib/api-schemas/schema-primitives.js +11 -0
  162. package/lib/api-schemas/schema-primitives.js.map +1 -0
  163. package/lib/api-schemas/secrets.d.ts +497 -0
  164. package/lib/api-schemas/secrets.d.ts.map +1 -0
  165. package/lib/api-schemas/secrets.js +298 -0
  166. package/lib/api-schemas/secrets.js.map +1 -0
  167. package/lib/api-schemas/store.d.ts +22140 -0
  168. package/lib/api-schemas/store.d.ts.map +1 -0
  169. package/lib/api-schemas/store.js +557 -0
  170. package/lib/api-schemas/store.js.map +1 -0
  171. package/lib/api-schemas/sts.d.ts +156 -0
  172. package/lib/api-schemas/sts.d.ts.map +1 -0
  173. package/lib/api-schemas/sts.js +96 -0
  174. package/lib/api-schemas/sts.js.map +1 -0
  175. package/lib/api-schemas/task.d.ts +215 -0
  176. package/lib/api-schemas/task.d.ts.map +1 -0
  177. package/lib/api-schemas/task.js +95 -0
  178. package/lib/api-schemas/task.js.map +1 -0
  179. package/lib/api-schemas/tools.d.ts +111 -0
  180. package/lib/api-schemas/tools.d.ts.map +1 -0
  181. package/lib/api-schemas/tools.js +122 -0
  182. package/lib/api-schemas/tools.js.map +1 -0
  183. package/lib/api-schemas/user.d.ts +208 -0
  184. package/lib/api-schemas/user.d.ts.map +1 -0
  185. package/lib/api-schemas/user.js +180 -0
  186. package/lib/api-schemas/user.js.map +1 -0
  187. package/lib/api-schemas/view-execution.d.ts +3163 -0
  188. package/lib/api-schemas/view-execution.d.ts.map +1 -0
  189. package/lib/api-schemas/view-execution.js +172 -0
  190. package/lib/api-schemas/view-execution.js.map +1 -0
  191. package/lib/api-schemas/views.d.ts +5990 -0
  192. package/lib/api-schemas/views.d.ts.map +1 -0
  193. package/lib/api-schemas/views.js +396 -0
  194. package/lib/api-schemas/views.js.map +1 -0
  195. package/lib/api-schemas/workflow-runs.d.ts +2209 -0
  196. package/lib/api-schemas/workflow-runs.d.ts.map +1 -0
  197. package/lib/api-schemas/workflow-runs.js +589 -0
  198. package/lib/api-schemas/workflow-runs.js.map +1 -0
  199. package/lib/apikey-values.d.ts +10 -0
  200. package/lib/apikey-values.d.ts.map +1 -0
  201. package/lib/apikey-values.js +11 -0
  202. package/lib/apikey-values.js.map +1 -0
  203. package/lib/apikey.d.ts +37 -36
  204. package/lib/apikey.d.ts.map +1 -1
  205. package/lib/apikey.js +5 -4
  206. package/lib/apikey.js.map +1 -1
  207. package/lib/apps.d.ts +107 -1151
  208. package/lib/apps.d.ts.map +1 -1
  209. package/lib/apps.js.map +1 -1
  210. package/lib/ask-user.d.ts +8 -1
  211. package/lib/ask-user.d.ts.map +1 -1
  212. package/lib/audit-trail.d.ts +17 -128
  213. package/lib/audit-trail.d.ts.map +1 -1
  214. package/lib/audit-trail.js.map +1 -1
  215. package/lib/browser-credentials.d.ts +11 -106
  216. package/lib/browser-credentials.d.ts.map +1 -1
  217. package/lib/common.d.ts +59 -81
  218. package/lib/common.d.ts.map +1 -1
  219. package/lib/cost-analytics.d.ts +14 -167
  220. package/lib/cost-analytics.d.ts.map +1 -1
  221. package/lib/cost-analytics.js.map +1 -1
  222. package/lib/data-platform.d.ts +122 -786
  223. package/lib/data-platform.d.ts.map +1 -1
  224. package/lib/data-platform.js +41 -61
  225. package/lib/data-platform.js.map +1 -1
  226. package/lib/email.d.ts +5 -17
  227. package/lib/email.d.ts.map +1 -1
  228. package/lib/email.js +0 -3
  229. package/lib/email.js.map +1 -1
  230. package/lib/embeddings.d.ts +14 -56
  231. package/lib/embeddings.d.ts.map +1 -1
  232. package/lib/environment.d.ts +19 -115
  233. package/lib/environment.d.ts.map +1 -1
  234. package/lib/environment.js +3 -0
  235. package/lib/environment.js.map +1 -1
  236. package/lib/facets.d.ts +4 -7
  237. package/lib/facets.d.ts.map +1 -1
  238. package/lib/group.d.ts +33 -39
  239. package/lib/group.d.ts.map +1 -1
  240. package/lib/group.js +0 -1
  241. package/lib/group.js.map +1 -1
  242. package/lib/index.d.ts +7 -0
  243. package/lib/index.d.ts.map +1 -1
  244. package/lib/index.js.map +1 -1
  245. package/lib/integrations.d.ts +20 -108
  246. package/lib/integrations.d.ts.map +1 -1
  247. package/lib/integrations.js.map +1 -1
  248. package/lib/interaction-values.d.ts +11 -0
  249. package/lib/interaction-values.d.ts.map +1 -0
  250. package/lib/interaction-values.js +24 -0
  251. package/lib/interaction-values.js.map +1 -0
  252. package/lib/interaction.d.ts +88 -778
  253. package/lib/interaction.d.ts.map +1 -1
  254. package/lib/interaction.js +8 -12
  255. package/lib/interaction.js.map +1 -1
  256. package/lib/meters.d.ts +11 -7
  257. package/lib/meters.d.ts.map +1 -1
  258. package/lib/meters.js.map +1 -1
  259. package/lib/oauth-server.d.ts +33 -119
  260. package/lib/oauth-server.d.ts.map +1 -1
  261. package/lib/oauth.d.ts +14 -96
  262. package/lib/oauth.d.ts.map +1 -1
  263. package/lib/oauth.js +0 -4
  264. package/lib/oauth.js.map +1 -1
  265. package/lib/payload.d.ts +15 -38
  266. package/lib/payload.d.ts.map +1 -1
  267. package/lib/platform-event.d.ts +49 -462
  268. package/lib/platform-event.d.ts.map +1 -1
  269. package/lib/platform-event.js.map +1 -1
  270. package/lib/principal-context.d.ts +10 -15
  271. package/lib/principal-context.d.ts.map +1 -1
  272. package/lib/project-values.d.ts +24 -0
  273. package/lib/project-values.d.ts.map +1 -0
  274. package/lib/project-values.js +42 -0
  275. package/lib/project-values.js.map +1 -0
  276. package/lib/project.d.ts +55 -503
  277. package/lib/project.d.ts.map +1 -1
  278. package/lib/project.js +6 -76
  279. package/lib/project.js.map +1 -1
  280. package/lib/prompt.d.ts +20 -51
  281. package/lib/prompt.d.ts.map +1 -1
  282. package/lib/prompt.js.map +1 -1
  283. package/lib/query.d.ts +27 -88
  284. package/lib/query.d.ts.map +1 -1
  285. package/lib/rate-limiter.d.ts +19 -70
  286. package/lib/rate-limiter.d.ts.map +1 -1
  287. package/lib/rate-limiter.js +0 -3
  288. package/lib/rate-limiter.js.map +1 -1
  289. package/lib/refs.d.ts +3 -11
  290. package/lib/refs.d.ts.map +1 -1
  291. package/lib/refs.js.map +1 -1
  292. package/lib/roles/types.d.ts +14 -20
  293. package/lib/roles/types.d.ts.map +1 -1
  294. package/lib/roles/types.js +5 -9
  295. package/lib/roles/types.js.map +1 -1
  296. package/lib/runs.d.ts +6 -25
  297. package/lib/runs.d.ts.map +1 -1
  298. package/lib/secrets.d.ts +20 -105
  299. package/lib/secrets.d.ts.map +1 -1
  300. package/lib/store/agent-approval.d.ts +5 -14
  301. package/lib/store/agent-approval.d.ts.map +1 -1
  302. package/lib/store/agent-approval.js.map +1 -1
  303. package/lib/store/agent-run.d.ts +57 -358
  304. package/lib/store/agent-run.d.ts.map +1 -1
  305. package/lib/store/collections.d.ts +11 -63
  306. package/lib/store/collections.d.ts.map +1 -1
  307. package/lib/store/collections.js.map +1 -1
  308. package/lib/store/conversation-state.d.ts +61 -61
  309. package/lib/store/conversation-state.d.ts.map +1 -1
  310. package/lib/store/conversation-state.js +2 -0
  311. package/lib/store/conversation-state.js.map +1 -1
  312. package/lib/store/doc-analyzer.d.ts +9 -32
  313. package/lib/store/doc-analyzer.d.ts.map +1 -1
  314. package/lib/store/dsl-workflow.d.ts +37 -151
  315. package/lib/store/dsl-workflow.d.ts.map +1 -1
  316. package/lib/store/dsl-workflow.js.map +1 -1
  317. package/lib/store/editing-policy-schema.generated.d.ts +3 -0
  318. package/lib/store/editing-policy-schema.generated.d.ts.map +1 -0
  319. package/lib/store/editing-policy-schema.generated.js +28 -0
  320. package/lib/store/editing-policy-schema.generated.js.map +1 -0
  321. package/lib/store/grounded-extraction.d.ts +7 -104
  322. package/lib/store/grounded-extraction.d.ts.map +1 -1
  323. package/lib/store/grounded-extraction.js.map +1 -1
  324. package/lib/store/index.d.ts +2 -0
  325. package/lib/store/index.d.ts.map +1 -1
  326. package/lib/store/index.js +3 -0
  327. package/lib/store/index.js.map +1 -1
  328. package/lib/store/intake-policy-schema.generated.d.ts +3 -0
  329. package/lib/store/intake-policy-schema.generated.d.ts.map +1 -0
  330. package/lib/store/intake-policy-schema.generated.js +1425 -0
  331. package/lib/store/intake-policy-schema.generated.js.map +1 -0
  332. package/lib/store/process-schema.d.ts +80 -0
  333. package/lib/store/process-schema.d.ts.map +1 -1
  334. package/lib/store/process-schema.js +79 -0
  335. package/lib/store/process-schema.js.map +1 -1
  336. package/lib/store/process-validation.d.ts.map +1 -1
  337. package/lib/store/process-validation.js +70 -2
  338. package/lib/store/process-validation.js.map +1 -1
  339. package/lib/store/process.d.ts +36 -125
  340. package/lib/store/process.d.ts.map +1 -1
  341. package/lib/store/process.js.map +1 -1
  342. package/lib/store/rendering.d.ts +9 -64
  343. package/lib/store/rendering.d.ts.map +1 -1
  344. package/lib/store/rendering.js.map +1 -1
  345. package/lib/store/store.d.ts +98 -700
  346. package/lib/store/store.d.ts.map +1 -1
  347. package/lib/store/store.js +4 -456
  348. package/lib/store/store.js.map +1 -1
  349. package/lib/store/task.d.ts +15 -59
  350. package/lib/store/task.d.ts.map +1 -1
  351. package/lib/store/task.js +0 -3
  352. package/lib/store/task.js.map +1 -1
  353. package/lib/store/workflow.d.ts +54 -518
  354. package/lib/store/workflow.d.ts.map +1 -1
  355. package/lib/store/workflow.js +23 -11
  356. package/lib/store/workflow.js.map +1 -1
  357. package/lib/sts-token-types.d.ts +12 -66
  358. package/lib/sts-token-types.d.ts.map +1 -1
  359. package/lib/sts-token-types.js.map +1 -1
  360. package/lib/tools.d.ts +8 -100
  361. package/lib/tools.d.ts.map +1 -1
  362. package/lib/transient-tokens-values.d.ts +11 -0
  363. package/lib/transient-tokens-values.d.ts.map +1 -0
  364. package/lib/transient-tokens-values.js +12 -0
  365. package/lib/transient-tokens-values.js.map +1 -0
  366. package/lib/transient-tokens.d.ts +15 -13
  367. package/lib/transient-tokens.d.ts.map +1 -1
  368. package/lib/transient-tokens.js +5 -5
  369. package/lib/transient-tokens.js.map +1 -1
  370. package/lib/user.d.ts +54 -155
  371. package/lib/user.d.ts.map +1 -1
  372. package/lib/user.js +1 -78
  373. package/lib/user.js.map +1 -1
  374. package/lib/versions.d.ts +24 -1
  375. package/lib/versions.d.ts.map +1 -1
  376. package/lib/versions.js +23 -0
  377. package/lib/versions.js.map +1 -1
  378. package/lib/vertesia-common.js +6 -2
  379. package/lib/vertesia-common.js.map +1 -1
  380. package/lib/views-schema.d.ts +4 -4
  381. package/lib/views.d.ts +56 -312
  382. package/lib/views.d.ts.map +1 -1
  383. package/lib/views.js.map +1 -1
  384. package/package.json +13 -4
  385. package/src/access-control-values.ts +113 -0
  386. package/src/access-control.ts +33 -138
  387. package/src/account-values.ts +95 -0
  388. package/src/analytics.ts +18 -42
  389. package/src/api-schemas/access-control.contract.test.ts +209 -0
  390. package/src/api-schemas/access-control.ts +208 -0
  391. package/src/api-schemas/account.contract.test.ts +318 -0
  392. package/src/api-schemas/account.ts +150 -0
  393. package/src/api-schemas/adapter-edge-cases.test.ts +480 -0
  394. package/src/api-schemas/adapter.ts +778 -0
  395. package/src/api-schemas/agent-runs.ts +1081 -0
  396. package/src/api-schemas/analytics.ts +65 -0
  397. package/src/api-schemas/apikey.contract.test.ts +270 -0
  398. package/src/api-schemas/apikey.ts +199 -0
  399. package/src/api-schemas/app-lifecycle.ts +841 -0
  400. package/src/api-schemas/app-runtime.ts +919 -0
  401. package/src/api-schemas/apps.ts +415 -0
  402. package/src/api-schemas/audit-trail.ts +243 -0
  403. package/src/api-schemas/bulk-operation.contract.test.ts +39 -0
  404. package/src/api-schemas/bulk-operation.ts +75 -0
  405. package/src/api-schemas/bundle-isolation.test.ts +80 -0
  406. package/src/api-schemas/commands.contract.test.ts +51 -0
  407. package/src/api-schemas/commands.ts +62 -0
  408. package/src/api-schemas/content.ts +939 -0
  409. package/src/api-schemas/cost-analytics.contract.test.ts +64 -0
  410. package/src/api-schemas/cost-analytics.ts +235 -0
  411. package/src/api-schemas/dashboard.contract.test.ts +127 -0
  412. package/src/api-schemas/dashboard.ts +351 -0
  413. package/src/api-schemas/data-store.contract.test.ts +91 -0
  414. package/src/api-schemas/data-store.ts +571 -0
  415. package/src/api-schemas/document-processing.contract.test.ts +76 -0
  416. package/src/api-schemas/document-processing.ts +344 -0
  417. package/src/api-schemas/embeddings.ts +113 -0
  418. package/src/api-schemas/environment.contract.test.ts +184 -0
  419. package/src/api-schemas/environment.ts +190 -0
  420. package/src/api-schemas/events.ts +921 -0
  421. package/src/api-schemas/files.ts +159 -0
  422. package/src/api-schemas/group.contract.test.ts +205 -0
  423. package/src/api-schemas/group.ts +155 -0
  424. package/src/api-schemas/index.ts +35 -0
  425. package/src/api-schemas/indexing.contract.test.ts +83 -0
  426. package/src/api-schemas/indexing.ts +234 -0
  427. package/src/api-schemas/integrations.ts +369 -0
  428. package/src/api-schemas/interaction.ts +2357 -0
  429. package/src/api-schemas/invites.contract.test.ts +268 -0
  430. package/src/api-schemas/invites.ts +127 -0
  431. package/src/api-schemas/llumiverse.contract.test.ts +108 -0
  432. package/src/api-schemas/oauth-server.ts +219 -0
  433. package/src/api-schemas/oauth.contract.test.ts +118 -0
  434. package/src/api-schemas/oauth.ts +166 -0
  435. package/src/api-schemas/parameters.test.ts +402 -0
  436. package/src/api-schemas/parameters.ts +310 -0
  437. package/src/api-schemas/process.ts +929 -0
  438. package/src/api-schemas/project-configuration.ts +478 -0
  439. package/src/api-schemas/project.contract.test.ts +365 -0
  440. package/src/api-schemas/project.ts +214 -0
  441. package/src/api-schemas/prompt.ts +88 -0
  442. package/src/api-schemas/pruning-limits.test.ts +189 -0
  443. package/src/api-schemas/quota.contract.test.ts +147 -0
  444. package/src/api-schemas/quota.ts +122 -0
  445. package/src/api-schemas/registry-groups.test.ts +91 -0
  446. package/src/api-schemas/registry.ts +3487 -0
  447. package/src/api-schemas/response-pruning.test.ts +260 -0
  448. package/src/api-schemas/schema-primitives.ts +12 -0
  449. package/src/api-schemas/secrets.ts +332 -0
  450. package/src/api-schemas/store.contract.test.ts +450 -0
  451. package/src/api-schemas/store.ts +604 -0
  452. package/src/api-schemas/sts.contract.test.ts +80 -0
  453. package/src/api-schemas/sts.ts +110 -0
  454. package/src/api-schemas/task.ts +104 -0
  455. package/src/api-schemas/tools.ts +140 -0
  456. package/src/api-schemas/user.contract.test.ts +191 -0
  457. package/src/api-schemas/user.ts +204 -0
  458. package/src/api-schemas/view-execution.ts +200 -0
  459. package/src/api-schemas/views.ts +437 -0
  460. package/src/api-schemas/workflow-runs.ts +653 -0
  461. package/src/apikey-values.ts +10 -0
  462. package/src/apikey.ts +49 -40
  463. package/src/apps.ts +234 -1213
  464. package/src/ask-user.ts +9 -1
  465. package/src/audit-trail.ts +45 -137
  466. package/src/browser-credentials.ts +21 -106
  467. package/src/common.ts +67 -78
  468. package/src/cost-analytics.ts +37 -176
  469. package/src/data-platform.ts +205 -776
  470. package/src/email.ts +5 -17
  471. package/src/embeddings.ts +22 -60
  472. package/src/environment.ts +52 -126
  473. package/src/facets.ts +4 -7
  474. package/src/group.ts +38 -42
  475. package/src/index.ts +11 -0
  476. package/src/integrations.ts +39 -129
  477. package/src/interaction-values.ts +23 -0
  478. package/src/interaction.ts +162 -902
  479. package/src/meters.ts +11 -7
  480. package/src/oauth-server.ts +58 -127
  481. package/src/oauth.ts +24 -108
  482. package/src/payload.ts +25 -40
  483. package/src/platform-event.ts +98 -484
  484. package/src/principal-context.ts +11 -15
  485. package/src/project-values.ts +41 -0
  486. package/src/project.ts +116 -588
  487. package/src/prompt.ts +34 -61
  488. package/src/query.ts +34 -93
  489. package/src/rate-limiter.ts +27 -75
  490. package/src/refs.ts +4 -11
  491. package/src/roles/types.ts +20 -20
  492. package/src/runs.ts +11 -24
  493. package/src/secrets.ts +38 -117
  494. package/src/store/agent-approval.ts +9 -14
  495. package/src/store/agent-run.ts +93 -450
  496. package/src/store/collections.ts +21 -63
  497. package/src/store/content-type-editing.test.ts +1 -1
  498. package/src/store/conversation-state.ts +75 -64
  499. package/src/store/doc-analyzer.ts +17 -33
  500. package/src/store/dsl-workflow.ts +62 -158
  501. package/src/store/editing-policy-schema.generated.ts +30 -0
  502. package/src/store/grounded-extraction.ts +13 -104
  503. package/src/store/index.ts +3 -0
  504. package/src/store/intake-policy-schema.generated.ts +1442 -0
  505. package/src/store/process-schema.test.ts +43 -0
  506. package/src/store/process-schema.ts +79 -0
  507. package/src/store/process-validation.test.ts +141 -0
  508. package/src/store/process-validation.ts +82 -2
  509. package/src/store/process.ts +70 -146
  510. package/src/store/rendering.ts +15 -64
  511. package/src/store/store.ts +197 -1204
  512. package/src/store/task.ts +25 -59
  513. package/src/store/workflow.ts +97 -557
  514. package/src/sts-token-types.ts +24 -75
  515. package/src/tools.ts +18 -97
  516. package/src/transient-tokens-values.ts +11 -0
  517. package/src/transient-tokens.ts +16 -13
  518. package/src/user.ts +74 -214
  519. package/src/versions.ts +24 -0
  520. package/src/views-schema.test.ts +9 -1
  521. package/src/views.ts +106 -329
@@ -1,10 +1,90 @@
1
- import type { JSONSchemaType } from 'ajv';
2
- import type { ComputedFacetResponse } from '../facets.js';
3
- import type { InteractionExecutionConfiguration } from '../interaction.js';
1
+ import type { z } from 'zod';
2
+ import type { ContentObjectTypeRefSchema } from '../api-schemas/app-lifecycle.js';
3
+ import type {
4
+ ComplexSearchPayloadSchema,
5
+ ContentObjectApiResponseSchema,
6
+ ContentObjectApiRevisionSchema,
7
+ ContentObjectApiTypeRefSchema,
8
+ ContentObjectExportArtifactFileSchema,
9
+ ContentObjectExportArtifactSchema,
10
+ ContentObjectExportProgressSchema,
11
+ ContentObjectExportResultSchema,
12
+ ContentObjectExportStatusResponseSchema,
13
+ ContentObjectItemApiResponseSchema,
14
+ ContentObjectTextResponseSchema,
15
+ ContentObjectUserPermissionsSchema,
16
+ ContentSourceSchema,
17
+ CreateContentObjectHeadersSchema,
18
+ CreateContentObjectPayloadSchema,
19
+ CreateContentObjectQuerySchema,
20
+ DeleteContentObjectExportResponseSchema,
21
+ DeleteContentObjectResultSchema,
22
+ EmbeddingSchema,
23
+ ExportContentObjectsFilterSchema,
24
+ ExportContentObjectsIncludeOptionsSchema,
25
+ GenerationRunMetadataSchema,
26
+ GetObjectRenditionQuerySchema,
27
+ GetRenditionResponseSchema,
28
+ InheritedPropertyMetadataSchema,
29
+ ListContentObjectExportsResponseSchema,
30
+ ObjectSearchResponseSchema,
31
+ RevisionInfoSchema,
32
+ SetObjectEmbeddingsResponseSchema,
33
+ StartContentObjectExportRequestSchema,
34
+ StartContentObjectExportResponseSchema,
35
+ TranscriptSchema,
36
+ TranscriptSegmentSchema,
37
+ UpdateContentObjectHeadersSchema,
38
+ UpdateContentObjectQuerySchema,
39
+ } from '../api-schemas/content.js';
40
+ import type { MarkdownRenditionFormatSchema } from '../api-schemas/document-processing.js';
41
+ import type {
42
+ CreateWorkflowRulePayloadSchema,
43
+ WorkflowRuleItemSchema,
44
+ WorkflowRuleSchema,
45
+ } from '../api-schemas/events.js';
46
+ import type {
47
+ BucketReadAccessStatusResponseSchema,
48
+ BulkUploadUrlsPayloadSchema,
49
+ BulkUploadUrlsResponseSchema,
50
+ CopyFilePayloadSchema,
51
+ CopyFileResponseSchema,
52
+ DeleteFileResultSchema,
53
+ EnsureBucketReadAccessPayloadSchema,
54
+ EnsureBucketReadAccessResponseSchema,
55
+ FileBucketResponseSchema,
56
+ FileDeleteQuerySchema,
57
+ FileListQuerySchema,
58
+ FileListResponseSchema,
59
+ FileMetadataQuerySchema,
60
+ FileMetadataResponseSchema,
61
+ FileMetadataUpdateResultSchema,
62
+ GetFileUrlPayloadSchema,
63
+ GetFileUrlResponseSchema,
64
+ GetUploadUrlPayloadSchema,
65
+ SetFileMetadataPayloadSchema,
66
+ } from '../api-schemas/files.js';
67
+ import type {
68
+ ColumnLayoutSchema,
69
+ ContentObjectTypeCatalogEntrySchema,
70
+ ContentObjectTypeCatalogQuerySchema,
71
+ ContentObjectTypeItemSchema,
72
+ ContentObjectTypeListQuerySchema,
73
+ ContentObjectTypeSchema,
74
+ ContentObjectTypeStatusSchema,
75
+ ContentTypeEditingPolicySchema,
76
+ ContentTypeExtractionGroundingPolicySchema,
77
+ ContentTypeExtractionGroundingReviewPolicySchema,
78
+ ContentTypeIntakePolicySchema,
79
+ CreateContentObjectTypePayloadSchema,
80
+ InCodeTypeDefinitionSchema,
81
+ IntakePageRangesSchema,
82
+ IntakePageScopeSchema,
83
+ IntakeVisionDetailSchema,
84
+ UpdateContentObjectTypePayloadSchema,
85
+ } from '../api-schemas/store.js';
4
86
  import type { JSONObject } from '../json.js';
5
- import type { SearchPayload } from '../payload.js';
6
87
  import type { SupportedEmbeddingTypes } from '../project.js';
7
- import type { ComplexSearchQuery } from '../query.js';
8
88
  import type { BaseObject } from './common.js';
9
89
 
10
90
  export enum ContentObjectApiHeaders {
@@ -18,39 +98,15 @@ export enum ContentObjectApiHeaders {
18
98
  SUPPRESS_WORKFLOWS = 'x-suppress-workflows',
19
99
  }
20
100
 
21
- export interface CreateContentObjectQuery {
22
- collection_id?: string;
23
- processing_priority?: ContentObjectProcessingPriority;
24
- }
101
+ export type CreateContentObjectQuery = z.infer<typeof CreateContentObjectQuerySchema>;
25
102
 
26
- export interface CreateContentObjectHeaders {
27
- 'x-collection-id'?: string;
28
- 'x-processing-priority'?: ContentObjectProcessingPriority;
29
- }
103
+ export type CreateContentObjectHeaders = z.infer<typeof CreateContentObjectHeadersSchema>;
30
104
 
31
- export interface UpdateContentObjectQuery {
32
- create_revision?: boolean;
33
- revision_label?: string;
34
- processing_priority?: ContentObjectProcessingPriority;
35
- }
105
+ export type UpdateContentObjectQuery = z.infer<typeof UpdateContentObjectQuerySchema>;
36
106
 
37
- export interface UpdateContentObjectHeaders {
38
- 'if-match'?: string;
39
- 'x-create-revision'?: boolean;
40
- 'x-revision-label'?: string;
41
- 'x-processing-priority'?: ContentObjectProcessingPriority;
42
- /**
43
- * @deprecated Events are now always emitted. This suppresses the Temporal-backed delivery targets (workflow, agent, and process) — webhook deliveries still fire.
44
- */
45
- 'x-suppress-workflows'?: boolean;
46
- }
107
+ export type UpdateContentObjectHeaders = z.infer<typeof UpdateContentObjectHeadersSchema>;
47
108
 
48
- export interface GetObjectRenditionQuery {
49
- block_on_generation?: boolean;
50
- generate_if_missing?: boolean;
51
- max_hw?: number;
52
- sign_url?: boolean;
53
- }
109
+ export type GetObjectRenditionQuery = z.infer<typeof GetObjectRenditionQuerySchema>;
54
110
 
55
111
  /**
56
112
  * Headers for Data Store API calls.
@@ -70,52 +126,11 @@ export enum ContentObjectStatus {
70
126
  archived = 'archived',
71
127
  }
72
128
 
73
- export interface Embedding {
74
- model: string; //the model used to generate this embedding
75
- values: number[];
76
- etag?: string; // the etag of the text used for the embedding
77
- }
129
+ export type Embedding = z.infer<typeof EmbeddingSchema>;
78
130
 
79
- /**
80
- * Optional object context to include in content object export rows.
81
- */
82
- export interface ExportContentObjectsIncludeOptions {
83
- /**
84
- * Include stored embeddings. Disabled by default for generic object exports.
85
- */
86
- embeddings?: boolean;
87
- /**
88
- * Include content source metadata. Enabled by default.
89
- */
90
- content?: boolean;
91
- /**
92
- * Include object lifecycle status. Enabled by default.
93
- */
94
- status?: boolean;
95
- /**
96
- * Include object properties. Enabled by default.
97
- */
98
- properties?: boolean;
99
- /**
100
- * Include technical object metadata. Disabled by default because metadata may be large.
101
- */
102
- metadata?: boolean;
103
- /**
104
- * Include object revision details. Enabled by default.
105
- */
106
- revision?: boolean;
107
- }
131
+ export type ExportContentObjectsIncludeOptions = z.infer<typeof ExportContentObjectsIncludeOptionsSchema>;
108
132
 
109
- /**
110
- * Bounded filters supported by the bulk content object export API.
111
- */
112
- export interface ExportContentObjectsFilter {
113
- types?: string[];
114
- created_from?: string;
115
- created_to?: string;
116
- updated_from?: string;
117
- updated_to?: string;
118
- }
133
+ export type ExportContentObjectsFilter = z.infer<typeof ExportContentObjectsFilterSchema>;
119
134
 
120
135
  /**
121
136
  * Exported object identity and context for a single content object row.
@@ -146,34 +161,9 @@ export interface ExportedContentObjectRecord {
146
161
  embeddings?: Partial<Record<SupportedEmbeddingTypes, Embedding>>;
147
162
  }
148
163
 
149
- export interface StartContentObjectExportRequest {
150
- /**
151
- * Embedding types to export when include.embeddings is true. Defaults to all supported embedding types.
152
- */
153
- embedding_types?: SupportedEmbeddingTypes[];
154
- /**
155
- * Explicit export filters. This intentionally does not accept the search API's full Mongo/search DSL.
156
- */
157
- filter?: ExportContentObjectsFilter;
158
- /**
159
- * Include all revisions. Defaults to false, exporting only head revisions.
160
- */
161
- all_revisions?: boolean;
162
- /**
163
- * Optional object context selectors.
164
- */
165
- include?: ExportContentObjectsIncludeOptions;
166
- /**
167
- * Compress the export with gzip. Defaults to true.
168
- */
169
- compression?: boolean;
170
- }
164
+ export type StartContentObjectExportRequest = z.infer<typeof StartContentObjectExportRequestSchema>;
171
165
 
172
- export interface StartContentObjectExportResponse {
173
- workflow_id: string;
174
- run_id: string;
175
- export_id: string;
176
- }
166
+ export type StartContentObjectExportResponse = z.infer<typeof StartContentObjectExportResponseSchema>;
177
167
 
178
168
  export interface ZenoBulkContentObjectExportRequest extends Omit<StartContentObjectExportRequest, 'compression'> {
179
169
  tenant_id: string;
@@ -240,145 +230,36 @@ export interface ZenoBulkContentObjectExportComposeRequest extends ZenoBulkConte
240
230
  started_at?: string;
241
231
  }
242
232
 
243
- export interface ContentObjectExportResult {
244
- status: 'completed';
245
- path: string;
246
- filename: string;
247
- content_type: string;
248
- manifest_path?: string;
249
- manifest_filename?: string;
250
- manifest_content_type?: string;
251
- manifest_bytes?: number;
252
- records: number;
253
- bytes: number;
254
- started_at: string;
255
- completed_at: string;
256
- duration_ms: number;
257
- }
233
+ export type ContentObjectExportResult = z.infer<typeof ContentObjectExportResultSchema>;
258
234
 
259
- export interface ContentObjectExportProgress {
260
- status: 'queued' | 'planning' | 'exporting' | 'composing' | 'completed' | 'failed';
261
- records: number;
262
- bytes: number;
263
- path?: string;
264
- filename?: string;
265
- completed_shards?: number;
266
- total_shards?: number;
267
- started_at?: string;
268
- completed_at?: string;
269
- error?: string;
270
- }
235
+ export type ContentObjectExportProgress = z.infer<typeof ContentObjectExportProgressSchema>;
271
236
 
272
- export interface ContentObjectExportStatusResponse {
273
- workflow_id: string;
274
- run_id: string;
275
- status: 'queued' | 'running' | 'completed' | 'failed' | 'canceled' | 'terminated' | 'timed_out' | 'unknown';
276
- done: boolean;
277
- progress?: ContentObjectExportProgress;
278
- result?: ContentObjectExportResult;
279
- error?: string;
280
- }
237
+ export type ContentObjectExportStatusResponse = z.infer<typeof ContentObjectExportStatusResponseSchema>;
281
238
 
282
- export interface ContentObjectExportArtifact {
283
- export_id: string;
284
- path: string;
285
- filename: string;
286
- content_type: string;
287
- bytes: number;
288
- created_at?: string;
289
- files?: ContentObjectExportArtifactFile[];
290
- }
239
+ export type ContentObjectExportArtifact = z.infer<typeof ContentObjectExportArtifactSchema>;
291
240
 
292
- export interface ContentObjectExportArtifactFile {
293
- role: 'data' | 'manifest';
294
- path: string;
295
- filename: string;
296
- content_type: string;
297
- bytes: number;
298
- }
241
+ export type ContentObjectExportArtifactFile = z.infer<typeof ContentObjectExportArtifactFileSchema>;
299
242
 
300
- export interface ListContentObjectExportsResponse {
301
- items: ContentObjectExportArtifact[];
302
- limit: number;
303
- }
243
+ export type ListContentObjectExportsResponse = z.infer<typeof ListContentObjectExportsResponseSchema>;
304
244
 
305
- export interface DeleteContentObjectExportResponse {
306
- success: boolean;
307
- export_id: string;
308
- path: string;
309
- }
245
+ export type DeleteContentObjectExportResponse = z.infer<typeof DeleteContentObjectExportResponseSchema>;
310
246
 
311
- /**
312
- * Metadata about a single inherited property.
313
- */
314
- export interface InheritedPropertyMetadata {
315
- /** The property name that was inherited */
316
- name: string;
317
- /** The collection ID that provided this property */
318
- collection: string;
319
- }
320
- /**
321
- * Computed per-request permissions for the current user on a content object.
322
- * Not stored in the database — computed on the fly by the API from the object's security field.
323
- */
324
- export interface ContentObjectUserPermissions {
325
- can_write: boolean;
326
- can_delete: boolean;
327
- }
247
+ export type InheritedPropertyMetadata = z.infer<typeof InheritedPropertyMetadataSchema>;
248
+ export type ContentObjectUserPermissions = z.infer<typeof ContentObjectUserPermissionsSchema>;
328
249
 
329
- export interface ContentObjectTextResponse {
330
- text?: string;
331
- }
250
+ export type ContentObjectTextResponse = z.infer<typeof ContentObjectTextResponseSchema>;
332
251
 
333
- export interface DeleteContentObjectResult {
334
- id: string;
335
- count: number;
336
- }
252
+ export type DeleteContentObjectResult = z.infer<typeof DeleteContentObjectResultSchema>;
337
253
 
338
- export interface SetObjectEmbeddingsResponse {
339
- type?: Embedding;
340
- }
254
+ export type SetObjectEmbeddingsResponse = z.infer<typeof SetObjectEmbeddingsResponseSchema>;
341
255
 
342
- export type ContentObjectApiTypeRef = ContentObjectTypeRef;
256
+ export type ContentObjectApiTypeRef = z.infer<typeof ContentObjectApiTypeRefSchema>;
343
257
 
344
- export interface ContentObjectApiRevision {
345
- parent?: string;
346
- root: string;
347
- head: boolean;
348
- label?: string;
349
- }
258
+ export type ContentObjectApiRevision = z.infer<typeof ContentObjectApiRevisionSchema>;
350
259
 
351
- export interface ContentObjectItemApiResponse extends BaseObject {
352
- parent?: string;
353
- location: string;
354
- status: ContentObjectStatus;
355
- type?: ContentObjectApiTypeRef;
356
- content?: ContentSource;
357
- external_id?: string;
358
- properties: JSONObject;
359
- metadata?: Record<string, unknown>;
360
- tokens?: {
361
- count?: number;
362
- encoding?: string;
363
- etag?: string;
364
- };
365
- revision: ContentObjectApiRevision;
366
- is_deleted?: boolean;
367
- is_locked?: boolean;
368
- score?: number;
369
- user_permissions?: ContentObjectUserPermissions;
370
- }
260
+ export type ContentObjectItemApiResponse = z.infer<typeof ContentObjectItemApiResponseSchema>;
371
261
 
372
- export interface ContentObjectApiResponse extends ContentObjectItemApiResponse {
373
- text?: string;
374
- text_etag?: string;
375
- embeddings?: Record<string, Embedding>;
376
- parts?: string[];
377
- parts_etag?: string;
378
- transcript?: Record<string, unknown>;
379
- security?: Record<string, string[]>;
380
- inherited_properties?: InheritedPropertyMetadata[];
381
- }
262
+ export type ContentObjectApiResponse = z.infer<typeof ContentObjectApiResponseSchema>;
382
263
 
383
264
  export interface ContentObject<T = JSONObject> extends ContentObjectItem<T> {
384
265
  text?: string; // the text representation of the object
@@ -419,18 +300,7 @@ export interface Location {
419
300
  longitude: number;
420
301
  }
421
302
 
422
- export interface GenerationRunMetadata {
423
- id: string;
424
- date: string;
425
- model: string;
426
- target?: string;
427
- /**
428
- * Fingerprint of the inputs used by property extraction (content etag, type + its object
429
- * schema, source, instructions, interaction). Lets a later run skip re-extraction when
430
- * nothing changed.
431
- */
432
- extraction_fingerprint?: string;
433
- }
303
+ export type GenerationRunMetadata = z.infer<typeof GenerationRunMetadataSchema>;
434
304
 
435
305
  // Base rendition interface for document and audio
436
306
  export interface Rendition {
@@ -609,11 +479,7 @@ export interface GroundedMetadata {
609
479
  [key: string]: unknown;
610
480
  }
611
481
 
612
- export interface Transcript {
613
- text?: string;
614
- segments?: TranscriptSegment[];
615
- etag?: string;
616
- }
482
+ export type Transcript = z.infer<typeof TranscriptSchema>;
617
483
 
618
484
  export const TextExtractionStatus = {
619
485
  success: 'success',
@@ -626,48 +492,11 @@ export interface TranscriptMediaResult {
626
492
  gladiaTranscriptionId?: string;
627
493
  }
628
494
 
629
- export interface TranscriptSegment {
630
- start: number;
631
- text: string;
632
- speaker?: number;
633
- end?: number;
634
- confidence?: number;
635
- language?: string;
636
- }
495
+ export type TranscriptSegment = z.infer<typeof TranscriptSegmentSchema>;
637
496
 
638
- export interface ContentSource {
639
- // the URI of the content source. Usually an URL to the uploaded file inside a cloud file storage like s3.
640
- source?: string;
641
- // the mime type of the content source.
642
- type?: string;
643
- // the original name of the input file if any
644
- name?: string;
645
- // the etag of the content source if any
646
- etag?: string;
647
- }
497
+ export type ContentSource = z.infer<typeof ContentSourceSchema>;
648
498
 
649
- /**
650
- *
651
- */
652
- export interface RevisionInfo {
653
- /** Direct parent revision id (omit on the first revision) */
654
- parent?: string;
655
-
656
- /** The root revision id (omit on the first revision) */
657
- root: string;
658
-
659
- /** True if this revision is the head revision */
660
- head: boolean;
661
-
662
- /** Human‑friendly tag or state ("v1.2", "approved") */
663
- label?: string;
664
-
665
- /** Extra parents when two branches are merged (leave undefined until needed) */
666
- //merge_parents?: string[]; //maybe later
667
-
668
- /** Pointer to a diff / patch blob if you store deltas instead of full content */
669
- //delta_ref?: string;
670
- }
499
+ export type RevisionInfo = z.infer<typeof RevisionInfoSchema>;
671
500
 
672
501
  /**
673
502
  * The content object item is a simplified version of the ContentObject that is returned by the store API when listing objects.
@@ -750,15 +579,15 @@ export interface ContentObjectItem<T = JSONObject> extends BaseObject {
750
579
  user_permissions?: ContentObjectUserPermissions;
751
580
  }
752
581
 
753
- /**
754
- * When creating from an uploaded file the content should be an URL to the uploaded file
755
- */
756
- export interface CreateContentObjectPayload<T = JSONObject>
757
- extends Partial<Omit<ContentObject<T>, 'id' | 'root' | 'created_at' | 'updated_at' | 'type' | 'owner'>> {
758
- id?: string; // An optional existing object ID to be replaced by the new one
759
- type?: string; // the object type ID
760
- generation_run_info?: GenerationRunMetadata;
761
- }
582
+ type CreateContentObjectPayloadWire = z.infer<typeof CreateContentObjectPayloadSchema>;
583
+ export type CreateContentObjectPayload<T = JSONObject> = Omit<
584
+ CreateContentObjectPayloadWire,
585
+ 'properties' | 'metadata'
586
+ > & {
587
+ properties?: T;
588
+ /** Known metadata interfaces remain assignable; the runtime contract deliberately accepts any object keys. */
589
+ metadata?: ContentObjectItem['metadata'];
590
+ };
762
591
 
763
592
  type LegacyContentObjectTypeRef = Partial<ContentObjectTypeRef> & {
764
593
  ref_type?: 'stored' | 'incode';
@@ -783,92 +612,27 @@ export function withContentObjectTypeRefDiscriminator(
783
612
  return { ref_type: 'stored', id, name };
784
613
  }
785
614
 
786
- /**
787
- * Reference to a content object type. `id` is the canonical identifier for both
788
- * stored and in-code types.
789
- */
790
- /**
791
- * @discriminator ref_type
792
- */
793
- export type ContentObjectTypeRef = StoredTypeRef | InCodeTypeRef;
794
-
795
- interface StoredTypeRef {
796
- ref_type: 'stored';
797
- /**
798
- * MongoDB ObjectId string for stored types
799
- */
800
- id: string;
801
- name: string;
802
- /**
803
- * Display hint from the type's intake policy (`intake.default_view`). Enriched by the
804
- * API on single-object reads so clients can pick the initial view without fetching the
805
- * type. Absent on list responses and older servers.
806
- */
807
- default_view?: ContentTypeIntakePolicy['default_view'];
808
- }
809
-
810
- interface InCodeTypeRef {
811
- ref_type: 'incode';
812
- /**
813
- * Namespaced identifier for in-code types (e.g. "sys:Invoice", "app:myapp:Contract")
814
- */
815
- id: string;
816
- name: string;
817
- /**
818
- * Display hint from the type's intake policy (`intake.default_view`). Enriched by the
819
- * API on single-object reads so clients can pick the initial view without fetching the
820
- * type. Absent on list responses and older servers.
821
- */
822
- default_view?: ContentTypeIntakePolicy['default_view'];
823
- }
615
+ export type ContentObjectTypeRef = z.infer<typeof ContentObjectTypeRefSchema>;
824
616
 
825
- export interface ComplexSearchPayload extends Omit<SearchPayload, 'query'> {
826
- query?: ComplexSearchQuery;
827
- }
617
+ export type ComplexSearchPayload = z.infer<typeof ComplexSearchPayloadSchema>;
828
618
 
829
- export interface ColumnLayout {
830
- /**
831
- * The path of the field to use (e.g. "properties.title")
832
- */
833
- field: string;
834
- /**
835
- * The name to display in the table column
836
- */
837
- name: string;
838
- /**
839
- * The type of the field specifies how the rendering will be done. If not specified the string type will be used.
840
- * The type may contain additional parameters prepended using a web-like query string syntax: date?LLL
841
- */
842
- type?: string;
843
- /*
844
- * a fallback field to use if the field is not present in the object
845
- */
846
- fallback?: string;
847
- /**
848
- * A default value to be used if the field is not present in the object
849
- */
850
- default?: unknown;
851
- }
619
+ export type ColumnLayout = z.infer<typeof ColumnLayoutSchema>;
852
620
 
853
- export type ContentObjectTypeStatus = 'active' | 'draft';
621
+ export type ContentObjectTypeStatus = z.infer<typeof ContentObjectTypeStatusSchema>;
854
622
 
855
- /** Vision detail level names referenced by intake policies. The rendering profiles behind the
856
- * names (dpi, max size, quality, color mode) are PLATFORM-defined and project-overridable —
857
- * a type only ever references a detail name. */
858
- export type IntakeVisionDetail = 'low' | 'standard' | 'high';
623
+ export type IntakeVisionDetail = z.infer<typeof IntakeVisionDetailSchema>;
859
624
 
860
- /**
861
- * Named page scope for intake conversion/extraction: everything or the locate-pass result.
862
- * Static page ranges live in the sibling `page_ranges` field (which wins when set) — kept as
863
- * a SEPARATE field because scalar-or-collection unions generate unstable API clients.
864
- */
865
- export type IntakePageScope = 'all' | 'located';
625
+ export type IntakePageScope = z.infer<typeof IntakePageScopeSchema>;
866
626
 
867
627
  /**
868
- * Static page ranges: inclusive [start, end] pairs; negative indexes count from the end of
869
- * the document ([[1, 2], [-1, -1]] = first two pages plus the last page).
628
+ * Inclusive `[start, end]` pairs.
629
+ *
630
+ * Inferred as `number[][]` rather than the `[number, number][]` this used to declare: the published
631
+ * component is a uniform-items array with `minItems`/`maxItems`, which is what the scanner made of the
632
+ * tuple, and reproducing it is what keeps the generated clients unchanged. The length is still
633
+ * enforced at runtime.
870
634
  */
871
- export type IntakePageRanges = [number, number][];
635
+ export type IntakePageRanges = z.infer<typeof IntakePageRangesSchema>;
872
636
 
873
637
  /** Rendering settings behind a vision detail name (platform defaults, project-overridable
874
638
  * via `configuration.intake.vision_profiles`). */
@@ -883,674 +647,31 @@ export interface IntakeVisionProfileSettings {
883
647
  color_mode: 'grayscale' | 'auto';
884
648
  }
885
649
 
886
- export interface ContentTypeExtractionGroundingReviewPolicy {
887
- /** Set false to disable an inherited grounding review pass for this type. */
888
- enabled?: boolean;
889
- /** Model execution configuration for the review interaction. */
890
- config?: InteractionExecutionConfiguration;
891
- /** Hardness score at or above which review runs. Defaults to hardness_threshold. */
892
- threshold?: number;
893
- /**
894
- * Review also runs when any page's citation coverage falls below this
895
- * floor (evidence of missed content). Default 0.2.
896
- */
897
- coverage_threshold?: number;
898
- /** Run review regardless of hardness. */
899
- force?: boolean;
900
- }
901
-
902
- export interface ContentTypeExtractionGroundingPolicy {
903
- /** Enable PDF block-level citation grounding for property extraction. */
904
- enabled?: boolean;
905
- /** Grounded extraction interaction. Defaults to the system grounded extractor. */
906
- interaction?: string;
907
- /** Maximum pages to process. */
908
- max_pages?: number;
909
- /** Run OCR on every page even when a text layer exists. */
910
- force_ocr?: boolean;
911
- /** Attach instrumented page images to the grounded extraction prompt. */
912
- use_vision?: boolean;
913
- /**
914
- * How to read pages with no digital text layer (scans / image-only pages).
915
- * 'vision' (default): read them off the page image and skip OCR. 'ocr': legacy
916
- * path — OCR those pages and block-ground on the (lossy) OCR text.
917
- */
918
- raster_mode?: 'vision' | 'ocr';
919
- /**
920
- * A1 locate-grid cell size in PDF points for vision pages. Smaller = finer grid
921
- * (more cells, tighter boxes) but can trip weaker models into over-reading;
922
- * tune per the model in `config`. Default 15.
923
- */
924
- grid_cell_pt?: number;
925
- /**
926
- * Drop block bounding boxes from the extraction prompt. Only sound with
927
- * use_vision (layout comes from the image).
928
- */
929
- omit_block_boxes?: boolean;
930
- /** Maximum pages per grounded extraction call before windowing. */
931
- window_pages?: number;
932
- /** Update object properties with grounded extraction data. Default true. */
933
- update_properties?: boolean;
934
- /** Model execution configuration for the main grounded extraction interaction. */
935
- config?: InteractionExecutionConfiguration;
936
- /** Model execution configuration used for hard-to-read content. */
937
- hard_config?: InteractionExecutionConfiguration;
938
- /** Hardness score at or above which hard_config is used. Default 0.5. */
939
- hardness_threshold?: number;
940
- /**
941
- * Minimum citations-per-leaf-value ratio; completions below it retry with
942
- * escalation. Default 0.3.
943
- */
944
- min_citation_density?: number;
945
- /** Re-run OCR instead of restoring durable OCR artifacts (stale pipeline output). */
946
- refresh_ocr?: boolean;
947
- /** Optional post-extraction review pass. */
948
- review?: ContentTypeExtractionGroundingReviewPolicy;
949
- }
950
-
951
- /**
952
- * Per-content-type policy for the standard intake workflows.
953
- */
954
- export interface ContentTypeIntakePolicy {
955
- /** Intake orchestration mode for this type. */
956
- mode?: 'programmatic' | 'agentic';
957
- /** Guidance used when selecting or creating this content type. */
958
- identification?: {
959
- guidance?: string;
960
- distinguish_from?: string;
961
- examples?: string[];
962
- };
963
- /**
964
- * Document-map ("locate") pass: page thumbnails tiled into labeled contact sheets, one
965
- * vision call returns which pages matter for THIS type. The result can scope conversion
966
- * and extraction, and doubles as the vision planner for visual extraction.
967
- */
968
- locate?: {
969
- /** What to look for ("commercial terms, payment schedule, signature pages"). */
970
- instructions: string;
971
- /** Pages per contact sheet: 8 = bigger tiles (headings readable). Default 16. */
972
- detail?: 8 | 16;
973
- /** Only run when the page count is at least this. Default 8. */
974
- min_pages?: number;
975
- };
976
- /** Controls source-to-text conversion before extraction and embedding. */
977
- text_conversion?: {
978
- enabled?: boolean;
979
- method?: 'auto' | 'basic' | 'llm' | 'custom';
980
- custom?: {
981
- interaction?: string;
982
- agent?: string;
983
- };
984
- instructions?: string;
985
- output_format?: 'markdown' | 'text';
986
- /** Which pages to convert: everything or the locate result. Default all. */
987
- scope?: IntakePageScope;
988
- /** Static page ranges to convert (wins over `scope` when set). */
989
- page_ranges?: IntakePageRanges;
990
- };
991
- /** Controls schema-property extraction after type assignment. */
992
- extraction?: {
993
- enabled?: boolean;
994
- source?: 'auto' | 'text' | 'vision' | 'mixed';
995
- instructions?: string;
996
- interaction?: string;
997
- /** Which pages extraction sees: everything or the locate result. */
998
- scope?: IntakePageScope;
999
- /** Static page ranges extraction sees (wins over `scope` when set). */
1000
- page_ranges?: IntakePageRanges;
1001
- /** Cap on pages sent to extraction. Default 20. */
1002
- max_pages?: number;
1003
- /** Vision evidence budget for visual extraction. Detail names reference platform
1004
- * profiles; the type never defines dpi/quality/resolution. */
1005
- vision?: {
1006
- default_detail?: IntakeVisionDetail;
1007
- allowed_details?: IntakeVisionDetail[];
1008
- /** PRIMARY budget: estimated image tokens per extraction call. Default 16000. */
1009
- max_image_tokens?: number;
1010
- /** Transport guard in megabytes. Default 16. */
1011
- max_payload_mb?: number;
1012
- /** Cap on page images per extraction call. Default 8. */
1013
- max_pages_per_call?: number;
1014
- };
1015
- verification?: {
1016
- enabled?: boolean;
1017
- model?: string;
1018
- environment?: string;
1019
- materiality?: string;
1020
- threshold?: number;
1021
- max_retries?: number;
1022
- on_fail?: 'flag' | 'block';
1023
- };
1024
- /** Controls PDF block-level citation grounding with annotated proof output. */
1025
- grounding?: ContentTypeExtractionGroundingPolicy;
1026
- };
1027
- /** Handlebars template used to materialize extracted properties into object text. */
1028
- rendering_template?: string;
1029
- /** Per-type embedding switches. Unspecified values inherit the project policy. */
1030
- embeddings?: Partial<Record<SupportedEmbeddingTypes, boolean>>;
1031
- /** Whether intake should generate a table of contents for matching documents. */
1032
- generate_toc?: boolean;
1033
- /** Preferred first view for objects of this type. */
1034
- default_view?: 'auto' | 'text' | 'pdf' | 'image' | 'properties';
1035
- }
1036
-
1037
- /** Per-content-type policy for collaborative document editing. */
1038
- export interface ContentTypeEditingPolicy {
1039
- /** Agent interaction used for new document-editing sessions. Defaults to sys:GeneralAgent. */
1040
- interaction?: string;
1041
- }
1042
-
1043
- export const ContentTypeEditingPolicySchema: JSONSchemaType<ContentTypeEditingPolicy> = {
1044
- type: 'object',
1045
- description: 'Per-content-type policy for collaborative document editing.',
1046
- required: [],
1047
- additionalProperties: false,
1048
- properties: {
1049
- interaction: {
1050
- type: 'string',
1051
- description: 'Agent interaction used for new document-editing sessions. Omit to use sys:GeneralAgent.',
1052
- nullable: true,
1053
- },
1054
- },
1055
- };
1056
-
1057
- /** Reusable sub-schema for IntakePageScope ('all' | 'located'). */
1058
- const IntakePageScopeSchema = {
1059
- type: 'string',
1060
- enum: ['all', 'located'],
1061
- description: "Named pages selection: 'all' or 'located' (the locate-pass result). Default all.",
1062
- nullable: true,
1063
- };
1064
-
1065
- /** Reusable sub-schema for IntakePageRanges (inclusive [start, end] pairs, negative = from end). */
1066
- const IntakePageRangesSchema = {
1067
- type: 'array',
1068
- items: { type: 'array', items: { type: 'integer' }, minItems: 2, maxItems: 2 },
1069
- description:
1070
- 'Static inclusive [start, end] page ranges; negative indexes count from the end ' +
1071
- '([[1,2],[-1,-1]] = first two pages plus the last). Wins over scope when set.',
1072
- nullable: true,
1073
- };
1074
-
1075
- const IntakeExecutionConfigurationSchema = {
1076
- type: 'object',
1077
- description: 'Interaction execution configuration such as model, environment, and model options.',
1078
- nullable: true,
1079
- required: [],
1080
- additionalProperties: true,
1081
- properties: {
1082
- id: { type: 'string', nullable: true },
1083
- environment: { type: 'string', nullable: true },
1084
- model: { type: 'string', nullable: true },
1085
- do_validate: { type: 'boolean', nullable: true },
1086
- run_data: { type: 'string', nullable: true },
1087
- configMode: { type: 'string', nullable: true },
1088
- model_options: {
1089
- type: 'object',
1090
- nullable: true,
1091
- required: [],
1092
- additionalProperties: true,
1093
- },
1094
- http_timeout: {
1095
- type: 'object',
1096
- nullable: true,
1097
- required: [],
1098
- additionalProperties: true,
1099
- },
1100
- },
1101
- };
1102
-
1103
- const ContentTypeExtractionGroundingPolicySchema = {
1104
- type: 'object',
1105
- description:
1106
- 'PDF block-level citation grounding policy. When enabled, property extraction uses the grounded ' +
1107
- 'child workflow and stores citations plus annotated proof output.',
1108
- nullable: true,
1109
- required: [],
1110
- additionalProperties: false,
1111
- properties: {
1112
- enabled: {
1113
- type: 'boolean',
1114
- description: 'Enable PDF block-level citation grounding for this type.',
1115
- nullable: true,
1116
- },
1117
- interaction: {
1118
- type: 'string',
1119
- description: 'Grounded extraction interaction id. Omit to use the system grounded extractor.',
1120
- nullable: true,
1121
- },
1122
- max_pages: {
1123
- type: 'integer',
1124
- minimum: 1,
1125
- description: 'Maximum pages to process.',
1126
- nullable: true,
1127
- },
1128
- force_ocr: {
1129
- type: 'boolean',
1130
- description: 'Run OCR on every page even when a text layer exists.',
1131
- nullable: true,
1132
- },
1133
- use_vision: {
1134
- type: 'boolean',
1135
- description: 'Attach instrumented page images to the grounded extraction prompt.',
1136
- nullable: true,
1137
- },
1138
- raster_mode: {
1139
- type: 'string',
1140
- enum: ['vision', 'ocr'],
1141
- description:
1142
- "How to read pages with no digital text layer (scans). 'vision' (default) reads off the page image and skips OCR; 'ocr' is the legacy OCR-then-block-ground path.",
1143
- nullable: true,
1144
- },
1145
- grid_cell_pt: {
1146
- type: 'number',
1147
- minimum: 1,
1148
- description:
1149
- 'A1 locate-grid cell size in PDF points for vision pages. Smaller = finer grid; tune per the model in config. Default 14.',
1150
- nullable: true,
1151
- },
1152
- omit_block_boxes: {
1153
- type: 'boolean',
1154
- description: 'Drop block bounding boxes from the extraction prompt (only sound with use_vision).',
1155
- nullable: true,
1156
- },
1157
- window_pages: {
1158
- type: 'integer',
1159
- minimum: 1,
1160
- description:
1161
- 'Maximum pages per extraction call before sequential window completion (later windows append to prior). Default 3.',
1162
- nullable: true,
1163
- },
1164
- update_properties: {
1165
- type: 'boolean',
1166
- description: 'Update object properties with grounded extraction data. Default true.',
1167
- nullable: true,
1168
- },
1169
- config: IntakeExecutionConfigurationSchema,
1170
- hard_config: IntakeExecutionConfigurationSchema,
1171
- hardness_threshold: {
1172
- type: 'number',
1173
- minimum: 0,
1174
- maximum: 1,
1175
- description: 'Hardness score at or above which hard_config is used. Default 0.5.',
1176
- nullable: true,
1177
- },
1178
- min_citation_density: {
1179
- type: 'number',
1180
- minimum: 0,
1181
- maximum: 1,
1182
- description:
1183
- 'Minimum citations-per-leaf-value ratio; completions below it retry with escalation. Default 0.3.',
1184
- nullable: true,
1185
- },
1186
- refresh_ocr: {
1187
- type: 'boolean',
1188
- description: 'Re-run OCR instead of restoring durable OCR artifacts (stale pipeline output).',
1189
- nullable: true,
1190
- },
1191
- review: {
1192
- type: 'object',
1193
- description: 'Optional post-extraction review pass for hard content.',
1194
- nullable: true,
1195
- required: [],
1196
- additionalProperties: false,
1197
- properties: {
1198
- enabled: {
1199
- type: 'boolean',
1200
- description: 'Set false to disable an inherited grounding review pass for this type.',
1201
- nullable: true,
1202
- },
1203
- config: IntakeExecutionConfigurationSchema,
1204
- threshold: {
1205
- type: 'number',
1206
- minimum: 0,
1207
- maximum: 1,
1208
- description: 'Hardness score at or above which review runs.',
1209
- nullable: true,
1210
- },
1211
- coverage_threshold: {
1212
- type: 'number',
1213
- minimum: 0,
1214
- maximum: 1,
1215
- description:
1216
- "Review also runs when any page's citation coverage falls below this floor. Default 0.2.",
1217
- nullable: true,
1218
- },
1219
- force: {
1220
- type: 'boolean',
1221
- description: 'Run review regardless of hardness.',
1222
- nullable: true,
1223
- },
1224
- },
1225
- },
1226
- },
1227
- };
1228
-
1229
- /** JSON schema for validating ContentTypeIntakePolicy payloads at API/tool boundaries.
1230
- * NOTE: typed via a cast because AJV's strict `JSONSchemaType` mapping cannot express the
1231
- * `[number, number]` pair items of `page_ranges` as a uniform-items array. The runtime
1232
- * schema is compiled (and thus validated) by every consumer and by the schema-acceptance
1233
- * unit test in packages/workflows. */
1234
- export const ContentTypeIntakePolicySchema = {
1235
- type: 'object',
1236
- description:
1237
- 'Per-content-type policy for standard intake: type selection, conversion, extraction, rendering, and embeddings.',
1238
- required: [],
1239
- additionalProperties: false,
1240
- properties: {
1241
- mode: {
1242
- type: 'string',
1243
- enum: ['programmatic', 'agentic'],
1244
- description:
1245
- 'Intake orchestration mode. Use programmatic unless the user explicitly asks for agentic intake.',
1246
- nullable: true,
1247
- },
1248
- identification: {
1249
- type: 'object',
1250
- description: 'Guidance used by automatic type selection to recognize this type before full extraction.',
1251
- nullable: true,
1252
- required: [],
1253
- additionalProperties: false,
1254
- properties: {
1255
- guidance: {
1256
- type: 'string',
1257
- description: 'Classifier-facing description of what this type is and when it should be selected.',
1258
- nullable: true,
1259
- },
1260
- distinguish_from: {
1261
- type: 'string',
1262
- description: 'How to distinguish this type from common look-alike document types.',
1263
- nullable: true,
1264
- },
1265
- examples: {
1266
- type: 'array',
1267
- description: 'Object ids of human-confirmed examples for this type.',
1268
- nullable: true,
1269
- items: { type: 'string' },
1270
- },
1271
- },
1272
- },
1273
- locate: {
1274
- type: 'object',
1275
- description:
1276
- 'Document-map pass: labeled page-thumbnail contact sheets and one vision call return which ' +
1277
- 'pages matter for this type. Scopes conversion/extraction and plans visual extraction.',
1278
- nullable: true,
1279
- required: ['instructions'],
1280
- additionalProperties: false,
1281
- properties: {
1282
- instructions: {
1283
- type: 'string',
1284
- description: 'What to look for (e.g. "commercial terms, payment schedule, signature pages").',
1285
- },
1286
- detail: {
1287
- type: 'integer',
1288
- enum: [8, 16],
1289
- description: 'Pages per contact sheet: 8 = bigger tiles with readable headings. Default 16.',
1290
- nullable: true,
1291
- },
1292
- min_pages: {
1293
- type: 'integer',
1294
- minimum: 0,
1295
- description: 'Only run the locate pass when the page count is at least this. Default 8.',
1296
- nullable: true,
1297
- },
1298
- },
1299
- },
1300
- text_conversion: {
1301
- type: 'object',
1302
- description: 'Controls source-to-text conversion before extraction, search, and text embeddings.',
1303
- nullable: true,
1304
- required: [],
1305
- additionalProperties: false,
1306
- properties: {
1307
- enabled: {
1308
- type: 'boolean',
1309
- description: 'Set false for extraction-only types that should not create converted markdown/text.',
1310
- nullable: true,
1311
- },
1312
- method: {
1313
- type: 'string',
1314
- enum: ['auto', 'basic', 'llm', 'custom'],
1315
- description: 'Conversion method. Use auto unless the user asks for a specific converter.',
1316
- nullable: true,
1317
- },
1318
- custom: {
1319
- type: 'object',
1320
- description: 'Custom conversion implementation for method=custom.',
1321
- nullable: true,
1322
- required: [],
1323
- additionalProperties: false,
1324
- properties: {
1325
- interaction: {
1326
- type: 'string',
1327
- description: 'Interaction id to call for custom conversion.',
1328
- nullable: true,
1329
- },
1330
- agent: {
1331
- type: 'string',
1332
- description: 'Agent id to launch for custom conversion.',
1333
- nullable: true,
1334
- },
1335
- },
1336
- },
1337
- instructions: {
1338
- type: 'string',
1339
- description: 'Instructions for what source content to preserve during conversion.',
1340
- nullable: true,
1341
- },
1342
- output_format: {
1343
- type: 'string',
1344
- enum: ['markdown', 'text'],
1345
- description: 'Output format for converted text. Prefer markdown for readable documents.',
1346
- nullable: true,
1347
- },
1348
- scope: IntakePageScopeSchema,
1349
- page_ranges: IntakePageRangesSchema,
1350
- },
1351
- },
1352
- extraction: {
1353
- type: 'object',
1354
- description: 'Controls structured property extraction against the content type object_schema.',
1355
- nullable: true,
1356
- required: [],
1357
- additionalProperties: false,
1358
- properties: {
1359
- enabled: {
1360
- type: 'boolean',
1361
- description: 'Whether intake should extract structured properties for this type.',
1362
- nullable: true,
1363
- },
1364
- source: {
1365
- type: 'string',
1366
- enum: ['auto', 'text', 'vision', 'mixed'],
1367
- description:
1368
- 'Evidence source for extraction: auto chooses text or vision, text sends text only, vision sends image/PDF evidence only, mixed sends both.',
1369
- nullable: true,
1370
- },
1371
- instructions: {
1372
- type: 'string',
1373
- description: 'Type-specific extraction instructions such as pages or sections to ignore.',
1374
- nullable: true,
1375
- },
1376
- interaction: {
1377
- type: 'string',
1378
- description: 'Interaction id used for extraction. Omit to use the system extractor.',
1379
- nullable: true,
1380
- },
1381
- scope: IntakePageScopeSchema,
1382
- page_ranges: IntakePageRangesSchema,
1383
- max_pages: {
1384
- type: 'integer',
1385
- minimum: 1,
1386
- description: 'Cap on pages sent to extraction. Default 20.',
1387
- nullable: true,
1388
- },
1389
- vision: {
1390
- type: 'object',
1391
- description:
1392
- 'Vision evidence budget for visual extraction. Detail names reference platform-defined ' +
1393
- 'profiles; the type never sets dpi, quality, or resolution.',
1394
- nullable: true,
1395
- required: [],
1396
- additionalProperties: false,
1397
- properties: {
1398
- default_detail: {
1399
- type: 'string',
1400
- enum: ['low', 'standard', 'high'],
1401
- description: 'Detail profile used when the plan does not request one. Default standard.',
1402
- nullable: true,
1403
- },
1404
- allowed_details: {
1405
- type: 'array',
1406
- items: { type: 'string', enum: ['low', 'standard', 'high'] },
1407
- description: 'Detail profiles the plan may request. Others fall back to default_detail.',
1408
- nullable: true,
1409
- },
1410
- max_image_tokens: {
1411
- type: 'integer',
1412
- minimum: 1,
1413
- description: 'PRIMARY budget: estimated image tokens per extraction call. Default 16000.',
1414
- nullable: true,
1415
- },
1416
- max_payload_mb: {
1417
- type: 'number',
1418
- minimum: 1,
1419
- description: 'Transport guard in megabytes. Default 16.',
1420
- nullable: true,
1421
- },
1422
- max_pages_per_call: {
1423
- type: 'integer',
1424
- minimum: 1,
1425
- description: 'Cap on page images per extraction call. Default 8.',
1426
- nullable: true,
1427
- },
1428
- },
1429
- },
1430
- verification: {
1431
- type: 'object',
1432
- description: 'Optional safe-mode verification of extracted values against source evidence.',
1433
- nullable: true,
1434
- required: [],
1435
- additionalProperties: false,
1436
- properties: {
1437
- enabled: {
1438
- type: 'boolean',
1439
- description: 'Whether to verify extracted values after extraction.',
1440
- nullable: true,
1441
- },
1442
- model: { type: 'string', description: 'Verifier model override.', nullable: true },
1443
- environment: {
1444
- type: 'string',
1445
- description: 'Verifier environment override.',
1446
- nullable: true,
1447
- },
1448
- materiality: {
1449
- type: 'string',
1450
- description: 'What errors are material for this type.',
1451
- nullable: true,
1452
- },
1453
- threshold: {
1454
- type: 'number',
1455
- minimum: 0,
1456
- maximum: 1,
1457
- description: 'Minimum verification confidence before flag/block behavior applies.',
1458
- nullable: true,
1459
- },
1460
- max_retries: {
1461
- type: 'integer',
1462
- minimum: 0,
1463
- description: 'Maximum extraction retries when verification fails.',
1464
- nullable: true,
1465
- },
1466
- on_fail: {
1467
- type: 'string',
1468
- enum: ['flag', 'block'],
1469
- description: 'Failure behavior after retries: flag for review or block property write.',
1470
- nullable: true,
1471
- },
1472
- },
1473
- },
1474
- grounding: ContentTypeExtractionGroundingPolicySchema,
1475
- },
1476
- },
1477
- rendering_template: {
1478
- type: 'string',
1479
- description: 'Handlebars template used to materialize extracted properties into object text.',
1480
- nullable: true,
1481
- },
1482
- embeddings: {
1483
- type: 'object',
1484
- description: 'Per-type embedding switches. Omitted fields inherit the project embedding policy.',
1485
- nullable: true,
1486
- required: [],
1487
- additionalProperties: false,
1488
- properties: {
1489
- text: { type: 'boolean', description: 'Whether to generate text embeddings.', nullable: true },
1490
- image: { type: 'boolean', description: 'Whether to generate image embeddings.', nullable: true },
1491
- properties: {
1492
- type: 'boolean',
1493
- description: 'Whether to generate property embeddings.',
1494
- nullable: true,
1495
- },
1496
- },
1497
- },
1498
- generate_toc: {
1499
- type: 'boolean',
1500
- description: 'Whether intake should generate table-of-contents sections for this type.',
1501
- nullable: true,
1502
- },
1503
- default_view: {
1504
- type: 'string',
1505
- enum: ['auto', 'text', 'pdf', 'image', 'properties'],
1506
- description: 'Preferred first view for objects of this type.',
1507
- nullable: true,
1508
- },
1509
- },
1510
- } as unknown as JSONSchemaType<ContentTypeIntakePolicy>;
1511
-
1512
- export interface ContentObjectType extends ContentObjectTypeItem {}
1513
- export interface ContentObjectTypeItem extends BaseObject {
1514
- status?: ContentObjectTypeStatus;
1515
- is_chunkable?: boolean;
1516
- intake?: ContentTypeIntakePolicy;
1517
- editing?: ContentTypeEditingPolicy;
1518
- /**
1519
- * This is only included in ContentObjectTypeItem if explicitly requested
1520
- * It is always included in ContentObjectType
1521
- */
1522
- table_layout?: ColumnLayout[];
1523
- /**
1524
- * this is only included in ContentObjectTypeItem if explicitly requested
1525
- * It is always included in ContentObjectType
1526
- */
1527
- object_schema?: Record<string, unknown>; // an optional JSON schema for the object properties.
1528
-
1529
- /**
1530
- * Determines if the content will be validated against the object schema a generation time and save/update time.
1531
- */
1532
- strict_mode?: boolean;
1533
- }
1534
- export type InCodeTypeDefinition = Pick<
1535
- ContentObjectTypeItem,
1536
- | 'id'
1537
- | 'name'
1538
- | 'description'
1539
- | 'tags'
1540
- | 'object_schema'
1541
- | 'table_layout'
1542
- | 'is_chunkable'
1543
- | 'strict_mode'
1544
- | 'status'
1545
- | 'intake'
1546
- | 'editing'
650
+ export type ContentTypeExtractionGroundingReviewPolicy = z.infer<
651
+ typeof ContentTypeExtractionGroundingReviewPolicySchema
1547
652
  >;
1548
- export interface ContentObjectTypeCatalogEntry extends InCodeTypeDefinition {
1549
- updated_by?: string;
1550
- created_by?: string;
1551
- created_at?: string;
1552
- updated_at?: string;
1553
- }
653
+
654
+ export type ContentTypeExtractionGroundingPolicy = z.infer<typeof ContentTypeExtractionGroundingPolicySchema>;
655
+
656
+ export type ContentTypeIntakePolicy = z.infer<typeof ContentTypeIntakePolicySchema>;
657
+
658
+ // No TSDoc: the description is the canonical schema's, and a doc comment above a canonical alias is
659
+ // published a second time.
660
+ //
661
+ // The hand-written AJV `ContentTypeEditingPolicySchema` that used to sit here is gone. It said the
662
+ // same thing as the Zod schema and had to be kept in step by hand; `./editing-policy-schema.generated.ts`
663
+ // now emits it from the canonical component, under the same exported name, so the validator the types
664
+ // resource compiles and the component the spec publishes are the same object.
665
+ export type ContentTypeEditingPolicy = z.infer<typeof ContentTypeEditingPolicySchema>;
666
+
667
+ export type ContentObjectType = z.infer<typeof ContentObjectTypeSchema>;
668
+ export type ContentObjectTypeItem = z.infer<typeof ContentObjectTypeItemSchema>;
669
+ // Was `Pick<ContentObjectTypeItem, ...>`, and published under the name that derived from:
670
+ // `Pick_ContentObjectTypeItem_id_name_description_tags_object_schema_...`. A mapped type over a
671
+ // canonical alias resolves to `{}`, so the shape is authored now — and it publishes under its own
672
+ // name, which is what the API always meant.
673
+ export type InCodeTypeDefinition = z.infer<typeof InCodeTypeDefinitionSchema>;
674
+ export type ContentObjectTypeCatalogEntry = z.infer<typeof ContentObjectTypeCatalogEntrySchema>;
1554
675
  /**
1555
676
  * The itnerface to be used whend efining types in a plugin app.
1556
677
  */
@@ -1565,61 +686,19 @@ export function isInCodeType(typeId: string): boolean {
1565
686
  return typeId.includes(':');
1566
687
  }
1567
688
 
1568
- export interface CreateContentObjectTypePayload
1569
- extends Omit<ContentObjectType, 'id' | 'created_at' | 'updated_at' | 'created_by' | 'updated_by'> {}
689
+ export type CreateContentObjectTypePayload = z.infer<typeof CreateContentObjectTypePayloadSchema>;
690
+
691
+ export type UpdateContentObjectTypePayload = z.infer<typeof UpdateContentObjectTypePayloadSchema>;
1570
692
 
1571
693
  export enum WorkflowRuleInputType {
1572
694
  single = 'single',
1573
695
  multiple = 'multiple',
1574
696
  none = 'none',
1575
697
  }
1576
- export interface WorkflowRuleItem extends BaseObject {
1577
- // the name of the workflow function
1578
- endpoint: string;
1579
- input_type: WorkflowRuleInputType;
1580
- }
1581
- export interface WorkflowRule extends WorkflowRuleItem {
1582
- /*
1583
- * mongo matching rules for a content event
1584
- */
1585
- match?: Record<string, unknown>;
1586
- /**
1587
- * Activities configuration if any.
1588
- */
1589
- config?: Record<string, unknown>;
1590
-
1591
- /**
1592
- * Debug mode for the rule
1593
- * @default false
1594
- */
1595
- debug?: boolean;
698
+ export type WorkflowRuleItem = z.infer<typeof WorkflowRuleItemSchema>;
699
+ export type WorkflowRule = z.infer<typeof WorkflowRuleSchema>;
1596
700
 
1597
- /**
1598
- * Customer override for the rule
1599
- * When set to true the rule will not be updated by the system
1600
- */
1601
- customer_override?: boolean;
1602
-
1603
- /**
1604
- * Optional task queue name to use when starting workflows for this rule
1605
- */
1606
- task_queue?: string;
1607
-
1608
- /**
1609
- * Event subscription migration status for legacy workflow-rule cutover.
1610
- */
1611
- event_subscription_migration_status?: 'migrated' | 'unsupported_match' | 'failed';
1612
-
1613
- /**
1614
- * Migration failure or unsupported-match reason, when applicable.
1615
- */
1616
- event_subscription_migration_error?: string;
1617
- }
1618
-
1619
- export interface CreateWorkflowRulePayload extends UploadWorkflowRulePayload {
1620
- name: string; // required
1621
- endpoint: string; // required
1622
- }
701
+ export type CreateWorkflowRulePayload = z.infer<typeof CreateWorkflowRulePayloadSchema>;
1623
702
  export interface UploadWorkflowRulePayload
1624
703
  extends Partial<Omit<WorkflowRule, 'id' | 'created_at' | 'updated_at' | 'owner'>> {}
1625
704
 
@@ -1629,10 +708,12 @@ export enum ImageRenditionFormat {
1629
708
  webp = 'webp',
1630
709
  }
1631
710
 
1632
- export enum MarkdownRenditionFormat {
1633
- docx = 'docx',
1634
- pdf = 'pdf',
1635
- }
711
+ export const MarkdownRenditionFormat = {
712
+ docx: 'docx',
713
+ pdf: 'pdf',
714
+ } as const;
715
+
716
+ export type MarkdownRenditionFormat = z.infer<typeof MarkdownRenditionFormatSchema>;
1636
717
 
1637
718
  export interface GetRenditionParams {
1638
719
  format: ImageRenditionFormat | MarkdownRenditionFormat;
@@ -1642,17 +723,9 @@ export interface GetRenditionParams {
1642
723
  block_on_generation?: boolean;
1643
724
  }
1644
725
 
1645
- export interface GetRenditionResponse {
1646
- status: 'found' | 'generating' | 'failed';
1647
- renditions?: string[]; //file paths for the renditions
1648
- workflow_run_id?: string;
1649
- }
726
+ export type GetRenditionResponse = z.infer<typeof GetRenditionResponseSchema>;
1650
727
 
1651
- export interface ObjectSearchResponse {
1652
- results: ContentObjectItemApiResponse[];
1653
- facets: ComputedFacetResponse;
1654
- aggregations?: Record<string, unknown>;
1655
- }
728
+ export type ObjectSearchResponse = z.infer<typeof ObjectSearchResponseSchema>;
1656
729
 
1657
730
  // ============================================================================
1658
731
  // Rendition Format Compatibility Utilities
@@ -1766,127 +839,47 @@ export function supportsVisualRendition(contentType: string | undefined): boolea
1766
839
  return canGenerateRendition(contentType, ImageRenditionFormat.jpeg);
1767
840
  }
1768
841
 
1769
- export interface GetUploadUrlPayload {
1770
- name: string;
1771
- id?: string;
1772
- mime_type?: string;
1773
- ttl?: number;
1774
- }
842
+ export type GetUploadUrlPayload = z.infer<typeof GetUploadUrlPayloadSchema>;
1775
843
 
1776
- export interface GetFileUrlPayload {
1777
- file: string;
1778
- // Optional filename to use in Content-Disposition for downloads
1779
- name?: string;
1780
- // Optional disposition for downloads (default: attachment)
1781
- disposition?: 'inline' | 'attachment';
1782
- }
844
+ export type GetFileUrlPayload = z.infer<typeof GetFileUrlPayloadSchema>;
1783
845
 
1784
- export interface GetFileUrlResponse {
1785
- url: string;
1786
- id: string;
1787
- mime_type?: string;
1788
- path: string;
1789
- }
846
+ export type GetFileUrlResponse = z.infer<typeof GetFileUrlResponseSchema>;
1790
847
 
1791
- export interface EnsureBucketReadAccessPayload {
1792
- principal: string;
1793
- }
848
+ export type EnsureBucketReadAccessPayload = z.infer<typeof EnsureBucketReadAccessPayloadSchema>;
1794
849
 
1795
- export interface EnsureBucketReadAccessResponse {
1796
- bucket: string;
1797
- principal: string;
1798
- granted: boolean;
1799
- }
850
+ export type EnsureBucketReadAccessResponse = z.infer<typeof EnsureBucketReadAccessResponseSchema>;
1800
851
 
1801
- export interface BucketReadAccessStatusResponse {
1802
- bucket: string;
1803
- principal: string;
1804
- hasAccess: boolean;
1805
- }
852
+ export type BucketReadAccessStatusResponse = z.infer<typeof BucketReadAccessStatusResponseSchema>;
1806
853
 
1807
- export interface FileMetadataResponse {
1808
- name: string;
1809
- size: number;
1810
- contentType: string;
1811
- contentDisposition?: string;
1812
- etag?: string;
1813
- customMetadata?: Record<string, string>;
1814
- }
854
+ export type FileMetadataResponse = z.infer<typeof FileMetadataResponseSchema>;
1815
855
 
1816
- export interface SetFileMetadataPayload {
1817
- /** The file path (relative to bucket) or full URI */
1818
- file: string;
1819
- /** Custom metadata key-value pairs to set on the file */
1820
- metadata: Record<string, string>;
1821
- }
856
+ export type SetFileMetadataPayload = z.infer<typeof SetFileMetadataPayloadSchema>;
1822
857
 
1823
- export interface FileMetadataUpdateResult {
1824
- success: boolean;
1825
- file: string;
1826
- }
858
+ export type FileMetadataUpdateResult = z.infer<typeof FileMetadataUpdateResultSchema>;
1827
859
 
1828
- export interface BulkUploadUrlsPayload {
1829
- files: { name: string; mime_type?: string; id?: string }[];
1830
- }
860
+ export type BulkUploadUrlsPayload = z.infer<typeof BulkUploadUrlsPayloadSchema>;
1831
861
 
1832
- export interface BulkUploadUrlsResponse {
1833
- files: GetFileUrlResponse[];
1834
- }
862
+ export type BulkUploadUrlsResponse = z.infer<typeof BulkUploadUrlsResponseSchema>;
1835
863
 
1836
- export interface FileBucketResponse {
1837
- bucket: string;
1838
- }
864
+ export type FileBucketResponse = z.infer<typeof FileBucketResponseSchema>;
1839
865
 
1840
- export interface FileListResponse {
1841
- files: string[];
1842
- }
866
+ export type FileListResponse = z.infer<typeof FileListResponseSchema>;
1843
867
 
1844
- export interface FileMetadataQuery {
1845
- file: string;
1846
- }
868
+ export type FileMetadataQuery = z.infer<typeof FileMetadataQuerySchema>;
1847
869
 
1848
- export interface FileListQuery {
1849
- prefix: string;
1850
- }
870
+ export type FileListQuery = z.infer<typeof FileListQuerySchema>;
1851
871
 
1852
- export interface FileDeleteQuery {
1853
- prefix?: boolean;
1854
- }
872
+ export type FileDeleteQuery = z.infer<typeof FileDeleteQuerySchema>;
1855
873
 
1856
- export interface ContentObjectTypeCatalogQuery {
1857
- tag?: string;
1858
- layout?: boolean;
1859
- schema?: boolean;
1860
- limit?: number;
1861
- offset?: number;
1862
- }
874
+ export type ContentObjectTypeCatalogQuery = z.infer<typeof ContentObjectTypeCatalogQuerySchema>;
1863
875
 
1864
- export interface ContentObjectTypeListQuery {
1865
- name?: string;
1866
- chunkable?: boolean;
1867
- layout?: boolean;
1868
- schema?: boolean;
1869
- limit?: number;
1870
- offset?: number;
1871
- }
876
+ export type ContentObjectTypeListQuery = z.infer<typeof ContentObjectTypeListQuerySchema>;
1872
877
 
1873
- export interface CopyFilePayload {
1874
- source: string;
1875
- dest: string;
1876
- }
878
+ export type CopyFilePayload = z.infer<typeof CopyFilePayloadSchema>;
1877
879
 
1878
- export interface CopyFileResponse {
1879
- success: boolean;
1880
- source: string;
1881
- dest: string;
1882
- }
880
+ export type CopyFileResponse = z.infer<typeof CopyFileResponseSchema>;
1883
881
 
1884
- export interface DeleteFileResult {
1885
- success: boolean;
1886
- count: number;
1887
- message?: string;
1888
- file?: string;
1889
- }
882
+ export type DeleteFileResult = z.infer<typeof DeleteFileResultSchema>;
1890
883
 
1891
884
  export enum ContentObjectProcessingPriority {
1892
885
  normal = 'normal',