@vertesia/common 1.0.0-dev.20260203.130115Z → 1.0.0-dev.20260225.024852Z

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 (366) hide show
  1. package/lib/cjs/Progress.js +61 -0
  2. package/lib/cjs/Progress.js.map +1 -0
  3. package/lib/cjs/access-control.js +56 -0
  4. package/lib/cjs/access-control.js.map +1 -0
  5. package/lib/cjs/analytics.js +3 -0
  6. package/lib/cjs/analytics.js.map +1 -0
  7. package/lib/cjs/apikey.js +17 -0
  8. package/lib/cjs/apikey.js.map +1 -0
  9. package/lib/cjs/apps.js +35 -0
  10. package/lib/cjs/apps.js.map +1 -0
  11. package/lib/cjs/ask-user.js +8 -0
  12. package/lib/cjs/ask-user.js.map +1 -0
  13. package/lib/cjs/audit-trail.js +3 -0
  14. package/lib/cjs/audit-trail.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 +56 -0
  30. package/lib/cjs/index.js.map +1 -0
  31. package/lib/cjs/integrations.js +16 -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 +143 -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/hive-memory.js +3 -0
  75. package/lib/cjs/store/hive-memory.js.map +1 -0
  76. package/lib/cjs/store/index.js +32 -0
  77. package/lib/cjs/store/index.js.map +1 -0
  78. package/lib/cjs/store/object-types.js +98 -0
  79. package/lib/cjs/store/object-types.js.map +1 -0
  80. package/lib/cjs/store/rendering.js +22 -0
  81. package/lib/cjs/store/rendering.js.map +1 -0
  82. package/lib/cjs/store/schedule.js +32 -0
  83. package/lib/cjs/store/schedule.js.map +1 -0
  84. package/lib/cjs/store/signals.js +3 -0
  85. package/lib/cjs/store/signals.js.map +1 -0
  86. package/lib/cjs/store/store.js +179 -0
  87. package/lib/cjs/store/store.js.map +1 -0
  88. package/lib/cjs/store/temporalio.js +44 -0
  89. package/lib/cjs/store/temporalio.js.map +1 -0
  90. package/lib/cjs/store/worker.js +3 -0
  91. package/lib/cjs/store/worker.js.map +1 -0
  92. package/lib/cjs/store/workflow.js +305 -0
  93. package/lib/cjs/store/workflow.js.map +1 -0
  94. package/lib/cjs/sts-token-types.js +32 -0
  95. package/lib/cjs/sts-token-types.js.map +1 -0
  96. package/lib/cjs/tenant.js +3 -0
  97. package/lib/cjs/tenant.js.map +1 -0
  98. package/lib/cjs/tool-execution.js +6 -0
  99. package/lib/cjs/tool-execution.js.map +1 -0
  100. package/lib/cjs/training.js +14 -0
  101. package/lib/cjs/training.js.map +1 -0
  102. package/lib/cjs/transient-tokens.js +9 -0
  103. package/lib/cjs/transient-tokens.js.map +1 -0
  104. package/lib/cjs/user.js +25 -0
  105. package/lib/cjs/user.js.map +1 -0
  106. package/lib/cjs/utils/auth.js +15 -0
  107. package/lib/cjs/utils/auth.js.map +1 -0
  108. package/lib/cjs/utils/schemas.js +138 -0
  109. package/lib/cjs/utils/schemas.js.map +1 -0
  110. package/lib/cjs/utils/type-helpers.js +3 -0
  111. package/lib/cjs/utils/type-helpers.js.map +1 -0
  112. package/lib/cjs/versions.js +9 -0
  113. package/lib/cjs/versions.js.map +1 -0
  114. package/lib/cjs/workflow-analytics.js +52 -0
  115. package/lib/cjs/workflow-analytics.js.map +1 -0
  116. package/lib/esm/Progress.js +57 -0
  117. package/lib/esm/Progress.js.map +1 -0
  118. package/lib/esm/access-control.js +53 -0
  119. package/lib/esm/access-control.js.map +1 -0
  120. package/lib/esm/analytics.js +2 -0
  121. package/lib/esm/analytics.js.map +1 -0
  122. package/lib/esm/apikey.js +14 -0
  123. package/lib/esm/apikey.js.map +1 -0
  124. package/lib/esm/apps.js +32 -0
  125. package/lib/esm/apps.js.map +1 -0
  126. package/lib/esm/ask-user.js +7 -0
  127. package/lib/esm/ask-user.js.map +1 -0
  128. package/lib/esm/audit-trail.js +2 -0
  129. package/lib/esm/audit-trail.js.map +1 -0
  130. package/lib/esm/channels.js +57 -0
  131. package/lib/esm/channels.js.map +1 -0
  132. package/lib/esm/common.js +2 -0
  133. package/lib/esm/common.js.map +1 -0
  134. package/lib/esm/data-platform.js +124 -0
  135. package/lib/esm/data-platform.js.map +1 -0
  136. package/lib/esm/email.js +16 -0
  137. package/lib/esm/email.js.map +1 -0
  138. package/lib/esm/environment.js +41 -0
  139. package/lib/esm/environment.js.map +1 -0
  140. package/lib/esm/facets.js +2 -0
  141. package/lib/esm/facets.js.map +1 -0
  142. package/lib/esm/group.js +2 -0
  143. package/lib/esm/group.js.map +1 -0
  144. package/lib/esm/index.js +40 -0
  145. package/lib/esm/index.js.map +1 -0
  146. package/lib/esm/integrations.js +13 -0
  147. package/lib/esm/integrations.js.map +1 -0
  148. package/lib/esm/interaction.js +92 -0
  149. package/lib/esm/interaction.js.map +1 -0
  150. package/lib/esm/json-schema.js +2 -0
  151. package/lib/esm/json-schema.js.map +1 -0
  152. package/lib/esm/json.js +2 -0
  153. package/lib/esm/json.js.map +1 -0
  154. package/lib/esm/meters.js +10 -0
  155. package/lib/esm/meters.js.map +1 -0
  156. package/lib/esm/model_utility.js +2 -0
  157. package/lib/esm/model_utility.js.map +1 -0
  158. package/lib/esm/payload.js +2 -0
  159. package/lib/esm/payload.js.map +1 -0
  160. package/lib/esm/pending-asks.js +6 -0
  161. package/lib/esm/pending-asks.js.map +1 -0
  162. package/lib/esm/project.js +138 -0
  163. package/lib/esm/project.js.map +1 -0
  164. package/lib/esm/prompt.js +18 -0
  165. package/lib/esm/prompt.js.map +1 -0
  166. package/lib/esm/query.js +2 -0
  167. package/lib/esm/query.js.map +1 -0
  168. package/lib/esm/rate-limiter.js +5 -0
  169. package/lib/esm/rate-limiter.js.map +1 -0
  170. package/lib/esm/refs.js +11 -0
  171. package/lib/esm/refs.js.map +1 -0
  172. package/lib/esm/runs.js +2 -0
  173. package/lib/esm/runs.js.map +1 -0
  174. package/lib/esm/skill.js +13 -0
  175. package/lib/esm/skill.js.map +1 -0
  176. package/lib/esm/store/activity-catalog.js +2 -0
  177. package/lib/esm/store/activity-catalog.js.map +1 -0
  178. package/lib/esm/store/collections.js +6 -0
  179. package/lib/esm/store/collections.js.map +1 -0
  180. package/lib/esm/store/common.js +2 -0
  181. package/lib/esm/store/common.js.map +1 -0
  182. package/lib/esm/store/conversation-state.js +2 -0
  183. package/lib/esm/store/conversation-state.js.map +1 -0
  184. package/lib/esm/store/doc-analyzer.js +2 -0
  185. package/lib/esm/store/doc-analyzer.js.map +1 -0
  186. package/lib/esm/store/dsl-workflow.js +2 -0
  187. package/lib/esm/store/dsl-workflow.js.map +1 -0
  188. package/lib/esm/store/hive-memory.js +2 -0
  189. package/lib/esm/store/hive-memory.js.map +1 -0
  190. package/lib/esm/store/index.js +16 -0
  191. package/lib/esm/store/index.js.map +1 -0
  192. package/lib/esm/store/object-types.js +95 -0
  193. package/lib/esm/store/object-types.js.map +1 -0
  194. package/lib/esm/store/rendering.js +18 -0
  195. package/lib/esm/store/rendering.js.map +1 -0
  196. package/lib/esm/store/schedule.js +29 -0
  197. package/lib/esm/store/schedule.js.map +1 -0
  198. package/lib/esm/store/signals.js +2 -0
  199. package/lib/esm/store/signals.js.map +1 -0
  200. package/lib/esm/store/store.js +171 -0
  201. package/lib/esm/store/store.js.map +1 -0
  202. package/lib/esm/store/temporalio.js +41 -0
  203. package/lib/esm/store/temporalio.js.map +1 -0
  204. package/lib/esm/store/worker.js +2 -0
  205. package/lib/esm/store/worker.js.map +1 -0
  206. package/lib/esm/store/workflow.js +287 -0
  207. package/lib/esm/store/workflow.js.map +1 -0
  208. package/lib/esm/sts-token-types.js +24 -0
  209. package/lib/esm/sts-token-types.js.map +1 -0
  210. package/lib/esm/tenant.js +2 -0
  211. package/lib/esm/tenant.js.map +1 -0
  212. package/lib/esm/tool-execution.js +5 -0
  213. package/lib/esm/tool-execution.js.map +1 -0
  214. package/lib/esm/training.js +11 -0
  215. package/lib/esm/training.js.map +1 -0
  216. package/lib/esm/transient-tokens.js +6 -0
  217. package/lib/esm/transient-tokens.js.map +1 -0
  218. package/lib/esm/user.js +22 -0
  219. package/lib/esm/user.js.map +1 -0
  220. package/lib/esm/utils/auth.js +11 -0
  221. package/lib/esm/utils/auth.js.map +1 -0
  222. package/lib/esm/utils/schemas.js +129 -0
  223. package/lib/esm/utils/schemas.js.map +1 -0
  224. package/lib/esm/utils/type-helpers.js +2 -0
  225. package/lib/esm/utils/type-helpers.js.map +1 -0
  226. package/lib/esm/versions.js +6 -0
  227. package/lib/esm/versions.js.map +1 -0
  228. package/lib/esm/workflow-analytics.js +49 -0
  229. package/lib/esm/workflow-analytics.js.map +1 -0
  230. package/lib/tsconfig.tsbuildinfo +1 -0
  231. package/lib/types/Progress.d.ts +21 -0
  232. package/lib/types/Progress.d.ts.map +1 -0
  233. package/lib/types/access-control.d.ts +73 -0
  234. package/lib/types/access-control.d.ts.map +1 -0
  235. package/lib/types/analytics.d.ts +87 -0
  236. package/lib/types/analytics.d.ts.map +1 -0
  237. package/lib/types/apikey.d.ts +99 -0
  238. package/lib/types/apikey.d.ts.map +1 -0
  239. package/lib/types/apps.d.ts +455 -0
  240. package/lib/types/apps.d.ts.map +1 -0
  241. package/lib/types/ask-user.d.ts +32 -0
  242. package/lib/types/ask-user.d.ts.map +1 -0
  243. package/lib/types/audit-trail.d.ts +49 -0
  244. package/lib/types/audit-trail.d.ts.map +1 -0
  245. package/lib/types/channels.d.ts +21 -0
  246. package/lib/types/channels.d.ts.map +1 -0
  247. package/lib/types/common.d.ts +31 -0
  248. package/lib/types/common.d.ts.map +1 -0
  249. package/lib/types/data-platform.d.ts +860 -0
  250. package/lib/types/data-platform.d.ts.map +1 -0
  251. package/lib/types/email.d.ts +66 -0
  252. package/lib/types/email.d.ts.map +1 -0
  253. package/lib/types/environment.d.ts +106 -0
  254. package/lib/types/environment.d.ts.map +1 -0
  255. package/lib/types/facets.d.ts +34 -0
  256. package/lib/types/facets.d.ts.map +1 -0
  257. package/lib/types/group.d.ts +21 -0
  258. package/lib/types/group.d.ts.map +1 -0
  259. package/lib/types/index.d.ts +40 -0
  260. package/lib/types/index.d.ts.map +1 -0
  261. package/lib/types/integrations.d.ts +68 -0
  262. package/lib/types/integrations.d.ts.map +1 -0
  263. package/lib/types/interaction.d.ts +964 -0
  264. package/lib/types/interaction.d.ts.map +1 -0
  265. package/lib/types/json-schema.d.ts +1 -0
  266. package/lib/types/json-schema.d.ts.map +1 -0
  267. package/lib/types/json.d.ts +1 -0
  268. package/lib/types/json.d.ts.map +1 -0
  269. package/lib/types/meters.d.ts +23 -0
  270. package/lib/types/meters.d.ts.map +1 -0
  271. package/lib/types/model_utility.d.ts +1 -0
  272. package/lib/types/model_utility.d.ts.map +1 -0
  273. package/lib/types/payload.d.ts +60 -0
  274. package/lib/types/payload.d.ts.map +1 -0
  275. package/lib/types/pending-asks.d.ts +93 -0
  276. package/lib/types/pending-asks.d.ts.map +1 -0
  277. package/lib/types/project.d.ts +434 -0
  278. package/lib/types/project.d.ts.map +1 -0
  279. package/lib/types/prompt.d.ts +77 -0
  280. package/lib/types/prompt.d.ts.map +1 -0
  281. package/lib/types/query.d.ts +118 -0
  282. package/lib/types/query.d.ts.map +1 -0
  283. package/lib/types/rate-limiter.d.ts +28 -0
  284. package/lib/types/rate-limiter.d.ts.map +1 -0
  285. package/lib/types/refs.d.ts +22 -0
  286. package/lib/types/refs.d.ts.map +1 -0
  287. package/lib/types/runs.d.ts +32 -0
  288. package/lib/types/runs.d.ts.map +1 -0
  289. package/lib/types/skill.d.ts +78 -0
  290. package/lib/types/skill.d.ts.map +1 -0
  291. package/lib/types/store/activity-catalog.d.ts +26 -0
  292. package/lib/types/store/activity-catalog.d.ts.map +1 -0
  293. package/lib/types/store/collections.d.ts +78 -0
  294. package/lib/types/store/collections.d.ts.map +1 -0
  295. package/lib/types/store/common.d.ts +22 -0
  296. package/lib/types/store/common.d.ts.map +1 -0
  297. package/lib/types/store/conversation-state.d.ts +132 -0
  298. package/lib/types/store/conversation-state.d.ts.map +1 -0
  299. package/lib/types/store/doc-analyzer.d.ts +140 -0
  300. package/lib/types/store/doc-analyzer.d.ts.map +1 -0
  301. package/lib/types/store/dsl-workflow.d.ts +272 -0
  302. package/lib/types/store/dsl-workflow.d.ts.map +1 -0
  303. package/lib/types/store/hive-memory.d.ts +116 -0
  304. package/lib/types/store/hive-memory.d.ts.map +1 -0
  305. package/lib/types/store/index.d.ts +15 -0
  306. package/lib/types/store/index.d.ts.map +1 -0
  307. package/lib/types/store/object-types.d.ts +23 -0
  308. package/lib/types/store/object-types.d.ts.map +1 -0
  309. package/lib/types/store/rendering.d.ts +193 -0
  310. package/lib/types/store/rendering.d.ts.map +1 -0
  311. package/lib/types/store/schedule.d.ts +184 -0
  312. package/lib/types/store/schedule.d.ts.map +1 -0
  313. package/lib/types/store/signals.d.ts +24 -0
  314. package/lib/types/store/signals.d.ts.map +1 -0
  315. package/lib/types/store/store.d.ts +436 -0
  316. package/lib/types/store/store.d.ts.map +1 -0
  317. package/lib/types/store/temporalio.d.ts +16 -0
  318. package/lib/types/store/temporalio.d.ts.map +1 -0
  319. package/lib/types/store/worker.d.ts +18 -0
  320. package/lib/types/store/worker.d.ts.map +1 -0
  321. package/lib/types/store/workflow.d.ts +948 -0
  322. package/lib/types/store/workflow.d.ts.map +1 -0
  323. package/lib/types/sts-token-types.d.ts +72 -0
  324. package/lib/types/sts-token-types.d.ts.map +1 -0
  325. package/lib/types/tenant.d.ts +10 -0
  326. package/lib/types/tenant.d.ts.map +1 -0
  327. package/lib/types/tool-execution.d.ts +45 -0
  328. package/lib/types/tool-execution.d.ts.map +1 -0
  329. package/lib/types/training.d.ts +38 -0
  330. package/lib/types/training.d.ts.map +1 -0
  331. package/lib/types/transient-tokens.d.ts +24 -0
  332. package/lib/types/transient-tokens.d.ts.map +1 -0
  333. package/lib/types/user.d.ts +125 -0
  334. package/lib/types/user.d.ts.map +1 -0
  335. package/lib/types/utils/auth.d.ts +3 -0
  336. package/lib/types/utils/auth.d.ts.map +1 -0
  337. package/lib/types/utils/schemas.d.ts +18 -0
  338. package/lib/types/utils/schemas.d.ts.map +1 -0
  339. package/lib/types/utils/type-helpers.d.ts +3 -0
  340. package/lib/types/utils/type-helpers.d.ts.map +1 -0
  341. package/lib/types/versions.d.ts +4 -0
  342. package/lib/types/versions.d.ts.map +1 -0
  343. package/lib/types/workflow-analytics.d.ts +777 -0
  344. package/lib/types/workflow-analytics.d.ts.map +1 -0
  345. package/lib/vertesia-common.js +2 -0
  346. package/lib/vertesia-common.js.map +1 -0
  347. package/package.json +2 -4
  348. package/src/apikey.ts +1 -0
  349. package/src/apps.ts +163 -1
  350. package/src/audit-trail.ts +61 -0
  351. package/src/index.ts +1 -0
  352. package/src/integrations.ts +10 -0
  353. package/src/interaction.ts +11 -12
  354. package/src/project.ts +226 -0
  355. package/src/prompt.ts +3 -4
  356. package/src/store/conversation-state.ts +9 -0
  357. package/src/store/doc-analyzer.ts +1 -1
  358. package/src/store/dsl-workflow.ts +20 -0
  359. package/src/store/index.ts +1 -0
  360. package/src/store/rendering.ts +233 -0
  361. package/src/store/schedule.ts +3 -0
  362. package/src/store/store.ts +40 -5
  363. package/src/store/workflow.ts +184 -7
  364. package/src/user.ts +11 -0
  365. package/src/utils/schemas.ts +33 -11
  366. package/src/versions.ts +1 -0
