@vertesia/common 1.5.0-dev.20260722.120446Z → 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 (522) 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 +116 -1121
  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 -113
  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 +116 -734
  253. package/lib/interaction.d.ts.map +1 -1
  254. package/lib/interaction.js +56 -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 +63 -342
  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 +63 -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 -693
  346. package/lib/store/store.d.ts.map +1 -1
  347. package/lib/store/store.js +4 -443
  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 +56 -516
  354. package/lib/store/workflow.d.ts.map +1 -1
  355. package/lib/store/workflow.js +28 -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 +14 -5
  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/agent-resources.test.ts +100 -0
  389. package/src/analytics.ts +18 -42
  390. package/src/api-schemas/access-control.contract.test.ts +209 -0
  391. package/src/api-schemas/access-control.ts +208 -0
  392. package/src/api-schemas/account.contract.test.ts +318 -0
  393. package/src/api-schemas/account.ts +150 -0
  394. package/src/api-schemas/adapter-edge-cases.test.ts +480 -0
  395. package/src/api-schemas/adapter.ts +778 -0
  396. package/src/api-schemas/agent-runs.ts +1081 -0
  397. package/src/api-schemas/analytics.ts +65 -0
  398. package/src/api-schemas/apikey.contract.test.ts +270 -0
  399. package/src/api-schemas/apikey.ts +199 -0
  400. package/src/api-schemas/app-lifecycle.ts +841 -0
  401. package/src/api-schemas/app-runtime.ts +919 -0
  402. package/src/api-schemas/apps.ts +415 -0
  403. package/src/api-schemas/audit-trail.ts +243 -0
  404. package/src/api-schemas/bulk-operation.contract.test.ts +39 -0
  405. package/src/api-schemas/bulk-operation.ts +75 -0
  406. package/src/api-schemas/bundle-isolation.test.ts +80 -0
  407. package/src/api-schemas/commands.contract.test.ts +51 -0
  408. package/src/api-schemas/commands.ts +62 -0
  409. package/src/api-schemas/content.ts +939 -0
  410. package/src/api-schemas/cost-analytics.contract.test.ts +64 -0
  411. package/src/api-schemas/cost-analytics.ts +235 -0
  412. package/src/api-schemas/dashboard.contract.test.ts +127 -0
  413. package/src/api-schemas/dashboard.ts +351 -0
  414. package/src/api-schemas/data-store.contract.test.ts +91 -0
  415. package/src/api-schemas/data-store.ts +571 -0
  416. package/src/api-schemas/document-processing.contract.test.ts +76 -0
  417. package/src/api-schemas/document-processing.ts +344 -0
  418. package/src/api-schemas/embeddings.ts +113 -0
  419. package/src/api-schemas/environment.contract.test.ts +184 -0
  420. package/src/api-schemas/environment.ts +190 -0
  421. package/src/api-schemas/events.ts +921 -0
  422. package/src/api-schemas/files.ts +159 -0
  423. package/src/api-schemas/group.contract.test.ts +205 -0
  424. package/src/api-schemas/group.ts +155 -0
  425. package/src/api-schemas/index.ts +35 -0
  426. package/src/api-schemas/indexing.contract.test.ts +83 -0
  427. package/src/api-schemas/indexing.ts +234 -0
  428. package/src/api-schemas/integrations.ts +369 -0
  429. package/src/api-schemas/interaction.ts +2357 -0
  430. package/src/api-schemas/invites.contract.test.ts +268 -0
  431. package/src/api-schemas/invites.ts +127 -0
  432. package/src/api-schemas/llumiverse.contract.test.ts +108 -0
  433. package/src/api-schemas/oauth-server.ts +219 -0
  434. package/src/api-schemas/oauth.contract.test.ts +118 -0
  435. package/src/api-schemas/oauth.ts +166 -0
  436. package/src/api-schemas/parameters.test.ts +402 -0
  437. package/src/api-schemas/parameters.ts +310 -0
  438. package/src/api-schemas/process.ts +929 -0
  439. package/src/api-schemas/project-configuration.ts +478 -0
  440. package/src/api-schemas/project.contract.test.ts +365 -0
  441. package/src/api-schemas/project.ts +214 -0
  442. package/src/api-schemas/prompt.ts +88 -0
  443. package/src/api-schemas/pruning-limits.test.ts +189 -0
  444. package/src/api-schemas/quota.contract.test.ts +147 -0
  445. package/src/api-schemas/quota.ts +122 -0
  446. package/src/api-schemas/registry-groups.test.ts +91 -0
  447. package/src/api-schemas/registry.ts +3487 -0
  448. package/src/api-schemas/response-pruning.test.ts +260 -0
  449. package/src/api-schemas/schema-primitives.ts +12 -0
  450. package/src/api-schemas/secrets.ts +332 -0
  451. package/src/api-schemas/store.contract.test.ts +450 -0
  452. package/src/api-schemas/store.ts +604 -0
  453. package/src/api-schemas/sts.contract.test.ts +80 -0
  454. package/src/api-schemas/sts.ts +110 -0
  455. package/src/api-schemas/task.ts +104 -0
  456. package/src/api-schemas/tools.ts +140 -0
  457. package/src/api-schemas/user.contract.test.ts +191 -0
  458. package/src/api-schemas/user.ts +204 -0
  459. package/src/api-schemas/view-execution.ts +200 -0
  460. package/src/api-schemas/views.ts +437 -0
  461. package/src/api-schemas/workflow-runs.ts +653 -0
  462. package/src/apikey-values.ts +10 -0
  463. package/src/apikey.ts +49 -40
  464. package/src/apps.ts +249 -1179
  465. package/src/ask-user.ts +9 -1
  466. package/src/audit-trail.ts +45 -137
  467. package/src/browser-credentials.ts +21 -106
  468. package/src/common.ts +67 -78
  469. package/src/cost-analytics.ts +37 -176
  470. package/src/data-platform.ts +205 -776
  471. package/src/email.ts +5 -17
  472. package/src/embeddings.ts +22 -60
  473. package/src/environment.ts +52 -124
  474. package/src/facets.ts +4 -7
  475. package/src/group.ts +38 -42
  476. package/src/index.ts +11 -0
  477. package/src/integrations.ts +39 -129
  478. package/src/interaction-values.ts +23 -0
  479. package/src/interaction.ts +231 -841
  480. package/src/meters.ts +11 -7
  481. package/src/oauth-server.ts +58 -127
  482. package/src/oauth.ts +24 -108
  483. package/src/payload.ts +25 -40
  484. package/src/platform-event.ts +98 -484
  485. package/src/principal-context.ts +11 -15
  486. package/src/project-values.ts +41 -0
  487. package/src/project.ts +116 -588
  488. package/src/prompt.ts +34 -61
  489. package/src/query.ts +34 -93
  490. package/src/rate-limiter.ts +27 -75
  491. package/src/refs.ts +4 -11
  492. package/src/roles/types.ts +20 -20
  493. package/src/runs.ts +11 -24
  494. package/src/secrets.ts +38 -117
  495. package/src/store/agent-approval.ts +9 -14
  496. package/src/store/agent-run.ts +106 -434
  497. package/src/store/collections.ts +21 -63
  498. package/src/store/content-type-editing.test.ts +17 -0
  499. package/src/store/conversation-state.ts +78 -64
  500. package/src/store/doc-analyzer.ts +17 -33
  501. package/src/store/dsl-workflow.ts +62 -158
  502. package/src/store/editing-policy-schema.generated.ts +30 -0
  503. package/src/store/grounded-extraction.ts +13 -104
  504. package/src/store/index.ts +3 -0
  505. package/src/store/intake-policy-schema.generated.ts +1442 -0
  506. package/src/store/process-schema.test.ts +43 -0
  507. package/src/store/process-schema.ts +79 -0
  508. package/src/store/process-validation.test.ts +141 -0
  509. package/src/store/process-validation.ts +82 -2
  510. package/src/store/process.ts +70 -146
  511. package/src/store/rendering.ts +15 -64
  512. package/src/store/store.ts +197 -1182
  513. package/src/store/task.ts +25 -59
  514. package/src/store/workflow.ts +103 -554
  515. package/src/sts-token-types.ts +24 -75
  516. package/src/tools.ts +18 -97
  517. package/src/transient-tokens-values.ts +11 -0
  518. package/src/transient-tokens.ts +16 -13
  519. package/src/user.ts +74 -214
  520. package/src/versions.ts +24 -0
  521. package/src/views-schema.test.ts +9 -1
  522. 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
