@vertesia/common 0.24.0-dev.202601221707

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 (388) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +53 -0
  3. package/lib/cjs/Progress.js +61 -0
  4. package/lib/cjs/Progress.js.map +1 -0
  5. package/lib/cjs/access-control.js +56 -0
  6. package/lib/cjs/access-control.js.map +1 -0
  7. package/lib/cjs/analytics.js +3 -0
  8. package/lib/cjs/analytics.js.map +1 -0
  9. package/lib/cjs/apikey.js +16 -0
  10. package/lib/cjs/apikey.js.map +1 -0
  11. package/lib/cjs/apps.js +35 -0
  12. package/lib/cjs/apps.js.map +1 -0
  13. package/lib/cjs/ask-user.js +8 -0
  14. package/lib/cjs/ask-user.js.map +1 -0
  15. package/lib/cjs/channels.js +63 -0
  16. package/lib/cjs/channels.js.map +1 -0
  17. package/lib/cjs/common.js +3 -0
  18. package/lib/cjs/common.js.map +1 -0
  19. package/lib/cjs/data-platform.js +127 -0
  20. package/lib/cjs/data-platform.js.map +1 -0
  21. package/lib/cjs/email.js +20 -0
  22. package/lib/cjs/email.js.map +1 -0
  23. package/lib/cjs/environment.js +44 -0
  24. package/lib/cjs/environment.js.map +1 -0
  25. package/lib/cjs/facets.js +3 -0
  26. package/lib/cjs/facets.js.map +1 -0
  27. package/lib/cjs/group.js +5 -0
  28. package/lib/cjs/group.js.map +1 -0
  29. package/lib/cjs/index.js +55 -0
  30. package/lib/cjs/index.js.map +1 -0
  31. package/lib/cjs/integrations.js +14 -0
  32. package/lib/cjs/integrations.js.map +1 -0
  33. package/lib/cjs/interaction.js +97 -0
  34. package/lib/cjs/interaction.js.map +1 -0
  35. package/lib/cjs/json-schema.js +3 -0
  36. package/lib/cjs/json-schema.js.map +1 -0
  37. package/lib/cjs/json.js +3 -0
  38. package/lib/cjs/json.js.map +1 -0
  39. package/lib/cjs/meters.js +13 -0
  40. package/lib/cjs/meters.js.map +1 -0
  41. package/lib/cjs/model_utility.js +6 -0
  42. package/lib/cjs/model_utility.js.map +1 -0
  43. package/lib/cjs/package.json +3 -0
  44. package/lib/cjs/payload.js +3 -0
  45. package/lib/cjs/payload.js.map +1 -0
  46. package/lib/cjs/pending-asks.js +7 -0
  47. package/lib/cjs/pending-asks.js.map +1 -0
  48. package/lib/cjs/project.js +107 -0
  49. package/lib/cjs/project.js.map +1 -0
  50. package/lib/cjs/prompt.js +21 -0
  51. package/lib/cjs/prompt.js.map +1 -0
  52. package/lib/cjs/query.js +3 -0
  53. package/lib/cjs/query.js.map +1 -0
  54. package/lib/cjs/rate-limiter.js +6 -0
  55. package/lib/cjs/rate-limiter.js.map +1 -0
  56. package/lib/cjs/refs.js +14 -0
  57. package/lib/cjs/refs.js.map +1 -0
  58. package/lib/cjs/runs.js +3 -0
  59. package/lib/cjs/runs.js.map +1 -0
  60. package/lib/cjs/skill.js +14 -0
  61. package/lib/cjs/skill.js.map +1 -0
  62. package/lib/cjs/store/activity-catalog.js +3 -0
  63. package/lib/cjs/store/activity-catalog.js.map +1 -0
  64. package/lib/cjs/store/collections.js +9 -0
  65. package/lib/cjs/store/collections.js.map +1 -0
  66. package/lib/cjs/store/common.js +3 -0
  67. package/lib/cjs/store/common.js.map +1 -0
  68. package/lib/cjs/store/conversation-state.js +3 -0
  69. package/lib/cjs/store/conversation-state.js.map +1 -0
  70. package/lib/cjs/store/doc-analyzer.js +3 -0
  71. package/lib/cjs/store/doc-analyzer.js.map +1 -0
  72. package/lib/cjs/store/dsl-workflow.js +5 -0
  73. package/lib/cjs/store/dsl-workflow.js.map +1 -0
  74. package/lib/cjs/store/index.js +30 -0
  75. package/lib/cjs/store/index.js.map +1 -0
  76. package/lib/cjs/store/object-types.js +98 -0
  77. package/lib/cjs/store/object-types.js.map +1 -0
  78. package/lib/cjs/store/schedule.js +32 -0
  79. package/lib/cjs/store/schedule.js.map +1 -0
  80. package/lib/cjs/store/signals.js +3 -0
  81. package/lib/cjs/store/signals.js.map +1 -0
  82. package/lib/cjs/store/store.js +166 -0
  83. package/lib/cjs/store/store.js.map +1 -0
  84. package/lib/cjs/store/temporalio.js +44 -0
  85. package/lib/cjs/store/temporalio.js.map +1 -0
  86. package/lib/cjs/store/worker.js +3 -0
  87. package/lib/cjs/store/worker.js.map +1 -0
  88. package/lib/cjs/store/workflow.js +241 -0
  89. package/lib/cjs/store/workflow.js.map +1 -0
  90. package/lib/cjs/sts-token-types.js +32 -0
  91. package/lib/cjs/sts-token-types.js.map +1 -0
  92. package/lib/cjs/tenant.js +3 -0
  93. package/lib/cjs/tenant.js.map +1 -0
  94. package/lib/cjs/tool-execution.js +6 -0
  95. package/lib/cjs/tool-execution.js.map +1 -0
  96. package/lib/cjs/training.js +14 -0
  97. package/lib/cjs/training.js.map +1 -0
  98. package/lib/cjs/transient-tokens.js +9 -0
  99. package/lib/cjs/transient-tokens.js.map +1 -0
  100. package/lib/cjs/user.js +25 -0
  101. package/lib/cjs/user.js.map +1 -0
  102. package/lib/cjs/utils/auth.js +15 -0
  103. package/lib/cjs/utils/auth.js.map +1 -0
  104. package/lib/cjs/utils/schemas.js +114 -0
  105. package/lib/cjs/utils/schemas.js.map +1 -0
  106. package/lib/cjs/utils/type-helpers.js +3 -0
  107. package/lib/cjs/utils/type-helpers.js.map +1 -0
  108. package/lib/cjs/versions.js +8 -0
  109. package/lib/cjs/versions.js.map +1 -0
  110. package/lib/cjs/workflow-analytics.js +52 -0
  111. package/lib/cjs/workflow-analytics.js.map +1 -0
  112. package/lib/esm/Progress.js +57 -0
  113. package/lib/esm/Progress.js.map +1 -0
  114. package/lib/esm/access-control.js +53 -0
  115. package/lib/esm/access-control.js.map +1 -0
  116. package/lib/esm/analytics.js +2 -0
  117. package/lib/esm/analytics.js.map +1 -0
  118. package/lib/esm/apikey.js +13 -0
  119. package/lib/esm/apikey.js.map +1 -0
  120. package/lib/esm/apps.js +32 -0
  121. package/lib/esm/apps.js.map +1 -0
  122. package/lib/esm/ask-user.js +7 -0
  123. package/lib/esm/ask-user.js.map +1 -0
  124. package/lib/esm/channels.js +57 -0
  125. package/lib/esm/channels.js.map +1 -0
  126. package/lib/esm/common.js +2 -0
  127. package/lib/esm/common.js.map +1 -0
  128. package/lib/esm/data-platform.js +124 -0
  129. package/lib/esm/data-platform.js.map +1 -0
  130. package/lib/esm/email.js +16 -0
  131. package/lib/esm/email.js.map +1 -0
  132. package/lib/esm/environment.js +41 -0
  133. package/lib/esm/environment.js.map +1 -0
  134. package/lib/esm/facets.js +2 -0
  135. package/lib/esm/facets.js.map +1 -0
  136. package/lib/esm/group.js +2 -0
  137. package/lib/esm/group.js.map +1 -0
  138. package/lib/esm/index.js +39 -0
  139. package/lib/esm/index.js.map +1 -0
  140. package/lib/esm/integrations.js +11 -0
  141. package/lib/esm/integrations.js.map +1 -0
  142. package/lib/esm/interaction.js +92 -0
  143. package/lib/esm/interaction.js.map +1 -0
  144. package/lib/esm/json-schema.js +2 -0
  145. package/lib/esm/json-schema.js.map +1 -0
  146. package/lib/esm/json.js +2 -0
  147. package/lib/esm/json.js.map +1 -0
  148. package/lib/esm/meters.js +10 -0
  149. package/lib/esm/meters.js.map +1 -0
  150. package/lib/esm/model_utility.js +2 -0
  151. package/lib/esm/model_utility.js.map +1 -0
  152. package/lib/esm/payload.js +2 -0
  153. package/lib/esm/payload.js.map +1 -0
  154. package/lib/esm/pending-asks.js +6 -0
  155. package/lib/esm/pending-asks.js.map +1 -0
  156. package/lib/esm/project.js +102 -0
  157. package/lib/esm/project.js.map +1 -0
  158. package/lib/esm/prompt.js +18 -0
  159. package/lib/esm/prompt.js.map +1 -0
  160. package/lib/esm/query.js +2 -0
  161. package/lib/esm/query.js.map +1 -0
  162. package/lib/esm/rate-limiter.js +5 -0
  163. package/lib/esm/rate-limiter.js.map +1 -0
  164. package/lib/esm/refs.js +11 -0
  165. package/lib/esm/refs.js.map +1 -0
  166. package/lib/esm/runs.js +2 -0
  167. package/lib/esm/runs.js.map +1 -0
  168. package/lib/esm/skill.js +13 -0
  169. package/lib/esm/skill.js.map +1 -0
  170. package/lib/esm/store/activity-catalog.js +2 -0
  171. package/lib/esm/store/activity-catalog.js.map +1 -0
  172. package/lib/esm/store/collections.js +6 -0
  173. package/lib/esm/store/collections.js.map +1 -0
  174. package/lib/esm/store/common.js +2 -0
  175. package/lib/esm/store/common.js.map +1 -0
  176. package/lib/esm/store/conversation-state.js +2 -0
  177. package/lib/esm/store/conversation-state.js.map +1 -0
  178. package/lib/esm/store/doc-analyzer.js +2 -0
  179. package/lib/esm/store/doc-analyzer.js.map +1 -0
  180. package/lib/esm/store/dsl-workflow.js +2 -0
  181. package/lib/esm/store/dsl-workflow.js.map +1 -0
  182. package/lib/esm/store/index.js +14 -0
  183. package/lib/esm/store/index.js.map +1 -0
  184. package/lib/esm/store/object-types.js +95 -0
  185. package/lib/esm/store/object-types.js.map +1 -0
  186. package/lib/esm/store/schedule.js +29 -0
  187. package/lib/esm/store/schedule.js.map +1 -0
  188. package/lib/esm/store/signals.js +2 -0
  189. package/lib/esm/store/signals.js.map +1 -0
  190. package/lib/esm/store/store.js +160 -0
  191. package/lib/esm/store/store.js.map +1 -0
  192. package/lib/esm/store/temporalio.js +41 -0
  193. package/lib/esm/store/temporalio.js.map +1 -0
  194. package/lib/esm/store/worker.js +2 -0
  195. package/lib/esm/store/worker.js.map +1 -0
  196. package/lib/esm/store/workflow.js +228 -0
  197. package/lib/esm/store/workflow.js.map +1 -0
  198. package/lib/esm/sts-token-types.js +24 -0
  199. package/lib/esm/sts-token-types.js.map +1 -0
  200. package/lib/esm/tenant.js +2 -0
  201. package/lib/esm/tenant.js.map +1 -0
  202. package/lib/esm/tool-execution.js +5 -0
  203. package/lib/esm/tool-execution.js.map +1 -0
  204. package/lib/esm/training.js +11 -0
  205. package/lib/esm/training.js.map +1 -0
  206. package/lib/esm/transient-tokens.js +6 -0
  207. package/lib/esm/transient-tokens.js.map +1 -0
  208. package/lib/esm/user.js +22 -0
  209. package/lib/esm/user.js.map +1 -0
  210. package/lib/esm/utils/auth.js +11 -0
  211. package/lib/esm/utils/auth.js.map +1 -0
  212. package/lib/esm/utils/schemas.js +107 -0
  213. package/lib/esm/utils/schemas.js.map +1 -0
  214. package/lib/esm/utils/type-helpers.js +2 -0
  215. package/lib/esm/utils/type-helpers.js.map +1 -0
  216. package/lib/esm/versions.js +5 -0
  217. package/lib/esm/versions.js.map +1 -0
  218. package/lib/esm/workflow-analytics.js +49 -0
  219. package/lib/esm/workflow-analytics.js.map +1 -0
  220. package/lib/tsconfig.tsbuildinfo +1 -0
  221. package/lib/types/Progress.d.ts +21 -0
  222. package/lib/types/Progress.d.ts.map +1 -0
  223. package/lib/types/access-control.d.ts +73 -0
  224. package/lib/types/access-control.d.ts.map +1 -0
  225. package/lib/types/analytics.d.ts +87 -0
  226. package/lib/types/analytics.d.ts.map +1 -0
  227. package/lib/types/apikey.d.ts +98 -0
  228. package/lib/types/apikey.d.ts.map +1 -0
  229. package/lib/types/apps.d.ts +236 -0
  230. package/lib/types/apps.d.ts.map +1 -0
  231. package/lib/types/ask-user.d.ts +32 -0
  232. package/lib/types/ask-user.d.ts.map +1 -0
  233. package/lib/types/channels.d.ts +21 -0
  234. package/lib/types/channels.d.ts.map +1 -0
  235. package/lib/types/common.d.ts +31 -0
  236. package/lib/types/common.d.ts.map +1 -0
  237. package/lib/types/data-platform.d.ts +860 -0
  238. package/lib/types/data-platform.d.ts.map +1 -0
  239. package/lib/types/email.d.ts +66 -0
  240. package/lib/types/email.d.ts.map +1 -0
  241. package/lib/types/environment.d.ts +106 -0
  242. package/lib/types/environment.d.ts.map +1 -0
  243. package/lib/types/facets.d.ts +34 -0
  244. package/lib/types/facets.d.ts.map +1 -0
  245. package/lib/types/group.d.ts +21 -0
  246. package/lib/types/group.d.ts.map +1 -0
  247. package/lib/types/index.d.ts +39 -0
  248. package/lib/types/index.d.ts.map +1 -0
  249. package/lib/types/integrations.d.ts +60 -0
  250. package/lib/types/integrations.d.ts.map +1 -0
  251. package/lib/types/interaction.d.ts +958 -0
  252. package/lib/types/interaction.d.ts.map +1 -0
  253. package/lib/types/json-schema.d.ts +1 -0
  254. package/lib/types/json-schema.d.ts.map +1 -0
  255. package/lib/types/json.d.ts +1 -0
  256. package/lib/types/json.d.ts.map +1 -0
  257. package/lib/types/meters.d.ts +23 -0
  258. package/lib/types/meters.d.ts.map +1 -0
  259. package/lib/types/model_utility.d.ts +1 -0
  260. package/lib/types/model_utility.d.ts.map +1 -0
  261. package/lib/types/payload.d.ts +60 -0
  262. package/lib/types/payload.d.ts.map +1 -0
  263. package/lib/types/pending-asks.d.ts +93 -0
  264. package/lib/types/pending-asks.d.ts.map +1 -0
  265. package/lib/types/project.d.ts +179 -0
  266. package/lib/types/project.d.ts.map +1 -0
  267. package/lib/types/prompt.d.ts +78 -0
  268. package/lib/types/prompt.d.ts.map +1 -0
  269. package/lib/types/query.d.ts +118 -0
  270. package/lib/types/query.d.ts.map +1 -0
  271. package/lib/types/rate-limiter.d.ts +28 -0
  272. package/lib/types/rate-limiter.d.ts.map +1 -0
  273. package/lib/types/refs.d.ts +22 -0
  274. package/lib/types/refs.d.ts.map +1 -0
  275. package/lib/types/runs.d.ts +32 -0
  276. package/lib/types/runs.d.ts.map +1 -0
  277. package/lib/types/skill.d.ts +78 -0
  278. package/lib/types/skill.d.ts.map +1 -0
  279. package/lib/types/store/activity-catalog.d.ts +26 -0
  280. package/lib/types/store/activity-catalog.d.ts.map +1 -0
  281. package/lib/types/store/collections.d.ts +78 -0
  282. package/lib/types/store/collections.d.ts.map +1 -0
  283. package/lib/types/store/common.d.ts +22 -0
  284. package/lib/types/store/common.d.ts.map +1 -0
  285. package/lib/types/store/conversation-state.d.ts +120 -0
  286. package/lib/types/store/conversation-state.d.ts.map +1 -0
  287. package/lib/types/store/doc-analyzer.d.ts +140 -0
  288. package/lib/types/store/doc-analyzer.d.ts.map +1 -0
  289. package/lib/types/store/dsl-workflow.d.ts +244 -0
  290. package/lib/types/store/dsl-workflow.d.ts.map +1 -0
  291. package/lib/types/store/index.d.ts +13 -0
  292. package/lib/types/store/index.d.ts.map +1 -0
  293. package/lib/types/store/object-types.d.ts +23 -0
  294. package/lib/types/store/object-types.d.ts.map +1 -0
  295. package/lib/types/store/schedule.d.ts +182 -0
  296. package/lib/types/store/schedule.d.ts.map +1 -0
  297. package/lib/types/store/signals.d.ts +24 -0
  298. package/lib/types/store/signals.d.ts.map +1 -0
  299. package/lib/types/store/store.d.ts +407 -0
  300. package/lib/types/store/store.d.ts.map +1 -0
  301. package/lib/types/store/temporalio.d.ts +16 -0
  302. package/lib/types/store/temporalio.d.ts.map +1 -0
  303. package/lib/types/store/worker.d.ts +18 -0
  304. package/lib/types/store/worker.d.ts.map +1 -0
  305. package/lib/types/store/workflow.d.ts +730 -0
  306. package/lib/types/store/workflow.d.ts.map +1 -0
  307. package/lib/types/sts-token-types.d.ts +72 -0
  308. package/lib/types/sts-token-types.d.ts.map +1 -0
  309. package/lib/types/tenant.d.ts +10 -0
  310. package/lib/types/tenant.d.ts.map +1 -0
  311. package/lib/types/tool-execution.d.ts +45 -0
  312. package/lib/types/tool-execution.d.ts.map +1 -0
  313. package/lib/types/training.d.ts +38 -0
  314. package/lib/types/training.d.ts.map +1 -0
  315. package/lib/types/transient-tokens.d.ts +24 -0
  316. package/lib/types/transient-tokens.d.ts.map +1 -0
  317. package/lib/types/user.d.ts +116 -0
  318. package/lib/types/user.d.ts.map +1 -0
  319. package/lib/types/utils/auth.d.ts +3 -0
  320. package/lib/types/utils/auth.d.ts.map +1 -0
  321. package/lib/types/utils/schemas.d.ts +9 -0
  322. package/lib/types/utils/schemas.d.ts.map +1 -0
  323. package/lib/types/utils/type-helpers.d.ts +3 -0
  324. package/lib/types/utils/type-helpers.d.ts.map +1 -0
  325. package/lib/types/versions.d.ts +3 -0
  326. package/lib/types/versions.d.ts.map +1 -0
  327. package/lib/types/workflow-analytics.d.ts +777 -0
  328. package/lib/types/workflow-analytics.d.ts.map +1 -0
  329. package/lib/vertesia-common.js +2 -0
  330. package/lib/vertesia-common.js.map +1 -0
  331. package/package.json +54 -0
  332. package/src/Progress.ts +57 -0
  333. package/src/access-control.ts +98 -0
  334. package/src/analytics.ts +106 -0
  335. package/src/apikey.ts +116 -0
  336. package/src/apps.ts +296 -0
  337. package/src/ask-user.ts +35 -0
  338. package/src/channels.ts +70 -0
  339. package/src/common.ts +37 -0
  340. package/src/data-platform.ts +976 -0
  341. package/src/email.ts +80 -0
  342. package/src/environment.ts +137 -0
  343. package/src/facets.ts +44 -0
  344. package/src/group.ts +26 -0
  345. package/src/index.ts +40 -0
  346. package/src/integrations.ts +72 -0
  347. package/src/interaction.ts +1182 -0
  348. package/src/json-schema.ts +7 -0
  349. package/src/json.ts +4 -0
  350. package/src/meters.ts +30 -0
  351. package/src/model_utility.ts +1 -0
  352. package/src/payload.ts +83 -0
  353. package/src/pending-asks.ts +106 -0
  354. package/src/project.ts +263 -0
  355. package/src/prompt.ts +103 -0
  356. package/src/query.ts +137 -0
  357. package/src/rate-limiter.ts +34 -0
  358. package/src/refs.ts +30 -0
  359. package/src/runs.ts +36 -0
  360. package/src/skill.ts +90 -0
  361. package/src/store/activity-catalog.ts +44 -0
  362. package/src/store/collections.ts +87 -0
  363. package/src/store/common.ts +30 -0
  364. package/src/store/conversation-state.ts +146 -0
  365. package/src/store/doc-analyzer.ts +161 -0
  366. package/src/store/dsl-workflow.ts +288 -0
  367. package/src/store/index.ts +14 -0
  368. package/src/store/ms.d.ts +11 -0
  369. package/src/store/object-types.ts +127 -0
  370. package/src/store/schedule.ts +238 -0
  371. package/src/store/signals.ts +25 -0
  372. package/src/store/store.ts +579 -0
  373. package/src/store/temporalio.ts +54 -0
  374. package/src/store/worker.ts +19 -0
  375. package/src/store/workflow.test.ts +578 -0
  376. package/src/store/workflow.ts +973 -0
  377. package/src/sts-token-types.ts +117 -0
  378. package/src/tenant.ts +10 -0
  379. package/src/tool-execution.ts +47 -0
  380. package/src/training.ts +44 -0
  381. package/src/transient-tokens.ts +30 -0
  382. package/src/user.ts +153 -0
  383. package/src/utils/auth.ts +12 -0
  384. package/src/utils/schemas.ts +108 -0
  385. package/src/utils/type-helpers.ts +6 -0
  386. package/src/versions.ts +3 -0
  387. package/src/workflow-analytics.ts +925 -0
  388. package/tsconfig.dist.json +20 -0
