@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
@@ -0,0 +1,98 @@
1
+ /**
2
+ * @module access-control
3
+ * @description
4
+ * Access control interfaces
5
+ */
6
+
7
+ import { ProjectRoles } from "./project.js";
8
+
9
+ export enum Permission {
10
+ int_read = "interaction:read",
11
+ int_write = "interaction:write",
12
+ int_delete = "interaction:delete",
13
+
14
+ int_execute = "interaction:execute",
15
+ run_read = "run:read",
16
+ run_write = "run:write",
17
+
18
+ env_admin = "environment:admin",
19
+
20
+ project_admin = "project:admin",
21
+ project_integration_read = "project:integration_read",
22
+ project_settings_write = "project:settings_write",
23
+
24
+ api_key_create = "api_key:create",
25
+ api_key_read = "api_key:read",
26
+ api_key_update = "api_key:update",
27
+ api_key_delete = "api_key:delete",
28
+
29
+ account_read = "account:read",
30
+ account_write = "account:write",
31
+ account_admin = "account:admin",
32
+ manage_billing = "account:billing",
33
+ account_member = "account:member",
34
+
35
+
36
+ content_read = "content:read",
37
+ content_write = "content:write",
38
+ content_delete = "content:delete",
39
+ content_admin = "content:admin", //manage schemas
40
+ content_superadmin = "content:superadmin", // list all objects and collections
41
+
42
+
43
+ workflow_run = "workflow:run",
44
+ workflow_admin = "workflow:admin",
45
+ workflow_superadmin = "workflow:superadmin",
46
+
47
+ iam_impersonate = "iam:impersonate",
48
+
49
+ /** whether the user has access to Sutdio App. */
50
+ studio_access = "studio:access",
51
+ }
52
+
53
+ export enum AccessControlResourceType {
54
+ project = "project",
55
+ environment = "environment",
56
+ account = "account",
57
+ interaction = "interaction",
58
+ app = "application",
59
+ }
60
+
61
+ export enum AccessControlPrincipalType {
62
+ user = "user",
63
+ group = "group",
64
+ apikey = "apikey",
65
+ }
66
+
67
+
68
+
69
+ export interface AccessControlEntry {
70
+ role: ProjectRoles;
71
+ resource_type: AccessControlResourceType;
72
+ resource: string; //objectId
73
+ principal_type: AccessControlPrincipalType;
74
+ principal: string; //objectId
75
+ tags?: string[];
76
+ expires_at?: string;
77
+ created_at?: string;
78
+ updated_at?: string;
79
+ id: string;
80
+ }
81
+
82
+ export interface ACECreatePayload extends
83
+ Omit<AccessControlEntry, "created_at" | "updated_at" | "id"> {
84
+ }
85
+
86
+ export interface ACEUpdatePayload extends Partial<ACECreatePayload> {
87
+ }
88
+
89
+
90
+ export interface AcesQueryOptions {
91
+
92
+ level?: 'resource' | 'project' | 'projects' | 'account'
93
+ resource?: string
94
+ principal?: string
95
+ role?: string
96
+ type?: AccessControlResourceType
97
+
98
+ }
@@ -0,0 +1,106 @@
1
+
2
+ export interface AnalyticsAxis {
3
+ environment?: string;
4
+ project?: string;
5
+ interactions?: string[];
6
+ models?: string[];
7
+ status?: string[];
8
+ tags?: string[];
9
+ selectedOnly?: boolean;
10
+ }
11
+
12
+ export interface RunAnalyticsQuery {
13
+
14
+ /** filters to apply to the query */
15
+ filterBy: AnalyticsAxis;
16
+
17
+ /** The field to group by */
18
+ groupBy?: RunAnalyticsGroupBy
19
+
20
+ /** The start date of the query in EPOCH format */
21
+ from?: number;
22
+ /** The end date of the query in EPOCH format */
23
+ to?: number;
24
+
25
+ /** The time resolution unit of the analytics query */
26
+ resolution?: TimeResolution;
27
+
28
+ /** The step size for the resolution (e.g., 4 with resolution='hour' means 4-hour intervals). Defaults to 1. */
29
+ resolutionStep?: number;
30
+
31
+ /** The field to sort by */
32
+ virtual?: boolean;
33
+
34
+ }
35
+
36
+
37
+ export type RunAnalyticsGroupBy = "interaction" | "modelId" | "project" | "status" | "tags" | "environment";
38
+
39
+ export type TimeResolution = "minute" | "hour" | "day" | "week" | "month" | "year";
40
+
41
+
42
+ export interface RunAnalyticsResult {
43
+ date: string,
44
+ timestamp: string,
45
+ group: string
46
+ count: number,
47
+ execution_time: {
48
+ avg: number,
49
+ min: number,
50
+ max: number
51
+ },
52
+ }
53
+
54
+ /** Entity with status breakdown (requires compound index for covered queries) */
55
+ export interface EntityStatusCounts {
56
+ id: string;
57
+ name: string;
58
+ /** Total count, or null if query failed */
59
+ total: number | null;
60
+ /** Counts by status, values are null if individual status query failed */
61
+ byStatus: Record<string, number | null>;
62
+ /** True if any query for this entity failed */
63
+ hasErrors?: boolean;
64
+ }
65
+
66
+ /** Lightweight analytics summary using covered queries - scalable to 1M+ documents */
67
+ export interface RunsAnalyticsSummary {
68
+ /** Total count of runs (from estimatedDocumentCount), null if failed */
69
+ total: number | null;
70
+ /** Counts by status, values are null if individual query failed */
71
+ byStatus: Record<string, number | null>;
72
+ /** Counts by environment with status breakdown (uses { environment: 1, status: 1 } compound index) */
73
+ byEnvironment: EntityStatusCounts[];
74
+ /** Counts by interaction with status breakdown (uses { interaction: 1, status: 1 } compound index) */
75
+ byInteraction: EntityStatusCounts[];
76
+ /** Number of queries that failed out of total */
77
+ queryStats: {
78
+ total: number;
79
+ failed: number;
80
+ };
81
+ }
82
+
83
+ /** Date range filter for analytics queries (uses created_at field) */
84
+ export interface DateRangeQuery {
85
+ /** Start date in ISO format, optional (unbounded if omitted) */
86
+ start?: string;
87
+ /** End date in ISO format, optional (unbounded if omitted) */
88
+ end?: string;
89
+ }
90
+
91
+ /** Token usage for a single environment */
92
+ export interface TokenUsageByEnvironment {
93
+ environmentId: string;
94
+ environmentName: string;
95
+ /** Total prompt tokens, null if query failed */
96
+ totalPromptTokens: number | null;
97
+ }
98
+
99
+ /** Summary of token usage by environment (requires { environment: 1, created_at: -1, "token_use.prompt": 1 } index) */
100
+ export interface TokenUsageSummary {
101
+ byEnvironment: TokenUsageByEnvironment[];
102
+ queryStats: {
103
+ total: number;
104
+ failed: number;
105
+ };
106
+ }
package/src/apikey.ts ADDED
@@ -0,0 +1,116 @@
1
+ import { UserGroupRef } from "./group.js";
2
+ import { ProjectRef, ProjectRoles } from "./project.js";
3
+ import { AccountRef } from "./user.js";
4
+
5
+ export enum ApiKeyTypes {
6
+ secret = "sk",
7
+ }
8
+ export interface ApiKey {
9
+ id: string;
10
+ name: string;
11
+ type: ApiKeyTypes;
12
+ role: ProjectRoles;
13
+ maskedValue?: string; //masked value
14
+ account: string; // the account id
15
+ project: ProjectRef; // the project id if any
16
+ enabled: boolean;
17
+ created_by: string;
18
+ updated_by: string;
19
+ created_at: Date;
20
+ updated_at: Date;
21
+ expires_at?: Date; // in case of public key only
22
+ }
23
+
24
+ export interface CreateOrUpdateApiKeyPayload extends Partial<ApiKey> {}
25
+
26
+ export interface ApiKeyWithValue extends Omit<ApiKey, "maskedValue"> {
27
+ value: string;
28
+ }
29
+
30
+ export interface CreatePublicKeyPayload {
31
+ name?: string;
32
+ projectId?: string;
33
+ ttl?: number;
34
+ }
35
+
36
+ export interface AuthTokenResponse {
37
+ token: string;
38
+ }
39
+
40
+ export interface AuthTokenPayload {
41
+ sub: string;
42
+ name: string;
43
+ email?: string;
44
+ picture?: string;
45
+
46
+ type: PrincipalType;
47
+ account: AccountRef;
48
+
49
+ account_roles: ProjectRoles[];
50
+ accounts: AccountRef[];
51
+
52
+ project?: ProjectRef;
53
+ project_roles?: ProjectRoles[];
54
+
55
+ /**
56
+ * The app names enabled for this token. Defaults to an empty array if no apps are enabled.
57
+ */
58
+ apps: string[];
59
+
60
+ /**
61
+ * The user ID (if any) attached to the token.
62
+ * This is set when the token is a user token or an agent token running as a user.
63
+ * Not set for impersonating tokens like project tokens.
64
+ */
65
+ user_id?: string;
66
+
67
+ /** groups */
68
+ groups?: UserGroupRef[]; //group ids
69
+
70
+ /**
71
+ * API endpoints information to be used with this token.
72
+ * Either a n API domain like 'api.vertesia.io' | 'api-preview.vertesia.io' | 'api-staging.vertesia.io' | 'local'
73
+ * or explicit studio, store, and token URLs.
74
+ */
75
+ endpoints?:
76
+ | string
77
+ | {
78
+ studio: string;
79
+ store: string;
80
+ token?: string;
81
+ };
82
+
83
+ iss: string; //issuer
84
+ aud: string; //audience
85
+ exp: number; //expires in (EPOC seconds)
86
+ tags?: string[]; //tags
87
+
88
+ permissions?: string[]; //permissions
89
+ scopes?: string[]; //scopes
90
+
91
+ /**
92
+ * Service caller information for agent and service account tokens.
93
+ * Contains audit information about who/what initiated the token request.
94
+ * For agent tokens, includes `onBehalfOf` with the original user's token payload.
95
+ */
96
+ service_caller?: {
97
+ /** The principal that requested the token (e.g., service account identity) */
98
+ id?: string;
99
+ name?: string;
100
+ email?: string;
101
+ /**
102
+ * For agent tokens: the verified token payload of the user/apikey the agent acts on behalf of.
103
+ * Contains the original user's name, email, picture, user_id, etc.
104
+ */
105
+ onBehalfOf?: AuthTokenPayload;
106
+ [key: string]: unknown;
107
+ };
108
+ }
109
+
110
+ export enum PrincipalType {
111
+ User = "user",
112
+ Group = "group",
113
+ ApiKey = "apikey",
114
+ ServiceAccount = "service_account",
115
+ Agent = "agent",
116
+ }
package/src/apps.ts ADDED
@@ -0,0 +1,296 @@
1
+ import { JSONSchema } from "@llumiverse/common";
2
+
3
+ export interface AppUIConfig {
4
+ /**
5
+ * The source URL of the app. The src can be a template which contain
6
+ * a variable named `buildId` which will be replaced with the current build id.
7
+ * For example: `/plugins/vertesia-review-center-${buildId}`
8
+ */
9
+ src: string;
10
+ /**
11
+ * The isolation strategy. If not specified it defaults to shadow
12
+ * - shadow - use Shadow DOM to fully isolate the plugin from the host.
13
+ * - css - use CSS processing (like prefixing or other isolation techniques). Ligther but plugins may conflict with the host
14
+ */
15
+ isolation?: "shadow" | "css";
16
+ }
17
+
18
+ /**
19
+ * Authentication type for tool collections
20
+ */
21
+ export type ToolCollectionAuthType = "oauth" | "other";
22
+
23
+ /**
24
+ * Tool collection type
25
+ */
26
+ export type ToolCollectionType = "mcp" | "vertesia_sdk";
27
+
28
+ /**
29
+ * Base tool collection configuration
30
+ */
31
+ interface BaseToolCollectionObject {
32
+ /**
33
+ * The URL endpoint for the tool collection
34
+ */
35
+ url: string;
36
+
37
+ /**
38
+ * Optional authentication type required for this tool collection
39
+ */
40
+ auth?: ToolCollectionAuthType;
41
+ }
42
+
43
+ /**
44
+ * MCP tool collection configuration (requires name, description, and namespace)
45
+ */
46
+ export interface MCPToolCollectionObject extends BaseToolCollectionObject {
47
+ type: "mcp";
48
+
49
+ /**
50
+ * Name for the tool collection.
51
+ * Used as an identifier for the collection (e.g., for OAuth authentication).
52
+ */
53
+ name: string;
54
+
55
+ /**
56
+ * Description for the tool collection.
57
+ * Helps users understand what tools this collection provides.
58
+ */
59
+ description: string;
60
+
61
+ /**
62
+ * Prefix to use for tool names from this collection.
63
+ * Provides clean, readable tool names (e.g., "jira" instead of "https://mcp.atlassian.com/v1/mcp")
64
+ */
65
+ namespace: string;
66
+ }
67
+
68
+ /**
69
+ * Vertesia SDK tool collection configuration
70
+ */
71
+ export interface VertesiaSDKToolCollectionObject extends BaseToolCollectionObject {
72
+ type: "vertesia_sdk";
73
+
74
+ /**
75
+ * Optional namespace to use for tool names from this collection.
76
+ * If not provided, the tool server default will be used.
77
+ */
78
+ namespace?: string;
79
+
80
+ /**
81
+ * Optional name for the tool collection.
82
+ * If not provided, the tool server default will be used.
83
+ */
84
+ name?: string;
85
+
86
+ /**
87
+ * Optional description for the tool collection.
88
+ * If not provided, the tool server default will be used.
89
+ */
90
+ description?: string;
91
+ }
92
+
93
+ /**
94
+ * Tool collection configuration (object format)
95
+ */
96
+ export type ToolCollectionObject = MCPToolCollectionObject | VertesiaSDKToolCollectionObject;
97
+
98
+ /**
99
+ * Tool collection can be either:
100
+ * - A string URL (legacy format, with "mcp:" prefix for MCP servers)
101
+ * - An object with url, type, and optional auth (new format)
102
+ */
103
+ export type ToolCollection = string | ToolCollectionObject;
104
+
105
+ /**
106
+ * Normalizes a tool collection to the object format.
107
+ * Handles backward compatibility with string URLs.
108
+ *
109
+ * @param collection - String URL or ToolCollectionObject
110
+ * @returns Normalized ToolCollectionObject
111
+ */
112
+ export function normalizeToolCollection(collection: ToolCollection): ToolCollectionObject {
113
+ if (typeof collection === 'string') {
114
+ // Legacy string format
115
+ if (collection.startsWith('mcp:')) {
116
+ const url = collection.substring('mcp:'.length);
117
+ // For legacy MCP strings, derive name and prefix from URL
118
+ const urlObj = new URL(url);
119
+ const name = urlObj.hostname.replace(/\./g, '-');
120
+ return {
121
+ url,
122
+ type: 'mcp',
123
+ name,
124
+ description: `MCP server at ${url}`,
125
+ namespace: name
126
+ };
127
+ }
128
+ return {
129
+ url: collection,
130
+ type: 'vertesia_sdk'
131
+ };
132
+ }
133
+ // Already in object format
134
+ return collection;
135
+ }
136
+
137
+ export interface AppManifestData {
138
+ /**
139
+ * The name of the app, used as the id in the system.
140
+ * Must be in kebab case (e.g. my-app).
141
+ */
142
+ name: string;
143
+
144
+ /**
145
+ * Visibility level of the app:
146
+ * - "public": visible to all accounts
147
+ * - "private": visible only to the owning account
148
+ * - "vertesia": visible only to Vertesia team members (any project)
149
+ */
150
+ visibility: "public" | "private" | "vertesia";
151
+
152
+ title: string;
153
+ description: string;
154
+ publisher: string;
155
+
156
+ /**
157
+ * A svg icon for the app.
158
+ */
159
+ icon?: string;
160
+
161
+ /**
162
+ * A color name to be used as the color of the app card (e.g. blue, red, green, etc.)
163
+ * If not specified a random color will be picked.
164
+ */
165
+ color?: string;
166
+
167
+ status: "beta" | "stable" | "deprecated"
168
+
169
+ ui?: AppUIConfig
170
+
171
+ /**
172
+ * A list of tool collections endpoints to be used by this app.
173
+ * A tools collection endpoint is an URL which may end with a `?import` query string.
174
+ * If the `?import` query string is used the tool will be imported as a javascript module and not executed through a POST on the collections endpoint.
175
+ */
176
+ tool_collections?: ToolCollection[]
177
+
178
+ /**
179
+ * An URL providing interactions definitions in JSON format.
180
+ * The URL must provide 2 endpoints:
181
+ * 1. GET URL - must return a JSON array with the list of interactions (as AppInteractionRef[])
182
+ * 2. GET URL/{interaction_name} - must return the full interaction definition for the specified interaction.
183
+ */
184
+ interactions?: string;
185
+
186
+ /**
187
+ * A JSON chema for the app installation settings.
188
+ */
189
+ settings_schema?: JSONSchema;
190
+ }
191
+ export interface AppManifest extends AppManifestData {
192
+ id: string;
193
+ account: string;
194
+ created_at: string;
195
+ updated_at: string;
196
+ }
197
+
198
+ export interface AppInstallation {
199
+ id: string;
200
+ project: string; // the project where the app is installed
201
+ manifest: string; // the app manifest
202
+ settings?: Record<string, any>; // settings for the app installation
203
+ created_at: string;
204
+ updated_at: string;
205
+ }
206
+
207
+ export interface AppInstallationWithManifest extends Omit<AppInstallation, 'manifest'> {
208
+ manifest: AppManifest; // the app manifest data
209
+ }
210
+
211
+ export interface AppInstallationPayload {
212
+ app_id: string,
213
+ settings?: Record<string, any>
214
+ }
215
+
216
+ export type AppInstallationKind = 'ui' | 'tools' | 'all';
217
+
218
+ /**
219
+ * A description of the tools provided by an app
220
+ */
221
+ export interface AppToolCollection {
222
+ /**
223
+ * The collection name
224
+ */
225
+ name: string;
226
+
227
+ /**
228
+ * Optional collection description
229
+ */
230
+ description?: string;
231
+
232
+ /**
233
+ * the tools provided by this collection
234
+ */
235
+ tools: { name: string, description?: string }[]
236
+ }
237
+
238
+ /**
239
+ * Information about a tool and its associated app installation.
240
+ * Used to look up which app provides a specific tool.
241
+ */
242
+ export interface ProjectToolInfo {
243
+ /**
244
+ * The tool name
245
+ */
246
+ tool_name: string;
247
+
248
+ /**
249
+ * Optional tool description
250
+ */
251
+ tool_description?: string;
252
+
253
+ /**
254
+ * The app name that provides this tool
255
+ */
256
+ app_name: string;
257
+
258
+ /**
259
+ * The app installation ID
260
+ */
261
+ app_install_id: string;
262
+
263
+ /**
264
+ * The app installation settings.
265
+ * Only included for agent tokens, not user tokens (security: may contain API keys).
266
+ */
267
+ settings?: Record<string, any>;
268
+ }
269
+
270
+ /**
271
+ * OAuth authentication status for an MCP tool collection
272
+ */
273
+ export interface OAuthAuthStatus {
274
+ collection_name: string;
275
+ authenticated: boolean;
276
+ mcp_server_url: string;
277
+ expires_at?: string;
278
+ scope?: string;
279
+ }
280
+
281
+ /**
282
+ * Response from OAuth authorization endpoint
283
+ */
284
+ export interface OAuthAuthorizeResponse {
285
+ authorization_url: string;
286
+ state: string;
287
+ }
288
+
289
+ /**
290
+ * Response from OAuth metadata endpoint
291
+ */
292
+ export interface OAuthMetadataResponse {
293
+ collection_name: string;
294
+ mcp_server_url: string;
295
+ metadata: any;
296
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Types for ask_user tool UX configuration.
3
+ * These types enable the model to transmit structured UX parameters
4
+ * that render as interactive widgets instead of plain text.
5
+ */
6
+
7
+ /** Option for user selection in ask_user widget */
8
+ export interface AskUserOption {
9
+ /** Unique identifier returned when this option is selected */
10
+ id: string;
11
+ /** Display text for the option */
12
+ label: string;
13
+ /** Optional tooltip/description shown on hover */
14
+ description?: string;
15
+ }
16
+
17
+ /** UX configuration for ask_user messages */
18
+ export interface AskUserUxConfig {
19
+ /** Predefined options for the user to select from */
20
+ options?: AskUserOption[];
21
+ /** Visual style variant */
22
+ variant?: 'default' | 'warning' | 'info' | 'success';
23
+ /** Allow selecting multiple options (renders checkboxes instead of buttons) */
24
+ multiSelect?: boolean;
25
+ /** Show text input for free-form response */
26
+ allowFreeResponse?: boolean;
27
+ /** Placeholder text for free-form input */
28
+ placeholder?: string;
29
+ }
30
+
31
+ /** Message details structure for REQUEST_INPUT messages with UX config */
32
+ export interface AskUserMessageDetails {
33
+ /** UX configuration for rendering the ask_user widget */
34
+ ux?: AskUserUxConfig;
35
+ }