- }
637
-
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
- }
648
-
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;
495
+ export type TranscriptSegment = z.infer<typeof TranscriptSegmentSchema>;
661
496
 
662
- /** Human‑friendly tag or state ("v1.2", "approved") */
663
- label?: string;
497
+ export type ContentSource = z.infer<typeof ContentSourceSchema>;
664
498
 
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,652 +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
- /** Reusable sub-schema for IntakePageScope ('all' | 'located'). */
1038
- const IntakePageScopeSchema = {
1039
- type: 'string',
1040
- enum: ['all', 'located'],
1041
- description: "Named pages selection: 'all' or 'located' (the locate-pass result). Default all.",
1042
- nullable: true,
1043
- };
1044
-
1045
- /** Reusable sub-schema for IntakePageRanges (inclusive [start, end] pairs, negative = from end). */
1046
- const IntakePageRangesSchema = {
1047
- type: 'array',
1048
- items: { type: 'array', items: { type: 'integer' }, minItems: 2, maxItems: 2 },
1049
- description:
1050
- 'Static inclusive [start, end] page ranges; negative indexes count from the end ' +
1051
- '([[1,2],[-1,-1]] = first two pages plus the last). Wins over scope when set.',
1052
- nullable: true,
1053
- };
1054
-
1055
- const IntakeExecutionConfigurationSchema = {
1056
- type: 'object',
1057
- description: 'Interaction execution configuration such as model, environment, and model options.',
1058
- nullable: true,
1059
- required: [],
1060
- additionalProperties: true,
1061
- properties: {
1062
- id: { type: 'string', nullable: true },
1063
- environment: { type: 'string', nullable: true },
1064
- model: { type: 'string', nullable: true },
1065
- do_validate: { type: 'boolean', nullable: true },
1066
- run_data: { type: 'string', nullable: true },
1067
- configMode: { type: 'string', nullable: true },
1068
- model_options: {
1069
- type: 'object',
1070
- nullable: true,
1071
- required: [],
1072
- additionalProperties: true,
1073
- },
1074
- http_timeout: {
1075
- type: 'object',
1076
- nullable: true,
1077
- required: [],
1078
- additionalProperties: true,
1079
- },
1080
- },
1081
- };
1082
-
1083
- const ContentTypeExtractionGroundingPolicySchema = {
1084
- type: 'object',
1085
- description:
1086
- 'PDF block-level citation grounding policy. When enabled, property extraction uses the grounded ' +
1087
- 'child workflow and stores citations plus annotated proof output.',
1088
- nullable: true,
1089
- required: [],
1090
- additionalProperties: false,
1091
- properties: {
1092
- enabled: {
1093
- type: 'boolean',
1094
- description: 'Enable PDF block-level citation grounding for this type.',
1095
- nullable: true,
1096
- },
1097
- interaction: {
1098
- type: 'string',
1099
- description: 'Grounded extraction interaction id. Omit to use the system grounded extractor.',
1100
- nullable: true,
1101
- },
1102
- max_pages: {
1103
- type: 'integer',
1104
- minimum: 1,
1105
- description: 'Maximum pages to process.',
1106
- nullable: true,
1107
- },
1108
- force_ocr: {
1109
- type: 'boolean',
1110
- description: 'Run OCR on every page even when a text layer exists.',
1111
- nullable: true,
1112
- },
1113
- use_vision: {
1114
- type: 'boolean',
1115
- description: 'Attach instrumented page images to the grounded extraction prompt.',
1116
- nullable: true,
1117
- },
1118
- raster_mode: {
1119
- type: 'string',
1120
- enum: ['vision', 'ocr'],
1121
- description:
1122
- "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.",
1123
- nullable: true,
1124
- },
1125
- grid_cell_pt: {
1126
- type: 'number',
1127
- minimum: 1,
1128
- description:
1129
- 'A1 locate-grid cell size in PDF points for vision pages. Smaller = finer grid; tune per the model in config. Default 14.',
1130
- nullable: true,
1131
- },
1132
- omit_block_boxes: {
1133
- type: 'boolean',
1134
- description: 'Drop block bounding boxes from the extraction prompt (only sound with use_vision).',
1135
- nullable: true,
1136
- },
1137
- window_pages: {
1138
- type: 'integer',
1139
- minimum: 1,
1140
- description:
1141
- 'Maximum pages per extraction call before sequential window completion (later windows append to prior). Default 3.',
1142
- nullable: true,
1143
- },
1144
- update_properties: {
1145
- type: 'boolean',
1146
- description: 'Update object properties with grounded extraction data. Default true.',
1147
- nullable: true,
1148
- },
1149
- config: IntakeExecutionConfigurationSchema,
1150
- hard_config: IntakeExecutionConfigurationSchema,
1151
- hardness_threshold: {
1152
- type: 'number',
1153
- minimum: 0,
1154
- maximum: 1,
1155
- description: 'Hardness score at or above which hard_config is used. Default 0.5.',
1156
- nullable: true,
1157
- },
1158
- min_citation_density: {
1159
- type: 'number',
1160
- minimum: 0,
1161
- maximum: 1,
1162
- description:
1163
- 'Minimum citations-per-leaf-value ratio; completions below it retry with escalation. Default 0.3.',
1164
- nullable: true,
1165
- },
1166
- refresh_ocr: {
1167
- type: 'boolean',
1168
- description: 'Re-run OCR instead of restoring durable OCR artifacts (stale pipeline output).',
1169
- nullable: true,
1170
- },
1171
- review: {
1172
- type: 'object',
1173
- description: 'Optional post-extraction review pass for hard content.',
1174
- nullable: true,
1175
- required: [],
1176
- additionalProperties: false,
1177
- properties: {
1178
- enabled: {
1179
- type: 'boolean',
1180
- description: 'Set false to disable an inherited grounding review pass for this type.',
1181
- nullable: true,
1182
- },
1183
- config: IntakeExecutionConfigurationSchema,
1184
- threshold: {
1185
- type: 'number',
1186
- minimum: 0,
1187
- maximum: 1,
1188
- description: 'Hardness score at or above which review runs.',
1189
- nullable: true,
1190
- },
1191
- coverage_threshold: {
1192
- type: 'number',
1193
- minimum: 0,
1194
- maximum: 1,
1195
- description:
1196
- "Review also runs when any page's citation coverage falls below this floor. Default 0.2.",
1197
- nullable: true,
1198
- },
1199
- force: {
1200
- type: 'boolean',
1201
- description: 'Run review regardless of hardness.',
1202
- nullable: true,
1203
- },
1204
- },
1205
- },
1206
- },
1207
- };
1208
-
1209
- /** JSON schema for validating ContentTypeIntakePolicy payloads at API/tool boundaries.
1210
- * NOTE: typed via a cast because AJV's strict `JSONSchemaType` mapping cannot express the
1211
- * `[number, number]` pair items of `page_ranges` as a uniform-items array. The runtime
1212
- * schema is compiled (and thus validated) by every consumer and by the schema-acceptance
1213
- * unit test in packages/workflows. */
1214
- export const ContentTypeIntakePolicySchema = {
1215
- type: 'object',
1216
- description:
1217
- 'Per-content-type policy for standard intake: type selection, conversion, extraction, rendering, and embeddings.',
1218
- required: [],
1219
- additionalProperties: false,
1220
- properties: {
1221
- mode: {
1222
- type: 'string',
1223
- enum: ['programmatic', 'agentic'],
1224
- description:
1225
- 'Intake orchestration mode. Use programmatic unless the user explicitly asks for agentic intake.',
1226
- nullable: true,
1227
- },
1228
- identification: {
1229
- type: 'object',
1230
- description: 'Guidance used by automatic type selection to recognize this type before full extraction.',
1231
- nullable: true,
1232
- required: [],
1233
- additionalProperties: false,
1234
- properties: {
1235
- guidance: {
1236
- type: 'string',
1237
- description: 'Classifier-facing description of what this type is and when it should be selected.',
1238
- nullable: true,
1239
- },
1240
- distinguish_from: {
1241
- type: 'string',
1242
- description: 'How to distinguish this type from common look-alike document types.',
1243
- nullable: true,
1244
- },
1245
- examples: {
1246
- type: 'array',
1247
- description: 'Object ids of human-confirmed examples for this type.',
1248
- nullable: true,
1249
- items: { type: 'string' },
1250
- },
1251
- },
1252
- },
1253
- locate: {
1254
- type: 'object',
1255
- description:
1256
- 'Document-map pass: labeled page-thumbnail contact sheets and one vision call return which ' +
1257
- 'pages matter for this type. Scopes conversion/extraction and plans visual extraction.',
1258
- nullable: true,
1259
- required: ['instructions'],
1260
- additionalProperties: false,
1261
- properties: {
1262
- instructions: {
1263
- type: 'string',
1264
- description: 'What to look for (e.g. "commercial terms, payment schedule, signature pages").',
1265
- },
1266
- detail: {
1267
- type: 'integer',
1268
- enum: [8, 16],
1269
- description: 'Pages per contact sheet: 8 = bigger tiles with readable headings. Default 16.',
1270
- nullable: true,
1271
- },
1272
- min_pages: {
1273
- type: 'integer',
1274
- minimum: 0,
1275
- description: 'Only run the locate pass when the page count is at least this. Default 8.',
1276
- nullable: true,
1277
- },
1278
- },
1279
- },
1280
- text_conversion: {
1281
- type: 'object',
1282
- description: 'Controls source-to-text conversion before extraction, search, and text embeddings.',
1283
- nullable: true,
1284
- required: [],
1285
- additionalProperties: false,
1286
- properties: {
1287
- enabled: {
1288
- type: 'boolean',
1289
- description: 'Set false for extraction-only types that should not create converted markdown/text.',
1290
- nullable: true,
1291
- },
1292
- method: {
1293
- type: 'string',
1294
- enum: ['auto', 'basic', 'llm', 'custom'],
1295
- description: 'Conversion method. Use auto unless the user asks for a specific converter.',
1296
- nullable: true,
1297
- },
1298
- custom: {
1299
- type: 'object',
1300
- description: 'Custom conversion implementation for method=custom.',
1301
- nullable: true,
1302
- required: [],
1303
- additionalProperties: false,
1304
- properties: {
1305
- interaction: {
1306
- type: 'string',
1307
- description: 'Interaction id to call for custom conversion.',
1308
- nullable: true,
1309
- },
1310
- agent: {
1311
- type: 'string',
1312
- description: 'Agent id to launch for custom conversion.',
1313
- nullable: true,
1314
- },
1315
- },
1316
- },
1317
- instructions: {
1318
- type: 'string',
1319
- description: 'Instructions for what source content to preserve during conversion.',
1320
- nullable: true,
1321
- },
1322
- output_format: {
1323
- type: 'string',
1324
- enum: ['markdown', 'text'],
1325
- description: 'Output format for converted text. Prefer markdown for readable documents.',
1326
- nullable: true,
1327
- },
1328
- scope: IntakePageScopeSchema,
1329
- page_ranges: IntakePageRangesSchema,
1330
- },
1331
- },
1332
- extraction: {
1333
- type: 'object',
1334
- description: 'Controls structured property extraction against the content type object_schema.',
1335
- nullable: true,
1336
- required: [],
1337
- additionalProperties: false,
1338
- properties: {
1339
- enabled: {
1340
- type: 'boolean',
1341
- description: 'Whether intake should extract structured properties for this type.',
1342
- nullable: true,
1343
- },
1344
- source: {
1345
- type: 'string',
1346
- enum: ['auto', 'text', 'vision', 'mixed'],
1347
- description:
1348
- 'Evidence source for extraction: auto chooses text or vision, text sends text only, vision sends image/PDF evidence only, mixed sends both.',
1349
- nullable: true,
1350
- },
1351
- instructions: {
1352
- type: 'string',
1353
- description: 'Type-specific extraction instructions such as pages or sections to ignore.',
1354
- nullable: true,
1355
- },
1356
- interaction: {
1357
- type: 'string',
1358
- description: 'Interaction id used for extraction. Omit to use the system extractor.',
1359
- nullable: true,
1360
- },
1361
- scope: IntakePageScopeSchema,
1362
- page_ranges: IntakePageRangesSchema,
1363
- max_pages: {
1364
- type: 'integer',
1365
- minimum: 1,
1366
- description: 'Cap on pages sent to extraction. Default 20.',
1367
- nullable: true,
1368
- },
1369
- vision: {
1370
- type: 'object',
1371
- description:
1372
- 'Vision evidence budget for visual extraction. Detail names reference platform-defined ' +
1373
- 'profiles; the type never sets dpi, quality, or resolution.',
1374
- nullable: true,
1375
- required: [],
1376
- additionalProperties: false,
1377
- properties: {
1378
- default_detail: {
1379
- type: 'string',
1380
- enum: ['low', 'standard', 'high'],
1381
- description: 'Detail profile used when the plan does not request one. Default standard.',
1382
- nullable: true,
1383
- },
1384
- allowed_details: {
1385
- type: 'array',
1386
- items: { type: 'string', enum: ['low', 'standard', 'high'] },
1387
- description: 'Detail profiles the plan may request. Others fall back to default_detail.',
1388
- nullable: true,
1389
- },
1390
- max_image_tokens: {
1391
- type: 'integer',
1392
- minimum: 1,
1393
- description: 'PRIMARY budget: estimated image tokens per extraction call. Default 16000.',
1394
- nullable: true,
1395
- },
1396
- max_payload_mb: {
1397
- type: 'number',
1398
- minimum: 1,
1399
- description: 'Transport guard in megabytes. Default 16.',
1400
- nullable: true,
1401
- },
1402
- max_pages_per_call: {
1403
- type: 'integer',
1404
- minimum: 1,
1405
- description: 'Cap on page images per extraction call. Default 8.',
1406
- nullable: true,
1407
- },
1408
- },
1409
- },
1410
- verification: {
1411
- type: 'object',
1412
- description: 'Optional safe-mode verification of extracted values against source evidence.',
1413
- nullable: true,
1414
- required: [],
1415
- additionalProperties: false,
1416
- properties: {
1417
- enabled: {
1418
- type: 'boolean',
1419
- description: 'Whether to verify extracted values after extraction.',
1420
- nullable: true,
1421
- },
1422
- model: { type: 'string', description: 'Verifier model override.', nullable: true },
1423
- environment: {
1424
- type: 'string',
1425
- description: 'Verifier environment override.',
1426
- nullable: true,
1427
- },
1428
- materiality: {
1429
- type: 'string',
1430
- description: 'What errors are material for this type.',
1431
- nullable: true,
1432
- },
1433
- threshold: {
1434
- type: 'number',
1435
- minimum: 0,
1436
- maximum: 1,
1437
- description: 'Minimum verification confidence before flag/block behavior applies.',
1438
- nullable: true,
1439
- },
1440
- max_retries: {
1441
- type: 'integer',
1442
- minimum: 0,
1443
- description: 'Maximum extraction retries when verification fails.',
1444
- nullable: true,
1445
- },
1446
- on_fail: {
1447
- type: 'string',
1448
- enum: ['flag', 'block'],
1449
- description: 'Failure behavior after retries: flag for review or block property write.',
1450
- nullable: true,
1451
- },
1452
- },
1453
- },
1454
- grounding: ContentTypeExtractionGroundingPolicySchema,
1455
- },
1456
- },
1457
- rendering_template: {
1458
- type: 'string',
1459
- description: 'Handlebars template used to materialize extracted properties into object text.',
1460
- nullable: true,
1461
- },
1462
- embeddings: {
1463
- type: 'object',
1464
- description: 'Per-type embedding switches. Omitted fields inherit the project embedding policy.',
1465
- nullable: true,
1466
- required: [],
1467
- additionalProperties: false,
1468
- properties: {
1469
- text: { type: 'boolean', description: 'Whether to generate text embeddings.', nullable: true },
1470
- image: { type: 'boolean', description: 'Whether to generate image embeddings.', nullable: true },
1471
- properties: {
1472
- type: 'boolean',
1473
- description: 'Whether to generate property embeddings.',
1474
- nullable: true,
1475
- },
1476
- },
1477
- },
1478
- generate_toc: {
1479
- type: 'boolean',
1480
- description: 'Whether intake should generate table-of-contents sections for this type.',
1481
- nullable: true,
1482
- },
1483
- default_view: {
1484
- type: 'string',
1485
- enum: ['auto', 'text', 'pdf', 'image', 'properties'],
1486
- description: 'Preferred first view for objects of this type.',
1487
- nullable: true,
1488
- },
1489
- },
1490
- } as unknown as JSONSchemaType<ContentTypeIntakePolicy>;
1491
-
1492
- export interface ContentObjectType extends ContentObjectTypeItem {}
1493
- export interface ContentObjectTypeItem extends BaseObject {
1494
- status?: ContentObjectTypeStatus;
1495
- is_chunkable?: boolean;
1496
- intake?: ContentTypeIntakePolicy;
1497
- /**
1498
- * This is only included in ContentObjectTypeItem if explicitly requested
1499
- * It is always included in ContentObjectType
1500
- */
1501
- table_layout?: ColumnLayout[];
1502
- /**
1503
- * this is only included in ContentObjectTypeItem if explicitly requested
1504
- * It is always included in ContentObjectType
1505
- */
1506
- object_schema?: Record<string, unknown>; // an optional JSON schema for the object properties.
1507
-
1508
- /**
1509
- * Determines if the content will be validated against the object schema a generation time and save/update time.
1510
- */
1511
- strict_mode?: boolean;
1512
- }
1513
- export type InCodeTypeDefinition = Pick<
1514
- ContentObjectTypeItem,
1515
- | 'id'
1516
- | 'name'
1517
- | 'description'
1518
- | 'tags'
1519
- | 'object_schema'
1520
- | 'table_layout'
1521
- | 'is_chunkable'
1522
- | 'strict_mode'
1523
- | 'status'
1524
- | 'intake'
650
+ export type ContentTypeExtractionGroundingReviewPolicy = z.infer<
651
+ typeof ContentTypeExtractionGroundingReviewPolicySchema
1525
652
  >;