package/src/email.ts ADDED
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Email-related types for agent communication and routing.
3
+ */
4
+
5
+ // ================= User Communication Channels ====================
6
+
7
+ /**
8
+ * Email channel configuration with threading support.
9
+ * Used for email-based agent communication.
10
+ */
11
+ export interface EmailChannel {
12
+ type: "email";
13
+ /** Email address to send agent messages to */
14
+ to_email: string;
15
+ /** Subject for the email thread (without "Re:" prefix) */
16
+ thread_subject?: string;
17
+ /** Message ID for In-Reply-To header (most recent message) */
18
+ in_reply_to?: string;
19
+ /** Chain of message IDs for References header */
20
+ references?: string[];
21
+ /** Short routing key for reply emails (8-char alphanumeric, stored in Redis) */
22
+ route_key?: string;
23
+ }
24
+
25
+ /**
26
+ * Interactive (UI chat) channel configuration.
27
+ * Used for real-time chat interface communication.
28
+ */
29
+ export interface InteractiveChannel {
30
+ type: "interactive";
31
+ }
32
+
33
+ /**
34
+ * Union of all supported user communication channel types.
35
+ */
36
+ export type UserChannel = EmailChannel | InteractiveChannel;
37
+
38
+ /**
39
+ * Type guard for email channels
40
+ */
41
+ export function isEmailChannel(channel: UserChannel): channel is EmailChannel {
42
+ return channel.type === "email";
43
+ }
44
+
45
+ /**
46
+ * Type guard for interactive channels
47
+ */
48
+ export function isInteractiveChannel(channel: UserChannel): channel is InteractiveChannel {
49
+ return channel.type === "interactive";
50
+ }
51
+
52
+ // ================= Email Routing ====================
53
+
54
+ /**
55
+ * Data stored in Redis for email route keys.
56
+ * Used to map short route keys (8-char) to workflow context for email replies.
57
+ *
58
+ * Short keys are used instead of full UUIDs in reply email addresses to avoid
59
+ * Gmail flagging emails as unsafe due to long random-looking strings.
60
+ *
61
+ * Pattern: r+{routeKey}@{domain} instead of r+{32-char-uuid}@{domain}
62
+ */
63
+ export interface EmailRouteData {
64
+ /** The workflow run ID */
65
+ runId: string;
66
+ /** Account ID for quick project lookup */
67
+ accountId: string;
68
+ /** Project ID for quick config lookup */
69
+ projectId: string;
70
+ /** Email thread subject (without "Re:" prefix) */
71
+ threadSubject?: string;
72
+ /** Message ID for In-Reply-To header (last message in thread) */
73
+ inReplyTo?: string;
74
+ /** Chain of message IDs for References header */
75
+ references?: string[];
76
+ /** User's email address (recipient of agent emails, sender of replies) */
77
+ userEmail: string;
78
+ /** Inbound domain for filtering (e.g., inbound.vertesia.io) */
79
+ inboundDomain: string;
80
+ }
@@ -0,0 +1,137 @@
1
+ import type { AIModel, ProviderParams, TextFallbackOptions } from "@llumiverse/common";
2
+ import { ProviderList, Providers } from "@llumiverse/common";
3
+
4
+ // Virtual providers from studio
5
+ export enum CustomProviders {
6
+ virtual_lb = 'virtual_lb',
7
+ virtual_mediator = 'virtual_mediator',
8
+ test = 'test'
9
+ }
10
+
11
+ export type SupportedProviders = Providers | CustomProviders;
12
+
13
+ export const SupportedProviders = {
14
+ ...Providers,
15
+ ...CustomProviders
16
+ } as const;
17
+
18
+ export interface SupportedProviderParams extends Omit<ProviderParams, 'id'> {
19
+ id: SupportedProviders;
20
+ }
21
+
22
+ export const CustomProvidersList: Record<CustomProviders, SupportedProviderParams> = {
23
+ virtual_lb:
24
+ {
25
+ id: CustomProviders.virtual_lb,
26
+ name: "Virtual - Load Balancer",
27
+ requiresApiKey: false,
28
+ requiresEndpointUrl: false,
29
+ supportSearch: false,
30
+ },
31
+ virtual_mediator:
32
+ {
33
+ id: CustomProviders.virtual_mediator,
34
+ name: "Virtual - Mediator",
35
+ requiresApiKey: false,
36
+ requiresEndpointUrl: false,
37
+ supportSearch: false,
38
+ },
39
+ test: {
40
+ id: CustomProviders.test,
41
+ name: "Test LLM",
42
+ requiresApiKey: false,
43
+ requiresEndpointUrl: false,
44
+ supportSearch: false,
45
+ },
46
+ };
47
+
48
+ export const SupportedProvidersList: Record<SupportedProviders, SupportedProviderParams> = {
49
+ ...ProviderList,
50
+ ...CustomProvidersList
51
+ } as const;
52
+
53
+
54
+ export interface VirtualEnvEntry {
55
+ model: string;
56
+ }
57
+
58
+ /**
59
+ * Custom configuration for virtual environments
60
+ **/
61
+ export interface LoadBalancingEnvConfig {
62
+ entries?: LoadBalancingEnvEntryConfig[];
63
+ balance_if_failed?: boolean;
64
+ }
65
+
66
+ export interface LoadBalancingEnvEntryConfig extends VirtualEnvEntry {
67
+ weight: number;
68
+ }
69
+
70
+ export interface MediatorEnvConfig {
71
+ entries?: VirtualEnvEntry[];
72
+ max_concurrent_requests?: number;
73
+ // the model used to evaluate the responses. If not specified all entries will mediates the response
74
+ // and the best response will be picked
75
+ mediators?: VirtualEnvEntry[];
76
+ model_options?: TextFallbackOptions;
77
+ }
78
+
79
+ export interface ExecutionEnvironment {
80
+ id: string;
81
+ name: string;
82
+ provider: SupportedProviders;
83
+ description?: string;
84
+ endpoint_url?: string;
85
+ default_model?: string;
86
+ enabled_models?: AIModel[];
87
+ apiKey?: string;
88
+ config?: any;
89
+ account: string;
90
+ allowed_projects?: string[];
91
+ created_by: string,
92
+ updated_by: string,
93
+ created_at: string;
94
+ updated_at: string;
95
+ }
96
+
97
+ export interface ExecutionEnvironmentRef {
98
+ id: string;
99
+ name: string;
100
+ provider: SupportedProviders;
101
+ enabled_models?: AIModel[];
102
+ default_model?: string;
103
+ endpoint_url?: string;
104
+ allowed_projects?: string[];
105
+ account: string;
106
+ created_by: string;
107
+ updated_by: string;
108
+ created_at: string;
109
+ updated_at: string;
110
+ }
111
+
112
+ export const ExecutionEnvironmentRefPopulate = "id name provider enabled_models default_model endpoint_url allowed_projects account created_at updated_at";
113
+
114
+ export interface ExecutionEnvironmentCreatePayload extends Omit<ExecutionEnvironment, 'id' | 'account' | 'created_at' | 'updated_at' | 'created_by' | 'updated_by' | 'project'> { }
115
+ export interface ExecutionEnvironmentUpdatePayload extends Partial<Omit<ExecutionEnvironment, 'id' | 'account' | 'created_at' | 'updated_at' | 'created_by' | 'updated_by'>> { }
116
+
117
+ export interface MigrateInteractionsPayload {
118
+ /**
119
+ * The new environment ID to set in the Interactions
120
+ */
121
+ new_env_id: string;
122
+ /**
123
+ * The new model ID to set in the Interactions
124
+ */
125
+ new_model_id: string;
126
+ /**
127
+ * The list of Interaction IDs to update.
128
+ *
129
+ * The Interactions must be in draft status.
130
+ */
131
+ interaction_ids: string[];
132
+ }
133
+
134
+ export interface MigrateInteractionsResult {
135
+ matched_count: number;
136
+ modified_count: number;
137
+ }
package/src/facets.ts ADDED
@@ -0,0 +1,44 @@
1
+
2
+ // this is the mongo definition of a facet. see https://www.mongodb.com/docs/atlas/atlas-search/facet/
3
+ export interface StringFacet {
4
+ type: "string",
5
+ path: string,
6
+ numBuckets?: number,
7
+ }
8
+
9
+ export interface NumericFacet {
10
+ type: "number",
11
+ path: string,
12
+ boundaries: number[],
13
+ default?: string
14
+ }
15
+
16
+ export interface DateFacet<T extends (Date | string) = string> {
17
+ type: "date",
18
+ path: string,
19
+ boundaries: T[], // array of dates
20
+ default?: string
21
+ }
22
+
23
+ export type Facet<DateT extends (Date | string) = string> = StringFacet | NumericFacet | DateFacet<DateT>;
24
+
25
+
26
+ export interface FacetSpec {
27
+ name: string;
28
+ field: string;
29
+ }
30
+
31
+ export interface FacetBucket {
32
+ _id: string,
33
+ count: number,
34
+ }
35
+
36
+ export interface FacetNameBucket {
37
+ name: string,
38
+ _id: string,
39
+ count: number,
40
+ }
41
+
42
+ export interface FacetResult {
43
+ buckets: FacetBucket[]
44
+ }
package/src/group.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { UserRef } from "./user.js";
2
+
3
+
4
+ export interface UserGroup {
5
+ id: string;
6
+ account: string;
7
+ name: string;
8
+ description?: string;
9
+ tags: string[];
10
+ created_at: Date;
11
+ updated_at: Date;
12
+ created_by?: string;
13
+ updated_by?: string;
14
+ }
15
+
16
+ export interface PopulatesUserGroup extends UserGroup {
17
+ members: UserRef[];
18
+ }
19
+
20
+ export interface UserGroupRef {
21
+ id: string;
22
+ name: string;
23
+ tags?: string[];
24
+ }
25
+
26
+ export const UserGroupRefPopulate = 'id name tags description';
package/src/index.ts ADDED
@@ -0,0 +1,40 @@
1
+ export * from './access-control.js';
2
+ export * from './analytics.js';
3
+ export * from './apikey.js';
4
+ export * from './apps.js';
5
+ export * from './ask-user.js';
6
+ export * from './channels.js';
7
+ export * from './common.js';
8
+ export * from './data-platform.js';
9
+ export * from './environment.js';
10
+ export * from "./facets.js";
11
+ export * from './group.js';
12
+ export * from './integrations.js';
13
+ export * from './interaction.js';
14
+ export * from './pending-asks.js';
15
+ export * from './json-schema.js';
16
+ export * from './json.js';
17
+ export * from './meters.js';
18
+ export * from './model_utility.js';
19
+ export * from './payload.js';
20
+ export * from "./Progress.js";
21
+ export * from './project.js';
22
+ export * from './prompt.js';
23
+ export * from './query.js';
24
+ export * from './rate-limiter.js';
25
+ export * from './refs.js';
26
+ export * from './runs.js';
27
+ export * from './skill.js';
28
+ export * from "./store/index.js";
29
+ export * from './sts-token-types.js';
30
+ export * from './tenant.js';
31
+ export * from './tool-execution.js';
32
+ export * from "./training.js";
33
+ export * from './transient-tokens.js';
34
+ export * from './user.js';
35
+ export * from './utils/auth.js';
36
+ export * from './utils/schemas.js';
37
+ export type * from './utils/type-helpers.js';
38
+ export * from './versions.js';
39
+ export * from './workflow-analytics.js';
40
+
@@ -0,0 +1,72 @@
1
+
2
+
3
+ export interface IntegrationConfigurationBase {
4
+ enabled: boolean;
5
+ }
6
+
7
+ export interface GladiaConfiguration extends IntegrationConfigurationBase {
8
+ api_key: string;
9
+ url?: string;
10
+ }
11
+
12
+
13
+ export interface GithubConfiguration extends IntegrationConfigurationBase {
14
+ allowed_repositories: string[];
15
+ }
16
+
17
+ export interface AwsConfiguration extends IntegrationConfigurationBase {
18
+ s3_role_arn: string;
19
+ }
20
+
21
+ export interface MagicPdfConfiguration extends IntegrationConfigurationBase {
22
+ // No additional configuration
23
+ default_features?: string[];
24
+ default_zones?: string[];
25
+ }
26
+
27
+ export interface SerperConfiguration extends IntegrationConfigurationBase {
28
+ api_key: string;
29
+ url?: string;
30
+ }
31
+
32
+ export interface ResendConfiguration extends IntegrationConfigurationBase {
33
+ /** Resend API key for sending emails */
34
+ api_key: string;
35
+ /** Domain for email (both sending and receiving). Must be verified in Resend. */
36
+ email_domain: string;
37
+ /** Default display name for outgoing emails (e.g., "Vertesia - Project Name") */
38
+ default_from_name?: string;
39
+ /** Webhook secret for validating inbound email webhooks (required for receiving emails) */
40
+ webhook_secret: string;
41
+ /** Domains allowed to send emails TO start agents (for inbound validation) */
42
+ allowed_sender_domains?: string[];
43
+ /** Require sender to have project access to start agents via email (default: true) */
44
+ require_project_access?: boolean;
45
+ /** Require DKIM/SPF authentication to pass for inbound emails (default: true) */
46
+ require_email_auth?: boolean;
47
+ }
48
+
49
+ /**
50
+ * Configuration for ask_user webhook notifications.
51
+ * Sends webhooks when agents call ask_user and when users respond.
52
+ */
53
+ export interface AskUserWebhookConfiguration extends IntegrationConfigurationBase {
54
+ /** Webhook URL to receive ask_user events */
55
+ webhook_url: string;
56
+ /** Secret for signing webhook payloads (HMAC-SHA256) */
57
+ webhook_secret?: string;
58
+ /** Which events to send: ['requested', 'resolved'] or subset (default: both) */
59
+ events?: ('requested' | 'resolved')[];
60
+ /** Custom headers to include in webhook requests */
61
+ custom_headers?: Record<string, string>;
62
+ }
63
+
64
+ export enum SupportedIntegrations {
65
+ gladia = "gladia",
66
+ github = "github",
67
+ aws = "aws",
68
+ magic_pdf = "magic_pdf",
69
+ serper = "serper",
70
+ resend = "resend",
71
+ ask_user_webhook = "ask_user_webhook",
72
+ }