@@ -3,6 +3,26 @@ import { BaseObject } from "./common.js";
3
3
  import { WorkflowExecutionPayload } from "./index.js";
4
4
  import { ParentClosePolicyType } from "./temporalio.js";
5
5
 
6
+ /**
7
+ * Discriminator for workflow input type - either object IDs or GCS file URIs
8
+ */
9
+ export type WorkflowInputType = 'objectIds' | 'files';
10
+
11
+ /**
12
+ * File reference with URL and mimetype
13
+ */
14
+ export interface WorkflowInputFile {
15
+ url: string;
16
+ mimetype: string;
17
+ }
18
+
19
+ /**
20
+ * Discriminated union for workflow inputs.
21
+ * Workflows can accept either a list of object IDs (existing behavior) OR a list of file references (new).
22
+ */
23
+ export type WorkflowInput =
24
+ | { inputType: 'objectIds', objectIds: string[] }
25
+ | { inputType: 'files', files: WorkflowInputFile[] };
6
26
 
7
27
  /**
8
28
  * The payload sent when starting a workflow from the temporal client to the workflow instance.
@@ -9,6 +9,7 @@ export * from "./object-types.js";
9
9
  export * from "./schedule.js";
10
10
  export * from "./signals.js";
11
11
  export * from "./store.js";
12
+ export * from "./rendering.js";
12
13
  export * from "./temporalio.js";
13
14
  export * from "./worker.js";
14
15
  export * from "./workflow.js";
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Rendering API types
3
+ *
4
+ * Types for rendering content to various formats (PDF, DOCX, images)
5
+ */
6
+
7
+ import { ImageRenditionFormat, MarkdownRenditionFormat } from "./store.js";
8
+ import { WorkflowExecutionStatus, WorkflowRunStatus } from "./workflow.js";
9
+
10
+ // ============================================================================
11
+ // Workflow Vars Types (Discriminated Union)
12
+ // ============================================================================
13
+
14
+ /** Base vars shared by all rendition types */
15
+ interface BaseRenditionVars {
16
+ mime_type?: string;
17
+ /** Custom upload path — overrides the default renditions/{etag}/{name} path */
18
+ outputPath?: string;
19
+ }
20
+
21
+ /** Workflow vars for image renditions (jpeg, png, webp) */
22
+ export interface ImageRenditionVars extends BaseRenditionVars {
23
+ format?: ImageRenditionFormat;
24
+ max_hw?: number;
25
+ max_pages?: number;
26
+ }
27
+
28
+ /** Metadata for PDF rendering (displayed in header/footer) */
29
+ export interface PdfRenderingMetadata {
30
+ /** Document ID to display in footer */
31
+ document_id?: string;
32
+ /** Agent name that generated the document */
33
+ agent_name?: string;
34
+ /** Agent run ID to display in footer */
35
+ agent_run_id?: string;
36
+ /** Document subtitle */
37
+ subtitle?: string;
38
+ /** Document author(s) */
39
+ author?: string | string[];
40
+ /** Document date (displayed in header and title page; defaults to today if omitted) */
41
+ date?: string;
42
+ }
43
+
44
+ /** Workflow vars for markdown renditions (pdf, docx) */
45
+ export interface MarkdownRenditionVars extends BaseRenditionVars {
46
+ format: MarkdownRenditionFormat;
47
+ /** Inline markdown content (mutually exclusive with objectId) */
48
+ content?: string;
49
+ /** Blob store path to fetch markdown from (mutually exclusive with content/objectId) */
50
+ artifactPath?: string;
51
+ /** Document title for inline content */
52
+ title?: string;
53
+ /** URL to template file (LaTeX for PDF, reference doc for DOCX) */
54
+ templateUrl?: string;
55
+ /** Optional logo URL for template variable `logo-path` (studio-hosted URL) */
56
+ templateLogoUrl?: string;
57
+ /** Template file via artifact:/store: protocol (takes precedence over templateUrl) */
58
+ templatePath?: string;
59
+ /** Logo file via artifact:/store: protocol (takes precedence over templateLogoUrl) */
60
+ logoPath?: string;
61
+ /** Use Vertesia default template if no templateUrl provided (default: true for pdf) */
62
+ useDefaultTemplate?: boolean;
63
+ /** Additional pandoc command-line options */
64
+ pandocOptions?: string[];
65
+ /** Run ID for resolving artifact: URLs in markdown */
66
+ artifactRunId?: string;
67
+ /** Document metadata for PDF footer/header */
68
+ metadata?: PdfRenderingMetadata;
69
+ /** Source reference for auto-wired template data: `store:<objectId>` or `artifact:<path-to-json>` */
70
+ templateDataSource?: string;
71
+ }
72
+
73
+ /** Discriminated union of all rendition workflow vars */
74
+ export type GenerateRenditionVars = ImageRenditionVars | MarkdownRenditionVars;
75
+
76
+ /** Type guard for markdown rendition vars */
77
+ export function isMarkdownRenditionVars(
78
+ vars: GenerateRenditionVars
79
+ ): vars is MarkdownRenditionVars {
80
+ return vars.format === 'pdf' || vars.format === 'docx';
81
+ }
82
+
83
+ // ============================================================================
84
+ // API Payload Types
85
+ // ============================================================================
86
+
87
+ /**
88
+ * Payload for rendering markdown to PDF or DOCX.
89
+ * Either object_id OR content must be provided.
90
+ */
91
+ export interface RenderMarkdownPayload {
92
+ /** Output format */
93
+ format: MarkdownRenditionFormat;
94
+ /** Object ID to render (mutually exclusive with content) */
95
+ object_id?: string;
96
+ /** Inline markdown content to render (mutually exclusive with object_id) */
97
+ content?: string;
98
+ /** Document title (used for filename when using inline content) */
99
+ title?: string;
100
+ /** URL to a template file for pandoc (DOCX reference doc or LaTeX template) */
101
+ template_url?: string;
102
+ /** Optional logo URL for template variable `logo-path` (studio-hosted URL) */
103
+ template_logo_url?: string;
104
+ /** Template file via artifact:/store: protocol (takes precedence over template_url) */
105
+ template_path?: string;
106
+ /** Logo file via artifact:/store: protocol (takes precedence over template_logo_url) */
107
+ logo_path?: string;
108
+ /** Use Vertesia default template if no template_url provided (default: true for pdf) */
109
+ use_default_template?: boolean;
110
+ /** Additional pandoc command-line options */
111
+ pandoc_options?: string[];
112
+ /** Run ID for resolving artifact: and image: URLs */
113
+ artifact_run_id?: string;
114
+ /** Document metadata for PDF footer/header */
115
+ metadata?: PdfRenderingMetadata;
116
+ /** Source reference for auto-wired template data: `store:<objectId>` or `artifact:<path-to-json>` */
117
+ template_data_source?: string;
118
+ /** Custom upload path for the rendered output */
119
+ output_path?: string;
120
+ }
121
+
122
+ /**
123
+ * Initial response when starting a markdown rendering workflow.
124
+ * Clients should poll status using workflow_id/workflow_run_id.
125
+ */
126
+ export interface RenderMarkdownStartResponse extends WorkflowRunStatus {
127
+ /** Requested output format */
128
+ format: MarkdownRenditionFormat;
129
+ }
130
+
131
+ /**
132
+ * Polled status response for markdown rendering workflow.
133
+ */
134
+ export interface RenderMarkdownStatusResponse extends WorkflowRunStatus {
135
+ /** Requested output format (if known) */
136
+ format?: MarkdownRenditionFormat;
137
+ /** Download URL for completed output */
138
+ download_url?: string;
139
+ /** File URI in storage for completed output */
140
+ file_uri?: string;
141
+ /** Error details for failed/terminated runs */
142
+ error?: string;
143
+ }
144
+
145
+ /**
146
+ * Client-side polling options for markdown rendering.
147
+ */
148
+ export interface RenderMarkdownPollOptions {
149
+ /** Maximum time to wait in milliseconds (default: 10 minutes) */
150
+ timeoutMs?: number;
151
+ /** Polling interval in milliseconds (default: 1500ms) */
152
+ pollIntervalMs?: number;
153
+ }
154
+
155
+ /**
156
+ * Result from the GenerateRenditions workflow.
157
+ * Shared between zeno-server (consumer) and workflows (producer).
158
+ */
159
+ export interface GenerateRenditionsResult {
160
+ uploads: string[];
161
+ format: string;
162
+ status: string;
163
+ fileUri?: string;
164
+ /** Warnings about rich content blocks that failed to render (document was still produced) */
165
+ warnings?: string[];
166
+ }
167
+
168
+ /**
169
+ * Response from the rendering API.
170
+ */
171
+ export interface RenderMarkdownResponse {
172
+ /** Rendering status */
173
+ status: "success";
174
+ /** Output format */
175
+ format: MarkdownRenditionFormat;
176
+ /** Download URL for the rendered document */
177
+ download_url?: string;
178
+ /** File URI in storage */
179
+ file_uri?: string;
180
+ }
181
+
182
+ // ============================================================================
183
+ // Slide Deck Types
184
+ // ============================================================================
185
+
186
+ /** A slide rendered from a named SVG template with structured content */
187
+ export interface TemplateSlide {
188
+ type: 'template';
189
+ /** Template name: 'title' | 'section' | 'bullets' | 'two-column' | 'image-text' */
190
+ template: string;
191
+ /** Key-value content for the template (values can be strings or string arrays) */
192
+ content: Record<string, string | string[]>;
193
+ }
194
+
195
+ /** A slide with raw SVG markup */
196
+ export interface RawSvgSlide {
197
+ type: 'svg';
198
+ /** Complete SVG markup (should use 1920x1080 viewBox) */
199
+ svg: string;
200
+ }
201
+
202
+ /** A single slide specification — either template-based or raw SVG */
203
+ export type SlideSpec = TemplateSlide | RawSvgSlide;
204
+
205
+ /** Options for rendering a slide deck to PDF */
206
+ export interface RenderSlidesDeckOptions {
207
+ /** Canvas scale factor for higher resolution (default: 2) */
208
+ scale?: number;
209
+ /** Background color for each slide (default: '#ffffff') */
210
+ backgroundColor?: string;
211
+ /** Slide theme — replaces default colors in SVG templates */
212
+ theme?: Record<string, string>;
213
+ }
214
+
215
+ /** Result of rendering a slide deck to PDF */
216
+ export interface RenderSlidesDeckResult {
217
+ /** PDF file as a Uint8Array (use Buffer.from() in Node.js) */
218
+ buffer: Uint8Array;
219
+ /** Number of slides rendered */
220
+ slideCount: number;
221
+ /** PDF page width in points (720 = 10") */
222
+ pageWidth: number;
223
+ /** PDF page height in points (540 = 7.5") */
224
+ pageHeight: number;
225
+ }
226
+
227
+ export function isWorkflowTerminalStatus(status: WorkflowExecutionStatus): boolean {
228
+ return status === WorkflowExecutionStatus.COMPLETED
229
+ || status === WorkflowExecutionStatus.FAILED
230
+ || status === WorkflowExecutionStatus.CANCELED
231
+ || status === WorkflowExecutionStatus.TERMINATED
232
+ || status === WorkflowExecutionStatus.TIMED_OUT;
233
+ }
@@ -107,6 +107,9 @@ export interface CreateSchedulePayload {
107
107
 
108
108
  /** Whether the schedule should be enabled immediately (defaults to true) */
109
109
  enabled?: boolean;
110
+
111
+ /** Visibility of the conversation (defaults to "project") */
112
+ visibility?: 'project' | 'private';
110
113
  }