1526
- export interface ContentObjectTypeCatalogEntry extends InCodeTypeDefinition {
1527
- updated_by?: string;
1528
- created_by?: string;
1529
- created_at?: string;
1530
- updated_at?: string;
1531
- }
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>;
1532
675
  /**
1533
676
  * The itnerface to be used whend efining types in a plugin app.
1534
677
  */
@@ -1543,61 +686,19 @@ export function isInCodeType(typeId: string): boolean {
1543
686
  return typeId.includes(':');
1544
687
  }
1545
688
 
1546
- export interface CreateContentObjectTypePayload
1547
- 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>;
1548
692
 
1549
693
  export enum WorkflowRuleInputType {
1550
694
  single = 'single',
1551
695
  multiple = 'multiple',
1552
696
  none = 'none',
1553
697
  }
1554
- export interface WorkflowRuleItem extends BaseObject {
1555
- // the name of the workflow function
1556
- endpoint: string;
1557
- input_type: WorkflowRuleInputType;
1558
- }
1559
- export interface WorkflowRule extends WorkflowRuleItem {
1560
- /*
1561
- * mongo matching rules for a content event
1562
- */
1563
- match?: Record<string, unknown>;
1564
- /**
1565
- * Activities configuration if any.
1566
- */
1567
- config?: Record<string, unknown>;
698
+ export type WorkflowRuleItem = z.infer<typeof WorkflowRuleItemSchema>;
699
+ export type WorkflowRule = z.infer<typeof WorkflowRuleSchema>;
1568
700
 
1569
- /**
1570
- * Debug mode for the rule
1571
- * @default false
1572
- */
1573
- debug?: boolean;
1574
-
1575
- /**
1576
- * Customer override for the rule
1577
- * When set to true the rule will not be updated by the system
1578
- */
1579
- customer_override?: boolean;
1580
-
1581
- /**
1582
- * Optional task queue name to use when starting workflows for this rule
1583
- */
1584
- task_queue?: string;
1585
-
1586
- /**
1587
- * Event subscription migration status for legacy workflow-rule cutover.
1588
- */
1589
- event_subscription_migration_status?: 'migrated' | 'unsupported_match' | 'failed';
1590
-
1591
- /**
1592
- * Migration failure or unsupported-match reason, when applicable.
1593
- */
1594
- event_subscription_migration_error?: string;
1595
- }
1596
-
1597
- export interface CreateWorkflowRulePayload extends UploadWorkflowRulePayload {
1598
- name: string; // required
1599
- endpoint: string; // required
1600
- }
701
+ export type CreateWorkflowRulePayload = z.infer<typeof CreateWorkflowRulePayloadSchema>;
1601
702
  export interface UploadWorkflowRulePayload
