@vertesia/common 1.2.0 → 1.4.0-dev.20260614.160504Z

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 (634) hide show
  1. package/LICENSE +198 -10
  2. package/lib/{types/Progress.d.ts → Progress.d.ts} +1 -0
  3. package/lib/Progress.d.ts.map +1 -0
  4. package/lib/{esm/Progress.js → Progress.js} +2 -2
  5. package/lib/Progress.js.map +1 -0
  6. package/lib/access-control.d.ts +144 -0
  7. package/lib/access-control.d.ts.map +1 -0
  8. package/lib/{esm/access-control.js → access-control.js} +35 -0
  9. package/lib/access-control.js.map +1 -0
  10. package/lib/agent-request-template.d.ts +4 -0
  11. package/lib/agent-request-template.d.ts.map +1 -0
  12. package/lib/agent-request-template.js +46 -0
  13. package/lib/agent-request-template.js.map +1 -0
  14. package/lib/{types/analytics.d.ts → analytics.d.ts} +3 -2
  15. package/lib/analytics.d.ts.map +1 -0
  16. package/lib/{cjs/analytics.js.map → analytics.js.map} +1 -1
  17. package/lib/{types/apikey.d.ts → apikey.d.ts} +34 -4
  18. package/lib/apikey.d.ts.map +1 -0
  19. package/lib/{esm/apikey.js → apikey.js} +1 -0
  20. package/lib/apikey.js.map +1 -0
  21. package/lib/{types/apps.d.ts → apps.d.ts} +430 -35
  22. package/lib/apps.d.ts.map +1 -0
  23. package/lib/apps.js +158 -0
  24. package/lib/apps.js.map +1 -0
  25. package/lib/{types/ask-user.d.ts → ask-user.d.ts} +1 -0
  26. package/lib/ask-user.d.ts.map +1 -0
  27. package/lib/{esm/ask-user.js.map → ask-user.js.map} +1 -1
  28. package/lib/{types/audit-trail.d.ts → audit-trail.d.ts} +2 -1
  29. package/lib/audit-trail.d.ts.map +1 -0
  30. package/lib/audit-trail.js +3 -0
  31. package/lib/audit-trail.js.map +1 -0
  32. package/lib/browser-credentials.d.ts +123 -0
  33. package/lib/browser-credentials.d.ts.map +1 -0
  34. package/lib/browser-credentials.js +2 -0
  35. package/lib/browser-credentials.js.map +1 -0
  36. package/lib/{types/channels.d.ts → channels.d.ts} +3 -2
  37. package/lib/channels.d.ts.map +1 -0
  38. package/lib/{esm/channels.js → channels.js} +3 -3
  39. package/lib/channels.js.map +1 -0
  40. package/lib/{types/common.d.ts → common.d.ts} +18 -10
  41. package/lib/common.d.ts.map +1 -0
  42. package/lib/common.js.map +1 -0
  43. package/lib/{types/cost-analytics.d.ts → cost-analytics.d.ts} +2 -3
  44. package/lib/cost-analytics.d.ts.map +1 -0
  45. package/lib/cost-analytics.js.map +1 -0
  46. package/lib/{types/data-platform.d.ts → data-platform.d.ts} +134 -7
  47. package/lib/data-platform.d.ts.map +1 -0
  48. package/lib/data-platform.js.map +1 -0
  49. package/lib/{types/email.d.ts → email.d.ts} +6 -2
  50. package/lib/email.d.ts.map +1 -0
  51. package/lib/{esm/email.js → email.js} +2 -2
  52. package/lib/email.js.map +1 -0
  53. package/lib/embeddings.d.ts +65 -0
  54. package/lib/embeddings.d.ts.map +1 -0
  55. package/lib/embeddings.js +2 -0
  56. package/lib/embeddings.js.map +1 -0
  57. package/lib/{types/environment.d.ts → environment.d.ts} +19 -5
  58. package/lib/environment.d.ts.map +1 -0
  59. package/lib/{esm/environment.js → environment.js} +17 -7
  60. package/lib/environment.js.map +1 -0
  61. package/lib/{types/facets.d.ts → facets.d.ts} +6 -5
  62. package/lib/facets.d.ts.map +1 -0
  63. package/lib/facets.js.map +1 -0
  64. package/lib/{types/group.d.ts → group.d.ts} +15 -2
  65. package/lib/group.d.ts.map +1 -0
  66. package/lib/group.js +3 -0
  67. package/lib/group.js.map +1 -0
  68. package/lib/host-utils.d.ts +8 -0
  69. package/lib/host-utils.d.ts.map +1 -0
  70. package/lib/host-utils.js +84 -0
  71. package/lib/host-utils.js.map +1 -0
  72. package/lib/{types/index.d.ts → index.d.ts} +19 -10
  73. package/lib/index.d.ts.map +1 -0
  74. package/lib/{esm/index.js → index.js} +18 -10
  75. package/lib/index.js.map +1 -0
  76. package/lib/integrations.d.ts +151 -0
  77. package/lib/integrations.d.ts.map +1 -0
  78. package/lib/{esm/integrations.js → integrations.js} +6 -0
  79. package/lib/integrations.js.map +1 -0
  80. package/lib/{types/interaction.d.ts → interaction.d.ts} +99 -56
  81. package/lib/interaction.d.ts.map +1 -0
  82. package/lib/{esm/interaction.js → interaction.js} +3 -3
  83. package/lib/interaction.js.map +1 -0
  84. package/lib/json-schema.d.ts +2 -0
  85. package/lib/json-schema.d.ts.map +1 -0
  86. package/lib/{cjs/json-schema.js.map → json-schema.js.map} +1 -1
  87. package/lib/json.d.ts +2 -0
  88. package/lib/json.d.ts.map +1 -0
  89. package/lib/json.js.map +1 -0
  90. package/lib/{types/meters.d.ts → meters.d.ts} +2 -1
  91. package/lib/meters.d.ts.map +1 -0
  92. package/lib/meters.js.map +1 -0
  93. package/lib/model_utility.d.ts +2 -0
  94. package/lib/model_utility.d.ts.map +1 -0
  95. package/lib/model_utility.js +2 -0
  96. package/lib/model_utility.js.map +1 -0
  97. package/lib/oauth-scopes.d.ts +18 -0
  98. package/lib/oauth-scopes.d.ts.map +1 -0
  99. package/lib/oauth-scopes.js +57 -0
  100. package/lib/oauth-scopes.js.map +1 -0
  101. package/lib/{types/oauth-server.d.ts → oauth-server.d.ts} +64 -4
  102. package/lib/oauth-server.d.ts.map +1 -0
  103. package/lib/{cjs/oauth-server.js.map → oauth-server.js.map} +1 -1
  104. package/lib/{types/oauth.d.ts → oauth.d.ts} +1 -0
  105. package/lib/oauth.d.ts.map +1 -0
  106. package/lib/oauth.js.map +1 -0
  107. package/lib/{types/payload.d.ts → payload.d.ts} +5 -4
  108. package/lib/payload.d.ts.map +1 -0
  109. package/lib/{cjs/payload.js.map → payload.js.map} +1 -1
  110. package/lib/{types/pending-asks.d.ts → pending-asks.d.ts} +8 -1
  111. package/lib/pending-asks.d.ts.map +1 -0
  112. package/lib/pending-asks.js.map +1 -0
  113. package/lib/principal-context.d.ts +27 -0
  114. package/lib/principal-context.d.ts.map +1 -0
  115. package/lib/principal-context.js +2 -0
  116. package/lib/principal-context.js.map +1 -0
  117. package/lib/{types/project.d.ts → project.d.ts} +278 -49
  118. package/lib/project.d.ts.map +1 -0
  119. package/lib/project.js +230 -0
  120. package/lib/project.js.map +1 -0
  121. package/lib/{types/prompt.d.ts → prompt.d.ts} +16 -9
  122. package/lib/prompt.d.ts.map +1 -0
  123. package/lib/prompt.js.map +1 -0
  124. package/lib/{types/query.d.ts → query.d.ts} +11 -8
  125. package/lib/query.d.ts.map +1 -0
  126. package/lib/query.js.map +1 -0
  127. package/lib/{types/rate-limiter.d.ts → rate-limiter.d.ts} +1 -0
  128. package/lib/rate-limiter.d.ts.map +1 -0
  129. package/lib/rate-limiter.js.map +1 -0
  130. package/lib/{types/refs.d.ts → refs.d.ts} +1 -0
  131. package/lib/refs.d.ts.map +1 -0
  132. package/lib/refs.js.map +1 -0
  133. package/lib/roles.d.ts +19 -0
  134. package/lib/roles.d.ts.map +1 -0
  135. package/lib/roles.js +228 -0
  136. package/lib/roles.js.map +1 -0
  137. package/lib/{types/runs.d.ts → runs.d.ts} +3 -2
  138. package/lib/runs.d.ts.map +1 -0
  139. package/lib/runs.js.map +1 -0
  140. package/lib/secrets.d.ts +47 -0
  141. package/lib/secrets.d.ts.map +1 -0
  142. package/lib/secrets.js +2 -0
  143. package/lib/secrets.js.map +1 -0
  144. package/lib/{types/skill.d.ts → skill.d.ts} +2 -1
  145. package/lib/skill.d.ts.map +1 -0
  146. package/lib/skill.js.map +1 -0
  147. package/lib/{types/store → store}/activity-catalog.d.ts +2 -1
  148. package/lib/store/activity-catalog.d.ts.map +1 -0
  149. package/lib/store/activity-catalog.js.map +1 -0
  150. package/lib/{types/store → store}/agent-run.d.ts +206 -35
  151. package/lib/store/agent-run.d.ts.map +1 -0
  152. package/lib/store/agent-run.js.map +1 -0
  153. package/lib/{types/store → store}/collections.d.ts +18 -9
  154. package/lib/store/collections.d.ts.map +1 -0
  155. package/lib/store/collections.js.map +1 -0
  156. package/lib/{types/store → store}/common.d.ts +1 -0
  157. package/lib/store/common.d.ts.map +1 -0
  158. package/lib/{cjs → store}/common.js.map +1 -1
  159. package/lib/{types/store → store}/conversation-state.d.ts +36 -5
  160. package/lib/store/conversation-state.d.ts.map +1 -0
  161. package/lib/{esm/store → store}/conversation-state.js +3 -0
  162. package/lib/store/conversation-state.js.map +1 -0
  163. package/lib/{types/store → store}/doc-analyzer.d.ts +20 -14
  164. package/lib/store/doc-analyzer.d.ts.map +1 -0
  165. package/lib/{cjs/store → store}/doc-analyzer.js.map +1 -1
  166. package/lib/{types/store → store}/dsl-workflow.d.ts +42 -24
  167. package/lib/store/dsl-workflow.d.ts.map +1 -0
  168. package/lib/store/dsl-workflow.js +8 -0
  169. package/lib/store/dsl-workflow.js.map +1 -0
  170. package/lib/{types/store → store}/hive-memory.d.ts +2 -1
  171. package/lib/store/hive-memory.d.ts.map +1 -0
  172. package/lib/{cjs/store → store}/hive-memory.js.map +1 -1
  173. package/lib/store/index.d.ts +20 -0
  174. package/lib/store/index.d.ts.map +1 -0
  175. package/lib/store/index.js +20 -0
  176. package/lib/store/index.js.map +1 -0
  177. package/lib/{types/store → store}/object-types.d.ts +2 -1
  178. package/lib/store/object-types.d.ts.map +1 -0
  179. package/lib/store/object-types.js +95 -0
  180. package/lib/store/object-types.js.map +1 -0
  181. package/lib/store/process-schema.d.ts +481 -0
  182. package/lib/store/process-schema.d.ts.map +1 -0
  183. package/lib/store/process-schema.js +482 -0
  184. package/lib/store/process-schema.js.map +1 -0
  185. package/lib/store/process-validation.d.ts +17 -0
  186. package/lib/store/process-validation.d.ts.map +1 -0
  187. package/lib/store/process-validation.js +428 -0
  188. package/lib/store/process-validation.js.map +1 -0
  189. package/lib/store/process.d.ts +261 -0
  190. package/lib/store/process.d.ts.map +1 -0
  191. package/lib/store/process.js +2 -0
  192. package/lib/store/process.js.map +1 -0
  193. package/lib/{types/store → store}/rendering.d.ts +5 -4
  194. package/lib/store/rendering.d.ts.map +1 -0
  195. package/lib/{esm/store → store}/rendering.js +6 -6
  196. package/lib/store/rendering.js.map +1 -0
  197. package/lib/{types/store → store}/schedule.d.ts +4 -3
  198. package/lib/store/schedule.d.ts.map +1 -0
  199. package/lib/store/schedule.js.map +1 -0
  200. package/lib/{types/store → store}/signals.d.ts +2 -1
  201. package/lib/store/signals.d.ts.map +1 -0
  202. package/lib/{cjs/store → store}/signals.js.map +1 -1
  203. package/lib/{types/store → store}/store.d.ts +67 -38
  204. package/lib/store/store.d.ts.map +1 -0
  205. package/lib/{esm/store → store}/store.js +17 -8
  206. package/lib/store/store.js.map +1 -0
  207. package/lib/store/task.d.ts +63 -0
  208. package/lib/store/task.d.ts.map +1 -0
  209. package/lib/store/task.js +5 -0
  210. package/lib/store/task.js.map +1 -0
  211. package/lib/store/temporalio.d.ts +17 -0
  212. package/lib/store/temporalio.d.ts.map +1 -0
  213. package/lib/{esm/store → store}/temporalio.js +6 -6
  214. package/lib/store/temporalio.js.map +1 -0
  215. package/lib/{types/store → store}/workflow.d.ts +87 -33
  216. package/lib/store/workflow.d.ts.map +1 -0
  217. package/lib/{esm/store → store}/workflow.js +36 -37
  218. package/lib/store/workflow.js.map +1 -0
  219. package/lib/{types/sts-token-types.d.ts → sts-token-types.d.ts} +29 -2
  220. package/lib/sts-token-types.d.ts.map +1 -0
  221. package/lib/{esm/sts-token-types.js → sts-token-types.js} +0 -4
  222. package/lib/sts-token-types.js.map +1 -0
  223. package/lib/{types/tenant.d.ts → tenant.d.ts} +1 -0
  224. package/lib/tenant.d.ts.map +1 -0
  225. package/lib/tenant.js.map +1 -0
  226. package/lib/{types/tool-execution.d.ts → tool-execution.d.ts} +3 -2
  227. package/lib/tool-execution.d.ts.map +1 -0
  228. package/lib/tool-execution.js.map +1 -0
  229. package/lib/tools.d.ts +101 -0
  230. package/lib/tools.d.ts.map +1 -0
  231. package/lib/tools.js +2 -0
  232. package/lib/tools.js.map +1 -0
  233. package/lib/{types/training.d.ts → training.d.ts} +10 -9
  234. package/lib/training.d.ts.map +1 -0
  235. package/lib/training.js.map +1 -0
  236. package/lib/{types/transient-tokens.d.ts → transient-tokens.d.ts} +3 -2
  237. package/lib/transient-tokens.d.ts.map +1 -0
  238. package/lib/transient-tokens.js.map +1 -0
  239. package/lib/{types/user.d.ts → user.d.ts} +13 -7
  240. package/lib/user.d.ts.map +1 -0
  241. package/lib/{esm/user.js → user.js} +2 -2
  242. package/lib/user.js.map +1 -0
  243. package/lib/{types/utils → utils}/auth.d.ts +2 -1
  244. package/lib/utils/auth.d.ts.map +1 -0
  245. package/lib/{esm/utils → utils}/auth.js +1 -1
  246. package/lib/utils/auth.js.map +1 -0
  247. package/lib/{types/utils → utils}/schemas.d.ts +5 -4
  248. package/lib/utils/schemas.d.ts.map +1 -0
  249. package/lib/{esm/utils → utils}/schemas.js +24 -22
  250. package/lib/utils/schemas.js.map +1 -0
  251. package/lib/{types/utils → utils}/type-helpers.d.ts +1 -0
  252. package/lib/utils/type-helpers.d.ts.map +1 -0
  253. package/lib/{cjs/utils → utils}/type-helpers.js.map +1 -1
  254. package/lib/{types/versions.d.ts → versions.d.ts} +1 -0
  255. package/lib/versions.d.ts.map +1 -0
  256. package/lib/versions.js.map +1 -0
  257. package/lib/vertesia-common.js +1 -1
  258. package/lib/vertesia-common.js.map +1 -1
  259. package/lib/{types/workflow-analytics.d.ts → workflow-analytics.d.ts} +10 -3
  260. package/lib/workflow-analytics.d.ts.map +1 -0
  261. package/lib/workflow-analytics.js.map +1 -0
  262. package/package.json +20 -20
  263. package/src/Progress.ts +9 -7
  264. package/src/access-control.ts +124 -55
  265. package/src/agent-request-template.test.ts +40 -0
  266. package/src/agent-request-template.ts +45 -0
  267. package/src/analytics.ts +11 -16
  268. package/src/apikey.ts +43 -11
  269. package/src/apps.test.ts +37 -0
  270. package/src/apps.ts +562 -78
  271. package/src/audit-trail.ts +3 -5
  272. package/src/browser-credentials.ts +133 -0
  273. package/src/channels.ts +5 -5
  274. package/src/common.ts +17 -11
  275. package/src/cost-analytics.ts +10 -4
  276. package/src/data-platform.ts +142 -7
  277. package/src/email.ts +7 -4
  278. package/src/embeddings.ts +76 -0
  279. package/src/environment.ts +44 -25
  280. package/src/facets.ts +19 -21
  281. package/src/group.ts +14 -3
  282. package/src/host-utils.test.ts +61 -0
  283. package/src/host-utils.ts +93 -0
  284. package/src/index.ts +18 -10
  285. package/src/integrations.ts +134 -26
  286. package/src/interaction.ts +185 -141
  287. package/src/json-schema.ts +1 -1
  288. package/src/json.ts +6 -3
  289. package/src/meters.ts +6 -9
  290. package/src/model_utility.ts +1 -1
  291. package/src/oauth-scopes.ts +72 -0
  292. package/src/oauth-server.ts +80 -5
  293. package/src/payload.ts +6 -6
  294. package/src/pending-asks.ts +8 -1
  295. package/src/principal-context.ts +27 -0
  296. package/src/project.ts +408 -101
  297. package/src/prompt.ts +30 -27
  298. package/src/query.ts +19 -17
  299. package/src/rate-limiter.ts +1 -1
  300. package/src/refs.ts +19 -24
  301. package/src/roles.test.ts +30 -0
  302. package/src/roles.ts +251 -0
  303. package/src/runs.ts +14 -15
  304. package/src/secrets.ts +60 -0
  305. package/src/skill.ts +1 -2
  306. package/src/store/activity-catalog.ts +13 -1
  307. package/src/store/agent-run.ts +269 -42
  308. package/src/store/collections.ts +21 -13
  309. package/src/store/common.ts +1 -2
  310. package/src/store/conversation-state.ts +42 -5
  311. package/src/store/doc-analyzer.ts +22 -14
  312. package/src/store/dsl-workflow.ts +54 -29
  313. package/src/store/hive-memory.ts +10 -10
  314. package/src/store/index.ts +19 -17
  315. package/src/store/ms.d.ts +34 -3
  316. package/src/store/object-types.ts +75 -79
  317. package/src/store/process-schema.test.ts +106 -0
  318. package/src/store/process-schema.ts +485 -0
  319. package/src/store/process-validation.test.ts +432 -0
  320. package/src/store/process-validation.ts +548 -0
  321. package/src/store/process.ts +305 -0
  322. package/src/store/rendering.ts +12 -12
  323. package/src/store/schedule.ts +3 -3
  324. package/src/store/signals.ts +1 -1
  325. package/src/store/store.ts +119 -89
  326. package/src/store/task.ts +71 -0
  327. package/src/store/temporalio.ts +14 -14
  328. package/src/store/workflow.test.ts +16 -14
  329. package/src/store/workflow.ts +177 -119
  330. package/src/sts-token-types.ts +30 -4
  331. package/src/tool-execution.ts +2 -2
  332. package/src/tools.ts +103 -0
  333. package/src/training.ts +25 -27
  334. package/src/transient-tokens.ts +4 -7
  335. package/src/user.ts +25 -35
  336. package/src/utils/auth.ts +2 -2
  337. package/src/utils/schemas.ts +36 -31
  338. package/src/utils/type-helpers.ts +2 -4
  339. package/src/workflow-analytics.ts +15 -18
  340. package/lib/cjs/Progress.js +0 -61
  341. package/lib/cjs/Progress.js.map +0 -1
  342. package/lib/cjs/access-control.js +0 -58
  343. package/lib/cjs/access-control.js.map +0 -1
  344. package/lib/cjs/analytics.js +0 -3
  345. package/lib/cjs/apikey.js +0 -17
  346. package/lib/cjs/apikey.js.map +0 -1
  347. package/lib/cjs/apps.js +0 -89
  348. package/lib/cjs/apps.js.map +0 -1
  349. package/lib/cjs/ask-user.js +0 -8
  350. package/lib/cjs/ask-user.js.map +0 -1
  351. package/lib/cjs/audit-trail.js +0 -10
  352. package/lib/cjs/audit-trail.js.map +0 -1
  353. package/lib/cjs/channels.js +0 -63
  354. package/lib/cjs/channels.js.map +0 -1
  355. package/lib/cjs/common.js +0 -3
  356. package/lib/cjs/cost-analytics.js +0 -13
  357. package/lib/cjs/cost-analytics.js.map +0 -1
  358. package/lib/cjs/data-platform.js +0 -127
  359. package/lib/cjs/data-platform.js.map +0 -1
  360. package/lib/cjs/email.js +0 -20
  361. package/lib/cjs/email.js.map +0 -1
  362. package/lib/cjs/environment.js +0 -44
  363. package/lib/cjs/environment.js.map +0 -1
  364. package/lib/cjs/facets.js +0 -3
  365. package/lib/cjs/facets.js.map +0 -1
  366. package/lib/cjs/group.js +0 -6
  367. package/lib/cjs/group.js.map +0 -1
  368. package/lib/cjs/index.js +0 -60
  369. package/lib/cjs/index.js.map +0 -1
  370. package/lib/cjs/integrations.js +0 -16
  371. package/lib/cjs/integrations.js.map +0 -1
  372. package/lib/cjs/interaction.js +0 -101
  373. package/lib/cjs/interaction.js.map +0 -1
  374. package/lib/cjs/json-schema.js +0 -3
  375. package/lib/cjs/json.js +0 -3
  376. package/lib/cjs/json.js.map +0 -1
  377. package/lib/cjs/meters.js +0 -13
  378. package/lib/cjs/meters.js.map +0 -1
  379. package/lib/cjs/model_utility.js +0 -6
  380. package/lib/cjs/model_utility.js.map +0 -1
  381. package/lib/cjs/oauth-server.js +0 -3
  382. package/lib/cjs/oauth.js +0 -7
  383. package/lib/cjs/oauth.js.map +0 -1
  384. package/lib/cjs/openapi.js +0 -3
  385. package/lib/cjs/openapi.js.map +0 -1
  386. package/lib/cjs/package.json +0 -3
  387. package/lib/cjs/payload.js +0 -3
  388. package/lib/cjs/pending-asks.js +0 -7
  389. package/lib/cjs/pending-asks.js.map +0 -1
  390. package/lib/cjs/project.js +0 -143
  391. package/lib/cjs/project.js.map +0 -1
  392. package/lib/cjs/prompt.js +0 -21
  393. package/lib/cjs/prompt.js.map +0 -1
  394. package/lib/cjs/query.js +0 -3
  395. package/lib/cjs/query.js.map +0 -1
  396. package/lib/cjs/rate-limiter.js +0 -6
  397. package/lib/cjs/rate-limiter.js.map +0 -1
  398. package/lib/cjs/refs.js +0 -14
  399. package/lib/cjs/refs.js.map +0 -1
  400. package/lib/cjs/runs.js +0 -3
  401. package/lib/cjs/runs.js.map +0 -1
  402. package/lib/cjs/skill.js +0 -14
  403. package/lib/cjs/skill.js.map +0 -1
  404. package/lib/cjs/store/activity-catalog.js +0 -3
  405. package/lib/cjs/store/activity-catalog.js.map +0 -1
  406. package/lib/cjs/store/agent-run.js +0 -16
  407. package/lib/cjs/store/agent-run.js.map +0 -1
  408. package/lib/cjs/store/collections.js +0 -9
  409. package/lib/cjs/store/collections.js.map +0 -1
  410. package/lib/cjs/store/common.js +0 -3
  411. package/lib/cjs/store/common.js.map +0 -1
  412. package/lib/cjs/store/conversation-state.js +0 -19
  413. package/lib/cjs/store/conversation-state.js.map +0 -1
  414. package/lib/cjs/store/doc-analyzer.js +0 -3
  415. package/lib/cjs/store/dsl-workflow.js +0 -5
  416. package/lib/cjs/store/dsl-workflow.js.map +0 -1
  417. package/lib/cjs/store/hive-memory.js +0 -3
  418. package/lib/cjs/store/index.js +0 -33
  419. package/lib/cjs/store/index.js.map +0 -1
  420. package/lib/cjs/store/object-types.js +0 -98
  421. package/lib/cjs/store/object-types.js.map +0 -1
  422. package/lib/cjs/store/rendering.js +0 -26
  423. package/lib/cjs/store/rendering.js.map +0 -1
  424. package/lib/cjs/store/schedule.js +0 -32
  425. package/lib/cjs/store/schedule.js.map +0 -1
  426. package/lib/cjs/store/signals.js +0 -3
  427. package/lib/cjs/store/store.js +0 -182
  428. package/lib/cjs/store/store.js.map +0 -1
  429. package/lib/cjs/store/temporalio.js +0 -44
  430. package/lib/cjs/store/temporalio.js.map +0 -1
  431. package/lib/cjs/store/worker.js +0 -3
  432. package/lib/cjs/store/worker.js.map +0 -1
  433. package/lib/cjs/store/workflow.js +0 -306
  434. package/lib/cjs/store/workflow.js.map +0 -1
  435. package/lib/cjs/sts-token-types.js +0 -32
  436. package/lib/cjs/sts-token-types.js.map +0 -1
  437. package/lib/cjs/tenant.js +0 -3
  438. package/lib/cjs/tenant.js.map +0 -1
  439. package/lib/cjs/tool-execution.js +0 -6
  440. package/lib/cjs/tool-execution.js.map +0 -1
  441. package/lib/cjs/training.js +0 -14
  442. package/lib/cjs/training.js.map +0 -1
  443. package/lib/cjs/transient-tokens.js +0 -9
  444. package/lib/cjs/transient-tokens.js.map +0 -1
  445. package/lib/cjs/user.js +0 -26
  446. package/lib/cjs/user.js.map +0 -1
  447. package/lib/cjs/utils/auth.js +0 -15
  448. package/lib/cjs/utils/auth.js.map +0 -1
  449. package/lib/cjs/utils/schemas.js +0 -182
  450. package/lib/cjs/utils/schemas.js.map +0 -1
  451. package/lib/cjs/utils/type-helpers.js +0 -3
  452. package/lib/cjs/versions.js +0 -10
  453. package/lib/cjs/versions.js.map +0 -1
  454. package/lib/cjs/workflow-analytics.js +0 -52
  455. package/lib/cjs/workflow-analytics.js.map +0 -1
  456. package/lib/esm/Progress.js.map +0 -1
  457. package/lib/esm/access-control.js.map +0 -1
  458. package/lib/esm/analytics.js.map +0 -1
  459. package/lib/esm/apikey.js.map +0 -1
  460. package/lib/esm/apps.js +0 -79
  461. package/lib/esm/apps.js.map +0 -1
  462. package/lib/esm/audit-trail.js +0 -7
  463. package/lib/esm/audit-trail.js.map +0 -1
  464. package/lib/esm/channels.js.map +0 -1
  465. package/lib/esm/common.js.map +0 -1
  466. package/lib/esm/cost-analytics.js.map +0 -1
  467. package/lib/esm/data-platform.js.map +0 -1
  468. package/lib/esm/email.js.map +0 -1
  469. package/lib/esm/environment.js.map +0 -1
  470. package/lib/esm/facets.js.map +0 -1
  471. package/lib/esm/group.js +0 -3
  472. package/lib/esm/group.js.map +0 -1
  473. package/lib/esm/index.js.map +0 -1
  474. package/lib/esm/integrations.js.map +0 -1
  475. package/lib/esm/interaction.js.map +0 -1
  476. package/lib/esm/json-schema.js.map +0 -1
  477. package/lib/esm/json.js.map +0 -1
  478. package/lib/esm/meters.js.map +0 -1
  479. package/lib/esm/model_utility.js +0 -2
  480. package/lib/esm/model_utility.js.map +0 -1
  481. package/lib/esm/oauth-server.js.map +0 -1
  482. package/lib/esm/oauth.js.map +0 -1
  483. package/lib/esm/openapi.js +0 -2
  484. package/lib/esm/openapi.js.map +0 -1
  485. package/lib/esm/payload.js.map +0 -1
  486. package/lib/esm/pending-asks.js.map +0 -1
  487. package/lib/esm/project.js +0 -138
  488. package/lib/esm/project.js.map +0 -1
  489. package/lib/esm/prompt.js.map +0 -1
  490. package/lib/esm/query.js.map +0 -1
  491. package/lib/esm/rate-limiter.js.map +0 -1
  492. package/lib/esm/refs.js.map +0 -1
  493. package/lib/esm/runs.js.map +0 -1
  494. package/lib/esm/skill.js.map +0 -1
  495. package/lib/esm/store/activity-catalog.js.map +0 -1
  496. package/lib/esm/store/agent-run.js.map +0 -1
  497. package/lib/esm/store/collections.js.map +0 -1
  498. package/lib/esm/store/common.js.map +0 -1
  499. package/lib/esm/store/conversation-state.js.map +0 -1
  500. package/lib/esm/store/doc-analyzer.js.map +0 -1
  501. package/lib/esm/store/dsl-workflow.js +0 -2
  502. package/lib/esm/store/dsl-workflow.js.map +0 -1
  503. package/lib/esm/store/hive-memory.js.map +0 -1
  504. package/lib/esm/store/index.js +0 -17
  505. package/lib/esm/store/index.js.map +0 -1
  506. package/lib/esm/store/object-types.js +0 -95
  507. package/lib/esm/store/object-types.js.map +0 -1
  508. package/lib/esm/store/rendering.js.map +0 -1
  509. package/lib/esm/store/schedule.js.map +0 -1
  510. package/lib/esm/store/signals.js.map +0 -1
  511. package/lib/esm/store/store.js.map +0 -1
  512. package/lib/esm/store/temporalio.js.map +0 -1
  513. package/lib/esm/store/worker.js +0 -2
  514. package/lib/esm/store/worker.js.map +0 -1
  515. package/lib/esm/store/workflow.js.map +0 -1
  516. package/lib/esm/sts-token-types.js.map +0 -1
  517. package/lib/esm/tenant.js.map +0 -1
  518. package/lib/esm/tool-execution.js.map +0 -1
  519. package/lib/esm/training.js.map +0 -1
  520. package/lib/esm/transient-tokens.js.map +0 -1
  521. package/lib/esm/user.js.map +0 -1
  522. package/lib/esm/utils/auth.js.map +0 -1
  523. package/lib/esm/utils/schemas.js.map +0 -1
  524. package/lib/esm/utils/type-helpers.js.map +0 -1
  525. package/lib/esm/versions.js.map +0 -1
  526. package/lib/esm/workflow-analytics.js.map +0 -1
  527. package/lib/tsconfig.tsbuildinfo +0 -1
  528. package/lib/types/Progress.d.ts.map +0 -1
  529. package/lib/types/access-control.d.ts +0 -79
  530. package/lib/types/access-control.d.ts.map +0 -1
  531. package/lib/types/analytics.d.ts.map +0 -1
  532. package/lib/types/apikey.d.ts.map +0 -1
  533. package/lib/types/apps.d.ts.map +0 -1
  534. package/lib/types/ask-user.d.ts.map +0 -1
  535. package/lib/types/audit-trail.d.ts.map +0 -1
  536. package/lib/types/channels.d.ts.map +0 -1
  537. package/lib/types/common.d.ts.map +0 -1
  538. package/lib/types/cost-analytics.d.ts.map +0 -1
  539. package/lib/types/data-platform.d.ts.map +0 -1
  540. package/lib/types/email.d.ts.map +0 -1
  541. package/lib/types/environment.d.ts.map +0 -1
  542. package/lib/types/facets.d.ts.map +0 -1
  543. package/lib/types/group.d.ts.map +0 -1
  544. package/lib/types/index.d.ts.map +0 -1
  545. package/lib/types/integrations.d.ts +0 -83
  546. package/lib/types/integrations.d.ts.map +0 -1
  547. package/lib/types/interaction.d.ts.map +0 -1
  548. package/lib/types/json-schema.d.ts +0 -1
  549. package/lib/types/json-schema.d.ts.map +0 -1
  550. package/lib/types/json.d.ts +0 -1
  551. package/lib/types/json.d.ts.map +0 -1
  552. package/lib/types/meters.d.ts.map +0 -1
  553. package/lib/types/model_utility.d.ts +0 -1
  554. package/lib/types/model_utility.d.ts.map +0 -1
  555. package/lib/types/oauth-server.d.ts.map +0 -1
  556. package/lib/types/oauth.d.ts.map +0 -1
  557. package/lib/types/openapi.d.ts +0 -90
  558. package/lib/types/openapi.d.ts.map +0 -1
  559. package/lib/types/payload.d.ts.map +0 -1
  560. package/lib/types/pending-asks.d.ts.map +0 -1
  561. package/lib/types/project.d.ts.map +0 -1
  562. package/lib/types/prompt.d.ts.map +0 -1
  563. package/lib/types/query.d.ts.map +0 -1
  564. package/lib/types/rate-limiter.d.ts.map +0 -1
  565. package/lib/types/refs.d.ts.map +0 -1
  566. package/lib/types/runs.d.ts.map +0 -1
  567. package/lib/types/skill.d.ts.map +0 -1
  568. package/lib/types/store/activity-catalog.d.ts.map +0 -1
  569. package/lib/types/store/agent-run.d.ts.map +0 -1
  570. package/lib/types/store/collections.d.ts.map +0 -1
  571. package/lib/types/store/common.d.ts.map +0 -1
  572. package/lib/types/store/conversation-state.d.ts.map +0 -1
  573. package/lib/types/store/doc-analyzer.d.ts.map +0 -1
  574. package/lib/types/store/dsl-workflow.d.ts.map +0 -1
  575. package/lib/types/store/hive-memory.d.ts.map +0 -1
  576. package/lib/types/store/index.d.ts +0 -16
  577. package/lib/types/store/index.d.ts.map +0 -1
  578. package/lib/types/store/object-types.d.ts.map +0 -1
  579. package/lib/types/store/rendering.d.ts.map +0 -1
  580. package/lib/types/store/schedule.d.ts.map +0 -1
  581. package/lib/types/store/signals.d.ts.map +0 -1
  582. package/lib/types/store/store.d.ts.map +0 -1
  583. package/lib/types/store/temporalio.d.ts +0 -16
  584. package/lib/types/store/temporalio.d.ts.map +0 -1
  585. package/lib/types/store/worker.d.ts +0 -18
  586. package/lib/types/store/worker.d.ts.map +0 -1
  587. package/lib/types/store/workflow.d.ts.map +0 -1
  588. package/lib/types/sts-token-types.d.ts.map +0 -1
  589. package/lib/types/tenant.d.ts.map +0 -1
  590. package/lib/types/tool-execution.d.ts.map +0 -1
  591. package/lib/types/training.d.ts.map +0 -1
  592. package/lib/types/transient-tokens.d.ts.map +0 -1
  593. package/lib/types/user.d.ts.map +0 -1
  594. package/lib/types/utils/auth.d.ts.map +0 -1
  595. package/lib/types/utils/schemas.d.ts.map +0 -1
  596. package/lib/types/utils/type-helpers.d.ts.map +0 -1
  597. package/lib/types/versions.d.ts.map +0 -1
  598. package/lib/types/workflow-analytics.d.ts.map +0 -1
  599. package/src/openapi.ts +0 -102
  600. package/src/store/worker.ts +0 -19
  601. /package/lib/{esm/analytics.js → analytics.js} +0 -0
  602. /package/lib/{esm/ask-user.js → ask-user.js} +0 -0
  603. /package/lib/{esm/common.js → common.js} +0 -0
  604. /package/lib/{esm/cost-analytics.js → cost-analytics.js} +0 -0
  605. /package/lib/{esm/data-platform.js → data-platform.js} +0 -0
  606. /package/lib/{esm/facets.js → facets.js} +0 -0
  607. /package/lib/{esm/json-schema.js → json-schema.js} +0 -0
  608. /package/lib/{esm/json.js → json.js} +0 -0
  609. /package/lib/{esm/meters.js → meters.js} +0 -0
  610. /package/lib/{esm/oauth-server.js → oauth-server.js} +0 -0
  611. /package/lib/{esm/oauth.js → oauth.js} +0 -0
  612. /package/lib/{esm/payload.js → payload.js} +0 -0
  613. /package/lib/{esm/pending-asks.js → pending-asks.js} +0 -0
  614. /package/lib/{esm/prompt.js → prompt.js} +0 -0
  615. /package/lib/{esm/query.js → query.js} +0 -0
  616. /package/lib/{esm/rate-limiter.js → rate-limiter.js} +0 -0
  617. /package/lib/{esm/refs.js → refs.js} +0 -0
  618. /package/lib/{esm/runs.js → runs.js} +0 -0
  619. /package/lib/{esm/skill.js → skill.js} +0 -0
  620. /package/lib/{esm/store → store}/activity-catalog.js +0 -0
  621. /package/lib/{esm/store → store}/agent-run.js +0 -0
  622. /package/lib/{esm/store → store}/collections.js +0 -0
  623. /package/lib/{esm/store → store}/common.js +0 -0
  624. /package/lib/{esm/store → store}/doc-analyzer.js +0 -0
  625. /package/lib/{esm/store → store}/hive-memory.js +0 -0
  626. /package/lib/{esm/store → store}/schedule.js +0 -0
  627. /package/lib/{esm/store → store}/signals.js +0 -0
  628. /package/lib/{esm/tenant.js → tenant.js} +0 -0
  629. /package/lib/{esm/tool-execution.js → tool-execution.js} +0 -0
  630. /package/lib/{esm/training.js → training.js} +0 -0
  631. /package/lib/{esm/transient-tokens.js → transient-tokens.js} +0 -0
  632. /package/lib/{esm/utils → utils}/type-helpers.js +0 -0
  633. /package/lib/{esm/versions.js → versions.js} +0 -0
  634. /package/lib/{esm/workflow-analytics.js → workflow-analytics.js} +0 -0
