@opensearch-project/agent-health 0.3.0 → 0.5.2

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 (518) hide show
  1. package/README.md +77 -6
  2. package/cli/dist/index.js +10072 -4502
  3. package/deployment/cloudformation/agent-health-observability.yaml +762 -0
  4. package/dist/assets/index-CCQRDlO0.js +243 -0
  5. package/dist/assets/index-CNHQVbcj.css +1 -0
  6. package/dist/index.html +2 -2
  7. package/docs/ARCHITECTURE.md +450 -0
  8. package/docs/BACKEND_JOB_QUEUE.md +405 -0
  9. package/docs/CLAUDE_CODE_TELEMETRY.md +283 -0
  10. package/docs/CLI.md +431 -0
  11. package/docs/CODING_AGENT_ANALYTICS.md +298 -0
  12. package/docs/CONFIGURATION.md +388 -0
  13. package/docs/CONNECTORS.md +536 -0
  14. package/docs/INSTRUMENT_WITH_OTEL.md +390 -0
  15. package/docs/ML-COMMONS-SETUP.md +289 -0
  16. package/docs/NPX_PACKAGING.md +195 -0
  17. package/docs/PERFORMANCE-MONITORING.md +200 -0
  18. package/docs/PERFORMANCE.md +390 -0
  19. package/docs/PI_PROFILING.md +169 -0
  20. package/docs/PLAN-non-agui-agent-support.md +525 -0
  21. package/docs/SDK.md +577 -0
  22. package/docs/SKILLS.md +264 -0
  23. package/docs/blogs/2026-02-28-opensearch-agent-health.md +200 -0
  24. package/docs/blogs/getting-started-blog.md +608 -0
  25. package/docs/diagrams/Agent-health.excalidraw +5656 -0
  26. package/docs/diagrams/architecture.png +0 -0
  27. package/docs/plans/field-redesign.md +468 -0
  28. package/docs/rfcs/001-coding-agent-analytics.md +374 -0
  29. package/docs/rfcs/002-enterprise-leaderboard.md +267 -0
  30. package/docs/rfcs/003-remote-aggregation.md +146 -0
  31. package/docs/rfcs/004-test-sdk-v2.md +599 -0
  32. package/docs/skills/AGENT_HEALTH.md +598 -0
  33. package/docs/skills/AGENT_PROFILE.md +191 -0
  34. package/docs/skills/add-connector/SKILL.md +68 -0
  35. package/docs/skills/agent-health-profile/SKILL.md +40 -0
  36. package/docs/skills/config-auth/SKILL.md +194 -0
  37. package/docs/skills/config-auth/evals/evals.json +35 -0
  38. package/docs/skills/create-pr/SKILL.md +73 -0
  39. package/docs/skills/instrument-otel/SKILL.md +84 -0
  40. package/docs/skills/write-test/SKILL.md +124 -0
  41. package/docs/ui prd.md +376 -0
  42. package/examples/README.md +53 -0
  43. package/examples/config/agent-health.config.example.ts +155 -0
  44. package/examples/connectors/echo-connector.ts +131 -0
  45. package/examples/eval-files/demo.eval.js +128 -0
  46. package/examples/eval-files/sdk-hooks-demo.eval.js +99 -0
  47. package/examples/pi-profiling/README.md +77 -0
  48. package/examples/pi-profiling/agent-health-profile.ts +417 -0
  49. package/lib/dist/lib/agentUtils.d.ts +29 -0
  50. package/lib/dist/lib/agentUtils.d.ts.map +1 -0
  51. package/lib/dist/lib/agentUtils.js +43 -0
  52. package/lib/dist/lib/agentUtils.js.map +1 -0
  53. package/lib/dist/lib/benchmarkExport.d.ts +14 -0
  54. package/lib/dist/lib/benchmarkExport.d.ts.map +1 -0
  55. package/lib/dist/lib/benchmarkExport.js +41 -0
  56. package/lib/dist/lib/benchmarkExport.js.map +1 -0
  57. package/lib/dist/lib/benchmarkVersionUtils.d.ts +37 -0
  58. package/lib/dist/lib/benchmarkVersionUtils.d.ts.map +1 -0
  59. package/lib/dist/lib/benchmarkVersionUtils.js +68 -0
  60. package/lib/dist/lib/benchmarkVersionUtils.js.map +1 -0
  61. package/lib/dist/lib/config/defineConfig.d.ts +27 -0
  62. package/lib/dist/lib/config/defineConfig.d.ts.map +1 -0
  63. package/lib/dist/lib/config/defineConfig.js +28 -0
  64. package/lib/dist/lib/config/defineConfig.js.map +1 -0
  65. package/lib/dist/lib/config/index.d.ts +9 -0
  66. package/lib/dist/lib/config/index.d.ts.map +1 -0
  67. package/lib/dist/lib/config/index.js +8 -0
  68. package/lib/dist/lib/config/index.js.map +1 -0
  69. package/lib/dist/lib/config/loader.d.ts +39 -0
  70. package/lib/dist/lib/config/loader.d.ts.map +1 -0
  71. package/lib/dist/lib/config/loader.js +258 -0
  72. package/lib/dist/lib/config/loader.js.map +1 -0
  73. package/lib/dist/lib/config/statePaths.d.ts +61 -0
  74. package/lib/dist/lib/config/statePaths.d.ts.map +1 -0
  75. package/lib/dist/lib/config/statePaths.js +188 -0
  76. package/lib/dist/lib/config/statePaths.js.map +1 -0
  77. package/lib/dist/lib/config/types.d.ts +231 -0
  78. package/lib/dist/lib/config/types.d.ts.map +1 -0
  79. package/lib/dist/lib/config/types.js +6 -0
  80. package/lib/dist/lib/config/types.js.map +1 -0
  81. package/lib/dist/lib/config.d.ts +39 -0
  82. package/lib/dist/lib/config.d.ts.map +1 -0
  83. package/lib/dist/lib/config.js +118 -0
  84. package/lib/dist/lib/config.js.map +1 -0
  85. package/lib/dist/lib/constants.d.ts +70 -0
  86. package/lib/dist/lib/constants.d.ts.map +1 -0
  87. package/lib/dist/lib/constants.js +365 -0
  88. package/lib/dist/lib/constants.js.map +1 -0
  89. package/lib/dist/lib/contextUtilization.d.ts +23 -0
  90. package/lib/dist/lib/contextUtilization.d.ts.map +1 -0
  91. package/lib/dist/lib/contextUtilization.js +72 -0
  92. package/lib/dist/lib/contextUtilization.js.map +1 -0
  93. package/lib/dist/lib/dashboardMetrics.d.ts +87 -0
  94. package/lib/dist/lib/dashboardMetrics.d.ts.map +1 -0
  95. package/lib/dist/lib/dashboardMetrics.js +242 -0
  96. package/lib/dist/lib/dashboardMetrics.js.map +1 -0
  97. package/lib/dist/lib/dataSourceConfig.d.ts +108 -0
  98. package/lib/dist/lib/dataSourceConfig.d.ts.map +1 -0
  99. package/lib/dist/lib/dataSourceConfig.js +166 -0
  100. package/lib/dist/lib/dataSourceConfig.js.map +1 -0
  101. package/lib/dist/lib/debug.d.ts +26 -0
  102. package/lib/dist/lib/debug.d.ts.map +1 -0
  103. package/lib/dist/lib/debug.js +132 -0
  104. package/lib/dist/lib/debug.js.map +1 -0
  105. package/lib/dist/lib/diagnostics.d.ts +28 -0
  106. package/lib/dist/lib/diagnostics.d.ts.map +1 -0
  107. package/lib/dist/lib/diagnostics.js +65 -0
  108. package/lib/dist/lib/diagnostics.js.map +1 -0
  109. package/lib/dist/lib/envCompat.d.ts +27 -0
  110. package/lib/dist/lib/envCompat.d.ts.map +1 -0
  111. package/lib/dist/lib/envCompat.js +73 -0
  112. package/lib/dist/lib/envCompat.js.map +1 -0
  113. package/lib/dist/lib/findPackageRoot.d.ts +7 -0
  114. package/lib/dist/lib/findPackageRoot.d.ts.map +1 -0
  115. package/lib/dist/lib/findPackageRoot.js +57 -0
  116. package/lib/dist/lib/findPackageRoot.js.map +1 -0
  117. package/lib/dist/lib/hooks.d.ts +36 -0
  118. package/lib/dist/lib/hooks.d.ts.map +1 -0
  119. package/lib/dist/lib/hooks.js +112 -0
  120. package/lib/dist/lib/hooks.js.map +1 -0
  121. package/lib/dist/lib/index.d.ts +47 -0
  122. package/lib/dist/lib/index.d.ts.map +1 -0
  123. package/lib/dist/lib/index.js +62 -0
  124. package/lib/dist/lib/index.js.map +1 -0
  125. package/lib/dist/lib/labels.d.ts +90 -0
  126. package/lib/dist/lib/labels.d.ts.map +1 -0
  127. package/lib/dist/lib/labels.js +158 -0
  128. package/lib/dist/lib/labels.js.map +1 -0
  129. package/lib/dist/lib/markdown.d.ts +16 -0
  130. package/lib/dist/lib/markdown.d.ts.map +1 -0
  131. package/lib/dist/lib/markdown.js +42 -0
  132. package/lib/dist/lib/markdown.js.map +1 -0
  133. package/lib/dist/lib/matchers/expect.d.ts +3 -0
  134. package/lib/dist/lib/matchers/expect.d.ts.map +1 -0
  135. package/lib/dist/lib/matchers/expect.js +225 -0
  136. package/lib/dist/lib/matchers/expect.js.map +1 -0
  137. package/lib/dist/lib/matchers/index.d.ts +8 -0
  138. package/lib/dist/lib/matchers/index.d.ts.map +1 -0
  139. package/lib/dist/lib/matchers/index.js +9 -0
  140. package/lib/dist/lib/matchers/index.js.map +1 -0
  141. package/lib/dist/lib/matchers/judgeAccessor.d.ts +113 -0
  142. package/lib/dist/lib/matchers/judgeAccessor.d.ts.map +1 -0
  143. package/lib/dist/lib/matchers/judgeAccessor.js +183 -0
  144. package/lib/dist/lib/matchers/judgeAccessor.js.map +1 -0
  145. package/lib/dist/lib/matchers/session.d.ts +39 -0
  146. package/lib/dist/lib/matchers/session.d.ts.map +1 -0
  147. package/lib/dist/lib/matchers/session.js +116 -0
  148. package/lib/dist/lib/matchers/session.js.map +1 -0
  149. package/lib/dist/lib/matchers/traces.d.ts +55 -0
  150. package/lib/dist/lib/matchers/traces.d.ts.map +1 -0
  151. package/lib/dist/lib/matchers/traces.js +116 -0
  152. package/lib/dist/lib/matchers/traces.js.map +1 -0
  153. package/lib/dist/lib/matchers/types.d.ts +75 -0
  154. package/lib/dist/lib/matchers/types.d.ts.map +1 -0
  155. package/lib/dist/lib/matchers/types.js +6 -0
  156. package/lib/dist/lib/matchers/types.js.map +1 -0
  157. package/lib/dist/lib/packagePaths.d.ts +29 -0
  158. package/lib/dist/lib/packagePaths.d.ts.map +1 -0
  159. package/lib/dist/lib/packagePaths.js +63 -0
  160. package/lib/dist/lib/packagePaths.js.map +1 -0
  161. package/lib/dist/lib/performance.d.ts +51 -0
  162. package/lib/dist/lib/performance.d.ts.map +1 -0
  163. package/lib/dist/lib/performance.js +159 -0
  164. package/lib/dist/lib/performance.js.map +1 -0
  165. package/lib/dist/lib/portConfig.d.ts +29 -0
  166. package/lib/dist/lib/portConfig.d.ts.map +1 -0
  167. package/lib/dist/lib/portConfig.js +64 -0
  168. package/lib/dist/lib/portConfig.js.map +1 -0
  169. package/lib/dist/lib/preferences.d.ts +63 -0
  170. package/lib/dist/lib/preferences.d.ts.map +1 -0
  171. package/lib/dist/lib/preferences.js +117 -0
  172. package/lib/dist/lib/preferences.js.map +1 -0
  173. package/lib/dist/lib/resolveAgentModel.d.ts +22 -0
  174. package/lib/dist/lib/resolveAgentModel.d.ts.map +1 -0
  175. package/lib/dist/lib/resolveAgentModel.js +37 -0
  176. package/lib/dist/lib/resolveAgentModel.js.map +1 -0
  177. package/lib/dist/lib/runStats.d.ts +92 -0
  178. package/lib/dist/lib/runStats.d.ts.map +1 -0
  179. package/lib/dist/lib/runStats.js +160 -0
  180. package/lib/dist/lib/runStats.js.map +1 -0
  181. package/lib/dist/lib/telemetry/constants.d.ts +60 -0
  182. package/lib/dist/lib/telemetry/constants.d.ts.map +1 -0
  183. package/lib/dist/lib/telemetry/constants.js +87 -0
  184. package/lib/dist/lib/telemetry/constants.js.map +1 -0
  185. package/lib/dist/lib/telemetry/evalSpans.d.ts +61 -0
  186. package/lib/dist/lib/telemetry/evalSpans.d.ts.map +1 -0
  187. package/lib/dist/lib/telemetry/evalSpans.js +254 -0
  188. package/lib/dist/lib/telemetry/evalSpans.js.map +1 -0
  189. package/lib/dist/lib/telemetry/index.d.ts +11 -0
  190. package/lib/dist/lib/telemetry/index.d.ts.map +1 -0
  191. package/lib/dist/lib/telemetry/index.js +15 -0
  192. package/lib/dist/lib/telemetry/index.js.map +1 -0
  193. package/lib/dist/lib/telemetry/opensearchExporter.d.ts +43 -0
  194. package/lib/dist/lib/telemetry/opensearchExporter.d.ts.map +1 -0
  195. package/lib/dist/lib/telemetry/opensearchExporter.js +217 -0
  196. package/lib/dist/lib/telemetry/opensearchExporter.js.map +1 -0
  197. package/lib/dist/lib/telemetry/provider.d.ts +55 -0
  198. package/lib/dist/lib/telemetry/provider.d.ts.map +1 -0
  199. package/lib/dist/lib/telemetry/provider.js +140 -0
  200. package/lib/dist/lib/telemetry/provider.js.map +1 -0
  201. package/lib/dist/lib/testCaseLabels.d.ts +34 -0
  202. package/lib/dist/lib/testCaseLabels.d.ts.map +1 -0
  203. package/lib/dist/lib/testCaseLabels.js +88 -0
  204. package/lib/dist/lib/testCaseLabels.js.map +1 -0
  205. package/lib/dist/lib/testCaseValidation.d.ts +140 -0
  206. package/lib/dist/lib/testCaseValidation.d.ts.map +1 -0
  207. package/lib/dist/lib/testCaseValidation.js +162 -0
  208. package/lib/dist/lib/testCaseValidation.js.map +1 -0
  209. package/lib/dist/lib/testCases/agentFixture.d.ts +80 -0
  210. package/lib/dist/lib/testCases/agentFixture.d.ts.map +1 -0
  211. package/lib/dist/lib/testCases/agentFixture.js +43 -0
  212. package/lib/dist/lib/testCases/agentFixture.js.map +1 -0
  213. package/lib/dist/lib/testCases/authoringSurface.d.ts +10 -0
  214. package/lib/dist/lib/testCases/authoringSurface.d.ts.map +1 -0
  215. package/lib/dist/lib/testCases/authoringSurface.js +54 -0
  216. package/lib/dist/lib/testCases/authoringSurface.js.map +1 -0
  217. package/lib/dist/lib/testCases/codemod.d.ts +13 -0
  218. package/lib/dist/lib/testCases/codemod.d.ts.map +1 -0
  219. package/lib/dist/lib/testCases/codemod.js +169 -0
  220. package/lib/dist/lib/testCases/codemod.js.map +1 -0
  221. package/lib/dist/lib/testCases/define.d.ts +114 -0
  222. package/lib/dist/lib/testCases/define.d.ts.map +1 -0
  223. package/lib/dist/lib/testCases/define.js +253 -0
  224. package/lib/dist/lib/testCases/define.js.map +1 -0
  225. package/lib/dist/lib/testCases/evaluators.d.ts +80 -0
  226. package/lib/dist/lib/testCases/evaluators.d.ts.map +1 -0
  227. package/lib/dist/lib/testCases/evaluators.js +105 -0
  228. package/lib/dist/lib/testCases/evaluators.js.map +1 -0
  229. package/lib/dist/lib/testCases/index.d.ts +14 -0
  230. package/lib/dist/lib/testCases/index.d.ts.map +1 -0
  231. package/lib/dist/lib/testCases/index.js +12 -0
  232. package/lib/dist/lib/testCases/index.js.map +1 -0
  233. package/lib/dist/lib/testCases/judge.d.ts +165 -0
  234. package/lib/dist/lib/testCases/judge.d.ts.map +1 -0
  235. package/lib/dist/lib/testCases/judge.js +359 -0
  236. package/lib/dist/lib/testCases/judge.js.map +1 -0
  237. package/lib/dist/lib/testCases/loader.d.ts +26 -0
  238. package/lib/dist/lib/testCases/loader.d.ts.map +1 -0
  239. package/lib/dist/lib/testCases/loader.js +149 -0
  240. package/lib/dist/lib/testCases/loader.js.map +1 -0
  241. package/lib/dist/lib/testCases/types.d.ts +242 -0
  242. package/lib/dist/lib/testCases/types.d.ts.map +1 -0
  243. package/lib/dist/lib/testCases/types.js +6 -0
  244. package/lib/dist/lib/testCases/types.js.map +1 -0
  245. package/lib/dist/lib/theme.d.ts +6 -0
  246. package/lib/dist/lib/theme.d.ts.map +1 -0
  247. package/lib/dist/lib/theme.js +36 -0
  248. package/lib/dist/lib/theme.js.map +1 -0
  249. package/lib/dist/lib/uiTelemetry.d.ts +7 -0
  250. package/lib/dist/lib/uiTelemetry.d.ts.map +1 -0
  251. package/lib/dist/lib/uiTelemetry.js +25 -0
  252. package/lib/dist/lib/uiTelemetry.js.map +1 -0
  253. package/lib/dist/lib/utils.d.ts +96 -0
  254. package/lib/dist/lib/utils.d.ts.map +1 -0
  255. package/lib/dist/lib/utils.js +232 -0
  256. package/lib/dist/lib/utils.js.map +1 -0
  257. package/lib/dist/lib/workflow/consolidate.d.ts +12 -0
  258. package/lib/dist/lib/workflow/consolidate.d.ts.map +1 -0
  259. package/lib/dist/lib/workflow/consolidate.js +33 -0
  260. package/lib/dist/lib/workflow/consolidate.js.map +1 -0
  261. package/lib/dist/lib/workflow/index.d.ts +13 -0
  262. package/lib/dist/lib/workflow/index.d.ts.map +1 -0
  263. package/lib/dist/lib/workflow/index.js +12 -0
  264. package/lib/dist/lib/workflow/index.js.map +1 -0
  265. package/lib/dist/lib/workflow/ledger.d.ts +30 -0
  266. package/lib/dist/lib/workflow/ledger.d.ts.map +1 -0
  267. package/lib/dist/lib/workflow/ledger.js +41 -0
  268. package/lib/dist/lib/workflow/ledger.js.map +1 -0
  269. package/lib/dist/lib/workflow/pool.d.ts +13 -0
  270. package/lib/dist/lib/workflow/pool.d.ts.map +1 -0
  271. package/lib/dist/lib/workflow/pool.js +44 -0
  272. package/lib/dist/lib/workflow/pool.js.map +1 -0
  273. package/lib/dist/lib/workflow/source.d.ts +22 -0
  274. package/lib/dist/lib/workflow/source.d.ts.map +1 -0
  275. package/lib/dist/lib/workflow/source.js +29 -0
  276. package/lib/dist/lib/workflow/source.js.map +1 -0
  277. package/lib/dist/lib/workflow/stepB.d.ts +71 -0
  278. package/lib/dist/lib/workflow/stepB.d.ts.map +1 -0
  279. package/lib/dist/lib/workflow/stepB.js +99 -0
  280. package/lib/dist/lib/workflow/stepB.js.map +1 -0
  281. package/lib/dist/lib/workflow/types.d.ts +86 -0
  282. package/lib/dist/lib/workflow/types.d.ts.map +1 -0
  283. package/lib/dist/lib/workflow/types.js +6 -0
  284. package/lib/dist/lib/workflow/types.js.map +1 -0
  285. package/lib/dist/lib/workflow/workflow.d.ts +119 -0
  286. package/lib/dist/lib/workflow/workflow.d.ts.map +1 -0
  287. package/lib/dist/lib/workflow/workflow.js +195 -0
  288. package/lib/dist/lib/workflow/workflow.js.map +1 -0
  289. package/lib/dist/services/agent/aguiConverter.d.ts +50 -0
  290. package/lib/dist/services/agent/aguiConverter.d.ts.map +1 -0
  291. package/lib/dist/services/agent/aguiConverter.js +449 -0
  292. package/lib/dist/services/agent/aguiConverter.js.map +1 -0
  293. package/lib/dist/services/agent/index.d.ts +10 -0
  294. package/lib/dist/services/agent/index.d.ts.map +1 -0
  295. package/lib/dist/services/agent/index.js +12 -0
  296. package/lib/dist/services/agent/index.js.map +1 -0
  297. package/lib/dist/services/agent/payloadBuilder.d.ts +33 -0
  298. package/lib/dist/services/agent/payloadBuilder.d.ts.map +1 -0
  299. package/lib/dist/services/agent/payloadBuilder.js +75 -0
  300. package/lib/dist/services/agent/payloadBuilder.js.map +1 -0
  301. package/lib/dist/services/agent/sseStream.d.ts +43 -0
  302. package/lib/dist/services/agent/sseStream.d.ts.map +1 -0
  303. package/lib/dist/services/agent/sseStream.js +223 -0
  304. package/lib/dist/services/agent/sseStream.js.map +1 -0
  305. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts +44 -0
  306. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts.map +1 -0
  307. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js +95 -0
  308. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js.map +1 -0
  309. package/lib/dist/services/connectors/base/BaseConnector.d.ts +81 -0
  310. package/lib/dist/services/connectors/base/BaseConnector.d.ts.map +1 -0
  311. package/lib/dist/services/connectors/base/BaseConnector.js +170 -0
  312. package/lib/dist/services/connectors/base/BaseConnector.js.map +1 -0
  313. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts +116 -0
  314. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts.map +1 -0
  315. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js +403 -0
  316. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js.map +1 -0
  317. package/lib/dist/services/connectors/index.d.ts +13 -0
  318. package/lib/dist/services/connectors/index.d.ts.map +1 -0
  319. package/lib/dist/services/connectors/index.js +32 -0
  320. package/lib/dist/services/connectors/index.js.map +1 -0
  321. package/lib/dist/services/connectors/kiro/KiroConnector.d.ts +48 -0
  322. package/lib/dist/services/connectors/kiro/KiroConnector.d.ts.map +1 -0
  323. package/lib/dist/services/connectors/kiro/KiroConnector.js +158 -0
  324. package/lib/dist/services/connectors/kiro/KiroConnector.js.map +1 -0
  325. package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts +36 -0
  326. package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts.map +1 -0
  327. package/lib/dist/services/connectors/langgraph/LangGraphConnector.js +175 -0
  328. package/lib/dist/services/connectors/langgraph/LangGraphConnector.js.map +1 -0
  329. package/lib/dist/services/connectors/mock/MockConnector.d.ts +37 -0
  330. package/lib/dist/services/connectors/mock/MockConnector.d.ts.map +1 -0
  331. package/lib/dist/services/connectors/mock/MockConnector.js +120 -0
  332. package/lib/dist/services/connectors/mock/MockConnector.js.map +1 -0
  333. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts +42 -0
  334. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts.map +1 -0
  335. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js +133 -0
  336. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js.map +1 -0
  337. package/lib/dist/services/connectors/pi/PiConnector.d.ts +87 -0
  338. package/lib/dist/services/connectors/pi/PiConnector.d.ts.map +1 -0
  339. package/lib/dist/services/connectors/pi/PiConnector.js +274 -0
  340. package/lib/dist/services/connectors/pi/PiConnector.js.map +1 -0
  341. package/lib/dist/services/connectors/registry.d.ts +57 -0
  342. package/lib/dist/services/connectors/registry.d.ts.map +1 -0
  343. package/lib/dist/services/connectors/registry.js +106 -0
  344. package/lib/dist/services/connectors/registry.js.map +1 -0
  345. package/lib/dist/services/connectors/rest/RESTConnector.d.ts +38 -0
  346. package/lib/dist/services/connectors/rest/RESTConnector.d.ts.map +1 -0
  347. package/lib/dist/services/connectors/rest/RESTConnector.js +117 -0
  348. package/lib/dist/services/connectors/rest/RESTConnector.js.map +1 -0
  349. package/lib/dist/services/connectors/server.d.ts +13 -0
  350. package/lib/dist/services/connectors/server.d.ts.map +1 -0
  351. package/lib/dist/services/connectors/server.js +34 -0
  352. package/lib/dist/services/connectors/server.js.map +1 -0
  353. package/lib/dist/services/connectors/strands/StrandsConnector.d.ts +48 -0
  354. package/lib/dist/services/connectors/strands/StrandsConnector.d.ts.map +1 -0
  355. package/lib/dist/services/connectors/strands/StrandsConnector.js +221 -0
  356. package/lib/dist/services/connectors/strands/StrandsConnector.js.map +1 -0
  357. package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts +88 -0
  358. package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts.map +1 -0
  359. package/lib/dist/services/connectors/subprocess/SubprocessConnector.js +418 -0
  360. package/lib/dist/services/connectors/subprocess/SubprocessConnector.js.map +1 -0
  361. package/lib/dist/services/connectors/types.d.ts +213 -0
  362. package/lib/dist/services/connectors/types.d.ts.map +1 -0
  363. package/lib/dist/services/connectors/types.js +6 -0
  364. package/lib/dist/services/connectors/types.js.map +1 -0
  365. package/lib/dist/services/evaluation/bedrockJudge.d.ts +64 -0
  366. package/lib/dist/services/evaluation/bedrockJudge.d.ts.map +1 -0
  367. package/lib/dist/services/evaluation/bedrockJudge.js +167 -0
  368. package/lib/dist/services/evaluation/bedrockJudge.js.map +1 -0
  369. package/lib/dist/services/evaluation/evaluatorError.d.ts +56 -0
  370. package/lib/dist/services/evaluation/evaluatorError.d.ts.map +1 -0
  371. package/lib/dist/services/evaluation/evaluatorError.js +56 -0
  372. package/lib/dist/services/evaluation/evaluatorError.js.map +1 -0
  373. package/lib/dist/services/evaluation/index.d.ts +106 -0
  374. package/lib/dist/services/evaluation/index.d.ts.map +1 -0
  375. package/lib/dist/services/evaluation/index.js +684 -0
  376. package/lib/dist/services/evaluation/index.js.map +1 -0
  377. package/lib/dist/services/evaluation/mockTrajectory.d.ts +3 -0
  378. package/lib/dist/services/evaluation/mockTrajectory.d.ts.map +1 -0
  379. package/lib/dist/services/evaluation/mockTrajectory.js +72 -0
  380. package/lib/dist/services/evaluation/mockTrajectory.js.map +1 -0
  381. package/lib/dist/services/opensearch/client.d.ts +26 -0
  382. package/lib/dist/services/opensearch/client.d.ts.map +1 -0
  383. package/lib/dist/services/opensearch/client.js +131 -0
  384. package/lib/dist/services/opensearch/client.js.map +1 -0
  385. package/lib/dist/services/opensearch/index.d.ts +16 -0
  386. package/lib/dist/services/opensearch/index.d.ts.map +1 -0
  387. package/lib/dist/services/opensearch/index.js +25 -0
  388. package/lib/dist/services/opensearch/index.js.map +1 -0
  389. package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts +123 -0
  390. package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts.map +1 -0
  391. package/lib/dist/services/storage/asyncBenchmarkStorage.js +429 -0
  392. package/lib/dist/services/storage/asyncBenchmarkStorage.js.map +1 -0
  393. package/lib/dist/services/storage/asyncRunStorage.d.ts +127 -0
  394. package/lib/dist/services/storage/asyncRunStorage.d.ts.map +1 -0
  395. package/lib/dist/services/storage/asyncRunStorage.js +448 -0
  396. package/lib/dist/services/storage/asyncRunStorage.js.map +1 -0
  397. package/lib/dist/services/storage/asyncTestCaseStorage.d.ts +156 -0
  398. package/lib/dist/services/storage/asyncTestCaseStorage.d.ts.map +1 -0
  399. package/lib/dist/services/storage/asyncTestCaseStorage.js +285 -0
  400. package/lib/dist/services/storage/asyncTestCaseStorage.js.map +1 -0
  401. package/lib/dist/services/storage/index.d.ts +17 -0
  402. package/lib/dist/services/storage/index.d.ts.map +1 -0
  403. package/lib/dist/services/storage/index.js +20 -0
  404. package/lib/dist/services/storage/index.js.map +1 -0
  405. package/lib/dist/services/storage/migration.d.ts +54 -0
  406. package/lib/dist/services/storage/migration.d.ts.map +1 -0
  407. package/lib/dist/services/storage/migration.js +296 -0
  408. package/lib/dist/services/storage/migration.js.map +1 -0
  409. package/lib/dist/services/storage/opensearchClient.d.ts +924 -0
  410. package/lib/dist/services/storage/opensearchClient.d.ts.map +1 -0
  411. package/lib/dist/services/storage/opensearchClient.js +435 -0
  412. package/lib/dist/services/storage/opensearchClient.js.map +1 -0
  413. package/lib/dist/services/traces/browserRecovery.d.ts +26 -0
  414. package/lib/dist/services/traces/browserRecovery.d.ts.map +1 -0
  415. package/lib/dist/services/traces/browserRecovery.js +81 -0
  416. package/lib/dist/services/traces/browserRecovery.js.map +1 -0
  417. package/lib/dist/services/traces/categoryStyles.d.ts +21 -0
  418. package/lib/dist/services/traces/categoryStyles.d.ts.map +1 -0
  419. package/lib/dist/services/traces/categoryStyles.js +56 -0
  420. package/lib/dist/services/traces/categoryStyles.js.map +1 -0
  421. package/lib/dist/services/traces/executionOrderTransform.d.ts +35 -0
  422. package/lib/dist/services/traces/executionOrderTransform.d.ts.map +1 -0
  423. package/lib/dist/services/traces/executionOrderTransform.js +313 -0
  424. package/lib/dist/services/traces/executionOrderTransform.js.map +1 -0
  425. package/lib/dist/services/traces/fetchSpansForRun.d.ts +86 -0
  426. package/lib/dist/services/traces/fetchSpansForRun.d.ts.map +1 -0
  427. package/lib/dist/services/traces/fetchSpansForRun.js +69 -0
  428. package/lib/dist/services/traces/fetchSpansForRun.js.map +1 -0
  429. package/lib/dist/services/traces/flowTransform.d.ts +24 -0
  430. package/lib/dist/services/traces/flowTransform.d.ts.map +1 -0
  431. package/lib/dist/services/traces/flowTransform.js +228 -0
  432. package/lib/dist/services/traces/flowTransform.js.map +1 -0
  433. package/lib/dist/services/traces/index.d.ts +121 -0
  434. package/lib/dist/services/traces/index.d.ts.map +1 -0
  435. package/lib/dist/services/traces/index.js +255 -0
  436. package/lib/dist/services/traces/index.js.map +1 -0
  437. package/lib/dist/services/traces/intentTransform.d.ts +20 -0
  438. package/lib/dist/services/traces/intentTransform.d.ts.map +1 -0
  439. package/lib/dist/services/traces/intentTransform.js +131 -0
  440. package/lib/dist/services/traces/intentTransform.js.map +1 -0
  441. package/lib/dist/services/traces/judgeAgentsHints.d.ts +63 -0
  442. package/lib/dist/services/traces/judgeAgentsHints.d.ts.map +1 -0
  443. package/lib/dist/services/traces/judgeAgentsHints.js +89 -0
  444. package/lib/dist/services/traces/judgeAgentsHints.js.map +1 -0
  445. package/lib/dist/services/traces/messageExtraction.d.ts +15 -0
  446. package/lib/dist/services/traces/messageExtraction.d.ts.map +1 -0
  447. package/lib/dist/services/traces/messageExtraction.js +251 -0
  448. package/lib/dist/services/traces/messageExtraction.js.map +1 -0
  449. package/lib/dist/services/traces/spanCategorization.d.ts +63 -0
  450. package/lib/dist/services/traces/spanCategorization.d.ts.map +1 -0
  451. package/lib/dist/services/traces/spanCategorization.js +276 -0
  452. package/lib/dist/services/traces/spanCategorization.js.map +1 -0
  453. package/lib/dist/services/traces/spanPreprocessing.d.ts +37 -0
  454. package/lib/dist/services/traces/spanPreprocessing.d.ts.map +1 -0
  455. package/lib/dist/services/traces/spanPreprocessing.js +102 -0
  456. package/lib/dist/services/traces/spanPreprocessing.js.map +1 -0
  457. package/lib/dist/services/traces/spansToTrajectory.d.ts +36 -0
  458. package/lib/dist/services/traces/spansToTrajectory.d.ts.map +1 -0
  459. package/lib/dist/services/traces/spansToTrajectory.js +387 -0
  460. package/lib/dist/services/traces/spansToTrajectory.js.map +1 -0
  461. package/lib/dist/services/traces/toolSimilarity.d.ts +35 -0
  462. package/lib/dist/services/traces/toolSimilarity.d.ts.map +1 -0
  463. package/lib/dist/services/traces/toolSimilarity.js +203 -0
  464. package/lib/dist/services/traces/toolSimilarity.js.map +1 -0
  465. package/lib/dist/services/traces/traceComparison.d.ts +31 -0
  466. package/lib/dist/services/traces/traceComparison.d.ts.map +1 -0
  467. package/lib/dist/services/traces/traceComparison.js +318 -0
  468. package/lib/dist/services/traces/traceComparison.js.map +1 -0
  469. package/lib/dist/services/traces/traceGrouping.d.ts +19 -0
  470. package/lib/dist/services/traces/traceGrouping.d.ts.map +1 -0
  471. package/lib/dist/services/traces/traceGrouping.js +107 -0
  472. package/lib/dist/services/traces/traceGrouping.js.map +1 -0
  473. package/lib/dist/services/traces/tracePoller.d.ts +84 -0
  474. package/lib/dist/services/traces/tracePoller.d.ts.map +1 -0
  475. package/lib/dist/services/traces/tracePoller.js +309 -0
  476. package/lib/dist/services/traces/tracePoller.js.map +1 -0
  477. package/lib/dist/services/traces/traceStats.d.ts +45 -0
  478. package/lib/dist/services/traces/traceStats.d.ts.map +1 -0
  479. package/lib/dist/services/traces/traceStats.js +114 -0
  480. package/lib/dist/services/traces/traceStats.js.map +1 -0
  481. package/lib/dist/services/traces/traceSummary.d.ts +47 -0
  482. package/lib/dist/services/traces/traceSummary.d.ts.map +1 -0
  483. package/lib/dist/services/traces/traceSummary.js +68 -0
  484. package/lib/dist/services/traces/traceSummary.js.map +1 -0
  485. package/lib/dist/services/traces/utils.d.ts +33 -0
  486. package/lib/dist/services/traces/utils.d.ts.map +1 -0
  487. package/lib/dist/services/traces/utils.js +114 -0
  488. package/lib/dist/services/traces/utils.js.map +1 -0
  489. package/lib/dist/types/agui.d.ts +13 -0
  490. package/lib/dist/types/agui.d.ts.map +1 -0
  491. package/lib/dist/types/agui.js +16 -0
  492. package/lib/dist/types/agui.js.map +1 -0
  493. package/lib/dist/types/index.d.ts +1175 -0
  494. package/lib/dist/types/index.d.ts.map +1 -0
  495. package/lib/dist/types/index.js +12 -0
  496. package/lib/dist/types/index.js.map +1 -0
  497. package/lib/dist/types/skills.d.ts +146 -0
  498. package/lib/dist/types/skills.d.ts.map +1 -0
  499. package/lib/dist/types/skills.js +6 -0
  500. package/lib/dist/types/skills.js.map +1 -0
  501. package/observio-sample-agent/pi-package/README.md +112 -0
  502. package/observio-sample-agent/pi-package/extensions/agent-health.ts +373 -0
  503. package/observio-sample-agent/pi-package/package.json +17 -0
  504. package/observio-sample-agent/pi-package/prompts/agent-health.md +37 -0
  505. package/observio-sample-agent/pi-package/skills/create-pr/SKILL.md +88 -0
  506. package/observio-sample-agent/pi-package/skills/fix-bug/SKILL.md +71 -0
  507. package/observio-sample-agent/pi-package/skills/implement-feature/SKILL.md +156 -0
  508. package/observio-sample-agent/pi-package/skills/instrument-otel/SKILL.md +208 -0
  509. package/observio-sample-agent/pi-package/skills/setup-collector/SKILL.md +146 -0
  510. package/observio-sample-agent/pi-package/skills/write-test/SKILL.md +115 -0
  511. package/package.json +64 -13
  512. package/server/dist/app.js +32651 -17637
  513. package/server/dist/index.js +29875 -14638
  514. package/tsconfig.lib.json +71 -0
  515. package/dist/assets/index-EvPLSTAS.js +0 -267
  516. package/dist/assets/index-RXasQKUs.css +0 -1
  517. package/lib/dist/config/index.js +0 -404
  518. package/lib/dist/index.js +0 -1665
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Cross-page user preferences.
3
+ *
4
+ * Each entry below is a single localStorage key (under the
5
+ * `agent-health:` prefix) shared by every page that exposes the
6
+ * corresponding control, so e.g. picking "30d" on the Eval Runs page is
7
+ * also reflected on Benchmarks and Test Cases.
8
+ *
9
+ * Storage layout is intentionally a flat, JSON-serialisable key/value
10
+ * map: each preference is its own localStorage entry. That keeps the
11
+ * format portable so prefs can be exported, copied across environments,
12
+ * or backed up to a server store later without rewriting call sites.
13
+ *
14
+ * Helpers `getPreferencesSnapshot()` / `applyPreferencesSnapshot()`
15
+ * below give a single-call dump and restore for that bundle, which is
16
+ * the natural shape to send over the network.
17
+ */
18
+ /** Stable, user-facing namespace for all cross-page preferences. */
19
+ export declare const PREFS_KEYS: {
20
+ /** Run-config: agent the user wants to RUN (QuickRunModal, NewRunPage). */
21
+ readonly agentKey: "prefs:agentKey";
22
+ /** Run-config: model the user wants to RUN (QuickRunModal, NewRunPage). */
23
+ readonly modelId: "prefs:modelId";
24
+ /** Time-range filter, shared by evaluation list pages and Agent Traces. */
25
+ readonly timeRange: "prefs:timeRange";
26
+ /** Agent filter dropdown shared by Benchmarks and Eval Runs. Defaults to `'all'`. */
27
+ readonly agentFilter: "prefs:agentFilter";
28
+ /** Benchmark filter dropdown shared by Test Cases (and any future page). */
29
+ readonly benchmarkFilter: "prefs:benchmarkFilter";
30
+ /** Flat / grouped view mode shared by list pages. */
31
+ readonly viewMode: "prefs:viewMode";
32
+ };
33
+ /** Possible string values for {@link PREFS_KEYS.timeRange}. */
34
+ export type SharedTimeRange = '1h' | '6h' | '1d' | '7d' | '30d' | 'all';
35
+ /**
36
+ * Convert a {@link SharedTimeRange} to a "minutes ago" cutoff suitable
37
+ * for the AgentTraces query. `'all'` is mapped to a very large window
38
+ * (90d) so that there's always *some* finite cutoff sent to the server.
39
+ */
40
+ export declare function sharedTimeRangeToMinutes(range: SharedTimeRange): number;
41
+ /**
42
+ * Return a portable snapshot of every cross-page preference currently
43
+ * stored in localStorage. Keys are the unprefixed identifiers (e.g.
44
+ * `'prefs:timeRange'`) and values are already JSON-decoded.
45
+ *
46
+ * Use this to copy a user's preferences to clipboard, persist them
47
+ * server-side, or assert against them in tests.
48
+ */
49
+ export declare function getPreferencesSnapshot(): Record<string, unknown>;
50
+ /**
51
+ * Apply a snapshot produced by {@link getPreferencesSnapshot}.
52
+ * Unknown keys are ignored so the snapshot format stays forward-
53
+ * compatible with future preferences. Pass an empty object to clear
54
+ * every preference (sets nothing — call {@link clearPreferences} for
55
+ * an explicit reset).
56
+ */
57
+ export declare function applyPreferencesSnapshot(snapshot: Record<string, unknown>): void;
58
+ /**
59
+ * Remove every preference from localStorage. Useful for "Reset
60
+ * preferences" buttons and tests.
61
+ */
62
+ export declare function clearPreferences(): void;
63
+ //# sourceMappingURL=preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../preferences.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AAEH,oEAAoE;AACpE,eAAO,MAAM,UAAU;IACrB,2EAA2E;;IAE3E,2EAA2E;;IAE3E,2EAA2E;;IAE3E,qFAAqF;;IAErF,4EAA4E;;IAE5E,qDAAqD;;CAE7C,CAAC;AAEX,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CASvE;AAID;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAchE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAWhF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CASvC"}
@@ -0,0 +1,117 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /**
6
+ * Cross-page user preferences.
7
+ *
8
+ * Each entry below is a single localStorage key (under the
9
+ * `agent-health:` prefix) shared by every page that exposes the
10
+ * corresponding control, so e.g. picking "30d" on the Eval Runs page is
11
+ * also reflected on Benchmarks and Test Cases.
12
+ *
13
+ * Storage layout is intentionally a flat, JSON-serialisable key/value
14
+ * map: each preference is its own localStorage entry. That keeps the
15
+ * format portable so prefs can be exported, copied across environments,
16
+ * or backed up to a server store later without rewriting call sites.
17
+ *
18
+ * Helpers `getPreferencesSnapshot()` / `applyPreferencesSnapshot()`
19
+ * below give a single-call dump and restore for that bundle, which is
20
+ * the natural shape to send over the network.
21
+ */
22
+ /** Stable, user-facing namespace for all cross-page preferences. */
23
+ export const PREFS_KEYS = {
24
+ /** Run-config: agent the user wants to RUN (QuickRunModal, NewRunPage). */
25
+ agentKey: 'prefs:agentKey',
26
+ /** Run-config: model the user wants to RUN (QuickRunModal, NewRunPage). */
27
+ modelId: 'prefs:modelId',
28
+ /** Time-range filter, shared by evaluation list pages and Agent Traces. */
29
+ timeRange: 'prefs:timeRange',
30
+ /** Agent filter dropdown shared by Benchmarks and Eval Runs. Defaults to `'all'`. */
31
+ agentFilter: 'prefs:agentFilter',
32
+ /** Benchmark filter dropdown shared by Test Cases (and any future page). */
33
+ benchmarkFilter: 'prefs:benchmarkFilter',
34
+ /** Flat / grouped view mode shared by list pages. */
35
+ viewMode: 'prefs:viewMode',
36
+ };
37
+ /**
38
+ * Convert a {@link SharedTimeRange} to a "minutes ago" cutoff suitable
39
+ * for the AgentTraces query. `'all'` is mapped to a very large window
40
+ * (90d) so that there's always *some* finite cutoff sent to the server.
41
+ */
42
+ export function sharedTimeRangeToMinutes(range) {
43
+ switch (range) {
44
+ case '1h': return 60;
45
+ case '6h': return 360;
46
+ case '1d': return 1440;
47
+ case '7d': return 10080;
48
+ case '30d': return 43200;
49
+ case 'all': return 60 * 24 * 90; // 90 days as a practical "all"
50
+ }
51
+ }
52
+ const STORAGE_PREFIX = 'agent-health:';
53
+ /**
54
+ * Return a portable snapshot of every cross-page preference currently
55
+ * stored in localStorage. Keys are the unprefixed identifiers (e.g.
56
+ * `'prefs:timeRange'`) and values are already JSON-decoded.
57
+ *
58
+ * Use this to copy a user's preferences to clipboard, persist them
59
+ * server-side, or assert against them in tests.
60
+ */
61
+ export function getPreferencesSnapshot() {
62
+ if (typeof window === 'undefined')
63
+ return {};
64
+ const out = {};
65
+ for (const key of Object.values(PREFS_KEYS)) {
66
+ try {
67
+ const raw = localStorage.getItem(STORAGE_PREFIX + key);
68
+ if (raw === null)
69
+ continue;
70
+ out[key] = JSON.parse(raw);
71
+ }
72
+ catch {
73
+ // Skip entries we can't decode; the caller will treat them as
74
+ // missing and the corresponding page will fall back to its default.
75
+ }
76
+ }
77
+ return out;
78
+ }
79
+ /**
80
+ * Apply a snapshot produced by {@link getPreferencesSnapshot}.
81
+ * Unknown keys are ignored so the snapshot format stays forward-
82
+ * compatible with future preferences. Pass an empty object to clear
83
+ * every preference (sets nothing — call {@link clearPreferences} for
84
+ * an explicit reset).
85
+ */
86
+ export function applyPreferencesSnapshot(snapshot) {
87
+ if (typeof window === 'undefined')
88
+ return;
89
+ const known = new Set(Object.values(PREFS_KEYS));
90
+ for (const [key, value] of Object.entries(snapshot)) {
91
+ if (!known.has(key))
92
+ continue;
93
+ try {
94
+ localStorage.setItem(STORAGE_PREFIX + key, JSON.stringify(value));
95
+ }
96
+ catch {
97
+ // Quota / storage disabled — ignore.
98
+ }
99
+ }
100
+ }
101
+ /**
102
+ * Remove every preference from localStorage. Useful for "Reset
103
+ * preferences" buttons and tests.
104
+ */
105
+ export function clearPreferences() {
106
+ if (typeof window === 'undefined')
107
+ return;
108
+ for (const key of Object.values(PREFS_KEYS)) {
109
+ try {
110
+ localStorage.removeItem(STORAGE_PREFIX + key);
111
+ }
112
+ catch {
113
+ // ignore
114
+ }
115
+ }
116
+ }
117
+ //# sourceMappingURL=preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../preferences.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH,oEAAoE;AACpE,MAAM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;YACP,8DAA8D;YAC9D,oEAAoE;QACtE,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAiC;IACxE,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACzD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC9B,IAAI,CAAC;YACH,YAAY,CAAC,OAAO,CAAC,cAAc,GAAG,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACpE,CAAC;QAAC,MAAM,CAAC;YACP,qCAAqC;QACvC,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC;YACH,YAAY,CAAC,UAAU,CAAC,cAAc,GAAG,GAAG,CAAC,CAAC;QAChD,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { AgentConfig } from '../types/index.js';
2
+ /**
3
+ * Resolve the LLM an agent runs on.
4
+ *
5
+ * The agent's model is owned by the agent's OWN config (`agent-health.config.ts`),
6
+ * NOT a user-facing "agent model" selector. There is intentionally no run-level
7
+ * or UI/CLI way to override it — picking a model separately from the agent is a
8
+ * leaky abstraction (subprocess agents like Claude Code / pi ignore it and run
9
+ * on whatever their connector is configured with). Claude-like agents that DO
10
+ * accept a model take it via their connector config.
11
+ *
12
+ * Resolution order (all from the agent's `connectorConfig`):
13
+ * 1. `connectorConfig.model` — pi / streaming / openai-compatible
14
+ * 2. `connectorConfig.env.ANTHROPIC_MODEL` — claude-code
15
+ * 3. `connectorConfig.args` `--model <id>` — any subprocess agent passing a flag
16
+ *
17
+ * `fallback` exists only for backward compatibility with runs/agents created
18
+ * before the agent-model concept was removed (where the run carried a
19
+ * user-selected `modelId`). New code should not rely on it.
20
+ */
21
+ export declare function resolveAgentModel(agent: AgentConfig | undefined | null, fallback?: string): string;
22
+ //# sourceMappingURL=resolveAgentModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveAgentModel.d.ts","sourceRoot":"","sources":["../../resolveAgentModel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,EACrC,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAWR"}
@@ -0,0 +1,37 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright OpenSearch Contributors
3
+ /**
4
+ * Resolve the LLM an agent runs on.
5
+ *
6
+ * The agent's model is owned by the agent's OWN config (`agent-health.config.ts`),
7
+ * NOT a user-facing "agent model" selector. There is intentionally no run-level
8
+ * or UI/CLI way to override it — picking a model separately from the agent is a
9
+ * leaky abstraction (subprocess agents like Claude Code / pi ignore it and run
10
+ * on whatever their connector is configured with). Claude-like agents that DO
11
+ * accept a model take it via their connector config.
12
+ *
13
+ * Resolution order (all from the agent's `connectorConfig`):
14
+ * 1. `connectorConfig.model` — pi / streaming / openai-compatible
15
+ * 2. `connectorConfig.env.ANTHROPIC_MODEL` — claude-code
16
+ * 3. `connectorConfig.args` `--model <id>` — any subprocess agent passing a flag
17
+ *
18
+ * `fallback` exists only for backward compatibility with runs/agents created
19
+ * before the agent-model concept was removed (where the run carried a
20
+ * user-selected `modelId`). New code should not rely on it.
21
+ */
22
+ export function resolveAgentModel(agent, fallback) {
23
+ const cc = (agent?.connectorConfig || {});
24
+ if (typeof cc.model === 'string' && cc.model)
25
+ return cc.model;
26
+ const envModel = cc.env?.ANTHROPIC_MODEL;
27
+ if (typeof envModel === 'string' && envModel)
28
+ return envModel;
29
+ const args = cc.args;
30
+ if (Array.isArray(args)) {
31
+ const i = args.indexOf('--model');
32
+ if (i >= 0 && typeof args[i + 1] === 'string' && args[i + 1])
33
+ return args[i + 1];
34
+ }
35
+ return fallback || '';
36
+ }
37
+ //# sourceMappingURL=resolveAgentModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveAgentModel.js","sourceRoot":"","sources":["../../resolveAgentModel.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oCAAoC;AAIpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAqC,EACrC,QAAiB;IAEjB,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,eAAe,IAAI,EAAE,CAAwB,CAAC;IACjE,IAAI,OAAO,EAAE,CAAC,KAAK,KAAK,QAAQ,IAAI,EAAE,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC,KAAK,CAAC;IAC9D,MAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC;IACzC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9D,MAAM,IAAI,GAAY,EAAE,CAAC,IAAI,CAAC;IAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAW,CAAC;IAC7F,CAAC;IACD,OAAO,QAAQ,IAAI,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Shared Run Statistics Calculation
3
+ *
4
+ * This module provides shared logic for calculating benchmark run statistics.
5
+ * Both UI and CLI use these functions to ensure consistent pass/fail counting.
6
+ *
7
+ * The canonical approach is:
8
+ * 1. Get report IDs from run.results[testCaseId].reportId
9
+ * 2. Fetch each report by ID
10
+ * 3. Count passFailStatus from the fetched reports
11
+ *
12
+ * For performance optimization, stats are denormalized onto BenchmarkRun.stats
13
+ * and updated incrementally as test cases complete.
14
+ */
15
+ import type { BenchmarkRun, EvaluationReport, RunStats as RunStatsType } from '../types/index.js';
16
+ /**
17
+ * Statistics for a benchmark run
18
+ */
19
+ export interface RunStats {
20
+ /** Number of test cases that passed (passFailStatus === 'passed') */
21
+ passed: number;
22
+ /** Number of test cases that failed (passFailStatus === 'failed' or execution failed) */
23
+ failed: number;
24
+ /** Number of test cases still pending (running, or report not yet available) */
25
+ pending: number;
26
+ /**
27
+ * Number of test cases where the *evaluator* could not produce a verdict
28
+ * (judge validation error, trace timeout, etc.). Excluded from passed and
29
+ * failed counts so a misconfigured evaluator doesn't poison aggregate
30
+ * pass rates. Issue #242.
31
+ */
32
+ errored: number;
33
+ /** Total number of test cases in the run */
34
+ total: number;
35
+ /**
36
+ * Pass rate as a percentage (0-100). Computed over `total - errored`
37
+ * (the *evaluable* set), not over `total`, so a non-retryable judge
38
+ * failure can't masquerade as the agent scoring 0%.
39
+ */
40
+ passRate: number;
41
+ }
42
+ /**
43
+ * Bucket a run's per-test-case results into passed/failed/errored/pending using
44
+ * ONLY the persisted result fields (status + passFailStatus) — no reports
45
+ * needed. This is the SINGLE source of truth for pass/fail/errored counts across
46
+ * the app (the runs list AND the comparison page), so the numbers can't
47
+ * diverge between views.
48
+ *
49
+ * The denormalized `run.stats` is NOT authoritative: its writer historically
50
+ * counted every 'completed' result as passed without checking the verdict, so
51
+ * an errored case (judge produced no verdict) was miscounted as a pass and
52
+ * `errored` was never tracked. Recompute from results instead.
53
+ *
54
+ * Errored (#242): a 'completed' result with no 'passed'/'failed' verdict means
55
+ * the evaluator couldn't produce one (judge validation error, trace timeout).
56
+ * Excluded from passed/failed — exactly as calculateRunStats does via the
57
+ * report's metricsStatus.
58
+ */
59
+ export declare function bucketRunResults(results: Record<string, {
60
+ status?: string;
61
+ passFailStatus?: string;
62
+ }> | undefined): Pick<RunStats, 'passed' | 'failed' | 'errored' | 'pending' | 'total'>;
63
+ /**
64
+ * Calculate statistics for a benchmark run.
65
+ *
66
+ * This function uses the same logic as the UI to count pass/fail status:
67
+ * - Iterates over run.results to get reportIds
68
+ * - Looks up each report in the provided reports map
69
+ * - Counts passFailStatus from completed reports
70
+ *
71
+ * @param run - The benchmark run to calculate stats for
72
+ * @param reports - Map of reportId -> EvaluationReport (pre-fetched)
73
+ * @returns Calculated statistics including passed, failed, pending, total, and passRate
74
+ */
75
+ export declare function calculateRunStats(run: BenchmarkRun, reports: Record<string, EvaluationReport | null>): RunStats;
76
+ /**
77
+ * Extract all report IDs from a run's results that need to be fetched.
78
+ *
79
+ * @param run - The benchmark run to extract report IDs from
80
+ * @returns Array of unique report IDs
81
+ */
82
+ export declare function getReportIdsFromRun(run: BenchmarkRun): string[];
83
+ /**
84
+ * Compute stats from a benchmark run and its reports.
85
+ * This is the server-side version that returns the denormalized stats object.
86
+ *
87
+ * @param run - The benchmark run to compute stats for
88
+ * @param reports - Array of reports for this run
89
+ * @returns Denormalized stats object (passed, failed, pending, total)
90
+ */
91
+ export declare function computeRunStatsFromReports(run: BenchmarkRun, reports: EvaluationReport[]): RunStatsType;
92
+ //# sourceMappingURL=runStats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runStats.d.ts","sourceRoot":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's per-test-case results into passed/failed/errored/pending using
7
+ * ONLY the persisted result fields (status + passFailStatus) — no reports
8
+ * needed. This is the SINGLE source of truth for pass/fail/errored counts across
9
+ * the app (the runs list AND the comparison page), so the numbers can't
10
+ * diverge between views.
11
+ *
12
+ * The denormalized `run.stats` is NOT authoritative: its writer historically
13
+ * counted every 'completed' result as passed without checking the verdict, so
14
+ * an errored case (judge produced no verdict) was miscounted as a pass and
15
+ * `errored` was never tracked. Recompute from results instead.
16
+ *
17
+ * Errored (#242): a 'completed' result with no 'passed'/'failed' verdict means
18
+ * the evaluator couldn't produce one (judge validation error, trace timeout).
19
+ * Excluded from passed/failed — exactly as calculateRunStats does via the
20
+ * report's metricsStatus.
21
+ */
22
+ export function bucketRunResults(results) {
23
+ let passed = 0, failed = 0, errored = 0, pending = 0, total = 0;
24
+ for (const r of Object.values(results || {})) {
25
+ total++;
26
+ if (r.status === 'pending' || r.status === 'running') {
27
+ pending++;
28
+ continue;
29
+ }
30
+ if (r.status === 'failed' || r.status === 'cancelled') {
31
+ failed++;
32
+ continue;
33
+ }
34
+ if (r.status === 'completed') {
35
+ if (r.passFailStatus === 'passed')
36
+ passed++;
37
+ else if (r.passFailStatus === 'failed')
38
+ failed++;
39
+ else
40
+ errored++; // completed without a verdict = judge errored (#242)
41
+ continue;
42
+ }
43
+ pending++; // unknown / no status
44
+ }
45
+ return { passed, failed, errored, pending, total };
46
+ }
47
+ /**
48
+ * Calculate statistics for a benchmark run.
49
+ *
50
+ * This function uses the same logic as the UI to count pass/fail status:
51
+ * - Iterates over run.results to get reportIds
52
+ * - Looks up each report in the provided reports map
53
+ * - Counts passFailStatus from completed reports
54
+ *
55
+ * @param run - The benchmark run to calculate stats for
56
+ * @param reports - Map of reportId -> EvaluationReport (pre-fetched)
57
+ * @returns Calculated statistics including passed, failed, pending, total, and passRate
58
+ */
59
+ export function calculateRunStats(run, reports) {
60
+ let passed = 0;
61
+ let failed = 0;
62
+ let pending = 0;
63
+ let errored = 0;
64
+ let total = 0;
65
+ Object.entries(run.results || {}).forEach(([testCaseId, result]) => {
66
+ total++;
67
+ // Check result status first
68
+ if (result.status === 'pending' || result.status === 'running') {
69
+ pending++;
70
+ return;
71
+ }
72
+ if (result.status === 'failed' || result.status === 'cancelled') {
73
+ failed++;
74
+ return;
75
+ }
76
+ // For completed results, check the report's passFailStatus
77
+ if (result.status === 'completed' && result.reportId) {
78
+ const report = reports[result.reportId];
79
+ if (!report) {
80
+ // Report not loaded yet or doesn't exist
81
+ pending++;
82
+ return;
83
+ }
84
+ // Check if evaluation is still pending (trace mode)
85
+ if (report.metricsStatus === 'pending' || report.metricsStatus === 'calculating') {
86
+ pending++;
87
+ return;
88
+ }
89
+ // Issue #242: evaluator could not produce a verdict (judge validation
90
+ // error, trace timeout, etc.). Excluded from passed/failed so
91
+ // misconfigured evaluators don't masquerade as agent failures.
92
+ if (report.metricsStatus === 'error') {
93
+ errored++;
94
+ return;
95
+ }
96
+ // Count based on passFailStatus from LLM judge
97
+ if (report.passFailStatus === 'passed') {
98
+ passed++;
99
+ }
100
+ else {
101
+ // passFailStatus === 'failed' or undefined (treat as failed)
102
+ failed++;
103
+ }
104
+ }
105
+ else {
106
+ // No reportId but status is completed - treat as pending
107
+ pending++;
108
+ }
109
+ });
110
+ // Pass rate is computed over the evaluable set (total minus errored).
111
+ // If every run errored, expose 0% rather than dividing by zero.
112
+ const evaluable = Math.max(0, total - errored);
113
+ const passRate = evaluable > 0 ? Math.round((passed / evaluable) * 100) : 0;
114
+ return {
115
+ passed,
116
+ failed,
117
+ pending,
118
+ errored,
119
+ total,
120
+ passRate,
121
+ };
122
+ }
123
+ /**
124
+ * Extract all report IDs from a run's results that need to be fetched.
125
+ *
126
+ * @param run - The benchmark run to extract report IDs from
127
+ * @returns Array of unique report IDs
128
+ */
129
+ export function getReportIdsFromRun(run) {
130
+ const reportIds = new Set();
131
+ Object.values(run.results || {}).forEach((result) => {
132
+ if (result.reportId) {
133
+ reportIds.add(result.reportId);
134
+ }
135
+ });
136
+ return Array.from(reportIds);
137
+ }
138
+ /**
139
+ * Compute stats from a benchmark run and its reports.
140
+ * This is the server-side version that returns the denormalized stats object.
141
+ *
142
+ * @param run - The benchmark run to compute stats for
143
+ * @param reports - Array of reports for this run
144
+ * @returns Denormalized stats object (passed, failed, pending, total)
145
+ */
146
+ export function computeRunStatsFromReports(run, reports) {
147
+ const reportsMap = {};
148
+ reports.forEach(report => {
149
+ reportsMap[report.id] = report;
150
+ });
151
+ const fullStats = calculateRunStats(run, reportsMap);
152
+ return {
153
+ passed: fullStats.passed,
154
+ failed: fullStats.failed,
155
+ pending: fullStats.pending,
156
+ errored: fullStats.errored,
157
+ total: fullStats.total,
158
+ };
159
+ }
160
+ //# sourceMappingURL=runStats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runStats.js","sourceRoot":"","sources":["../../runStats.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8CH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAiF;IAEjF,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC;IAChE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAAC,OAAO,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QAC9E,IAAI,CAAC,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YAAC,MAAM,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QAC9E,IAAI,CAAC,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YAC7B,IAAI,C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AAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CACxC,GAAiB,EACjB,OAA2B;IAE3B,MAAM,UAAU,GAA4C,EAAE,CAAC;IAC/D,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAErD,OAAO;QACL,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,KAAK,EAAE,SAAS,CAAC,KAAK;KACvB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * OTel Semantic Convention constants for evaluation telemetry.
3
+ *
4
+ * In-spec attributes are re-exported from @opentelemetry/semantic-conventions.
5
+ * Proposed and extension attributes are defined here as string constants.
6
+ */
7
+ export { ATTR_TEST_SUITE_NAME, ATTR_TEST_SUITE_RUN_STATUS, ATTR_TEST_CASE_NAME, ATTR_TEST_CASE_RESULT_STATUS, TEST_SUITE_RUN_STATUS_VALUE_SUCCESS, TEST_SUITE_RUN_STATUS_VALUE_FAILURE, TEST_SUITE_RUN_STATUS_VALUE_IN_PROGRESS, TEST_CASE_RESULT_STATUS_VALUE_PASS, TEST_CASE_RESULT_STATUS_VALUE_FAIL, ATTR_GEN_AI_OPERATION_NAME, ATTR_GEN_AI_EVALUATION_NAME, ATTR_GEN_AI_EVALUATION_SCORE_VALUE, ATTR_GEN_AI_EVALUATION_SCORE_LABEL, ATTR_GEN_AI_EVALUATION_EXPLANATION, EVENT_GEN_AI_EVALUATION_RESULT, } from '@opentelemetry/semantic-conventions/incubating';
8
+ /** Unique identifier for a specific test suite run */
9
+ export declare const ATTR_TEST_SUITE_RUN_ID: "test.suite.run.id";
10
+ /** Machine-readable unique identifier for a test case */
11
+ export declare const ATTR_TEST_CASE_ID: "test.case.id";
12
+ /** Test case input (prompt) */
13
+ export declare const ATTR_TEST_CASE_INPUT: "test.case.input";
14
+ /** Test case output (agent response) */
15
+ export declare const ATTR_TEST_CASE_OUTPUT: "test.case.output";
16
+ /** Test case expected outcome */
17
+ export declare const ATTR_TEST_CASE_EXPECTED: "test.case.expected";
18
+ /** Model ID used by the LLM judge */
19
+ export declare const ATTR_AGENT_HEALTH_JUDGE_MODEL_ID: "agent_health.judge.model_id";
20
+ /** Time spent in LLM judge evaluation (ms) */
21
+ export declare const ATTR_AGENT_HEALTH_JUDGE_DURATION_MS: "agent_health.judge.duration_ms";
22
+ /** Number of retry attempts for the LLM judge */
23
+ export declare const ATTR_AGENT_HEALTH_JUDGE_ATTEMPTS: "agent_health.judge.attempts";
24
+ /** Time spent in agent execution (ms) */
25
+ export declare const ATTR_AGENT_HEALTH_AGENT_DURATION_MS: "agent_health.agent.duration_ms";
26
+ /** Connector protocol used for agent communication */
27
+ export declare const ATTR_AGENT_HEALTH_CONNECTOR_PROTOCOL: "agent_health.connector.protocol";
28
+ /**
29
+ * Agent run ID — links eval spans to the agent execution trace (Strategy B).
30
+ *
31
+ * Uses Agent Health's own namespace rather than the OpenTelemetry-reserved
32
+ * `gen_ai.*` namespace: `gen_ai.request.id` is not a registered semantic
33
+ * convention attribute (the `gen_ai.request.*` namespace is for request
34
+ * parameters), and the OTEL naming spec advises against adding app-specific
35
+ * keys under an existing OTEL namespace. W3C trace context (shared traceId,
36
+ * Strategy A) remains the primary correlation; this attribute is the loose
37
+ * link for agents that don't propagate context.
38
+ */
39
+ export declare const ATTR_AGENT_HEALTH_AGENT_RUN_ID: "agent_health.run.id";
40
+ /** Operation name value for evaluation spans */
41
+ export declare const GEN_AI_OPERATION_NAME_VALUE_EVALUATION: "evaluation";
42
+ /**
43
+ * OTEL-registered (incubating) conversation/session identifier —
44
+ * `gen_ai.conversation.id` (model/gen-ai/registry.yaml): "the unique
45
+ * identifier for a conversation (session, thread), used to store and correlate
46
+ * messages within this conversation." We stamp this (= the agent run id) on our
47
+ * eval + sample-agent spans so trace queries can correlate on the OTEL-standard
48
+ * attribute in addition to our own `agent_health.run.id`. Declared as a string
49
+ * literal (rather than re-exported from the incubating module) so it's stable
50
+ * regardless of semantic-conventions packaging. See AGENTS.md → Trace
51
+ * correlation conventions.
52
+ */
53
+ export declare const ATTR_GEN_AI_CONVERSATION_ID: "gen_ai.conversation.id";
54
+ /** Maximum length for truncated attribute values */
55
+ export declare const MAX_ATTRIBUTE_LENGTH = 10000;
56
+ /** Maximum length for judge explanation in events */
57
+ export declare const MAX_EXPLANATION_LENGTH = 4000;
58
+ /** Tracer name used for evaluation spans */
59
+ export declare const EVAL_TRACER_NAME = "agent-health-eval";
60
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../telemetry/constants.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AAOH,OAAO,EAEL,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,mCAAmC,EACnC,mCAAmC,EACnC,uCAAuC,EACvC,kCAAkC,EAClC,kCAAkC,EAGlC,0BAA0B,EAC1B,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC,EAGlC,8BAA8B,GAC/B,MAAM,gDAAgD,CAAC;AAOxD,sDAAsD;AACtD,eAAO,MAAM,sBAAsB,EAAG,mBAA4B,CAAC;AAEnE,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,EAAG,c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