1602
703
  extends Partial<Omit<WorkflowRule, 'id' | 'created_at' | 'updated_at' | 'owner'>> {}
1603
704
 
@@ -1607,10 +708,12 @@ export enum ImageRenditionFormat {
1607
708
  webp = 'webp',
1608
709
  }
1609
710
 
1610
- export enum MarkdownRenditionFormat {
1611
- docx = 'docx',
1612
- pdf = 'pdf',
1613
- }
711
+ export const MarkdownRenditionFormat = {
712
+ docx: 'docx',
713
+ pdf: 'pdf',
714
+ } as const;
715
+
716
+ export type MarkdownRenditionFormat = z.infer<typeof MarkdownRenditionFormatSchema>;
1614
717
 
1615
718
  export interface GetRenditionParams {
1616
719
  format: ImageRenditionFormat | MarkdownRenditionFormat;
@@ -1620,17 +723,9 @@ export interface GetRenditionParams {
1620
723
  block_on_generation?: boolean;
1621
724
  }
1622
725
 
1623
- export interface GetRenditionResponse {
1624
- status: 'found' | 'generating' | 'failed';
1625
- renditions?: string[]; //file paths for the renditions
1626
- workflow_run_id?: string;
1627
- }
726
+ export type GetRenditionResponse = z.infer<typeof GetRenditionResponseSchema>;
1628
727
 
1629
- export interface ObjectSearchResponse {
1630
- results: ContentObjectItemApiResponse[];
1631
- facets: ComputedFacetResponse;
1632
- aggregations?: Record<string, unknown>;
1633
- }
728
+ export type ObjectSearchResponse = z.infer<typeof ObjectSearchResponseSchema>;
1634
729
 
1635
730
  // ============================================================================
1636
731
  // Rendition Format Compatibility Utilities
@@ -1744,127 +839,47 @@ export function supportsVisualRendition(contentType: string | undefined): boolea
1744
839
  return canGenerateRendition(contentType, ImageRenditionFormat.jpeg);
1745
840
  }
