@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/query.ts ADDED
@@ -0,0 +1,137 @@
1
+ import { ExecutionRunStatus } from './interaction.js';
2
+ import { CollectionSearchPayload } from './store/collections.js';
3
+ import { SearchTypes, SupportedEmbeddingTypes } from "./project.js";
4
+
5
+ export type EmbeddingSearchConfig = Partial<Record<SupportedEmbeddingTypes, boolean>>;
6
+
7
+ export interface RunListingQueryOptions {
8
+ project?: string;
9
+ interaction?: string | string[];
10
+ limit?: number;
11
+ offset?: number;
12
+ filters?: RunListingFilters;
13
+ }
14
+
15
+ export interface RunListingFilters {
16
+ interaction?: string | string[],
17
+ status?: ExecutionRunStatus,
18
+ model?: string,
19
+ environment?: string,
20
+ tag?: string,
21
+ fromDate?: string,
22
+ toDate?: string,
23
+ parent?: string | false,
24
+ workflow_run_ids?: string[],
25
+ }
26
+
27
+ export type scoreAggregationTypes = 'rrf' | 'rsf' | 'smart';
28
+ export type dynamicScalingTypes = 'off' | 'on';
29
+
30
+ export interface VectorSearchQuery {
31
+ objectId?: string;
32
+ values?: number[];
33
+ text?: string;
34
+ image?: string;
35
+ config?: EmbeddingSearchConfig;
36
+ }
37
+
38
+ export interface SimpleSearchQuery {
39
+ name?: string;
40
+ status?: string | string[];
41
+ limit?: number;
42
+ offset?: number;
43
+ }
44
+
45
+ export interface ObjectSearchQuery extends SimpleSearchQuery {
46
+ id?: string;
47
+ createdFrom?: string;
48
+ createdTo?: string;
49
+ updatedFrom?: string;
50
+ updatedTo?: string;
51
+ location?: string;
52
+ parent?: string;
53
+ type?: string;
54
+ types?: string[];
55
+ all_revisions?: boolean;
56
+ from_root?: string;
57
+ }
58
+
59
+ export interface ObjectTypeSearchQuery extends SimpleSearchQuery {
60
+ chunkable?: boolean;
61
+ }
62
+
63
+ export interface PromptSearchQuery extends SimpleSearchQuery {
64
+ role?: string;
65
+ matchInteractions?: boolean;
66
+ }
67
+
68
+ export interface InteractionSearchQuery extends SimpleSearchQuery {
69
+ prompt?: string;
70
+ tags?: string[];
71
+ version?: string;
72
+ model?: string;
73
+ environment?: string;
74
+ }
75
+
76
+ export interface RunSearchQuery extends SimpleSearchQuery {
77
+ offset?: number;
78
+ interaction?: string;
79
+ environment?: string;
80
+ model?: string;
81
+ status?: ExecutionRunStatus;
82
+ tags?: string[];
83
+ query?: string;
84
+ default_query_path?: string;
85
+ parent?: string[] | false;
86
+ object?: string;
87
+ start?: string;
88
+ end?: string;
89
+ finish_reason?: string;
90
+ created_by?: string;
91
+ workflow_run_ids?: string[];
92
+ run_ids?: string[];
93
+ }
94
+
95
+ export interface WorkflowExecutionSearchQuery extends SimpleSearchQuery {
96
+ documentId?: string;
97
+ eventName?: string;
98
+ ruleId?: string;
99
+ start?: string;
100
+ end?: string;
101
+ status?: string;
102
+ }
103
+
104
+ /**
105
+ * ComplexSearchQuery is used for full-text search and vector embedding search.
106
+ */
107
+ export interface ComplexSearchQuery extends ObjectSearchQuery {
108
+ vector?: VectorSearchQuery;
109
+
110
+ /**
111
+ * If present, do a full text search (snake_case version).
112
+ */
113
+ full_text?: string;
114
+
115
+ weights?: Record<SearchTypes, number>;
116
+
117
+ /**
118
+ * dynamicScaling rescales the weights when a particular search type is not present in the results, per object.
119
+ * e.g. Weights of 5,3,2 will be treated as 0,3,2 if the first search type is not present in the results.
120
+ * Ignored when scoreAggregation is 'smart'
121
+ * Default is 'on'
122
+ */
123
+ dynamic_scaling?: dynamicScalingTypes; // Move to top level
124
+
125
+ /**
126
+ * rrf: Reciprocal Rank Fusion
127
+ * rsf: Reciprocal Score Fusion
128
+ * smart: Our own algorithm (default and recommended)
129
+ */
130
+ score_aggregation?: scoreAggregationTypes;
131
+
132
+ match?: Record<string, any>;
133
+ }
134
+
135
+ export interface ComplexCollectionSearchQuery extends CollectionSearchPayload {
136
+ match?: Record<string, any>;
137
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Rate Limiter Types
3
+ */
4
+
5
+ export interface RateLimiterCapacity {
6
+ current: number;
7
+ base: number;
8
+ max: number;
9
+ }
10
+
11
+ export interface RateLimiterBreakerState {
12
+ state: 'open' | 'closed';
13
+ is_open: boolean;
14
+ last_opened_at?: string;
15
+ consecutive_failures?: number;
16
+ }
17
+
18
+ export interface RateLimiterModelStatus {
19
+ model_id: string;
20
+ admitted: number;
21
+ delayed: number;
22
+ capacity: RateLimiterCapacity;
23
+ breaker: RateLimiterBreakerState;
24
+ last_updated: string;
25
+ }
26
+
27
+ export interface RateLimiterStatus {
28
+ environment_id: string;
29
+ model_id: string;
30
+ status: RateLimiterModelStatus;
31
+ }
32
+
33
+ // Always return an array for consistency
34
+ export type RateLimiterStatusResponse = RateLimiterStatus[];
package/src/refs.ts ADDED
@@ -0,0 +1,30 @@
1
+
2
+
3
+ export enum ResolvableRefType {
4
+ project = "Project",
5
+ projects = "Projects",
6
+ environment = "Environment",
7
+ user = "User",
8
+ account = "Account",
9
+ interaction = "Interaction",
10
+ userGroup = "UserGroup"
11
+ }
12
+
13
+ export interface ResolvableRef {
14
+ type: ResolvableRefType
15
+ id: string
16
+ }
17
+
18
+ export interface RefResolutionRequest {
19
+
20
+ refs: ResolvableRef[]
21
+
22
+ }
23
+
24
+
25
+ export interface ResourceRef {
26
+ id: string
27
+ name: string
28
+ type: string
29
+ description?: string
30
+ }
package/src/runs.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { FacetResult } from './facets.js';
2
+ import { NamedInteractionExecutionPayload } from './interaction.js';
3
+
4
+ /**
5
+ * The run ref is used to identify a run document in the storage
6
+ */
7
+ export interface ExecutionRunDocRef {
8
+ id: string,
9
+ account: string,
10
+ project: string,
11
+ }
12
+
13
+ /**
14
+ * Interaction execution payload for creating a new run
15
+ * It uses interaction field (from NamedInteractionExecutionPayload) to pass the interaction ID to run
16
+ */
17
+ export interface RunCreatePayload extends NamedInteractionExecutionPayload {
18
+ }
19
+
20
+ /**
21
+ * To be used as a value for a numeric or date filters
22
+ */
23
+ export interface RangeValue {
24
+ gt?: number | string,
25
+ gte?: number | string,
26
+ lt?: number | string,
27
+ lte?: number | string,
28
+ }
29
+
30
+ export interface RunSearchMetaResponse {
31
+ count: {
32
+ lower_bound?: number,
33
+ total?: number,
34
+ },
35
+ facet: Record<string, FacetResult>
36
+ }
package/src/skill.ts ADDED
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Skill types for interaction-based skills.
3
+ *
4
+ * Skills are interactions with `agent_runner_options.is_skill = true`.
5
+ * They provide contextual instructions to agents without executing code.
6
+ * When a skill is called, its rendered prompt is returned as instructions.
7
+ *
8
+ * Skills can have associated scripts stored at:
9
+ * skills/{skill_name}/*.py, *.js, etc.
10
+ * These are automatically synced to the sandbox when the skill is used.
11
+ */
12
+
13
+ /**
14
+ * Context provided when searching for relevant skills
15
+ */
16
+ export interface SkillContext {
17
+ /**
18
+ * The task description or user prompt
19
+ */
20
+ task_description?: string;
21
+
22
+ /**
23
+ * Tools currently being used or available
24
+ */
25
+ tool_names?: string[];
26
+
27
+ /**
28
+ * Sample of input data for pattern matching
29
+ */
30
+ data_sample?: string;
31
+
32
+ /**
33
+ * Additional keywords to consider
34
+ */
35
+ keywords?: string[];
36
+ }
37
+
38
+ /**
39
+ * Payload for finding relevant skills
40
+ */
41
+ export interface FindRelevantSkillsPayload {
42
+ context: SkillContext;
43
+ limit?: number;
44
+ }
45
+
46
+ /**
47
+ * Result from skill injection into agent context.
48
+ * Contains the rendered prompt/instructions from a skill interaction.
49
+ */
50
+ export interface InjectedSkill {
51
+ /**
52
+ * The skill/interaction name
53
+ */
54
+ name: string;
55
+
56
+ /**
57
+ * The skill's rendered instructions (from the interaction prompt)
58
+ */
59
+ instructions: string;
60
+
61
+ /**
62
+ * Tools related to this skill
63
+ */
64
+ related_tools?: string[];
65
+
66
+ /**
67
+ * UI module for rendering results
68
+ */
69
+ ui_module?: string;
70
+
71
+ /**
72
+ * Match score (0-1) indicating relevance
73
+ */
74
+ match_score?: number;
75
+ }
76
+
77
+ /**
78
+ * Result from generateTools activity with skills
79
+ */
80
+ export interface ToolsWithSkills {
81
+ /**
82
+ * Array of tool definitions
83
+ */
84
+ tools: unknown[]; // ToolDefinition[]
85
+
86
+ /**
87
+ * Skills injected based on context
88
+ */
89
+ injected_skills: InjectedSkill[];
90
+ }
@@ -0,0 +1,44 @@
1
+ export type TsPropType = "string" | "number" | "boolean" | "record" | "object" | "array" | "enum" | "literal" | "union" | "promise" | "any" | "void";
2
+
3
+ // generic types are replaced by "any"
4
+ export interface ActivityTypeDefinition {
5
+ name: TsPropType;
6
+ // in case of primitives will be the type name: string, boolean number.
7
+ // in case of objects or enums will be the object name
8
+ // in case of arrays will be String(itemType.value)+"[]"
9
+ // in case of primitive literals will be the value
10
+ // or nested objects / arrays will be "object" or "array"
11
+ // for record this is Record<type,type>
12
+ value: string | boolean | number | null;
13
+ // in case of objects
14
+ members?: ActivityPropertyDefinition[];
15
+ // in case of arrays or promises will be innerType (i.e. the element type for arrays)
16
+ innerType?: ActivityTypeDefinition;
17
+ // in case of enums the enum values will be here
18
+ enum?: string[] | number[] | undefined;
19
+ // in case of unions
20
+ union?: ActivityTypeDefinition[];
21
+ }
22
+
23
+ export interface ActivityPropertyDefinition {
24
+ name: string;
25
+ type: ActivityTypeDefinition;
26
+ optional: boolean;
27
+ // the JSDoc comment for the activity property
28
+ doc?: string;
29
+ }
30
+
31
+ export interface ActivityDefinition {
32
+ name: string;
33
+ // generated from name
34
+ title: string;
35
+ // the JSDoc comment for the activity function
36
+ doc?: string;
37
+ paramsType: string;
38
+ params: ActivityPropertyDefinition[];
39
+ returnType?: ActivityTypeDefinition | undefined;
40
+ }
41
+
42
+ export interface ActivityCatalog {
43
+ activities: ActivityDefinition[];
44
+ }
@@ -0,0 +1,87 @@
1
+ import { BaseObject } from "./common.js";
2
+ import { ColumnLayout, ContentObjectTypeRef } from "./store.js";
3
+
4
+ export enum CollectionStatus {
5
+ active = "active",
6
+ archived = "archived",
7
+ }
8
+
9
+ export interface CreateCollectionPayload {
10
+ name: string;
11
+ dynamic: boolean;
12
+ description?: string;
13
+ skip_head_sync?: boolean;
14
+ tags?: string[];
15
+ type?: string;
16
+ query?: Record<string, any>;
17
+ properties?: Record<string, any>;
18
+ parent?: string | null;
19
+ table_layout?: ColumnLayout[] | null;
20
+ allowed_types?: string[];
21
+ updated_by?: string,
22
+ shared_properties?: string[];
23
+ }
24
+
25
+ export interface CollectionItem extends BaseObject {
26
+ /**
27
+ * A flag to indicate if the collection is dynamic or static.
28
+ * If the collection is dynamic, the members are determined by a query using the query field.
29
+ * If the collection is static, the members are explicitly defined using the members array.
30
+ */
31
+ dynamic: boolean;
32
+ status: CollectionStatus;
33
+ // A ref to the object type
34
+ type?: ContentObjectTypeRef;
35
+ /**
36
+ * A flag to indicate whether to track and sync member HEAD revisions.
37
+ * The default is to sync HEAD revisions for collection members (skip_head_sync: false)
38
+ */
39
+ skip_head_sync: boolean;
40
+ /**
41
+ * The parent collections if any.
42
+ * A collection can have multiple parents.
43
+ */
44
+ parents?: string[] | null;
45
+ /**
46
+ * The table layout to use for the collection.
47
+ * The layout defined in the type could serve as a fallback if not defined here.
48
+ */
49
+ table_layout?: ColumnLayout[];
50
+
51
+ /**
52
+ * The allowed types for the collection.
53
+ */
54
+ allowed_types?: string[];
55
+ }
56
+
57
+ export interface Collection extends CollectionItem {
58
+ properties: Record<string, any>;
59
+ query?: Record<string, any>;
60
+ security?: Record<string, string[]>; // ACL for collection access
61
+ /**
62
+ * List of property names from the collection's properties that should be shared with (injected into) member objects.
63
+ * These properties will be propagated to all members of this collection and merged as arrays.
64
+ */
65
+ shared_properties?: string[];
66
+ }
67
+
68
+ export interface StaticCollection extends Collection {
69
+ dynamic: false;
70
+ members: string[];
71
+ query: never;
72
+ }
73
+
74
+ export interface DynamicCollection extends Collection {
75
+ dynamic: true;
76
+ }
77
+
78
+ export interface CollectionSearchPayload {
79
+ parent?: string | null;
80
+ dynamic?: boolean;
81
+ status?: CollectionStatus;
82
+ limit?: number;
83
+ offset?: number;
84
+ name?: string;
85
+ type?: string;
86
+ types?: string[];
87
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Base interface for all domain objects in the system.
3
+ * Provides common properties shared across all business entities.
4
+ */
5
+ export interface BaseObject {
6
+ /** Unique identifier for the object */
7
+ id: string;
8
+
9
+ /** Human-readable name or title */
10
+ name: string;
11
+
12
+ /** Optional detailed description of the object */
13
+ description?: string;
14
+
15
+ /** Optional array of categorization tags */
16
+ tags?: string[];
17
+
18
+ /** Identifier of the user who last modified the object */
19
+ updated_by: string;
20
+
21
+ /** Identifier of the user who created the object */
22
+ created_by: string;
23
+
24
+ /** ISO timestamp of when the object was created */
25
+ created_at: string;
26
+
27
+ /** ISO timestamp of when the object was last updated */
28
+ updated_at: string;
29
+
30
+ }
@@ -0,0 +1,146 @@
1
+ import { CompletionResult, ExecutionTokenUsage, StatelessExecutionOptions, ToolUse } from "@llumiverse/common";
2
+ import { ConversationStripOptions, ResolvedInteractionExecutionInfo, UserChannel } from "../interaction.js";
3
+ import { ExecutionRunDocRef } from "../runs.js";
4
+ import { Plan, WorkflowAncestor } from "./workflow.js";
5
+
6
+ /**
7
+ * Lightweight tool reference for activity payloads.
8
+ * References tools stored in GCP instead of embedding full tool definitions.
9
+ */
10
+ export interface ToolReference {
11
+ storage_key: string;
12
+ tool_count: number;
13
+ stored_at: string;
14
+ }
15
+
16
+ /**
17
+ * Conversation state passed between workflow activities.
18
+ * Contains all context needed to continue a multi-turn agent conversation.
19
+ */
20
+ export interface ConversationState {
21
+ /**
22
+ * A reference to the run that started the conversation
23
+ */
24
+ run: ExecutionRunDocRef;
25
+
26
+ /**
27
+ * The execution environment with provider info for LLM calls.
28
+ */
29
+ environment: string;
30
+
31
+ /**
32
+ * The options to use on the next call.
33
+ */
34
+ options: StatelessExecutionOptions;
35
+
36
+ /**
37
+ * The tools to call next.
38
+ */
39
+ tool_use?: ToolUse[];
40
+
41
+ /**
42
+ * The output of the this conversation step
43
+ */
44
+ output: CompletionResult[];
45
+
46
+ /**
47
+ * The token usage of the this conversation step
48
+ */
49
+ token_usage?: ExecutionTokenUsage;
50
+
51
+ /** If a sub workflow execution, contains the parent's info */
52
+ parent?: WorkflowAncestor;
53
+
54
+ /** Full ancestry chain from root to immediate parent (for hierarchical aggregation) */
55
+ ancestors: WorkflowAncestor[];
56
+
57
+ /** If part of a larger agentic workflow, task id of this task */
58
+ task_id?: string;
59
+
60
+ /** Stores the most recent plan for reference by plan-related tools */
61
+ plan?: Plan;
62
+
63
+ /** Debug mode (more logs and persisted artifacts) */
64
+ debug?: boolean;
65
+
66
+ /**
67
+ * Configuration for stripping large data from conversation history.
68
+ * Passed to llumiverse ExecutionOptions.stripImagesAfterTurns.
69
+ */
70
+ strip_options?: ConversationStripOptions;
71
+
72
+ /** Conversation artifacts base url */
73
+ conversation_artifacts_base_url?: string;
74
+
75
+ /** Reference to tools stored in GCP instead of embedding full tool definitions */
76
+ tool_reference?: ToolReference;
77
+
78
+ /** Names of currently active tools (base + unlocked). Tool definitions loaded from tool_reference. */
79
+ active_tool_names?: string[];
80
+
81
+ /** Skills that have been used in this conversation (for auto-syncing scripts and package installation) */
82
+ used_skills?: UsedSkill[];
83
+
84
+ /** All available skills from registered tool collections (for upfront hydration in sandbox) */
85
+ available_skills?: AvailableSkill[];
86
+
87
+ /** Whether to stream LLM responses to Redis (cached from project config) */
88
+ streaming_enabled?: boolean;
89
+
90
+ /**
91
+ * Active communication channels with their current state.
92
+ * Channels can be updated as conversation progresses (e.g., email threading info).
93
+ */
94
+ user_channels?: UserChannel[];
95
+
96
+ /**
97
+ * The resolved interaction execution info.
98
+ * Contains interaction ID, name, version, and environment details.
99
+ */
100
+ resolvedInteraction?: ResolvedInteractionExecutionInfo;
101
+
102
+ /**
103
+ * End conversation metadata set when end_conversation tool is called.
104
+ * Signals the workflow to terminate gracefully.
105
+ */
106
+ end_conversation?: {
107
+ final_result?: string;
108
+ status?: 'success' | 'failure';
109
+ reason?: string;
110
+ };
111
+
112
+ /**
113
+ * Tools that have been unlocked by skills during the conversation.
114
+ * These tools were initially hidden (default: false) but became available
115
+ * when a skill with related_tools was called.
116
+ */
117
+ unlocked_tools?: string[];
118
+
119
+ /**
120
+ * Mapping of skill names to their related tools.
121
+ * When a skill is called, its related tools are added to unlocked_tools.
122
+ */
123
+ skill_tool_map?: Record<string, string[]>;
124
+ }
125
+
126
+ /** Skill metadata collected at workflow start for upfront sandbox hydration */
127
+ export interface AvailableSkill {
128
+ /** Skill name (e.g., "analyze_data") - without the "learn_" prefix */
129
+ name: string;
130
+ /** Source URL of the skill collection (e.g., "https://tools.vertesia.io/api/skills/data-analysis") */
131
+ src: string;
132
+ }
133
+
134
+ /** Skill metadata tracked when a skill is used */
135
+ export interface UsedSkill {
136
+ /** Skill name (e.g., "analyze_data") */
137
+ name: string;
138
+ /** Source URL of the skill collection (e.g., "https://tools.vertesia.io/api/skills/data-analysis") */
139
+ src: string;
140
+ /** Programming language (e.g., "python") */
141
+ language?: string;
142
+ /** Required packages (e.g., ["pandas", "numpy"]) */
143
+ packages?: string[];
144
+ /** System-level packages to install via sudo apt-get (e.g., ["poppler-utils"]) */
145
+ system_packages?: string[];
146
+ }