@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,777 @@
1
+ /**
2
+ * Agent Observability Telemetry Types
3
+ *
4
+ * These types define the event-based model for agent observability.
5
+ */
6
+ /**
7
+ * Types of telemetry events
8
+ */
9
+ export declare enum AgentEventType {
10
+ AgentRunStarted = "agent_run_started",
11
+ AgentRunCompleted = "agent_run_completed",
12
+ LlmCall = "llm_call",
13
+ ToolCall = "tool_call"
14
+ }
15
+ /**
16
+ * Types of LLM calls in a conversation
17
+ */
18
+ export declare enum LlmCallType {
19
+ /** Initial conversation start */
20
+ Start = "start",
21
+ /** Resuming with tool results */
22
+ ResumeTools = "resume_tools",
23
+ /** Resuming with user message */
24
+ ResumeUser = "resume_user",
25
+ /** Checkpoint resume (after conversation summarization) */
26
+ Checkpoint = "checkpoint",
27
+ /** Nested interaction call from within tools */
28
+ NestedInteraction = "nested_interaction"
29
+ }
30
+ /**
31
+ * Types of tools that can be called
32
+ */
33
+ export declare enum TelemetryToolType {
34
+ /** Built-in tools (e.g., plan, search) */
35
+ Builtin = "builtin",
36
+ /** Interaction-based tools */
37
+ Interaction = "interaction",
38
+ /** Remote/MCP tools */
39
+ Remote = "remote",
40
+ /** Skill tools */
41
+ Skill = "skill"
42
+ }
43
+ /**
44
+ * Base interface for all telemetry events
45
+ */
46
+ export interface BaseAgentEvent {
47
+ /** Type of the event */
48
+ eventType: string;
49
+ /** ISO 8601 timestamp */
50
+ timestamp: string;
51
+ /** Globally unique ID for this agent run */
52
+ runId: string;
53
+ /** LLM model identifier (e.g., "claude-3-5-sonnet", "gemini-1.5-pro") */
54
+ model: string;
55
+ /** Environment ID (MongoDB ObjectId of the environment) */
56
+ environmentId: string;
57
+ /** Environment type/driver (e.g., "vertexai", "bedrock", "openai") */
58
+ environmentType: string;
59
+ /** Interaction ID (MongoDB ObjectId of the interaction) */
60
+ interactionId: string;
61
+ /** Immediate parent run ID (if this is a child workflow) */
62
+ parentRunId?: string;
63
+ /** Ancestor run IDs from root to immediate parent (for hierarchical aggregation) */
64
+ ancestorRunIds?: string[];
65
+ }
66
+ /**
67
+ * Emitted when an agent run starts
68
+ */
69
+ export interface AgentRunStartedEvent extends BaseAgentEvent {
70
+ eventType: AgentEventType.AgentRunStarted;
71
+ /** Whether this is an interactive conversation */
72
+ interactive: boolean;
73
+ /** Task ID if part of a multi-workstream execution */
74
+ taskId?: string;
75
+ /** User channels enabled for this run (email, interactive, etc.) */
76
+ userChannels?: string[];
77
+ }
78
+ /**
79
+ * Emitted when an agent run completes (success or failure)
80
+ */
81
+ export interface AgentRunCompletedEvent extends BaseAgentEvent {
82
+ eventType: AgentEventType.AgentRunCompleted;
83
+ /** Whether the run succeeded */
84
+ success: boolean;
85
+ /** Total duration in milliseconds */
86
+ durationMs: number;
87
+ /** Error type if failed */
88
+ errorType?: string;
89
+ /** Error message if failed */
90
+ errorMessage?: string;
91
+ /** Total iterations in the conversation loop */
92
+ totalIterations: number;
93
+ /** Total tool calls made */
94
+ totalToolCalls: number;
95
+ /** Total LLM calls made */
96
+ totalLlmCalls: number;
97
+ /** Cumulative token usage */
98
+ totalTokens?: {
99
+ input: number;
100
+ output: number;
101
+ total: number;
102
+ };
103
+ /** If conversation was ended via end_conversation tool */
104
+ endConversation?: {
105
+ /** Status provided by the agent */
106
+ status: 'success' | 'failure';
107
+ /** Reason provided by the agent (especially for failures) */
108
+ reason?: string;
109
+ };
110
+ }
111
+ /**
112
+ * Emitted for each LLM call (start/resume conversation)
113
+ * Note: model, environmentId, environmentType are required (override base optional)
114
+ */
115
+ export interface LlmCallEvent extends BaseAgentEvent {
116
+ eventType: AgentEventType.LlmCall;
117
+ /** Number of input/prompt tokens */
118
+ promptTokens: number;
119
+ /** Number of output/completion tokens */
120
+ completionTokens: number;
121
+ /** Total tokens used */
122
+ totalTokens: number;
123
+ /** Duration of the LLM call in milliseconds */
124
+ durationMs: number;
125
+ /** Whether the call succeeded */
126
+ success: boolean;
127
+ /** Whether streaming was enabled */
128
+ streamingEnabled: boolean;
129
+ /** Number of tool uses returned by the LLM */
130
+ toolUseCount: number;
131
+ /** Type of call: 'start' for initial, 'resume_tools' for tool results, 'resume_user' for user message */
132
+ callType: LlmCallType;
133
+ /** Activity attempt number (for retries) */
134
+ attemptNumber?: number;
135
+ /** Error type if failed */
136
+ errorType?: string;
137
+ }
138
+ /**
139
+ * Emitted when a tool call completes (success or failure).
140
+ * Contains all information about the tool execution including parameters and results.
141
+ */
142
+ export interface ToolCallEvent extends BaseAgentEvent {
143
+ eventType: AgentEventType.ToolCall;
144
+ /** Name of the tool being called */
145
+ toolName: string;
146
+ /** Tool use ID from the LLM */
147
+ toolUseId: string;
148
+ /** Whether this is a built-in tool, interaction tool, or remote tool */
149
+ toolType: TelemetryToolType;
150
+ /** Current iteration number */
151
+ iteration: number;
152
+ /** Parameters passed to the tool (sanitized - no secrets) */
153
+ parameters?: Record<string, unknown>;
154
+ /** Size of parameters in bytes */
155
+ parametersSizeBytes?: number;
156
+ /** Whether the tool call succeeded */
157
+ success: boolean;
158
+ /** Duration in milliseconds */
159
+ durationMs: number;
160
+ /** Size of result in bytes */
161
+ resultSizeBytes?: number;
162
+ /** Error type if failed */
163
+ errorType?: string;
164
+ /** Error message if failed (truncated) */
165
+ errorMessage?: string;
166
+ /** Whether this tool spawned a child workflow */
167
+ spawnedChildWorkflow?: boolean;
168
+ }
169
+ /**
170
+ * Emitted when a checkpoint is created.
171
+ * Extends LlmCallEvent since checkpoint creation involves an LLM call.
172
+ */
173
+ export interface CheckpointCreatedEvent extends LlmCallEvent {
174
+ callType: LlmCallType.Checkpoint;
175
+ /** Token count that triggered the checkpoint (before this LLM call) */
176
+ tokenCountAtCheckpoint: number;
177
+ /** Checkpoint threshold configured */
178
+ checkpointThreshold: number;
179
+ /** Current iteration number */
180
+ iteration: number;
181
+ }
182
+ /**
183
+ * Emitted when a nested interaction is called from within a tool.
184
+ * Extends LlmCallEvent since nested interaction execution involves an LLM call.
185
+ */
186
+ export interface NestedInteractionEvent extends LlmCallEvent {
187
+ callType: LlmCallType.NestedInteraction;
188
+ /** The interaction being called (e.g., "sys:AnalyzeDocument") */
189
+ nestedInteractionId: string;
190
+ /** Tool that triggered this call - same pattern as ToolCallEvent */
191
+ toolName: string;
192
+ /** Tool type - same pattern as ToolCallEvent */
193
+ toolType: TelemetryToolType;
194
+ }
195
+ export type AgentEvent = AgentRunStartedEvent | AgentRunCompletedEvent | LlmCallEvent | ToolCallEvent | CheckpointCreatedEvent | NestedInteractionEvent;
196
+ /**
197
+ * Workflow Analytics Types
198
+ *
199
+ * Types for querying and presenting workflow telemetry analytics.
200
+ * Designed for end-user facing dashboards with aggregated metrics.
201
+ */
202
+ /**
203
+ * Time resolution for analytics aggregation
204
+ */
205
+ export type WorkflowAnalyticsResolution = 'minute' | 'hour' | 'day' | 'week' | 'month';
206
+ /**
207
+ * Dimensions to group analytics by
208
+ */
209
+ export type WorkflowAnalyticsGroupBy = 'model' | 'environment' | 'tool' | 'toolType' | 'agent' | 'errorType';
210
+ /**
211
+ * Filter criteria for workflow analytics queries
212
+ */
213
+ export interface WorkflowAnalyticsFilter {
214
+ /** Filter by specific agent/interaction names */
215
+ agents?: string[];
216
+ /** Filter by LLM models */
217
+ models?: string[];
218
+ /** Filter by environments/drivers */
219
+ environments?: string[];
220
+ /** Filter by tool names */
221
+ tools?: string[];
222
+ /** Filter by tool types */
223
+ toolTypes?: ('builtin' | 'interaction' | 'remote' | 'skill')[];
224
+ /** Filter by success/failure status */
225
+ success?: boolean;
226
+ /** Filter by specific workflow run IDs */
227
+ runIds?: string[];
228
+ /** Filter by principal IDs (users or API keys) */
229
+ principals?: string[];
230
+ }
231
+ /**
232
+ * Base query parameters for all workflow analytics endpoints
233
+ */
234
+ export interface WorkflowAnalyticsQueryBase {
235
+ /** Start time (ISO 8601 or Unix timestamp) */
236
+ from?: string | number;
237
+ /** End time (ISO 8601 or Unix timestamp) */
238
+ to?: string | number;
239
+ /** Filters to apply */
240
+ filter?: WorkflowAnalyticsFilter;
241
+ }
242
+ /**
243
+ * Query for time-series analytics (metrics over time)
244
+ */
245
+ export interface WorkflowAnalyticsTimeSeriesQuery extends WorkflowAnalyticsQueryBase {
246
+ /** Time bucket resolution */
247
+ resolution?: WorkflowAnalyticsResolution;
248
+ /** Resolution step size (e.g., 2 means 2-hour buckets when resolution is 'hour'). Defaults to 1. */
249
+ resolutionStep?: number;
250
+ /** Optional grouping dimension */
251
+ groupBy?: WorkflowAnalyticsGroupBy;
252
+ }
253
+ /**
254
+ * Query for summary/aggregate analytics
255
+ */
256
+ export interface WorkflowAnalyticsSummaryQuery extends WorkflowAnalyticsQueryBase {
257
+ /** Dimension to group results by */
258
+ groupBy?: WorkflowAnalyticsGroupBy;
259
+ /** Maximum number of groups to return (for top-N queries) */
260
+ limit?: number;
261
+ }
262
+ /**
263
+ * Query for tool parameter analytics
264
+ */
265
+ export interface WorkflowToolParametersQuery extends WorkflowAnalyticsQueryBase {
266
+ /** Specific tool to analyze parameters for (required) */
267
+ toolName: string;
268
+ /** Maximum number of parameter patterns to return */
269
+ limit?: number;
270
+ }
271
+ /**
272
+ * Token usage metrics
273
+ */
274
+ export interface TokenUsageMetrics {
275
+ /** Total input/prompt tokens */
276
+ inputTokens: number;
277
+ /** Total output/completion tokens */
278
+ outputTokens: number;
279
+ /** Total tokens (input + output) */
280
+ totalTokens: number;
281
+ /** Average tokens per LLM call */
282
+ avgTokensPerCall?: number;
283
+ }
284
+ /**
285
+ * Token usage aggregated by dimension
286
+ */
287
+ export interface TokenUsageByDimension {
288
+ /** The dimension value (model name, tool name, etc.) */
289
+ dimension: string;
290
+ /** Token usage metrics */
291
+ usage: TokenUsageMetrics;
292
+ /** Number of LLM calls */
293
+ callCount: number;
294
+ /** Percentage of total tokens */
295
+ percentageOfTotal?: number;
296
+ }
297
+ /**
298
+ * Token usage time series data point
299
+ */
300
+ export interface TokenUsageTimeSeriesPoint {
301
+ /** Timestamp bucket start (ISO 8601) */
302
+ timestamp: string;
303
+ /** Timestamp bucket end (ISO 8601) */
304
+ timestampEnd: string;
305
+ /** Token usage metrics for this bucket */
306
+ usage: TokenUsageMetrics;
307
+ /** Number of LLM calls in this bucket */
308
+ callCount: number;
309
+ /** Optional group value if groupBy was specified */
310
+ group?: string;
311
+ }
312
+ /**
313
+ * Duration/latency statistics
314
+ */
315
+ export interface DurationStats {
316
+ /** Average duration in milliseconds */
317
+ avgMs: number;
318
+ /** Minimum duration in milliseconds */
319
+ minMs: number;
320
+ /** Maximum duration in milliseconds */
321
+ maxMs: number;
322
+ /** Median duration in milliseconds (p50) */
323
+ medianMs?: number;
324
+ /** 95th percentile duration in milliseconds */
325
+ p95Ms?: number;
326
+ /** 99th percentile duration in milliseconds */
327
+ p99Ms?: number;
328
+ }
329
+ /**
330
+ * Latency metrics for a specific dimension
331
+ */
332
+ export interface LatencyByDimension {
333
+ /** The dimension value (model name, tool name, agent name, etc.) */
334
+ dimension: string;
335
+ /** Duration statistics */
336
+ duration: DurationStats;
337
+ /** Number of executions */
338
+ count: number;
339
+ /** Success rate (0-1) */
340
+ successRate: number;
341
+ }
342
+ /**
343
+ * Latency time series data point
344
+ */
345
+ export interface LatencyTimeSeriesPoint {
346
+ /** Timestamp bucket start (ISO 8601) */
347
+ timestamp: string;
348
+ /** Timestamp bucket end (ISO 8601) */
349
+ timestampEnd: string;
350
+ /** Duration statistics for this bucket */
351
+ duration: DurationStats;
352
+ /** Number of executions in this bucket */
353
+ count: number;
354
+ /** Success rate in this bucket (0-1) */
355
+ successRate: number;
356
+ /** Optional group value if groupBy was specified */
357
+ group?: string;
358
+ }
359
+ /**
360
+ * Error rate metrics
361
+ */
362
+ export interface ErrorMetrics {
363
+ /** Total number of executions */
364
+ totalCount: number;
365
+ /** Number of successful executions */
366
+ successCount: number;
367
+ /** Number of failed executions */
368
+ errorCount: number;
369
+ /** Error rate (0-1) */
370
+ errorRate: number;
371
+ /** Number of LLM call errors */
372
+ llmErrorCount?: number;
373
+ /** Number of tool call errors */
374
+ toolErrorCount?: number;
375
+ }
376
+ /**
377
+ * Error breakdown by type
378
+ */
379
+ export interface ErrorByType {
380
+ /** Error type (e.g., "timeout", "rate_limit", "invalid_response") */
381
+ errorType: string;
382
+ /** Number of occurrences */
383
+ count: number;
384
+ /** Percentage of total errors */
385
+ percentageOfErrors: number;
386
+ /** Example error message (truncated) */
387
+ exampleMessage?: string;
388
+ }
389
+ /**
390
+ * Error analytics by dimension
391
+ */
392
+ export interface ErrorByDimension {
393
+ /** The dimension value (model name, tool name, etc.) */
394
+ dimension: string;
395
+ /** Error metrics */
396
+ metrics: ErrorMetrics;
397
+ /** Breakdown by error type */
398
+ errorTypes?: ErrorByType[];
399
+ }
400
+ /**
401
+ * Error time series data point
402
+ */
403
+ export interface ErrorTimeSeriesPoint {
404
+ /** Timestamp bucket start (ISO 8601) */
405
+ timestamp: string;
406
+ /** Timestamp bucket end (ISO 8601) */
407
+ timestampEnd: string;
408
+ /** Error metrics for this bucket */
409
+ metrics: ErrorMetrics;
410
+ /** Optional group value if groupBy was specified */
411
+ group?: string;
412
+ }
413
+ /**
414
+ * Tool usage metrics
415
+ */
416
+ export interface ToolUsageMetrics {
417
+ /** Tool name */
418
+ toolName: string;
419
+ /** Tool type */
420
+ toolType: 'builtin' | 'interaction' | 'remote' | 'skill';
421
+ /** Number of invocations */
422
+ invocationCount: number;
423
+ /** Success rate (0-1) */
424
+ successRate: number;
425
+ /** Duration statistics */
426
+ duration: DurationStats;
427
+ /** Average input size in bytes */
428
+ avgInputSizeBytes?: number;
429
+ /** Average output size in bytes */
430
+ avgOutputSizeBytes?: number;
431
+ }
432
+ /**
433
+ * Parameter value distribution for a tool
434
+ */
435
+ export interface ToolParameterValue {
436
+ /** Parameter name */
437
+ parameterName: string;
438
+ /** Parameter value (stringified) */
439
+ value: string;
440
+ /** Number of times this value was used */
441
+ count: number;
442
+ /** Percentage of total invocations */
443
+ percentage: number;
444
+ }
445
+ /**
446
+ * Tool parameter analytics
447
+ */
448
+ export interface ToolParameterAnalytics {
449
+ /** Tool name */
450
+ toolName: string;
451
+ /** Total invocations analyzed */
452
+ totalInvocations: number;
453
+ /** Parameter value distributions */
454
+ parameters: {
455
+ [parameterName: string]: {
456
+ /** Top values for this parameter */
457
+ topValues: ToolParameterValue[];
458
+ /** Number of unique values */
459
+ uniqueValueCount: number;
460
+ };
461
+ };
462
+ }
463
+ /**
464
+ * Overall workflow analytics summary
465
+ */
466
+ export interface WorkflowAnalyticsSummary {
467
+ /** Time range of the data */
468
+ timeRange: {
469
+ from: string;
470
+ to: string;
471
+ };
472
+ /** Total workflow runs */
473
+ totalRuns: number;
474
+ /** Successful runs */
475
+ successfulRuns: number;
476
+ /** Failed runs */
477
+ failedRuns: number;
478
+ /** Ongoing runs (started but not yet completed) */
479
+ ongoingRuns: number;
480
+ /** Overall success rate (0-1) */
481
+ successRate: number;
482
+ /** Total token usage */
483
+ tokenUsage: TokenUsageMetrics;
484
+ /** Token usage from nested interaction calls (e.g., sys:AnalyzeDocument) */
485
+ nestedInteractionTokens: TokenUsageMetrics;
486
+ /** Average run duration (non-interactive runs only) */
487
+ avgRunDurationMs: number;
488
+ /** 95th percentile run duration (non-interactive runs only) */
489
+ p95RunDurationMs: number;
490
+ /** Number of non-interactive runs used for duration calculation */
491
+ nonInteractiveRunCount: number;
492
+ /** Total LLM calls */
493
+ totalLlmCalls: number;
494
+ /** Total tool calls */
495
+ totalToolCalls: number;
496
+ /** Unique models used */
497
+ uniqueModels: string[];
498
+ /** Unique tools used */
499
+ uniqueTools: string[];
500
+ }
501
+ /**
502
+ * Response for token usage analytics
503
+ */
504
+ export interface TokenUsageAnalyticsResponse {
505
+ /** Summary metrics */
506
+ summary: TokenUsageMetrics;
507
+ /** Breakdown by requested dimension */
508
+ byDimension?: TokenUsageByDimension[];
509
+ /** Time series data if resolution was specified */
510
+ timeSeries?: TokenUsageTimeSeriesPoint[];
511
+ }
512
+ /**
513
+ * Response for latency analytics
514
+ */
515
+ export interface LatencyAnalyticsResponse {
516
+ /** Summary metrics */
517
+ summary: DurationStats & {
518
+ count: number;
519
+ successRate: number;
520
+ };
521
+ /** Breakdown by requested dimension */
522
+ byDimension?: LatencyByDimension[];
523
+ /** Time series data if resolution was specified */
524
+ timeSeries?: LatencyTimeSeriesPoint[];
525
+ }
526
+ /**
527
+ * Response for error analytics
528
+ */
529
+ export interface ErrorAnalyticsResponse {
530
+ /** Summary metrics */
531
+ summary: ErrorMetrics;
532
+ /** Breakdown by error type */
533
+ byErrorType?: ErrorByType[];
534
+ /** Breakdown by requested dimension */
535
+ byDimension?: ErrorByDimension[];
536
+ /** Time series data if resolution was specified */
537
+ timeSeries?: ErrorTimeSeriesPoint[];
538
+ }
539
+ /**
540
+ * Response for tool analytics
541
+ */
542
+ export interface ToolAnalyticsResponse {
543
+ /** Tool usage metrics */
544
+ tools: ToolUsageMetrics[];
545
+ /** Total tool invocations */
546
+ totalInvocations: number;
547
+ }
548
+ /**
549
+ * Response for tool parameter analytics
550
+ */
551
+ export interface ToolParameterAnalyticsResponse {
552
+ /** Tool parameter analytics */
553
+ analytics: ToolParameterAnalytics;
554
+ }
555
+ /**
556
+ * Response for overall summary analytics
557
+ */
558
+ export interface WorkflowAnalyticsSummaryResponse {
559
+ /** Summary data */
560
+ summary: WorkflowAnalyticsSummary;
561
+ }
562
+ /**
563
+ * Agent/interaction reference with id and display name
564
+ */
565
+ export interface AgentFilterOption {
566
+ /** The agent/interaction ID (used for filtering) */
567
+ id: string;
568
+ /** The display name (resolved from interaction) */
569
+ name: string;
570
+ }
571
+ /**
572
+ * Environment reference with id and display name
573
+ */
574
+ export interface EnvironmentFilterOption {
575
+ /** The environment ID (used for filtering) */
576
+ id: string;
577
+ /** The display name (resolved from environment) */
578
+ name: string;
579
+ }
580
+ /**
581
+ * Environment-model pair from telemetry data
582
+ */
583
+ export interface EnvironmentModelPair {
584
+ /** Environment ID */
585
+ environmentId: string;
586
+ /** Environment display name */
587
+ environmentName: string;
588
+ /** Model ID (used for filtering) */
589
+ modelId: string;
590
+ /** Model display name (human-readable) */
591
+ modelName: string;
592
+ }
593
+ /**
594
+ * Principal (user/API key) filter option
595
+ */
596
+ export interface PrincipalFilterOption {
597
+ /** The principal ID (user ID or API key ID) */
598
+ id: string;
599
+ /** The principal type (user, apikey, service_account, agent) */
600
+ type: string;
601
+ /** The display name (user email/name, API key name, etc.) */
602
+ name: string;
603
+ }
604
+ /**
605
+ * Response for available filter options (unique values from telemetry data)
606
+ */
607
+ export interface WorkflowAnalyticsFilterOptionsResponse {
608
+ /** Unique agent/interaction options with id and name */
609
+ agents: AgentFilterOption[];
610
+ /** Environment-model pairs (since models are environment-specific) */
611
+ environmentModels: EnvironmentModelPair[];
612
+ /** Unique principals (users and API keys) that have triggered agent runs */
613
+ principals: PrincipalFilterOption[];
614
+ }
615
+ /**
616
+ * Summary of prompt size metrics across all agents
617
+ */
618
+ export interface PromptSizeSummary {
619
+ /** Average prompt/input tokens for start calls across all agents */
620
+ avgPromptTokens: number;
621
+ /** 95th percentile of prompt/input tokens */
622
+ p95PromptTokens: number;
623
+ /** Total number of start calls */
624
+ totalStartCalls: number;
625
+ }
626
+ /**
627
+ * Prompt size metrics for a single agent
628
+ */
629
+ export interface PromptSizeByAgent {
630
+ /** Agent ID (to be resolved to name by the API) */
631
+ agentId: string;
632
+ /** Agent display name (resolved from interaction) */
633
+ agentName: string;
634
+ /** Average prompt/input tokens for start calls */
635
+ avgPromptTokens: number;
636
+ /** Number of start calls */
637
+ startCallCount: number;
638
+ }
639
+ /**
640
+ * Response for prompt size analytics by agent
641
+ */
642
+ export interface PromptSizeAnalyticsResponse {
643
+ /** Summary metrics across all agents */
644
+ summary: PromptSizeSummary;
645
+ /** Prompt size metrics by agent */
646
+ byAgent: PromptSizeByAgent[];
647
+ }
648
+ /**
649
+ * Top principal (user/API key/service account) metrics
650
+ */
651
+ export interface TopPrincipal {
652
+ /** Principal ID (user ID, API key ID, etc.) */
653
+ principalId: string;
654
+ /** Principal type (user, apikey, service_account, agent) */
655
+ principalType: string;
656
+ /** Display name (user email/name, API key name, etc.) */
657
+ displayName: string;
658
+ /** Number of agent runs started by this principal */
659
+ runCount: number;
660
+ }
661
+ /**
662
+ * Response for top principals analytics (most active users/principals)
663
+ */
664
+ export interface TopPrincipalsAnalyticsResponse {
665
+ /** List of top principals sorted by run count descending */
666
+ principals: TopPrincipal[];
667
+ /** Total number of runs in the period */
668
+ totalRuns: number;
669
+ }
670
+ /**
671
+ * Agent run distribution metrics
672
+ */
673
+ export interface AgentRunDistribution {
674
+ /** Agent/interaction ID */
675
+ agentId: string;
676
+ /** Agent display name (resolved from interaction) */
677
+ agentName: string;
678
+ /** Number of runs for this agent */
679
+ runCount: number;
680
+ /** Percentage of total runs */
681
+ percentage: number;
682
+ }
683
+ /**
684
+ * Response for runs by agent analytics
685
+ */
686
+ export interface RunsByAgentAnalyticsResponse {
687
+ /** List of agents sorted by run count descending */
688
+ agents: AgentRunDistribution[];
689
+ /** Total number of runs in the period */
690
+ totalRuns: number;
691
+ }
692
+ /**
693
+ * Time to first response metrics
694
+ * Measures the time from agent run start to the completion of the first LLM call
695
+ */
696
+ export interface TimeToFirstResponseMetrics {
697
+ /** Average time to first response in milliseconds */
698
+ avgMs: number;
699
+ /** Minimum time to first response in milliseconds */
700
+ minMs: number;
701
+ /** Maximum time to first response in milliseconds */
702
+ maxMs: number;
703
+ /** Median time to first response in milliseconds (p50) */
704
+ medianMs: number;
705
+ /** 95th percentile time to first response in milliseconds */
706
+ p95Ms: number;
707
+ /** 99th percentile time to first response in milliseconds */
708
+ p99Ms: number;
709
+ /** Number of agent runs analyzed */
710
+ runCount: number;
711
+ }
712
+ /**
713
+ * Time to first response time series data point
714
+ */
715
+ export interface TimeToFirstResponseTimeSeriesPoint {
716
+ /** Timestamp bucket start (ISO 8601) */
717
+ timestamp: string;
718
+ /** Timestamp bucket end (ISO 8601) */
719
+ timestampEnd: string;
720
+ /** Average time to first response in this bucket (ms) */
721
+ avgMs: number;
722
+ /** Number of runs in this bucket */
723
+ count: number;
724
+ }
725
+ /**
726
+ * Response for time to first response analytics
727
+ */
728
+ export interface TimeToFirstResponseAnalyticsResponse {
729
+ /** Summary metrics */
730
+ summary: TimeToFirstResponseMetrics;
731
+ /** Time series data if resolution was specified */
732
+ timeSeries?: TimeToFirstResponseTimeSeriesPoint[];
733
+ }
734
+ /**
735
+ * First response behavior metrics
736
+ * Analyzes the agent's first LLM response (callType = 'start') behavior
737
+ */
738
+ export interface FirstResponseBehaviorMetrics {
739
+ /** Total number of agent runs analyzed */
740
+ totalRuns: number;
741
+ /** Number of runs where the first response used a plan tool */
742
+ runsWithPlanTool: number;
743
+ /** Percentage of runs that start with a plan tool (0-100) */
744
+ planToolPercentage: number;
745
+ /** Number of runs where the first response had no tool calls */
746
+ runsWithNoTools: number;
747
+ /** Percentage of runs that start with no tool calls (0-100) */
748
+ noToolsPercentage: number;
749
+ /** Number of runs where the first response had tool calls (excluding plan only) */
750
+ runsWithOtherTools: number;
751
+ /** Percentage of runs that start with other tool calls (0-100) */
752
+ otherToolsPercentage: number;
753
+ }
754
+ /**
755
+ * First response behavior time series data point
756
+ */
757
+ export interface FirstResponseBehaviorTimeSeriesPoint {
758
+ /** Timestamp bucket start (ISO 8601) */
759
+ timestamp: string;
760
+ /** Timestamp bucket end (ISO 8601) */
761
+ timestampEnd: string;
762
+ /** Total runs in this bucket */
763
+ totalRuns: number;
764
+ /** Runs with plan tool in this bucket */
765
+ runsWithPlanTool: number;
766
+ /** Runs with no tools in this bucket */
767
+ runsWithNoTools: number;
768
+ }
769
+ /**
770
+ * Response for first response behavior analytics
771
+ */
772
+ export interface FirstResponseBehaviorAnalyticsResponse {
773
+ /** Summary metrics */
774
+ summary: FirstResponseBehaviorMetrics;
775
+ /** Time series data if resolution was specified */
776
+ timeSeries?: FirstResponseBehaviorTimeSeriesPoint[];
777
+ }