1746
841
 
1747
- export interface GetUploadUrlPayload {
1748
- name: string;
1749
- id?: string;
1750
- mime_type?: string;
1751
- ttl?: number;
1752
- }
842
+ export type GetUploadUrlPayload = z.infer<typeof GetUploadUrlPayloadSchema>;
1753
843
 
1754
- export interface GetFileUrlPayload {
1755
- file: string;
1756
- // Optional filename to use in Content-Disposition for downloads
1757
- name?: string;
1758
- // Optional disposition for downloads (default: attachment)
1759
- disposition?: 'inline' | 'attachment';
1760
- }
844
+ export type GetFileUrlPayload = z.infer<typeof GetFileUrlPayloadSchema>;
1761
845
 
1762
- export interface GetFileUrlResponse {
1763
- url: string;
1764
- id: string;
1765
- mime_type?: string;
1766
- path: string;
1767
- }
846
+ export type GetFileUrlResponse = z.infer<typeof GetFileUrlResponseSchema>;
1768
847
 
1769
- export interface EnsureBucketReadAccessPayload {
1770
- principal: string;
1771
- }
848
+ export type EnsureBucketReadAccessPayload = z.infer<typeof EnsureBucketReadAccessPayloadSchema>;
1772
849
 
1773
- export interface EnsureBucketReadAccessResponse {
1774
- bucket: string;
1775
- principal: string;
1776
- granted: boolean;
1777
- }
850
+ export type EnsureBucketReadAccessResponse = z.infer<typeof EnsureBucketReadAccessResponseSchema>;
1778
851
 
