@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,161 @@
1
+ import { WorkflowExecutionPayload, WorkflowRunStatus } from "./workflow.js";
2
+
3
+ export interface PdfToRichtextOptions {
4
+ features: string[];
5
+ debug?: boolean;
6
+ [key: string]: any;
7
+ }
8
+
9
+ export interface PdfToRichTextWorkflowPayload extends Omit<WorkflowExecutionPayload, "vars"> {
10
+ vars: PdfToRichtextOptions;
11
+ }
12
+
13
+ /**
14
+ * Represents a image in a document that has been analyzed
15
+ */
16
+ export interface DocImage {
17
+ id?: string;
18
+ page_number?: number;
19
+ description?: string;
20
+ is_meaningful?: boolean;
21
+ width?: number;
22
+ height?: number;
23
+ }
24
+
25
+ /**
26
+ * The export type formats for tables.
27
+ */
28
+ export type ExportTableFormats = 'json' | 'csv' | 'xml';
29
+
30
+ /**
31
+ * Represents a table in a document that has been analyzed
32
+ */
33
+ export interface DocTable {
34
+ page_number?: number;
35
+ table_number?: number;
36
+ title?: string;
37
+ format: "application/csv" | "application/json";
38
+ }
39
+
40
+ /**
41
+ * Represents a table in a document that has been analyzed in CSV format
42
+ */
43
+ export interface DocTableCsv extends DocTable {
44
+ format: "application/csv";
45
+ title?: string;
46
+ data: string;
47
+ }
48
+
49
+ /**
50
+ * Represents a table in a document that has been analyzed in JSON format
51
+ */
52
+ export interface DocTableJson extends DocTable {
53
+ format: "application/json";
54
+ title?: string;
55
+ data: Object[];
56
+ }
57
+
58
+ /**
59
+ * Output format for document processing workflows
60
+ */
61
+ export type DocProcessorOutputFormat = "xml" | "markdown";
62
+
63
+ /**
64
+ * Represents a document analysis run status
65
+ */
66
+ export interface DocAnalyzeRunStatusResponse extends WorkflowRunStatus {
67
+ progress?: DocAnalyzerProgress;
68
+ /** The output format being used for processing (markdown or xml) */
69
+ output_format?: DocProcessorOutputFormat;
70
+ }
71
+
72
+ export interface DocAnalyzerResultResponse {
73
+ document?: string;
74
+ tables?: DocTableCsv[] | DocTableJson[];
75
+ images?: DocImage[];
76
+ annotated?: string | null;
77
+ }
78
+
79
+ export interface DocAnalyzerProgress {
80
+ pages: DocAnalyzerProgressStatus;
81
+ images: DocAnalyzerProgressStatus;
82
+ tables: DocAnalyzerProgressStatus;
83
+ visuals: DocAnalyzerProgressStatus;
84
+ started_at?: number;
85
+ percent: number;
86
+ /** The output format being used for processing (markdown or xml) */
87
+ output_format?: DocProcessorOutputFormat;
88
+ }
89
+
90
+ interface DocAnalyzerProgressStatus {
91
+ total: number;
92
+ processed: number;
93
+ success: number;
94
+ failed: number;
95
+ }
96
+
97
+ /**
98
+ * Adapt Tables Parameters, part of the request
99
+ */
100
+ export interface AdaptTablesParams {
101
+ /**
102
+ * JSON Schema to to convert the table into
103
+ */
104
+ target_schema: string;
105
+
106
+ /**
107
+ * Natural language description of the type item the table are composed of
108
+ */
109
+ item_name: string;
110
+
111
+ /**
112
+ * Natural language description of the type of table or item to convert
113
+ */
114
+ instructions?: string;
115
+
116
+ /**
117
+ * Format to return the data in (csv, json)
118
+ */
119
+ format?: "csv" | "json";
120
+
121
+ /**
122
+ * Process the table as a whole or by page
123
+ */
124
+ process_as?: "page" | "table";
125
+
126
+ /**
127
+ * Process the table as a CSV file
128
+ */
129
+ process_as_csv?: boolean;
130
+ }
131
+
132
+ interface DocAnalyzerRequestBase {
133
+ synchronous?: boolean;
134
+
135
+ notify_endpoints?: string[];
136
+
137
+ /**
138
+ * What environment to use to run the request
139
+ * If none specified the project embedded environment will be used
140
+ */
141
+ environment?: string;
142
+ }
143
+
144
+ export interface AdaptTablesRequest extends DocAnalyzerRequestBase, AdaptTablesParams {}
145
+
146
+ /**
147
+ * Get Adapted Tables Request
148
+ * @param raw If true, the raw data will be returned
149
+ * @param format The format to return the data in (csv, json)
150
+ */
151
+ export interface GetAdaptedTablesRequestQuery {
152
+ raw?: boolean;
153
+ format: "csv" | "json";
154
+ }
155
+ /**
156
+ * The adapted table result format
157
+ */
158
+ export interface AdaptedTable {
159
+ comment?: string;
160
+ data: Record<string, any>[];
161
+ }
@@ -0,0 +1,288 @@
1
+ import { StringValue } from "ms";
2
+ import { BaseObject } from "./common.js";
3
+ import { WorkflowExecutionPayload } from "./index.js";
4
+ import { ParentClosePolicyType } from "./temporalio.js";
5
+
6
+
7
+ /**
8
+ * The payload sent when starting a workflow from the temporal client to the workflow instance.
9
+ */
10
+ export interface DSLWorkflowExecutionPayload extends WorkflowExecutionPayload {
11
+ /**
12
+ * The workflow definition to be used by the DSL workflow.
13
+ * If a dsl workflow is executed and no definition is provided the workflow will fail.
14
+ */
15
+ workflow: DSLWorkflowSpec;
16
+ }
17
+
18
+ /**
19
+ * The payload for a DSL activity options.
20
+ *
21
+ * @see ActivityOptions in @temporalio/common
22
+ */
23
+ export interface DSLActivityOptions {
24
+ startToCloseTimeout?: StringValue | number;
25
+ scheduleToStartTimeout?: StringValue | number;
26
+ scheduleToCloseTimeout?: StringValue | number;
27
+ retry?: DSLRetryPolicy;
28
+ }
29
+
30
+ /**
31
+ * The payload for a DSL retry policy.
32
+ *
33
+ * @see RetryPolicy in @temporalio/common
34
+ */
35
+ export interface DSLRetryPolicy {
36
+ backoffCoefficient?: number;
37
+ initialInterval?: StringValue | number;
38
+ maximumAttempts?: number;
39
+ maximumInterval?: StringValue | number;
40
+ nonRetryableErrorTypes?: string[];
41
+ }
42
+
43
+ /**
44
+ * The payload for a DSL activity execution.
45
+ */
46
+ export interface DSLActivityExecutionPayload<ParamsT extends Record<string, any>> extends WorkflowExecutionPayload {
47
+ activity: DSLActivitySpec;
48
+ params: ParamsT;
49
+ workflow_name: string;
50
+ debug_mode?: boolean;
51
+ }
52
+
53
+
54
+ export type ImportSpec = (string | Record<string, string>)[];
55
+ export interface ActivityFetchSpec {
56
+ /**
57
+ * The data provider name
58
+ */
59
+ type: "document" | "document_type" | "interaction_run";
60
+ /**
61
+ * An optional URI to the data source.
62
+ */
63
+ source?: string;
64
+ /**
65
+ * The query to be executed by the data provider
66
+ */
67
+ query: Record<string, any>;
68
+ /**
69
+ * a string of space separated field names.
70
+ * Prefix a field name with "-" to exclude it from the result.
71
+ */
72
+ select?: string;
73
+
74
+ /**
75
+ * The number of results to return. If the result is limited to 1 the result will be a single object
76
+ */
77
+ limit?: number;
78
+
79
+ /**
80
+ * How to handle not found objects.
81
+ * 1. ignore - Ignore and return an empty array for multi objects query (or undefined for single object query) or empty array for multiple objects throw an error.
82
+ * 2. throw - Throw an error if the object or no objects are found.
83
+ */
84
+ on_not_found?: "ignore" | "throw";
85
+ }
86
+
87
+ export interface DSLWorkflowStepBase {
88
+ /**
89
+ * The type fo the step.
90
+ * If not set defaults to "activity"
91
+ */
92
+ type: "activity" | "workflow";
93
+ }
94
+
95
+ export interface DSLActivitySpec<PARAMS extends Record<string, any> = Record<string, any>> {
96
+ /**
97
+ * The name of the activity function
98
+ */
99
+ name: string;
100
+ /**
101
+ * Title of the activity to be displayed in the UI workflow builder
102
+ */
103
+ title?: string;
104
+ /**
105
+ * The description of the activity to e displayed in the UI workflow builder
106
+ */
107
+ description?: string;
108
+ /**
109
+ * Activities parameters. These parameters can be either literals
110
+ * (hardcoded strings, numbers, booleans, objects, arrays etc.), either
111
+ * references to the workflow variables.
112
+ * The workflow variables are built from the workflow params (e.g. the workflow configuration)
113
+ * and from the result of the previous activities.
114
+ */
115
+ params?: PARAMS;
116
+ /**
117
+ * The name of the workflow variable that will store the result of the activity
118
+ * If not specified the result will not be stored
119
+ * The parameters describe how the actual parameters will be obtained from the workflow execution vars.
120
+ * since it may contain references to workflow execution vars.
121
+ */
122
+ output?: string;
123
+
124
+ /**
125
+ * A JSON expression which evaluate to true or false similar to mongo matches.
126
+ * We support for now basic expression like: $true, $false, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $regexp
127
+ * {$eq: {name: value}},
128
+ * Ex: {$eq: {wfVarName: value}}
129
+ */
130
+ condition?: Record<string, any>;
131
+
132
+ /**
133
+ * The import spec is used to import data from workflow variables.
134
+ * The import spec is a list of variable names to import from the workflow context.
135
+ * You can also use objects to rename the imported variables, or to reference an expression.
136
+ * Example:
137
+ * ["runId", {"typeId": "docType.id"}]
138
+ */
139
+ import?: ImportSpec;
140
+
141
+ /**
142
+ * The fetch phase is used to fetch data from external sources.
143
+ */
144
+ fetch?: Record<string, ActivityFetchSpec>;
145
+
146
+ /**
147
+ * Projection to apply to the result. Not all activities support this.
148
+ */
149
+ projection?: never | Record<string, any>;
150
+
151
+ // ---------- Optional features not implemented in a first step ------------
152
+ /**
153
+ * If true the activity will be executed in parallel with the other activities.
154
+ * (i.e. the workflow will not wait for the activity to finish before starting the next one)
155
+ */
156
+ parallel?: boolean;
157
+
158
+ /**
159
+ * Await for a parallel activity execution to return.
160
+ */
161
+ await?: string; //the activity name to await
162
+
163
+ /**
164
+ * Activity options for configuring the activity execution, which overrides the activity options
165
+ * defined at workflow level.
166
+ */
167
+ options?: DSLActivityOptions;
168
+ }
169
+
170
+ export interface DSLActivityStep<PARAMS extends Record<string, any> = Record<string, any>> extends DSLActivitySpec<PARAMS>, DSLWorkflowStepBase {
171
+ type: "activity";
172
+ }
173
+
174
+ export interface DSLChildWorkflowStep extends DSLWorkflowStepBase {
175
+ type: "workflow";
176
+ // the workflow endpoint to run
177
+ name: string;
178
+ /**
179
+ * The parameters to pass to the child workflow.
180
+ * These parameters will be merged over the parent workflow vars and passed altogether to the child workflow.
181
+ */
182
+ vars?: Record<string, any>;
183
+ // whether or not to wait for the workflow to finish.
184
+ // default is false. (the parent workflow will await for the workflow to finish)
185
+ async?: boolean;
186
+ /**
187
+ * The name of the workflow variable that will store the result of the child workflow (if async the workflow id is stored)
188
+ * If not specified the result will not be stored
189
+ * The parameters describe how the actual parameters will be obtained from the workflow execution vars.
190
+ * since it may contain references to workflow execution vars.
191
+ */
192
+ output?: string;
193
+ /**
194
+ * In case the dslWorkflow is used as a child workflow the spec is used to define the child workflow.
195
+ * If spec is defined then the name must be "dslWorkflow"
196
+ */
197
+ spec?: DSLWorkflowSpec;
198
+ /**
199
+ * If true, copy the parent's workspace artifacts (scripts/, files/, skills/, docs/, out/)
200
+ * to the child workflow's agent space before execution. Defaults to true.
201
+ * conversation.json and tools.json are never copied.
202
+ */
203
+ inherit_artifacts?: boolean;
204
+ options?: {
205
+ memo?: Record<string, any>;
206
+ retry?: DSLRetryPolicy;
207
+ searchAttributes?: Record<string, string[] | number[] | boolean[] | Date[]>;
208
+ taskQueue?: string;
209
+ workflowExecutionTimeout?: StringValue | number;
210
+ workflowRunTimeout?: StringValue | number;
211
+ workflowTaskTimeout?: StringValue | number;
212
+ workflowId?: string;
213
+ cronSchedule?: string;
214
+ parentClosePolicy?: ParentClosePolicyType;
215
+ //TODO
216
+ //cancellationType
217
+ //versioningIntent
218
+ //workflowIdReusePolicy
219
+ }
220
+ }
221
+
222
+ export type DSLWorkflowStep = DSLActivityStep | DSLChildWorkflowStep;
223
+
224
+ export interface DSLWorkflowSpecBase {
225
+ name: string;
226
+ description?: string;
227
+ tags?: string[];
228
+
229
+ steps?: DSLWorkflowStep[] | never;
230
+ /**
231
+ * @deprecated use steps instead
232
+ */
233
+ activities?: DSLActivitySpec[] | never;
234
+
235
+ // a dictionary of vars to initialize the workflow execution vars
236
+ // Initial vars cannot contains references to other vars
237
+ vars: Record<string, any>;
238
+ // activity options that apply to all activities within the workflow
239
+ options?: DSLActivityOptions;
240
+ // the name of the variable that will hold the workflow result
241
+ // if not specified "result" will be assumed
242
+ result?: string;
243
+ debug_mode?: boolean;
244
+ }
245
+
246
+ export interface DSLWorkflowSpecWithSteps extends DSLWorkflowSpecBase {
247
+ steps: DSLWorkflowStep[];
248
+ /**
249
+ * @deprecated use steps instead
250
+ */
251
+ activities?: never;
252
+ }
253
+
254
+ /**
255
+ * @deprecated use steps instead
256
+ */
257
+ export interface DSLWorkflowSpecWithActivities extends DSLWorkflowSpecBase {
258
+ steps?: never;
259
+ /**
260
+ * @deprecated use steps instead
261
+ */
262
+ activities: DSLActivitySpec[];
263
+ }
264
+
265
+ /**
266
+ * activities and steps fields are mutually exclusive
267
+ * steps was added after activities and may contain a mix of activities and other tasks like exec child workflows.
268
+ * For backward compatibility we keep the activities field as a fallback but one should use one or the other not both.
269
+ */
270
+ export type DSLWorkflowSpec = DSLWorkflowSpecWithSteps | DSLWorkflowSpecWithActivities;
271
+
272
+ export interface DSLWorkflowDefinition extends BaseObject, DSLWorkflowSpecBase {
273
+ // an optional JSON schema to describe the input vars of the workflow.
274
+ input_schema?: Record<string, any>;
275
+ activities?: DSLActivitySpec[];
276
+ steps?: DSLWorkflowStep[];
277
+ }
278
+
279
+ export interface WorkflowDefinitionRef {
280
+ id: string;
281
+ name: string;
282
+ description?: string;
283
+ tags?: string[];
284
+ created_at: Date;
285
+ updated_at: Date;
286
+ }
287
+
288
+ export const WorkflowDefinitionRefPopulate = "id name description tags created_at updated_at"
@@ -0,0 +1,14 @@
1
+ export * from "./activity-catalog.js";
2
+ export * from "./collections.js";
3
+ export * from "./common.js";
4
+ export * from "./conversation-state.js";
5
+ export * from "./doc-analyzer.js";
6
+ export * from "./dsl-workflow.js";
7
+ export * from "./object-types.js";
8
+ export * from "./schedule.js";
9
+ export * from "./signals.js";
10
+ export * from "./store.js";
11
+ export * from "./temporalio.js";
12
+ export * from "./worker.js";
13
+ export * from "./workflow.js";
14
+
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Types for the `ms` package (version 3.0.0-canary.1)
3
+ */
4
+ declare module "ms" {
5
+ declare type Unit = 'Years' | 'Year' | 'Yrs' | 'Yr' | 'Y' | 'Weeks' | 'Week' | 'W' | 'Days' | 'Day' | 'D' | 'Hours' | 'Hour' | 'Hrs' | 'Hr' | 'H' | 'Minutes' | 'Minute' | 'Mins' | 'Min' | 'M' | 'Seconds' | 'Second' | 'Secs' | 'Sec' | 's' | 'Milliseconds' | 'Millisecond' | 'Msecs' | 'Msec' | 'Ms';
6
+ declare type UnitAnyCase = Unit | Uppercase<Unit> | Lowercase<Unit>;
7
+ export declare type StringValue = `${number}` | `${number}${UnitAnyCase}` | `${number} ${UnitAnyCase}`;
8
+ declare function ms(value: StringValue, options?: Options): number;
9
+ declare function ms(value: number, options?: Options): string;
10
+ export default ms;
11
+ }
@@ -0,0 +1,127 @@
1
+ import type { JSONSchemaType } from "ajv"
2
+
3
+ /*Default JSON Schema type for rendition*/
4
+
5
+ export interface RenditionProperties {
6
+ mime_type: string,
7
+ source_etag?: string,
8
+ height?: number,
9
+ width?: number,
10
+ multipart?: boolean,
11
+ total_parts?: number,
12
+ }
13
+
14
+ export const RenditionSchema: JSONSchemaType<RenditionProperties> = {
15
+
16
+ type: "object",
17
+ description: "Represent a rendition of a file stored in an object. It will be stored as a separate object in the database.",
18
+ properties: {
19
+ mime_type: {
20
+ type: "string",
21
+ description: "The format of the rendition. This is a MIME type."
22
+ },
23
+ source_etag: {
24
+ type: "string",
25
+ description: "The ETag of the file used for the rendition.",
26
+ nullable: true
27
+ },
28
+ height: {
29
+ type: "integer",
30
+ description: "The height of the rendition",
31
+ nullable: true
32
+ },
33
+ width: {
34
+ type: "integer",
35
+ description: "The width of the rendition",
36
+ nullable: true
37
+ },
38
+ multipart: {
39
+ type: "boolean",
40
+ description: "If the rendition is a multi-part rendition",
41
+ nullable: true,
42
+ default: false
43
+ },
44
+ total_parts: {
45
+ type: "integer",
46
+ description: "The total number of parts in the rendition",
47
+ nullable: true
48
+ }
49
+ },
50
+ required: ["mime_type"],
51
+ }
52
+
53
+
54
+
55
+ export interface DocumentPartProperties {
56
+
57
+ source_etag?: string,
58
+ part_number: number,
59
+ title?: string,
60
+ source_line_start?: number,
61
+ source_line_end?: number,
62
+ type?: 'text' | 'image' | 'table' | 'chart' | 'diagram' | 'code' | 'other',
63
+ page_number?: number,
64
+ description?: string,
65
+ height?: number,
66
+ width?: number,
67
+
68
+ }
69
+
70
+
71
+ export const DocumentPartSchema: JSONSchemaType<DocumentPartProperties> = {
72
+ type: "object",
73
+ description: "Represent a semantic chunk of a document",
74
+ properties: {
75
+ source_etag: {
76
+ type: "string",
77
+ description: "The ETag of the file used for the rendition.",
78
+ nullable: true
79
+ },
80
+ part_number: {
81
+ type: "integer",
82
+ description: "The part number of the chunk",
83
+ },
84
+ title: {
85
+ type: "string",
86
+ description: "The title of the chunk",
87
+ nullable: true
88
+ },
89
+ source_line_start: {
90
+ type: "integer",
91
+ description: "The line number where the chunk starts",
92
+ nullable: true
93
+ },
94
+ source_line_end: {
95
+ type: "integer",
96
+ description: "The line number where the chunk ends",
97
+ nullable: true
98
+ },
99
+ type: {
100
+ type: "string",
101
+ description: "The type of the chunk",
102
+ enum: ['text', 'image', 'table', 'chart', 'diagram', 'code', 'other'],
103
+ nullable: true
104
+ },
105
+ page_number: {
106
+ type: "integer",
107
+ description: "The page number of the document part",
108
+ nullable: true
109
+ },
110
+ description: {
111
+ type: "string",
112
+ description: "The description of the document part, if it's an image, the exhaustive description of the image",
113
+ nullable: true
114
+ },
115
+ height: {
116
+ type: "integer",
117
+ description: "The height of the rendition",
118
+ nullable: true
119
+ },
120
+ width: {
121
+ type: "integer",
122
+ description: "The width of the rendition",
123
+ nullable: true
124
+ }
125
+ },
126
+ required: ["part_number"],
127
+ }