111
114
 
112
115
  /**
@@ -302,8 +302,30 @@ export interface CreateContentObjectPayload<T = any>
302
302
  generation_run_info?: GenerationRunMetadata;
303
303
  }
304
304
 
305
- export interface ContentObjectTypeRef {
305
+ export function getContentTypeRefId(type: ContentObjectTypeRef) {
306
+ return (type as StoredTypeRef).id || (type as InCodeTypeRef).code;
307
+ }
308
+
309
+ /**
310
+ * Reference to a content object type. Either `id` (stored type) or `code` (in-code type) must be set.
311
+ */
312
+ export type ContentObjectTypeRef = StoredTypeRef | InCodeTypeRef;
313
+
314
+ interface StoredTypeRef {
315
+ /**
316
+ * MongoDB ObjectId string for stored types
317
+ */
306
318
  id: string;
319
+ code?: never;
320
+ name: string;
321
+ }
322
+
323
+ interface InCodeTypeRef {
324
+ id?: never;
325
+ /**
326
+ * Namespaced identifier for in-code types (e.g. "sys:Invoice", "app:myapp:Contract")
327
+ */
328
+ code: string;
307
329
  name: string;
308
330
  }
309
331
 
@@ -353,7 +375,20 @@ export interface ContentObjectTypeItem extends BaseObject {
353
375
  */
354
376
  strict_mode?: boolean;
355
377
  }