1779
- export interface BucketReadAccessStatusResponse {
1780
- bucket: string;
1781
- principal: string;
1782
- hasAccess: boolean;
1783
- }
852
+ export type BucketReadAccessStatusResponse = z.infer<typeof BucketReadAccessStatusResponseSchema>;
1784
853
 
1785
- export interface FileMetadataResponse {
1786
- name: string;
1787
- size: number;
1788
- contentType: string;
1789
- contentDisposition?: string;
1790
- etag?: string;
1791
- customMetadata?: Record<string, string>;
1792
- }
854
+ export type FileMetadataResponse = z.infer<typeof FileMetadataResponseSchema>;
1793
855
 
1794
- export interface SetFileMetadataPayload {
1795
- /** The file path (relative to bucket) or full URI */
1796
- file: string;
1797
- /** Custom metadata key-value pairs to set on the file */
1798
- metadata: Record<string, string>;
1799
- }
856
+ export type SetFileMetadataPayload = z.infer<typeof SetFileMetadataPayloadSchema>;
1800
857
 
1801
- export interface FileMetadataUpdateResult {
1802
- success: boolean;
1803
- file: string;
1804
- }
858
+ export type FileMetadataUpdateResult = z.infer<typeof FileMetadataUpdateResultSchema>;
1805
859
 