package/src/project.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { SupportedIntegrations } from "./integrations.js";
2
- import { ContentObjectTypeRef } from "./store/store.js";
3
- import { WorkflowRunStatus } from "./store/workflow.js";
4
- import { AccountRef } from "./user.js";
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { SupportedIntegrations } from './integrations.js';
3
+ import type { WorkflowRunStatus } from './store/workflow.js';
4
+ import type { AccountRef } from './user.js';
5
5
 
6
6
  export interface ICreateProjectPayload {
7
7
  name: string;
@@ -10,18 +10,22 @@ export interface ICreateProjectPayload {
10
10
  auto_config?: boolean;
11
11
  }
12
12
  export enum ProjectRoles {
13
- owner = "owner", // all permissions
14
- admin = "admin", // all permissions
15
- manager = "manager", // all permissions but manage_account, manage_billing
16
- developer = "developer", // all permissions but manage_account, manage_billing, manage_roles, delete
17
- application = "application", // executor + request_pk
18
- consumer = "consumer", // required permissions for users of micro apps
19
- executor = "executor", // can only read and execute interactions
20
- reader = "reader", // can only read (browse)
21
- billing = "billing", // can only manage billings
22
- member = "member", // can only access, but no specific permissions
23
- app_member = "app_member", // used to mark an user have access to an application. does not provide any permission on its own
24
- content_superadmin = "content_superadmin", // can see all content objects and collections
13
+ owner = 'owner', // all permissions
14
+ admin = 'admin', // all permissions
15
+ manager = 'manager', // all permissions but manage_account, manage_billing
16
+ developer = 'developer', // all permissions but manage_account, manage_billing, manage_roles, delete
17
+ application = 'application', // executor + request_pk
18
+ automation = 'automation', // event-triggered automation runner
19
+ content_processor = 'content_processor', // trusted system content processing
20
+ consumer = 'consumer', // required permissions for users of micro apps
21
+ executor = 'executor', // can only read and execute interactions
22
+ reader = 'reader', // can only read (browse)
23
+ auditor = 'auditor', // can read all non-admin resources without mutation permissions
24
+ support = 'support', // Vertesia support read-only role
25
+ billing = 'billing', // can only manage billings
26
+ member = 'member', // can only access, but no specific permissions
27
+ app_member = 'app_member', // used to mark an user have access to an application. does not provide any permission on its own
28
+ content_superadmin = 'content_superadmin', // can see all content objects and collections
25
29
  }
26
30
 
27
31
  export function isRoleIncludedIn(role: string, includingRole: string) {
@@ -39,11 +43,10 @@ export function isRoleIncludedIn(role: string, includingRole: string) {
39
43
  }
40
44
  }
41
45
 
42
-
43
46
  export interface PopulatedProjectRef {
44
47
  id: string;
45
48
  name: string;
46
- account: AccountRef
49
+ account: AccountRef;
47
50
  }
48
51
  export interface ProjectRef {
49
52
  id: string;
@@ -66,12 +69,11 @@ export interface ListProjectsQuery {
66
69
  }
67
70
 
68
71
  export enum ResourceVisibility {
69
- public = "public",
70
- account = "account",
71
- project = "project"
72
+ public = 'public',
73
+ account = 'account',
74
+ project = 'project',
72
75
  }
73
76
 
74
-
75
77
  // ==========================================
76
78
  // Project Model Defaults Types
77
79
  // ==========================================
@@ -100,28 +102,30 @@ export interface ModalityDefaults {
100
102
  * Categories group one or more system interactions for default model assignment.
101
103
  */
102
104
  export enum SystemInteractionCategory {
103
- content_type = "content_type",
104
- intake = "intake",
105
- analysis = "analysis",
106
- non_applicable = "non_applicable"
105
+ content_type = 'content_type',
106
+ intake = 'intake',
107
+ analysis = 'analysis',
108
+ agent = 'agent',
109
+ non_applicable = 'non_applicable',
107
110
  }
108
111
 
109
112
  /**
110
113
  * Map system interaction endpoints to categories.
111
114
  */
112
115
  export const SYSTEM_INTERACTION_CATEGORIES: Record<string, SystemInteractionCategory> = {
113
- "ExtractInformation": SystemInteractionCategory.intake,
114
- "SelectDocumentType": SystemInteractionCategory.intake,
115
- "GenerateMetadataModel": SystemInteractionCategory.content_type,
116
- "ChunkDocument": SystemInteractionCategory.intake,
117
- "IdentifyTextSections": SystemInteractionCategory.intake,
118
- "AnalyzeDocument": SystemInteractionCategory.analysis,
119
- "ReduceTextSections": SystemInteractionCategory.analysis,
120
- "GenericAgent": SystemInteractionCategory.non_applicable,
121
- "AdhocTaskAgent": SystemInteractionCategory.non_applicable,
122
- "Mediator": SystemInteractionCategory.non_applicable,
123
- "AnalyzeConversation": SystemInteractionCategory.analysis,
124
- "GetAgentConversationTopic": SystemInteractionCategory.analysis,
116
+ ExtractInformation: SystemInteractionCategory.intake,
117
+ SelectDocumentType: SystemInteractionCategory.intake,
118
+ GenerateMetadataModel: SystemInteractionCategory.content_type,
119
+ ChunkDocument: SystemInteractionCategory.intake,
120
+ IdentifyTextSections: SystemInteractionCategory.intake,
121
+ AnalyzeDocument: SystemInteractionCategory.analysis,
122
+ ReduceTextSections: SystemInteractionCategory.analysis,
123
+ GenericAgent: SystemInteractionCategory.non_applicable,
124
+ AdhocTaskAgent: SystemInteractionCategory.non_applicable,
125
+ Mediator: SystemInteractionCategory.non_applicable,
126
+ AnalyzeConversation: SystemInteractionCategory.analysis,
127
+ GetAgentConversationTopic: SystemInteractionCategory.analysis,
128
+ StudioAssistant: SystemInteractionCategory.agent,
125
129
  };
126
130
 
127
131
  /**
@@ -131,7 +135,7 @@ export const SYSTEM_INTERACTION_CATEGORIES: Record<string, SystemInteractionCate
131
135
  * @param endpoint - The interaction endpoint name
132
136
  */
133
137
  export function getSystemInteractionCategory(endpoint: string): SystemInteractionCategory | undefined {
134
- if (endpoint.startsWith("sys:")) {
138
+ if (endpoint.startsWith('sys:')) {
135
139
  // Strip sys: prefix
136
140
  endpoint = endpoint.substring(4);
137
141
  }
@@ -158,13 +162,115 @@ export interface ProjectModelDefaults {
158
162
  system?: SystemDefaults;
159
163
  }
160
164
 
165
+ export type BrowserUseRiskPolicy = 'read_only' | 'low_write' | 'requires_approval' | 'unrestricted';
166
+
167
+ export type BrowserUseScreenshotCapture = 'off' | 'on_action' | 'each_turn';
168
+
169
+ export interface BrowserUseProjectConfiguration {
170
+ /**
171
+ * Enable the browser_use workflow-level tool for this project.
172
+ * Defaults to true when omitted.
173
+ */
174
+ enabled?: boolean;
175
+ /**
176
+ * Risk policy used when the tool call does not specify one.
177
+ * Defaults to low_write.
178
+ */
179
+ default_policy?: BrowserUseRiskPolicy;
180
+ /**
181
+ * Maximum policy a tool call may request. Requested policies above this
182
+ * are clamped down to the project maximum. Defaults to unrestricted.
183
+ */
184
+ max_policy?: BrowserUseRiskPolicy;
185
+ /**
186
+ * Optional project-wide host allowlist. When present, browser_use calls
187
+ * can only request hosts contained by this list.
188
+ */
189
+ allowed_hosts?: string[];
190
+ /**
191
+ * Allow saved Playwright scripts to hydrate artifacts/documents as files
192
+ * inside the browser sandbox for upload flows. Defaults to true.
193
+ */
194
+ allow_file_uploads?: boolean;
195
+ /**
196
+ * Allow the browser_playwright_script tool in browser workstreams.
197
+ * Defaults to true.
198
+ */
199
+ allow_playwright_scripts?: boolean;
200
+ /**
201
+ * Persist browser screenshots for UI progress. Defaults to on_action.
202
+ */
203
+ capture_screenshots?: BrowserUseScreenshotCapture;
204
+ /**
205
+ * Prefer unannotated screenshots in the browser-use UI widget when both
206
+ * raw and annotated captures are available. Defaults to true.
207
+ */
208
+ prefer_raw_screenshots?: boolean;
209
+ }
210
+
211
+ export const BrowserUseProjectConfigurationSchema: JSONSchemaType<BrowserUseProjectConfiguration> = {
212
+ type: 'object',
213
+ properties: {
214
+ enabled: {
215
+ type: 'boolean',
216
+ nullable: true,
217
+ description: 'Enable the browser_use workflow-level tool for this project. Defaults to true.',
218
+ },
219
+ default_policy: {
220
+ type: 'string',
221
+ nullable: true,
222
+ enum: ['read_only', 'low_write', 'requires_approval', 'unrestricted'],
223
+ description: 'Risk policy used when a browser_use call does not specify one. Defaults to low_write.',
224
+ },
225
+ max_policy: {
226
+ type: 'string',
227
+ nullable: true,
228
+ enum: ['read_only', 'low_write', 'requires_approval', 'unrestricted'],
229
+ description: 'Maximum risk policy a browser_use call may request. Defaults to unrestricted.',
230
+ },
231
+ allowed_hosts: {
232
+ type: 'array',
233
+ nullable: true,
234
+ items: { type: 'string' },
235
+ description:
236
+ 'Optional project-wide host allowlist. When present, browser_use calls can only request hosts contained by this list.',
237
+ },
238
+ allow_file_uploads: {
239
+ type: 'boolean',
240
+ nullable: true,
241
+ description:
242
+ 'Allow replay scripts to hydrate artifacts/documents as files in the browser sandbox. Defaults to true.',
243
+ },
244
+ allow_playwright_scripts: {
245
+ type: 'boolean',
246
+ nullable: true,
247
+ description: 'Allow browser_playwright_script in browser workstreams. Defaults to true.',
248
+ },
249
+ capture_screenshots: {
250
+ type: 'string',
251
+ nullable: true,
252
+ enum: ['off', 'on_action', 'each_turn'],
253
+ description: 'Persist browser screenshots for UI progress. Defaults to on_action.',
254
+ },
255
+ prefer_raw_screenshots: {
256
+ type: 'boolean',
257
+ nullable: true,
258
+ description: 'Prefer unannotated screenshots in the browser-use UI widget. Defaults to true.',
259
+ },
260
+ },
261
+ required: [],
262
+ additionalProperties: false,
263
+ };
264
+
161
265
  // ==========================================
162
266
  // Project Configuration
163
267
  // ==========================================
164
268
 
165
- export interface ProjectConfiguration {
269
+ export type ProjectSearchTier = 'standard' | 'performance';
270
+ export type ElasticsearchBackend = 'serverless' | 'hosted';
166
271
 
167
- human_context: string;
272
+ export interface ProjectConfiguration {
273
+ human_context?: string;
168
274
 
169
275
  defaults?: ProjectModelDefaults;
170
276
 
@@ -173,10 +279,10 @@ export interface ProjectConfiguration {
173
279
  sync_content_properties?: boolean;
174
280
 
175
281
  embeddings: {
176
- text?: ProjectConfigurationEmbeddings;
177
- image?: ProjectConfigurationEmbeddings;
178
- properties?: ProjectConfigurationEmbeddings
179
- }
282
+ text?: ProjectConfigurationEmbedding;
283
+ image?: ProjectConfigurationEmbedding;
284
+ properties?: ProjectConfigurationEmbedding;
285
+ };
180
286
 
181
287
  datacenter?: string;
182
288
  storage_bucket?: string;
@@ -199,6 +305,20 @@ export interface ProjectConfiguration {
199
305
  * Defaults to true - indexing is always on when ES infrastructure is available.
200
306
  */
201
307
  enabled?: boolean;
308
+
309
+ /**
310
+ * Search tier for this project.
311
+ * standard uses the regional hosted Elasticsearch deployment.
312
+ * performance uses the regional serverless Elasticsearch project.
313
+ * Defaults to standard when omitted.
314
+ */
315
+ search_tier?: ProjectSearchTier;
316
+
317
+ /**
318
+ * Elasticsearch backend override for this project.
319
+ * Prefer search_tier for project configuration unless an explicit backend override is needed.
320
+ */
321
+ backend?: ElasticsearchBackend;
202
322
  };
203
323
 
204
324
  /**
@@ -211,6 +331,17 @@ export interface ProjectConfiguration {
211
331
  */
212
332
  main_language?: string;
213
333
 
334
+ /**
335
+ * Project defaults and caps for browser_use agent workstreams.
336
+ */
337
+ browser_use?: BrowserUseProjectConfiguration;
338
+
339
+ /**
340
+ * Object ID of a content object containing a custom LaTeX template (.latex file)
341
+ * to use as the branded PDF template. When set, "Export as Branded PDF" uses this
342
+ * template instead of the built-in Vertesia default template.
343
+ */
344
+ pdf_template_object_id?: string;
214
345
  }
215
346
 
216
347
  // export interface ProjectConfigurationEmbeddings {
@@ -221,26 +352,32 @@ export interface ProjectConfiguration {
221
352
  // }
222
353
 
223
354
  export enum SupportedEmbeddingTypes {
224
- text = "text",
225
- image = "image",
226
- properties = "properties"
355
+ text = 'text',
356
+ image = 'image',
357
+ properties = 'properties',
227
358
  }
228
359
 
229
360
  export enum FullTextType {
230
- full_text = "full_text"
361
+ full_text = 'full_text',
231
362
  }
232
363
 
233
364
  export type SearchTypes = SupportedEmbeddingTypes | FullTextType;
234
365
 
235
366
  export const SearchTypes = {
236
367
  ...SupportedEmbeddingTypes,
237
- ...FullTextType
368
+ ...FullTextType,
238
369
  } as const;
239
370
 
240
- export interface ProjectConfigurationEmbeddings {
241
- environment: string;
371
+ export interface ProjectConfigurationEmbedding {
372
+ environment?: string;
242
373
  enabled: boolean;
243
- dimensions: number;
374
+ dimensions?: number;
375
+ max_tokens?: number;
376
+ model?: string;
377
+ }
378
+
379
+ export interface ProjectConfigurationEmbeddingEnablePayload {
380
+ environment: string;
244
381
  max_tokens?: number;
245
382
  model?: string;
246
383
  }
@@ -252,10 +389,10 @@ export interface Project {
252
389
  description?: string;
253
390
  account: string;
254
391
  configuration: ProjectConfiguration;
255
- integrations: Map<string, any>;
392
+ integrations?: Map<string, unknown>;
256
393
  plugins: string[];
257
- created_by: string,
258
- updated_by: string,
394
+ created_by: string;
395
+ updated_by: string;
259
396
  created_at: Date;
260
397
  updated_at: Date;
261
398
  }
@@ -265,15 +402,13 @@ export interface ProjectCreatePayload {
265
402
  description?: string;
266
403
  }
267
404
 
268
- export interface ProjectUpdatePayload extends Partial<Project> { }
405
+ export interface ProjectUpdatePayload extends Partial<Project> {}
269
406
 
270
407
  export interface ProjectPluginsUpdatePayload {
271
408
  plugins: string[];
272
409
  }
273
410
 
274
-
275
- export const ProjectRefPopulate = "id name account";
276
-
411
+ export const ProjectRefPopulate = 'id name account';
277
412
 
278
413
  export interface EmbeddingsStatusResponse {
279
414
  status: string;
@@ -282,10 +417,10 @@ export interface EmbeddingsStatusResponse {
282
417
  embeddingsModels?: string[];
283
418
  objectsWithEmbeddings?: number;
284
419
  vectorIndex: {
285
- status: "READY" | "PENDING" | "DELETING" | "ABSENT",
286
- name?: string,
287
- type?: string
288
- }
420
+ status: 'READY' | 'PENDING' | 'DELETING' | 'ABSENT';
421
+ name?: string;
422
+ type?: string;
423
+ };
289
424
  }
290
425
 
291
426
  /**
@@ -298,6 +433,10 @@ export interface IndexingStatusResponse {
298
433
  indexing_enabled: boolean;
299
434
  /** @deprecated Now derived from indexing_enabled - queries automatically route to index when indexing is enabled */
300
435
  query_enabled: boolean;
436
+ /** Resolved Elasticsearch backend serving this project */
437
+ backend: ElasticsearchBackend;
438
+ /** Resolved search tier for this project */
439
+ search_tier: ProjectSearchTier;
301
440
  /** Index status */
302
441
  index: {
303
442
  /** Whether the index exists */
@@ -321,40 +460,62 @@ export interface IndexingStatusResponse {
321
460
  reindex_in_progress: boolean;
322
461
  /** Reindex progress (if reindex is in progress) */
323
462
  reindex_progress?: {
324
- /** Total documents to reindex */
325
- total: number;
326
- /** Documents processed so far */
327
- processed: number;
328
- /** Successfully indexed documents */
329
- successful: number;
330
- /** Failed documents */
331
- failed: number;
332
- /** Current status (e.g., "indexing", "complete") */
463
+ /** Total shards to process */
464
+ total_shards: number;
465
+ /** Shards completed so far */
466
+ completed_shards: number;
467
+ /** Shards that failed */
468
+ failed_shards: number;
469
+ /** Current status (e.g., "computing_shards", "indexing", "completed") */
333
470
  status: string;
334
- /** Current batch number */
335
- current_batch: number;
336
- /** Total number of batches */
337
- total_batches: number;
338
- /** Percentage complete (0-100) */
339
- percent_complete: number;
340
- /** Batches processed per second */
341
- batches_per_second: number;
471
+ /** Documents scanned from source */
472
+ scanned: number;
473
+ /** Documents written to target index */
474
+ written: number;
475
+ /** Documents that failed to index */
476
+ errors: number;
477
+ /** Embedding vectors written to target index */
478
+ embeddings_written?: number;
479
+ /** Embedding vectors skipped because they were invalid or dimension-mismatched */
480
+ skipped_embeddings?: number;
481
+ /** Text embedding vectors written to target index */
482
+ embeddings_text_written?: number;
483
+ /** Image embedding vectors written to target index */
484
+ embeddings_image_written?: number;
485
+ /** Properties embedding vectors written to target index */
486
+ embeddings_properties_written?: number;
487
+ /** Text embedding vectors skipped because they were invalid or dimension-mismatched */
488
+ embeddings_text_skipped?: number;
489
+ /** Image embedding vectors skipped because they were invalid or dimension-mismatched */
490
+ embeddings_image_skipped?: number;
491
+ /** Properties embedding vectors skipped because they were invalid or dimension-mismatched */
492
+ embeddings_properties_skipped?: number;
493
+ /** Oversized property string values dropped during transform (size-based pruning) */
494
+ properties_values_trimmed?: number;
495
+ /** Total bytes dropped from oversized property values */
496
+ properties_bytes_dropped?: number;
497
+ /** Total batcher flushes across all completed shards (cumulative) */
498
+ batches_flushed?: number;
499
+ /** Total ES bulk requests sent across all completed shards (cumulative) */
500
+ bulk_chunks_written?: number;
501
+ /** Total per-document ES bulk-item failures across all shards (cumulative). Counts docs ES rejected — they aren't in the indexed set. */
502
+ bulk_errors?: number;
503
+ /** Average documents per batch flush (written / batches_flushed) — useful to spot under/over-batching */
504
+ avg_docs_per_batch?: number;
505
+ /** Average chunks per batch (>1 means bulk_size_bytes cap is splitting batches frequently) */
506
+ avg_chunks_per_batch?: number;
342
507
  /** Documents processed per second */
343
508
  docs_per_second: number;
344
509
  /** Elapsed time in seconds */
345
510
  elapsed_seconds: number;
346
511
  /** Estimated seconds remaining (null if unknown) */
347
512
  estimated_seconds_remaining: number | null;
348
- /** Total bytes sent to ES */
349
- total_bytes?: number;
350
- /** Total ES bulk flushes */
351
- bulk_flushes?: number;
352
- /** Average bytes per ES bulk flush */
353
- avg_flush_bytes?: number;
354
- /** Configured batch size */
355
- batch_size?: number;
356
- /** Configured parallel batch count */
357
- parallel_batch_count?: number;
513
+ /** Percentage complete (0-100) */
514
+ percent_complete: number;
515
+ /** Source alias */
516
+ alias: string;
517
+ /** Target index name */
518
+ target_index: string;
358
519
  };
359
520
  }
360
521
 
@@ -366,10 +527,92 @@ export interface StartProjectReindexPayload {
366
527
  bulk_concurrency?: number;
367
528
  }
368
529
 
530
+ /**
531
+ * Auto-tunes shard sizing based on project doc count.
532
+ *
533
+ * Returns:
534
+ * - shard_size: target docs per shard (workflow path uses this; zeno-bulk
535
+ * computes shard count from total/shard_size).
536
+ * - parallel_shard_count: max in-flight shard activities (workflow path only).
537
+ * - max_shards: hard cap on shard count for the direct path. Direct path
538
+ * passes this as `shards` to zeno-bulk so all shards run as cursors in
539
+ * ONE process; without this cap, an under-estimated shard_size (e.g.
540
+ * from stale estimatedDocumentCount) can spawn 10+ in-flight cursors
541
+ * and exceed Cloud Run memory.
542
+ *
543
+ * Explicit overrides should bypass this function and use user-provided values.
544
+ */
545
+ export function autoTuneReindexParams(docCount: number): {
546
+ shard_size: number;
547
+ parallel_shard_count: number;
548
+ max_shards: number;
549
+ } {
550
+ if (docCount < 50_000) {
551
+ // Tiny/small project: aim for ~4 shards, with a 5k floor.
552
+ return {
553
+ shard_size: Math.max(Math.ceil(docCount / 4), 5_000),
554
+ parallel_shard_count: Math.min(4, Math.max(1, Math.ceil(docCount / 5_000))),
555
+ max_shards: 4,
556
+ };
557
+ }
558
+ if (docCount < 500_000) {
559
+ // Medium project: 50k shards → 1-10 shards
560
+ return { shard_size: 50_000, parallel_shard_count: 8, max_shards: 10 };
561
+ }
562
+ if (docCount < 2_000_000) {
563
+ // Large project: 100k shards → 5-20 shards
564
+ return { shard_size: 100_000, parallel_shard_count: 8, max_shards: 20 };
565
+ }
566
+ // Huge project: stick to 250k shards to keep coordination overhead bounded.
567
+ return { shard_size: 250_000, parallel_shard_count: 8, max_shards: 40 };
568
+ }
569
+
570
+ export interface ReindexAgentRunsPayload {
571
+ /**
572
+ * Drop any existing agent-runs index/alias family and recreate the stable concrete index before indexing.
573
+ * Defaults to true.
574
+ */
575
+ recreate_index?: boolean;
576
+ /** Number of MongoDB records to scan per batch. Defaults to 500. */
577
+ batch_size?: number;
578
+ /** Optional cap for partial/manual repair runs. Omit for all agent runs in the project. */
579
+ limit?: number;
580
+ }
581
+
582
+ export interface ReindexAgentRunsResponse {
583
+ status: string;
584
+ backend: ElasticsearchBackend;
585
+ index_name: string;
586
+ recreated: boolean;
587
+ total: number;
588
+ scanned: number;
589
+ indexed: number;
590
+ failed: number;
591
+ errors?: Array<{
592
+ id: string;
593
+ message: string;
594
+ }>;
595
+ }
596
+
369
597
  // ============================================================================
370
598
  // Internal indexing types (used by Temporal workflows)
371
599
  // ============================================================================
372
600
 
601
+ /**
602
+ * Indexed (`_source`) shape of the content type ref. Unlike the public
603
+ * ContentObjectTypeRef discriminated union, the index stores BOTH kinds under
604
+ * `id` — the ObjectId hex for stored types, the namespaced code for in-code
605
+ * types — so search filters and facets work on a single keyword field
606
+ * regardless of the kind. `ref_type` is kept to rebuild the public union on
607
+ * read. `code` only exists on documents written before the field was unified.
608
+ */
609
+ export interface IndexedContentTypeRef {
610
+ ref_type: 'stored' | 'incode';
611
+ id: string;
612
+ code?: string;
613
+ name: string;
614
+ }
615
+
373
616
  /**
374
617
  * Document data structure for Elasticsearch indexing
375
618
  */
@@ -378,7 +621,7 @@ export interface ElasticsearchDocumentData {
378
621
  text?: string;
379
622
  properties?: Record<string, unknown>;
380
623
  status?: string;
381
- type?: ContentObjectTypeRef;
624
+ type?: IndexedContentTypeRef;
382
625
  security?: {
383
626
  'content:read'?: string[];
384
627
  'content:write'?: string[];
@@ -411,6 +654,7 @@ export interface CreateReindexTargetResult {
411
654
  index_name: string;
412
655
  alias_name: string;
413
656
  version: number;
657
+ backend?: ElasticsearchBackend;
414
658
  dimensions?: {
415
659
  text?: number;
416
660
  image?: number;
@@ -419,15 +663,6 @@ export interface CreateReindexTargetResult {
419
663
  language?: string;
420
664
  }
421
665
 
422
- /**
423
- * Result from getting reindex range
424
- */
425
- export interface ReindexRangeResult {
426
- first: string | null;
427
- last: string | null;
428
- count: number;
429
- }
430
-
431
666
  /**
432
667
  * Result from fetching a batch
433
668
  */
@@ -469,6 +704,8 @@ export interface TriggerReindexResult {
469
704
  export interface ComputeShardsRequest {
470
705
  tenant_id: string;
471
706
  shard_size?: number;
707
+ updated_since?: string;
708
+ backend?: ElasticsearchBackend;
472
709
  }
473
710
 
474
711
  export interface ComputeShardsResult {
@@ -481,6 +718,7 @@ export interface IndexShardParams {
481
718
  target_index: string;
482
719
  shard_min: string;
483
720
  shard_max?: string;
721
+ backend?: ElasticsearchBackend;
484
722
  embedding_dimensions?: {
485
723
  text?: number;
486
724
  image?: number;
@@ -507,12 +745,43 @@ export interface IndexShardResult {
507
745
  written: number;
508
746
  skipped: number;
509
747
  errors: number;
748
+ /** Per-document ES bulk-item errors (e.g. mapping timeouts). Doc-level data-quality, not pipeline failure. */
749
+ bulk_errors?: number;
750
+ /** Sampled details of bulk-item failures (capped at 100 per shard). */
751
+ bulk_error_sample?: Array<{
752
+ tenant?: string;
753
+ doc_id: string;
754
+ type: string;
755
+ reason: string;
756
+ }>;
757
+ embeddings_written?: number;
758
+ skipped_embeddings?: number;
759
+ embeddings_text_written?: number;
760
+ embeddings_image_written?: number;
761
+ embeddings_properties_written?: number;
762
+ embeddings_text_skipped?: number;
763
+ embeddings_image_skipped?: number;
764
+ embeddings_properties_skipped?: number;
765
+ properties_values_trimmed?: number;
766
+ properties_bytes_dropped?: number;
767
+ batches_flushed?: number;
768
+ bulk_chunks_written?: number;
769
+ avg_docs_per_batch?: number;
770
+ avg_chunks_per_batch?: number;
771
+ avg_bytes_per_doc?: number;
772
+ avg_bytes_per_chunk?: number;
510
773
  read_docs_s: string;
511
774
  write_docs_s: string;
512
775
  read_mb: string;
513
776
  write_mb: string;
777
+ mongo_read_mb?: string;
778
+ gcs_read_mb?: string;
779
+ es_bulk_mb?: string;
514
780
  read_mb_s: string;
515
781
  write_mb_s: string;
782
+ mongo_read_mb_s?: string;
783
+ gcs_read_mb_s?: string;
784
+ es_bulk_mb_s?: string;
516
785
  duration_sec: number;
517
786
  failed_projects?: Array<{ tenant: string; error: string }>;
518
787
  }
@@ -520,6 +789,7 @@ export interface IndexShardResult {
520
789
  export interface SwapAliasRequest {
521
790
  tenant_id: string;
522
791
  target_index: string;
792
+ backend?: ElasticsearchBackend;
523
793
  /** ES alias name. If not provided, the Go service derives it from the tenant ID. */
524
794
  alias?: string;
525
795
  }
@@ -533,7 +803,19 @@ export interface SwapAliasResult {
533
803
 
534
804
  export interface ReindexViaBulkRequest {
535
805
  tenant_id: string;
806
+ project_id?: string;
807
+ backend?: ElasticsearchBackend;
536
808
  dry_run?: boolean;
809
+ /** Approximate documents per shard; drives auto-shard count (total / shard_size). Default 250_000. */
810
+ shard_size?: number;
811
+ /** Explicit shard count. When set, overrides shard_size-based auto-sharding. Useful to cap in-process concurrency for the direct path. */
812
+ shards?: number;
813
+ /** Number of ES bulk-write workers per shard. Default 10. */
814
+ bulk_concurrency?: number;
815
+ /** Hard cap per ES bulk request body in bytes. Default 12 MB. */
816
+ bulk_size_bytes?: number;
817
+ /** Max documents per batcher flush (size cap still regulates ES bulk requests). Default 200. */
818
+ bulk_max_docs?: number;
537
819
  }
538
820
 
539
821
  export interface ReindexViaBulkResult {
@@ -544,10 +826,34 @@ export interface ReindexViaBulkResult {
544
826
  scanned: number;
545
827
  written: number;
546
828
  errors: number;
829
+ embeddings_written?: number;
830
+ skipped_embeddings?: number;
831
+ embeddings_text_written?: number;
832
+ embeddings_image_written?: number;
833
+ embeddings_properties_written?: number;
834
+ embeddings_text_skipped?: number;
835
+ embeddings_image_skipped?: number;
836
+ embeddings_properties_skipped?: number;
837
+ properties_values_trimmed?: number;
838
+ properties_bytes_dropped?: number;
839
+ batches_flushed?: number;
840
+ bulk_chunks_written?: number;
841
+ avg_docs_per_batch?: number;
842
+ avg_chunks_per_batch?: number;
843
+ avg_bytes_per_doc?: number;
844
+ avg_bytes_per_chunk?: number;
547
845
  read_docs_s: string;
548
846
  write_docs_s: string;
549
847
  read_mb: string;
550
848
  write_mb: string;
849
+ mongo_read_mb?: string;
850
+ gcs_read_mb?: string;
851
+ es_bulk_mb?: string;
852
+ read_mb_s?: string;
853
+ write_mb_s?: string;
854
+ mongo_read_mb_s?: string;
855
+ gcs_read_mb_s?: string;
856
+ es_bulk_mb_s?: string;
551
857
  duration_sec: number;
552
858
  }
553
859
 
@@ -556,6 +862,7 @@ export interface ReindexViaBulkResult {
556
862
  */
557
863
  export interface ElasticsearchIndexStats {
558
864
  enabled: boolean;
865
+ backend?: ElasticsearchBackend;
559
866
  exists?: boolean;
560
867
  document_count?: number;
561
868
  size_in_bytes?: number;