356
- export type InCodeTypeDefinition = Pick<ContentObjectTypeItem, 'name' | 'description' | 'tags' | 'object_schema' | 'table_layout' | 'is_chunkable' | 'strict_mode'>;
378
+ export type InCodeTypeDefinition = Pick<ContentObjectTypeItem, 'id' | 'name' | 'description' | 'tags' | 'object_schema' | 'table_layout' | 'is_chunkable' | 'strict_mode'>;
379
+ /**
380
+ * The itnerface to be used whend efining types in a plugin app.
381
+ */
382
+ export type InCodeTypeSpec = Omit<InCodeTypeDefinition, 'id'>;
383
+
384
+ /**
385
+ * Returns true if the type id represents an in-code type (system or app-contributed).
386
+ * In-code types use colon-separated ids like "sys:Invoice" or "app:myapp:Article".
387
+ * These types are read-only and cannot be edited through the UI.
388
+ */
389
+ export function isInCodeType(typeId: string): boolean {
390
+ return typeId.includes(':');
391
+ }
357
392
 
358
393
  export interface CreateContentObjectTypePayload
359
394
  extends Omit<
@@ -456,8 +491,8 @@ const RENDITION_COMPATIBILITY: Record<string, RenditionFormat[]> = {
456
491
  'application/pdf': [ImageRenditionFormat.jpeg, ImageRenditionFormat.png, ImageRenditionFormat.webp],
457
492
  // Markdown can generate: pdf, docx (NOT jpeg/png)
458
493
  'text/markdown': [MarkdownRenditionFormat.pdf, MarkdownRenditionFormat.docx],
459
- // Plain text can generate: docx
460
- 'text/plain': [MarkdownRenditionFormat.docx],
494
+ // Any text/* can generate: docx (editable export)
495
+ 'text/*': [MarkdownRenditionFormat.docx],
461
496
  // Office documents can generate: pdf
462
497
  'application/vnd.openxmlformats-officedocument.wordprocessingml.document': [MarkdownRenditionFormat.pdf],
463
498
  'application/msword': [MarkdownRenditionFormat.pdf],
@@ -563,7 +598,7 @@ export interface GetFileUrlPayload {
563
598
  export interface GetFileUrlResponse {
564
599
  url: string;
565
600
  id: string;
566
- mime_type: string;
601
+ mime_type?: string;
567
602
  path: string;
568
603
  }
569
604
 
@@ -1,5 +1,6 @@
1
- import { JSONSchema4 } from "json-schema";
2
1
  import { ConversationVisibility, InteractionRef, UserChannel } from "../interaction.js";
2
+ import { JSONSchema } from "../json-schema.js";
3
+ import type { WorkflowInput } from "./dsl-workflow.js";
3
4
 
4
5
  export enum ContentEventName {
5
6
  create = "create",
@@ -151,9 +152,16 @@ export interface WorkflowExecutionPayload<T = Record<string, any>> extends Workf
151
152
  wf_rule_name?: string;
152
153
 
153
154
  /**
154
- * The ID of the target objects processed by the workflow.
155
+ * The ID of the target objects processed by the workflow (legacy format).
156
+ * For backward compatibility. New workflows should use the `input` field.
155
157
  */
156
- objectIds: string[];
158
+ objectIds?: string[];
159
+
160
+ /**
161
+ * New format: Workflow input (either objectIds or files).
162
+ * Takes precedence over the legacy `objectIds` field.
163
+ */
164
+ input?: WorkflowInput;
157
165
 
158
166
  /**
159
167
  * Auth Token to access Zeno and Composable from the workers
@@ -162,7 +170,12 @@ export interface WorkflowExecutionPayload<T = Record<string, any>> extends Workf
162
170
  }
163
171
 
164
172
  export function getDocumentIds(payload: WorkflowExecutionPayload): string[] {
165
- if ("objectIds" in payload) {
173
+ // Check new input format first
174
+ if (payload.input?.inputType === 'objectIds') {
175
+ return payload.input.objectIds;
176
+ }
177
+ // Fall back to legacy objectIds field
178
+ if (payload.objectIds) {
166
179
  return payload.objectIds;
167
180
  }
168
181
  return [];
@@ -181,6 +194,12 @@ export interface ExecuteWorkflowPayload {
181
194
  //@deprecated
182
195
  objectIds?: string[];
183
196
 
197
+ /**
198
+ * New format: Workflow input (either objectIds or files).
199
+ * Takes precedence over the deprecated `objectIds` field.
200
+ */
201
+ input?: WorkflowInput;
202
+
184
203
  /**
185
204
  * Parameters to pass to the workflow
186
205
  */
@@ -335,6 +354,12 @@ export interface WorkflowRunEvent {
335
354
 
336
355
  signal?: SignalEventProperties;
337
356
 
357
+ timer?: {
358
+ timerId?: string;
359
+ duration?: string;
360
+ summary?: string;
361
+ };
362
+
338
363
  error?: EventError;
339
364
 
340
365
  result?: any;
@@ -358,6 +383,7 @@ export enum TaskType {
358
383
  ACTIVITY = 'activity',
359
384
  CHILD_WORKFLOW = 'childWorkflow',
360
385
  SIGNAL = 'signal',
386
+ TIMER = 'timer',
361
387
  }
362
388
 
363
389
  // Base task interface
@@ -402,21 +428,75 @@ export interface SignalTask extends TaskBase {
402
428
  };
403
429
  }
404
430
 
431
+ // Timer-specific task
432
+ export interface TimerTask extends TaskBase {
433
+ type: TaskType.TIMER;
434
+ timerId?: string;
435
+ duration?: string;
436
+ }
437
+
405
438
  // Union type for all processed tasks
406
439
  export type WorkflowTask =
407
440
  | ActivityTask
408
441
  | ChildWorkflowTask
409
- | SignalTask;
442
+ | SignalTask
443
+ | TimerTask;
410
444
 
411
445
  // History format discriminated union
412
446
  export type WorkflowHistory =
413
447
  | { type: 'events'; events: WorkflowRunEvent[] }
414
448
  | { type: 'tasks'; tasks: WorkflowTask[] }
415
- | { type: 'agent'; data: any }; // Placeholder for future agent format
449
+ | { type: 'agent'; agentTasks: AgentTask[] };
416
450
 
417
451
  // History format query parameter type
418
452
  export type HistoryFormat = 'events' | 'tasks' | 'agent';
419
453
 
454
+ /**
455
+ * Agent task information for workflow history UI representation.
456
+ * This is separate from the analytics AgentEvent types.
457
+ * Consistent with WorkflowTask naming convention.
458
+ *
459
+ * Currently represents tool calls, but designed to be extensible
460
+ * for other task types (LLM calls, checkpoints, etc.)
461
+ */
462
+ export interface AgentTask {
463
+ /** Type discriminator for future task types */
464
+ taskType: 'tool_call' | 'llm_call' | 'input' | 'timer' | 'subagent' | 'processing';
465
+
466
+ /** Tool-specific fields */
467
+ toolName: string;
468
+ toolUseId?: string;
469
+ toolRunId?: string;
470
+ toolType?: 'builtin' | 'interaction' | 'remote' | 'skill';
471
+ iteration?: number;
472
+
473
+ /** Execution details */
474
+ scheduled_at: string | null;
475
+ started_at: string | null;
476
+ completed_at: string | null;
477
+ status: 'running' | 'completed' | 'error' | 'warning';
478
+
479
+ /** Tool data */
480
+ parameters?: Record<string, unknown>;
481
+ result?: string;
482
+ error?: { type: string; message: string };
483
+
484
+ /** Number of activity retries */
485
+ retries?: number;
486
+
487
+ /** Active tools for this LLM call */
488
+ activeTools?: string[];
489
+
490
+ /** Available skills for this LLM call */
491
+ availableSkills?: string[];
492
+
493
+ /** Workstream tracking */
494
+ workstreamId?: string;
495
+
496
+ /** LLM stop reason for llm_call tasks (e.g., "stop", "length", "tool_use") */
497
+ finish_reason?: string;
498
+ }
499
+
420
500
  export interface WorkflowRun {
421
501
  status?: WorkflowExecutionStatus | string;
422
502
  /**
@@ -504,8 +584,14 @@ export interface WorkflowInteractionVars {
504
584
  environment: string,
505
585
  model: string
506
586
  },
507
- interactionParamsSchema?: JSONSchema4
587
+ interactionParamsSchema?: JSONSchema,
508
588
  collection_id?: string;
589
+ /**
590
+ * The token threshold in thousands (K) for creating checkpoints.
591
+ * If total tokens exceed this value, a checkpoint will be created.
592
+ * If not specified, default value of 150K tokens will be used.
593
+ */
594
+ checkpoint_tokens?: number;
509
595
  /**
510
596
  * Optional version of the interaction to use when restoring conversations.
511
597
  * If not specified, the latest version will be used.
@@ -580,6 +666,97 @@ export enum AgentMessageType {
580
666
  BATCH_PROGRESS = 13,
581
667
  }
582
668
 
669
+ // ============================================
670
+ // AGENT MESSAGE DETAIL TYPES & TYPE GUARDS
671
+ // ============================================
672
+
673
+ /**
674
+ * Details for THOUGHT messages representing tool calls (event_class: 'activity').
675
+ */
676
+ export interface ToolCallDetails {
677
+ event_class: 'activity';
678
+ tool: string;
679
+ tool_run_id?: string;
680
+ tool_status?: 'running' | 'completed' | 'error' | 'warning';
681
+ tool_iteration?: number;
682
+ activity_group_id?: string;
683
+ activity_id?: string;
684
+ files?: string[];
685
+ outputFiles?: string[];
686
+ [key: string]: unknown;
687
+ }
688
+
689
+ /**
690
+ * Details for UPDATE messages signaling document creation or update.
691
+ */
692
+ export interface DocumentEventDetails {
693
+ event_class: 'document_created' | 'document_updated';
694
+ document_id: string;
695
+ title?: string;
696
+ [key: string]: unknown;
697
+ }
698
+
699
+ /**
700
+ * Details for REQUEST_INPUT messages with UX configuration.
701
+ */
702
+ export interface RequestInputDetails {
703
+ ux?: {
704
+ options?: Array<{ id: string; label: string }>;
705
+ variant?: string;
706
+ multiSelect?: boolean;
707
+ allowFreeResponse?: boolean;
708
+ placeholder?: string;
709
+ };
710
+ [key: string]: unknown;
711
+ }
712
+
713
+ /**
714
+ * Details for PLAN messages containing the plan structure.
715
+ */
716
+ export interface PlanMessageDetails {
717
+ plan: PlanTask[];
718
+ comment?: string;
719
+ [key: string]: unknown;
720
+ }
721
+
722
+ // Type guards — check both message type and details shape for safety
723
+
724
+ export function isToolCallMessage(msg: AgentMessage): msg is AgentMessage & { details: ToolCallDetails } {
725
+ return msg.type === AgentMessageType.THOUGHT &&
726
+ !!msg.details &&
727
+ typeof msg.details === 'object' &&
728
+ typeof msg.details.tool === 'string';
729
+ }
730
+
731
+ export function isDocumentEventMessage(msg: AgentMessage): msg is AgentMessage & { details: DocumentEventDetails } {
732
+ return msg.type === AgentMessageType.UPDATE &&
733
+ !!msg.details &&
734
+ typeof msg.details === 'object' &&
735
+ (msg.details.event_class === 'document_created' || msg.details.event_class === 'document_updated') &&
736
+ typeof msg.details.document_id === 'string';
737
+ }
738
+
739
+ export function isFileProcessingMessage(msg: AgentMessage): msg is AgentMessage & { details: FileProcessingDetails } {
740
+ return msg.type === AgentMessageType.SYSTEM &&
741
+ !!msg.details &&
742
+ typeof msg.details === 'object' &&
743
+ msg.details.system_type === 'file_processing' &&
744
+ Array.isArray(msg.details.files);
745
+ }
746
+
747
+ export function isPlanMessage(msg: AgentMessage): msg is AgentMessage & { details: PlanMessageDetails } {
748
+ return msg.type === AgentMessageType.PLAN &&
749
+ !!msg.details &&
750
+ typeof msg.details === 'object' &&
751
+ Array.isArray(msg.details.plan);
752
+ }
753
+
754
+ export function isRequestInputMessage(msg: AgentMessage): msg is AgentMessage & { details: RequestInputDetails } {
755
+ return msg.type === AgentMessageType.REQUEST_INPUT &&
756
+ !!msg.details &&
757
+ typeof msg.details === 'object';
758
+ }
759
+
583
760
  /**
584
761
  * Details for STREAMING_CHUNK messages used for real-time LLM response streaming
585
762
  * @deprecated Use CompactMessage with f field for streaming chunks
package/src/user.ts CHANGED
@@ -18,6 +18,17 @@ export interface User {
18
18
  sign_in_provider?: string;
19
19
  last_selected_account?: string;
20
20
  source?: 'firebase' | 'scim';
21
+ updated_by?: string;
22
+ }
23
+
24
+
25
+ export interface UpdateUserPayload {
26
+ name?: string;
27
+ username?: string;
28
+ picture?: string;
29
+ language?: string;
30
+ phone?: string;
31
+ last_selected_account?: string;
21
32
  }
22
33
 
23
34