1806
- export interface BulkUploadUrlsPayload {
1807
- files: { name: string; mime_type?: string; id?: string }[];
1808
- }
860
+ export type BulkUploadUrlsPayload = z.infer<typeof BulkUploadUrlsPayloadSchema>;
1809
861
 
1810
- export interface BulkUploadUrlsResponse {
1811
- files: GetFileUrlResponse[];
1812
- }
862
+ export type BulkUploadUrlsResponse = z.infer<typeof BulkUploadUrlsResponseSchema>;
1813
863
 
1814
- export interface FileBucketResponse {
1815
- bucket: string;
1816
- }
864
+ export type FileBucketResponse = z.infer<typeof FileBucketResponseSchema>;
1817
865
 
1818
- export interface FileListResponse {
1819
- files: string[];
1820
- }
866
+ export type FileListResponse = z.infer<typeof FileListResponseSchema>;
1821
867
 
1822
- export interface FileMetadataQuery {
1823
- file: string;
1824
- }
868
+ export type FileMetadataQuery = z.infer<typeof FileMetadataQuerySchema>;
1825
869
 
1826
- export interface FileListQuery {
1827
- prefix: string;
1828
- }
870
+ export type FileListQuery = z.infer<typeof FileListQuerySchema>;
1829
871
 
1830
- export interface FileDeleteQuery {
1831
- prefix?: boolean;
1832
- }
872
+ export type FileDeleteQuery = z.infer<typeof FileDeleteQuerySchema>;
1833
873
 
