@opensearch-project/agent-health 0.4.0 → 0.6.0

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 (551) hide show
  1. package/README.md +36 -5
  2. package/cli/dist/index.js +8292 -2938
  3. package/deployment/cloudformation/agent-health-observability.yaml +223 -32
  4. package/dist/assets/index-BfxtxmKc.css +1 -0
  5. package/dist/assets/index-CrjAfDHu.js +243 -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 +474 -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 +397 -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 +626 -0
  22. package/docs/SKILLS.md +264 -0
  23. package/docs/STORAGE_INDEX_FIELD_LIMITS.md +216 -0
  24. package/docs/blogs/2026-02-28-opensearch-agent-health.md +200 -0
  25. package/docs/blogs/getting-started-blog.md +608 -0
  26. package/docs/diagrams/Agent-health.excalidraw +5656 -0
  27. package/docs/diagrams/architecture.png +0 -0
  28. package/docs/plans/field-redesign.md +468 -0
  29. package/docs/rfcs/001-coding-agent-analytics.md +374 -0
  30. package/docs/rfcs/002-enterprise-leaderboard.md +267 -0
  31. package/docs/rfcs/003-remote-aggregation.md +146 -0
  32. package/docs/rfcs/004-test-sdk-v2.md +599 -0
  33. package/docs/skills/AGENT_HEALTH.md +652 -0
  34. package/docs/skills/AGENT_PROFILE.md +191 -0
  35. package/docs/skills/add-connector/SKILL.md +68 -0
  36. package/docs/skills/agent-health-profile/SKILL.md +40 -0
  37. package/docs/skills/config-auth/SKILL.md +194 -0
  38. package/docs/skills/config-auth/evals/evals.json +35 -0
  39. package/docs/skills/create-pr/SKILL.md +73 -0
  40. package/docs/skills/instrument-otel/SKILL.md +84 -0
  41. package/docs/skills/write-test/SKILL.md +124 -0
  42. package/docs/ui prd.md +376 -0
  43. package/examples/README.md +53 -0
  44. package/examples/config/agent-health.config.example.ts +155 -0
  45. package/examples/connectors/echo-connector.ts +131 -0
  46. package/examples/eval-files/demo.eval.js +128 -0
  47. package/examples/eval-files/ops-rca-classification.eval.js +71 -0
  48. package/examples/eval-files/ops-rca-evaluator.json +15 -0
  49. package/examples/eval-files/sdk-demo.eval.js +72 -0
  50. package/examples/eval-files/sdk-describe-demo.eval.js +50 -0
  51. package/examples/eval-files/sdk-hooks-demo.eval.js +99 -0
  52. package/examples/pi-profiling/README.md +77 -0
  53. package/examples/pi-profiling/agent-health-profile.ts +417 -0
  54. package/lib/dist/lib/agentUtils.d.ts +29 -0
  55. package/lib/dist/lib/agentUtils.d.ts.map +1 -0
  56. package/lib/dist/lib/agentUtils.js +43 -0
  57. package/lib/dist/lib/agentUtils.js.map +1 -0
  58. package/lib/dist/lib/bedrockCompat.d.ts +27 -0
  59. package/lib/dist/lib/bedrockCompat.d.ts.map +1 -0
  60. package/lib/dist/lib/bedrockCompat.js +83 -0
  61. package/lib/dist/lib/bedrockCompat.js.map +1 -0
  62. package/lib/dist/lib/benchmarkExport.d.ts +14 -0
  63. package/lib/dist/lib/benchmarkExport.d.ts.map +1 -0
  64. package/lib/dist/lib/benchmarkExport.js +41 -0
  65. package/lib/dist/lib/benchmarkExport.js.map +1 -0
  66. package/lib/dist/lib/benchmarkImage.d.ts +52 -0
  67. package/lib/dist/lib/benchmarkImage.d.ts.map +1 -0
  68. package/lib/dist/lib/benchmarkImage.js +113 -0
  69. package/lib/dist/lib/benchmarkImage.js.map +1 -0
  70. package/lib/dist/lib/benchmarkVersionUtils.d.ts +50 -0
  71. package/lib/dist/lib/benchmarkVersionUtils.d.ts.map +1 -0
  72. package/lib/dist/lib/benchmarkVersionUtils.js +89 -0
  73. package/lib/dist/lib/benchmarkVersionUtils.js.map +1 -0
  74. package/lib/dist/lib/chunkedFetch.d.ts +18 -0
  75. package/lib/dist/lib/chunkedFetch.d.ts.map +1 -0
  76. package/lib/dist/lib/chunkedFetch.js +40 -0
  77. package/lib/dist/lib/chunkedFetch.js.map +1 -0
  78. package/lib/dist/lib/comparisonInsights.d.ts +104 -0
  79. package/lib/dist/lib/comparisonInsights.d.ts.map +1 -0
  80. package/lib/dist/lib/comparisonInsights.js +212 -0
  81. package/lib/dist/lib/comparisonInsights.js.map +1 -0
  82. package/lib/dist/lib/config/defineConfig.d.ts +27 -0
  83. package/lib/dist/lib/config/defineConfig.d.ts.map +1 -0
  84. package/lib/dist/lib/config/defineConfig.js +28 -0
  85. package/lib/dist/lib/config/defineConfig.js.map +1 -0
  86. package/lib/dist/lib/config/index.d.ts +9 -0
  87. package/lib/dist/lib/config/index.d.ts.map +1 -0
  88. package/lib/dist/lib/config/index.js +8 -0
  89. package/lib/dist/lib/config/index.js.map +1 -0
  90. package/lib/dist/lib/config/loader.d.ts +39 -0
  91. package/lib/dist/lib/config/loader.d.ts.map +1 -0
  92. package/lib/dist/lib/config/loader.js +263 -0
  93. package/lib/dist/lib/config/loader.js.map +1 -0
  94. package/lib/dist/lib/config/statePaths.d.ts +61 -0
  95. package/lib/dist/lib/config/statePaths.d.ts.map +1 -0
  96. package/lib/dist/lib/config/statePaths.js +188 -0
  97. package/lib/dist/lib/config/statePaths.js.map +1 -0
  98. package/lib/dist/lib/config/types.d.ts +245 -0
  99. package/lib/dist/lib/config/types.d.ts.map +1 -0
  100. package/lib/dist/lib/config/types.js +6 -0
  101. package/lib/dist/lib/config/types.js.map +1 -0
  102. package/lib/dist/lib/config.d.ts +39 -0
  103. package/lib/dist/lib/config.d.ts.map +1 -0
  104. package/lib/dist/lib/config.js +118 -0
  105. package/lib/dist/lib/config.js.map +1 -0
  106. package/lib/dist/lib/constants.d.ts +81 -0
  107. package/lib/dist/lib/constants.d.ts.map +1 -0
  108. package/lib/dist/lib/constants.js +374 -0
  109. package/lib/dist/lib/constants.js.map +1 -0
  110. package/lib/dist/lib/contextFormat.d.ts +26 -0
  111. package/lib/dist/lib/contextFormat.d.ts.map +1 -0
  112. package/lib/dist/lib/contextFormat.js +28 -0
  113. package/lib/dist/lib/contextFormat.js.map +1 -0
  114. package/lib/dist/lib/contextUtilization.d.ts +23 -0
  115. package/lib/dist/lib/contextUtilization.d.ts.map +1 -0
  116. package/lib/dist/lib/contextUtilization.js +72 -0
  117. package/lib/dist/lib/contextUtilization.js.map +1 -0
  118. package/lib/dist/lib/dashboardMetrics.d.ts +87 -0
  119. package/lib/dist/lib/dashboardMetrics.d.ts.map +1 -0
  120. package/lib/dist/lib/dashboardMetrics.js +242 -0
  121. package/lib/dist/lib/dashboardMetrics.js.map +1 -0
  122. package/lib/dist/lib/dataSourceConfig.d.ts +108 -0
  123. package/lib/dist/lib/dataSourceConfig.d.ts.map +1 -0
  124. package/lib/dist/lib/dataSourceConfig.js +166 -0
  125. package/lib/dist/lib/dataSourceConfig.js.map +1 -0
  126. package/lib/dist/lib/debug.d.ts +26 -0
  127. package/lib/dist/lib/debug.d.ts.map +1 -0
  128. package/lib/dist/lib/debug.js +132 -0
  129. package/lib/dist/lib/debug.js.map +1 -0
  130. package/lib/dist/lib/diagnostics.d.ts +28 -0
  131. package/lib/dist/lib/diagnostics.d.ts.map +1 -0
  132. package/lib/dist/lib/diagnostics.js +65 -0
  133. package/lib/dist/lib/diagnostics.js.map +1 -0
  134. package/lib/dist/lib/envCompat.d.ts +27 -0
  135. package/lib/dist/lib/envCompat.d.ts.map +1 -0
  136. package/lib/dist/lib/envCompat.js +82 -0
  137. package/lib/dist/lib/envCompat.js.map +1 -0
  138. package/lib/dist/lib/evaluationRerun.d.ts +63 -0
  139. package/lib/dist/lib/evaluationRerun.d.ts.map +1 -0
  140. package/lib/dist/lib/evaluationRerun.js +85 -0
  141. package/lib/dist/lib/evaluationRerun.js.map +1 -0
  142. package/lib/dist/lib/findPackageRoot.d.ts +7 -0
  143. package/lib/dist/lib/findPackageRoot.d.ts.map +1 -0
  144. package/lib/dist/lib/findPackageRoot.js +57 -0
  145. package/lib/dist/lib/findPackageRoot.js.map +1 -0
  146. package/lib/dist/lib/hooks.d.ts +36 -0
  147. package/lib/dist/lib/hooks.d.ts.map +1 -0
  148. package/lib/dist/lib/hooks.js +112 -0
  149. package/lib/dist/lib/hooks.js.map +1 -0
  150. package/lib/dist/lib/index.d.ts +47 -0
  151. package/lib/dist/lib/index.d.ts.map +1 -0
  152. package/lib/dist/lib/index.js +62 -0
  153. package/lib/dist/lib/index.js.map +1 -0
  154. package/lib/dist/lib/labels.d.ts +90 -0
  155. package/lib/dist/lib/labels.d.ts.map +1 -0
  156. package/lib/dist/lib/labels.js +158 -0
  157. package/lib/dist/lib/labels.js.map +1 -0
  158. package/lib/dist/lib/markdown.d.ts +16 -0
  159. package/lib/dist/lib/markdown.d.ts.map +1 -0
  160. package/lib/dist/lib/markdown.js +42 -0
  161. package/lib/dist/lib/markdown.js.map +1 -0
  162. package/lib/dist/lib/matchers/expect.d.ts +3 -0
  163. package/lib/dist/lib/matchers/expect.d.ts.map +1 -0
  164. package/lib/dist/lib/matchers/expect.js +225 -0
  165. package/lib/dist/lib/matchers/expect.js.map +1 -0
  166. package/lib/dist/lib/matchers/index.d.ts +8 -0
  167. package/lib/dist/lib/matchers/index.d.ts.map +1 -0
  168. package/lib/dist/lib/matchers/index.js +9 -0
  169. package/lib/dist/lib/matchers/index.js.map +1 -0
  170. package/lib/dist/lib/matchers/judgeAccessor.d.ts +113 -0
  171. package/lib/dist/lib/matchers/judgeAccessor.d.ts.map +1 -0
  172. package/lib/dist/lib/matchers/judgeAccessor.js +183 -0
  173. package/lib/dist/lib/matchers/judgeAccessor.js.map +1 -0
  174. package/lib/dist/lib/matchers/session.d.ts +39 -0
  175. package/lib/dist/lib/matchers/session.d.ts.map +1 -0
  176. package/lib/dist/lib/matchers/session.js +116 -0
  177. package/lib/dist/lib/matchers/session.js.map +1 -0
  178. package/lib/dist/lib/matchers/traces.d.ts +70 -0
  179. package/lib/dist/lib/matchers/traces.d.ts.map +1 -0
  180. package/lib/dist/lib/matchers/traces.js +236 -0
  181. package/lib/dist/lib/matchers/traces.js.map +1 -0
  182. package/lib/dist/lib/matchers/tracesPricing.d.ts +38 -0
  183. package/lib/dist/lib/matchers/tracesPricing.d.ts.map +1 -0
  184. package/lib/dist/lib/matchers/tracesPricing.js +64 -0
  185. package/lib/dist/lib/matchers/tracesPricing.js.map +1 -0
  186. package/lib/dist/lib/matchers/types.d.ts +75 -0
  187. package/lib/dist/lib/matchers/types.d.ts.map +1 -0
  188. package/lib/dist/lib/matchers/types.js +6 -0
  189. package/lib/dist/lib/matchers/types.js.map +1 -0
  190. package/lib/dist/lib/packagePaths.d.ts +29 -0
  191. package/lib/dist/lib/packagePaths.d.ts.map +1 -0
  192. package/lib/dist/lib/packagePaths.js +63 -0
  193. package/lib/dist/lib/packagePaths.js.map +1 -0
  194. package/lib/dist/lib/performance.d.ts +51 -0
  195. package/lib/dist/lib/performance.d.ts.map +1 -0
  196. package/lib/dist/lib/performance.js +159 -0
  197. package/lib/dist/lib/performance.js.map +1 -0
  198. package/lib/dist/lib/portConfig.d.ts +29 -0
  199. package/lib/dist/lib/portConfig.d.ts.map +1 -0
  200. package/lib/dist/lib/portConfig.js +64 -0
  201. package/lib/dist/lib/portConfig.js.map +1 -0
  202. package/lib/dist/lib/preferences.d.ts +63 -0
  203. package/lib/dist/lib/preferences.d.ts.map +1 -0
  204. package/lib/dist/lib/preferences.js +117 -0
  205. package/lib/dist/lib/preferences.js.map +1 -0
  206. package/lib/dist/lib/resolveAgentModel.d.ts +22 -0
  207. package/lib/dist/lib/resolveAgentModel.d.ts.map +1 -0
  208. package/lib/dist/lib/resolveAgentModel.js +37 -0
  209. package/lib/dist/lib/resolveAgentModel.js.map +1 -0
  210. package/lib/dist/lib/runStats.d.ts +116 -0
  211. package/lib/dist/lib/runStats.d.ts.map +1 -0
  212. package/lib/dist/lib/runStats.js +192 -0
  213. package/lib/dist/lib/runStats.js.map +1 -0
  214. package/lib/dist/lib/telemetry/constants.d.ts +60 -0
  215. package/lib/dist/lib/telemetry/constants.d.ts.map +1 -0
  216. package/lib/dist/lib/telemetry/constants.js +87 -0
  217. package/lib/dist/lib/telemetry/constants.js.map +1 -0
  218. package/lib/dist/lib/telemetry/evalSpans.d.ts +61 -0
  219. package/lib/dist/lib/telemetry/evalSpans.d.ts.map +1 -0
  220. package/lib/dist/lib/telemetry/evalSpans.js +254 -0
  221. package/lib/dist/lib/telemetry/evalSpans.js.map +1 -0
  222. package/lib/dist/lib/telemetry/index.d.ts +11 -0
  223. package/lib/dist/lib/telemetry/index.d.ts.map +1 -0
  224. package/lib/dist/lib/telemetry/index.js +15 -0
  225. package/lib/dist/lib/telemetry/index.js.map +1 -0
  226. package/lib/dist/lib/telemetry/opensearchExporter.d.ts +43 -0
  227. package/lib/dist/lib/telemetry/opensearchExporter.d.ts.map +1 -0
  228. package/lib/dist/lib/telemetry/opensearchExporter.js +217 -0
  229. package/lib/dist/lib/telemetry/opensearchExporter.js.map +1 -0
  230. package/lib/dist/lib/telemetry/provider.d.ts +55 -0
  231. package/lib/dist/lib/telemetry/provider.d.ts.map +1 -0
  232. package/lib/dist/lib/telemetry/provider.js +140 -0
  233. package/lib/dist/lib/telemetry/provider.js.map +1 -0
  234. package/lib/dist/lib/testCaseLabels.d.ts +34 -0
  235. package/lib/dist/lib/testCaseLabels.d.ts.map +1 -0
  236. package/lib/dist/lib/testCaseLabels.js +88 -0
  237. package/lib/dist/lib/testCaseLabels.js.map +1 -0
  238. package/lib/dist/lib/testCaseValidation.d.ts +140 -0
  239. package/lib/dist/lib/testCaseValidation.d.ts.map +1 -0
  240. package/lib/dist/lib/testCaseValidation.js +162 -0
  241. package/lib/dist/lib/testCaseValidation.js.map +1 -0
  242. package/lib/dist/lib/testCases/agentFixture.d.ts +80 -0
  243. package/lib/dist/lib/testCases/agentFixture.d.ts.map +1 -0
  244. package/lib/dist/lib/testCases/agentFixture.js +43 -0
  245. package/lib/dist/lib/testCases/agentFixture.js.map +1 -0
  246. package/lib/dist/lib/testCases/authoringSurface.d.ts +10 -0
  247. package/lib/dist/lib/testCases/authoringSurface.d.ts.map +1 -0
  248. package/lib/dist/lib/testCases/authoringSurface.js +54 -0
  249. package/lib/dist/lib/testCases/authoringSurface.js.map +1 -0
  250. package/lib/dist/lib/testCases/codemod.d.ts +13 -0
  251. package/lib/dist/lib/testCases/codemod.d.ts.map +1 -0
  252. package/lib/dist/lib/testCases/codemod.js +169 -0
  253. package/lib/dist/lib/testCases/codemod.js.map +1 -0
  254. package/lib/dist/lib/testCases/define.d.ts +114 -0
  255. package/lib/dist/lib/testCases/define.d.ts.map +1 -0
  256. package/lib/dist/lib/testCases/define.js +253 -0
  257. package/lib/dist/lib/testCases/define.js.map +1 -0
  258. package/lib/dist/lib/testCases/evaluators.d.ts +80 -0
  259. package/lib/dist/lib/testCases/evaluators.d.ts.map +1 -0
  260. package/lib/dist/lib/testCases/evaluators.js +105 -0
  261. package/lib/dist/lib/testCases/evaluators.js.map +1 -0
  262. package/lib/dist/lib/testCases/index.d.ts +14 -0
  263. package/lib/dist/lib/testCases/index.d.ts.map +1 -0
  264. package/lib/dist/lib/testCases/index.js +12 -0
  265. package/lib/dist/lib/testCases/index.js.map +1 -0
  266. package/lib/dist/lib/testCases/judge.d.ts +165 -0
  267. package/lib/dist/lib/testCases/judge.d.ts.map +1 -0
  268. package/lib/dist/lib/testCases/judge.js +359 -0
  269. package/lib/dist/lib/testCases/judge.js.map +1 -0
  270. package/lib/dist/lib/testCases/loader.d.ts +36 -0
  271. package/lib/dist/lib/testCases/loader.d.ts.map +1 -0
  272. package/lib/dist/lib/testCases/loader.js +179 -0
  273. package/lib/dist/lib/testCases/loader.js.map +1 -0
  274. package/lib/dist/lib/testCases/types.d.ts +242 -0
  275. package/lib/dist/lib/testCases/types.d.ts.map +1 -0
  276. package/lib/dist/lib/testCases/types.js +6 -0
  277. package/lib/dist/lib/testCases/types.js.map +1 -0
  278. package/lib/dist/lib/theme.d.ts +6 -0
  279. package/lib/dist/lib/theme.d.ts.map +1 -0
  280. package/lib/dist/lib/theme.js +36 -0
  281. package/lib/dist/lib/theme.js.map +1 -0
  282. package/lib/dist/lib/uiTelemetry.d.ts +7 -0
  283. package/lib/dist/lib/uiTelemetry.d.ts.map +1 -0
  284. package/lib/dist/lib/uiTelemetry.js +25 -0
  285. package/lib/dist/lib/uiTelemetry.js.map +1 -0
  286. package/lib/dist/lib/utils.d.ts +111 -0
  287. package/lib/dist/lib/utils.d.ts.map +1 -0
  288. package/lib/dist/lib/utils.js +254 -0
  289. package/lib/dist/lib/utils.js.map +1 -0
  290. package/lib/dist/lib/workflow/consolidate.d.ts +12 -0
  291. package/lib/dist/lib/workflow/consolidate.d.ts.map +1 -0
  292. package/lib/dist/lib/workflow/consolidate.js +33 -0
  293. package/lib/dist/lib/workflow/consolidate.js.map +1 -0
  294. package/lib/dist/lib/workflow/index.d.ts +13 -0
  295. package/lib/dist/lib/workflow/index.d.ts.map +1 -0
  296. package/lib/dist/lib/workflow/index.js +12 -0
  297. package/lib/dist/lib/workflow/index.js.map +1 -0
  298. package/lib/dist/lib/workflow/ledger.d.ts +30 -0
  299. package/lib/dist/lib/workflow/ledger.d.ts.map +1 -0
  300. package/lib/dist/lib/workflow/ledger.js +41 -0
  301. package/lib/dist/lib/workflow/ledger.js.map +1 -0
  302. package/lib/dist/lib/workflow/pool.d.ts +13 -0
  303. package/lib/dist/lib/workflow/pool.d.ts.map +1 -0
  304. package/lib/dist/lib/workflow/pool.js +44 -0
  305. package/lib/dist/lib/workflow/pool.js.map +1 -0
  306. package/lib/dist/lib/workflow/source.d.ts +22 -0
  307. package/lib/dist/lib/workflow/source.d.ts.map +1 -0
  308. package/lib/dist/lib/workflow/source.js +29 -0
  309. package/lib/dist/lib/workflow/source.js.map +1 -0
  310. package/lib/dist/lib/workflow/stepB.d.ts +71 -0
  311. package/lib/dist/lib/workflow/stepB.d.ts.map +1 -0
  312. package/lib/dist/lib/workflow/stepB.js +99 -0
  313. package/lib/dist/lib/workflow/stepB.js.map +1 -0
  314. package/lib/dist/lib/workflow/types.d.ts +86 -0
  315. package/lib/dist/lib/workflow/types.d.ts.map +1 -0
  316. package/lib/dist/lib/workflow/types.js +6 -0
  317. package/lib/dist/lib/workflow/types.js.map +1 -0
  318. package/lib/dist/lib/workflow/workflow.d.ts +119 -0
  319. package/lib/dist/lib/workflow/workflow.d.ts.map +1 -0
  320. package/lib/dist/lib/workflow/workflow.js +195 -0
  321. package/lib/dist/lib/workflow/workflow.js.map +1 -0
  322. package/lib/dist/services/agent/aguiConverter.d.ts +50 -0
  323. package/lib/dist/services/agent/aguiConverter.d.ts.map +1 -0
  324. package/lib/dist/services/agent/aguiConverter.js +449 -0
  325. package/lib/dist/services/agent/aguiConverter.js.map +1 -0
  326. package/lib/dist/services/agent/index.d.ts +10 -0
  327. package/lib/dist/services/agent/index.d.ts.map +1 -0
  328. package/lib/dist/services/agent/index.js +12 -0
  329. package/lib/dist/services/agent/index.js.map +1 -0
  330. package/lib/dist/services/agent/payloadBuilder.d.ts +33 -0
  331. package/lib/dist/services/agent/payloadBuilder.d.ts.map +1 -0
  332. package/lib/dist/services/agent/payloadBuilder.js +75 -0
  333. package/lib/dist/services/agent/payloadBuilder.js.map +1 -0
  334. package/lib/dist/services/agent/sseStream.d.ts +43 -0
  335. package/lib/dist/services/agent/sseStream.d.ts.map +1 -0
  336. package/lib/dist/services/agent/sseStream.js +223 -0
  337. package/lib/dist/services/agent/sseStream.js.map +1 -0
  338. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts +44 -0
  339. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts.map +1 -0
  340. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js +95 -0
  341. package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js.map +1 -0
  342. package/lib/dist/services/connectors/base/BaseConnector.d.ts +81 -0
  343. package/lib/dist/services/connectors/base/BaseConnector.d.ts.map +1 -0
  344. package/lib/dist/services/connectors/base/BaseConnector.js +170 -0
  345. package/lib/dist/services/connectors/base/BaseConnector.js.map +1 -0
  346. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts +126 -0
  347. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts.map +1 -0
  348. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js +417 -0
  349. package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js.map +1 -0
  350. package/lib/dist/services/connectors/index.d.ts +13 -0
  351. package/lib/dist/services/connectors/index.d.ts.map +1 -0
  352. package/lib/dist/services/connectors/index.js +32 -0
  353. package/lib/dist/services/connectors/index.js.map +1 -0
  354. package/lib/dist/services/connectors/kiro/KiroConnector.d.ts +48 -0
  355. package/lib/dist/services/connectors/kiro/KiroConnector.d.ts.map +1 -0
  356. package/lib/dist/services/connectors/kiro/KiroConnector.js +158 -0
  357. package/lib/dist/services/connectors/kiro/KiroConnector.js.map +1 -0
  358. package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts +36 -0
  359. package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts.map +1 -0
  360. package/lib/dist/services/connectors/langgraph/LangGraphConnector.js +175 -0
  361. package/lib/dist/services/connectors/langgraph/LangGraphConnector.js.map +1 -0
  362. package/lib/dist/services/connectors/mock/MockConnector.d.ts +37 -0
  363. package/lib/dist/services/connectors/mock/MockConnector.d.ts.map +1 -0
  364. package/lib/dist/services/connectors/mock/MockConnector.js +120 -0
  365. package/lib/dist/services/connectors/mock/MockConnector.js.map +1 -0
  366. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts +42 -0
  367. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts.map +1 -0
  368. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js +133 -0
  369. package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js.map +1 -0
  370. package/lib/dist/services/connectors/pi/PiConnector.d.ts +87 -0
  371. package/lib/dist/services/connectors/pi/PiConnector.d.ts.map +1 -0
  372. package/lib/dist/services/connectors/pi/PiConnector.js +274 -0
  373. package/lib/dist/services/connectors/pi/PiConnector.js.map +1 -0
  374. package/lib/dist/services/connectors/registry.d.ts +57 -0
  375. package/lib/dist/services/connectors/registry.d.ts.map +1 -0
  376. package/lib/dist/services/connectors/registry.js +106 -0
  377. package/lib/dist/services/connectors/registry.js.map +1 -0
  378. package/lib/dist/services/connectors/rest/RESTConnector.d.ts +38 -0
  379. package/lib/dist/services/connectors/rest/RESTConnector.d.ts.map +1 -0
  380. package/lib/dist/services/connectors/rest/RESTConnector.js +117 -0
  381. package/lib/dist/services/connectors/rest/RESTConnector.js.map +1 -0
  382. package/lib/dist/services/connectors/server.d.ts +13 -0
  383. package/lib/dist/services/connectors/server.d.ts.map +1 -0
  384. package/lib/dist/services/connectors/server.js +34 -0
  385. package/lib/dist/services/connectors/server.js.map +1 -0
  386. package/lib/dist/services/connectors/strands/StrandsConnector.d.ts +48 -0
  387. package/lib/dist/services/connectors/strands/StrandsConnector.d.ts.map +1 -0
  388. package/lib/dist/services/connectors/strands/StrandsConnector.js +221 -0
  389. package/lib/dist/services/connectors/strands/StrandsConnector.js.map +1 -0
  390. package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts +88 -0
  391. package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts.map +1 -0
  392. package/lib/dist/services/connectors/subprocess/SubprocessConnector.js +426 -0
  393. package/lib/dist/services/connectors/subprocess/SubprocessConnector.js.map +1 -0
  394. package/lib/dist/services/connectors/types.d.ts +213 -0
  395. package/lib/dist/services/connectors/types.d.ts.map +1 -0
  396. package/lib/dist/services/connectors/types.js +6 -0
  397. package/lib/dist/services/connectors/types.js.map +1 -0
  398. package/lib/dist/services/evaluation/bedrockJudge.d.ts +71 -0
  399. package/lib/dist/services/evaluation/bedrockJudge.d.ts.map +1 -0
  400. package/lib/dist/services/evaluation/bedrockJudge.js +169 -0
  401. package/lib/dist/services/evaluation/bedrockJudge.js.map +1 -0
  402. package/lib/dist/services/evaluation/evaluatorError.d.ts +56 -0
  403. package/lib/dist/services/evaluation/evaluatorError.d.ts.map +1 -0
  404. package/lib/dist/services/evaluation/evaluatorError.js +56 -0
  405. package/lib/dist/services/evaluation/evaluatorError.js.map +1 -0
  406. package/lib/dist/services/evaluation/index.d.ts +106 -0
  407. package/lib/dist/services/evaluation/index.d.ts.map +1 -0
  408. package/lib/dist/services/evaluation/index.js +684 -0
  409. package/lib/dist/services/evaluation/index.js.map +1 -0
  410. package/lib/dist/services/evaluation/mockTrajectory.d.ts +3 -0
  411. package/lib/dist/services/evaluation/mockTrajectory.d.ts.map +1 -0
  412. package/lib/dist/services/evaluation/mockTrajectory.js +72 -0
  413. package/lib/dist/services/evaluation/mockTrajectory.js.map +1 -0
  414. package/lib/dist/services/opensearch/client.d.ts +26 -0
  415. package/lib/dist/services/opensearch/client.d.ts.map +1 -0
  416. package/lib/dist/services/opensearch/client.js +131 -0
  417. package/lib/dist/services/opensearch/client.js.map +1 -0
  418. package/lib/dist/services/opensearch/index.d.ts +16 -0
  419. package/lib/dist/services/opensearch/index.d.ts.map +1 -0
  420. package/lib/dist/services/opensearch/index.js +25 -0
  421. package/lib/dist/services/opensearch/index.js.map +1 -0
  422. package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts +123 -0
  423. package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts.map +1 -0
  424. package/lib/dist/services/storage/asyncBenchmarkStorage.js +440 -0
  425. package/lib/dist/services/storage/asyncBenchmarkStorage.js.map +1 -0
  426. package/lib/dist/services/storage/asyncRunStorage.d.ts +135 -0
  427. package/lib/dist/services/storage/asyncRunStorage.d.ts.map +1 -0
  428. package/lib/dist/services/storage/asyncRunStorage.js +524 -0
  429. package/lib/dist/services/storage/asyncRunStorage.js.map +1 -0
  430. package/lib/dist/services/storage/asyncTestCaseStorage.d.ts +170 -0
  431. package/lib/dist/services/storage/asyncTestCaseStorage.d.ts.map +1 -0
  432. package/lib/dist/services/storage/asyncTestCaseStorage.js +301 -0
  433. package/lib/dist/services/storage/asyncTestCaseStorage.js.map +1 -0
  434. package/lib/dist/services/storage/index.d.ts +17 -0
  435. package/lib/dist/services/storage/index.d.ts.map +1 -0
  436. package/lib/dist/services/storage/index.js +20 -0
  437. package/lib/dist/services/storage/index.js.map +1 -0
  438. package/lib/dist/services/storage/migration.d.ts +54 -0
  439. package/lib/dist/services/storage/migration.d.ts.map +1 -0
  440. package/lib/dist/services/storage/migration.js +296 -0
  441. package/lib/dist/services/storage/migration.js.map +1 -0
  442. package/lib/dist/services/storage/opensearchClient.d.ts +947 -0
  443. package/lib/dist/services/storage/opensearchClient.d.ts.map +1 -0
  444. package/lib/dist/services/storage/opensearchClient.js +442 -0
  445. package/lib/dist/services/storage/opensearchClient.js.map +1 -0
  446. package/lib/dist/services/traces/browserRecovery.d.ts +37 -0
  447. package/lib/dist/services/traces/browserRecovery.d.ts.map +1 -0
  448. package/lib/dist/services/traces/browserRecovery.js +108 -0
  449. package/lib/dist/services/traces/browserRecovery.js.map +1 -0
  450. package/lib/dist/services/traces/categoryStyles.d.ts +21 -0
  451. package/lib/dist/services/traces/categoryStyles.d.ts.map +1 -0
  452. package/lib/dist/services/traces/categoryStyles.js +56 -0
  453. package/lib/dist/services/traces/categoryStyles.js.map +1 -0
  454. package/lib/dist/services/traces/executionOrderTransform.d.ts +35 -0
  455. package/lib/dist/services/traces/executionOrderTransform.d.ts.map +1 -0
  456. package/lib/dist/services/traces/executionOrderTransform.js +313 -0
  457. package/lib/dist/services/traces/executionOrderTransform.js.map +1 -0
  458. package/lib/dist/services/traces/fetchSpansForRun.d.ts +86 -0
  459. package/lib/dist/services/traces/fetchSpansForRun.d.ts.map +1 -0
  460. package/lib/dist/services/traces/fetchSpansForRun.js +69 -0
  461. package/lib/dist/services/traces/fetchSpansForRun.js.map +1 -0
  462. package/lib/dist/services/traces/flowTransform.d.ts +24 -0
  463. package/lib/dist/services/traces/flowTransform.d.ts.map +1 -0
  464. package/lib/dist/services/traces/flowTransform.js +228 -0
  465. package/lib/dist/services/traces/flowTransform.js.map +1 -0
  466. package/lib/dist/services/traces/index.d.ts +121 -0
  467. package/lib/dist/services/traces/index.d.ts.map +1 -0
  468. package/lib/dist/services/traces/index.js +255 -0
  469. package/lib/dist/services/traces/index.js.map +1 -0
  470. package/lib/dist/services/traces/intentTransform.d.ts +20 -0
  471. package/lib/dist/services/traces/intentTransform.d.ts.map +1 -0
  472. package/lib/dist/services/traces/intentTransform.js +131 -0
  473. package/lib/dist/services/traces/intentTransform.js.map +1 -0
  474. package/lib/dist/services/traces/judgeAgentsHints.d.ts +63 -0
  475. package/lib/dist/services/traces/judgeAgentsHints.d.ts.map +1 -0
  476. package/lib/dist/services/traces/judgeAgentsHints.js +89 -0
  477. package/lib/dist/services/traces/judgeAgentsHints.js.map +1 -0
  478. package/lib/dist/services/traces/messageExtraction.d.ts +15 -0
  479. package/lib/dist/services/traces/messageExtraction.d.ts.map +1 -0
  480. package/lib/dist/services/traces/messageExtraction.js +313 -0
  481. package/lib/dist/services/traces/messageExtraction.js.map +1 -0
  482. package/lib/dist/services/traces/spanCategorization.d.ts +63 -0
  483. package/lib/dist/services/traces/spanCategorization.d.ts.map +1 -0
  484. package/lib/dist/services/traces/spanCategorization.js +276 -0
  485. package/lib/dist/services/traces/spanCategorization.js.map +1 -0
  486. package/lib/dist/services/traces/spanPreprocessing.d.ts +37 -0
  487. package/lib/dist/services/traces/spanPreprocessing.d.ts.map +1 -0
  488. package/lib/dist/services/traces/spanPreprocessing.js +102 -0
  489. package/lib/dist/services/traces/spanPreprocessing.js.map +1 -0
  490. package/lib/dist/services/traces/spansToTrajectory.d.ts +36 -0
  491. package/lib/dist/services/traces/spansToTrajectory.d.ts.map +1 -0
  492. package/lib/dist/services/traces/spansToTrajectory.js +425 -0
  493. package/lib/dist/services/traces/spansToTrajectory.js.map +1 -0
  494. package/lib/dist/services/traces/toolSimilarity.d.ts +35 -0
  495. package/lib/dist/services/traces/toolSimilarity.d.ts.map +1 -0
  496. package/lib/dist/services/traces/toolSimilarity.js +203 -0
  497. package/lib/dist/services/traces/toolSimilarity.js.map +1 -0
  498. package/lib/dist/services/traces/traceComparison.d.ts +31 -0
  499. package/lib/dist/services/traces/traceComparison.d.ts.map +1 -0
  500. package/lib/dist/services/traces/traceComparison.js +318 -0
  501. package/lib/dist/services/traces/traceComparison.js.map +1 -0
  502. package/lib/dist/services/traces/traceGrouping.d.ts +19 -0
  503. package/lib/dist/services/traces/traceGrouping.d.ts.map +1 -0
  504. package/lib/dist/services/traces/traceGrouping.js +107 -0
  505. package/lib/dist/services/traces/traceGrouping.js.map +1 -0
  506. package/lib/dist/services/traces/tracePoller.d.ts +108 -0
  507. package/lib/dist/services/traces/tracePoller.d.ts.map +1 -0
  508. package/lib/dist/services/traces/tracePoller.js +475 -0
  509. package/lib/dist/services/traces/tracePoller.js.map +1 -0
  510. package/lib/dist/services/traces/traceStats.d.ts +45 -0
  511. package/lib/dist/services/traces/traceStats.d.ts.map +1 -0
  512. package/lib/dist/services/traces/traceStats.js +114 -0
  513. package/lib/dist/services/traces/traceStats.js.map +1 -0
  514. package/lib/dist/services/traces/traceSummary.d.ts +47 -0
  515. package/lib/dist/services/traces/traceSummary.d.ts.map +1 -0
  516. package/lib/dist/services/traces/traceSummary.js +68 -0
  517. package/lib/dist/services/traces/traceSummary.js.map +1 -0
  518. package/lib/dist/services/traces/utils.d.ts +33 -0
  519. package/lib/dist/services/traces/utils.d.ts.map +1 -0
  520. package/lib/dist/services/traces/utils.js +114 -0
  521. package/lib/dist/services/traces/utils.js.map +1 -0
  522. package/lib/dist/types/agui.d.ts +13 -0
  523. package/lib/dist/types/agui.d.ts.map +1 -0
  524. package/lib/dist/types/agui.js +16 -0
  525. package/lib/dist/types/agui.js.map +1 -0
  526. package/lib/dist/types/index.d.ts +1229 -0
  527. package/lib/dist/types/index.d.ts.map +1 -0
  528. package/lib/dist/types/index.js +12 -0
  529. package/lib/dist/types/index.js.map +1 -0
  530. package/lib/dist/types/skills.d.ts +146 -0
  531. package/lib/dist/types/skills.d.ts.map +1 -0
  532. package/lib/dist/types/skills.js +6 -0
  533. package/lib/dist/types/skills.js.map +1 -0
  534. package/observio-sample-agent/pi-package/README.md +112 -0
  535. package/observio-sample-agent/pi-package/extensions/agent-health.ts +373 -0
  536. package/observio-sample-agent/pi-package/package.json +17 -0
  537. package/observio-sample-agent/pi-package/prompts/agent-health.md +37 -0
  538. package/observio-sample-agent/pi-package/skills/create-pr/SKILL.md +88 -0
  539. package/observio-sample-agent/pi-package/skills/fix-bug/SKILL.md +71 -0
  540. package/observio-sample-agent/pi-package/skills/implement-feature/SKILL.md +156 -0
  541. package/observio-sample-agent/pi-package/skills/instrument-otel/SKILL.md +208 -0
  542. package/observio-sample-agent/pi-package/skills/setup-collector/SKILL.md +146 -0
  543. package/observio-sample-agent/pi-package/skills/write-test/SKILL.md +115 -0
  544. package/package.json +45 -9
  545. package/server/dist/app.js +34031 -18731
  546. package/server/dist/index.js +30737 -15338
  547. package/tsconfig.lib.json +71 -0
  548. package/dist/assets/index-BOIP5L7h.js +0 -246
  549. package/dist/assets/index-CU9YKpAL.css +0 -1
  550. package/lib/dist/config/index.js +0 -452
  551. package/lib/dist/index.js +0 -1725
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Comparison insights — deterministic agreement + category math for the
3
+ * comparison page's insights band (and, later, as grounding context for the
4
+ * "What's actually different" LLM deep-dive).
5
+ *
6
+ * Everything here is pure arithmetic over the already-loaded comparison rows:
7
+ * no API calls, no LLM. The band renders the *what* (which runs agree where,
8
+ * which categories are weak); the deep-dive explains the *why*.
9
+ *
10
+ * Generalized to N runs from the start:
11
+ * - 2 runs → "Both pass / Both fail / Split"
12
+ * - 3+ runs → "All pass / All fail / Split"
13
+ */
14
+ import type { TestCaseComparisonRow } from '../types/index.js';
15
+ /** Agreement bucket for a row across the selected runs. */
16
+ export type AgreementBucket = 'allPass' | 'allFail' | 'split';
17
+ export interface AgreementPartition {
18
+ allPass: TestCaseComparisonRow[];
19
+ allFail: TestCaseComparisonRow[];
20
+ split: TestCaseComparisonRow[];
21
+ /** Rows where at least one run has no verdict (missing report / not run). */
22
+ uncovered: TestCaseComparisonRow[];
23
+ }
24
+ /**
25
+ * Partition rows into agreement buckets across the given runs.
26
+ * A row only participates when EVERY selected run has a verdict for it —
27
+ * partially-covered rows go to `uncovered` (they can't agree or disagree).
28
+ */
29
+ export declare function partitionByAgreement(rows: TestCaseComparisonRow[], runIds: string[]): AgreementPartition;
30
+ /** Bucket a single row (same semantics as {@link partitionByAgreement}); null = uncovered. */
31
+ export declare function bucketRow(row: TestCaseComparisonRow, runIds: string[]): AgreementBucket | null;
32
+ /**
33
+ * Synthetic bucket names. Parentheses are deliberately outside the
34
+ * name-tag charset (`[\w-]`), so a real benchmark category can never
35
+ * collide with these rollup buckets.
36
+ */
37
+ export declare const UNCATEGORIZED = "(uncategorized)";
38
+ /** Rollup bucket for categories with too few cases to be meaningful. */
39
+ export declare const OTHER_CATEGORY = "(other)";
40
+ /**
41
+ * Extract a row's category.
42
+ * Priority:
43
+ * 1. The `subcategory:<x>` label — the proper, purpose-built tag for this
44
+ * (set via the SDK's `test(name, { labels: ['subcategory:basic'] })`,
45
+ * the JSON/CLI import's `subcategory` field, or the Test Case editor).
46
+ * Prefer this over anything scraped from free text: it's validated,
47
+ * exported/round-tripped, and shown elsewhere in the UI (EvalsPage,
48
+ * BenchmarkEditor) — a real column, not a regex guess.
49
+ * 2. A bracketed tag embedded in the test-case name — a convention older
50
+ * imported benchmarks used before `subcategory` existed (e.g.
51
+ * "qst_0011 [basic] How long is …"). Kept only for benchmarks that
52
+ * predate the `subcategory` field; new imports should set it instead.
53
+ * 3. A `topic:<x>` label (the generic labels system, pre-dates
54
+ * `subcategory` as a dedicated concept).
55
+ * 4. {@link UNCATEGORIZED}.
56
+ * (`category:<x>` labels are intentionally NOT used here: imported benchmarks
57
+ * stamp a single `category:RAG` on every case, which would collapse the
58
+ * breakdown into one column — that's the coarse domain, not this facet.)
59
+ */
60
+ export declare function extractRowCategory(row: Pick<TestCaseComparisonRow, 'testCaseName' | 'labels'>): string;
61
+ export interface CategoryCell {
62
+ passed: number;
63
+ total: number;
64
+ }
65
+ export interface CategoryBreakdown {
66
+ /** Display order: by case count desc; `other` (if present) always last. */
67
+ categories: string[];
68
+ /** runId → category → {passed,total}. Totals may differ per run (missing results are skipped). */
69
+ perRun: Record<string, Record<string, CategoryCell>>;
70
+ /** Overall case count per category (across rows, not per run). */
71
+ totals: Record<string, number>;
72
+ /**
73
+ * Raw categories each displayed column represents. Identity for real
74
+ * categories; the union of rolled-up raw categories for `(other)`.
75
+ * Filtering MUST use this mapping so clicking `(other)` matches exactly
76
+ * the rows its cell counted.
77
+ */
78
+ members: Record<string, string[]>;
79
+ }
80
+ /**
81
+ * Default minimum case count for a category to get its own column; smaller
82
+ * ones roll up into `other`. Callers with small datasets may lower this —
83
+ * a cell needs enough cases that a single verdict flip doesn't swing it
84
+ * by tens of percentage points.
85
+ */
86
+ export declare const MIN_CATEGORY_CASES = 5;
87
+ /** Per-category pass rates per run, with small categories rolled into `other`. */
88
+ export declare function buildCategoryBreakdown(rows: TestCaseComparisonRow[], runIds: string[], minCases?: number): CategoryBreakdown;
89
+ export interface SharedWeakness {
90
+ category: string;
91
+ /** runId → pass-rate percent (0-100) in this category. */
92
+ rates: Record<string, number>;
93
+ /** Fraction (0-1) of all-fail cases that belong to this category. */
94
+ allFailShare: number;
95
+ }
96
+ /**
97
+ * Detect a category that is the weakest (within {@link WEAKEST_TOLERANCE_PP})
98
+ * for EVERY selected run — the "shared floor". When present, it usually
99
+ * indicates a benchmark/corpus-level problem rather than an agent choice.
100
+ * Returns null when runs disagree about their weakest category or nothing is
101
+ * genuinely weak. `other`/`uncategorized` rollups are never flagged.
102
+ */
103
+ export declare function detectSharedWeakness(breakdown: CategoryBreakdown, partition: AgreementPartition, runIds: string[]): SharedWeakness | null;
104
+ //# sourceMappingURL=comparisonInsights.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparisonInsights.d.ts","sourceRoot":"","sources":["../../comparisonInsights.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGrD,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,6EAA6E;IAC7E,SAAS,EAAE,qBAAqB,EAAE,CAAC;CACpC;AAyBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,qBAAqB,EAAE,EAC7B,MAAM,EAAE,MAAM,EAAE,GACf,kBAAkB,CAgBpB;AAED,8FAA8F;AAC9F,wBAAgB,SAAS,CAAC,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,eAAe,GAAG,IAAI,CAO9F;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,wEAAwE;AACxE,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,cAAc,GAAG,QAAQ,CAAC,GAAG,MAAM,CAQtG;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IACrD,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,kFAAkF;AAClF,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,qBAAqB,EAAE,EAC7B,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,GAAE,MAA2B,GACpC,iBAAiB,CAuCnB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,qEAAqE;IACrE,YAAY,EAAE,MAAM,CAAC;CACtB;AAYD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,kBAAkB,EAC7B,MAAM,EAAE,MAAM,EAAE,GACf,cAAc,GAAG,IAAI,CAuCvB"}
@@ -0,0 +1,212 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { getSubcategoryFromLabels } from '../lib/testCaseLabels.js';
6
+ /** True when this run's result counts as a pass for agreement purposes. */
7
+ function isPass(r) {
8
+ return r?.passFailStatus === 'passed';
9
+ }
10
+ /**
11
+ * True when the run produced *some verdict* we can bucket (pass OR fail).
12
+ * Three shapes count:
13
+ * - a judge verdict (`passFailStatus` passed/failed);
14
+ * - a run-level failure (`status: 'failed'` — the agent errored/crashed on
15
+ * this case, which IS a fail verdict for agreement purposes).
16
+ * NOT a verdict (→ uncovered): missing results, and evaluator-errored
17
+ * reports (`errored: true`, `passFailStatus` cleared — issue #242 keeps
18
+ * "the judge broke" distinct from "the agent failed"; bucketing them as
19
+ * fails would poison All-fail with infrastructure noise).
20
+ */
21
+ function hasVerdict(r) {
22
+ if (!r || r.status === 'missing')
23
+ return false;
24
+ if (r.passFailStatus === 'passed' || r.passFailStatus === 'failed')
25
+ return true;
26
+ if (r.errored)
27
+ return false;
28
+ return r.status === 'failed';
29
+ }
30
+ /**
31
+ * Partition rows into agreement buckets across the given runs.
32
+ * A row only participates when EVERY selected run has a verdict for it —
33
+ * partially-covered rows go to `uncovered` (they can't agree or disagree).
34
+ */
35
+ export function partitionByAgreement(rows, runIds) {
36
+ const partition = { allPass: [], allFail: [], split: [], uncovered: [] };
37
+ if (runIds.length === 0)
38
+ return partition;
39
+ for (const row of rows) {
40
+ const results = runIds.map(id => row.results[id]);
41
+ if (results.some(r => !hasVerdict(r))) {
42
+ partition.uncovered.push(row);
43
+ continue;
44
+ }
45
+ const passes = results.filter(r => isPass(r)).length;
46
+ if (passes === runIds.length)
47
+ partition.allPass.push(row);
48
+ else if (passes === 0)
49
+ partition.allFail.push(row);
50
+ else
51
+ partition.split.push(row);
52
+ }
53
+ return partition;
54
+ }
55
+ /** Bucket a single row (same semantics as {@link partitionByAgreement}); null = uncovered. */
56
+ export function bucketRow(row, runIds) {
57
+ const results = runIds.map(id => row.results[id]);
58
+ if (results.some(r => !hasVerdict(r)))
59
+ return null;
60
+ const passes = results.filter(r => isPass(r)).length;
61
+ if (passes === runIds.length)
62
+ return 'allPass';
63
+ if (passes === 0)
64
+ return 'allFail';
65
+ return 'split';
66
+ }
67
+ /**
68
+ * Synthetic bucket names. Parentheses are deliberately outside the
69
+ * name-tag charset (`[\w-]`), so a real benchmark category can never
70
+ * collide with these rollup buckets.
71
+ */
72
+ export const UNCATEGORIZED = '(uncategorized)';
73
+ /** Rollup bucket for categories with too few cases to be meaningful. */
74
+ export const OTHER_CATEGORY = '(other)';
75
+ /**
76
+ * Extract a row's category.
77
+ * Priority:
78
+ * 1. The `subcategory:<x>` label — the proper, purpose-built tag for this
79
+ * (set via the SDK's `test(name, { labels: ['subcategory:basic'] })`,
80
+ * the JSON/CLI import's `subcategory` field, or the Test Case editor).
81
+ * Prefer this over anything scraped from free text: it's validated,
82
+ * exported/round-tripped, and shown elsewhere in the UI (EvalsPage,
83
+ * BenchmarkEditor) — a real column, not a regex guess.
84
+ * 2. A bracketed tag embedded in the test-case name — a convention older
85
+ * imported benchmarks used before `subcategory` existed (e.g.
86
+ * "qst_0011 [basic] How long is …"). Kept only for benchmarks that
87
+ * predate the `subcategory` field; new imports should set it instead.
88
+ * 3. A `topic:<x>` label (the generic labels system, pre-dates
89
+ * `subcategory` as a dedicated concept).
90
+ * 4. {@link UNCATEGORIZED}.
91
+ * (`category:<x>` labels are intentionally NOT used here: imported benchmarks
92
+ * stamp a single `category:RAG` on every case, which would collapse the
93
+ * breakdown into one column — that's the coarse domain, not this facet.)
94
+ */
95
+ export function extractRowCategory(row) {
96
+ const subcategory = getSubcategoryFromLabels(row.labels);
97
+ if (subcategory)
98
+ return subcategory.toLowerCase();
99
+ const m = /\[([\w-]+)\]/.exec(row.testCaseName || '');
100
+ if (m)
101
+ return m[1].toLowerCase();
102
+ const topic = (row.labels || []).find(l => l.toLowerCase().startsWith('topic:'));
103
+ if (topic)
104
+ return topic.slice('topic:'.length).toLowerCase();
105
+ return UNCATEGORIZED;
106
+ }
107
+ /**
108
+ * Default minimum case count for a category to get its own column; smaller
109
+ * ones roll up into `other`. Callers with small datasets may lower this —
110
+ * a cell needs enough cases that a single verdict flip doesn't swing it
111
+ * by tens of percentage points.
112
+ */
113
+ export const MIN_CATEGORY_CASES = 5;
114
+ /** Per-category pass rates per run, with small categories rolled into `other`. */
115
+ export function buildCategoryBreakdown(rows, runIds, minCases = MIN_CATEGORY_CASES) {
116
+ // Raw counts per category (row-level, for rollup decisions)
117
+ const rawTotals = {};
118
+ for (const row of rows) {
119
+ const cat = extractRowCategory(row);
120
+ rawTotals[cat] = (rawTotals[cat] || 0) + 1;
121
+ }
122
+ const keep = new Set(Object.keys(rawTotals).filter(c => rawTotals[c] >= minCases));
123
+ const resolve = (cat) => (keep.has(cat) ? cat : OTHER_CATEGORY);
124
+ const members = {};
125
+ for (const raw of Object.keys(rawTotals)) {
126
+ const col = resolve(raw);
127
+ (members[col] = members[col] || []).push(raw);
128
+ }
129
+ const perRun = {};
130
+ const totals = {};
131
+ for (const row of rows) {
132
+ const cat = resolve(extractRowCategory(row));
133
+ totals[cat] = (totals[cat] || 0) + 1;
134
+ for (const runId of runIds) {
135
+ const r = row.results[runId];
136
+ if (!hasVerdict(r))
137
+ continue;
138
+ perRun[runId] = perRun[runId] || {};
139
+ const cell = (perRun[runId][cat] = perRun[runId][cat] || { passed: 0, total: 0 });
140
+ cell.total += 1;
141
+ if (isPass(r))
142
+ cell.passed += 1;
143
+ }
144
+ }
145
+ const categories = Object.keys(totals).sort((a, b) => {
146
+ if (a === OTHER_CATEGORY)
147
+ return 1;
148
+ if (b === OTHER_CATEGORY)
149
+ return -1;
150
+ return (totals[b] || 0) - (totals[a] || 0);
151
+ });
152
+ return { categories, perRun, totals, members };
153
+ }
154
+ /**
155
+ * Tie tolerance (pp) for the "weakest" claim. Kept at rounding-error level
156
+ * on purpose: the callout says "weakest category", so another category may
157
+ * not be meaningfully lower for any run — a 5pp allowance here would make
158
+ * the copy dishonest.
159
+ */
160
+ const WEAKEST_TOLERANCE_PP = 1;
161
+ /** Don't flag a shared weakness unless the mean rate is actually weak. */
162
+ const WEAKNESS_MAX_MEAN_RATE = 75;
163
+ /**
164
+ * Detect a category that is the weakest (within {@link WEAKEST_TOLERANCE_PP})
165
+ * for EVERY selected run — the "shared floor". When present, it usually
166
+ * indicates a benchmark/corpus-level problem rather than an agent choice.
167
+ * Returns null when runs disagree about their weakest category or nothing is
168
+ * genuinely weak. `other`/`uncategorized` rollups are never flagged.
169
+ */
170
+ export function detectSharedWeakness(breakdown, partition, runIds) {
171
+ const candidates = breakdown.categories.filter(c => c !== OTHER_CATEGORY && c !== UNCATEGORIZED);
172
+ if (candidates.length < 2 || runIds.length === 0)
173
+ return null;
174
+ const rate = (runId, cat) => {
175
+ const cell = breakdown.perRun[runId]?.[cat];
176
+ if (!cell || cell.total === 0)
177
+ return null;
178
+ return (cell.passed / cell.total) * 100;
179
+ };
180
+ // Mean-weakest candidate across runs.
181
+ let best = null;
182
+ for (const cat of candidates) {
183
+ const rates = runIds.map(id => rate(id, cat)).filter((x) => x !== null);
184
+ if (rates.length !== runIds.length)
185
+ continue; // needs coverage in every run
186
+ const mean = rates.reduce((a, b) => a + b, 0) / rates.length;
187
+ if (!best || mean < best.mean)
188
+ best = { cat, mean };
189
+ }
190
+ if (!best || best.mean >= WEAKNESS_MAX_MEAN_RATE)
191
+ return null;
192
+ // It must be every run's weakest category (within tolerance).
193
+ for (const runId of runIds) {
194
+ const candidateRate = rate(runId, best.cat);
195
+ if (candidateRate === null)
196
+ return null;
197
+ for (const cat of candidates) {
198
+ if (cat === best.cat)
199
+ continue;
200
+ const r = rate(runId, cat);
201
+ if (r !== null && r < candidateRate - WEAKEST_TOLERANCE_PP)
202
+ return null;
203
+ }
204
+ }
205
+ const rates = {};
206
+ for (const runId of runIds)
207
+ rates[runId] = Math.round(rate(runId, best.cat));
208
+ const allFailInCat = partition.allFail.filter(row => extractRowCategory(row) === best.cat).length;
209
+ const allFailShare = partition.allFail.length > 0 ? allFailInCat / partition.allFail.length : 0;
210
+ return { category: best.cat, rates, allFailShare };
211
+ }
212
+ //# sourceMappingURL=comparisonInsights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparisonInsights.js","sourceRoot":"","sources":["../../comparisonInsights.ts"],"names":[],"mappings":"A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;QAC1E,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,MAAM;QAAE,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAE,CAAC,CAAC;IAC9E,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,IAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IACnG,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhG,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * defineConfig Helper
3
+ * Provides type safety for agent-health.config.ts files
4
+ */
5
+ import type { UserConfig } from './types.js';
6
+ /**
7
+ * Define configuration with full type safety
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // agent-health.config.ts
12
+ * import { defineConfig } from '@opensearch-project/agent-health';
13
+ *
14
+ * export default defineConfig({
15
+ * agents: [
16
+ * {
17
+ * key: 'my-agent',
18
+ * name: 'My Agent',
19
+ * endpoint: 'https://api.example.com/chat',
20
+ * connectorType: 'rest',
21
+ * },
22
+ * ],
23
+ * });
24
+ * ```
25
+ */
26
+ export declare function defineConfig(config: UserConfig): UserConfig;
27
+ //# sourceMappingURL=defineConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineConfig.d.ts","sourceRoot":"","sources":["../../../config/defineConfig.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE3D"}
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /**
6
+ * Define configuration with full type safety
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // agent-health.config.ts
11
+ * import { defineConfig } from '@opensearch-project/agent-health';
12
+ *
13
+ * export default defineConfig({
14
+ * agents: [
15
+ * {
16
+ * key: 'my-agent',
17
+ * name: 'My Agent',
18
+ * endpoint: 'https://api.example.com/chat',
19
+ * connectorType: 'rest',
20
+ * },
21
+ * ],
22
+ * });
23
+ * ```
24
+ */
25
+ export function defineConfig(config) {
26
+ return config;
27
+ }
28
+ //# sourceMappingURL=defineConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineConfig.js","sourceRoot":"","sources":["../../../config/defineConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC7C,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Config Module
3
+ * Public exports for configuration system
4
+ */
5
+ export type { UserConfig, UserAgentConfig, UserModelConfig, ResolvedConfig, ConfigFileInfo, ReporterConfig, JudgeConfig, ServerConfig, ResolvedServerConfig, } from './types.js';
6
+ export type { AgentHooks, BeforeRequestContext } from '../../types/index.js';
7
+ export { defineConfig } from './defineConfig.js';
8
+ export { loadConfig, loadConfigSync, findConfigFile, getConfigFileInfo, clearConfigCache, DEFAULT_SERVER_CONFIG, } from './loader.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../config/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAGH,YAAY,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGhE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ // Function exports
6
+ export { defineConfig } from './defineConfig.js';
7
+ export { loadConfig, loadConfigSync, findConfigFile, getConfigFileInfo, clearConfigCache, DEFAULT_SERVER_CONFIG, } from './loader.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../config/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,mBAAmB;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { ResolvedConfig, ResolvedServerConfig, ConfigFileInfo } from './types.js';
2
+ /**
3
+ * Default server configuration
4
+ * Follows Playwright's webServer pattern
5
+ */
6
+ export declare const DEFAULT_SERVER_CONFIG: ResolvedServerConfig;
7
+ /**
8
+ * Runtime state file (config v2: `.agent-health/state.json`, user or project
9
+ * scope). Loaded by the *server services* (configService, customAgentStore,
10
+ * dataSourceConfig), not by this loader. We only probe for it so the startup
11
+ * log can tell the user whether on-disk runtime state is in effect (ui-first
12
+ * mode) instead of saying "No config file found".
13
+ */
14
+ export declare function hasServerJsonConfig(cwd?: string): boolean;
15
+ /**
16
+ * Find config file in the given directory
17
+ */
18
+ export declare function findConfigFile(cwd?: string): ConfigFileInfo | null;
19
+ /**
20
+ * Load and resolve configuration
21
+ *
22
+ * @param cwd - Working directory to search for config file
23
+ * @param force - Force reload even if cached
24
+ */
25
+ export declare function loadConfig(cwd?: string, force?: boolean): Promise<ResolvedConfig>;
26
+ /**
27
+ * Load config synchronously (for use in module initialization)
28
+ * Returns defaults if no config file or if loading fails
29
+ */
30
+ export declare function loadConfigSync(cwd?: string): ResolvedConfig;
31
+ /**
32
+ * Clear config cache (useful for testing)
33
+ */
34
+ export declare function clearConfigCache(): void;
35
+ /**
36
+ * Get config file info without loading
37
+ */
38
+ export declare function getConfigFileInfo(cwd?: string): ConfigFileInfo | null;
39
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../config/loader.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAIV,cAAc,EACd,oBAAoB,EACpB,cAAc,EAIf,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,oBAInC,CAAC;AAWF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAExE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,cAAc,GAAG,IAAI,CASjF;AAwJD;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,GAAG,GAAE,MAAsB,EAC3B,KAAK,GAAE,OAAe,GACrB,OAAO,CAAC,cAAc,CAAC,CAqCzB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,cAAc,CAmB1E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,cAAc,GAAG,IAAI,CAEpF"}