1834
- export interface ContentObjectTypeCatalogQuery {
1835
- tag?: string;
1836
- layout?: boolean;
1837
- schema?: boolean;
1838
- limit?: number;
1839
- offset?: number;
1840
- }
874
+ export type ContentObjectTypeCatalogQuery = z.infer<typeof ContentObjectTypeCatalogQuerySchema>;
1841
875
 
1842
- export interface ContentObjectTypeListQuery {
1843
- name?: string;
1844
- chunkable?: boolean;
1845
- layout?: boolean;
1846
- schema?: boolean;
1847
- limit?: number;
1848
- offset?: number;
1849
- }
876
+ export type ContentObjectTypeListQuery = z.infer<typeof ContentObjectTypeListQuerySchema>;
1850
877
 
1851
- export interface CopyFilePayload {
1852
- source: string;
1853
- dest: string;
1854
- }
878
+ export type CopyFilePayload = z.infer<typeof CopyFilePayloadSchema>;
1855
879
 
1856
- export interface CopyFileResponse {
1857
- success: boolean;
1858
- source: string;
1859
- dest: string;
1860
- }
880
+ export type CopyFileResponse = z.infer<typeof CopyFileResponseSchema>;
1861
881
 
1862
- export interface DeleteFileResult {
1863
- success: boolean;
1864
- count: number;
1865
- message?: string;
1866
- file?: string;
1867
- }
882
+ export type DeleteFileResult = z.infer<typeof DeleteFileResultSchema>;
1868
883
 
1869
884
  export enum ContentObjectProcessingPriority {
1870
885
  normal = 'normal',