@langwatch/server 3.8.0 → 3.9.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 (1330) hide show
  1. package/README.md +3 -3
  2. package/feature-map.json +4 -2
  3. package/langevals/evaluators/langevals/langevals_langevals/select_best_compare.py +165 -5
  4. package/langevals/evaluators/langevals/tests/test_select_best_compare.py +471 -9
  5. package/langevals/ts-integration/evaluators.generated.ts +83 -63
  6. package/langwatch/.env.example +7 -0
  7. package/langwatch/biome.jsonc +23 -0
  8. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-DKvtbwGG.js +2 -0
  9. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-D1vOO9OS.js +6 -0
  10. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-zxFsPi_K.js +2 -0
  11. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-soYSKpT_.js +2 -0
  12. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-BHJmgYGv.js +3 -0
  13. package/langwatch/dist/client/assets/AddParticipants-z6X3xaWh.js +2 -0
  14. package/langwatch/dist/client/assets/AgentHistoryDrawer-kb5K4X01.js +2 -0
  15. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Cf-aA1pn.js +5 -0
  16. package/langwatch/dist/client/assets/AgentListDrawer-z4OL5IVm.js +2 -0
  17. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-Ky7GOYHj.js +2 -0
  18. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-CAszeo8y.js +2 -0
  19. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-DWrxkhIq.js +2 -0
  20. package/langwatch/dist/client/assets/AiGatewayLayout-BqznP5T2.js +2 -0
  21. package/langwatch/dist/client/assets/AnnotationsTable-C9n949u_.js +2 -0
  22. package/langwatch/dist/client/assets/AreaChart-PNFZHqkl.js +2 -0
  23. package/langwatch/dist/client/assets/AuthCard-D14g-b3Y.js +2 -0
  24. package/langwatch/dist/client/assets/AutomationDrawer-Cjo9egay.js +112 -0
  25. package/langwatch/dist/client/assets/BarChart-B23ShI5J.js +4 -0
  26. package/langwatch/dist/client/assets/BatchEvaluationSummary-CmkigWIn.js +2 -0
  27. package/langwatch/dist/client/assets/BudgetEditDrawer-nkQpQiY0.js +2 -0
  28. package/langwatch/dist/client/assets/CartesianChart-Ci1mTvgb.js +54 -0
  29. package/langwatch/dist/client/assets/CascadeArchiveDialog-BPqLe1Ai.js +2 -0
  30. package/langwatch/dist/client/assets/ChartTooltip-BMGa2HEK.js +2 -0
  31. package/langwatch/dist/client/assets/ChatWindow-BBsct-iS.js +5 -0
  32. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-DOqtlBKU.js +9 -0
  33. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk--UfSQyVR.js +2 -0
  34. package/langwatch/dist/client/assets/ColorfulBlockIcons-zwwbjL9F.js +6 -0
  35. package/langwatch/dist/client/assets/ColumnTypeIcon-CZZ6Esh0.js +2 -0
  36. package/langwatch/dist/client/assets/ComparisonLeaderboardDrawer-ChH7KNaX.js +4 -0
  37. package/langwatch/dist/client/assets/ConfirmDialog-CWzCY4sN.js +2 -0
  38. package/langwatch/dist/client/assets/ContactSalesBlock-B3w2lKdE.js +2 -0
  39. package/langwatch/dist/client/assets/Conversation-BhvQmXJ-.js +2 -0
  40. package/langwatch/dist/client/assets/CopyInput-Qeb_2bgP.js +2 -0
  41. package/langwatch/dist/client/assets/CopyableInputWithPrefix-Bp04WBtM.js +2 -0
  42. package/langwatch/dist/client/assets/CreateProjectDrawer-Dg_yrbka.js +2 -0
  43. package/langwatch/dist/client/assets/CreateTeamDrawer-CLJnKmFE.js +2 -0
  44. package/langwatch/dist/client/assets/CustomGraph-C6j6slUs.js +2 -0
  45. package/langwatch/dist/client/assets/DashboardLayout-Cn5-9Ye2.js +96 -0
  46. package/langwatch/dist/client/assets/DashboardNameDrawer-BvGn3rsq.js +2 -0
  47. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-Wx7PJ_9S.js +2 -0
  48. package/langwatch/dist/client/assets/DatasetEditorTable-Ca3bmQrl.js +2 -0
  49. package/langwatch/dist/client/assets/DatasetPickerList-RZLjPQ2S.js +2 -0
  50. package/langwatch/dist/client/assets/DatasetPreviewTable-Ck22Wy4h.js +2 -0
  51. package/langwatch/dist/client/assets/DatasetSelector-BxeSHSDD.js +2 -0
  52. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-ncleLyuX.js +2 -0
  53. package/langwatch/dist/client/assets/DeleteConfirmationDialog-Br5m12kp.js +2 -0
  54. package/langwatch/dist/client/assets/DocsLinks-D-I122gH.js +2 -0
  55. package/langwatch/dist/client/assets/DynamicZodForm-BUbQBluG.js +2 -0
  56. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-Bci7dGy6.js +3 -0
  57. package/langwatch/dist/client/assets/EditModelProviderDrawer-CdUQa5qQ.js +4 -0
  58. package/langwatch/dist/client/assets/EditProjectDrawer-DDMa3VNp.js +2 -0
  59. package/langwatch/dist/client/assets/EmojiPickerModal-BLskXRKS.js +3 -0
  60. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CGy3NpuC.js +2 -0
  61. package/langwatch/dist/client/assets/ErrorBarContext-CUuF6tzC.js +2 -0
  62. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Dw6JMkKa.js +107 -0
  63. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-F1nHh-cP.js +2 -0
  64. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-eotRSQPT.js +2 -0
  65. package/langwatch/dist/client/assets/EvaluatorEditorShared-BLZXXMFD.js +43 -0
  66. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-Bx_uZmkb.js +2 -0
  67. package/langwatch/dist/client/assets/EvaluatorListDrawer--2JYBA1w.js +2 -0
  68. package/langwatch/dist/client/assets/EvaluatorMappingsSection-DCqvgq8G.js +2 -0
  69. package/langwatch/dist/client/assets/EvaluatorSelection-BTMe6CCC.js +2 -0
  70. package/langwatch/dist/client/assets/EvaluatorSelectionBox-CDxYA37_.js +2 -0
  71. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BDgiQ_Gu.js +2 -0
  72. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-D4HFeq77.js +2 -0
  73. package/langwatch/dist/client/assets/ExecutionState-xp8LG59p.js +2 -0
  74. package/langwatch/dist/client/assets/FeatureFlagsDrawer-DIplgYQy.js +2 -0
  75. package/langwatch/dist/client/assets/FieldInfoTooltip-C_hEtQpK.js +2 -0
  76. package/langwatch/dist/client/assets/FieldsFilters-Ci5mVooQ.js +2 -0
  77. package/langwatch/dist/client/assets/FilterDisplay-BKjP30tt.js +2 -0
  78. package/langwatch/dist/client/assets/FilterSidebar-Cgxbpfi7.js +2 -0
  79. package/langwatch/dist/client/assets/FormatMoney-LZE9c_pf.js +2 -0
  80. package/langwatch/dist/client/assets/FoundryDrawer-DjVyu6Ww.js +2 -0
  81. package/langwatch/dist/client/assets/FullLogo-DRBt8v39.js +2 -0
  82. package/langwatch/dist/client/assets/GovernanceLayout-Baar1Fc8.js +2 -0
  83. package/langwatch/dist/client/assets/GraphsLayout-RNsRoPhs.js +2 -0
  84. package/langwatch/dist/client/assets/GroupBindingInputRow-BxvXd1EU.js +2 -0
  85. package/langwatch/dist/client/assets/GuardrailsDrawer-BtsfIXzD.js +91 -0
  86. package/langwatch/dist/client/assets/History-B3CO9rUC.js +17 -0
  87. package/langwatch/dist/client/assets/HorizontalFormControl-CpxShF8O.js +2 -0
  88. package/langwatch/dist/client/assets/HoverableBigText-BMBnTTnr.js +2 -0
  89. package/langwatch/dist/client/assets/InstallCliCard-DO5HE9Zk.js +2 -0
  90. package/langwatch/dist/client/assets/IntegratePaneShell-Bc7i3AU3.js +8 -0
  91. package/langwatch/dist/client/assets/InviteMemberDrawer-CiQbGDVl.js +2 -0
  92. package/langwatch/dist/client/assets/IsolatedErrorBoundary-QK1gsCee.js +2 -0
  93. package/langwatch/dist/client/assets/LLMModelCostDrawer-K4uPc99h.js +2 -0
  94. package/langwatch/dist/client/assets/LangyContextTarget-Dxr919ue.js +2 -0
  95. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-CnBBcfON.js +2 -0
  96. package/langwatch/dist/client/assets/Legend-C-o-ebW-.js +6 -0
  97. package/langwatch/dist/client/assets/Line-CbuF_DU9.js +2 -0
  98. package/langwatch/dist/client/assets/LineChart-CjG7MhLF.js +2 -0
  99. package/langwatch/dist/client/assets/ListTable-Dq11zhPy.js +2 -0
  100. package/langwatch/dist/client/assets/LoadingScreen-BRa1kl7f.js +2 -0
  101. package/langwatch/dist/client/assets/Markdown-Cip8Rj5C.js +35 -0
  102. package/langwatch/dist/client/assets/MenuLink-CEEzPpsg.js +2 -0
  103. package/langwatch/dist/client/assets/MessageCard-Nbu21sIo.js +2 -0
  104. package/langwatch/dist/client/assets/MetadataTag-CQmOL4su.js +5 -0
  105. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-s8Z1JIfQ.js +2 -0
  106. package/langwatch/dist/client/assets/ModelProviderScreen-BkZVsCiO.js +2 -0
  107. package/langwatch/dist/client/assets/ModelSelector-BjEx9IlF.js +2 -0
  108. package/langwatch/dist/client/assets/MyLayout-Dr6t6Ogu.js +2 -0
  109. package/langwatch/dist/client/assets/NavigationFooter-GfOzirbT.js +2 -0
  110. package/langwatch/dist/client/assets/NewWorkflowForm-uqnhwRpZ.js +2 -0
  111. package/langwatch/dist/client/assets/NoDataInfoBlock-Busjhz63.js +2 -0
  112. package/langwatch/dist/client/assets/OnboardingContainer-BGhio01s.js +2 -0
  113. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-DyCVUUmz.js +2 -0
  114. package/langwatch/dist/client/assets/OpsPageShell-GqOT9Ezv.js +2 -0
  115. package/langwatch/dist/client/assets/OttlEditor-BYyg1quG.js +3 -0
  116. package/langwatch/dist/client/assets/OverflownText-q6WIx911.js +2 -0
  117. package/langwatch/dist/client/assets/ProjectAvatar-B0tbfKzY.js +43 -0
  118. package/langwatch/dist/client/assets/ProjectLangyLayout-Du3nxtBV.js +82 -0
  119. package/langwatch/dist/client/assets/PromptEditorDrawer-DeL8XgdG.js +2 -0
  120. package/langwatch/dist/client/assets/PromptListDrawer-y4bmNt4t.js +2 -0
  121. package/langwatch/dist/client/assets/PropertySectionTitle-CK55WvKi.js +37 -0
  122. package/langwatch/dist/client/assets/ProviderModelSelector-B-0vpQ2t.js +2 -0
  123. package/langwatch/dist/client/assets/ProviderScopeChips-DN3rtvAE.js +2 -0
  124. package/langwatch/dist/client/assets/PushToCopiesDialog-Ry_M3FuH.js +2 -0
  125. package/langwatch/dist/client/assets/ReferenceDot-DrNtDSrg.js +2 -0
  126. package/langwatch/dist/client/assets/RenderInputOutput-DqsCnspr.js +261 -0
  127. package/langwatch/dist/client/assets/ScatterChart-jarSkvrF.js +2 -0
  128. package/langwatch/dist/client/assets/ScenarioFormDrawer-DvJcYmkQ.js +2 -0
  129. package/langwatch/dist/client/assets/ScenarioInputMappingSection-BewVLFCZ.js +2 -0
  130. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-BAPna8ym.js +3 -0
  131. package/langwatch/dist/client/assets/ScopeChipPicker-pQ061i-c.js +2 -0
  132. package/langwatch/dist/client/assets/SearchInput-DH_qIhwi.js +2 -0
  133. package/langwatch/dist/client/assets/SectionNavigationLayout-DwPBnqYj.js +2 -0
  134. package/langwatch/dist/client/assets/SelectDatasetDrawer-8MPCEZID.js +2 -0
  135. package/langwatch/dist/client/assets/SelectionActionBar-C2SOsiow.js +2 -0
  136. package/langwatch/dist/client/assets/SeriesFilterDrawer-d5DYEKTZ.js +2 -0
  137. package/langwatch/dist/client/assets/SettingsLayout-ZI47ZjuT.js +2 -0
  138. package/langwatch/dist/client/assets/SetupWithAgentButton-CNTb3Avj.js +4 -0
  139. package/langwatch/dist/client/assets/ShikiCommandBox-u0WEsz_9.js +5 -0
  140. package/langwatch/dist/client/assets/SpanDetails-L_YT0nxH.js +3 -0
  141. package/langwatch/dist/client/assets/SubscriptionPage-CaUbKJjG.js +2 -0
  142. package/langwatch/dist/client/assets/SuiteFormDrawer-BjUQdKq8.js +2 -0
  143. package/langwatch/dist/client/assets/Symbols-R6sphPWl.js +2 -0
  144. package/langwatch/dist/client/assets/TabButton-8Oc9UYh8.js +3 -0
  145. package/langwatch/dist/client/assets/TableCell-Ci8ylzki.js +2 -0
  146. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-DSKFRtdD.js +2 -0
  147. package/langwatch/dist/client/assets/TeamForm-CL9ycvq0.js +2 -0
  148. package/langwatch/dist/client/assets/TeamUserRoleField-D0ZTlKiH.js +2 -0
  149. package/langwatch/dist/client/assets/TraceDetails-JolY6sXJ.js +9 -0
  150. package/langwatch/dist/client/assets/TraceDetailsDrawer-lgPzHJ3L.js +2 -0
  151. package/langwatch/dist/client/assets/TraceIdPeek-DDi0ChdF.js +2 -0
  152. package/langwatch/dist/client/assets/TracesMapping-BPXT_-h4.js +2 -0
  153. package/langwatch/dist/client/assets/UpgradeModalContent-DmGd0n65.js +2 -0
  154. package/langwatch/dist/client/assets/UploadCSVDrawer-haYFZH65.js +3 -0
  155. package/langwatch/dist/client/assets/VariablesSection-DW_-pHw8.js +2 -0
  156. package/langwatch/dist/client/assets/VersionBadge-BrsZ4NP1.js +2 -0
  157. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9tl6d9Q.js +1161 -0
  158. package/langwatch/dist/client/assets/ViewAutomationDrawer-DliGiKaC.js +2 -0
  159. package/langwatch/dist/client/assets/VirtualKeySecretReveal-B9QMNIxJ.js +54 -0
  160. package/langwatch/dist/client/assets/WelcomeLayout-DZ1ue0he.js +2 -0
  161. package/langwatch/dist/client/assets/WithFeatureFlagGuard-CgkIIt3_.js +2 -0
  162. package/langwatch/dist/client/assets/WithPermissionGuard-Da_hdEdq.js +2 -0
  163. package/langwatch/dist/client/assets/WorkflowCard-C_ClnTV_.js +2 -0
  164. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-DozYRazW.js +2 -0
  165. package/langwatch/dist/client/assets/_...path_-Da4obdgF.js +2 -0
  166. package/langwatch/dist/client/assets/_Uint8Array-BKsS4AYJ.js +2 -0
  167. package/langwatch/dist/client/assets/__...path__-hjRUlcmj.js +22 -0
  168. package/langwatch/dist/client/assets/_baseAssignValue-B0IP5NGP.js +2 -0
  169. package/langwatch/dist/client/assets/_baseClone-DWP1OuEe.js +2 -0
  170. package/langwatch/dist/client/assets/_baseEach-Bv6waMUN.js +2 -0
  171. package/langwatch/dist/client/assets/_baseFor-K5aTWdeA.js +2 -0
  172. package/langwatch/dist/client/assets/_experiment_-Cv2h4AYK.js +2 -0
  173. package/langwatch/dist/client/assets/_id_-BoubOQoS.js +2 -0
  174. package/langwatch/dist/client/assets/_id_-BuzJEIUf.js +2 -0
  175. package/langwatch/dist/client/assets/_id_-BzLlrR7z.js +2 -0
  176. package/langwatch/dist/client/assets/_id_-DAzjJ7AY.js +2 -0
  177. package/langwatch/dist/client/assets/_id_-Dc2UAWAO.js +2 -0
  178. package/langwatch/dist/client/assets/_id_-DwutdLKk.js +2 -0
  179. package/langwatch/dist/client/assets/_id_-H7-5DI5r.js +2 -0
  180. package/langwatch/dist/client/assets/_project_-DTuunSJZ.js +8 -0
  181. package/langwatch/dist/client/assets/_runId_-BGhwmwQj.js +7 -0
  182. package/langwatch/dist/client/assets/_shell-ChQAHWWX.js +2 -0
  183. package/langwatch/dist/client/assets/_slug_-D6Y2wsW5.js +2 -0
  184. package/langwatch/dist/client/assets/_slug_-DLKkXVG8.js +2 -0
  185. package/langwatch/dist/client/assets/_slug_-yLo6E4BE.js +17 -0
  186. package/langwatch/dist/client/assets/_team_-TUptH6wK.js +2 -0
  187. package/langwatch/dist/client/assets/_workflow_-B_flNNON.js +3 -0
  188. package/langwatch/dist/client/assets/_workflow_-DUyBeEF1.js +25 -0
  189. package/langwatch/dist/client/assets/accept-BtE8pbrP.js +2 -0
  190. package/langwatch/dist/client/assets/activity-BDNvBEBL.js +1 -0
  191. package/langwatch/dist/client/assets/agents-CZnWSlhu.js +2 -0
  192. package/langwatch/dist/client/assets/alerts-BDNvBEBL.js +1 -0
  193. package/langwatch/dist/client/assets/all-in7z_yGY.js +2 -0
  194. package/langwatch/dist/client/assets/analytics-C8m2qboV.js +2 -0
  195. package/langwatch/dist/client/assets/annotation-scores-hmT53w46.js +2 -0
  196. package/langwatch/dist/client/assets/annotations-DwouO48Z.js +2 -0
  197. package/langwatch/dist/client/assets/anomaly-rules-DoJdIoCt.js +2 -0
  198. package/langwatch/dist/client/assets/api-keys-CykxAxvG.js +4 -0
  199. package/langwatch/dist/client/assets/asaplangy-D3J00Q-Z.js +5 -0
  200. package/langwatch/dist/client/assets/audit-log-Dy4vcEeJ.js +2 -0
  201. package/langwatch/dist/client/assets/auth-IqMSC5k1.js +2 -0
  202. package/langwatch/dist/client/assets/authentication-BqVl7Fh-.js +2 -0
  203. package/langwatch/dist/client/assets/authorize-BGMc1Gzv.js +2 -0
  204. package/langwatch/dist/client/assets/authorize-DhHzBVUd.js +2 -0
  205. package/langwatch/dist/client/assets/automations-BDNvBEBL.js +1 -0
  206. package/langwatch/dist/client/assets/automations-BhzNESFp.js +2 -0
  207. package/langwatch/dist/client/assets/billing-plans-D_IT1cHz.js +2 -0
  208. package/langwatch/dist/client/assets/blank-Ct2wtHyX.js +2 -0
  209. package/langwatch/dist/client/assets/blobs-Dwi1OImQ.js +2 -0
  210. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CnAsMlS_.js +133 -0
  211. package/langwatch/dist/client/assets/budgets-Cn5gXQK_.js +3 -0
  212. package/langwatch/dist/client/assets/bug-reports-feRha8NA.js +2 -0
  213. package/langwatch/dist/client/assets/cache-rules-T0g7jfVv.js +2 -0
  214. package/langwatch/dist/client/assets/choose-D7SJAjkq.js +2 -0
  215. package/langwatch/dist/client/assets/chunk-EX3LRPZG-DkekrL-i.js +232 -0
  216. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-2uc49Oqf.js +3 -0
  217. package/langwatch/dist/client/assets/chunk-PUDLZKDR-CdFvlX4m.js +157 -0
  218. package/langwatch/dist/client/assets/chunk-RYQCIY6F-BLUBc3em.js +2 -0
  219. package/langwatch/dist/client/assets/chunk-V7JOEXUC-daLm26hJ.js +207 -0
  220. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-CDA8LHAw.js +2 -0
  221. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-CDA8LHAw.js +2 -0
  222. package/langwatch/dist/client/assets/clsx-CjueKrWZ.js +2 -0
  223. package/langwatch/dist/client/assets/codeAgentConfig-BGKq9uCt.js +7 -0
  224. package/langwatch/dist/client/assets/codingDefaultSync-BHSxIX3Y.js +2 -0
  225. package/langwatch/dist/client/assets/configure-CrBmyV7I.js +4 -0
  226. package/langwatch/dist/client/assets/constants-CDt5HyiB.js +2 -0
  227. package/langwatch/dist/client/assets/custom-wRFdLdR4.js +12 -0
  228. package/langwatch/dist/client/assets/custom_evaluator-C4ikBFuX.js +31 -0
  229. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BElJnuGp.js +5 -0
  230. package/langwatch/dist/client/assets/dagre-VMur7wh6.js +2 -0
  231. package/langwatch/dist/client/assets/data-privacy-DAIYO4AS.js +2 -0
  232. package/langwatch/dist/client/assets/data-retention-6spK_HnV.js +2 -0
  233. package/langwatch/dist/client/assets/datasets-_6-oF4ZW.js +2 -0
  234. package/langwatch/dist/client/assets/debounce-CS9Z04io.js +2 -0
  235. package/langwatch/dist/client/assets/defaultModelState-B2tL23ua.js +2 -0
  236. package/langwatch/dist/client/assets/dejaview-Cde-wWV4.js +2 -0
  237. package/langwatch/dist/client/assets/departments-Cm-0ZxEt.js +2 -0
  238. package/langwatch/dist/client/assets/devices-DmiWzGY2.js +2 -0
  239. package/langwatch/dist/client/assets/dist-C4xeXVRv.js +6 -0
  240. package/langwatch/dist/client/assets/drawerFromUrl-CKr5SifD.js +2 -0
  241. package/langwatch/dist/client/assets/edit-CLmkWTOM.js +62 -0
  242. package/langwatch/dist/client/assets/email-suppressions-cqwH0a9N.js +2 -0
  243. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-Byy32QYy.js +86 -0
  244. package/langwatch/dist/client/assets/error-D8QCVS4R.js +2 -0
  245. package/langwatch/dist/client/assets/errors-mlatPkMI.js +2 -0
  246. package/langwatch/dist/client/assets/evaluations-BBoYdpZy.js +2 -0
  247. package/langwatch/dist/client/assets/evaluations-DhzXchFj.js +2 -0
  248. package/langwatch/dist/client/assets/evaluators-BtHslgaT.js +2 -0
  249. package/langwatch/dist/client/assets/evaluators-_EDCn-tQ.js +148 -0
  250. package/langwatch/dist/client/assets/experiments-CffarahA.js +1 -0
  251. package/langwatch/dist/client/assets/feature-flags-mcBTRF0E.js +2 -0
  252. package/langwatch/dist/client/assets/fetchSSE-CnJPAkno.js +3 -0
  253. package/langwatch/dist/client/assets/fieldset-kmG3NTVs.js +2 -0
  254. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-CY9NG0NN.js +1 -0
  255. package/langwatch/dist/client/assets/forgot-password-wo5Sna-0.js +2 -0
  256. package/langwatch/dist/client/assets/formatMoney-ClmqgvaY.js +2 -0
  257. package/langwatch/dist/client/assets/formatTargetOutput-DXvqMkYJ.js +2 -0
  258. package/langwatch/dist/client/assets/foundry-CfvGgfP0.js +477 -0
  259. package/langwatch/dist/client/assets/gateway-Be0EsD57.js +2 -0
  260. package/langwatch/dist/client/assets/getEvaluator-D2EjIa3G.js +2 -0
  261. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-D2oUP3Tn.js +2 -0
  262. package/langwatch/dist/client/assets/governance-YZL-Q4Vy.js +2 -0
  263. package/langwatch/dist/client/assets/graphlib-DsLTzvlk.js +2 -0
  264. package/langwatch/dist/client/assets/grid-MxZhegzw.js +2 -0
  265. package/langwatch/dist/client/assets/groups-BmusUt3C.js +2 -0
  266. package/langwatch/dist/client/assets/guardrails-DAx8mDop.js +2 -0
  267. package/langwatch/dist/client/assets/handled-error-DbmvFmFF.js +2 -0
  268. package/langwatch/dist/client/assets/http-C64lOZI7.js +7 -0
  269. package/langwatch/dist/client/assets/identifierUtils-C2FgAR6z.js +2 -0
  270. package/langwatch/dist/client/assets/immer-DImI3Uq2.js +14 -0
  271. package/langwatch/dist/client/assets/index-8SbDirJv.js +68 -0
  272. package/langwatch/dist/client/assets/ingestion-source-detail-PQbeRniA.js +19 -0
  273. package/langwatch/dist/client/assets/ingestion-sources-CCyiAKHP.js +12 -0
  274. package/langwatch/dist/client/assets/integrations-WSl7N8v9.js +2 -0
  275. package/langwatch/dist/client/assets/isArrayLikeObject-DQ6J5Gh8.js +2 -0
  276. package/langwatch/dist/client/assets/isSymbol-DQQCRrSw.js +2 -0
  277. package/langwatch/dist/client/assets/langyHomeSuggestions-czH603Eu.js +2 -0
  278. package/langwatch/dist/client/assets/license-BXfbZQgG.js +2 -0
  279. package/langwatch/dist/client/assets/licenseStatusUtils-CeEgqpQ1.js +2 -0
  280. package/langwatch/dist/client/assets/lu-BSZWBZXU.js +2 -0
  281. package/langwatch/dist/client/assets/map-DUpZ7PrO.js +2 -0
  282. package/langwatch/dist/client/assets/mappingValidation-C7knTdfD.js +2 -0
  283. package/langwatch/dist/client/assets/me-DbCM2fI8.js +7 -0
  284. package/langwatch/dist/client/assets/me-DgXzEkaD.js +2 -0
  285. package/langwatch/dist/client/assets/members-CNILhgB4.js +2 -0
  286. package/langwatch/dist/client/assets/mermaid.core-1LNrQSiZ.js +12 -0
  287. package/langwatch/dist/client/assets/messages-CIoUj-2S.js +2 -0
  288. package/langwatch/dist/client/assets/metrics-Ba4ghWyR.js +2 -0
  289. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-BsK9qdX4.js +97 -0
  290. package/langwatch/dist/client/assets/model-costs-Cmo-7iNN.js +2 -0
  291. package/langwatch/dist/client/assets/model-providers-DNeQW-T1.js +2 -0
  292. package/langwatch/dist/client/assets/modelProviderHelpers-BgYFTBND.js +2 -0
  293. package/langwatch/dist/client/assets/my-queue-DAyfQ6lp.js +2 -0
  294. package/langwatch/dist/client/assets/normalizeComparison-QGQpERT7.js +2 -0
  295. package/langwatch/dist/client/assets/not-found-BFkr8OS7.js +2 -0
  296. package/langwatch/dist/client/assets/now-BWCCq_PO.js +2 -0
  297. package/langwatch/dist/client/assets/onboarding-DAAoh3gE.js +2 -0
  298. package/langwatch/dist/client/assets/online-evaluations-DbC0C3ct.js +2 -0
  299. package/langwatch/dist/client/assets/ops-BnGgY3gP.js +2 -0
  300. package/langwatch/dist/client/assets/organizations-D-hWxeYL.js +2 -0
  301. package/langwatch/dist/client/assets/pages-BthWVZpr.js +2 -0
  302. package/langwatch/dist/client/assets/persistence-NkzSPIBC.js +2 -0
  303. package/langwatch/dist/client/assets/personalProject-C9vU_vdl.js +2 -0
  304. package/langwatch/dist/client/assets/plans-B_rx4bLE.js +2 -0
  305. package/langwatch/dist/client/assets/preconditionFieldUtils-ryKgG9T1.js +2 -0
  306. package/langwatch/dist/client/assets/product-BuY5Xwg3.js +2 -0
  307. package/langwatch/dist/client/assets/project-C2NjfKL8.js +2 -0
  308. package/langwatch/dist/client/assets/projections-rLpLV9w3.js +2 -0
  309. package/langwatch/dist/client/assets/projects-BF0LrAID.js +2 -0
  310. package/langwatch/dist/client/assets/promptHandle-BT-5THDj.js +2 -0
  311. package/langwatch/dist/client/assets/prompts-BHe5aLJx.js +8 -0
  312. package/langwatch/dist/client/assets/radio-group-BPt-WSZX.js +2 -0
  313. package/langwatch/dist/client/assets/registry-olFQKglt.js +2 -0
  314. package/langwatch/dist/client/assets/reports-BLYN6Q1s.js +2 -0
  315. package/langwatch/dist/client/assets/request-DFzKYavU.js +2 -0
  316. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-CRtGWC_J.js +85 -0
  317. package/langwatch/dist/client/assets/reset-password-DYZspdMQ.js +2 -0
  318. package/langwatch/dist/client/assets/role-bindings-FmulBsng.js +2 -0
  319. package/langwatch/dist/client/assets/roles-RLhR-aqL.js +2 -0
  320. package/langwatch/dist/client/assets/routing-policies-ljceihkc.js +5 -0
  321. package/langwatch/dist/client/assets/scenarios-BQqYDDZG.js +2 -0
  322. package/langwatch/dist/client/assets/scheduler-BFnKJjAw.js +2 -0
  323. package/langwatch/dist/client/assets/schedules-BDNvBEBL.js +1 -0
  324. package/langwatch/dist/client/assets/scim-Bmka9JwE.js +2 -0
  325. package/langwatch/dist/client/assets/seatTypeCopy-fhsCX-T3.js +2 -0
  326. package/langwatch/dist/client/assets/secrets-Cwr6m0Ec.js +2 -0
  327. package/langwatch/dist/client/assets/segment-group-BktqF-NE.js +2 -0
  328. package/langwatch/dist/client/assets/segmented-control-Dux7mG6V.js +2 -0
  329. package/langwatch/dist/client/assets/select-BvA110t-.js +2 -0
  330. package/langwatch/dist/client/assets/send-KqbwnHm5.js +2 -0
  331. package/langwatch/dist/client/assets/sequenceView-CXTCS8lF.js +5 -0
  332. package/langwatch/dist/client/assets/seriesOptions-B04NlY20.js +1015 -0
  333. package/langwatch/dist/client/assets/settings-U355L_I1.js +2 -0
  334. package/langwatch/dist/client/assets/setup-BlSoABYV.js +2 -0
  335. package/langwatch/dist/client/assets/shikiAdapter-Ctbe7cQu.js +3 -0
  336. package/langwatch/dist/client/assets/showSuiteRunError-D2fez5Ub.js +2 -0
  337. package/langwatch/dist/client/assets/signin-DyT1qLoq.js +2 -0
  338. package/langwatch/dist/client/assets/signup-D8m3PZ3b.js +2 -0
  339. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-iaTfadDT.js +2 -0
  340. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-DH-TUWs1.js +2 -0
  341. package/langwatch/dist/client/assets/subscription-_ypR9RT2.js +3 -0
  342. package/langwatch/dist/client/assets/subscriptions-BRPlrnsz.js +2 -0
  343. package/langwatch/dist/client/assets/suggestionUI-BvF9IL3n.js +106 -0
  344. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-DT3qutmi.js +3 -0
  345. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-Chcqm6v8.js +9 -0
  346. package/langwatch/dist/client/assets/switch-BZp2DIfW.js +2 -0
  347. package/langwatch/dist/client/assets/switch-C1DNHB2v.js +2 -0
  348. package/langwatch/dist/client/assets/tabs-B6CQXTUQ.js +2 -0
  349. package/langwatch/dist/client/assets/teams-B3Yc0LtS.js +2 -0
  350. package/langwatch/dist/client/assets/teams-Df3DGQGZ.js +2 -0
  351. package/langwatch/dist/client/assets/tool-catalog-CpVqJ_Dp.js +7 -0
  352. package/langwatch/dist/client/assets/toolIcons-CwYXl2Eu.js +2 -0
  353. package/langwatch/dist/client/assets/tooltip-CM-lMDNU.js +2 -0
  354. package/langwatch/dist/client/assets/topic-clustering-DEtDEXOU.js +2 -0
  355. package/langwatch/dist/client/assets/topics-BGSBPvH8.js +2 -0
  356. package/langwatch/dist/client/assets/traceStore-C-SeEWpA.js +55 -0
  357. package/langwatch/dist/client/assets/traces-hMC5nfWE.js +289 -0
  358. package/langwatch/dist/client/assets/tracesMapping-CJhNJ9Ej.js +3 -0
  359. package/langwatch/dist/client/assets/tracking-in5OR8uP.js +2 -0
  360. package/langwatch/dist/client/assets/types-DNh2n8ZE.js +2 -0
  361. package/langwatch/dist/client/assets/types-OZJZgbcd.js +2 -0
  362. package/langwatch/dist/client/assets/types-nw9Z9F-v.js +2 -0
  363. package/langwatch/dist/client/assets/undo-2-CYjzz3Fj.js +2 -0
  364. package/langwatch/dist/client/assets/usage-BMXYHJUH.js +2 -0
  365. package/langwatch/dist/client/assets/usage-Da6wBDdP.js +2 -0
  366. package/langwatch/dist/client/assets/use-generic-onboarding-flow-eie3NRF5.js +2 -0
  367. package/langwatch/dist/client/assets/useActivePlan-Dsa3BYxd.js +2 -0
  368. package/langwatch/dist/client/assets/useAllPromptsForProject-BS-h_uSZ.js +2 -0
  369. package/langwatch/dist/client/assets/useAnnotationQueues-BMo2kZ_n.js +2 -0
  370. package/langwatch/dist/client/assets/useAvailableEvaluators-DkZ2Yt1F.js +2 -0
  371. package/langwatch/dist/client/assets/useCyclingVerb-BTWaxKR2.js +2 -0
  372. package/langwatch/dist/client/assets/useDepartmentColumn-xoZ52lPP.js +2 -0
  373. package/langwatch/dist/client/assets/useEvaluationsV3Store-CjI63SqB.js +2 -0
  374. package/langwatch/dist/client/assets/useExportTraces-kA2TFkjy.js +2 -0
  375. package/langwatch/dist/client/assets/useFeatureFlag-BjAcqOFH.js +2 -0
  376. package/langwatch/dist/client/assets/usePersonalContext-BGjy_Vrg.js +2 -0
  377. package/langwatch/dist/client/assets/useProjectSpanNames-DV-N8Iqc.js +2 -0
  378. package/langwatch/dist/client/assets/useProjectsForCopy-C63wLMNr.js +2 -0
  379. package/langwatch/dist/client/assets/useRunViaApiTabs-DMsq4RV1.js +50 -0
  380. package/langwatch/dist/client/assets/useShowLangy-C1pPUZqz.js +2 -0
  381. package/langwatch/dist/client/assets/useSimulationUpdateListener-ufWGuGhO.js +2 -0
  382. package/langwatch/dist/client/assets/useTargetName-DRCsNovZ.js +2 -0
  383. package/langwatch/dist/client/assets/useTargetNameMap-2sQCSyzN.js +2 -0
  384. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CWSKPTh_.js +2 -0
  385. package/langwatch/dist/client/assets/useTraceUpdateListener-DqLF7KuU.js +2 -0
  386. package/langwatch/dist/client/assets/useUrlScopeFilter-BmRsU3rU.js +2 -0
  387. package/langwatch/dist/client/assets/useVariantMetrics-CK9aOmIb.js +2 -0
  388. package/langwatch/dist/client/assets/useWorkflowStore-CWWkoMW1.js +8 -0
  389. package/langwatch/dist/client/assets/users-B9jauEWz.js +2 -0
  390. package/langwatch/dist/client/assets/users-C8IaWy9-.js +2 -0
  391. package/langwatch/dist/client/assets/users-DIbzKO8Q.js +2 -0
  392. package/langwatch/dist/client/assets/v3-C9Ud_O3k.js +2 -0
  393. package/langwatch/dist/client/assets/variables-Dox25KUK.js +396 -0
  394. package/langwatch/dist/client/assets/viewStore-BCIvcW8n.js +2 -0
  395. package/langwatch/dist/client/assets/virtual-keys-D-qkAFBv.js +2 -0
  396. package/langwatch/dist/client/assets/welcome-CnjW7kg3.js +16 -0
  397. package/langwatch/dist/client/assets/wizard-CUCaNag_.js +2 -0
  398. package/langwatch/dist/client/assets/workbench-N1DutXtL.js +2 -0
  399. package/langwatch/dist/client/assets/workflows-D2XRYWpS.js +3 -0
  400. package/langwatch/dist/client/assets/wrap-D_XqGHIU.js +2 -0
  401. package/langwatch/dist/client/index.html +4 -4
  402. package/langwatch/dist/scenario-child-process.js +7 -0
  403. package/langwatch/e2e/auth-regression/better-auth-sso-smoketest.ts +72 -0
  404. package/langwatch/ee/LICENSE.md +52 -18
  405. package/langwatch/ee/README.md +15 -6
  406. package/langwatch/ee/admin/routes/__tests__/admin.integration.test.ts +1 -1
  407. package/langwatch/ee/admin/routes/admin.ts +1 -1
  408. package/langwatch/ee/audit-log/auditLog.ts +51 -0
  409. package/langwatch/ee/billing/__tests__/planLimits.unit.test.ts +6 -6
  410. package/langwatch/ee/billing/__tests__/planProvider.unit.test.ts +21 -33
  411. package/langwatch/ee/billing/__tests__/subscription.service.unit.test.ts +1 -0
  412. package/langwatch/ee/billing/__tests__/usage-limit.service.unit.test.ts +17 -17
  413. package/langwatch/ee/billing/planLimits.ts +1 -37
  414. package/langwatch/ee/billing/planProvider.ts +0 -13
  415. package/langwatch/ee/governance/reactors/__tests__/gatewayBudgetSync.reactor.unit.test.ts +39 -0
  416. package/langwatch/ee/governance/reactors/__tests__/governanceKpisSync.reactor.unit.test.ts +33 -0
  417. package/langwatch/ee/governance/reactors/__tests__/governanceOcsfEventsSync.reactor.unit.test.ts +33 -0
  418. package/langwatch/ee/governance/reactors/__tests__/governanceReactorsPreEnqueueGate.unit.test.ts +243 -0
  419. package/langwatch/ee/governance/reactors/gatewayBudgetSync.reactor.ts +391 -185
  420. package/langwatch/ee/governance/reactors/governanceKpisSync.reactor.ts +14 -7
  421. package/langwatch/ee/governance/reactors/governanceOcsfEventsSync.reactor.ts +97 -81
  422. package/langwatch/ee/governance/services/governanceAttributeKeys.ts +17 -0
  423. package/langwatch/ee/licensing/__tests__/constants.unit.test.ts +4 -6
  424. package/langwatch/ee/licensing/__tests__/defaults.unit.test.ts +63 -86
  425. package/langwatch/ee/licensing/__tests__/fixtures/testLicenses.ts +18 -0
  426. package/langwatch/ee/licensing/__tests__/licenseGenerationService.unit.test.ts +52 -16
  427. package/langwatch/ee/licensing/__tests__/licenseHandler.integration.test.ts +199 -15
  428. package/langwatch/ee/licensing/__tests__/mintedPlan.unit.test.ts +110 -0
  429. package/langwatch/ee/licensing/__tests__/planMapping.unit.test.ts +4 -29
  430. package/langwatch/ee/licensing/__tests__/planTemplates.unit.test.ts +0 -61
  431. package/langwatch/ee/licensing/__tests__/validation.unit.test.ts +69 -0
  432. package/langwatch/ee/licensing/constants.ts +11 -59
  433. package/langwatch/ee/licensing/defaults.ts +20 -32
  434. package/langwatch/ee/licensing/licenseGenerationService.ts +6 -19
  435. package/langwatch/ee/licensing/licenseHandler.ts +109 -92
  436. package/langwatch/ee/licensing/mintedPlan.ts +57 -0
  437. package/langwatch/ee/licensing/ossBaselineFloor.ts +45 -0
  438. package/langwatch/ee/licensing/planInfo.ts +0 -13
  439. package/langwatch/ee/licensing/planMapping.ts +0 -13
  440. package/langwatch/ee/licensing/planTemplates.ts +8 -42
  441. package/langwatch/ee/licensing/types.ts +24 -29
  442. package/langwatch/ee/licensing/validation.ts +13 -1
  443. package/langwatch/ee/scim/__tests__/scim-token.service.unit.test.ts +110 -0
  444. package/langwatch/ee/scim/__tests__/scim.costCenter.integration.test.ts +171 -0
  445. package/langwatch/ee/scim/__tests__/scim.service.unit.test.ts +415 -0
  446. package/langwatch/ee/scim/routes.ts +585 -0
  447. package/langwatch/ee/scim/scim-group.service.ts +465 -0
  448. package/langwatch/ee/scim/scim-role-resolver.ts +48 -0
  449. package/langwatch/ee/scim/scim-role-resolver.unit.test.ts +93 -0
  450. package/langwatch/ee/scim/scim-token.service.ts +71 -0
  451. package/langwatch/ee/scim/scim.service.ts +554 -0
  452. package/langwatch/ee/scim/scim.types.ts +149 -0
  453. package/langwatch/ee/scim/webhooks.ts +170 -0
  454. package/langwatch/ee/sso/__tests__/fallbackName.test.ts +142 -0
  455. package/langwatch/ee/sso/__tests__/matching.test.ts +126 -0
  456. package/langwatch/ee/sso/__tests__/parseIssuerUrl.test.ts +59 -0
  457. package/langwatch/ee/sso/__tests__/sso-gate.test.ts +459 -0
  458. package/langwatch/ee/sso/__tests__/sso-license.repository.test.ts +53 -0
  459. package/langwatch/ee/sso/__tests__/ssoPathGate.test.ts +182 -0
  460. package/langwatch/ee/sso/__tests__/ssoRouteTableCanary.test.ts +186 -0
  461. package/langwatch/ee/sso/matching.ts +48 -0
  462. package/langwatch/ee/sso/providers.ts +271 -0
  463. package/langwatch/ee/sso/sso-gate.ts +294 -0
  464. package/langwatch/ee/sso/sso-license.repository.ts +47 -0
  465. package/langwatch/ee/sso/ssoPathGate.ts +127 -0
  466. package/langwatch/package.json +1 -1
  467. package/langwatch/prisma/migrations/20260802120000_organization_user_disabled_at/migration.sql +7 -0
  468. package/langwatch/prisma/schema.prisma +8 -0
  469. package/langwatch/scripts/check-feature-parity.ts +0 -4
  470. package/langwatch/src/__tests__/noBinarySourceFiles.unit.test.ts +56 -0
  471. package/langwatch/src/app/api/agents/[[...route]]/app.ts +0 -2
  472. package/langwatch/src/app/api/agents/__tests__/agents-rest-api.integration.test.ts +0 -22
  473. package/langwatch/src/app/api/dashboards/[[...route]]/app.ts +0 -2
  474. package/langwatch/src/app/api/dashboards/__tests__/dashboard-rest-api.integration.test.ts +0 -18
  475. package/langwatch/src/app/api/dataset/[[...route]]/app.ts +0 -33
  476. package/langwatch/src/app/api/dataset/__tests__/dataset-rest-api.integration.test.ts +0 -24
  477. package/langwatch/src/app/api/dataset/__tests__/dataset-upload-api.integration.test.ts +0 -25
  478. package/langwatch/src/app/api/evaluators/[[...route]]/app.v1.ts +0 -2
  479. package/langwatch/src/app/api/export/scenario-runs/[[...route]]/app.ts +250 -0
  480. package/langwatch/src/app/api/export/scenario-runs/__tests__/scenario-run-export-route.integration.test.ts +336 -0
  481. package/langwatch/src/app/api/graphs/[[...route]]/app.ts +0 -2
  482. package/langwatch/src/app/api/middleware/__tests__/error-handler.unit.test.ts +4 -4
  483. package/langwatch/src/app/api/middleware/index.ts +0 -1
  484. package/langwatch/src/app/api/monitors/[[...route]]/app.ts +0 -2
  485. package/langwatch/src/app/api/projects/[[...route]]/app.ts +28 -8
  486. package/langwatch/src/app/api/prompts/[[...route]]/app.v1.ts +0 -2
  487. package/langwatch/src/app/api/scenario-events/[[...route]]/app.ts +0 -5
  488. package/langwatch/src/app/api/scenarios/[[...route]]/app.v1.ts +0 -2
  489. package/langwatch/src/app/api/shared/errors.ts +14 -0
  490. package/langwatch/src/app/api/simulation-runs/__tests__/simulation-run-platform-url.integration.test.ts +6 -3
  491. package/langwatch/src/app/api/suites/[[...route]]/app.ts +0 -2
  492. package/langwatch/src/app/api/teams/[[...route]]/app.ts +22 -1
  493. package/langwatch/src/app/api/teams/__tests__/teams-rest-api.integration.test.ts +146 -0
  494. package/langwatch/src/app/api/traces/[[...route]]/app.v1.ts +114 -0
  495. package/langwatch/src/app/api/triggers/[[...route]]/app.ts +0 -2
  496. package/langwatch/src/components/AddMembersForm.tsx +25 -5
  497. package/langwatch/src/components/AddOrEditDatasetDrawer.tsx +1 -9
  498. package/langwatch/src/components/ComparisonLeaderboardDrawer.tsx +496 -0
  499. package/langwatch/src/components/LicenseStatus.tsx +14 -16
  500. package/langwatch/src/components/__tests__/ComparisonLeaderboardDrawer.gate.integration.test.tsx +146 -0
  501. package/langwatch/src/components/__tests__/LicenseStatus.integration.test.tsx +129 -0
  502. package/langwatch/src/components/__tests__/UpgradeModal.integration.test.tsx +358 -68
  503. package/langwatch/src/components/agents/AgentCodeEditorDrawer.tsx +7 -14
  504. package/langwatch/src/components/agents/AgentHttpEditorDrawer.tsx +7 -14
  505. package/langwatch/src/components/agents/WorkflowSelectorDrawer.tsx +1 -15
  506. package/langwatch/src/components/analytics/DashboardNameDrawer.tsx +20 -26
  507. package/langwatch/src/components/auth/AuthCard.tsx +41 -0
  508. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResults.tsx +72 -0
  509. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResultsTable.tsx +109 -2
  510. package/langwatch/src/components/batch-evaluation-results/ComparisonCharts.tsx +241 -77
  511. package/langwatch/src/components/batch-evaluation-results/ComparisonLeaderboardChart.tsx +355 -0
  512. package/langwatch/src/components/batch-evaluation-results/ComparisonTable.tsx +437 -75
  513. package/langwatch/src/components/batch-evaluation-results/LeaderboardStep.tsx +105 -0
  514. package/langwatch/src/components/batch-evaluation-results/LeaderboardTrustPanel.tsx +464 -0
  515. package/langwatch/src/components/batch-evaluation-results/LeaderboardVerdictPanel.tsx +354 -0
  516. package/langwatch/src/components/batch-evaluation-results/PairwiseLeaderboard.tsx +553 -0
  517. package/langwatch/src/components/batch-evaluation-results/ParetoScatterChart.tsx +512 -0
  518. package/langwatch/src/components/batch-evaluation-results/TradeoffSummaryLine.tsx +58 -0
  519. package/langwatch/src/components/batch-evaluation-results/WinRateChart.tsx +12 -4
  520. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.filter-overflow.integration.test.tsx +8 -1
  521. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.leaderboard-gate.integration.test.tsx +192 -0
  522. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.test.tsx +8 -1
  523. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonTable.group-by-metadata.integration.test.tsx +352 -0
  524. package/langwatch/src/components/batch-evaluation-results/__tests__/bootstrapMeanCI.unit.test.ts +98 -0
  525. package/langwatch/src/components/batch-evaluation-results/__tests__/buildAxisLabels.unit.test.ts +134 -0
  526. package/langwatch/src/components/batch-evaluation-results/__tests__/buildPairwiseComparisons.test.ts +95 -0
  527. package/langwatch/src/components/batch-evaluation-results/__tests__/buildTrustChecks.unit.test.ts +551 -0
  528. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBTLeaderboard.test.ts +428 -0
  529. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBandClipping.unit.test.ts +125 -0
  530. package/langwatch/src/components/batch-evaluation-results/__tests__/computeComparability.unit.test.ts +208 -0
  531. package/langwatch/src/components/batch-evaluation-results/__tests__/computeJudgeBiasChecks.unit.test.ts +186 -0
  532. package/langwatch/src/components/batch-evaluation-results/__tests__/computeLeaderboardVerdict.test.ts +288 -0
  533. package/langwatch/src/components/batch-evaluation-results/__tests__/computeParetoDominance.unit.test.ts +599 -0
  534. package/langwatch/src/components/batch-evaluation-results/__tests__/computeSampleAdequacy.unit.test.ts +212 -0
  535. package/langwatch/src/components/batch-evaluation-results/__tests__/computeScoreBarScale.unit.test.ts +104 -0
  536. package/langwatch/src/components/batch-evaluation-results/__tests__/computeVariantMetrics.test.ts +99 -0
  537. package/langwatch/src/components/batch-evaluation-results/__tests__/detectComparisonColumns.test.ts +133 -0
  538. package/langwatch/src/components/batch-evaluation-results/__tests__/formatLeaderboardHeadline.unit.test.ts +252 -0
  539. package/langwatch/src/components/batch-evaluation-results/__tests__/formatTradeoffSummary.unit.test.ts +219 -0
  540. package/langwatch/src/components/batch-evaluation-results/__tests__/leaderboardCache.unit.test.ts +128 -0
  541. package/langwatch/src/components/batch-evaluation-results/__tests__/panelAgreement.unit.test.ts +165 -0
  542. package/langwatch/src/components/batch-evaluation-results/__tests__/paretoScatterPoints.unit.test.ts +95 -0
  543. package/langwatch/src/components/batch-evaluation-results/__tests__/scoreSeparation.unit.test.ts +314 -0
  544. package/langwatch/src/components/batch-evaluation-results/__tests__/variantMetricsSymmetry.unit.test.ts +129 -0
  545. package/langwatch/src/components/batch-evaluation-results/__tests__/verdictSafety.unit.test.ts +438 -0
  546. package/langwatch/src/components/batch-evaluation-results/__tests__/winMatrixHasPairwiseDetail.unit.test.ts +126 -0
  547. package/langwatch/src/components/batch-evaluation-results/bootstrapMeanCI.ts +78 -0
  548. package/langwatch/src/components/batch-evaluation-results/buildPairwiseComparisons.ts +30 -0
  549. package/langwatch/src/components/batch-evaluation-results/chartAxisLabels.ts +98 -0
  550. package/langwatch/src/components/batch-evaluation-results/computeBTLeaderboard.ts +814 -0
  551. package/langwatch/src/components/batch-evaluation-results/computeComparability.ts +305 -0
  552. package/langwatch/src/components/batch-evaluation-results/computeJudgeBiasChecks.ts +175 -0
  553. package/langwatch/src/components/batch-evaluation-results/computeLeaderboardVerdict.ts +277 -0
  554. package/langwatch/src/components/batch-evaluation-results/computeParetoDominance.ts +283 -0
  555. package/langwatch/src/components/batch-evaluation-results/computeSampleAdequacy.ts +91 -0
  556. package/langwatch/src/components/batch-evaluation-results/computeVariantMetrics.ts +236 -0
  557. package/langwatch/src/components/batch-evaluation-results/computeWinMatrixShape.ts +61 -0
  558. package/langwatch/src/components/batch-evaluation-results/formatLeaderboardHeadline.ts +139 -0
  559. package/langwatch/src/components/batch-evaluation-results/formatTradeoffSummary.ts +126 -0
  560. package/langwatch/src/components/batch-evaluation-results/mulberry32.ts +19 -0
  561. package/langwatch/src/components/batch-evaluation-results/scoreSeparation.ts +102 -0
  562. package/langwatch/src/components/batch-evaluation-results/types.ts +82 -9
  563. package/langwatch/src/components/batch-evaluation-results/useBTLeaderboard.ts +137 -0
  564. package/langwatch/src/components/batch-evaluation-results/usePairwiseSort.ts +78 -0
  565. package/langwatch/src/components/batch-evaluation-results/useResultsGrouping.ts +119 -0
  566. package/langwatch/src/components/batch-evaluation-results/useShowComparisonLeaderboard.ts +43 -0
  567. package/langwatch/src/components/batch-evaluation-results/useVariantMetrics.ts +106 -0
  568. package/langwatch/src/components/checks/DynamicZodForm.tsx +9 -0
  569. package/langwatch/src/components/drawerRegistry.ts +5 -0
  570. package/langwatch/src/components/evaluations/OnlineEvaluationDrawer.tsx +13 -20
  571. package/langwatch/src/components/evaluators/EvaluatorEditorShared.tsx +16 -20
  572. package/langwatch/src/components/evaluators/WorkflowSelectorForEvaluatorDrawer.tsx +1 -15
  573. package/langwatch/src/components/experiments/CreateExperimentButton.tsx +13 -17
  574. package/langwatch/src/components/license/LicenseDetailsCard.tsx +72 -23
  575. package/langwatch/src/components/license/LicenseGeneratorForm.tsx +0 -60
  576. package/langwatch/src/components/license/LicenseLoadError.tsx +23 -0
  577. package/langwatch/src/components/license/OverSeatsCallout.tsx +68 -0
  578. package/langwatch/src/components/license/ResourceLimitsDisplay.tsx +0 -74
  579. package/langwatch/src/components/license/__tests__/OverSeatsCallout.integration.test.tsx +56 -0
  580. package/langwatch/src/components/license/__tests__/ResourceLimitsDisplay.unit.test.ts +8 -135
  581. package/langwatch/src/components/license/__tests__/licenseStatusUtils.unit.test.ts +68 -13
  582. package/langwatch/src/components/license/__tests__/planFormDefaults.unit.test.ts +11 -11
  583. package/langwatch/src/components/license/__tests__/useLicenseActions.integration.test.ts +185 -0
  584. package/langwatch/src/components/license/licenseStatusUtils.ts +21 -17
  585. package/langwatch/src/components/license/planFormDefaults.ts +3 -18
  586. package/langwatch/src/components/license/useLicenseActions.ts +26 -3
  587. package/langwatch/src/components/me/PersonalRecentTracesTable.tsx +4 -0
  588. package/langwatch/src/components/ops/projections/BulkReplayWizard.tsx +23 -1
  589. package/langwatch/src/components/plans/PlansComparisonPage.tsx +18 -0
  590. package/langwatch/src/components/plans/__tests__/PlansComparisonPage.integration.test.tsx +17 -0
  591. package/langwatch/src/components/plans/__tests__/planCurrentResolver.unit.test.ts +19 -0
  592. package/langwatch/src/components/plans/planCurrentResolver.ts +13 -0
  593. package/langwatch/src/components/projects/CreateProjectDrawer.tsx +36 -40
  594. package/langwatch/src/components/prompts/PromptEditorDrawer.tsx +9 -15
  595. package/langwatch/src/components/prompts/__tests__/PromptEditorDrawer.test.tsx +0 -1
  596. package/langwatch/src/components/scenarios/ScenarioCreateModal.tsx +3 -5
  597. package/langwatch/src/components/scenarios/ScenarioFormDrawer.tsx +2 -32
  598. package/langwatch/src/components/settings/CreateTeamDrawer.tsx +31 -35
  599. package/langwatch/src/components/settings/EnterpriseCapabilitiesSection.tsx +236 -0
  600. package/langwatch/src/components/settings/InfoWithoutSelecting.tsx +25 -0
  601. package/langwatch/src/components/settings/OrganizationUserRoleField.tsx +21 -2
  602. package/langwatch/src/components/settings/__tests__/EnterpriseCapabilitiesSection.integration.test.tsx +173 -0
  603. package/langwatch/src/components/settings/__tests__/seatTypeCopy.unit.test.ts +94 -0
  604. package/langwatch/src/components/settings/__tests__/seatTypeExplanation.integration.test.tsx +126 -0
  605. package/langwatch/src/components/settings/seatTypeCopy.ts +29 -0
  606. package/langwatch/src/components/subscription/SubscriptionPage.tsx +0 -1
  607. package/langwatch/src/components/subscription/__tests__/subscription-test-setup.ts +0 -13
  608. package/langwatch/src/components/subscription/billing-plans.ts +3 -12
  609. package/langwatch/src/components/suites/RunHistoryFilters.tsx +55 -3
  610. package/langwatch/src/components/suites/RunHistoryPanel.tsx +44 -0
  611. package/langwatch/src/components/suites/ScenarioRunExportDialog.tsx +92 -0
  612. package/langwatch/src/components/suites/SuiteFormDrawer.tsx +4 -20
  613. package/langwatch/src/components/suites/__tests__/AllRunsPanel.integration.test.tsx +3 -0
  614. package/langwatch/src/components/suites/__tests__/RunHistoryEmptyState.integration.test.tsx +45 -0
  615. package/langwatch/src/components/suites/__tests__/RunHistoryLiveWindow.integration.test.tsx +135 -0
  616. package/langwatch/src/components/suites/__tests__/ScenarioRunExportUi.integration.test.tsx +227 -0
  617. package/langwatch/src/components/suites/__tests__/SuiteDetailPanel.integration.test.tsx +3 -0
  618. package/langwatch/src/components/suites/run-history-transforms.ts +1 -28
  619. package/langwatch/src/components/suites/useExportScenarioRuns.ts +333 -0
  620. package/langwatch/src/components/suites/useRunHistoryPagination.ts +14 -0
  621. package/langwatch/src/components/upgrade-modal/LimitContent.tsx +3 -154
  622. package/langwatch/src/env-create.mjs +4 -0
  623. package/langwatch/src/features/errors/logic/codes.ts +2 -1
  624. package/langwatch/src/features/errors/logic/presentation.ts +8 -3
  625. package/langwatch/src/features/langy/__tests__/presentLangyToolError.unit.test.ts +1 -1
  626. package/langwatch/src/features/langy/logic/langyToolFailure.ts +4 -7
  627. package/langwatch/src/features/traces-v2/components/TraceDrawer/conversationView/TurnSteps.tsx +1 -1
  628. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/DrawerHeader.tsx +34 -0
  629. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/__tests__/utils.unit.test.ts +74 -0
  630. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/TerminalView.tsx +57 -3
  631. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/__tests__/TerminalView.integration.test.tsx +43 -3
  632. package/langwatch/src/features/traces-v2/components/TraceTable/columns.ts +7 -0
  633. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/ContextSizeCell.tsx +48 -0
  634. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/__tests__/ContextSizeCell.integration.test.tsx +57 -0
  635. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/index.ts +2 -0
  636. package/langwatch/src/features/traces-v2/components/shared/TokenBreakdownTooltip.tsx +22 -0
  637. package/langwatch/src/features/traces-v2/lens/capabilities.ts +2 -0
  638. package/langwatch/src/features/traces-v2/types/trace.ts +2 -0
  639. package/langwatch/src/hooks/__tests__/useLicenseEnforcement.unit.test.tsx +18 -30
  640. package/langwatch/src/hooks/__tests__/useOrganizationTeamProject.personal-workspace.integration.test.tsx +30 -0
  641. package/langwatch/src/hooks/__tests__/usePostHogIdentify.unit.test.ts +3 -3
  642. package/langwatch/src/hooks/useMemberDisableAction.ts +53 -0
  643. package/langwatch/src/hooks/useOrganizationTeamProject.ts +8 -7
  644. package/langwatch/src/optimization_studio/components/Evaluate.tsx +39 -46
  645. package/langwatch/src/optimization_studio/components/workflow/NewWorkflowForm.tsx +22 -30
  646. package/langwatch/src/pages/[project]/analytics/custom/index.tsx +1 -6
  647. package/langwatch/src/pages/api/experiment/__tests__/init.unit.test.ts +2 -87
  648. package/langwatch/src/pages/api/experiment/init.ts +7 -60
  649. package/langwatch/src/pages/auth/__tests__/forgot-password.integration.test.tsx +38 -3
  650. package/langwatch/src/pages/auth/forgot-password.tsx +19 -23
  651. package/langwatch/src/pages/auth/reset-password.tsx +2 -23
  652. package/langwatch/src/pages/settings/__tests__/authentication.integration.test.tsx +7 -0
  653. package/langwatch/src/pages/settings/__tests__/team-settings.refused-save.integration.test.tsx +253 -0
  654. package/langwatch/src/pages/settings/authentication.tsx +7 -2
  655. package/langwatch/src/pages/settings/license.tsx +4 -3
  656. package/langwatch/src/pages/settings/members.tsx +126 -34
  657. package/langwatch/src/pages/settings/teams/[team].tsx +73 -20
  658. package/langwatch/src/pages/settings/usage.tsx +7 -8
  659. package/langwatch/src/prompts/prompt-playground/components/sidebar/AddPromptButton.tsx +3 -8
  660. package/langwatch/src/server/api/routers/__tests__/annotation.tenant-references.unit.test.ts +1 -1
  661. package/langwatch/src/server/api/routers/__tests__/apiKey.myBindings.unit.test.ts +1 -1
  662. package/langwatch/src/server/api/routers/__tests__/apiKey.nameById.unit.test.ts +1 -1
  663. package/langwatch/src/server/api/routers/__tests__/apiKey.restricted-permissions.unit.test.ts +4 -1
  664. package/langwatch/src/server/api/routers/__tests__/automations.router.integration.test.ts +1 -1
  665. package/langwatch/src/server/api/routers/__tests__/bugReports.gating.unit.test.ts +1 -1
  666. package/langwatch/src/server/api/routers/__tests__/enterprise-guards.integration.test.ts +0 -4
  667. package/langwatch/src/server/api/routers/__tests__/evaluators.tenant-workflow.unit.test.ts +1 -1
  668. package/langwatch/src/server/api/routers/__tests__/graphs.tenant-dashboard.unit.test.ts +1 -1
  669. package/langwatch/src/server/api/routers/__tests__/langy.turnErrors.unit.test.ts +1 -1
  670. package/langwatch/src/server/api/routers/__tests__/langyGithub.access-order.unit.test.ts +1 -1
  671. package/langwatch/src/server/api/routers/__tests__/license.integration.test.ts +1 -17
  672. package/langwatch/src/server/api/routers/__tests__/licenseEnforcement.reportLimitBlocked.unit.test.ts +1 -1
  673. package/langwatch/src/server/api/routers/__tests__/monitors.copy.integration.test.ts +1 -11
  674. package/langwatch/src/server/api/routers/__tests__/organization.acceptInvite.unit.test.ts +1 -1
  675. package/langwatch/src/server/api/routers/__tests__/organization.setMemberDisabled.integration.test.ts +306 -0
  676. package/langwatch/src/server/api/routers/__tests__/personal-workspace-invariants.integration.test.ts +794 -0
  677. package/langwatch/src/server/api/routers/__tests__/plan.getActivePlan.integration.test.ts +0 -1
  678. package/langwatch/src/server/api/routers/__tests__/project.getHasFirstMessage.unit.test.ts +1 -1
  679. package/langwatch/src/server/api/routers/__tests__/project.regenerateApiKey.unit.test.ts +2 -2
  680. package/langwatch/src/server/api/routers/__tests__/prompts.copy.integration.test.ts +0 -58
  681. package/langwatch/src/server/api/routers/__tests__/prompts.duplicate.integration.test.ts +0 -54
  682. package/langwatch/src/server/api/routers/__tests__/publicEnv.test.ts +60 -0
  683. package/langwatch/src/server/api/routers/__tests__/secrets.reserved-names.unit.test.ts +1 -1
  684. package/langwatch/src/server/api/routers/__tests__/team.update.multi-binding.unit.test.ts +1 -1
  685. package/langwatch/src/server/api/routers/__tests__/traces.4991-full-resolution.unit.test.ts +1 -1
  686. package/langwatch/src/server/api/routers/__tests__/tracesV2.transcript-read.unit.test.ts +121 -0
  687. package/langwatch/src/server/api/routers/__tests__/translate.unit.test.ts +1 -1
  688. package/langwatch/src/server/api/routers/__tests__/user.changePassword.unit.test.ts +105 -0
  689. package/langwatch/src/server/api/routers/__tests__/user.deactivation.unit.test.ts +1 -1
  690. package/langwatch/src/server/api/routers/__tests__/user.register.unit.test.ts +67 -5
  691. package/langwatch/src/server/api/routers/__tests__/workflows.generateCommitMessage.unit.test.ts +1 -1
  692. package/langwatch/src/server/api/routers/agents.ts +0 -6
  693. package/langwatch/src/server/api/routers/analytics/__tests__/dataForFilter.unit.test.ts +1 -1
  694. package/langwatch/src/server/api/routers/apiKey.ts +1 -1
  695. package/langwatch/src/server/api/routers/automations.ts +0 -4
  696. package/langwatch/src/server/api/routers/bugReports.ts +1 -1
  697. package/langwatch/src/server/api/routers/copyEvaluatorToProject.ts +2 -5
  698. package/langwatch/src/server/api/routers/dashboards.ts +0 -2
  699. package/langwatch/src/server/api/routers/dataset.ts +0 -9
  700. package/langwatch/src/server/api/routers/emailSuppression.ts +1 -1
  701. package/langwatch/src/server/api/routers/evaluators.ts +0 -4
  702. package/langwatch/src/server/api/routers/experiments.ts +0 -14
  703. package/langwatch/src/server/api/routers/export.ts +65 -24
  704. package/langwatch/src/server/api/routers/graphs.ts +0 -2
  705. package/langwatch/src/server/api/routers/group.ts +6 -0
  706. package/langwatch/src/server/api/routers/langyEgress.ts +1 -1
  707. package/langwatch/src/server/api/routers/langyGithub.ts +1 -1
  708. package/langwatch/src/server/api/routers/license.ts +44 -36
  709. package/langwatch/src/server/api/routers/licenseEnforcement.ts +0 -21
  710. package/langwatch/src/server/api/routers/modelProviders.ts +1 -1
  711. package/langwatch/src/server/api/routers/monitors.ts +0 -6
  712. package/langwatch/src/server/api/routers/onboarding/__tests__/onboarding.personal-workspace.integration.test.ts +8 -15
  713. package/langwatch/src/server/api/routers/onboarding/onboarding.router.unit.test.ts +1 -1
  714. package/langwatch/src/server/api/routers/onboarding/setProductInterest.integration.test.ts +1 -1
  715. package/langwatch/src/server/api/routers/ops.ts +2 -0
  716. package/langwatch/src/server/api/routers/organization.ts +67 -1
  717. package/langwatch/src/server/api/routers/project.ts +74 -36
  718. package/langwatch/src/server/api/routers/prompts/prompts.trpc-router.ts +0 -10
  719. package/langwatch/src/server/api/routers/publicEnv.ts +7 -3
  720. package/langwatch/src/server/api/routers/scenarios/__tests__/simulation-runner.router.unit.test.ts +1 -1
  721. package/langwatch/src/server/api/routers/scenarios/scenario-crud.router.ts +0 -4
  722. package/langwatch/src/server/api/routers/scimToken.ts +1 -1
  723. package/langwatch/src/server/api/routers/suites/suite.router.ts +0 -3
  724. package/langwatch/src/server/api/routers/team.ts +48 -39
  725. package/langwatch/src/server/api/routers/tracesV2.schemas.ts +2 -0
  726. package/langwatch/src/server/api/routers/tracesV2.ts +76 -20
  727. package/langwatch/src/server/api/routers/user.ts +16 -6
  728. package/langwatch/src/server/api/routers/workflows.ts +0 -7
  729. package/langwatch/src/server/api/trpc.ts +1 -1
  730. package/langwatch/src/server/api-key/__tests__/api-key.service.legacy-ceiling.unit.test.ts +379 -0
  731. package/langwatch/src/server/api-key/__tests__/api-key.service.safety.unit.test.ts +3 -0
  732. package/langwatch/src/server/api-key/__tests__/api-key.service.unit.test.ts +3 -0
  733. package/langwatch/src/server/api-key/api-key.service.ts +63 -22
  734. package/langwatch/src/server/api-router.ts +5 -3
  735. package/langwatch/src/server/app-layer/__tests__/tracing.unit.test.ts +142 -0
  736. package/langwatch/src/server/app-layer/clients/clickhouse/__tests__/cold-scan-detector.coverage.unit.test.ts +2 -0
  737. package/langwatch/src/server/app-layer/clients/clickhouse/windowed-read.ts +15 -0
  738. package/langwatch/src/server/app-layer/dependencies.ts +8 -0
  739. package/langwatch/src/server/app-layer/evaluations/repositories/__tests__/evaluation-run.resolver-window.unit.test.ts +103 -0
  740. package/langwatch/src/server/app-layer/evaluations/repositories/evaluation-run.clickhouse.repository.ts +35 -1
  741. package/langwatch/src/server/app-layer/groups/group.service.ts +37 -0
  742. package/langwatch/src/server/app-layer/groups/repositories/group.prisma.repository.ts +9 -0
  743. package/langwatch/src/server/app-layer/groups/repositories/group.repository.ts +8 -0
  744. package/langwatch/src/server/app-layer/langy/__tests__/langyConversationMemory.unit.test.ts +1 -1
  745. package/langwatch/src/server/app-layer/langy/__tests__/langyTurnContext.unit.test.ts +0 -0
  746. package/langwatch/src/server/app-layer/langy/langyConversationMemory.ts +1 -1
  747. package/langwatch/src/server/app-layer/logs/repositories/__tests__/canonical-log-record.clickhouse.repository.unit.test.ts +54 -0
  748. package/langwatch/src/server/app-layer/logs/repositories/canonical-log-record.clickhouse.repository.ts +29 -12
  749. package/langwatch/src/server/app-layer/ops/__tests__/integration/pending-counter-reconcile.integration.test.ts +240 -0
  750. package/langwatch/src/server/app-layer/ops/__tests__/integration/replay-full-rebuild.integration.test.ts +390 -0
  751. package/langwatch/src/server/app-layer/ops/__tests__/replay.service.unit.test.ts +105 -1
  752. package/langwatch/src/server/app-layer/ops/replay.service.ts +47 -0
  753. package/langwatch/src/server/app-layer/ops/repositories/__tests__/queue.redis.repository.reconcile-pending.unit.test.ts +752 -0
  754. package/langwatch/src/server/app-layer/ops/repositories/queue.redis.repository.ts +597 -48
  755. package/langwatch/src/server/app-layer/organizations/__tests__/organization.service.unit.test.ts +1 -0
  756. package/langwatch/src/server/app-layer/organizations/organization.service.ts +16 -0
  757. package/langwatch/src/server/app-layer/organizations/repositories/organization.prisma.repository.ts +63 -2
  758. package/langwatch/src/server/app-layer/organizations/repositories/organization.repository.ts +15 -0
  759. package/langwatch/src/server/app-layer/presets.ts +27 -13
  760. package/langwatch/src/server/app-layer/projects/__tests__/project-service-update.unit.test.ts +100 -0
  761. package/langwatch/src/server/app-layer/projects/project.service.ts +145 -6
  762. package/langwatch/src/server/app-layer/projects/repositories/project.prisma.repository.ts +2 -16
  763. package/langwatch/src/server/app-layer/projects/repositories/project.repository.ts +2 -13
  764. package/langwatch/src/server/app-layer/simulations/__tests__/scenario-run-export-sweep.integration.test.ts +370 -0
  765. package/langwatch/src/server/app-layer/simulations/repositories/simulation.clickhouse.repository.ts +302 -7
  766. package/langwatch/src/server/app-layer/simulations/repositories/simulation.repository.ts +62 -0
  767. package/langwatch/src/server/app-layer/subscription/__tests__/composite-plan-provider.unit.test.ts +2 -28
  768. package/langwatch/src/server/app-layer/subscription/__tests__/self-hosted-plan-provider.unit.test.ts +101 -0
  769. package/langwatch/src/server/app-layer/subscription/self-hosted-plan-provider.ts +34 -0
  770. package/langwatch/src/server/app-layer/teams/team.service.ts +27 -0
  771. package/langwatch/src/server/app-layer/traces/__tests__/claude-code-span-enrichment.unit.test.ts +179 -0
  772. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-span-filter.unit.test.ts +50 -0
  773. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-transcript.derivation.unit.test.ts +331 -0
  774. package/langwatch/src/server/app-layer/traces/__tests__/trace-io-extraction.service.unit.test.ts +20 -0
  775. package/langwatch/src/server/app-layer/traces/canonicalisation/__tests__/structuredIO.test.ts +22 -1
  776. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/claudeCode.unit.test.ts +217 -0
  777. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/codex.unit.test.ts +133 -0
  778. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/vercel.unit.test.ts +79 -0
  779. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/_constants.ts +9 -0
  780. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/claudeCode.ts +429 -6
  781. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/codex.ts +158 -70
  782. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/vercel.ts +26 -8
  783. package/langwatch/src/server/app-layer/traces/claude-code-span-enrichment.ts +89 -1
  784. package/langwatch/src/server/app-layer/traces/coding-agent-span-filter.ts +23 -1
  785. package/langwatch/src/server/app-layer/traces/coding-agent-transcript.derivation.ts +330 -75
  786. package/langwatch/src/server/app-layer/traces/repositories/__tests__/span-storage.resolver-window.unit.test.ts +108 -0
  787. package/langwatch/src/server/app-layer/traces/repositories/__tests__/trace-list.clickhouse.repository.integration.test.ts +31 -2
  788. package/langwatch/src/server/app-layer/traces/repositories/span-storage.clickhouse.repository.ts +36 -1
  789. package/langwatch/src/server/app-layer/traces/repositories/trace-list.clickhouse.repository.ts +7 -0
  790. package/langwatch/src/server/app-layer/traces/trace-io-extraction.service.ts +8 -1
  791. package/langwatch/src/server/app-layer/traces/trace-list.service.ts +10 -0
  792. package/langwatch/src/server/app-layer/tracing.ts +47 -0
  793. package/langwatch/src/server/app-layer/usage/usage.service.ts +0 -80
  794. package/langwatch/src/server/better-auth/__tests__/hooks.test.ts +72 -0
  795. package/langwatch/src/server/better-auth/__tests__/index.test.ts +31 -9
  796. package/langwatch/src/server/better-auth/__tests__/resetRecoversOauthUser.test.ts +128 -0
  797. package/langwatch/src/server/better-auth/__tests__/ssoGate.hook.test.ts +321 -0
  798. package/langwatch/src/server/better-auth/hooks.ts +46 -1
  799. package/langwatch/src/server/better-auth/index.ts +123 -284
  800. package/langwatch/src/server/clickhouse/__tests__/replicatedEngineGuard.unit.test.ts +301 -0
  801. package/langwatch/src/server/clickhouse/goose.ts +8 -0
  802. package/langwatch/src/server/clickhouse/migrations/00064_replicate_gateway_budget_scope_totals.sql +291 -0
  803. package/langwatch/src/server/clickhouse/migrations/00065_replicate_trace_analytics_rollup.sql +143 -0
  804. package/langwatch/src/server/clickhouse/migrations/00066_replicate_evaluation_analytics_rollup.sql +115 -0
  805. package/langwatch/src/server/datasets/__tests__/dataset-chunking.unit.test.ts +0 -0
  806. package/langwatch/src/server/evaluations/evaluators.generated.ts +83 -63
  807. package/langwatch/src/server/event-sourcing/pipeline/__tests__/staticBuilder.validations.unit.test.ts +46 -0
  808. package/langwatch/src/server/event-sourcing/pipeline/processManagerDefinition.ts +14 -0
  809. package/langwatch/src/server/event-sourcing/pipeline/staticBuilder.ts +8 -0
  810. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/__tests__/graphTriggerActivity.groupKey.unit.test.ts +55 -0
  811. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/graphTriggerActivity.subscriber.ts +23 -0
  812. package/langwatch/src/server/event-sourcing/pipelines/blob-maintenance/process-manager/blobCleanup.process.ts +6 -4
  813. package/langwatch/src/server/event-sourcing/pipelines/coding-agent-processing/schemas/constants.ts +6 -4
  814. package/langwatch/src/server/event-sourcing/pipelines/evaluation-processing/pipeline.ts +9 -1
  815. package/langwatch/src/server/event-sourcing/pipelines/log-processing/__tests__/logCommandCoalescing.unit.test.ts +174 -0
  816. package/langwatch/src/server/event-sourcing/pipelines/log-processing/pipeline.ts +7 -0
  817. package/langwatch/src/server/event-sourcing/pipelines/log-processing/schemas/constants.ts +19 -0
  818. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/__tests__/metricCommandCoalescing.unit.test.ts +137 -0
  819. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/pipeline.ts +7 -0
  820. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/schemas/constants.ts +19 -0
  821. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/__tests__/aiSdkStructuredOutput.integration.test.ts +199 -0
  822. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/pipeline.ts +9 -1
  823. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/spanStorageGroupKey.unit.test.ts +98 -0
  824. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummaryClaudeCodeLift.unit.test.ts +187 -1
  825. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorage.mapProjection.ts +10 -1
  826. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorageGroupKey.ts +63 -0
  827. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/traceSummary.foldProjection.ts +85 -18
  828. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/__tests__/projectMetadata.groupKey.unit.test.ts +140 -0
  829. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/projectMetadata.reactor.ts +23 -0
  830. package/langwatch/src/server/event-sourcing/projections/__tests__/projectionRouter.mapReactorCollapse.unit.test.ts +260 -0
  831. package/langwatch/src/server/event-sourcing/projections/foldProjection.types.ts +6 -3
  832. package/langwatch/src/server/event-sourcing/projections/global/__tests__/billingMeterDispatch.groupKey.unit.test.ts +139 -0
  833. package/langwatch/src/server/event-sourcing/projections/global/billingMeterDispatch.reactor.ts +27 -1
  834. package/langwatch/src/server/event-sourcing/projections/projectionRouter.ts +58 -41
  835. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/blobSweeper.integration.test.ts +149 -0
  836. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.decodeDrop.integration.test.ts +12 -1
  837. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.integration.test.ts +45 -0
  838. package/langwatch/src/server/event-sourcing/queues/groupQueue/blobSweeper.ts +130 -22
  839. package/langwatch/src/server/event-sourcing/queues/groupQueue/scripts.ts +46 -0
  840. package/langwatch/src/server/event-sourcing/replay/__tests__/traceAnalyticsRollupReplay.integration.test.ts +356 -0
  841. package/langwatch/src/server/event-sourcing/replay/replayService.ts +7 -0
  842. package/langwatch/src/server/event-sourcing/services/queues/__tests__/queueManager.commandGroupKey.test.ts +114 -2
  843. package/langwatch/src/server/event-sourcing/services/queues/queueManager.ts +13 -9
  844. package/langwatch/src/server/experiments-v3/execution/__tests__/buildTargetMetadata.unit.test.ts +93 -0
  845. package/langwatch/src/server/experiments-v3/execution/__tests__/orchestratorStorageDispatch.unit.test.ts +57 -0
  846. package/langwatch/src/server/experiments-v3/execution/__tests__/resultMapper.test.ts +180 -13
  847. package/langwatch/src/server/experiments-v3/execution/orchestrator.ts +40 -8
  848. package/langwatch/src/server/experiments-v3/execution/resultMapper.ts +81 -22
  849. package/langwatch/src/server/experiments-v3/execution/types.ts +8 -0
  850. package/langwatch/src/server/export/scenario-runs/__tests__/csv-serializer.unit.test.ts +732 -0
  851. package/langwatch/src/server/export/scenario-runs/__tests__/scenario-run-export.service.unit.test.ts +303 -0
  852. package/langwatch/src/server/export/scenario-runs/csv-serializer.ts +383 -0
  853. package/langwatch/src/server/export/scenario-runs/errors.ts +44 -0
  854. package/langwatch/src/server/export/scenario-runs/scenario-run-export.service.ts +200 -0
  855. package/langwatch/src/server/export/scenario-runs/types.ts +64 -0
  856. package/langwatch/src/server/featureFlag/frontendFeatureFlags.ts +4 -0
  857. package/langwatch/src/server/featureFlag/registry.ts +7 -0
  858. package/langwatch/src/server/gateway/virtualKey.service.ts +2 -2
  859. package/langwatch/src/server/license-enforcement/__tests__/constants.unit.test.ts +2 -10
  860. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.integration.test.ts +17 -194
  861. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.unit.test.ts +3 -301
  862. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.service.unit.test.ts +51 -137
  863. package/langwatch/src/server/license-enforcement/__tests__/license-limit-guard.unit.test.ts +46 -13
  864. package/langwatch/src/server/license-enforcement/__tests__/usage-stats.service.unit.test.ts +1 -3
  865. package/langwatch/src/server/license-enforcement/constants.ts +0 -26
  866. package/langwatch/src/server/license-enforcement/index.ts +0 -5
  867. package/langwatch/src/server/license-enforcement/license-enforcement.repository.ts +4 -227
  868. package/langwatch/src/server/license-enforcement/license-enforcement.service.ts +0 -52
  869. package/langwatch/src/server/license-enforcement/types.ts +8 -17
  870. package/langwatch/src/server/license-enforcement/usage-stats.service.ts +0 -32
  871. package/langwatch/src/server/modelProviders/__tests__/governanceSignup.providerScope.integration.test.ts +1 -1
  872. package/langwatch/src/server/rbac/__tests__/apiKeyCeilingStaleness.unit.test.ts +5 -0
  873. package/langwatch/src/server/rbac/__tests__/role-binding-resolver.ceiling.unit.test.ts +108 -3
  874. package/langwatch/src/server/rbac/role-binding-resolver.ts +147 -1
  875. package/langwatch/src/server/role/__tests__/role-service-rolebinding.unit.test.ts +2 -0
  876. package/langwatch/src/server/role/role.service.ts +15 -1
  877. package/langwatch/src/server/role-bindings/__tests__/role-binding.service.tenant.unit.test.ts +2 -0
  878. package/langwatch/src/server/role-bindings/personal-team-scope.ts +105 -0
  879. package/langwatch/src/server/role-bindings/role-binding.service.ts +10 -2
  880. package/langwatch/src/server/routes/__tests__/github-langy-install.integration.test.ts +1 -1
  881. package/langwatch/src/server/routes/auth.ts +6 -1
  882. package/langwatch/src/server/routes/github-langy.ts +1 -1
  883. package/langwatch/src/server/scenarios/__tests__/scenario-archive.integration.test.ts +11 -15
  884. package/langwatch/src/server/scenarios/scenario-run-category.ts +48 -0
  885. package/langwatch/src/server/stored-objects/__tests__/coerce-content-to-array.unit.test.ts +0 -0
  886. package/langwatch/src/server/stored-objects/__tests__/scenario-events-ingest.integration.test.ts +2 -6
  887. package/langwatch/src/server/teams/team.service.ts +14 -1
  888. package/langwatch/src/server/tracer/types.ts +3 -0
  889. package/langwatch/src/server/traces/__tests__/trace-service-claude-enrichment.unit.test.ts +85 -0
  890. package/langwatch/src/server/traces/mappers/__tests__/trace-summary.mapper.test.ts +106 -0
  891. package/langwatch/src/server/traces/mappers/trace-summary.mapper.ts +59 -0
  892. package/langwatch/src/server/traces/projection/catalog.ts +3 -0
  893. package/langwatch/src/server/traces/trace.service.ts +21 -1
  894. package/langwatch/src/server/workers/__tests__/livenessThread.unit.test.ts +133 -0
  895. package/langwatch/src/server/workers/startWorkers.ts +250 -29
  896. package/langwatch/src/utils/__tests__/api.unit.test.ts +15 -15
  897. package/langwatch/src/utils/constants.ts +1 -0
  898. package/langwatch/src/utils/lambdaFetch.ts +0 -0
  899. package/langwatch/test-setup.ts +9 -0
  900. package/mcp-server/dist/chunk-FMQIE5DL.js +2328 -0
  901. package/mcp-server/dist/create-mcp-server.js +1 -1
  902. package/mcp-server/dist/discover-evaluator-schema-HYPFWGNN.js +2191 -0
  903. package/mcp-server/dist/http-server-UBX7YFXE.js +24466 -0
  904. package/mcp-server/dist/index.js +49 -33
  905. package/package.json +1 -1
  906. package/packages/server/dist/cli.cjs +1 -1
  907. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-BeOD83jA.js +0 -2
  908. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-jHTYLVuB.js +0 -6
  909. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-DW5VXwj8.js +0 -2
  910. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-6ycw-4n0.js +0 -2
  911. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-DKQT3n1Q.js +0 -3
  912. package/langwatch/dist/client/assets/AddParticipants-7HKlJHjI.js +0 -2
  913. package/langwatch/dist/client/assets/AgentHistoryDrawer-B1kjJyfj.js +0 -2
  914. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Dkex2eS8.js +0 -5
  915. package/langwatch/dist/client/assets/AgentListDrawer-B-ab-fJ_.js +0 -2
  916. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-CBUwY7Q0.js +0 -2
  917. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-DZr-iX29.js +0 -2
  918. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-C1AYXbvP.js +0 -2
  919. package/langwatch/dist/client/assets/AiGatewayLayout-BFUOyL-l.js +0 -2
  920. package/langwatch/dist/client/assets/AnnotationsTable-CnwGxhJg.js +0 -2
  921. package/langwatch/dist/client/assets/AreaChart-BZjKjRMD.js +0 -2
  922. package/langwatch/dist/client/assets/AutomationDrawer-BTtX7UXo.js +0 -112
  923. package/langwatch/dist/client/assets/BatchEvaluationSummary-CFBL50E9.js +0 -2
  924. package/langwatch/dist/client/assets/BudgetEditDrawer-DhNs7V2e.js +0 -2
  925. package/langwatch/dist/client/assets/CartesianChart-CgGSWzzH.js +0 -54
  926. package/langwatch/dist/client/assets/CascadeArchiveDialog-BOcl2osO.js +0 -2
  927. package/langwatch/dist/client/assets/ChartTooltip-BKs8as3o.js +0 -4
  928. package/langwatch/dist/client/assets/ChatWindow-B-UHoZDM.js +0 -5
  929. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-jdmrD4H5.js +0 -9
  930. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk-CKLyE8Ty.js +0 -2
  931. package/langwatch/dist/client/assets/ColorfulBlockIcons-Ctm_Gy50.js +0 -6
  932. package/langwatch/dist/client/assets/ColumnTypeIcon-Bh1MI0_N.js +0 -2
  933. package/langwatch/dist/client/assets/ConfirmDialog-CbyD4lof.js +0 -2
  934. package/langwatch/dist/client/assets/ContactSalesBlock-3LFiXNMY.js +0 -2
  935. package/langwatch/dist/client/assets/Conversation-C27uRW0p.js +0 -2
  936. package/langwatch/dist/client/assets/CopyInput-BJ8UDgiW.js +0 -2
  937. package/langwatch/dist/client/assets/CopyableInputWithPrefix-DhfQEE7R.js +0 -2
  938. package/langwatch/dist/client/assets/CreateProjectDrawer-f6ESIihF.js +0 -2
  939. package/langwatch/dist/client/assets/CreateTeamDrawer-CsScDzr3.js +0 -2
  940. package/langwatch/dist/client/assets/CustomGraph-DOp8hQmM.js +0 -2
  941. package/langwatch/dist/client/assets/DashboardLayout-BhHe0vIT.js +0 -96
  942. package/langwatch/dist/client/assets/DashboardNameDrawer-WriiQpWZ.js +0 -2
  943. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-BWcEQSs7.js +0 -2
  944. package/langwatch/dist/client/assets/DatasetEditorTable-BLbB_Sn-.js +0 -2
  945. package/langwatch/dist/client/assets/DatasetPickerList-CDIBTAQW.js +0 -2
  946. package/langwatch/dist/client/assets/DatasetPreviewTable-UuBrd6hv.js +0 -2
  947. package/langwatch/dist/client/assets/DatasetSelector-DJI4ZOko.js +0 -2
  948. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-DfGbPivl.js +0 -2
  949. package/langwatch/dist/client/assets/DeleteConfirmationDialog-w7WZ7lHP.js +0 -2
  950. package/langwatch/dist/client/assets/DocsLinks-vsvIA7dY.js +0 -2
  951. package/langwatch/dist/client/assets/DynamicZodForm-lW0sHL84.js +0 -2
  952. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-UZGlf7Jf.js +0 -3
  953. package/langwatch/dist/client/assets/EditModelProviderDrawer-FxE8Cjfj.js +0 -4
  954. package/langwatch/dist/client/assets/EditProjectDrawer-DvGgMwQg.js +0 -2
  955. package/langwatch/dist/client/assets/EmojiPickerModal-DOTbYgFl.js +0 -3
  956. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CM8Sj7hf.js +0 -2
  957. package/langwatch/dist/client/assets/ErrorBarContext-Bpz3-JDH.js +0 -2
  958. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Bnv6z6m_.js +0 -107
  959. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-DPt4B9Ey.js +0 -2
  960. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-C1OQ89no.js +0 -2
  961. package/langwatch/dist/client/assets/EvaluatorEditorShared-Dlnmyfw9.js +0 -43
  962. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-BFqreRNY.js +0 -2
  963. package/langwatch/dist/client/assets/EvaluatorListDrawer-B5GkvEER.js +0 -2
  964. package/langwatch/dist/client/assets/EvaluatorMappingsSection-uZ95zEz_.js +0 -2
  965. package/langwatch/dist/client/assets/EvaluatorSelection-CLClnlPT.js +0 -2
  966. package/langwatch/dist/client/assets/EvaluatorSelectionBox-VWh5DBap.js +0 -2
  967. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BTrBItgE.js +0 -2
  968. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-0T-zwQQZ.js +0 -2
  969. package/langwatch/dist/client/assets/ExecutionState-BPNxLkdI.js +0 -2
  970. package/langwatch/dist/client/assets/FeatureFlagsDrawer-CpSauosT.js +0 -2
  971. package/langwatch/dist/client/assets/FieldInfoTooltip-BlO6fteF.js +0 -2
  972. package/langwatch/dist/client/assets/FieldsFilters-B46wbf2n.js +0 -2
  973. package/langwatch/dist/client/assets/FilterDisplay-BzhnJIar.js +0 -2
  974. package/langwatch/dist/client/assets/FilterSidebar-CbZF27X2.js +0 -2
  975. package/langwatch/dist/client/assets/FormatMoney-vCZvmGG1.js +0 -2
  976. package/langwatch/dist/client/assets/FoundryDrawer-DskBXiS5.js +0 -2
  977. package/langwatch/dist/client/assets/FullLogo-Db9M_uOO.js +0 -2
  978. package/langwatch/dist/client/assets/GovernanceLayout-DiDbO74a.js +0 -2
  979. package/langwatch/dist/client/assets/GraphsLayout-BCvqg3RK.js +0 -2
  980. package/langwatch/dist/client/assets/GroupBindingInputRow-DQP7aETW.js +0 -2
  981. package/langwatch/dist/client/assets/GuardrailsDrawer-CHV6LBxp.js +0 -91
  982. package/langwatch/dist/client/assets/History-hXXVv0A2.js +0 -17
  983. package/langwatch/dist/client/assets/HorizontalFormControl-lYiaIlzD.js +0 -2
  984. package/langwatch/dist/client/assets/HoverableBigText-CIhevUVt.js +0 -2
  985. package/langwatch/dist/client/assets/InstallCliCard-CJKSPLJ_.js +0 -2
  986. package/langwatch/dist/client/assets/IntegratePaneShell-BpcA5j4P.js +0 -8
  987. package/langwatch/dist/client/assets/InviteMemberDrawer-DiuPqGoS.js +0 -2
  988. package/langwatch/dist/client/assets/IsolatedErrorBoundary-CZ4MnYEN.js +0 -2
  989. package/langwatch/dist/client/assets/LLMModelCostDrawer-D1G0lU1N.js +0 -2
  990. package/langwatch/dist/client/assets/LangyContextTarget-CIlp_Zew.js +0 -2
  991. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-Cd0jbm0t.js +0 -2
  992. package/langwatch/dist/client/assets/Legend-DY68SncN.js +0 -6
  993. package/langwatch/dist/client/assets/Line-B2wakHWw.js +0 -2
  994. package/langwatch/dist/client/assets/LineChart-Bb84FSVR.js +0 -2
  995. package/langwatch/dist/client/assets/ListTable-8idtTXBY.js +0 -2
  996. package/langwatch/dist/client/assets/LoadingScreen-DQ62wqSN.js +0 -2
  997. package/langwatch/dist/client/assets/Markdown-C9extmbX.js +0 -35
  998. package/langwatch/dist/client/assets/MenuLink-CVzOs3K8.js +0 -2
  999. package/langwatch/dist/client/assets/MessageCard--GCYkR2M.js +0 -2
  1000. package/langwatch/dist/client/assets/MetadataTag-CSCPlbDN.js +0 -5
  1001. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-DUwvNeux.js +0 -2
  1002. package/langwatch/dist/client/assets/ModelProviderScreen-BVBKstQm.js +0 -2
  1003. package/langwatch/dist/client/assets/ModelSelector-4R-dc-Ny.js +0 -2
  1004. package/langwatch/dist/client/assets/MyLayout-DCMYTSgX.js +0 -2
  1005. package/langwatch/dist/client/assets/NavigationFooter-1VNOUoV6.js +0 -2
  1006. package/langwatch/dist/client/assets/NewWorkflowForm-CsYSc1Vr.js +0 -2
  1007. package/langwatch/dist/client/assets/NoDataInfoBlock-C8x5bzL0.js +0 -2
  1008. package/langwatch/dist/client/assets/OnboardingContainer-e4kVlnyx.js +0 -2
  1009. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-D2jYsSON.js +0 -2
  1010. package/langwatch/dist/client/assets/OpsPageShell-Ch1rtwuD.js +0 -2
  1011. package/langwatch/dist/client/assets/OttlEditor-baChQv3o.js +0 -3
  1012. package/langwatch/dist/client/assets/OverflownText-CY4Y__oL.js +0 -2
  1013. package/langwatch/dist/client/assets/ProjectAvatar-DtI9dT1f.js +0 -43
  1014. package/langwatch/dist/client/assets/ProjectLangyLayout-Cl7GB9zi.js +0 -82
  1015. package/langwatch/dist/client/assets/PromptEditorDrawer-BLIu4fKV.js +0 -2
  1016. package/langwatch/dist/client/assets/PromptListDrawer-BHC9jUMJ.js +0 -2
  1017. package/langwatch/dist/client/assets/PropertySectionTitle-Da2IdhM3.js +0 -37
  1018. package/langwatch/dist/client/assets/ProviderModelSelector-Cg5Lbc1U.js +0 -2
  1019. package/langwatch/dist/client/assets/ProviderScopeChips-D7HJW6Ht.js +0 -2
  1020. package/langwatch/dist/client/assets/PushToCopiesDialog-B_hvn6aW.js +0 -2
  1021. package/langwatch/dist/client/assets/ReferenceDot-DbjBc6Dh.js +0 -2
  1022. package/langwatch/dist/client/assets/RenderInputOutput-BntIB-Ae.js +0 -261
  1023. package/langwatch/dist/client/assets/ScenarioFormDrawer-BORe6ffA.js +0 -2
  1024. package/langwatch/dist/client/assets/ScenarioInputMappingSection-DVpK_-Qh.js +0 -2
  1025. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-MJhw77cs.js +0 -3
  1026. package/langwatch/dist/client/assets/ScopeChipPicker-B3xHf0Ii.js +0 -2
  1027. package/langwatch/dist/client/assets/SearchInput-C7YbWRUQ.js +0 -2
  1028. package/langwatch/dist/client/assets/SectionNavigationLayout-CIP_2Nxf.js +0 -2
  1029. package/langwatch/dist/client/assets/SelectDatasetDrawer-D_nCx9JT.js +0 -2
  1030. package/langwatch/dist/client/assets/SelectionActionBar-fxhOYCmO.js +0 -2
  1031. package/langwatch/dist/client/assets/SeriesFilterDrawer-zoWjjTxC.js +0 -2
  1032. package/langwatch/dist/client/assets/SettingsLayout-sixsNIX_.js +0 -2
  1033. package/langwatch/dist/client/assets/SetupWithAgentButton-Bhxb1yOj.js +0 -4
  1034. package/langwatch/dist/client/assets/ShikiCommandBox-CN1W-H2m.js +0 -5
  1035. package/langwatch/dist/client/assets/SpanDetails-DavcMtlr.js +0 -3
  1036. package/langwatch/dist/client/assets/SubscriptionPage-gPKGn08f.js +0 -2
  1037. package/langwatch/dist/client/assets/SuiteFormDrawer-C_5urLUY.js +0 -2
  1038. package/langwatch/dist/client/assets/TabButton-Cp8UA45p.js +0 -3
  1039. package/langwatch/dist/client/assets/TableCell-Cbtwk2YR.js +0 -2
  1040. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-B0xHR5hC.js +0 -2
  1041. package/langwatch/dist/client/assets/TeamForm-DvN0gccP.js +0 -2
  1042. package/langwatch/dist/client/assets/TeamUserRoleField-DD6lt16j.js +0 -2
  1043. package/langwatch/dist/client/assets/TraceDetails-DZtIKcmo.js +0 -9
  1044. package/langwatch/dist/client/assets/TraceDetailsDrawer-DKgyPTw5.js +0 -2
  1045. package/langwatch/dist/client/assets/TraceIdPeek-7T88rBev.js +0 -2
  1046. package/langwatch/dist/client/assets/TracesMapping-CYIUxk62.js +0 -2
  1047. package/langwatch/dist/client/assets/UpgradeModalContent-eXy8pG4-.js +0 -2
  1048. package/langwatch/dist/client/assets/UploadCSVDrawer-BTttuVHZ.js +0 -3
  1049. package/langwatch/dist/client/assets/VariablesSection-hjZ5pmeK.js +0 -2
  1050. package/langwatch/dist/client/assets/VersionBadge-BPxGh4w7.js +0 -2
  1051. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9EYtw_g.js +0 -1161
  1052. package/langwatch/dist/client/assets/ViewAutomationDrawer-H_lJU8lG.js +0 -2
  1053. package/langwatch/dist/client/assets/VirtualKeySecretReveal-5GeVsP9d.js +0 -54
  1054. package/langwatch/dist/client/assets/WelcomeLayout-CDTLOa4d.js +0 -2
  1055. package/langwatch/dist/client/assets/WithFeatureFlagGuard-OePuXWRG.js +0 -2
  1056. package/langwatch/dist/client/assets/WithPermissionGuard-Cr6Aljmy.js +0 -2
  1057. package/langwatch/dist/client/assets/WorkflowCard-SFB2TN6O.js +0 -2
  1058. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-C9JwDruB.js +0 -2
  1059. package/langwatch/dist/client/assets/_...path_-Cgdgmf5W.js +0 -2
  1060. package/langwatch/dist/client/assets/_Uint8Array-DZ50H-2q.js +0 -2
  1061. package/langwatch/dist/client/assets/__...path__-CwRP2Csi.js +0 -22
  1062. package/langwatch/dist/client/assets/_baseAssignValue-BqKt0w0a.js +0 -2
  1063. package/langwatch/dist/client/assets/_baseClone-DCKy3Vq2.js +0 -2
  1064. package/langwatch/dist/client/assets/_baseEach-BGeacxUS.js +0 -2
  1065. package/langwatch/dist/client/assets/_baseFor-BQgMStOx.js +0 -2
  1066. package/langwatch/dist/client/assets/_experiment_-UwR3aJGK.js +0 -2
  1067. package/langwatch/dist/client/assets/_id_-7nn1sxUS.js +0 -2
  1068. package/langwatch/dist/client/assets/_id_-BGN_cxTM.js +0 -2
  1069. package/langwatch/dist/client/assets/_id_-C39KWPCF.js +0 -2
  1070. package/langwatch/dist/client/assets/_id_-CLpZ89Xl.js +0 -2
  1071. package/langwatch/dist/client/assets/_id_-CYndCW2V.js +0 -2
  1072. package/langwatch/dist/client/assets/_id_-CfWpUbg4.js +0 -2
  1073. package/langwatch/dist/client/assets/_id_-npXkLrUc.js +0 -2
  1074. package/langwatch/dist/client/assets/_project_-B7G8spwK.js +0 -8
  1075. package/langwatch/dist/client/assets/_runId_-BSik_ZD4.js +0 -7
  1076. package/langwatch/dist/client/assets/_shell-BGaZUKLi.js +0 -2
  1077. package/langwatch/dist/client/assets/_slug_-BN6BJfW8.js +0 -17
  1078. package/langwatch/dist/client/assets/_slug_-C7DGk6aN.js +0 -2
  1079. package/langwatch/dist/client/assets/_slug_-DOlOZ10W.js +0 -2
  1080. package/langwatch/dist/client/assets/_team_-B9rXOt0D.js +0 -2
  1081. package/langwatch/dist/client/assets/_workflow_-BJIdrL-L.js +0 -25
  1082. package/langwatch/dist/client/assets/_workflow_-BKcndaRn.js +0 -3
  1083. package/langwatch/dist/client/assets/accept-CSdmIcux.js +0 -2
  1084. package/langwatch/dist/client/assets/activity-QICCt22J.js +0 -1
  1085. package/langwatch/dist/client/assets/agents--fK5G7M5.js +0 -2
  1086. package/langwatch/dist/client/assets/alerts-QICCt22J.js +0 -1
  1087. package/langwatch/dist/client/assets/all-yOqzcthm.js +0 -2
  1088. package/langwatch/dist/client/assets/analytics-CjMLTwIY.js +0 -2
  1089. package/langwatch/dist/client/assets/annotation-scores-sPTr7fKF.js +0 -2
  1090. package/langwatch/dist/client/assets/annotations-Ye3ttmrc.js +0 -2
  1091. package/langwatch/dist/client/assets/anomaly-rules-DwSc-85q.js +0 -2
  1092. package/langwatch/dist/client/assets/api-keys-CKyHUAXs.js +0 -4
  1093. package/langwatch/dist/client/assets/asaplangy-6A4CIIRR.js +0 -5
  1094. package/langwatch/dist/client/assets/audit-log-DQ9_D13G.js +0 -2
  1095. package/langwatch/dist/client/assets/auth-CHp-bSLm.js +0 -2
  1096. package/langwatch/dist/client/assets/authentication-CktawfTg.js +0 -2
  1097. package/langwatch/dist/client/assets/authorize-BSFPddoX.js +0 -2
  1098. package/langwatch/dist/client/assets/authorize-YWRIgnuS.js +0 -2
  1099. package/langwatch/dist/client/assets/automations-CI-QD_zf.js +0 -2
  1100. package/langwatch/dist/client/assets/automations-QICCt22J.js +0 -1
  1101. package/langwatch/dist/client/assets/billing-plans-DUVLJ_Sk.js +0 -2
  1102. package/langwatch/dist/client/assets/blank-CqHTkVM2.js +0 -2
  1103. package/langwatch/dist/client/assets/blobs-B_lHV3eu.js +0 -2
  1104. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CQSMftlX.js +0 -133
  1105. package/langwatch/dist/client/assets/budgets-D0yk2zkk.js +0 -3
  1106. package/langwatch/dist/client/assets/bug-reports-D48JQaYJ.js +0 -2
  1107. package/langwatch/dist/client/assets/cache-rules-BLbEe56I.js +0 -2
  1108. package/langwatch/dist/client/assets/choose-CR8H5_AF.js +0 -2
  1109. package/langwatch/dist/client/assets/chunk-EX3LRPZG-CULySKMF.js +0 -232
  1110. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-vsHlz4qh.js +0 -3
  1111. package/langwatch/dist/client/assets/chunk-PUDLZKDR-ByJfzd90.js +0 -157
  1112. package/langwatch/dist/client/assets/chunk-RYQCIY6F-DW5yDiZP.js +0 -2
  1113. package/langwatch/dist/client/assets/chunk-V7JOEXUC-rGVlZXkP.js +0 -207
  1114. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-DjpCOWYp.js +0 -2
  1115. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-DjpCOWYp.js +0 -2
  1116. package/langwatch/dist/client/assets/codeAgentConfig-DlJOMg8p.js +0 -7
  1117. package/langwatch/dist/client/assets/codingDefaultSync-C3S2VHmn.js +0 -2
  1118. package/langwatch/dist/client/assets/configure-BPQgl6jf.js +0 -4
  1119. package/langwatch/dist/client/assets/constants-Bb5Vi_Bd.js +0 -2
  1120. package/langwatch/dist/client/assets/custom-D79e_fnJ.js +0 -12
  1121. package/langwatch/dist/client/assets/custom_evaluator-DgcItmbH.js +0 -31
  1122. package/langwatch/dist/client/assets/dagre-BqI7WPId.js +0 -2
  1123. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BJj7ndf9.js +0 -5
  1124. package/langwatch/dist/client/assets/data-privacy-BuolZ3DI.js +0 -2
  1125. package/langwatch/dist/client/assets/data-retention-yWQxxUQF.js +0 -2
  1126. package/langwatch/dist/client/assets/datasets-u_OgZHiv.js +0 -2
  1127. package/langwatch/dist/client/assets/debounce-BJsF8wQY.js +0 -2
  1128. package/langwatch/dist/client/assets/defaultModelState-DY_b79Yj.js +0 -2
  1129. package/langwatch/dist/client/assets/dejaview-DSjI4vi2.js +0 -2
  1130. package/langwatch/dist/client/assets/departments-C3oaBPyA.js +0 -2
  1131. package/langwatch/dist/client/assets/devices-O_ZVZdxA.js +0 -2
  1132. package/langwatch/dist/client/assets/dist-Dd3SzC15.js +0 -6
  1133. package/langwatch/dist/client/assets/drawerFromUrl-DaNSDEzf.js +0 -2
  1134. package/langwatch/dist/client/assets/edit-CswmqyLU.js +0 -62
  1135. package/langwatch/dist/client/assets/email-suppressions-B8AuxWio.js +0 -2
  1136. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-DIiR5G9i.js +0 -86
  1137. package/langwatch/dist/client/assets/error-nKFTkytv.js +0 -2
  1138. package/langwatch/dist/client/assets/errors-e711UMq7.js +0 -2
  1139. package/langwatch/dist/client/assets/evaluations-Cg9PywKJ.js +0 -2
  1140. package/langwatch/dist/client/assets/evaluations-xuA_g6-G.js +0 -2
  1141. package/langwatch/dist/client/assets/evaluators-6oHFfk5m.js +0 -146
  1142. package/langwatch/dist/client/assets/evaluators-CBPI9nP9.js +0 -2
  1143. package/langwatch/dist/client/assets/experiments-DHsdWtPG.js +0 -1
  1144. package/langwatch/dist/client/assets/feature-flags-e-cVnxOK.js +0 -2
  1145. package/langwatch/dist/client/assets/fetchSSE-5rVPow_l.js +0 -3
  1146. package/langwatch/dist/client/assets/fieldset-BNLAUiqD.js +0 -2
  1147. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-DlrfK-aL.js +0 -1
  1148. package/langwatch/dist/client/assets/forgot-password-B_FXHTn9.js +0 -2
  1149. package/langwatch/dist/client/assets/formatMoney-DRwvOSzZ.js +0 -2
  1150. package/langwatch/dist/client/assets/formatTargetOutput-CkKef3lk.js +0 -2
  1151. package/langwatch/dist/client/assets/foundry-U39hnXil.js +0 -477
  1152. package/langwatch/dist/client/assets/gateway-DZnsUBnP.js +0 -2
  1153. package/langwatch/dist/client/assets/getEvaluator-irVFciCL.js +0 -2
  1154. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-BFtcAGI_.js +0 -2
  1155. package/langwatch/dist/client/assets/governance-BBQIXSQ_.js +0 -2
  1156. package/langwatch/dist/client/assets/graphlib-Bg9XziCe.js +0 -2
  1157. package/langwatch/dist/client/assets/grid-DVy6ELOp.js +0 -2
  1158. package/langwatch/dist/client/assets/groups-DYnJ4U2W.js +0 -2
  1159. package/langwatch/dist/client/assets/guardrails-DdKPd-Zs.js +0 -2
  1160. package/langwatch/dist/client/assets/handled-error-CI7XXA3n.js +0 -2
  1161. package/langwatch/dist/client/assets/http-DSF_1QKT.js +0 -7
  1162. package/langwatch/dist/client/assets/identifierUtils-B50FmQLB.js +0 -2
  1163. package/langwatch/dist/client/assets/immer-CFru3D02.js +0 -14
  1164. package/langwatch/dist/client/assets/index-CPtTUYLD.js +0 -68
  1165. package/langwatch/dist/client/assets/ingestion-source-detail-BLfzu5Yv.js +0 -19
  1166. package/langwatch/dist/client/assets/ingestion-sources-BcwE_tRu.js +0 -12
  1167. package/langwatch/dist/client/assets/integrations-D220c59Q.js +0 -2
  1168. package/langwatch/dist/client/assets/isArrayLikeObject-DUy1V36n.js +0 -2
  1169. package/langwatch/dist/client/assets/isSymbol-COuSxi_J.js +0 -2
  1170. package/langwatch/dist/client/assets/langyHomeSuggestions-6NtCcdnH.js +0 -2
  1171. package/langwatch/dist/client/assets/license-Be6bs3wD.js +0 -2
  1172. package/langwatch/dist/client/assets/licenseStatusUtils-YSS0xL-G.js +0 -2
  1173. package/langwatch/dist/client/assets/lu-DlSq9Be4.js +0 -2
  1174. package/langwatch/dist/client/assets/map-7tkBBrDN.js +0 -2
  1175. package/langwatch/dist/client/assets/mappingValidation-C-AT88B0.js +0 -2
  1176. package/langwatch/dist/client/assets/me-BHRwGQAJ.js +0 -7
  1177. package/langwatch/dist/client/assets/me-DyaTjlbw.js +0 -2
  1178. package/langwatch/dist/client/assets/members-Dn5oJBlv.js +0 -2
  1179. package/langwatch/dist/client/assets/mermaid.core-krP_t-L5.js +0 -12
  1180. package/langwatch/dist/client/assets/messages-CN1bd906.js +0 -2
  1181. package/langwatch/dist/client/assets/metrics-Do8QhcIC.js +0 -2
  1182. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-DBef2D4I.js +0 -97
  1183. package/langwatch/dist/client/assets/model-costs-D6eiVgIz.js +0 -2
  1184. package/langwatch/dist/client/assets/model-providers-CiSkvGtd.js +0 -2
  1185. package/langwatch/dist/client/assets/modelProviderHelpers-P2Cogc-H.js +0 -2
  1186. package/langwatch/dist/client/assets/my-queue-D1aRcnMh.js +0 -2
  1187. package/langwatch/dist/client/assets/normalizeComparison-BY-r_dYf.js +0 -2
  1188. package/langwatch/dist/client/assets/not-found-BiyummjJ.js +0 -2
  1189. package/langwatch/dist/client/assets/now-flOUcolU.js +0 -2
  1190. package/langwatch/dist/client/assets/onboarding-D3dMDvS6.js +0 -2
  1191. package/langwatch/dist/client/assets/online-evaluations-Dk2ygUi2.js +0 -2
  1192. package/langwatch/dist/client/assets/ops-Djcw5_lX.js +0 -2
  1193. package/langwatch/dist/client/assets/organizations-F6Q6gYJ3.js +0 -2
  1194. package/langwatch/dist/client/assets/pages-BXwixFEM.js +0 -2
  1195. package/langwatch/dist/client/assets/persistence-DZOtzFnQ.js +0 -2
  1196. package/langwatch/dist/client/assets/personalProject-DMRX2-SI.js +0 -2
  1197. package/langwatch/dist/client/assets/plans-C_VYB2VX.js +0 -2
  1198. package/langwatch/dist/client/assets/preconditionFieldUtils-B7QfymK4.js +0 -2
  1199. package/langwatch/dist/client/assets/product-D0RNZ3Ls.js +0 -2
  1200. package/langwatch/dist/client/assets/project-ZTQzA2gY.js +0 -2
  1201. package/langwatch/dist/client/assets/projections-DocSauqq.js +0 -2
  1202. package/langwatch/dist/client/assets/projects-ClyGKBO9.js +0 -2
  1203. package/langwatch/dist/client/assets/promptHandle-Cen_6YRW.js +0 -2
  1204. package/langwatch/dist/client/assets/prompts-CLb2R5Fd.js +0 -8
  1205. package/langwatch/dist/client/assets/radio-group-CWz2nJi3.js +0 -2
  1206. package/langwatch/dist/client/assets/registry-B64xvGV5.js +0 -2
  1207. package/langwatch/dist/client/assets/reports-C-XbHSdJ.js +0 -2
  1208. package/langwatch/dist/client/assets/request-C3Wgq2B3.js +0 -2
  1209. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-9g84jNsR.js +0 -85
  1210. package/langwatch/dist/client/assets/reset-password-ohopJtIH.js +0 -2
  1211. package/langwatch/dist/client/assets/role-bindings-BQ31P1EO.js +0 -2
  1212. package/langwatch/dist/client/assets/roles-CQDx2TP6.js +0 -2
  1213. package/langwatch/dist/client/assets/routing-policies-uvNo9gfx.js +0 -5
  1214. package/langwatch/dist/client/assets/scenarios-CpA_eExG.js +0 -2
  1215. package/langwatch/dist/client/assets/scheduler-CgzNzJjP.js +0 -2
  1216. package/langwatch/dist/client/assets/schedules-QICCt22J.js +0 -1
  1217. package/langwatch/dist/client/assets/scim-BivWilDe.js +0 -2
  1218. package/langwatch/dist/client/assets/secrets-Dp2ang1r.js +0 -2
  1219. package/langwatch/dist/client/assets/segment-group-DQ4SkpwM.js +0 -2
  1220. package/langwatch/dist/client/assets/segmented-control-BNxU6DEN.js +0 -2
  1221. package/langwatch/dist/client/assets/select-D17PWjH9.js +0 -2
  1222. package/langwatch/dist/client/assets/send-Dd5105kW.js +0 -2
  1223. package/langwatch/dist/client/assets/sequenceView-FFm7w152.js +0 -5
  1224. package/langwatch/dist/client/assets/seriesOptions-CDRg_FIS.js +0 -1015
  1225. package/langwatch/dist/client/assets/settings-aFAaBCpo.js +0 -2
  1226. package/langwatch/dist/client/assets/setup-BqCpBMpq.js +0 -2
  1227. package/langwatch/dist/client/assets/shikiAdapter-CbWAxLvq.js +0 -3
  1228. package/langwatch/dist/client/assets/showSuiteRunError-B2iiQdeh.js +0 -2
  1229. package/langwatch/dist/client/assets/signin-C6AzSXTw.js +0 -2
  1230. package/langwatch/dist/client/assets/signup-Co9SguQP.js +0 -2
  1231. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-CDfCuyr-.js +0 -2
  1232. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-mNUL4OCz.js +0 -2
  1233. package/langwatch/dist/client/assets/subscription-BYrIJoC0.js +0 -3
  1234. package/langwatch/dist/client/assets/subscriptions-CrupW2oH.js +0 -2
  1235. package/langwatch/dist/client/assets/suggestionUI-0NFK2m-V.js +0 -106
  1236. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-aY42sUsR.js +0 -3
  1237. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-BQgl3Mwz.js +0 -9
  1238. package/langwatch/dist/client/assets/switch-DGatWO8v.js +0 -2
  1239. package/langwatch/dist/client/assets/switch-mtnuJtgJ.js +0 -2
  1240. package/langwatch/dist/client/assets/tabs-U8n5D55_.js +0 -2
  1241. package/langwatch/dist/client/assets/teams-CMzKSSEB.js +0 -2
  1242. package/langwatch/dist/client/assets/teams-DBNLpvFi.js +0 -2
  1243. package/langwatch/dist/client/assets/tool-catalog-DgWWHys3.js +0 -7
  1244. package/langwatch/dist/client/assets/toolIcons-DmISNQ_S.js +0 -2
  1245. package/langwatch/dist/client/assets/tooltip-gjZ4s2dt.js +0 -2
  1246. package/langwatch/dist/client/assets/topic-clustering-wc06nKYO.js +0 -2
  1247. package/langwatch/dist/client/assets/topics-DbjuJKH7.js +0 -2
  1248. package/langwatch/dist/client/assets/traceStore-By6b3pBZ.js +0 -55
  1249. package/langwatch/dist/client/assets/traces-DjQaBgiE.js +0 -289
  1250. package/langwatch/dist/client/assets/tracesMapping-DpjIOyAg.js +0 -3
  1251. package/langwatch/dist/client/assets/tracking-D4oUOPlm.js +0 -2
  1252. package/langwatch/dist/client/assets/types-CCALFpCT.js +0 -2
  1253. package/langwatch/dist/client/assets/types-DfJmP3wn.js +0 -2
  1254. package/langwatch/dist/client/assets/types-X7bcC-zw.js +0 -2
  1255. package/langwatch/dist/client/assets/usage-B3fH-bNu.js +0 -2
  1256. package/langwatch/dist/client/assets/usage-YeRzOlEs.js +0 -2
  1257. package/langwatch/dist/client/assets/use-generic-onboarding-flow-DZY28ya2.js +0 -2
  1258. package/langwatch/dist/client/assets/useActivePlan-fRQ_etI2.js +0 -2
  1259. package/langwatch/dist/client/assets/useAllPromptsForProject-DCZJ0_-p.js +0 -2
  1260. package/langwatch/dist/client/assets/useAnnotationQueues-ByLqaEs6.js +0 -2
  1261. package/langwatch/dist/client/assets/useAvailableEvaluators-BKFN_L8t.js +0 -2
  1262. package/langwatch/dist/client/assets/useCompoundLicenseCheck-BqNF-zzC.js +0 -2
  1263. package/langwatch/dist/client/assets/useCyclingVerb-DSHVFfHS.js +0 -2
  1264. package/langwatch/dist/client/assets/useDepartmentColumn-D1DF_PiG.js +0 -2
  1265. package/langwatch/dist/client/assets/useEvaluationsV3Store-Bc6Q5CKo.js +0 -2
  1266. package/langwatch/dist/client/assets/useExportTraces-BqLmfd8N.js +0 -2
  1267. package/langwatch/dist/client/assets/useFeatureFlag-Do1Ecu3l.js +0 -2
  1268. package/langwatch/dist/client/assets/useInviteActions-DwPlKWmS.js +0 -2
  1269. package/langwatch/dist/client/assets/useLicenseEnforcement-DOI0dcqD.js +0 -2
  1270. package/langwatch/dist/client/assets/usePersonalContext-CggG6KVI.js +0 -2
  1271. package/langwatch/dist/client/assets/useProjectSpanNames-jFO9A6Re.js +0 -2
  1272. package/langwatch/dist/client/assets/useProjectsForCopy-B8F_BY79.js +0 -2
  1273. package/langwatch/dist/client/assets/useRunViaApiTabs-Cr0_nbbp.js +0 -50
  1274. package/langwatch/dist/client/assets/useShowLangy-kmjRxLHs.js +0 -2
  1275. package/langwatch/dist/client/assets/useSimulationUpdateListener-BQB61L8b.js +0 -2
  1276. package/langwatch/dist/client/assets/useTargetName-nPyk8kf-.js +0 -2
  1277. package/langwatch/dist/client/assets/useTargetNameMap-C2bPHyhD.js +0 -2
  1278. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CL82mHNA.js +0 -2
  1279. package/langwatch/dist/client/assets/useTraceUpdateListener-r6BQdcuk.js +0 -2
  1280. package/langwatch/dist/client/assets/useUrlScopeFilter-DFlXMn0U.js +0 -2
  1281. package/langwatch/dist/client/assets/useWorkflowStore-DGHQA8ai.js +0 -8
  1282. package/langwatch/dist/client/assets/users-D5W8Qjjj.js +0 -2
  1283. package/langwatch/dist/client/assets/users-DFyHT5UO.js +0 -2
  1284. package/langwatch/dist/client/assets/users-rKylpyh9.js +0 -2
  1285. package/langwatch/dist/client/assets/v3-NB4P-Pc3.js +0 -2
  1286. package/langwatch/dist/client/assets/variables-DF2_abiB.js +0 -396
  1287. package/langwatch/dist/client/assets/viewStore-DtvCfAUF.js +0 -2
  1288. package/langwatch/dist/client/assets/virtual-keys-DW1kPrjW.js +0 -2
  1289. package/langwatch/dist/client/assets/welcome-DJsfSWej.js +0 -16
  1290. package/langwatch/dist/client/assets/wizard-D2X_QMNx.js +0 -2
  1291. package/langwatch/dist/client/assets/workbench-fZ1KK4fN.js +0 -2
  1292. package/langwatch/dist/client/assets/workflows-CY65pvqY.js +0 -3
  1293. package/langwatch/dist/client/assets/wrap-DlWOPhPw.js +0 -2
  1294. package/langwatch/src/app/api/middleware/__tests__/resource-limit-enforcement.integration.test.ts +0 -278
  1295. package/langwatch/src/app/api/middleware/__tests__/resource-limit.unit.test.ts +0 -299
  1296. package/langwatch/src/app/api/middleware/resource-limit.ts +0 -147
  1297. package/langwatch/src/app/api/scenario-events/[[...route]]/scenario-set-limit.ts +0 -54
  1298. package/langwatch/src/app/api/scenario-events/__tests__/scenario-set-limit.unit.test.ts +0 -195
  1299. package/langwatch/src/app/api/scenario-events/scenario-set-limit.stress.test.ts +0 -216
  1300. package/langwatch/src/components/__tests__/UpgradeModal.unit.test.tsx +0 -103
  1301. package/langwatch/src/hooks/useCompoundLicenseCheck.ts +0 -41
  1302. package/langwatch/src/pages/api/experiment/init.stress.test.ts +0 -130
  1303. package/langwatch/src/server/api/routers/__tests__/project.create.planLimit.integration.test.ts +0 -370
  1304. package/langwatch/src/server/api/routers/__tests__/team.createTeamWithMembers.planLimit.integration.test.ts +0 -251
  1305. package/langwatch/src/server/app-layer/usage/__tests__/usage-service-checkScenarioSetLimit.unit.test.ts +0 -322
  1306. package/langwatch/src/server/app-layer/usage/errors.ts +0 -24
  1307. package/langwatch/src/server/auditLog.ts +0 -49
  1308. package/langwatch/src/server/better-auth/__tests__/fallbackName.test.ts +0 -141
  1309. package/langwatch/src/server/better-auth/__tests__/parseIssuerUrl.test.ts +0 -58
  1310. package/langwatch/src/server/better-auth/__tests__/sso.test.ts +0 -125
  1311. package/langwatch/src/server/better-auth/sso.ts +0 -47
  1312. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummary.coalesce.unit.test.ts +0 -33
  1313. package/langwatch/src/server/license-enforcement/__tests__/limit-breakdown.unit.test.ts +0 -101
  1314. package/langwatch/src/server/license-enforcement/__tests__/personal-workspaces-excluded.integration.test.ts +0 -391
  1315. package/langwatch/src/server/license-enforcement/enforcement.middleware.ts +0 -103
  1316. package/langwatch/src/server/license-enforcement/limit-breakdown.ts +0 -96
  1317. package/langwatch/src/server/routes/scim.ts +0 -583
  1318. package/langwatch/src/server/routes/webhooks.ts +0 -168
  1319. package/langwatch/src/server/scim/__tests__/scim-token.service.unit.test.ts +0 -109
  1320. package/langwatch/src/server/scim/__tests__/scim.costCenter.integration.test.ts +0 -170
  1321. package/langwatch/src/server/scim/__tests__/scim.service.unit.test.ts +0 -414
  1322. package/langwatch/src/server/scim/scim-group.service.ts +0 -464
  1323. package/langwatch/src/server/scim/scim-role-resolver.ts +0 -47
  1324. package/langwatch/src/server/scim/scim-role-resolver.unit.test.ts +0 -92
  1325. package/langwatch/src/server/scim/scim-token.service.ts +0 -70
  1326. package/langwatch/src/server/scim/scim.service.ts +0 -553
  1327. package/langwatch/src/server/scim/scim.types.ts +0 -148
  1328. package/mcp-server/dist/chunk-DSB77X63.js +0 -2328
  1329. package/mcp-server/dist/discover-evaluator-schema-OFEADIJY.js +0 -2175
  1330. package/mcp-server/dist/http-server-YVM4PRTC.js +0 -24466
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{a as c,i as l,n as u,r as d,t as f}from"./alert-CPsXih3K.js";import{g as p,h as m}from"./errors-mlatPkMI.js";import{Mr as h,St as g}from"./index-8SbDirJv.js";import{t as _}from"./alert-triangle-svMxxY53.js";var v=e(t()),y=a();function b({open:e,onClose:t,onConfirm:a,isLoading:b=!1,isLoadingRelated:x=!1,entityType:S,entityName:C,relatedEntities:w}){let[T,E]=(0,v.useState)(``),D=(0,v.useRef)(null);(0,v.useEffect)(()=>{E(``)},[e]);let O=(w.workflows?.length??0)>0||(w.evaluators?.length??0)>0||(w.agents?.length??0)>0||(w.monitors?.length??0)>0,k=e=>{switch(e){case`workflow`:return`workflow`;case`evaluator`:return`evaluator`;case`agent`:return`agent`}},A=(e,t,n)=>!e||e.length===0?null:(0,y.jsxs)(s,{align:`stretch`,gap:1,children:[(0,y.jsxs)(o,{fontWeight:`medium`,fontSize:`sm`,children:[t,` (`,e.length,`) - `,n]}),(0,y.jsxs)(p,{paddingLeft:4,children:[e.slice(0,5).map(e=>(0,y.jsx)(m,{fontSize:`sm`,color:`fg.muted`,children:e.name},e.id)),e.length>5&&(0,y.jsxs)(m,{fontSize:`sm`,color:`fg.subtle`,children:[`...and `,e.length-5,` more`]})]})]});return(0,y.jsx)(g.Root,{open:e,onOpenChange:t,placement:`center`,initialFocusEl:()=>D.current,children:(0,y.jsxs)(g.Content,{bg:`bg`,maxWidth:`500px`,onClick:e=>e.stopPropagation(),children:[(0,y.jsx)(g.CloseTrigger,{}),(0,y.jsx)(g.Header,{children:(0,y.jsxs)(g.Title,{fontSize:`md`,fontWeight:`500`,children:[`Delete `,k(S),`?`]})}),(0,y.jsx)(g.Body,{children:x?(0,y.jsxs)(i,{justify:`center`,paddingY:4,children:[(0,y.jsx)(n,{size:`sm`}),(0,y.jsx)(o,{children:`Loading related items...`})]}):(0,y.jsxs)(s,{align:`stretch`,gap:4,children:[(0,y.jsxs)(o,{children:[`You are about to delete`,` `,(0,y.jsxs)(o,{as:`span`,fontWeight:`semibold`,children:[`"`,C,`"`]}),`.`]}),O&&(0,y.jsxs)(l,{status:`warning`,children:[(0,y.jsx)(d,{children:(0,y.jsx)(_,{size:16})}),(0,y.jsxs)(f,{children:[(0,y.jsx)(c,{children:`This will also affect:`}),(0,y.jsx)(u,{children:(0,y.jsxs)(s,{align:`stretch`,gap:2,marginTop:2,children:[A(w.workflows,`Workflows`,`will be archived`),A(w.evaluators,`Evaluators`,`will be archived`),A(w.agents,`Agents`,`will be archived`),A(w.monitors,`Online Evaluations`,`will be deleted`)]})})]})]}),(0,y.jsxs)(o,{children:[`This action cannot be undone. Type`,` `,(0,y.jsx)(o,{as:`span`,fontWeight:`semibold`,children:`delete`}),` `,`below to confirm:`]}),(0,y.jsx)(h,{placeholder:`Type 'delete' to confirm`,value:T,autoFocus:!0,onChange:e=>{e.stopPropagation(),E(e.target.value)},ref:D,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&T.toLowerCase()===`delete`&&!b&&a()},"data-testid":`cascade-archive-confirm-input`})]})}),(0,y.jsxs)(g.Footer,{children:[(0,y.jsx)(r,{variant:`outline`,mr:3,onClick:e=>{e.stopPropagation(),t()},disabled:b,children:`Cancel`}),(0,y.jsx)(r,{colorPalette:`red`,onClick:e=>{e.stopPropagation(),T.toLowerCase()===`delete`&&!b&&a()},disabled:T.toLowerCase()!==`delete`||b||x,"data-testid":`cascade-archive-confirm-button`,children:b?(0,y.jsx)(n,{size:`sm`}):`Delete`})]})]})})}export{b as t};
2
+ //# sourceMappingURL=CascadeArchiveDialog-BPqLe1Ai.js.map
@@ -0,0 +1,2 @@
1
+ import{dn as e,n as t}from"./portal-Sdfvrza9.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{n as r,t as i}from"./v-stack-hkuSkmCA.js";var a=n();function o({active:n,payload:o,label:s,formatter:c,labelFormatter:l,separator:u=`: `}){if(!n||!o?.length)return null;let d=l?l(s,o):s;return(0,a.jsxs)(e,{bg:`bg.panel/85`,backdropFilter:`blur(8px)`,border:`1px solid`,borderColor:`border`,borderRadius:`md`,px:3,py:2,boxShadow:`lg`,children:[d!=null&&d!==``&&(0,a.jsx)(r,{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,mb:1,children:d}),(0,a.jsx)(i,{gap:.5,align:`start`,children:o.filter(e=>!e.hide).map((n,i)=>{let s=n.value,l=n.name;if(c&&n.value!=null){let e=c(n.value,n.name,n,i,o);Array.isArray(e)?(s=e[0],e[1]!=null&&(l=e[1])):s=e}return(0,a.jsxs)(t,{gap:1.5,align:`center`,children:[(0,a.jsx)(e,{width:`8px`,height:`8px`,borderRadius:`2px`,flexShrink:0,style:{backgroundColor:n.color}}),(0,a.jsxs)(r,{textStyle:`xs`,color:`fg`,children:[(0,a.jsx)(r,{as:`span`,color:`fg.muted`,children:l}),u,s]})]},i)})})]})}export{o as t};
2
+ //# sourceMappingURL=ChartTooltip-BMGa2HEK.js.map
@@ -0,0 +1,5 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{T as c}from"./fetchSSE-CnJPAkno.js";import{n as l}from"./api-l6Cnm0vQ.js";import{s as u}from"./index.esm-Cpy5fWo1.js";import{Mr as d,Vt as f}from"./index-8SbDirJv.js";import{t as p}from"./prop-types-DeUPn3oD.js";import{t as m}from"./input-group-D7qfFB6C.js";import{t as h}from"./SmallLabel-Dh74EKHT.js";import{r as g}from"./nodeUtils-DBBk3sXl.js";import{n as _,t as v}from"./ExecutionState-xp8LG59p.js";import{n as y}from"./useWorkflowStore-CWWkoMW1.js";var b=e(t()),x=e(p());function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}function C(e,t){if(e==null)return{};var n=w(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function w(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var T=(0,b.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=C(e,[`color`,`size`]);return b.createElement(`svg`,S({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),b.createElement(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),b.createElement(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`}))});T.propTypes={color:x.default.string,size:x.default.oneOfType([x.default.string,x.default.number])},T.displayName=`Send`;var E=a(),D=e=>{let[t,n]=(0,b.useState)(()=>e.reduce((e,t)=>{let n=t.sourceHandle?.split(`.`)[1]??``;return{...e,[n]:``}},{}));return{inputs:t,handleInputChange:(0,b.useCallback)((e,t)=>{n(n=>({...n,[e]:t}))},[])}},O=({workflowId:e,isOpen:t,useApi:r,nodes:a,edges:u,executionStatus:d})=>{let{getWorkflow:p}=y(e=>({getWorkflow:e.getWorkflow})),{project:m}=f(),{startWorkflowExecution:h}=_(),x=l.optimization.chat.useMutation(),S=p(),[C,w]=(0,b.useState)([]),T=g(u,a);(0,b.useEffect)(()=>{if(d===`success`){let e=S.state.execution?.result;if(e&&typeof e==`object`){let t=Object.entries(e.end).map(([e,t])=>`${e}: ${t}`).join(`
2
+ `);w([{input:[C[0]?.input??``].flat(),output:[t]}])}}},[d]),(0,b.useEffect)(()=>{t&&w([])},[t]);let{inputs:O,handleInputChange:A}=D(T),j=()=>{let e=T.map(e=>{let t=e.sourceHandle?.split(`.`)[1];return t?`${t}: ${O[t]??``}`:``}).join(`
3
+ `);w([{input:[e],output:[``]}]),r?M(e):h({inputs:[O]})},M=async t=>{if(!e)return;let n=await x.mutateAsync({workflowId:e,inputMessages:[O],projectId:m?.id??``});if(n.status===`success`){let e=Object.entries(n.result).map(([e,t])=>`${e}: ${t}`).join(`
4
+ `);w([{input:[t],output:[e]}])}};return(0,E.jsxs)(i,{align:`start`,gap:1,height:`100%`,children:[(0,E.jsx)(k,{inputs:O,handleInputChange:A,sendMultiMessage:j,isSingle:!1,entryInputs:T}),(0,E.jsxs)(s,{gap:4,align:`stretch`,width:`100%`,height:`100%`,border:`1px`,borderColor:`border`,borderRadius:`lg`,padding:2,children:[(0,E.jsx)(n,{flexGrow:1,overflowY:`auto`,children:C.map((e,t)=>(0,E.jsxs)(c,{flexDirection:`column`,width:`100%`,mb:4,children:[e.input.map((e,t)=>(0,E.jsx)(n,{alignSelf:`flex-end`,maxWidth:`70%`,mb:2,children:(0,E.jsx)(o,{bg:`blue.500`,color:`white`,p:2,borderRadius:`lg`,whiteSpace:`pre-wrap`,children:e})},`input-${t}`)),e.output.map((e,t)=>e||x.isLoading||d===`running`?(0,E.jsx)(n,{alignSelf:`flex-start`,maxWidth:`70%`,mb:2,children:(0,E.jsx)(n,{bg:`bg.emphasized`,p:2,borderRadius:`lg`,whiteSpace:`pre-wrap`,children:x.isLoading||d===`running`?(0,E.jsx)(v,{isLoading:x.isLoading}):e})},`output-${t}`):null)]},t))}),(0,E.jsx)(k,{inputs:O,handleInputChange:A,sendMultiMessage:j,isSingle:!0,entryInputs:T})]})]})},k=({inputs:e,handleInputChange:t,sendMultiMessage:n,isSingle:i,entryInputs:a})=>{let{handleSubmit:o}=u(),c=()=>{n()};return!i&&a.length===1||i&&a.length>1?null:a&&a.length===1?(0,E.jsx)(m,{as:`form`,onSubmit:o(c),endElement:(0,E.jsx)(r,{size:`sm`,padding:2,colorPalette:`orange`,type:`submit`,children:(0,E.jsx)(T,{})}),children:(0,E.jsx)(d,{required:!0,value:e[0],onChange:e=>t(a[0]?.sourceHandle?.split(`.`)?.[1]??``,e.target.value),placeholder:`Send ${a[0]?.sourceHandle?.split(`.`)[1]} `,onKeyDown:e=>{e.key===`Enter`&&(c(),setTimeout(()=>{e.target.value=``},1))}})}):(0,E.jsxs)(s,{width:`xl`,border:`1px`,borderColor:`border`,borderRadius:`lg`,height:`100%`,padding:2,gap:4,justifyContent:`space-between`,as:`form`,onSubmit:o(c),children:[(0,E.jsx)(s,{gap:3,width:`full`,children:a.map((n,r)=>(0,E.jsxs)(s,{gap:1,children:[(0,E.jsx)(h,{children:n.sourceHandle?.split(`.`)[1]??`Input ${r+1}`}),(0,E.jsx)(d,{value:e[r],required:!0,onChange:e=>t(n.sourceHandle?.split(`.`)[1]??``,e.target.value)})]},r))}),(0,E.jsx)(r,{width:`full`,type:`submit`,colorPalette:`orange`,children:`Submit`})]})};export{O as ChatBox};
5
+ //# sourceMappingURL=ChatWindow-BBsct-iS.js.map
@@ -0,0 +1,9 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{n as l}from"./toaster-BsYkODqs.js";import{a as u,n as d,r as f}from"./field-BadoNaN5.js";import{t as p}from"./icon-button-Wlb_dGXL.js";import{n as m}from"./personalProject-C9vU_vdl.js";import"./fetchSSE-CnJPAkno.js";import{t as h}from"./errors-mlatPkMI.js";import{n as g,r as _,t as v}from"./native-select-DL2k8x0o.js";import{n as y}from"./api-l6Cnm0vQ.js";import"./variables-Dox25KUK.js";import{c as b}from"./PropertySectionTitle-CK55WvKi.js";import{Mn as x,Zt as S,r as C}from"./lu-BSZWBZXU.js";import{An as w,En as T,G as E,I as D,Mr as O,Vt as k,W as A,pn as j,z as M}from"./index-8SbDirJv.js";import{t as N}from"./VariablesSection-DW_-pHw8.js";import{t as P}from"./codeSignature-C0d4aZg9.js";var F=e(t()),I=T({identifier:w().min(1),type:w().min(1)});T({code:w().min(1),inputs:j(I).min(1),outputs:j(I).min(1)});var L=[{identifier:`details`,type:`str`},{identifier:`passed`,type:`bool`},{identifier:`score`,type:`float`},{identifier:`label`,type:`str`}],R={code:`class Code:
2
+ def __call__(self, output: str, expected_output: str):
3
+ # Return a dict with any of: passed (bool), score (float),
4
+ # label (str), details (str). All are optional.
5
+ passed = output.strip() == expected_output.strip()
6
+
7
+ return {"passed": passed, "score": 1.0 if passed else 0.0}
8
+ `,inputs:[{identifier:`output`,type:`str`},{identifier:`expected_output`,type:`str`}],outputs:L.map(e=>({...e}))};function z({hasName:e,hasCode:t,hasInput:n,isEditing:r}){let i=[];if(e||i.push(`a name`),t||i.push(`some code`),n||i.push(`at least one input`),i.length===0)return null;let a=r?`save your changes`:`create the evaluator`;return`Add ${B(i)} to ${a}.`}function B(e){return e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`}var V=o(),H=[`str`,`float`,`bool`,`list[str]`,`dict`],U=e=>e.filter(e=>e.identifier.trim()!==``);function W(e){let{project:t}=k(),{closeDrawer:n}=A(),r=E(),i=D(),a=y.useContext(),o=e.evaluatorId??r.evaluatorId??i.evaluatorId,s=!!o,c=e.mappingsConfig??i.mappingsConfig,u=e.onMappingChange??M(`codeEvaluatorEditor`)?.onMappingChange,d=e.open!==!1&&e.open!==void 0,[f,p]=(0,F.useState)(``),[m,g]=(0,F.useState)(R.code),[_,v]=(0,F.useState)(R.inputs.map(e=>({...e}))),b=L,[x,S]=(0,F.useState)(c?.initialMappings??{}),C=y.evaluators.getById.useQuery({id:o??``,projectId:t?.id??``},{enabled:s&&!!t?.id&&d}),w=(0,F.useRef)(null);(0,F.useEffect)(()=>{let e=C.data;if(!e||w.current===e.id)return;w.current=e.id;let t=e.config;p(e.name),t?.code&&g(t.code),t?.inputs?.length&&v(t.inputs.map(e=>({...e})))},[C.data]);let T=e=>{v(e);let t=U(e);t.length>0&&g(e=>P(e,t))},O=(e,t)=>{S(n=>{let r={...n};return t?r[e]=t:delete r[e],r}),u?.(e,t)},j=r=>{a.evaluators.getAll.invalidate({projectId:t?.id??``}),s&&a.evaluators.getById.invalidate({id:r.id,projectId:t?.id??``}),l.create({title:s?`Code evaluator saved`:`Code evaluator created`,type:`success`,meta:{closable:!0}});let i=M(`codeEvaluatorEditor`)?.onSave??M(`evaluatorEditor`)?.onSave??e.onSave;i?i({id:r.id,name:r.name}):n()},N=y.evaluators.create.useMutation({onSuccess:j,onError:e=>h({error:e,fallbackTitle:`Couldn't create code evaluator`})}),I=y.evaluators.update.useMutation({onSuccess:j,onError:e=>h({error:e,fallbackTitle:`Couldn't save code evaluator`})}),B=()=>{if(!t?.id||!f.trim())return;let e={code:m,inputs:U(_),outputs:L.map(e=>({...e}))};s?I.mutate({id:o,projectId:t.id,type:`code`,name:f.trim(),config:e}):N.mutate({projectId:t.id,name:f.trim(),type:`code`,config:e})},V=N.isPending||I.isPending,H=s&&C.isLoading,W=!!f.trim()&&m.trim()!==``&&U(_).length>0&&!V&&!H,G=V||H?null:z({hasName:!!f.trim(),hasCode:m.trim()!==``,hasInput:U(_).length>0,isEditing:s});return{name:f,setName:p,code:m,setCode:g,inputs:_,setInputs:T,outputs:b,mappings:x,handleMappingChange:O,mappingsConfig:c,showMappings:!!(c&&u),isEditing:s,isLoadingEvaluator:H,handleSave:B,canSave:W,disabledReason:G,isPending:V}}function G(e){let{closeDrawer:t,canGoBack:o,goBack:c}=A(),l=W(e),u=e.open!==!1&&e.open!==void 0;return(0,V.jsx)(m.Root,{open:u,onOpenChange:({open:n})=>{n||(e.onClose?.(),t())},size:`lg`,closeOnInteractOutside:!1,modal:!1,children:(0,V.jsxs)(m.Content,{bg:`bg`,children:[(0,V.jsx)(m.CloseTrigger,{}),(0,V.jsx)(K,{canGoBack:o,goBack:c,isEditing:l.isEditing}),(0,V.jsx)(m.Body,{display:`flex`,flexDirection:`column`,gap:4,children:l.isLoadingEvaluator?(0,V.jsx)(a,{justify:`center`,paddingY:8,children:(0,V.jsx)(n,{size:`md`})}):(0,V.jsx)(q,{form:l})}),(0,V.jsx)(m.Footer,{borderTopWidth:`1px`,borderColor:`border`,children:(0,V.jsxs)(a,{width:`full`,justify:`space-between`,gap:3,children:[l.disabledReason?(0,V.jsx)(s,{fontSize:`sm`,color:`fg.muted`,"data-testid":`code-evaluator-disabled-reason`,children:l.disabledReason}):(0,V.jsx)(r,{}),(0,V.jsx)(i,{colorPalette:`blue`,onClick:l.handleSave,disabled:!l.canSave,loading:l.isPending,"data-testid":`save-code-evaluator`,children:l.isEditing?`Save changes`:`Create evaluator`})]})})]})})}function K({canGoBack:e,goBack:t,isEditing:n}){return(0,V.jsx)(m.Header,{children:(0,V.jsxs)(a,{gap:2,children:[e&&(0,V.jsx)(i,{variant:`ghost`,size:`sm`,onClick:t,padding:1,minWidth:`auto`,"data-testid":`back-button`,children:(0,V.jsx)(C,{size:20})}),(0,V.jsx)(s,{fontSize:`lg`,fontWeight:`semibold`,children:n?`Edit Code Evaluator`:`New Code Evaluator`})]})})}function q({form:e}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(u,{required:!0,children:[(0,V.jsx)(f,{children:`Name`}),(0,V.jsx)(O,{value:e.name,onChange:t=>e.setName(t.target.value),placeholder:`My code evaluator`,"data-testid":`code-evaluator-name`})]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{children:`Python Code`}),(0,V.jsx)(d,{margin:0,children:"Define a Python class with a `__call__` method that takes the inputs and returns the outputs (passed, score, label or details)."}),(0,V.jsx)(r,{width:`full`,height:`320px`,borderWidth:`1px`,borderColor:`border`,borderRadius:`md`,overflow:`hidden`,children:(0,V.jsx)(b,{code:e.code,setCode:e.setCode,onClose:()=>void 0,language:`python`,technologies:[`python`],inputs:U(e.inputs),outputs:U(e.outputs)})})]}),e.showMappings&&e.mappingsConfig?(0,V.jsx)(N,{title:`Inputs`,variables:e.inputs.map(e=>({identifier:e.identifier,type:e.type})),onChange:t=>e.setInputs(t.map(e=>({identifier:e.identifier,type:e.type}))),showMappings:!0,mappings:e.mappings,onMappingChange:e.handleMappingChange,availableSources:e.mappingsConfig.availableSources,canAddRemove:!0}):(0,V.jsx)(X,{label:`Inputs`,fields:e.inputs,setFields:e.setInputs,testIdPrefix:`code-evaluator-input`}),(0,V.jsx)(Y,{})]})}var J={passed:`Whether the check passed (true or false).`,score:`A numeric score for the result.`,label:`A classification label for the result.`,details:`A human-readable explanation of the result.`};function Y(){return(0,V.jsxs)(c,{align:`stretch`,gap:2,children:[(0,V.jsx)(s,{fontSize:`sm`,fontWeight:`semibold`,children:`Outputs`}),(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`Return a dictionary from your function with any of these fields. Whichever you return become the evaluation result.`}),(0,V.jsx)(c,{align:`stretch`,gap:1.5,borderWidth:`1px`,borderColor:`border`,borderRadius:`md`,padding:3,children:L.map(e=>(0,V.jsxs)(a,{gap:2,align:`baseline`,children:[(0,V.jsx)(s,{fontSize:`sm`,fontFamily:`mono`,fontWeight:`medium`,"data-testid":`code-evaluator-output-field-${e.identifier}`,children:e.identifier}),(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,fontFamily:`mono`,children:e.type}),(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:J[e.identifier]})]},e.identifier))})]})}function X({label:e,fields:t,setFields:n,testIdPrefix:r}){return(0,V.jsxs)(c,{align:`stretch`,gap:2,children:[(0,V.jsxs)(a,{justify:`space-between`,children:[(0,V.jsx)(s,{fontSize:`sm`,fontWeight:`semibold`,children:e}),(0,V.jsxs)(i,{size:`xs`,variant:`ghost`,onClick:()=>n([...t,{identifier:``,type:`str`}]),"data-testid":`${r}-add`,children:[(0,V.jsx)(S,{size:14}),` Add`]})]}),t.map((i,o)=>(0,V.jsxs)(a,{gap:2,children:[(0,V.jsx)(O,{size:`sm`,value:i.identifier,placeholder:`identifier`,onChange:e=>n(t.map((t,n)=>n===o?{...t,identifier:e.target.value}:t)),"data-testid":`${r}-identifier-${o}`}),(0,V.jsxs)(_,{size:`sm`,width:`140px`,children:[(0,V.jsx)(v,{value:i.type,onChange:e=>n(t.map((t,n)=>n===o?{...t,type:e.target.value}:t)),children:H.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))}),(0,V.jsx)(g,{})]}),(0,V.jsx)(p,{size:`sm`,variant:`ghost`,"aria-label":`Remove ${e.toLowerCase()} ${i.identifier}`,onClick:()=>n(t.filter((e,t)=>t!==o)),disabled:t.length<=1,children:(0,V.jsx)(x,{size:14})})]},o))]})}export{G as CodeEvaluatorEditorDrawer};
9
+ //# sourceMappingURL=CodeEvaluatorEditorDrawer-DOqtlBKU.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{i as n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i}from"./v-stack-hkuSkmCA.js";import{n as a}from"./toaster-BsYkODqs.js";import{t as o}from"./errors-mlatPkMI.js";import{n as s}from"./api-l6Cnm0vQ.js";import{p as c}from"./trpcError-CFsR-0nB.js";import{At as l,Dt as u,Et as d,Ot as f,Vt as p,kt as m,wt as h}from"./index-8SbDirJv.js";import{o as g,s as _}from"./registry-olFQKglt.js";import{t as v}from"./FieldInfoTooltip-C_hEtQpK.js";import{t as y}from"./codingDefaultSync-BHSxIX3Y.js";var b=[];function x(){let{project:e,organization:t,hasPermission:n}=p(),r=n(`organization:view`),i=s.modelProvider.listAllForOrganizationForFrontend.useQuery({organizationId:t?.id??``},{enabled:!!t?.id&&r,retry:!1,refetchOnWindowFocus:!1}),a=s.modelProvider.listAllForProjectForFrontend.useQuery({projectId:e?.id??``},{enabled:!!e?.id&&!r,retry:!1,refetchOnWindowFocus:!1}),o=r?i:a;return{providers:o.data?.providers??b,isReady:o.isSuccess,isLoading:o.isLoading,refetch:o.refetch}}function S(e){return!!e&&e!==`new`}function C({providers:e,modelProviderId:t}){if(S(t))return e.find(e=>e.id===t)}var w=e(t()),T=r(),E=c(e=>({pending:null,request:t=>e({pending:t}),clear:()=>e({pending:null})}));function D(){let e=E(e=>e.pending),t=E(e=>e.clear),n=s.modelProvider.getResolvedDefault.useQuery({projectId:e?.projectId??``,featureKey:g},{enabled:!!e}),r=!!n.data?.model&&_(n.data.model);(0,w.useEffect)(()=>{e&&r&&t()},[e,r,t]);let i=!n.isLoading||n.isError;return!e||!i||r?null:(0,T.jsx)(k,{open:!0,projectId:e.projectId,scopes:e.scopes,onClose:t})}async function O({applyDefaults:e,utils:t,projectId:n,scopes:r,onClose:i}){try{await e({projectId:n,scopes:r}),await y({utils:t,projectId:n}),a.create({title:`Codex set as the Langy and Fast default`,type:`success`}),i()}catch(e){o({error:e,fallbackTitle:`Could not set the defaults`})}}function k({open:e,projectId:t,scopes:r,onClose:a}){let o=s.modelProvider.codexApplyCodingDefaults.useMutation(),c=s.useUtils();return(0,T.jsx)(m,{open:e,onOpenChange:e=>!e.open&&a(),children:(0,T.jsxs)(d,{children:[(0,T.jsx)(f,{children:(0,T.jsx)(l,{children:`Set Codex as your coding default?`})}),(0,T.jsx)(h,{children:(0,T.jsxs)(i,{fontSize:`sm`,children:[`Langy and the fast AI assists`,(0,T.jsx)(v,{description:`The fast assists are the small AI helpers across the product: search, chat titles, autocomplete, and translations.`,testId:`codex-fast-assists-info`}),` `,`across LangWatch will run on this OpenAI account's plan. The playground, evaluations and workflows keep their current models.`]})}),(0,T.jsxs)(u,{children:[(0,T.jsx)(n,{size:`sm`,variant:`ghost`,onClick:a,children:`Not now`}),(0,T.jsx)(n,{size:`sm`,colorPalette:`orange`,loading:o.isLoading,onClick:()=>void O({applyDefaults:o.mutateAsync,utils:c,projectId:t,scopes:r,onClose:a}),children:`Set as default`})]})]})})}export{x as a,S as i,E as n,C as r,D as t};
2
+ //# sourceMappingURL=CodexCodingDefaultsAsk--UfSQyVR.js.map
@@ -0,0 +1,6 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{Pt as i,yr as a}from"./index-8SbDirJv.js";import{t as o}from"./prop-types-DeUPn3oD.js";import{t as s}from"./book-open-d9AKoJH3.js";import{t as c}from"./check-CcrJKf5P.js";import{t as l}from"./code-kZIt0FhA.js";import{t as u}from"./flag-x5s6thWb.js";import{t as d}from"./git-branch-BG6ExXKS.js";import{t as f}from"./shield-Da9CJWs3.js";var p=e(t()),m=e(o());function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function g(e,t){if(e==null)return{};var n=_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var v=(0,p.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=g(e,[`color`,`size`]);return p.createElement(`svg`,h({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),p.createElement(`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`}),p.createElement(`polyline`,{points:`3.27 6.96 12 12.01 20.73 6.96`}),p.createElement(`line`,{x1:`12`,y1:`22.08`,x2:`12`,y2:`12`}))});v.propTypes={color:m.default.string,size:m.default.oneOfType([m.default.string,m.default.number])},v.displayName=`Box`;function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}function b(e,t){if(e==null)return{};var n=x(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var S=(0,p.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=b(e,[`color`,`size`]);return p.createElement(`svg`,y({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),p.createElement(`circle`,{cx:`12`,cy:`12`,r:`10`}),p.createElement(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),p.createElement(`path`,{d:`M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z`}))});S.propTypes={color:m.default.string,size:m.default.oneOfType([m.default.string,m.default.number])},S.displayName=`Globe`;function C(){return C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(this,arguments)}function w(e,t){if(e==null)return{};var n=T(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function T(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var E=(0,p.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=w(e,[`color`,`size`]);return p.createElement(`svg`,C({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),p.createElement(`path`,{d:`M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),p.createElement(`polyline`,{points:`9 22 9 12 15 12 15 22`}))});E.propTypes={color:m.default.string,size:m.default.oneOfType([m.default.string,m.default.number])},E.displayName=`Home`;var D=r();function O(){return(0,D.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`17`,height:`17`,fill:`none`,viewBox:`0 0 17 17`,children:(0,D.jsx)(`path`,{fill:`#fff`,d:`M1.03 6.019V3.03h14.557V6.02H1.03zm0 7V10.03h14.557v2.989H1.03z`})})}function k(){return(0,D.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`17`,height:`17`,fill:`none`,viewBox:`0 0 77 77`,children:(0,D.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M4.684 20.571a18.54 18.54 0 00-3.175-.862c-.679-.121-.679-1.095 0-1.216l.224-.041a18.54 18.54 0 004.613-1.53A18.545 18.545 0 0015.63 6.685a18.54 18.54 0 00.862-3.175c.121-.679 1.095-.679 1.216 0l.041.224a18.54 18.54 0 001.53 4.613 18.544 18.544 0 0010.238 9.285 18.54 18.54 0 003.175.862c.679.121.679 1.095 0 1.216l-.224.041a18.54 18.54 0 00-4.612 1.53 18.544 18.544 0 00-9.286 10.238 18.54 18.54 0 00-.862 3.175c-.121.679-1.095.679-1.216 0l-.041-.224a18.54 18.54 0 00-1.53-4.612A18.545 18.545 0 004.685 20.57zm22.68 24.119a30.15 30.15 0 00-2.337-.531l-.032-.006-.044-.008-.29-.052-.051-.01c-1.086-.205-1.086-1.76 0-1.965l.052-.009.289-.052.044-.008.032-.006.32-.06a30.152 30.152 0 003.697-.976 30.01 30.01 0 0020-22.98l.005-.032.008-.044.051-.285.001-.005.01-.051c.205-1.086 1.76-1.086 1.965 0l.009.052.052.289.008.044.006.032.061.32a30.12 30.12 0 00.976 3.697 30.01 30.01 0 0022.98 20l.031.005.044.008.29.052.051.01c1.086.205 1.086 1.76 0 1.965l-.051.009-.157.028-.133.024-.044.008-.032.006-.32.061a30.135 30.135 0 00-3.697.976 30.01 30.01 0 00-20 22.98l-.005.031-.008.044-.018.099-.033.185-.01.057c-.206 1.086-1.76 1.086-1.966 0l-.009-.051-.052-.29-.008-.044-.006-.032-.06-.32a30.12 30.12 0 00-.976-3.697A30.01 30.01 0 0027.364 44.69zM12.395 65.511a11.683 11.683 0 017.404 4.803 11.689 11.689 0 011.918 4.635c.077.428.692.428.768 0l.026-.142a11.687 11.687 0 016.079-8.177 11.685 11.685 0 013.359-1.145c.428-.076.428-.691 0-.768a11.685 11.685 0 01-7.545-4.829 11.705 11.705 0 01-1.919-4.635c-.076-.428-.691-.428-.768 0l-.026.142a11.68 11.68 0 01-4.803 7.403 11.67 11.67 0 01-4.635 1.92c-.428.076-.428.69 0 .767l.142.026z`,clipRule:`evenodd`})})}function A(){return(0,D.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`80`,height:`80`,fill:`none`,viewBox:`0 0 80 80`,children:(0,D.jsx)(`path`,{fill:`currentColor`,d:`M40 29.813l-18.45 16.22-3.6-11.714L21.55 19 4 29.813v19.824L21.55 60 40 49.637 57.55 60 76 49.637V29.813L57.55 19l4.05 15.319-4.05 11.714L40 29.813z`})})}var j={xs:`16px`,sm:`20px`,md:`24px`,lg:`28px`,xl:`32px`},M={xs:`12px`,sm:`13px`,md:`16px`,lg:`18px`,xl:`20px`};function N({color:e,size:t,icon:r,...i}){return(0,D.jsx)(n,{backgroundColor:e,borderRadius:`4px`,fontSize:M[t],display:`flex`,alignItems:`center`,justifyContent:`center`,color:`white`,_icon:{padding:{xs:`2px`,sm:`3px`,md:`3px`,lg:`4px`,xl:`4px`}[t],minWidth:j[t],minHeight:j[t],maxWidth:j[t],maxHeight:j[t]},...i,children:r})}function P({cls:e}){let t={ExactMatchEvaluator:(0,D.jsx)(O,{}),"azure/prompt_injection":(0,D.jsx)(f,{}),"openai/moderation":(0,D.jsx)(f,{})};return t[e??``]?t[e??``]:(0,D.jsx)(c,{})}function F({cls:e}){let t={WeaviateRM:(0,D.jsx)(A,{})};return t[e??``]?t[e??``]:(0,D.jsx)(s,{})}var I=({type:e,cls:t,size:n,behave_as:r})=>{let i={signature:(0,D.jsx)(k,{}),entry:(0,D.jsx)(E,{}),code:(0,D.jsx)(l,{}),http:(0,D.jsx)(S,{}),agent:(0,D.jsx)(a,{size:16}),retriever:(0,D.jsx)(F,{cls:t}),prompting_technique:(0,D.jsx)(v,{}),evaluator:(0,D.jsx)(P,{cls:t}),end:(0,D.jsx)(u,{}),custom:(0,D.jsx)(v,{}),if_else:(0,D.jsx)(d,{})},o={signature:`green.emphasized`,entry:`blue.emphasized`,code:`cyan.emphasized`,http:`orange.emphasized`,agent:`purple.emphasized`,retriever:`purple.emphasized`,prompting_technique:`teal.emphasized`,evaluator:`green.emphasized`,end:`orange.emphasized`,custom:`gray.emphasized`,if_else:`yellow.emphasized`}[e];return r===`evaluator`&&(o=`green.solid`),(0,D.jsx)(N,{color:o,size:n,icon:i[e]})};function L({icon:e,size:t,...r}){let a=`<svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="6" height="6" fill="${i(`#F2F4F8`,`#19191d`)}"/>
3
+ <rect x="3" y="3" width="2" height="2" fill="${i(`#E5E7EB`,`#2e3038`)}"/>
4
+ </svg>
5
+ `;return(0,D.jsx)(n,{background:`url('data:image/svg+xml;utf8,${encodeURIComponent(a)}')`,borderRadius:`4px`,border:`1px solid`,borderColor:`border`,width:j[t],minWidth:j[t],height:j[t],minHeight:j[t],display:`flex`,alignItems:`center`,justifyContent:`center`,color:`white`,fontSize:M[t],...r,children:e})}export{v as a,k as i,I as n,L as r,N as t};
6
+ //# sourceMappingURL=ColorfulBlockIcons-zwwbjL9F.js.map
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./jsx-runtime-CFwixLRt.js";import{s as t}from"./shikiAdapter-Ctbe7cQu.js";import{kn as n}from"./ProjectAvatar-B0tbfKzY.js";import{t as r}from"./braces-DdQzhQOf.js";import{t as i}from"./layers-SRlsNtld.js";import{t as a}from"./clipboard-check-B4KWGtTD.js";import{t as o}from"./hash-Ci9P85W2.js";import{t as s}from"./image-C5YGAaF3.js";import{t as c}from"./type-DJLCeacc.js";import{Gn as l,gr as u,ir as d,xr as f}from"./index-8SbDirJv.js";var p=e(),m=({type:e,size:m=12})=>{let h={size:m,strokeWidth:2.5};switch(e){case`string`:return(0,p.jsx)(c,{...h,color:`var(--chakra-colors-blue-500)`});case`number`:return(0,p.jsx)(o,{...h,color:`var(--chakra-colors-green-500)`});case`boolean`:return(0,p.jsx)(l,{size:m+2,strokeWidth:2.5,color:`var(--chakra-colors-teal-500)`});case`json`:return(0,p.jsx)(r,{...h,color:`var(--chakra-colors-purple-500)`});case`chat_messages`:return(0,p.jsx)(t,{...h,color:`var(--chakra-colors-orange-500)`});case`image`:return(0,p.jsx)(s,{...h,color:`var(--chakra-colors-gray-400)`});case`date`:return(0,p.jsx)(u,{...h,color:`var(--chakra-colors-yellow-600)`});case`list`:return(0,p.jsx)(d,{...h,color:`var(--chakra-colors-purple-400)`});case`rag_contexts`:return(0,p.jsx)(f,{...h,color:`var(--chakra-colors-cyan-500)`});case`spans`:return(0,p.jsx)(i,{...h,color:`var(--chakra-colors-gray-500)`});case`annotations`:return(0,p.jsx)(n,{...h,color:`var(--chakra-colors-yellow-500)`});case`evaluations`:return(0,p.jsx)(a,{...h,color:`var(--chakra-colors-green-600)`});default:return(0,p.jsx)(c,{...h,color:`var(--chakra-colors-gray-400)`})}};export{m as t};
2
+ //# sourceMappingURL=ColumnTypeIcon-CZZ6Esh0.js.map
@@ -0,0 +1,4 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{t as c}from"./tooltip-CM-lMDNU.js";import{$ as l,J as u,Q as d,X as f,Y as p,Z as m,tt as h}from"./Markdown-Cip8Rj5C.js";import{t as g}from"./icon-D6xQEiPb.js";import{n as _}from"./personalProject-C9vU_vdl.js";import{Cn as v,S as y,n as b,o as x,pt as S,rn as C,s as w}from"./lu-BSZWBZXU.js";import{W as T}from"./index-8SbDirJv.js";import{Bn as E,C as D,D as O,E as k,Ht as A,Q as j,St as M,T as N,Un as P,an as F,at as I,cn as L,cr as R,d as ee,gn as te,in as ne,ln as re,on as ie,rn as ae,rt as oe,tr as se,u as ce,w as le,xn as ue,y as de}from"./CartesianChart-Ci1mTvgb.js";import{d as fe,f as pe,i as me,m as he,n as ge,p as _e,r as ve,t as ye,u as be}from"./useVariantMetrics-CK9aOmIb.js";import{o as xe}from"./BarChart-B23ShI5J.js";import{r as Se,t as Ce}from"./ErrorBarContext-CUuF6tzC.js";import{n as we,t as Te}from"./ScatterChart-jarSkvrF.js";var z=e(t()),B=e=>e.length===0?null:e.reduce((e,t)=>e+t,0)/e.length,Ee=({rows:e,variantId:t})=>{let n=[];for(let r of e){let e=r.targets[t];if(!e||e.error)continue;let i=he(e.output);typeof i!=`string`||i.length===0||n.push(i.length)}return B(n)},De=({variantIds:e,rows:t,leaderId:n})=>{let r={};for(let n of e)r[n]=Ee({rows:t,variantId:n});let i=n?r[n]??null:null,a=B(e.filter(e=>e!==n).map(e=>r[e]).filter(e=>e!=null));return{meanLengthByVariant:r,leaderRatio:i!==null&&a!==null&&a>0?i/a:null,leaderMeanLength:i,fieldMeanLength:a,leaderId:n??null}},Oe=e=>{if(!e)return null;let[t]=e.split(`/`);return!t||t===e?null:t.toLowerCase()},ke=({judgeModel:e,modelByVariant:t})=>{let n=Oe(e),r=n?Object.entries(t).filter(([,e])=>Oe(e)===n).map(([e])=>e):[];return{judgeModel:e??null,judgeFamily:n,sharedFamilyVariantIds:r}},Ae=e=>{let t=e.entries.filter(e=>!e.isDegenerate),n=t.length,r=n*(n-1)/2,i=e.scoreDifferenceCI,a=0;for(let n=0;n<t.length;n++)for(let r=n+1;r<t.length;r++)_e({a:t[n],b:t[r],differenceCI:i,comparability:e.comparability})&&a++;return{comparisonCount:e.comparisonCount,rankedVariantCount:n,separatedPairs:a,totalPairs:r,resolution:r>0?a/r:null,familyWiseFalsePositiveRate:r>1?1-.95**r:null}},V=a();function H({index:e,title:t,subtitle:r,help:a,hasProblem:l=!1,children:u}){return(0,V.jsxs)(n,{borderWidth:`1px`,borderColor:l?`orange.emphasized`:`border.muted`,borderRadius:`md`,padding:4,bg:`bg.subtle`,children:[(0,V.jsxs)(i,{align:`start`,gap:3,marginBottom:3,children:[(0,V.jsx)(n,{minWidth:`22px`,height:`22px`,borderRadius:`full`,bg:l?`orange.emphasized`:`border.emphasized`,color:`bg`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,children:(0,V.jsx)(o,{fontSize:`2xs`,fontWeight:`bold`,children:e})}),(0,V.jsxs)(s,{align:`start`,gap:0,children:[(0,V.jsxs)(i,{gap:1.5,align:`center`,children:[(0,V.jsx)(o,{fontSize:`sm`,fontWeight:`bold`,children:t}),a?(0,V.jsx)(c,{content:a,positioning:{placement:`bottom-start`},contentProps:{maxWidth:`320px`},children:(0,V.jsx)(n,{as:`span`,tabIndex:0,color:`fg.subtle`,display:`inline-flex`,cursor:`help`,"aria-label":`What does "${t}" mean?`,children:(0,V.jsx)(g,{as:S,boxSize:`13px`})})}):null]}),(0,V.jsx)(o,{fontSize:`xs`,color:`fg.muted`,children:r})]})]}),u]})}var je=.02,Me=(e,t)=>t[e]??e,Ne=e=>e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,Pe=e=>{let{comparability:t}=e,n=t.groups.length;return t.identifiable||n<=1?{label:`Everything is on one scale`,tone:`ok`,detail:`Every variant is linked to the rest through wins and losses, so the whole ranking is on a single scale.`}:{label:`Not all on one scale`,tone:`warn`,detail:`The run splits into ${n} groups that it never connected by a two-way result. Inside a group the scores compare normally; across groups only the order is meaningful, and the size of the gap is not — it reflects where the solver stopped rather than the evidence.`}},Fe=({leaderboard:e,warnThreshold:t})=>({label:`Enough comparisons`,tone:e.minMatchups>=t?`ok`:`warn`,detail:e.minMatchups>=t?`Every variant took part in at least ${e.minMatchups} matchups.`:`The least-compared variant has only ${e.minMatchups} of the ${t} matchups needed for a stable score. Run more rows.`}),Ie=e=>({label:`Every variant both won and lost`,tone:e.hasDegenerate?`warn`:`ok`,detail:e.hasDegenerate?`At least one variant never won, or never lost. There is no score that fits that, so it is excluded from the ranking.`:`No variant swept or was swept.`}),Le=e=>({label:`Ranking settled`,tone:e.didConverge&&e.comparability.identifiable?`ok`:`warn`,detail:e.comparability.identifiable?e.didConverge?`The ranking converged on a stable answer.`:`The ranking did not fully settle, so treat the order as approximate.`:`The ranking cannot settle across groups the run never connected, so treat gaps that span them as unmeasured.`}),Re=e=>{let t=e.bootstrapNonConvergence;return t===null||t<=je?[]:[{label:`Margins of error are approximate`,tone:`warn`,detail:`${Math.round(t*100)}% of the resamples used to size the margins of error did not settle, so treat the intervals as rough rather than exact.`}]},ze=({leaderboard:e,rowsWithoutVerdict:t})=>{if(t===void 0)return[];let n=e.comparisonCount;if(t===0)return[{label:`The judge called every row`,tone:`ok`,detail:`No row was left without a verdict.`}];let r=n+t,i=r>0?t/r:0;return[{label:`Rows the judge would not call`,tone:i>=.25?`warn`:`note`,detail:`${t} of ${r} rows produced no verdict — the judge picked a different winner when the candidates were shown in the opposite order, so neither answer was recorded. Those rows contribute nothing to the ranking${i>=.25?`, and at this share they are the likeliest reason it is thin. A judge this order-sensitive will not settle by running more rows; change the judge model or the prompt.`:`.`}`}]},Be=({leaderboard:e,warnThreshold:t,sampleAdequacy:n,verbosity:r,judgeIndependence:i,variantNames:a,rowsWithoutVerdict:o})=>{let s=e.entries.find(e=>!e.isDegenerate)?.variantId??null;return[Fe({leaderboard:e,warnThreshold:t}),Ie(e),Pe(e),...ze({leaderboard:e,rowsWithoutVerdict:o}),Le(e),...Re(e),He(n),Ue(r),We(i,a,s)]},Ve=e=>{let t=e.familyWiseFalsePositiveRate;return t===null||e.separatedPairs===0?``:` Each pair is judged on its own at 95%, so across ${e.totalPairs} pairs there is roughly a ${Math.round(t*100)}% chance at least one of them separated by luck.`},He=e=>{let{separatedPairs:t,totalPairs:n,comparisonCount:r}=e;return n===0?{label:`How much this run settled`,tone:`note`,detail:`Only one variant could be placed on the scale, so there is no pair to separate. Based on ${r} comparisons.`}:t===0?{label:`How much this run settled`,tone:`warn`,detail:`None of the ${n} variant pairs were separated — for every pair, the gap between the two scores is smaller than the uncertainty in that gap. ${r} comparisons was not enough to order these variants.`}:{label:`How much this run settled`,tone:t===n?`ok`:`note`,detail:(t===n?`All ${n} variant pairs were separated, so the run establishes a full order. Based on ${r} comparisons.`:`${t} of ${n} variant pairs were separated; for the rest, the gap between them is smaller than the uncertainty in that gap. Based on ${r} comparisons.`)+Ve(e)}},Ue=e=>{let{leaderRatio:t}=e;return t===null?{label:`Answer length`,tone:`note`,detail:e.leaderId===null?`This run has no single leader, so there is nothing to compare answer lengths against.`:`Not enough output text was recorded to compare how long each variant's answers were.`}:t>=1.5?{label:`Answer length`,tone:`note`,detail:`The leading variant's answers averaged ${t.toFixed(1)}× the length of the rest of the field. Judges tend to favour longer answers, so consider whether the extra length is doing real work here.`}:t<=1/1.5?{label:`Answer length`,tone:`note`,detail:`The leading variant's answers averaged ${t.toFixed(1)}× the length of the rest of the field — it won while writing less, which is the opposite of the usual length bias.`}:{label:`Answer length`,tone:`ok`,detail:`The leading variant's answers were about as long as everyone else's (${t.toFixed(1)}×), so length is unlikely to be what won it.`}},We=(e,t,n)=>{let{judgeModel:r,judgeFamily:i,sharedFamilyVariantIds:a}=e;return r?i===null?{label:`Judge independence`,tone:`note`,detail:`The judge is recorded as ${r}, which does not name a provider, so whether it shares a model family with a candidate cannot be checked.`}:a.length>0?{label:`Judge independence`,tone:`warn`,detail:`The judge (${r}) shares a model family with ${Ne(a.map(e=>Me(e,t)))}. Judges tend to rate their own family's output higher, so ${n!==null&&a.includes(n)?`discount that variant's lead accordingly.`:`that variant's score may be flattered — which matters most if it is close to the one you are about to ship.`}`}:{label:`Judge independence`,tone:`ok`,detail:`Judged by ${r}, which shares a model family with none of the candidates.`}:{label:`Judge independence`,tone:`note`,detail:`This run did not record which model judged it, so whether the judge shares a model family with a candidate cannot be checked.`}},Ge={ok:{color:`green.fg`,icon:y},warn:{color:`orange.fg`,icon:v},note:{color:`fg.muted`,icon:S}};function Ke(e){let t=Be(e);return(0,V.jsxs)(s,{align:`stretch`,gap:2,children:[(0,V.jsxs)(o,{fontSize:`xs`,color:`fg.muted`,children:[`Based on `,e.leaderboard.comparisonCount,` comparisons the judge resolved.`]}),t.map(e=>{let t=Ge[e.tone];return(0,V.jsxs)(i,{align:`start`,gap:2,children:[(0,V.jsx)(n,{marginTop:`2px`,color:t.color,flexShrink:0,children:(0,V.jsx)(g,{as:t.icon,boxSize:`13px`})}),(0,V.jsxs)(n,{children:[(0,V.jsx)(o,{fontSize:`xs`,fontWeight:`semibold`,children:e.label}),(0,V.jsx)(o,{fontSize:`xs`,color:`fg.muted`,children:e.detail})]})]},e.label)})]})}var qe=(e,t)=>t[e]??e,Je=e=>{let t=e.filter(e=>!e.isDegenerate).map(e=>e.score).filter(e=>Number.isFinite(e));if(t.length===0)return null;let n=Math.min(...t),r=Math.max(...t),i=(r-n||1)*.1,a=n-i,o=r+i,s=o-a||1;return{min:a,max:o,pct:e=>Math.min(100,Math.max(0,(e-a)/s*100))}},Ye=({ci:e,min:t,max:n})=>({start:e[0]<t,end:e[1]>n}),Xe=({start:e,end:t})=>{if(e&&t)return`linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%)`;if(e)return`linear-gradient(to right, transparent 0%, #000 14%)`;if(t)return`linear-gradient(to left, transparent 0%, #000 14%)`};function Ze({leaderboard:e,verdict:t,cheaperAlternative:n,variantNames:r,targetColors:i}){let a=new Set(t.tiedIds),o=be({verdict:t,cheaperAlternative:n,variantNames:r});return(0,V.jsxs)(s,{align:`stretch`,gap:4,children:[(0,V.jsx)($e,{tone:o.tone,heading:o.heading,children:o.detail}),(0,V.jsx)(rt,{leaderboard:e,variantNames:r,targetColors:i,tied:a,showTieShading:t.kind===`tie-at-top`})]})}var Qe={positive:{bg:`green.subtle`,fg:`green.fg`,border:`green.emphasized`},caution:{bg:`orange.subtle`,fg:`orange.fg`,border:`orange.emphasized`},neutral:{bg:`bg.muted`,fg:`fg`,border:`border.emphasized`}};function $e({tone:e,heading:t,children:r}){let i=Qe[e];return(0,V.jsxs)(n,{bg:i.bg,borderStartWidth:`3px`,borderStartColor:i.border,borderRadius:`md`,padding:3,children:[(0,V.jsx)(o,{fontSize:`md`,fontWeight:`bold`,color:i.fg,children:t}),(0,V.jsx)(o,{fontSize:`xs`,color:`fg.muted`,marginTop:1,children:r})]})}var et=e=>e.scoreCI&&Number.isFinite(e.scoreCI[0])&&Number.isFinite(e.scoreCI[1])?e.scoreCI:null;function tt({entry:e,label:t,tieLabel:n}){return(0,V.jsxs)(i,{justify:`space-between`,marginBottom:1,children:[(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(o,{fontSize:`xs`,fontWeight:`semibold`,children:t}),n?(0,V.jsx)(o,{fontSize:`2xs`,color:`orange.fg`,fontWeight:`semibold`,children:`tied for first`}):null,e.isDegenerate?(0,V.jsx)(o,{fontSize:`2xs`,color:`fg.muted`,children:`not scoreable`}):null]}),(0,V.jsxs)(o,{fontSize:`2xs`,color:`fg.muted`,children:[e.winRate===null?`—`:`${Math.round(e.winRate*100)}% win rate`,` `,`· `,e.matchups,` comparisons`]})]})}function nt({entry:e,color:t,scale:r}){let{pct:i,min:a,max:o}=r,s=et(e),c=s?Ye({ci:s,min:a,max:o}):null,l=c?Xe(c):void 0;return(0,V.jsxs)(n,{position:`relative`,height:`18px`,bg:`bg.muted`,borderRadius:`sm`,children:[s?(0,V.jsx)(n,{position:`absolute`,top:`5px`,bottom:`5px`,insetStart:`${i(s[0])}%`,width:`${Math.max(1,i(s[1])-i(s[0]))}%`,bg:t,opacity:.25,borderRadius:`sm`,borderStartRadius:c?.start?0:void 0,borderEndRadius:c?.end?0:void 0,style:l?{maskImage:l,WebkitMaskImage:l}:void 0}):null,(0,V.jsx)(n,{position:`absolute`,top:0,bottom:0,insetStart:`${i(e.score)}%`,width:`3px`,bg:t,borderRadius:`full`})]})}function rt({leaderboard:e,variantNames:t,targetColors:r,tied:i,showTieShading:a}){let c=e.entries,l=c.length>0?Je(c):null;return l?(0,V.jsxs)(s,{align:`stretch`,gap:2,children:[c.map(e=>(0,V.jsxs)(n,{children:[(0,V.jsx)(tt,{entry:e,label:qe(e.variantId,t),tieLabel:a&&i.has(e.variantId)}),(0,V.jsx)(nt,{entry:e,color:r?.[e.variantId]??`rgb(37, 99, 235)`,scale:l})]},e.variantId)),(0,V.jsxs)(o,{fontSize:`2xs`,color:`fg.muted`,children:[`Bar marks the score, the shaded band the range it could plausibly be. Two bands overlapping does not by itself mean the run failed to separate them — that is judged on the gap between the two scores, which is pinned down better than either score alone`,a?`, and “tied for first” marks the variants it could not separate from the top scorer`:``,`. A faded edge means the band continues past the chart.`]})]}):null}var it=({winMatrix:e,variantIds:t})=>{for(let n of t){let r=e[n];if(!r)continue;let i=t.filter(e=>e!==n).map(e=>r[e]??0);if(i.length<2||i.every(e=>e===0))continue;let[a]=i;if(i.some(e=>e!==a))return!0}return!1};function at({entries:e,variantNames:t}){let[n,r]=(0,z.useState)(`rank`),[i,a]=(0,z.useState)(`asc`),o=(0,z.useMemo)(()=>e.map((e,n)=>({...e,rank:n+1,name:t[e.variantId]??e.variantId})),[e,t]);return{sorted:(0,z.useMemo)(()=>{let e=[...o],t=i===`asc`?1:-1;return e.sort((e,r)=>{switch(n){case`score`:return(e.score-r.score)*t;case`winRate`:return((e.winRate??-1)-(r.winRate??-1))*t;case`matchups`:return(e.matchups-r.matchups)*t;default:return(e.rank-r.rank)*t}}),e},[o,n,i]),sortKey:n,sortDir:i,onSort:e=>{e===n?a(e=>e===`asc`?`desc`:`asc`):(r(e),a(e===`rank`?`asc`:`desc`))}}}function ot({leaderboard:e,variantNames:t,warnThreshold:n=30,onCellClick:r,showWarnings:a=!0}){let{sorted:c,sortKey:l,sortDir:u,onSort:d}=at({entries:e.entries,variantNames:t});return(0,V.jsxs)(s,{align:`stretch`,gap:3,padding:3,borderRadius:`md`,borderWidth:`1px`,borderColor:`border.muted`,bg:`bg.subtle`,children:[(0,V.jsxs)(i,{gap:2,flexWrap:`wrap`,children:[(0,V.jsx)(o,{fontWeight:`semibold`,fontSize:`sm`,children:`Leaderboard (95% confidence)`}),(0,V.jsxs)(o,{fontSize:`xs`,color:`fg.muted`,children:[e.comparisonCount,` comparisons · min`,` `,e.minMatchups,` matchups per variant`]})]}),(0,V.jsx)(st,{leaderboard:e,warnThreshold:n,showWarnings:a}),(0,V.jsx)(ct,{sorted:c,sortKey:l,sortDir:u,onSort:d}),(0,V.jsx)(pt,{leaderboard:e,variantNames:t,onCellClick:r})]})}function st({leaderboard:e,warnThreshold:t,showWarnings:n}){return n?(0,V.jsxs)(V.Fragment,{children:[e.minMatchups<t?(0,V.jsx)(W,{tone:`warning`,icon:v,text:`Sample size low — at least one variant has fewer than ${t} matchups. Scores may be unstable.`}):null,e.hasDegenerate?(0,V.jsx)(W,{tone:`info`,icon:v,text:`One or more variants have no wins or no losses — MLE is undefined for those and shown smoothed at the bottom of the table.`}):null,e.didConverge?null:(0,V.jsx)(W,{tone:`warning`,icon:v,text:`BT solver did not fully converge; scores are approximate.`})]}):null}function ct({sorted:e,sortKey:t,sortDir:r,onSort:a}){return(0,V.jsx)(n,{overflowX:`auto`,children:(0,V.jsxs)(d,{size:`sm`,variant:`outline`,children:[(0,V.jsx)(m,{children:(0,V.jsxs)(l,{children:[(0,V.jsx)(U,{label:`Rank`,col:`rank`,sortKey:t,sortDir:r,onSort:a}),(0,V.jsx)(f,{children:`Variant`}),(0,V.jsx)(U,{label:`Score (± 95% confidence)`,col:`score`,sortKey:t,sortDir:r,onSort:a}),(0,V.jsx)(U,{label:`Win rate`,col:`winRate`,sortKey:t,sortDir:r,onSort:a}),(0,V.jsx)(U,{label:`N`,col:`matchups`,sortKey:t,sortDir:r,onSort:a})]})}),(0,V.jsx)(u,{children:e.map(e=>(0,V.jsxs)(l,{children:[(0,V.jsx)(p,{children:e.rank}),(0,V.jsx)(p,{children:(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(o,{children:e.name}),e.isDegenerate?(0,V.jsx)(o,{fontSize:`xs`,color:`fg.muted`,children:`(never won / never lost)`}):null]})}),(0,V.jsx)(p,{children:lt(e.score,e.scoreCI)}),(0,V.jsx)(p,{children:e.winRate===null?`—`:`${Math.round(e.winRate*100)}%`}),(0,V.jsx)(p,{children:e.matchups})]},e.variantId))})]})})}function U({label:e,col:t,sortKey:n,sortDir:r,onSort:a}){let s=n===t,c=s?r===`asc`?x:b:w;return(0,V.jsx)(f,{"aria-sort":s?r===`asc`?`ascending`:`descending`:`none`,children:(0,V.jsxs)(i,{gap:1,cursor:`pointer`,onClick:()=>a(t),userSelect:`none`,role:`button`,tabIndex:0,"aria-label":`Sort by ${e}`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a(t))},_focusVisible:{outline:`2px solid`,outlineColor:`blue.focusRing`},children:[(0,V.jsx)(o,{children:e}),(0,V.jsx)(g,{as:c,boxSize:`12px`,color:s?`fg`:`fg.muted`})]})})}function lt(e,t){let n=e.toFixed(2);return!t||!Number.isFinite(t[0])||!Number.isFinite(t[1])?n:`${n} ± ${((t[1]-t[0])/2).toFixed(2)}`}function W({tone:e,icon:t,text:n}){return(0,V.jsxs)(i,{gap:2,paddingX:3,paddingY:2,borderRadius:`md`,bg:e===`warning`?`yellow.subtle`:`blue.subtle`,color:e===`warning`?`yellow.fg`:`blue.fg`,fontSize:`xs`,children:[(0,V.jsx)(g,{as:t,boxSize:`14px`}),(0,V.jsx)(o,{children:n})]})}var ut=({winMatrix:e,variantNames:t,rowId:n,colId:r})=>{let i=e[n]?.[r]??0,a=i+(e[r]?.[n]??0),o=a>0?i/a:null;return{wins:i,total:a,rate:o,pair:`${t[n]??n} vs ${t[r]??r}`,summary:o===null?`No matchups`:`${i} wins / ${a} matchups (${Math.round(o*100)}%)`}},dt=({rowId:e,colId:t,onCellClick:n})=>({role:`button`,tabIndex:0,onKeyDown:r=>{(r.key===`Enter`||r.key===` `)&&(r.preventDefault(),n(e,t))},_focusVisible:{outline:`2px solid`,outlineColor:`blue.focusRing`}});function ft({winMatrix:e,variantNames:t,rowId:n,colId:r,onCellClick:i}){if(n===r)return(0,V.jsx)(p,{textAlign:`center`,color:`fg.muted`,children:`—`});let{wins:a,total:o,rate:s,pair:c,summary:l}=ut({winMatrix:e,variantNames:t,rowId:n,colId:r}),u=o>0?i:void 0;return(0,V.jsx)(p,{textAlign:`center`,bg:mt(s),cursor:u?`pointer`:void 0,onClick:u?()=>u(n,r):void 0,...u?dt({rowId:n,colId:r,onCellClick:u}):{},"aria-label":u?`${c}: ${l}. Show the judge's reasoning.`:`${c}: ${l}`,title:l,children:o===0?`—`:a})}function pt({leaderboard:e,variantNames:t,onCellClick:r}){let i=e.entries.map(e=>e.variantId);if(i.length===0)return null;let a=it({winMatrix:e.winMatrix,variantIds:i});return(0,V.jsxs)(s,{align:`stretch`,gap:2,children:[(0,V.jsx)(o,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Win matrix (row = winner, column = opponent) — click a cell for why`}),a?null:(0,V.jsx)(o,{fontSize:`2xs`,color:`fg.muted`,children:`Each row here is the same number repeated — that variant's total wins, not a per-opponent tally, so the counts cannot tell you who it beat. The shading still can: it is how often the row variant won when those two met.`}),(0,V.jsx)(n,{overflowX:`auto`,children:(0,V.jsxs)(d,{size:`sm`,variant:`outline`,children:[(0,V.jsx)(m,{children:(0,V.jsxs)(l,{children:[(0,V.jsx)(f,{}),i.map(e=>(0,V.jsx)(f,{textAlign:`center`,children:t[e]??e},e))]})}),(0,V.jsx)(u,{children:i.map(n=>(0,V.jsxs)(l,{children:[(0,V.jsx)(p,{fontWeight:`medium`,children:t[n]??n}),i.map(i=>(0,V.jsx)(ft,{winMatrix:e.winMatrix,variantNames:t,rowId:n,colId:i,onCellClick:r},i))]},n))})]})})]})}function mt(e){if(e===null)return;let t=Math.abs(e-.5);return t<.05?`bg.muted`:e>.5?t>.3?`green.muted`:`green.subtle`:t>.3?`red.muted`:`red.subtle`}function ht(e){var t=E(),n=(0,z.useRef)(null);return(0,z.useLayoutEffect)(()=>{n.current===null?t(N(e)):n.current!==e&&t(O({prev:n.current,next:e})),n.current=e},[e,t]),(0,z.useLayoutEffect)(()=>()=>{n.current&&=(t(k(n.current)),null)},[t]),null}var gt={zAxisId:0,range:M.range,scale:M.scale,type:M.type};function G(e){var t=P(e,gt);return z.createElement(ht,{domain:t.domain,id:t.zAxisId,dataKey:t.dataKey,name:t.name,unit:t.unit,range:t.range,scale:t.scale,type:t.type,allowDuplicatedCategory:M.allowDuplicatedCategory,allowDataOverflow:M.allowDataOverflow,reversed:M.reversed,includeHidden:M.includeHidden})}G.displayName=`ZAxis`;function _t(e,t){return xt(e)||bt(e,t)||yt(e,t)||vt()}function vt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yt(e,t){if(e){if(typeof e==`string`)return K(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}function K(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function xt(e){if(Array.isArray(e))return e}var St={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}};function Ct(e){if(!(e===`spring`||typeof e!=`string`))return e}function wt(e){var t=P(e,St),n=t.animationId,r=t.from,i=t.to,a=t.attributeName,o=t.isActive,s=t.canBegin,c=t.duration,l=t.easing,u=t.begin,d=t.onAnimationEnd,f=t.onAnimationStart,p=t.children,m=L(),h=o===`auto`?!re.isSsr&&!m:o,g=ie(t.animationController),_=_t((0,z.useState)(()=>h?r:i),2),v=_[0],y=_[1],b=(0,z.useRef)(!1),x=(0,z.useCallback)(()=>{y(r),f()},[r,f]);return(0,z.useEffect)(()=>!h||!s?se:(b.current=!0,g(new ne,new F({animationId:n+a,easing:l,animationDuration:c,animationBegin:u,onAnimationStart:x,onAnimationEnd:d,from:r,to:i}),y)),[h,s,c,l,u,x,d,g,i,r,n,a]),h?s&&b.current?p({transition:ae([a],c,l),[a]:v}):p({[a]:r}):p({[a]:i})}var Tt=[`direction`,`width`,`dataKey`,`isAnimationActive`,`animationBegin`,`animationDuration`,`animationEasing`];function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?J(Object(n),!0).forEach(function(t){Et(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Et(e,t,n){return(t=Dt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dt(e){var t=Ot(e,`string`);return typeof t==`symbol`?t:t+``}function Ot(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kt(e,t){return Pt(e)||Nt(e,t)||jt(e,t)||At()}function At(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jt(e,t){if(e){if(typeof e==`string`)return Mt(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mt(e,t):void 0}}function Mt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Nt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Pt(e){if(Array.isArray(e))return e}function Ft(e,t){if(e==null)return{};var n,r,i=It(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function It(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Lt(e){var t=e.direction,n=e.width,r=e.dataKey,i=e.isAnimationActive,a=e.animationBegin,o=e.animationDuration,s=e.animationEasing,c=R(Ft(e,Tt)),l=Se(),u=l.data,d=l.dataPointFormatter,f=l.xAxisId,p=l.yAxisId,m=l.errorBarOffset,h=D(f),g=le(p);if(h?.scale==null||g?.scale==null||u==null||t===`x`&&h.type!==`number`)return null;var _=u.map((e,l)=>{var u=d(e,r,t),f=u.x,p=u.y,_=u.value,v=u.errorVal;if(!v||f==null||p==null)return null;var y=[],b,x;if(Array.isArray(v)){var S=kt(v,2),C=S[0],w=S[1];if(C==null||w==null)return null;b=C,x=w}else b=x=v;if(t===`x`){var T=h.scale,E=p+m,D=E+n,O=E-n,k=T.map(_-b),A=T.map(_+x);k!=null&&A!=null&&(y.push({x1:A,y1:D,x2:A,y2:O}),y.push({x1:k,y1:E,x2:A,y2:E}),y.push({x1:k,y1:D,x2:k,y2:O}))}else if(t===`y`){var M=g.scale,N=f+m,P=N-n,F=N+n,I=M.map(_-b),L=M.map(_+x);I!=null&&L!=null&&(y.push({x1:P,y1:L,x2:F,y2:L}),y.push({x1:N,y1:I,x2:N,y2:L}),y.push({x1:P,y1:I,x2:F,y2:I}))}var R=t===`x`?`scaleX`:`scaleY`,ee=`${f+m}px ${p+m}px`;return z.createElement(j,q({className:`recharts-errorBar`,key:`bar-${f}-${p}-${_}-${l}`},c),y.map((e,n)=>{var r=i?{transformOrigin:ee}:void 0;return z.createElement(wt,{animationId:`error-bar-${t}_${e.x1}-${e.x2}-${e.y1}-${e.y2}`,from:`${R}(0)`,to:`${R}(1)`,attributeName:`transform`,begin:a,easing:Ct(s),isActive:i,duration:o,key:`errorbar-${l}-${e.x1}-${e.y1}-${e.x2}-${e.y2}-${n}`},t=>z.createElement(`line`,q({},e,{style:Y(Y({},r),t)})))}))});return z.createElement(j,{className:`recharts-errorBars`},_)}function Rt(e){var t=te();return e??(t==null?`x`:t===`horizontal`?`y`:`x`)}var zt={stroke:`black`,strokeWidth:1.5,width:5,offset:0,isAnimationActive:!0,animationBegin:0,animationDuration:400,animationEasing:`ease-in-out`,zIndex:A.line};function X(e){var t=Rt(e.direction),n=P(e,zt),r=n.width,i=n.isAnimationActive,a=n.animationBegin,o=n.animationDuration,s=n.animationEasing,c=n.zIndex;return z.createElement(z.Fragment,null,z.createElement(Ce,{dataKey:n.dataKey,direction:t}),z.createElement(I,{zIndex:c},z.createElement(Lt,q({},n,{direction:t,width:r,isAnimationActive:i,animationBegin:a,animationDuration:o,animationEasing:s}))))}X.displayName=`ErrorBar`;var Bt=({a:e,b:t,differenceCI:n,comparability:r})=>_e({a:e,b:t,differenceCI:n,comparability:r})?e.score>t.score?1:-1:0,Vt=e=>e&&Number.isFinite(e.avg)&&e.count>=5?e.avg:null,Ht=({metrics:e,dimension:t,otherVariantId:n})=>{let r=(t===`cost`?e?.costDifferenceCI:e?.durationDifferenceCI)?.[n];return r?.every(e=>Number.isFinite(e))?r[1]<0?1:r[0]>0?-1:0:0},Ut=({dimension:e,a:t,b:n,leaderboard:r,variantMetrics:i})=>e===`quality`?Bt({a:t,b:n,differenceCI:r.scoreDifferenceCI,comparability:r.comparability}):Ht({metrics:i[t.variantId],dimension:e,otherVariantId:n.variantId}),Wt=({ranked:e,variantMetrics:t,dimension:n})=>e.length>0&&e.every(e=>{let r=t[e.variantId];return Vt(n===`cost`?r?.costStats:r?.durationStats)!==null}),Gt=({ranked:e,variantMetrics:t})=>{let n=[`quality`];return Wt({ranked:e,variantMetrics:t,dimension:`cost`})&&n.push(`cost`),Wt({ranked:e,variantMetrics:t,dimension:`speed`})&&n.push(`speed`),n},Kt=({winner:e,loser:t,dimensions:n,leaderboard:r,variantMetrics:i})=>{let a=n.map(n=>Ut({dimension:n,a:e,b:t,leaderboard:r,variantMetrics:i})),o=a.every(e=>e>=0),s=a.some(e=>e>0);return!o||!s?null:{winnerId:e.variantId,loserId:t.variantId,strictlyBetterOn:n.filter((e,t)=>a[t]>0)}},qt=({leaderboard:e,variantMetrics:t})=>{let n=e.entries.filter(e=>!e.isDegenerate),r=Gt({ranked:n,variantMetrics:t}),i=[],a=Object.fromEntries(n.map(e=>[e.variantId,[]]));for(let o of n)for(let s of n){if(o.variantId===s.variantId)continue;let n=Kt({winner:o,loser:s,dimensions:r,leaderboard:e,variantMetrics:t});n&&(i.push(n),a[s.variantId].push(o.variantId))}return{dimensions:r,dominatedBy:a,edges:i,front:n.map(e=>e.variantId).filter(e=>a[e].length===0)}},Jt=e=>e<1e-4?`$${e.toExponential(2)}`:`$${e.toFixed(4)}`,Yt=e=>e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`,Xt=[70,420],Zt=[110,110],Qt={width:4,strokeWidth:1.5,stroke:`var(--chakra-colors-fg-muted)`},Z=e=>e===`cost`?`Avg cost`:`Avg duration`,$t=e=>e===`cost`?Jt:Yt,en=e=>{let t=e===`cost`?`duration`:`cost`;return{xAxisMetric:e,sizeMetric:t,formatX:$t(e),formatSize:$t(t),xLabel:Z(e),sizeLabel:Z(t).toLowerCase()}},Q=e=>e?.every(e=>Number.isFinite(e))?e:null,tn=({metrics:e,metric:t})=>(t===`cost`?e?.costStats:e?.durationStats)?.avg??null,nn=({metrics:e,metric:t})=>Q(t===`cost`?e?.costMeanCI:e?.durationMeanCI),rn=({value:e,ci:t,clampAtZero:n=!1})=>{if(!t)return;let r=e-t[0],i=t[1]-e;return n?[Math.max(0,r),Math.max(0,i)]:[r,i]},an=({entries:e,variantMetrics:t,variantNames:n,targetColors:r,axis:i,dominance:a})=>e.filter(e=>!e.isDegenerate).map((e,o)=>{let s=t[e.variantId],c=tn({metrics:s,metric:i.xAxisMetric});if(c===null)return null;let l=nn({metrics:s,metric:i.xAxisMetric});return{variantId:e.variantId,name:n[e.variantId]??e.variantId,score:e.score,x:c,xOffsets:rn({value:c,ci:l,clampAtZero:!0}),xCI:l,size:tn({metrics:s,metric:i.sizeMetric}),dominated:(a.dominatedBy[e.variantId]?.length??0)>0,ciOffsets:rn({value:e.score,ci:Q(e.scoreCI)}),color:r?.[e.variantId]??me[o%me.length]}}).filter(e=>e!==null);function on({leaderboard:e,variantMetrics:t,variantNames:n,targetColors:r,chartHeight:a=260}){let[c,l]=(0,z.useState)(`cost`),u=(0,z.useMemo)(()=>en(c),[c]),d=(0,z.useMemo)(()=>qt({leaderboard:e,variantMetrics:t}),[e,t]),f=(0,z.useMemo)(()=>an({entries:e.entries,variantMetrics:t,variantNames:n,targetColors:r,axis:u,dominance:d}),[e.entries,t,n,r,u,d]);return(0,V.jsxs)(s,{align:`stretch`,gap:2,children:[(0,V.jsxs)(i,{justify:`space-between`,flexWrap:`wrap`,children:[(0,V.jsxs)(o,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:[`Quality vs. `,u.xLabel.toLowerCase()]}),(0,V.jsx)(sn,{value:c,onChange:l})]}),f.length===0?(0,V.jsxs)(o,{fontSize:`xs`,color:`fg.muted`,textAlign:`center`,paddingY:6,children:[`No `,c,` data recorded for these variants yet.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ln,{data:f,axis:u,chartHeight:a}),(0,V.jsx)(dn,{data:f,axis:u})]})]})}function sn({value:e,onChange:t}){return(0,V.jsxs)(i,{gap:1,children:[(0,V.jsx)(r,{size:`2xs`,variant:e===`cost`?`solid`:`ghost`,"aria-pressed":e===`cost`,onClick:()=>t(`cost`),children:`Cost`}),(0,V.jsx)(r,{size:`2xs`,variant:e===`duration`?`solid`:`ghost`,"aria-pressed":e===`duration`,onClick:()=>t(`duration`),children:`Duration`})]})}var cn=e=>(0,V.jsx)(xe,{fill:e.color,fillOpacity:e.dominated?.25:.9,stroke:e.color,strokeWidth:e.dominated?1.5:0},e.variantId);function ln({data:e,axis:t,chartHeight:n}){let r=e.some(e=>e.size!==null),i=e.some(e=>e.ciOffsets!==void 0),a=e.some(e=>e.xOffsets!==void 0);return(0,V.jsx)(ue,{width:`100%`,height:n,children:(0,V.jsxs)(Te,{margin:{top:14,right:24,left:10,bottom:10},children:[(0,V.jsx)(de,{stroke:`var(--chakra-colors-border)`,strokeDasharray:`3 3`}),(0,V.jsx)(ee,{type:`number`,dataKey:`x`,name:t.xLabel,tickFormatter:e=>t.formatX(e),style:{fontSize:`11px`},tick:{fill:`var(--chakra-colors-fg-muted)`}}),(0,V.jsx)(ce,{type:`number`,dataKey:`score`,name:`Score`,style:{fontSize:`11px`},tick:{fill:`var(--chakra-colors-fg-muted)`},width:40}),(0,V.jsx)(G,{type:`number`,dataKey:`size`,name:t.sizeLabel,range:r?Xt:Zt}),(0,V.jsx)(oe,{cursor:{strokeDasharray:`3 3`},content:({active:e,payload:n})=>(0,V.jsx)(un,{active:e,point:n?.[0]?.payload,axis:t})}),(0,V.jsxs)(we,{data:e,name:`Variants`,children:[i?(0,V.jsx)(X,{dataKey:`ciOffsets`,direction:`y`,...Qt}):null,a?(0,V.jsx)(X,{dataKey:`xOffsets`,direction:`x`,...Qt}):null,e.map(cn)]})]})})}function un({active:e,point:t,axis:n}){return!e||!t?null:(0,V.jsxs)(s,{align:`start`,gap:0,bg:`bg.panel`,border:`1px solid`,borderColor:`border`,borderRadius:`md`,padding:2,fontSize:`xs`,children:[(0,V.jsx)(o,{fontWeight:`semibold`,children:t.name}),(0,V.jsxs)(o,{children:[`Score: `,t.score.toFixed(2),t.ciOffsets?` (${(t.score-t.ciOffsets[0]).toFixed(0)} to ${(t.score+t.ciOffsets[1]).toFixed(0)})`:``]}),(0,V.jsxs)(o,{children:[n.xLabel,`: `,n.formatX(t.x),t.xCI?` (${n.formatX(t.xCI[0])} to ${n.formatX(t.xCI[1])})`:``]}),t.size===null?null:(0,V.jsxs)(o,{children:[Z(n.sizeMetric),`: `,n.formatSize(t.size)]}),t.dominated?(0,V.jsx)(o,{color:`fg.muted`,children:`Beaten outright by another variant`}):null]})}function dn({data:e,axis:t}){let n=e.some(e=>e.size!==null),r=e.some(e=>e.ciOffsets!==void 0),i=e.some(e=>e.xOffsets!==void 0),a=e.some(e=>e.dominated);return(0,V.jsxs)(s,{align:`start`,gap:0,children:[n?(0,V.jsxs)(o,{fontSize:`xs`,color:`fg.muted`,children:[`Point size is `,t.sizeLabel,` — bigger is`,` `,t.sizeMetric===`cost`?`dearer`:`slower`,`.`]}):(0,V.jsxs)(o,{fontSize:`xs`,color:`fg.muted`,children:[`No `,t.sizeMetric,` was recorded, so point size means nothing here.`]}),r?(0,V.jsxs)(o,{fontSize:`xs`,color:`fg.muted`,children:[`Bars are 95% confidence intervals — vertically for the score,`,i?` horizontally for the ${t.xLabel.toLowerCase()}. Both say where the true value lies, not how much individual rows varied.`:`.`]}):null,a?(0,V.jsx)(o,{fontSize:`xs`,color:`fg.muted`,children:`Hollow points are beaten outright on every metric shown.`}):null]})}var fn={quality:`quality`,cost:`cost`,speed:`speed`},$=e=>e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,pn=({dominance:e,variantNames:t})=>{let n=e=>t[e]??e;if(Object.keys(e.dominatedBy).length<2)return null;if(e.dimensions.length<2)return{tone:`neutral`,droppableIds:[],headline:`Only quality could be compared here — no cost or duration was recorded for every variant, so there is no trade-off to weigh.`};let r=$(e.dimensions.map(e=>fn[e]));if(e.edges.length===0)return{tone:`neutral`,droppableIds:[],headline:`No variant is beaten outright on ${r} — every one of them is better than the others at something, so this is a genuine trade-off.`};let i=Object.keys(e.dominatedBy).filter(t=>(e.dominatedBy[t]?.length??0)>0);if(i.length===1){let t=i[0],r=e.dominatedBy[t][0],a=e.edges.find(e=>e.loserId===t&&e.winnerId===r),o=$((a?.strictlyBetterOn??[]).map(e=>fn[e])),s=(a?.strictlyBetterOn.length??0)<e.dimensions.length?`, and no worse on the rest`:``;return{tone:`actionable`,droppableIds:i,headline:`${n(t)} is beaten outright by ${n(r)} — better on ${o}${s}. There is nothing it is buying you.`}}return{tone:`actionable`,droppableIds:i,headline:`${i.length} variants are beaten outright and can be dropped: ${$(i.map(t=>`${n(t)} (by ${$(e.dominatedBy[t].map(n))})`))}.`}};function mn({leaderboard:e,variantMetrics:t,variantNames:n}){let r=(0,z.useMemo)(()=>pn({dominance:qt({leaderboard:e,variantMetrics:t}),variantNames:n}),[e,t,n]);if(!r)return null;let a=r.tone===`actionable`;return(0,V.jsxs)(i,{align:`start`,gap:2,borderWidth:`1px`,borderColor:a?`orange.emphasized`:`border.muted`,borderRadius:`md`,padding:3,children:[(0,V.jsx)(g,{as:a?C:S,boxSize:`14px`,color:a?`orange.fg`:`fg.muted`,marginTop:`2px`,flexShrink:0}),(0,V.jsx)(o,{fontSize:`sm`,children:r.headline})]})}var hn=({column:e,rows:t,variantIds:n,variantNames:r,modelByTargetId:i,judgeModel:a})=>{let o=ve({column:e,variantIds:n}),s=ye({rows:t,variantIds:n}),c=(0,z.useMemo)(()=>fe(o),[o]),l=(0,z.useMemo)(()=>pe({verdict:c,variantMetrics:s}),[c,s]),u=(0,z.useMemo)(()=>Ae(o),[o]),d=(0,z.useMemo)(()=>De({variantIds:n,rows:t,leaderId:c.leaderId}),[n,t,c.leaderId]),f=(0,z.useMemo)(()=>ke({judgeModel:a??null,modelByVariant:Object.fromEntries(n.map(e=>[e,i?.[e]??null]))}),[a,i,n]);return{leaderboard:o,variantMetrics:s,verdict:c,cheaperAlternative:l,sampleAdequacy:u,verbosity:d,judgeIndependence:f,trustHasProblem:(0,z.useMemo)(()=>Be({leaderboard:o,warnThreshold:30,sampleAdequacy:u,verbosity:d,judgeIndependence:f,variantNames:r,rowsWithoutVerdict:e.rowsWithoutVerdict}),[o,u,d,f,r,e.rowsWithoutVerdict]).some(e=>e.tone===`warn`)}};function gn({pair:e,variantNames:t,verdictsByRow:r}){let i=(0,z.useMemo)(()=>Object.values(r).filter(t=>t.winnerId===e.winnerId&&(t.candidateIds??[]).includes(e.winnerId)&&(t.candidateIds??[]).includes(e.opponentId)&&t.reasoning),[r,e]);return(0,V.jsxs)(n,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:3,children:[(0,V.jsxs)(o,{fontWeight:`semibold`,fontSize:`sm`,marginBottom:2,children:[t[e.winnerId]??e.winnerId,` vs`,` `,t[e.opponentId]??e.opponentId]}),i.length===0?(0,V.jsx)(o,{fontSize:`xs`,color:`fg.muted`,children:`No reasoning recorded for this matchup.`}):(0,V.jsx)(s,{align:`stretch`,gap:2,children:i.map((e,t)=>(0,V.jsxs)(n,{children:[(0,V.jsxs)(o,{fontSize:`xs`,color:`fg.muted`,children:[`Row `,e.rowIndex+1]}),(0,V.jsx)(o,{fontSize:`sm`,children:e.reasoning}),t<i.length-1?(0,V.jsx)(h,{marginTop:2}):null]},e.rowIndex))})]})}var _n=(0,V.jsx)(V.Fragment,{children:`Each verdict the judge gave is read as one matchup per pair of variants in it. Each variant gets a score from those, weighted by how strong its opponents were — so beating a good variant counts for more than beating a weak one. The score is chess-rating style: 0 is average for this group, and it is the GAP that means something, not the number. A 400-point gap is roughly 10:1 odds; 0 is a coin flip. The shaded band behind each bar is where that score could plausibly sit. Whether two variants actually differ is judged on the gap between them rather than on those two bands: every resample re-scores the whole field at once, so the scores move together and the gap is pinned down better than either score is on its own. Two bands can overlap and the run still tell those variants apart.`}),vn=(0,V.jsx)(V.Fragment,{children:`Every check is reported either way, so a silent panel means the check passed rather than that it was never run. Ticks are fine, amber is a real problem worth acting on, and grey is a measurement for you to judge — like how much longer the leading variant's answers were, which matters because judges tend to favour longer answers whether or not they are better.`}),yn=(0,V.jsx)(V.Fragment,{children:`Cost and latency are shown next to quality, never blended into it — a single "best overall" number would hide the trade-off you are actually making. All three are on one chart: two as position, the third as point size. A variant that is no better on any of them is called out above, so you do not have to find it yourself. The grid below counts how often each variant beat each other one; click any cell to read the judge's own words for those rows.`});function bn({analysis:e,variantNames:t,targetColors:n,verdictsByRow:r}){let[i,a]=(0,z.useState)(null);return(0,V.jsx)(H,{index:3,title:`What is it costing you, and why did it win?`,subtitle:`Trade-offs, head-to-head detail, and the judge's own reasoning.`,help:yn,children:(0,V.jsxs)(s,{align:`stretch`,gap:4,children:[(0,V.jsx)(mn,{leaderboard:e.leaderboard,variantMetrics:e.variantMetrics,variantNames:t}),(0,V.jsx)(on,{leaderboard:e.leaderboard,variantMetrics:e.variantMetrics,variantNames:t,targetColors:n}),(0,V.jsx)(h,{}),(0,V.jsx)(ot,{leaderboard:e.leaderboard,variantNames:t,warnThreshold:30,showWarnings:!1,onCellClick:(e,t)=>a({winnerId:e,opponentId:t})}),i?(0,V.jsx)(gn,{pair:i,variantNames:t,verdictsByRow:r}):null]})})}function xn({evaluatorId:e}){let{closeDrawer:t}=T();return(0,V.jsx)(_.Root,{open:!0,placement:`end`,size:`lg`,onOpenChange:t,children:(0,V.jsxs)(_.Content,{bg:`bg`,children:[(0,V.jsxs)(_.Header,{children:[(0,V.jsx)(o,{fontWeight:`semibold`,fontSize:`lg`,children:`Leaderboard`}),(0,V.jsx)(_.CloseTrigger,{})]}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(o,{fontSize:`sm`,color:`fg.muted`,"data-testid":`leaderboard-needs-results-page-${e}`,children:`This leaderboard is built from the run's results, which are not carried in the link. Open the run and expand the leaderboard card to see it.`})})]})})}function Sn({evaluatorId:e,column:t,rows:n,...r}){return ge()?!t||!n?(0,V.jsx)(xn,{evaluatorId:e}):(0,V.jsx)(Cn,{evaluatorId:e,column:t,rows:n,...r}):null}function Cn({column:e,rows:t,targetColors:n,modelByTargetId:r,judgeModel:i}){let{closeDrawer:a}=T(),c=(0,z.useMemo)(()=>e.variants.map(e=>e.id).filter(e=>!!e),[e.variants]),l=(0,z.useMemo)(()=>Object.fromEntries(e.variants.map(e=>[e.id??``,e.name])),[e.variants]),u=hn({column:e,rows:t,variantIds:c,variantNames:l,modelByTargetId:r,judgeModel:i});return(0,V.jsx)(_.Root,{open:!0,placement:`end`,size:`lg`,onOpenChange:a,children:(0,V.jsxs)(_.Content,{bg:`bg`,children:[(0,V.jsxs)(_.Header,{children:[(0,V.jsxs)(o,{fontWeight:`semibold`,fontSize:`lg`,children:[e.name,` — leaderboard`]}),(0,V.jsx)(_.CloseTrigger,{})]}),(0,V.jsx)(_.Body,{children:(0,V.jsxs)(s,{align:`stretch`,gap:4,paddingBottom:6,children:[(0,V.jsx)(H,{index:1,title:`Which one should you ship?`,subtitle:`The ranking, and whether the run actually separates them.`,help:_n,children:(0,V.jsx)(Ze,{leaderboard:u.leaderboard,verdict:u.verdict,cheaperAlternative:u.cheaperAlternative,variantNames:l,targetColors:n})}),(0,V.jsx)(H,{index:2,title:`Can you trust that?`,subtitle:`What this run does and does not support.`,help:vn,hasProblem:u.trustHasProblem,children:(0,V.jsx)(Ke,{leaderboard:u.leaderboard,rowsWithoutVerdict:e.rowsWithoutVerdict,warnThreshold:30,sampleAdequacy:u.sampleAdequacy,verbosity:u.verbosity,judgeIndependence:u.judgeIndependence,variantNames:l})}),(0,V.jsx)(bn,{analysis:u,variantNames:l,targetColors:n,verdictsByRow:e.verdictsByRow})]})})]})})}export{Sn as ComparisonLeaderboardDrawer};
4
+ //# sourceMappingURL=ComparisonLeaderboardDrawer-ChH7KNaX.js.map
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./portal-Sdfvrza9.js";import{t}from"./jsx-runtime-CFwixLRt.js";import{n}from"./v-stack-hkuSkmCA.js";import{St as r}from"./index-8SbDirJv.js";var i=t();function a({open:t,onClose:a,onConfirm:o,title:s,description:c,isLoading:l,children:u,confirmDisabled:d=!1}){return(0,i.jsx)(r.Root,{open:t,onOpenChange:e=>!e.open&&a(),children:(0,i.jsxs)(r.Content,{bg:`bg`,children:[(0,i.jsx)(r.Header,{children:(0,i.jsx)(r.Title,{children:s})}),(0,i.jsxs)(r.Body,{children:[(0,i.jsx)(n,{textStyle:`sm`,children:c}),u]}),(0,i.jsxs)(r.Footer,{children:[(0,i.jsx)(e,{variant:`outline`,size:`sm`,onClick:a,children:`Cancel`}),(0,i.jsx)(e,{colorPalette:`red`,size:`sm`,onClick:o,loading:l,disabled:d,children:`Confirm`})]}),(0,i.jsx)(r.CloseTrigger,{})]})})}export{a as t};
2
+ //# sourceMappingURL=ConfirmDialog-CWzCY4sN.js.map
@@ -0,0 +1,2 @@
1
+ import{i as e,n as t}from"./portal-Sdfvrza9.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{n as r}from"./v-stack-hkuSkmCA.js";import{Nn as i}from"./ProjectAvatar-B0tbfKzY.js";import{s as a}from"./toaster-BsYkODqs.js";import{A as o}from"./DashboardLayout-Cn5-9Ye2.js";import{r as s,t as c}from"./card-By_Mbslh.js";import{T as l}from"./fetchSSE-CnJPAkno.js";import{t as u}from"./index-8SbDirJv.js";import{t as d}from"./billing-plans-D_IT1cHz.js";var f=n();function p(){return(0,f.jsx)(s,{"data-testid":`contact-sales-block`,borderWidth:1,borderColor:`border`,children:(0,f.jsxs)(c,{paddingY:5,paddingX:6,children:[(0,f.jsx)(r,{fontWeight:`semibold`,fontSize:`lg`,children:`Need more?`}),(0,f.jsx)(i,{"data-testid":`enterprise-features-list`,templateColumns:{base:`1fr`,md:`1fr 1.4fr 1fr`},gap:2,marginTop:4,children:d.map(e=>(0,f.jsxs)(t,{gap:2,alignItems:`start`,children:[(0,f.jsx)(a,{size:16,color:`var(--chakra-colors-orange-solid)`}),(0,f.jsx)(r,{fontSize:`sm`,color:`fg.muted`,children:e})]},e))}),(0,f.jsx)(l,{justifyContent:`flex-end`,marginTop:6,children:(0,f.jsx)(e,{asChild:!0,variant:`outline`,size:`sm`,colorPalette:`orange`,children:(0,f.jsx)(u,{href:o,isExternal:!0,fontWeight:`semibold`,children:`Contact Sales`})})})]})})}export{p as t};
2
+ //# sourceMappingURL=ContactSalesBlock-B3w2lKdE.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./skeleton-0JSrjbwm.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{$ as u,$n as d,At as f,Mt as p,Tt as m,Zn as h,cn as g,d as _,hn as v,jt as y,ln as b,mn as x,n as ee,tr as S,u as C}from"./ProjectAvatar-B0tbfKzY.js";import{t as w}from"./tooltip-CM-lMDNU.js";import{d as T,f as E,n as D}from"./toaster-BsYkODqs.js";import{D as O,I as k,O as A,ct as j,t as M,tt as te,u as N}from"./Markdown-Cip8Rj5C.js";import{t as P}from"./grid-MxZhegzw.js";import{r as F}from"./fieldset-kmG3NTVs.js";import{a as I,i as L,n as ne,r as R,t as z}from"./alert-CPsXih3K.js";import{r as re,t as ie}from"./card-By_Mbslh.js";import{t as B}from"./grid-item-CKAuKzga.js";import{t as V}from"./spacer-C38e7o6r.js";import{tt as ae}from"./immer-DImI3Uq2.js";import{n as H}from"./api-l6Cnm0vQ.js";import{p as oe,s as se}from"./trpcError-CFsR-0nB.js";import{c as ce}from"./auth-client-MjRW2PVA.js";import{r as U}from"./next-router-CWLrMXvP.js";import{s as le}from"./index.esm-Cpy5fWo1.js";import{D as ue,Mr as de,St as W,Ut as fe,Vt as G,W as pe,n as me,t as he,vr as ge}from"./index-8SbDirJv.js";import{c as _e,l as ve,n as ye,o as K,r as be,s as xe}from"./MessageCard-Nbu21sIo.js";import{t as Se}from"./edit-3WDhqC-Q.js";import{t as Ce}from"./message-circle-B_y3A1Db.js";import{t as we}from"./more-vertical-CnKfgTmQ.js";import{t as Te}from"./thumbs-up-TCqW37wn.js";import{t as Ee}from"./trash-2-Bq5tW_xF.js";import{t as De}from"./SmallLabel-Dh74EKHT.js";import{a as Oe,r as ke}from"./RenderInputOutput-DqsCnspr.js";import{t as Ae}from"./useTraceDetailsDrawer-CWSKPTh_.js";import{r as je}from"./HoverableBigText-BMBnTTnr.js";import{r as Me}from"./src-yc8ckSKn.js";var Ne=T(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),q=e(t()),J=oe(e=>({traceId:null,action:null,annotationId:null,conversationHasSomeComments:!1,expectedOutputAction:null,expectedOutput:null,setCommentState:t=>e(e=>({...e,...t})),resetComment:()=>e({traceId:null,action:null,expectedOutputAction:null,expectedOutput:null}),setConversationHasSomeComments:t=>e({conversationHasSomeComments:t}),setExpectedOutput:t=>e({expectedOutput:t})}));function Pe(e){let t=U(),n=typeof t.query.span==`string`?t.query.span:void 0,r=typeof t.query.openTab==`string`?t.query.openTab:void 0,{project:i}=G(),[a,o]=(0,q.useState)(!0),s=H.traces.getById.useQuery({projectId:i?.id??``,traceId:e},{enabled:!!i&&!!e,refetchOnWindowFocus:!0,refetchInterval:a?5e3:void 0});return(0,q.useEffect)(()=>{if(s.data){o(!1);return}let e=setTimeout(()=>{o(!1)},1e4);return()=>clearTimeout(e)},[s.data]),se(s.error)&&a&&(s={...s,data:void 0,error:void 0,isLoading:!0,isError:!1}),{traceId:e,spanId:n,trace:s,openTab:r}}var Y=o(),Fe=({traceId:e})=>{let{project:t}=G(),n=J(),{annotationId:i,expectedOutput:o,setExpectedOutput:s,setCommentState:d}=n,f=H.annotation.getByTraceId.useQuery({projectId:t?.id??``,traceId:e},{enabled:!!t?.id});return(0,Y.jsxs)(l,{gap:3,align:`start`,paddingBottom:4,width:`full`,children:[n.expectedOutputAction===`new`&&e===n.traceId&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(c,{fontWeight:`500`,children:`Suggest output:`}),(0,Y.jsx)(ae,{width:`full`,value:o??``,placeholder:`Enter your expected output here...`,onClick:e=>{e.stopPropagation()},onChange:e=>{s(e.target.value)}})]}),f.data?.some(e=>e.expectedOutput)&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(c,{fontWeight:`bold`,children:`Expected Output:`}),f.data?.map(t=>t.expectedOutput?(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(a,{width:`full`,onDoubleClick:()=>{d({expectedOutputAction:`edit`,annotationId:t.id,expectedOutput:t.expectedOutput,traceId:e,action:`edit`})},children:[(0,Y.jsx)(w,{content:t.user?.name??``,children:(0,Y.jsx)(r,{display:`inline-flex`,children:(0,Y.jsx)(u,{size:`xs`,name:t.user?.name??``,image:t.user?.image})})}),n.expectedOutputAction===`edit`&&i===t.id?(0,Y.jsx)(ae,{value:n.expectedOutputAction===`edit`?o??``:t.expectedOutput??``,placeholder:`Enter your expected output here...`,onClick:e=>{e.stopPropagation()},onChange:e=>{s(e.target.value)}}):(0,Y.jsx)(c,{children:t.expectedOutput})]},t.id)}):null)]})]})};function Ie({reason:e,open:t,onClose:n,onConfirm:r}){let[a,o]=(0,q.useState)(e);return(0,q.useEffect)(()=>{o(e)},[e,t]),(0,Y.jsx)(W.Root,{open:t,onOpenChange:n,placement:`center`,children:(0,Y.jsxs)(W.Content,{bg:`bg`,children:[(0,Y.jsx)(W.CloseTrigger,{}),(0,Y.jsx)(W.Header,{children:(0,Y.jsx)(W.Title,{fontSize:`md`,fontWeight:`500`,children:`Why did you select this option?`})}),(0,Y.jsx)(W.Body,{children:(0,Y.jsx)(de,{placeholder:`Explain your reasoning`,value:a,onChange:e=>o(e.target.value)})}),(0,Y.jsxs)(W.Footer,{fontWeight:`500`,children:[(0,Y.jsx)(i,{variant:`outline`,mr:3,onClick:n,children:`Leave Blank`}),(0,Y.jsx)(i,{colorPalette:`blue`,onClick:()=>{r(a),n()},children:`Add`})]})]})})}var X=!1;function Z({key:e=``}){let{project:t,isPublicRoute:o}=G(),d=J(),{traceId:f,action:p,annotationId:m,expectedOutput:h}=d,g=H.useContext(),_=ce(),v=H.annotation.create.useMutation(),y=H.annotation.deleteById.useMutation(),b=H.annotationScore.getAllActive.useQuery({projectId:t?.id??``},{enabled:!!t?.id&&!o}),x=H.annotation.getById.useQuery({projectId:t?.id??``,annotationId:m??``}),C=H.annotation.updateByTraceId.useMutation(),{id:w}=x.data??{comment:``,scoreOptions:{}},{register:T,handleSubmit:E,watch:O,setValue:A,reset:j}=le({defaultValues:{comment:``,scoreOptions:{}}});(0,q.useEffect)(()=>{x.data?j({comment:x.data.comment??``,scoreOptions:x.data.scoreOptions??{}}):p===`new`&&j({comment:``,scoreOptions:{}})},[x.data,p]);let M=e=>{let n=Object.fromEntries(Object.entries(e.scoreOptions??{}).filter(([e,t])=>t.value!==``&&t.value!==null&&(typeof t.value==`boolean`?t.value:!0)&&(Array.isArray(t.value)?t.value.length>0:!0)));p===`edit`?C.mutate({id:w??``,projectId:t?.id??``,comment:e.comment,traceId:f??``,scoreOptions:n,expectedOutput:h??``},{onSuccess:()=>{g.annotation.getByTraceId.invalidate(),g.annotation.getAll.invalidate(),D.create({title:`Annotation Updated`,description:`You have successfully updated the annotation`,type:`success`,meta:{closable:!0}}),j(),d.resetComment()},onError:()=>{D.create({title:`Error`,description:`Error updating annotation`,type:`error`,meta:{closable:!0}})}}):v.mutate({projectId:t?.id??``,comment:e.comment,traceId:f??``,scoreOptions:n,expectedOutput:h??``},{onSuccess:()=>{g.annotation.getByTraceId.invalidate(),D.create({title:`Annotation Created`,description:`You have successfully created an annotation`,type:`success`,meta:{closable:!0}}),j(),d.resetComment()},onError:()=>{D.create({title:`Error`,description:`Error creating annotation`,type:`error`,meta:{closable:!0}})}})},N=()=>{y.mutate({annotationId:w??``,projectId:t?.id??``},{onSuccess:()=>{g.annotation.getByTraceId.invalidate(),D.create({title:`Annotation Deleted`,description:`You have successfully deleted the annotation`,type:`success`,meta:{closable:!0}}),d.resetComment()}})},P=S(),[F,I]=(0,q.useState)(null),L=e=>{I(e),P.onOpen()},ne=F?O(`scoreOptions.${F}`)?.reason??``:``,{open:R,setOpen:z}=S();return(0,q.useEffect)(()=>{X=!1},[R]),(0,Y.jsxs)(r,{width:`full`,onClick:e=>e.stopPropagation(),minWidth:380,children:[(0,Y.jsx)(re,{children:(0,Y.jsx)(ie,{children:x.isLoading?(0,Y.jsxs)(l,{align:`start`,gap:3,width:`full`,children:[(0,Y.jsxs)(a,{children:[(0,Y.jsx)(s,{children:(0,Y.jsx)(ee,{size:`sm`,name:_.data?.user.name??``,image:_.data?.user.image})}),(0,Y.jsx)(s,{height:`20px`,width:`120px`})]}),(0,Y.jsx)(s,{height:`40px`,width:`full`}),(0,Y.jsxs)(a,{gap:2,width:`full`,children:[(0,Y.jsx)(s,{height:`24px`,width:`100px`}),(0,Y.jsx)(s,{height:`24px`,width:`100px`}),(0,Y.jsx)(s,{height:`24px`,width:`100px`})]}),(0,Y.jsxs)(a,{width:`full`,justify:`flex-end`,children:[(0,Y.jsx)(s,{height:`32px`,width:`80px`}),(0,Y.jsx)(s,{height:`32px`,width:`80px`})]})]}):(0,Y.jsx)(`form`,{onSubmit:E(M),children:(0,Y.jsxs)(l,{align:`start`,gap:3,children:[(0,Y.jsxs)(a,{width:`full`,children:[(0,Y.jsx)(u,{size:`sm`,name:_.data?.user.name??``,image:_.data?.user.image}),(0,Y.jsx)(c,{children:_.data?.user.name}),(0,Y.jsx)(V,{}),p===`edit`&&(0,Y.jsxs)(k.Root,{open:R,onOpenChange:e=>z(X?!0:e.open),children:[(0,Y.jsx)(k.Trigger,{asChild:!0,children:(0,Y.jsx)(i,{size:`xs`,variant:`ghost`,children:(0,Y.jsx)(we,{size:16})})}),(0,Y.jsx)(k.Content,{portalled:!1,children:(0,Y.jsxs)(k.Item,{value:`delete`,color:`red.fg`,onClick:()=>{X=!0,N()},children:[y.isLoading||x.isLoading?(0,Y.jsx)(n,{size:`sm`}):(0,Y.jsx)(Ee,{size:16}),`Delete`]})})]})]}),(0,Y.jsx)(de,{...T(`comment`),autoFocus:p===`new`,placeholder:p===`new`?`Leave your comment here`:``}),(0,Y.jsx)(a,{gap:2,width:`full`,wrap:`wrap`,children:b.data?.map(e=>(0,Y.jsx)(Le,{scoreType:{...e,options:e.options,dataType:e.dataType,defaultValue:e.defaultValue},watch:O,setValue:A,onReasonClick:()=>L(e.id)},e.id))}),(0,Y.jsxs)(a,{width:`full`,children:[(0,Y.jsx)(V,{}),(0,Y.jsx)(i,{variant:`outline`,size:`sm`,onClick:e=>{e.stopPropagation(),j(),d.resetComment()},children:`Cancel`}),(0,Y.jsx)(i,{colorPalette:`blue`,type:`submit`,minWidth:`fit-content`,size:`sm`,loading:v.isLoading||C.isLoading||x.isLoading,children:p===`new`?`Save`:`Update`})]}),b.data?.length===0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(te,{}),(0,Y.jsx)(c,{children:`Scoring metrics are currently disabled. Enable them to add more data to your annotations.`}),(0,Y.jsx)(me,{href:`/settings/annotation-scores`,children:(0,Y.jsx)(i,{colorPalette:`blue`,minWidth:`fit-content`,size:`sm`,children:`Enable scoring metrics`})})]})]})})})}),(0,Y.jsx)(Ie,{reason:ne,open:P.open,onClose:()=>{P.onClose(),I(null)},onConfirm:e=>{F&&A(`scoreOptions.${F}.reason`,e),P.onClose(),I(null)}})]},e)}var Le=({scoreType:e,watch:t,setValue:n,onReasonClick:r})=>{let a=t(`scoreOptions.${e.id}.value`),o=e.defaultValue?.value??``,[s,c]=(0,q.useState)();(0,q.useEffect)(()=>{let e=a;e&&c(e)},[a]);let[u,d]=(0,q.useState)(!1);return(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(p.Root,{open:u,onOpenChange:e=>d(e.open),children:[(0,Y.jsx)(p.Trigger,{asChild:!0,children:(0,Y.jsxs)(i,{size:`xs`,variant:`outline`,children:[a?Array.isArray(a)?a.join(`, `):a.toString():e.name,(0,Y.jsx)(x,{size:16})]})}),(0,Y.jsxs)(p.Content,{children:[(0,Y.jsx)(p.Arrow,{}),(0,Y.jsx)(p.CloseTrigger,{}),(0,Y.jsx)(p.Header,{children:e.description}),(0,Y.jsx)(p.Body,{children:e?.dataType===`CHECKBOX`?(0,Y.jsx)(F,{children:(0,Y.jsx)(A,{value:[...s?[s].flat():[]],onValueChange:e=>{c(e)},children:(0,Y.jsxs)(l,{align:`start`,gap:2,children:[e.options.map((e,t)=>(0,Y.jsx)(O,{value:e.value.toString(),children:e.label},t)),(0,Y.jsx)(Re,{scoreTypeId:e.id,onReasonClick:r,setValue:n,watch:t,tempValue:s??``,setTempValue:c,setOpen:d})]})})}):(0,Y.jsx)(F,{children:(0,Y.jsx)(y,{value:s?.toString()??``,defaultValue:o,onValueChange:e=>{c(e.value??``)},children:(0,Y.jsxs)(l,{align:`start`,gap:2,children:[e.options.map(e=>(0,Y.jsx)(f,{value:e.value.toString(),children:e.label},e.value)),(0,Y.jsx)(Re,{scoreTypeId:e.id,onReasonClick:r,setValue:n,watch:t,tempValue:s??``,setTempValue:c,setOpen:d})]})})})})]})]})})},Re=({scoreTypeId:e,onReasonClick:t,setValue:n,watch:r,tempValue:o,setTempValue:s,setOpen:l})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(c,{fontSize:`sm`,children:r(`scoreOptions.${e}.reason`)&&`Reason: ${r(`scoreOptions.${e}.reason`)}`}),(0,Y.jsxs)(a,{width:`full`,children:[(0,Y.jsx)(V,{}),(0,Y.jsx)(i,{size:`xs`,onClick:()=>{n(`scoreOptions.${e}.value`,``),n(`scoreOptions.${e}.reason`,``),s(``)},variant:`outline`,children:`Clear`}),(0,Y.jsx)(i,{size:`xs`,onClick:()=>{t(e),n(`scoreOptions.${e}.value`,o),l(!1)},colorPalette:`blue`,disabled:!o,children:`Apply`})]})]}),ze=({traceId:e,setHover:t})=>{let{data:n}=fe(),{project:i,isPublicRoute:o}=G(),s=J(),d=H.annotation.getByTraceId.useQuery({projectId:i?.id??``,traceId:e},{enabled:!!i?.id}),f=H.annotationScore.getAll.useQuery({projectId:i?.id??``},{enabled:!!i?.id&&!o});return(0,Y.jsxs)(l,{gap:3,align:`start`,paddingY:4,children:[d.data?.map(i=>{let o=n?.user?.id===i.user?.id;return s.annotationId===i.id&&s.action===`edit`?(0,Y.jsx)(r,{onMouseEnter:()=>t(!0),onMouseMove:()=>t(!0),onMouseLeave:()=>t(!1),children:(0,Y.jsx)(Z,{},i.id)},i.id):(0,Y.jsx)(re,{backgroundColor:`bg.muted`,border:`none`,width:`full`,onClick:o?t=>{t.stopPropagation(),s.setCommentState?.({traceId:e,action:`edit`,annotationId:i.id,expectedOutput:i.expectedOutput,expectedOutputAction:`edit`})}:void 0,onMouseEnter:()=>t(!0),onMouseMove:()=>t(!0),onMouseLeave:()=>t(!1),cursor:o?`pointer`:`default`,children:(0,Y.jsx)(ie,{children:(0,Y.jsxs)(l,{align:`start`,gap:3,children:[(0,Y.jsxs)(a,{width:`full`,align:`top`,children:[(0,Y.jsx)(u,{size:`sm`,background:`gray.solid`,color:`white`,name:i.user?.name??void 0,image:i.user?.image}),(0,Y.jsxs)(l,{align:`start`,gap:0,children:[(0,Y.jsx)(c,{fontWeight:`bold`,fontSize:`sm`,children:i.user?.name??(0,Y.jsxs)(a,{marginBottom:2,children:[(0,Y.jsx)(r,{borderRadius:5,paddingY:.5,paddingX:2,border:`1px solid`,borderColor:`border.emphasized`,fontSize:`xs`,children:`API`}),(0,Y.jsxs)(c,{color:`fg.muted`,fontSize:`sm`,children:[`-`,` `,i.email?i.email:`anonymous`]})]})}),(0,Y.jsx)(c,{fontSize:`xs`,children:i.createdAt.toLocaleString()})]}),(0,Y.jsx)(V,{}),o&&(0,Y.jsx)(w,{content:`Edit Annotation`,positioning:{placement:`top`},showArrow:!0,children:(0,Y.jsx)(Se,{size:`18px`})})]}),(0,Y.jsx)(c,{children:i.comment}),i.isThumbsUp===!0?(0,Y.jsx)(Te,{size:`20px`}):i.isThumbsUp===!1?(0,Y.jsx)(_e,{size:`20px`}):null,(0,Y.jsx)(a,{align:`start`,gap:2,wrap:`wrap`,divideY:`1px`,children:i.scoreOptions&&typeof i.scoreOptions==`object`&&Object.entries(i.scoreOptions).map(([e,t])=>{if(!t||typeof t!=`object`||!(`value`in t))return null;let n=f.data?.find(t=>t.id===e)?.name;return!n||!t.value?null:n&&(0,Y.jsx)(c,{fontSize:`sm`,children:(0,Y.jsxs)(l,{align:`start`,gap:0,children:[(0,Y.jsxs)(c,{fontSize:`xs`,fontWeight:`500`,children:[n,`:`]}),typeof t==`object`&&`value`in t&&(0,Y.jsxs)(a,{gap:1,wrap:`wrap`,children:[(0,Y.jsx)(c,{fontSize:`xs`,children:Array.isArray(t.value)?t.value.join(`,`):String(t.value??``)}),t.reason&&(0,Y.jsx)(w,{content:typeof t.reason==`object`?JSON.stringify(t.reason):t.reason,children:(0,Y.jsx)(Ce,{size:`12px`})})]})]})},e)})})]})})},i.id)}),s.action===`new`&&s.traceId===e&&(0,Y.jsx)(Z,{},s.annotationId??``)]})};function Be({content:e}){return Me(e)?(0,Y.jsxs)(L,{status:`info`,size:`sm`,variant:`subtle`,width:`full`,children:[(0,Y.jsx)(R,{}),(0,Y.jsx)(z,{children:(0,Y.jsxs)(ne,{fontSize:`sm`,children:[`Some content was redacted by this project's privacy settings (PII or secrets redaction). Review them under`,` `,(0,Y.jsx)(E,{asChild:!0,color:`blue.600`,textDecoration:`underline`,children:(0,Y.jsx)(me,{href:`/settings/data-privacy`,children:`Settings`})}),`.`]})})]}):null}var Ve=()=>{let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(null),[i,a]=(0,q.useState)(!1);return{translatedTextInput:e,setTranslatedTextInput:t,translatedTextOutput:n,setTranslatedTextOutput:r,translationActive:i,setTranslationActive:a}},Q=({tooltipContent:e,onClick:t,children:n})=>(0,Y.jsx)(w,{content:e,showArrow:!0,positioning:{placement:`top`},children:(0,Y.jsx)(r,{width:`38px`,height:`38px`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:2,paddingX:2,borderRadius:`50%`,border:`1px solid`,borderColor:`border`,backgroundColor:`bg.panel`,onClick:e=>{e.stopPropagation(),t(e)},cursor:`pointer`,children:(0,Y.jsx)(l,{children:n})})}),He=({trace:e,translatedTextInput:t,setTranslatedTextInput:r,setTranslatedTextOutput:i,setTranslationActive:a,translationActive:o})=>{let{project:s}=G(),{isLiteMember:c}=C(),u=H.translate.translate.useMutation(),d=()=>{if(a(!o),t)return;let n=u.mutateAsync({projectId:s?.id??``,textToTranslate:K(e)}),c=u.mutateAsync({projectId:s?.id??``,textToTranslate:e.output?.value??``});Promise.all([n,c]).then(([e,t])=>{r(e.translation),i(t.translation)}).catch(e=>{a(!1),g(e)&&D.create({title:`Error translating`,description:`There was an error translating the message, please try again.`,type:`error`,meta:{closable:!0}})})},{setCommentState:f}=J(),{drawerOpen:p}=pe(),{openTraceDetailsDrawer:m}=Ae();return(0,Y.jsxs)(l,{position:`absolute`,top:`50%`,right:-5,transform:`translateY(-50%)`,children:[!c&&(0,Y.jsx)(Q,{tooltipContent:`View Trace`,onClick:()=>{e&&(p(`traceDetails`)?m({traceId:e.trace_id,selectedTab:`traceDetails`}):m({traceId:e.trace_id}))},children:(0,Y.jsx)(ge,{size:`20px`})}),(0,Y.jsx)(Q,{tooltipContent:`Translate message to English`,onClick:d,children:u.isLoading?(0,Y.jsx)(n,{size:`sm`}):o?(0,Y.jsx)(j,{src:`/images/translate-active.svg`,alt:`Translate`,width:`20px`}):(0,Y.jsx)(j,{src:`/images/translate.svg`,alt:`Translate`,width:`20px`})}),(0,Y.jsx)(Q,{tooltipContent:`Annotate`,onClick:()=>{f?.({traceId:e.trace_id,action:`new`,annotationId:void 0})},children:(0,Y.jsx)(Se,{size:`20px`})}),(0,Y.jsx)(Q,{tooltipContent:`Suggest`,onClick:()=>{f?.({traceId:e.trace_id,action:`new`,annotationId:void 0,expectedOutput:e.output?.value,expectedOutputAction:`new`})},children:(0,Y.jsx)(Ne,{size:`20px`})})]})},Ue=q.forwardRef(function({trace:e,highlighted:t,index:i,loadingMore:o},s){let{project:u}=G(),[f,p]=(0,q.useState)(!1),[g,y]=(0,q.useState)(!1),{setCommentState:x,action:ee,conversationHasSomeComments:S,setConversationHasSomeComments:C}=J(),w=Ve(),T=H.annotation.getByTraceId.useQuery({projectId:u?.id??``,traceId:e.trace_id},{enabled:!!u?.id}),E=ee==`new`||S,D=(0,q.useMemo)(()=>m(e.input?.value),[e.input?.value]),O=(0,q.useMemo)(()=>m(e.output?.value),[e.output?.value]);(0,q.useEffect)(()=>(T.data&&T.data.length>0&&C(!0),()=>{C(!1)}),[T.data]);let k=(0,Y.jsx)(l,{ref:s,align:`start`,width:`full`,gap:0,children:(0,Y.jsxs)(P,{templateColumns:`repeat(4, 1fr)`,gap:5,width:`full`,maxWidth:E?`1420px`:`1000px`,alignItems:`start`,role:`group`,children:[(0,Y.jsx)(B,{colSpan:E?3:4,height:`100%`,maxWidth:`1000px`,width:`100%`,position:`relative`,background:t?`blue.subtle`:f?`bg.muted`:`bg.panel`,paddingLeft:10,paddingRight:10,paddingY:4,borderX:`1px solid`,borderTop:t||!o&&(i===`first`||i===`only`)?`1px solid`:`none`,...o?{borderRadius:`0`}:i===`only`?{borderRadius:`lg`}:i===`first`?{borderTopRadius:`lg`}:i===`last`?{borderBottomRadius:`lg`}:{borderRadius:`0`},borderBottom:t||i===`last`||i===`only`?`1px solid`:`none`,borderColor:t?`blue.200`:`border`,onMouseEnter:()=>y(!0),onMouseMove:()=>y(!0),onMouseLeave:()=>y(!1),children:(0,Y.jsxs)(l,{gap:0,marginRight:5,width:`100%`,align:`start`,children:[o&&(0,Y.jsxs)(a,{gap:3,paddingBottom:6,children:[(0,Y.jsx)(n,{size:`sm`}),(0,Y.jsx)(c,{children:`Loading messages...`})]}),g&&(0,Y.jsx)(He,{trace:e,...w}),e.metadata.thread_id&&(0,Y.jsxs)(c,{color:`fg.subtle`,fontSize:`xs`,children:[`Thread ID: `,e.metadata.thread_id]}),(0,Y.jsx)(Be,{content:`${K(e)??``}\n${N(e.output?.value)??``}`}),(0,Y.jsx)(_,{categories:e.privacy?.droppedCategories}),(0,Y.jsx)($,{author:`Input`,avatar:(0,Y.jsx)(d,{size:`sm`,children:(0,Y.jsx)(h,{})}),timestamp:e.timestamps.started_at,paddingTop:`20px`,children:(0,Y.jsx)(r,{paddingY:`6px`,marginBottom:`38px`,children:(0,Y.jsxs)(b,{field:`input`,children:[(0,Y.jsx)(Oe,{parts:D}),(0,Y.jsx)(M,{children:w.translatedTextInput&&w.translationActive?w.translatedTextInput:K(e)})]})})}),(0,Y.jsxs)($,{author:u?.name??``,avatar:(0,Y.jsx)(d,{size:`sm`,background:`orange.400`,children:(0,Y.jsx)(h,{name:u?.name})}),timestamp:e.timestamps.started_at+(e.metrics?.first_token_ms??e.metrics?.total_time_ms??0),children:[O.length>0&&(0,Y.jsx)(r,{paddingTop:2,children:(0,Y.jsx)(Oe,{parts:O})}),e.error&&!e.output?.value?(0,Y.jsxs)(l,{alignItems:`flex-start`,gap:2,paddingY:2,children:[(0,Y.jsx)(r,{fontSize:`11px`,color:`red.400`,textTransform:`uppercase`,fontWeight:`bold`,children:`Exception`}),(0,Y.jsx)(c,{color:`red.900`,children:e.error.message})]}):e.output?.value&&(je(N(e.output.value))||ke(N(e.output.value)))?(0,Y.jsx)(ye,{value:N(e.output.value)}):e.output?.value?(0,Y.jsxs)(l,{alignItems:`flex-start`,gap:2,paddingY:2,width:`80%`,children:[(0,Y.jsx)(r,{onDoubleClick:()=>{x?.({traceId:e.trace_id,action:`new`,annotationId:void 0,expectedOutput:N(e.output?.value),expectedOutputAction:`new`})},children:(0,Y.jsx)(b,{field:`output`,children:(0,Y.jsx)(M,{children:w.translatedTextOutput&&w.translationActive?w.translatedTextOutput:N(e.output.value)})})}),(0,Y.jsx)(Fe,{traceId:e.trace_id,setHover:p,output:N(e.output.value)})]}):(0,Y.jsx)(b,{field:`output`,children:(0,Y.jsx)(c,{paddingY:2,children:`<empty>`})}),e.expected_output&&(0,Y.jsxs)(L,{status:`warning`,children:[(0,Y.jsx)(R,{children:(0,Y.jsx)(ve,{size:`16`})}),(0,Y.jsxs)(z,{children:[(0,Y.jsx)(I,{children:`Expected Output:`}),(0,Y.jsx)(c,{children:w.translatedTextOutput&&w.translationActive?w.translatedTextOutput:be(e)})]})]}),(0,Y.jsx)(a,{fontSize:`13px`,color:`fg.subtle`,children:(0,Y.jsx)(xe,{trace:e,addDot:!1})})]}),i===`only`&&(0,Y.jsx)(r,{width:`100%`,height:`200px`})]})}),E&&(0,Y.jsx)(B,{minWidth:`420px`,paddingRight:6,paddingLeft:4,onClick:t=>{t.stopPropagation(),x?.({traceId:e.trace_id,action:`new`,annotationId:void 0,expectedOutputAction:`new`,expectedOutput:null})},children:(0,Y.jsx)(ze,{traceId:e.trace_id,setHover:p})})]})});return e.redacted_by_visibility_window?(0,Y.jsx)(v,{children:k}):k});function $({author:e,avatar:t,timestamp:n,paddingTop:r,children:i}){let{project:o}=G(),s=n?new Date(n):void 0,u=ue(n);return o?(0,Y.jsxs)(a,{width:`full`,paddingTop:r,align:`start`,gap:3,children:[t,(0,Y.jsxs)(l,{align:`start`,gap:0,width:`full`,className:`content-hover`,wordBreak:`break-all`,children:[(0,Y.jsxs)(a,{width:`full`,children:[(0,Y.jsx)(De,{children:e}),(0,Y.jsx)(V,{}),s&&u&&(0,Y.jsx)(w,{content:s?.toLocaleString(),children:(0,Y.jsx)(c,{color:`fg.subtle`,children:u})})]}),i]})]}):null}function We({threadId:e,traceId:t}){let n=U(),{trace:i}=Pe(n.query.trace||t),{project:a,isPublicRoute:o}=G(),u=(0,q.useRef)(null),d=H.traces.getTracesByThreadId.useQuery({projectId:a?.id??``,threadId:e??``},{enabled:!!a&&!!e}),f=n.query.trace||(d.data?.length&&d.data?.length>1?n.query[`drawer.traceId`]:void 0);return(0,q.useEffect)(()=>{if(d.data&&d.data?.length>0&&f){let e=setTimeout(()=>{u.current&&u.current.scrollIntoView({behavior:`smooth`,block:`center`})},300);return()=>clearTimeout(e)}},[d.data,f]),(0,Y.jsxs)(r,{width:`full`,minWidth:`800px`,paddingX:6,children:[d.data&&d.data.length>50&&(0,Y.jsxs)(L,{status:`info`,children:[(0,Y.jsx)(R,{}),(0,Y.jsx)(z,{children:(0,Y.jsx)(I,{children:`Over 50 messages found in thread, showing only the last 50.`})})]}),(0,Y.jsx)(l,{align:`start`,width:`full`,gap:0,children:e||i.data?(0,Y.jsxs)(Y.Fragment,{children:[e?d.data?d.data.slice(Math.max(0,d.data.length-50)).map((e,n)=>(0,Y.jsx)(Ue,{trace:e,index:d.data.length===1?`only`:n===0?`first`:n===d.data.length-1?`last`:`other`,ref:e.trace_id==(f||t)?u:void 0,highlighted:e.trace_id==f},e.trace_id)):d.error&&!o?(0,Y.jsx)(r,{maxWidth:`800px`,paddingTop:8,paddingBottom:4,children:(0,Y.jsx)(c,{color:`red.500`,children:`Something went wrong trying to load previous messages`})}):null:null,i.data&&(!d.data||d.data.length===0)&&(0,Y.jsx)(Ue,{trace:i.data,highlighted:!!f,index:`only`,loadingMore:d.isFetching}),i.data&&!i.data.metadata.thread_id&&(0,Y.jsx)(r,{width:`full`,maxWidth:`1000px`,paddingY:8,children:(0,Y.jsxs)(c,{fontStyle:`italic`,color:`fg.muted`,textAlign:`center`,width:`full`,children:[`Pass the thread_id on your integration to capture and visualize the whole conversation or associated actions. Read more on our`,` `,(0,Y.jsx)(he,{isExternal:!0,href:`https://docs.langwatch.ai/integration/python/guide#adding-metadata`,textDecoration:`underline`,children:`docs`}),`.`]})})]}):i.isLoading?(0,Y.jsx)(r,{maxWidth:`1000px`,width:`full`,children:(0,Y.jsx)(P,{templateColumns:`repeat(4, 1fr)`,children:(0,Y.jsx)(B,{colSpan:4,children:(0,Y.jsxs)(r,{position:`relative`,border:`1px solid`,borderColor:`border`,marginRight:5,paddingLeft:10,paddingRight:10,paddingY:4,background:`bg.panel`,borderRadius:`lg`,minHeight:`524px`,children:[(0,Y.jsx)($,{author:``,avatar:(0,Y.jsx)(s,{borderRadius:`full`,minWidth:`36px`,minHeight:`36px`}),paddingTop:`20px`,children:(0,Y.jsx)(r,{paddingY:`6px`,marginBottom:`62px`,maxWidth:`90%`,children:(0,Y.jsxs)(l,{gap:4,width:`full`,align:`start`,children:[(0,Y.jsx)(s,{width:`720px`,maxWidth:`100%`,height:`20px`}),(0,Y.jsx)(s,{width:`720px`,maxWidth:`100%`,height:`20px`})]})})}),(0,Y.jsx)($,{author:``,avatar:(0,Y.jsx)(s,{borderRadius:`full`,minWidth:`36px`,minHeight:`36px`}),children:(0,Y.jsx)(r,{paddingY:`6px`,marginBottom:`62px`,maxWidth:`90%`,children:(0,Y.jsxs)(l,{gap:4,width:`full`,align:`start`,children:[(0,Y.jsx)(s,{width:`720px`,maxWidth:`100%`,height:`20px`}),(0,Y.jsx)(s,{width:`720px`,maxWidth:`100%`,height:`20px`})]})})})]})})})}):null})]})}export{Pe as n,J as r,We as t};
2
+ //# sourceMappingURL=Conversation-BhvQmXJ-.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{n as r}from"./toaster-BsYkODqs.js";import{Pn as i}from"./lu-BSZWBZXU.js";import{Mr as a}from"./index-8SbDirJv.js";import{t as o}from"./input-group-D7qfFB6C.js";var s=e(t());function c(e){return i({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`},child:[]},{tag:`circle`,attr:{cx:`12`,cy:`12`,r:`3`},child:[]}]})(e)}function l(e){return i({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24`},child:[]},{tag:`line`,attr:{x1:`1`,y1:`1`,x2:`23`,y2:`23`},child:[]}]})(e)}function u(e){return i({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`},child:[]},{tag:`path`,attr:{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`},child:[]}]})(e)}var d=n();function f(e){let[t,n]=(0,s.useState)(!1),i=!!e.secureMode;return(0,d.jsx)(o,{...e,fontFamily:`monospace`,width:`full`,cursor:`pointer`,onClick:()=>{if(e.onClick&&e.onClick(),!navigator.clipboard){r.create({title:`Your browser does not support clipboard access, please copy the ${e.label} manually`,type:`error`,duration:2e3,meta:{closable:!0}});return}(async()=>{await navigator.clipboard.writeText(e.value),r.create({title:`${e.label} copied to your clipboard`,type:`success`,duration:2e3,meta:{closable:!0}})})()},endElement:(0,d.jsxs)(d.Fragment,{children:[i&&(0,d.jsx)(`button`,{type:`button`,style:{background:`none`,border:`none`,cursor:`pointer`,marginLeft:8,padding:0,color:`#888`},"aria-label":t?`Hide ${e.label}`:`Show ${e.label}`,onClick:e=>{e.stopPropagation(),n(e=>!e)},children:t?(0,d.jsx)(l,{size:18}):(0,d.jsx)(c,{size:18})}),(0,d.jsx)(u,{size:18,style:{marginLeft:i?8:0}})]}),children:(0,d.jsx)(a,{cursor:`pointer`,type:i&&!t?`password`:`text`,value:e.value,readOnly:!0,style:{paddingRight:i?`4rem`:`2rem`},_hover:{backgroundColor:`bg.subtle`}})})}export{f as t};
2
+ //# sourceMappingURL=CopyInput-Qeb_2bgP.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,n as r}from"./portal-Sdfvrza9.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{n as a}from"./v-stack-hkuSkmCA.js";import{t as o}from"./tooltip-CM-lMDNU.js";import{K as s}from"./Markdown-Cip8Rj5C.js";import{t as c}from"./icon-button-Wlb_dGXL.js";import{t as l}from"./clipboard-plus-QquBuWbY.js";import{t as u}from"./clipboard-QEY7dbAQ.js";import{t as d}from"./eye-off-C1m7ZwkW.js";var f=e(t()),p=i();function m({prefix:e,value:t,ariaLabel:i,showVisibilityToggle:m=!1,onCopy:h}){let[g,_]=(0,f.useState)(!1);function v(){_(e=>!e)}function y(){return!m||g?t:t.length<=16?`••••••••`:`${t.slice(0,4)}••••••••${t.slice(-4)}`}return(0,p.jsxs)(n,{position:`relative`,borderRadius:`xl`,border:`1px solid`,borderColor:`gray.200`,bg:`bg.panel/70`,backdropFilter:`blur(24px) saturate(1.4)`,boxShadow:`0 4px 30px rgba(0,0,0,0.06)`,overflow:`hidden`,transition:`all 0.2s ease`,_hover:{borderColor:`gray.300`,boxShadow:`0 8px 40px rgba(0,0,0,0.08)`},children:[(0,p.jsxs)(n,{px:5,py:3.5,pr:m?`120px`:`90px`,fontSize:`xs`,lineHeight:`tall`,fontFamily:`mono`,color:`fg`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,"aria-label":i,children:[(0,p.jsx)(a,{as:`span`,color:`fg.muted`,children:e}),y()]}),(0,p.jsxs)(r,{position:`absolute`,top:`50%`,right:2,transform:`translateY(-50%)`,gap:`0.5`,children:[m&&(0,p.jsx)(o,{content:g?`Hide`:`Show`,openDelay:0,showArrow:!0,children:(0,p.jsx)(c,{size:`xs`,variant:`ghost`,onClick:v,"aria-label":g?`Hide key`:`Show key`,backdropFilter:`blur(8px)`,bg:`bg.panel/50`,borderRadius:`lg`,_hover:{bg:`bg.panel/70`},children:g?(0,p.jsx)(d,{size:14}):(0,p.jsx)(s,{size:14})})}),(0,p.jsx)(o,{content:`Copy ${i.toLowerCase()}`,openDelay:0,showArrow:!0,children:(0,p.jsx)(c,{size:`xs`,variant:`ghost`,onClick:()=>void h({withBashPrefix:!1}),"aria-label":`Copy ${i.toLowerCase()}`,backdropFilter:`blur(8px)`,bg:`bg.panel/50`,borderRadius:`lg`,_hover:{bg:`bg.panel/70`},children:(0,p.jsx)(u,{size:14})})}),(0,p.jsx)(o,{content:`Copy with env prefix`,openDelay:0,showArrow:!0,children:(0,p.jsx)(c,{size:`xs`,variant:`ghost`,onClick:()=>void h({withBashPrefix:!0}),"aria-label":`Copy ${i.toLowerCase()} with bash prefix`,backdropFilter:`blur(8px)`,bg:`bg.panel/50`,borderRadius:`lg`,_hover:{bg:`bg.panel/70`},children:(0,p.jsx)(l,{size:14})})})]})]})}export{m as t};
2
+ //# sourceMappingURL=CopyableInputWithPrefix-Bp04WBtM.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./heading-C0sACr0w.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{p as l,t as u}from"./select-BvA110t-.js";import{n as d}from"./toaster-BsYkODqs.js";import{a as f,r as p,t as m}from"./field-BadoNaN5.js";import{n as h}from"./personalProject-C9vU_vdl.js";import{r as g,u as _}from"./errors-mlatPkMI.js";import{t as v}from"./spacer-C38e7o6r.js";import{n as y}from"./api-l6Cnm0vQ.js";import{s as b,t as x}from"./index.esm-Cpy5fWo1.js";import{Mr as S,Qn as C,Vt as w,W as T}from"./index-8SbDirJv.js";import{t as E}from"./tracking-in5OR8uP.js";var D=e(t());function O(e){return!e||e.trim()===``?`Project name is required`:!0}function k(e,t){return e===`NEW`&&(!t||t.trim()===``)?`Team name is required`:!0}var A=a();function j(e){let{onSubmit:t,isLoading:n=!1,error:a,defaultTeamId:o,organizationId:u}=e,{organization:d}=w(),h=u??d?.id,x=b({defaultValues:{name:``,teamId:o??``}}),{register:C,handleSubmit:T,formState:{errors:E},reset:j,watch:N,control:P}=x,F=N(`teamId`),[I,L]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(!a){L(null);return}L(_({error:a,form:x})?null:a)},[a,x]);let R=y.team.getTeamsWithMembers.useQuery({organizationId:h??``},{enabled:!!h});(0,D.useEffect)(()=>{if(R.data&&R.data.length>0&&!F){let e=o&&R.data.some(e=>e.id===o)?o:R.data[0]?.id??``;j(t=>({...t,teamId:e}))}},[R.data,F,j,o]);let z=e=>{t({...e,language:`other`,framework:`other`})},B=R.data?.some(e=>e.projects.length>0)??!1,V=(0,D.useMemo)(()=>R.data?.map(e=>({label:e.name,value:e.id}))??[],[R.data]),H=(0,D.useMemo)(()=>l({items:V}),[V]);return(0,A.jsx)(`form`,{onSubmit:T(z),children:(0,A.jsxs)(c,{align:`stretch`,gap:6,children:[(0,A.jsx)(s,{fontSize:`sm`,color:`fg.muted`,children:`You can set up separate projects for each service or LLM feature of your application (for example, one for your ChatBot, another for that Content Generation feature).`}),(0,A.jsxs)(f,{invalid:!!E.name,children:[(0,A.jsx)(p,{children:`Project Name`}),(0,A.jsx)(S,{...C(`name`,{required:`Project name is required`,validate:O}),placeholder:`AI Project`}),E.name&&(0,A.jsx)(m,{children:E.name.message})]}),B&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(f,{invalid:!!E.teamId,children:[(0,A.jsx)(p,{children:`Team`}),(0,A.jsx)(M,{control:P,teamCollection:H,teamOptions:V})]}),F===`NEW`&&(0,A.jsxs)(f,{invalid:!!E.newTeamName,children:[(0,A.jsx)(p,{children:`New Team Name`}),(0,A.jsx)(S,{...C(`newTeamName`,{validate:e=>k(F,e)}),placeholder:`Engineering Team`}),E.newTeamName&&(0,A.jsx)(m,{children:E.newTeamName.message})]})]}),!!I&&(0,A.jsx)(g,{error:I,fallbackTitle:`Couldn't save this project`}),(0,A.jsxs)(i,{width:`full`,children:[(0,A.jsx)(v,{}),(0,A.jsx)(r,{colorPalette:`orange`,type:`submit`,loading:n,disabled:n,children:`Create`})]})]})})}function M({control:e,teamCollection:t,teamOptions:i}){let[a,o]=(0,D.useState)(!1);return(0,A.jsx)(x,{control:e,name:`teamId`,rules:{required:`Team is required`},render:({field:e})=>(0,A.jsxs)(u.Root,{collection:t,value:[e.value],open:a,onOpenChange:e=>o(e.open),onValueChange:t=>{let n=t.value[0];n&&e.onChange(n)},children:[(0,A.jsx)(u.Trigger,{children:(0,A.jsx)(u.ValueText,{placeholder:`Select team`,children:()=>e.value===`NEW`?(0,A.jsx)(s,{color:`fg.muted`,children:`New team`}):i.find(t=>t.value===e.value)?.label??`Select team`})}),(0,A.jsxs)(u.Content,{paddingY:2,children:[i.map(e=>(0,A.jsx)(u.Item,{item:e,children:e.label},e.value)),(0,A.jsx)(n,{borderTop:`1px solid`,borderColor:`border`,marginTop:2,marginX:-1,marginBottom:-2,background:`bg.muted`,children:(0,A.jsxs)(r,{width:`full`,fontWeight:`500`,color:`fg.muted`,paddingY:4,paddingX:3,justifyContent:`flex-start`,variant:`ghost`,colorPalette:`gray`,size:`sm`,borderRadius:`none`,onClick:()=>{e.onChange(`NEW`),o(!1)},children:[(0,A.jsx)(C,{size:16}),(0,A.jsx)(s,{fontSize:14,children:`Create new team`})]})})]})]})})}function N(e){e.organization.getAll.invalidate(),e.limits.getUsage.invalidate(),e.team.getTeamsWithMembers.invalidate(),e.team.getTeamWithMembers.invalidate(),e.team.getTeamsWithRoleBindings.invalidate()}function P({open:e=!0,onClose:t,navigateOnCreate:n=!1,defaultTeamId:r,organizationId:i,onCreated:a}){let{organization:s}=w(),c=i??s?.id,{closeDrawer:l}=T(),u=y.useContext(),f=y.project.create.useMutation(),p=()=>{t?t():l()};return(0,A.jsx)(h.Root,{open:e,placement:`end`,size:`lg`,onOpenChange:({open:e})=>{e||p()},children:(0,A.jsxs)(h.Content,{bg:`bg`,children:[(0,A.jsxs)(h.Header,{children:[(0,A.jsx)(h.CloseTrigger,{onClick:p}),(0,A.jsx)(o,{children:`Create New Project`})]}),(0,A.jsx)(h.Body,{children:(0,A.jsx)(j,{onSubmit:e=>{if(!c)return;let t=e.teamId===`NEW`?void 0:e.teamId||r;f.mutate({organizationId:c,name:e.name,teamId:t,newTeamName:e.newTeamName,language:e.language,framework:e.framework},{onSuccess:t=>{if(N(u),E(`project_created`,{project_slug:t.projectSlug,language:e.language,framework:e.framework}),d.create({title:`Project Created`,description:`Successfully created ${t.projectSlug}`,type:`success`,meta:{closable:!0}}),a?.({projectSlug:t.projectSlug}),n){window.location.href=`/${t.projectSlug}`;return}p()}})},isLoading:f.isLoading,error:f.error,defaultTeamId:r,organizationId:c})})]})})}export{P as CreateProjectDrawer};
2
+ //# sourceMappingURL=CreateProjectDrawer-Dg_yrbka.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{n as r}from"./toaster-BsYkODqs.js";import{n as i}from"./personalProject-C9vU_vdl.js";import{n as a}from"./api-l6Cnm0vQ.js";import{s as o}from"./index.esm-Cpy5fWo1.js";import{Ut as s,Vt as c,W as l,zn as u}from"./index-8SbDirJv.js";import{r as d}from"./TeamUserRoleField-D0ZTlKiH.js";import{t as f}from"./TeamForm-CL9ycvq0.js";var p=u(),m=e(t()),h=n();function g({open:e=!0}){let{organization:t}=c(),{data:n}=s(),{closeDrawer:u}=l(),g=a.useContext(),_=o({defaultValues:{name:``,members:[{userId:{label:`${n?.user.name} (${n?.user.email})`,value:n?.user.id??``},role:d[p.TeamUserRole.ADMIN],saved:!1}]}}),v=a.team.createTeamWithMembers.useMutation(),y=(0,m.useCallback)(e=>{t&&v.mutate({name:e.name,organizationId:t.id,members:e.members.map(e=>({userId:e.userId?.value??``,role:e.role.value,customRoleId:e.role.customRoleId}))},{onSuccess:()=>{g.team.getTeamsWithRoleBindings.invalidate(),g.team.getTeamsWithMembers.invalidate(),r.create({title:`Team created successfully`,type:`success`,duration:5e3,meta:{closable:!0}}),u()},onError:()=>{r.create({title:`Failed to create team`,type:`error`,duration:5e3,meta:{closable:!0}})}})},[v,t,g,u]);return(0,h.jsx)(i.Root,{open:e,placement:`end`,size:`lg`,onOpenChange:({open:e})=>{e||u()},children:(0,h.jsxs)(i.Content,{bg:`bg`,children:[(0,h.jsx)(i.Header,{children:(0,h.jsx)(i.CloseTrigger,{onClick:u})}),(0,h.jsx)(i.Body,{children:t&&(0,h.jsx)(f,{organizationId:t.id,form:_,onSubmit:y,isLoading:v.isLoading})})]})})}export{g as CreateTeamDrawer};
2
+ //# sourceMappingURL=CreateTeamDrawer-CLJnKmFE.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./skeleton-0JSrjbwm.js";import{t as c}from"./heading-C0sACr0w.js";import{n as l,t as u}from"./v-stack-hkuSkmCA.js";import{Sn as d,a as f,c as p,l as m,yn as h}from"./ProjectAvatar-B0tbfKzY.js";import{t as g}from"./badge-Cpc3eA-C.js";import{t as _}from"./tooltip-CM-lMDNU.js";import{T as v}from"./fetchSSE-CnJPAkno.js";import{i as ee,r as y}from"./errors-mlatPkMI.js";import{n as b}from"./api-l6Cnm0vQ.js";import{t as x}from"./usePublicEnv-ue4-Igop.js";import{r as S}from"./next-router-CWLrMXvP.js";import{dn as C}from"./lu-BSZWBZXU.js";import{An as w,Dn as T,En as E,Ft as te,Mn as D,Mt as O,Pt as k,Tn as A,Vt as ne,kn as j,mn as re,pn as M,ut as N,xn as P,yn as F}from"./index-8SbDirJv.js";import{t as I}from"./help-circle-DKxNhAgT.js";import{t as ie}from"./refresh-cw-C7FbMWoi.js";import{t as ae}from"./clsx-CjueKrWZ.js";import{a as oe}from"./stringCasing-Cx6SsTTf.js";import{$n as L,$t as se,A as R,At as ce,B as le,Bn as ue,Bt as de,Ct as z,Dt as B,En as fe,G as V,Gn as pe,Ht as me,I as H,Jn as U,Jt as he,K as ge,L as _e,Lt as ve,M as ye,Mn as be,Mt as xe,N as Se,Nn as W,Q as G,Tn as Ce,U as we,Un as Te,Vn as Ee,Vt as De,W as Oe,X as ke,Xt as Ae,Yn as je,Yt as Me,Z as Ne,_t as Pe,a as Fe,at as Ie,bt as Le,c as Re,cr as ze,ct as Be,d as Ve,en as He,er as Ue,gt as We,ht as Ge,i as Ke,ir as qe,it as Je,jt as Ye,kt as Xe,l as Ze,lr as Qe,lt as $e,mt as et,n as tt,nt,o as rt,pn as it,pt as at,r as ot,rt as st,s as ct,sn as lt,st as ut,tn as dt,u as ft,vt as pt,wn as mt,wt as ht,xn as gt,xt as _t,y as vt,yn as yt,yt as bt,zn as K}from"./CartesianChart-Ci1mTvgb.js";import{t as xt}from"./Legend-C-o-ebW-.js";import{a as St,i as Ct,n as wt,o as Tt,r as Et,t as Dt}from"./BarChart-B23ShI5J.js";import{t as Ot}from"./Line-CbuF_DU9.js";import{n as kt,t as At}from"./AreaChart-PNFZHqkl.js";import{n as jt,t as Mt}from"./ScatterChart-jarSkvrF.js";import{t as Nt}from"./LineChart-CjG7MhLF.js";import{t as Pt}from"./types-OZJZgbcd.js";import{t as Ft}from"./formatMilliseconds-P4cwJ3go.js";import{t as It}from"./buildMetadataFilterParams-DVzA-0qt.js";import{t as Lt}from"./formatMoney-ClmqgvaY.js";import{t as Rt}from"./Delayed-CNoxRUCn.js";import{t as zt}from"./ChartTooltip-BMGa2HEK.js";var Bt=e=>e.graphicalItems.polarItems,Vt=K([Bt,B,K([De,de],z)],bt),Ht=K([K([Vt],pt),Me],We),Ut=K([Ht,B,Vt],at);K([Ht,B,Vt],(e,t,n)=>n.length>0?e.flatMap(e=>n.flatMap(n=>({value:W(e,t.dataKey??n.dataKey),errorDomain:[]}))).filter(Boolean):t?.dataKey==null?e.map(e=>({value:e,errorDomain:[]})):e.map(e=>({value:W(e,t.dataKey),errorDomain:[]})));var Wt=()=>void 0,Gt=K([B,it,Ht,Ut,he,De,K([B,Xe,ce,Wt,K([Ht,B,Vt,ht,De,Ae],Pe),Wt,it,De],_t)],et);K([Ye,K([B,Gt,K([Gt,xe,Ye],Le),De],Ge)],ve);function Kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kt(Object(n),!0).forEach(function(t){Jt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jt(e,t,n){return(t=Yt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yt(e){var t=Xt(e,`string`);return typeof t==`symbol`?t:t+``}function Xt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Zt=K([Bt,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`pie`).find(e=>e.id===t)),Qt=[],$t=(e,t,n)=>n?.length===0?Qt:n,en=K([Me,Zt,$t],(e,t,n)=>{var r=e.chartData;if(t!=null){var i=t?.data!=null&&t.data.length>0?t.data:r;if((!i||!i.length)&&n!=null&&(i=n.map(e=>qt(qt({},t.presentationProps),e.props))),i!=null)return i}}),tn=K([en,Zt,$t],(e,t,n)=>{if(!(e==null||t==null))return e.map((e,r)=>{var i,a=W(e,t.nameKey,t.name),o=n!=null&&(i=n[r])!=null&&(i=i.props)!=null&&i.fill?n[r].props.fill:typeof e==`object`&&e&&`fill`in e?e.fill:t.fill;return{value:be(a,t.dataKey),dataKey:t.dataKey,color:o,payload:e,type:t.legendType}})}),nn=K([en,Zt,$t,mt],(e,t,n,r)=>{if(!(t==null||e==null))return Dn({offset:r,pieSettings:t,displayedData:e,cells:n})}),q=e(t()),rn=[`key`],an=[`onMouseEnter`,`onClick`,`onMouseLeave`],on=[`id`],sn=[`id`];function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}function cn(e,t){if(e==null)return{};var n,r,i=ln(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ln(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?un(Object(n),!0).forEach(function(t){dn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dn(e,t,n){return(t=fn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fn(e){var t=pn(e,`string`);return typeof t==`symbol`?t:t+``}function pn(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var mn=se;function hn(e){var t=(0,q.useMemo)(()=>ge(e.children,Tt),[e.children]),n=Ee(n=>tn(n,e.id,t));return n==null?null:q.createElement(we,{legendPayload:n})}function gn(e){if(!(e==null||typeof e==`boolean`||typeof e==`function`)){if(q.isValidElement(e)){var t=e.props?.fill;return typeof t==`string`?t:void 0}var n=e.fill;return typeof n==`string`?n:void 0}}var _n=q.memo(e=>{var t=e.dataKey,n=e.nameKey,r=e.sectors,i=e.stroke,a=e.strokeWidth,o=e.fill,s=e.name,c=e.hide,l=e.tooltipType,u=e.formatter,d=e.id,f=e.activeShape,p=gn(f),m={dataDefinedOnItem:r.map(e=>{var t=e.tooltipPayload;return p==null||t==null?t:t.map(e=>Y(Y({},e),{},{color:p,fill:p}))}),getPosition:e=>r[Number(e)]?.tooltipPosition,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:be(s,t),hide:c,type:l,color:o,unit:``,formatter:u,graphicalItemId:d}};return q.createElement(Oe,{tooltipEntrySettings:m})}),vn=(e,t)=>e>t?`start`:e<t?`end`:`middle`,yn=(e,t,n)=>U(typeof t==`function`?t(e):t,n,n*.8),bn=(e,t,n)=>{var r=t.top,i=t.left,a=t.width,o=t.height,s=He(a,o);return{cx:i+U(e.cx,a,a/2),cy:r+U(e.cy,o,o/2),innerRadius:U(e.innerRadius,s,0),outerRadius:yn(n,e.outerRadius,s),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}},xn=(e,t)=>Ue(t-e)*Math.min(Math.abs(t-e),360),Sn=(e,t)=>{if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e==`function`)return e(t);var n=ae(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);t.key;var r=cn(t,rn);return q.createElement(lt,J({},r,{type:`linear`,className:n}))},Cn=(e,t,n)=>{if(q.isValidElement(e))return q.cloneElement(e,t);var r=n;if(typeof e==`function`&&(r=e(t),q.isValidElement(r)))return r;var i=ae(`recharts-pie-label-text`,R(e));return q.createElement(nt,J({},t,{alignmentBaseline:`middle`,className:i}),r)};function wn(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label,a=n.labelLine,o=n.dataKey;if(!r||!i||!t)return null;var s=ze(n),c=Qe(i),l=Qe(a),u=typeof i==`object`&&`offsetRadius`in i&&typeof i.offsetRadius==`number`&&i.offsetRadius||20,d=t.map((e,t)=>{var n=(e.startAngle+e.endAngle)/2,r=dt(e.cx,e.cy,e.outerRadius+u,n),d=Y(Y(Y(Y({},s),e),{},{stroke:`none`},c),{},{index:t,textAnchor:vn(r.x,e.cx)},r),f=Y(Y(Y(Y({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:t,points:[dt(e.cx,e.cy,e.outerRadius,n),r],key:`line`});return q.createElement(Ie,{zIndex:me.label,key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`},q.createElement(G,null,a&&Sn(a,f),Cn(i,d,W(e,o))))});return q.createElement(G,{className:`recharts-pie-labels`},d)}function Tn(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label;return typeof i==`object`&&i&&`position`in i?q.createElement(ke,{label:i}):q.createElement(wn,{sectors:t,props:n,showLabels:r})}function En(e){var t=e.sectors,n=e.activeShape,r=e.inactiveShape,i=e.allOtherPieProps,a=e.shape,o=e.id,s=e.animationElapsedTime,c=e.isAnimating,l=e.isEntrance,u=Ee($e),d=Ee(ut),f=Ee(Be),p=i.onMouseEnter,m=i.onClick,h=i.onMouseLeave,g=cn(i,an),_=Ct(p,i.dataKey,o),v=St(h),ee=Et(m,i.dataKey,o);return t==null||t.length===0?null:q.createElement(q.Fragment,null,t.map((e,p)=>{if(e?.startAngle===0&&e?.endAngle===0&&t.length!==1)return null;var m=f==null||f===o,h=String(p)===u&&(d==null||i.dataKey===d)&&m,y=n&&h?n:u?r:null,b=Y(Y({},e),{},{stroke:e.stroke,tabIndex:-1,index:p,isActive:h,animationElapsedTime:s,isAnimating:c,isEntrance:l,[fe]:p,[Ce]:o});return q.createElement(G,J({key:`sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${p}`,tabIndex:-1,className:`recharts-pie-sector`},pe(g,e,p),{onMouseEnter:_(e,p),onMouseLeave:v(e,p),onClick:ee(e,p)}),q.createElement(V,{option:y??a,DefaultShape:mn,shapeProps:b}))}))}function Dn(e){var t=e.pieSettings,n=e.displayedData,r=e.cells,i=e.offset,a=t.cornerRadius,o=t.startAngle,s=t.endAngle,c=t.dataKey,l=t.nameKey,u=t.tooltipType,d=Math.abs(t.minAngle),f=xn(o,s),p=Math.abs(f),m=n.length<=1?0:t.paddingAngle??0,h=n.filter(e=>W(e,c,0)!==0).length,g=(p>=360?h:h-1)*m,_=n.reduce((e,t)=>{var n=W(t,c,0);return e+(L(n)?n:0)},0),v=d>0&&_>0&&n.some(e=>{var t=W(e,c,0),n=(L(t)?t:0)/_;return t!==0&&n*p<d})?d:0,ee=p-h*v-g,y;if(_>0){var b;y=n.map((e,n)=>{var s=W(e,c,0),d=W(e,l,n),p=bn(t,i,e),h=(L(s)?s:0)/_,g,y=Y(Y({},e),r&&r[n]&&r[n].props),x=y!=null&&`fill`in y&&typeof y.fill==`string`?y.fill:t.fill;g=n?b.endAngle+Ue(f)*m*(s===0?0:1):o;var S=g+Ue(f)*((s===0?0:v)+h*ee),C=(g+S)/2,w=(p.innerRadius+p.outerRadius)/2,T=[{name:d,value:s,payload:y,dataKey:c,type:u,color:x,fill:x,graphicalItemId:t.id}],E=dt(p.cx,p.cy,w,C);return b=Y(Y(Y(Y({},t.presentationProps),{},{percent:h,cornerRadius:typeof a==`string`?parseFloat(a):a,name:d,tooltipPayload:T,midAngle:C,middleRadius:w,tooltipPosition:E},y),p),{},{value:s,dataKey:c,startAngle:g,endAngle:S,payload:y,paddingAngle:s===0?0:Ue(f)*m}),b})}return y}function On(e){var t=e.showLabels,n=e.sectors,r=e.children,i=(0,q.useMemo)(()=>!t||!n?[]:n.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})),[n,t]);return q.createElement(Ne,{value:t?i:void 0},r)}var kn=(e,t)=>{if(e==null)return[];var n=[],r=e.find(e=>e.status!==`removed`),i=r?r.next.startAngle:0;return e.forEach((e,r)=>{if(e.status!==`removed`){var a=r>0?qe(e.next,`paddingAngle`,0):0;if(e.status===`matched`){var o=je(e.prev.endAngle-e.prev.startAngle,e.next.endAngle-e.next.startAngle,t),s=Y(Y({},e.next),{},{startAngle:i+a,endAngle:i+o+a});n.push(s),i=s.endAngle}else{var c=je(0,e.next.endAngle-e.next.startAngle,t),l=Y(Y({},e.next),{},{startAngle:i+a,endAngle:i+c+a});n.push(l),i=l.endAngle}}}),n};function An(e){var t=e.props,n=e.previousSectorsRef,r=e.id,i=t.sectors,a=t.activeShape,o=t.inactiveShape,s=t.animationInterpolateFn,c=_e(t.onAnimationStart,t.onAnimationEnd),l=c.isAnimating,u=c.handleAnimationStart,d=c.handleAnimationEnd,f=yt();return f==null?null:q.createElement(On,{showLabels:!l,sectors:i},q.createElement(H,{animationInput:t,animationIdPrefix:`recharts-pie-`,items:i,previousItemsRef:n,isAnimationActive:t.isAnimationActive,animationBegin:t.animationBegin,animationDuration:t.animationDuration,animationEasing:t.animationEasing,onAnimationStart:u,onAnimationEnd:d,animationInterpolateFn:s,animationMatchBy:t.animationMatchBy,layout:f},(e,n,i)=>q.createElement(G,null,q.createElement(En,{sectors:e,activeShape:a,inactiveShape:o,allOtherPieProps:t,shape:t.shape,id:r,animationElapsedTime:n,isAnimating:l||n<1,isEntrance:i}))),q.createElement(Tn,{showLabels:!l,sectors:i,props:t}),t.children)}var jn={animationBegin:400,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:kn,animationMatchBy:le,cx:`50%`,cy:`50%`,dataKey:`value`,endAngle:360,fill:`#808080`,hide:!1,innerRadius:0,isAnimationActive:`auto`,label:!1,labelLine:!0,legendType:`rect`,minAngle:0,nameKey:`name`,outerRadius:`80%`,paddingAngle:0,rootTabIndex:0,shape:mn,startAngle:0,stroke:`#fff`,zIndex:me.area};function Mn(e){var t=e.id,n=cn(e,on),r=e.hide,i=e.className,a=e.rootTabIndex,o=(0,q.useMemo)(()=>ge(e.children,Tt),[e.children]),s=Ee(e=>nn(e,t,o)),c=(0,q.useRef)(null),l=ae(`recharts-pie`,i);return r||s==null?(c.current=null,q.createElement(G,{tabIndex:a,className:l})):q.createElement(Ie,{zIndex:e.zIndex},q.createElement(_n,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,formatter:e.formatter,id:t,activeShape:e.activeShape}),q.createElement(G,{tabIndex:a,className:l},q.createElement(An,{props:Y(Y({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function Nn(e){var t=Te(e,jn),n=t.id,r=cn(t,sn),i=ze(r);return q.createElement(Se,{id:n,type:`pie`},e=>q.createElement(q.Fragment,null,q.createElement(ye,{type:`pie`,id:e,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),q.createElement(hn,J({},r,{id:e})),q.createElement(Mn,J({},r,{id:e}))))}var Pn=Nn;Pn.displayName=`Pie`;function Fn(e){var t=ue();return(0,q.useEffect)(()=>{t(Ze(e))},[t,e]),null}var In=[`layout`];function Ln(){return Ln=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ln.apply(null,arguments)}function Rn(e,t){if(e==null)return{};var n,r,i=zn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Bn(Object(n),!0).forEach(function(t){Hn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Hn(e,t,n){return(t=Un(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Un(e){var t=Wn(e,`string`);return typeof t==`symbol`?t:t+``}function Wn(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Gn=Vn({accessibilityLayer:!0,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`,layout:`radial`,responsive:!1,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`},Re),Kn=(0,q.forwardRef)(function(e,t){var n=Te(e.categoricalChartProps,Gn),r=n.layout,i=Rn(n,In),a=e.chartName,o={chartName:a,defaultTooltipEventType:e.defaultTooltipEventType,validateTooltipEventTypes:e.validateTooltipEventTypes,tooltipPayloadSearcher:e.tooltipPayloadSearcher,eventEmitter:void 0};return q.createElement(ct,{preloadedState:{options:o},reduxStoreName:n.id??a},q.createElement(rt,{chartData:n.data}),q.createElement(Fe,{layout:r,margin:n.margin}),q.createElement(ot,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),q.createElement(Ke,{baseValue:void 0,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),q.createElement(Fn,{cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius}),q.createElement(tt,Ln({},i,{ref:t})))});function qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qn(Object(n),!0).forEach(function(t){Yn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yn(e,t,n){return(t=Xn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xn(e){var t=Zn(e,`string`);return typeof t==`symbol`?t:t+``}function Zn(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Qn=[`item`],$n=Jn(Jn({},Gn),{},{layout:`centric`,startAngle:0,endAngle:360}),er=(0,q.forwardRef)((e,t)=>{var n=Te(e,$n);return q.createElement(Kn,{chartName:`PieChart`,defaultTooltipEventType:`item`,validateTooltipEventTypes:Qn,tooltipPayloadSearcher:Je,categoricalChartProps:n,ref:t})}),X=e(d()),tr=()=>(e,t,n=0)=>{let r=h[e];if(!r||r.length===0)return O(`gray.400`);let i=r[t%r.length]?.color??`gray.400`,[a,o]=i.split(`.`),s=parseInt(o??`0`);return O(isNaN(s)?i:`${a}.${Math.max(Math.min(s+n,900),50)}`)},nr=F([`terms`,`cardinality`,`avg`,`sum`,`min`,`max`,`median`,`p99`,`p95`,`p90`]),rr=nr.options,ir=[`avg`,`sum`,`min`,`max`],ar=[`median`,`p99`,`p95`,`p90`],or=F([`trace_id`,`user_id`,`thread_id`,`customer_id`]),sr=F([`sum`,`avg`,`min`,`max`]),cr=E({projectId:w(),startDate:A().positive(),endDate:A().positive(),query:w().optional(),filters:j(Pt,D([M(w()),j(w(),M(w())),j(w(),j(w(),M(w())))])).default({}),traceIds:M(w()).optional(),negateFilters:re().optional()}),Z={format:`0.[0]a`,allowedAggregations:[...ir,...ar]},lr={metadata:{trace_id:{label:`Traces`,colorSet:`orangeTones`,format:`0.[0]`,increaseIs:`good`,allowedAggregations:[`cardinality`]},user_id:{label:`Users`,colorSet:`blueTones`,format:`0.[0]`,increaseIs:`good`,allowedAggregations:[`cardinality`]},thread_id:{label:`Threads`,colorSet:`greenTones`,format:`0.[0]`,increaseIs:`good`,allowedAggregations:[`cardinality`]},span_type:{label:`Span Type`,colorSet:`purpleTones`,allowedAggregations:[`cardinality`],format:`0.[00]a`,increaseIs:`neutral`,requiresKey:{filter:`spans.type`,optional:!0}}},sentiment:{thumbs_up_down:{label:`Thumbs Up/Down Score`,colorSet:`purpleTones`,format:`0.00a`,increaseIs:`good`,allowedAggregations:rr}},performance:{completion_time:{...Z,label:`Completion Time`,colorSet:`greenTones`,format:Ft,increaseIs:`bad`},first_token:{...Z,label:`Time to First Token`,colorSet:`cyanTones`,format:Ft,increaseIs:`bad`},total_cost:{...Z,label:`Total Cost`,colorSet:`greenTones`,format:e=>Lt({amount:e,currency:`USD`}),increaseIs:`neutral`},cost_billed:{...Z,label:`Billed Cost`,colorSet:`greenTones`,format:e=>Lt({amount:e,currency:`USD`}),increaseIs:`neutral`},cost_non_billed:{...Z,label:`Non-billed (theoretical) Cost`,colorSet:`grayTones`,format:e=>Lt({amount:e,currency:`USD`}),increaseIs:`neutral`},prompt_tokens:{...Z,label:`Prompt Tokens`,colorSet:`blueTones`,increaseIs:`neutral`},completion_tokens:{...Z,label:`Completion Tokens`,colorSet:`orangeTones`,increaseIs:`neutral`},cache_read_tokens:{...Z,label:`Cache Read Tokens`,colorSet:`tealTones`,increaseIs:`neutral`},cache_write_tokens:{...Z,label:`Cache Write Tokens`,colorSet:`yellowTones`,increaseIs:`neutral`},reasoning_tokens:{...Z,label:`Reasoning Tokens`,colorSet:`pinkTones`,increaseIs:`neutral`},total_processed_tokens:{...Z,label:`Total Processed Tokens`,colorSet:`purpleTones`,increaseIs:`neutral`},total_tokens:{...Z,label:`Total Tokens`,colorSet:`purpleTones`,increaseIs:`neutral`},tokens_per_second:{...Z,label:`Tokens per Second`,colorSet:`cyanTones`,increaseIs:`good`}},events:{event_type:{label:`Event Type`,colorSet:`purpleTones`,allowedAggregations:[`cardinality`],format:`0.[00]a`,increaseIs:`neutral`,requiresKey:{filter:`events.event_type`,optional:!0}},event_score:{label:`Event Score`,colorSet:`purpleTones`,format:`0.00a`,increaseIs:`neutral`,allowedAggregations:rr.filter(e=>e!=`cardinality`),requiresKey:{filter:`events.event_type`},requiresSubkey:{filter:`events.metrics.key`}},event_details:{label:`Event Details`,colorSet:`purpleTones`,format:`0.[00]a`,increaseIs:`neutral`,allowedAggregations:[`cardinality`],requiresKey:{filter:`events.event_type`},requiresSubkey:{filter:`events.event_details.key`}}},evaluations:{evaluation_score:{label:`Evaluation Score`,colorSet:`tealTones`,format:`0.00a`,increaseIs:`neutral`,allowedAggregations:rr.filter(e=>e!=`cardinality`&&e!=`terms`),requiresKey:{filter:`evaluations.evaluator_id`}},evaluation_pass_rate:{label:`Evaluation Pass Rate`,colorSet:`tealTones`,format:`0%`,increaseIs:`good`,allowedAggregations:rr.filter(e=>e!=`cardinality`&&e!=`terms`),requiresKey:{filter:`evaluations.evaluator_id`}},evaluation_runs:{label:`Evaluation Runs`,colorSet:`tealTones`,format:`0.[00]a`,increaseIs:`neutral`,allowedAggregations:[`cardinality`],requiresKey:{filter:`evaluations.evaluator_id`,optional:!0}}},threads:{average_duration_per_thread:{label:`Thread Duration`,colorSet:`purpleTones`,format:Ft,increaseIs:`neutral`,allowedAggregations:[`avg`]}}},ur=Object.keys(lr).flatMap(e=>Object.keys(lr[e]).map(t=>[e,t].join(`.`))),dr={trace_id:{label:`per message`,field:`trace_id`},user_id:{label:`per user`,field:`metadata.user_id`},thread_id:{label:`per thread`,field:`metadata.thread_id`},customer_id:{label:`per customer`,field:`metadata.customer_id`}},fr={avg:`average`,sum:`sum`,min:`minimum`,max:`maximum`},pr={terms:`count`,cardinality:`count`,avg:`average`,sum:`sum`,min:`minimum`,max:`maximum`,median:`median`,p99:`99th percentile`,p95:`95th percentile`,p90:`90th percentile`},mr={topics:{topics:{label:`Topic`}},traces:{trace_name:{label:`Trace Name`}},metadata:{user_id:{label:`User`},thread_id:{label:`Thread`},customer_id:{label:`Customer ID`},labels:{label:`Label`},model:{label:`Model`},span_type:{label:`Span Type`}},sentiment:{thumbs_up_down:{label:`Thumbs Up/Down`}},events:{event_type:{label:`Event Type`}},evaluations:{evaluation_passed:{label:`Evaluation Passed`,requiresKey:{filter:`evaluations.evaluator_id`,optional:!0}},evaluation_label:{label:`Evaluation Label`,requiresKey:{filter:`evaluations.evaluator_id`,optional:!0}},evaluation_processing_state:{label:`Evaluation Processing State`,requiresKey:{filter:`evaluations.evaluator_id`,optional:!0}}},error:{has_error:{label:`Contains Error`}}},hr=Object.keys(mr).flatMap(e=>Object.keys(mr[e]).map(t=>[e,t].join(`.`))),gr=e=>{let[t,n]=e.split(`.`);return lr[t][n]},_r=e=>{let[t,n]=e.split(`.`);return mr[t][n]},vr=E({metric:F(ur),key:T(w()),subkey:T(w()),aggregation:nr,pipeline:T(E({field:or,aggregation:sr})),filters:T(j(Pt,D([M(w()),j(w(),M(w())),j(w(),j(w(),M(w())))]))),asPercent:T(re())}),yr=E({query:T(w()),series:M(vr),groupBy:T(F(hr)),groupByKey:T(w()),timeScale:T(D([P(`full`),A().int()])),timeZone:w()});cr.extend(yr.shape);var Q=o();function br({error:e,onRetry:t}){return(0,Q.jsx)(r,{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1,children:(0,Q.jsxs)(u,{gap:3,align:`stretch`,maxWidth:`sm`,width:`fit-content`,children:[(0,Q.jsx)(y,{error:e,fallbackTitle:`Failed to load chart data`}),(0,Q.jsx)(a,{gap:2,children:(0,Q.jsxs)(i,{size:`xs`,variant:`outline`,onClick:t,children:[(0,Q.jsx)(ie,{size:12}),`Retry`]})})]})})}var xr=({date:e,timeScale:t,daysDifference:n})=>{if(!e)return``;let r=new Date(e);return isNaN(r.getTime())?``:typeof t==`number`&&t<1440?n>1?N(r,`MMM d HH:mm`):N(r,`HH:mm`):N(r,`MMM d`)};function Sr({label:e,current:t,previous:n,format:r,tooltip:i,increaseIs:a,noDataUrl:o,titleProps:s}){return(0,Q.jsxs)(u,{minWidth:`92px`,flex:1,gap:2,align:`start`,justifyContent:`space-between`,borderLeftWidth:`1px`,borderLeftColor:`border`,paddingX:4,_first:{paddingLeft:0,borderLeft:`none`},children:[(0,Q.jsxs)(c,{textStyle:`xs`,color:`fg.muted`,fontWeight:`normal`,lineClamp:2,wordBreak:`break-word`,title:e,...s??{},children:[e,i&&(0,Q.jsx)(_,{content:i,children:(0,Q.jsx)(I,{style:{display:`inline-block`,verticalAlign:`middle`,marginTop:`-3px`,marginLeft:`4px`},width:`14px`})})]}),(0,Q.jsx)(Cr,{current:t,previous:n,format:r,increaseIs:a,noDataUrl:o})]})}function Cr({current:e,previous:t,format:n,increaseIs:i=`good`,noDataUrl:a}){if(e!==void 0&&(e===0||e===`0`)&&(t===void 0||t===0))return(0,Q.jsxs)(u,{align:`start`,gap:1,children:[(0,Q.jsx)(r,{textStyle:`2xl`,fontWeight:`600`,color:`fg.muted`,children:`-`}),(0,Q.jsxs)(l,{textStyle:`xs`,color:`fg.subtle`,children:[`No data yet`,a&&(0,Q.jsxs)(Q.Fragment,{children:[` · `,(0,Q.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,style:{textDecoration:`underline`},children:`Set up`})]})]})]});let o=typeof e==`number`&&typeof t==`number`&&t>0?Math.round((e-t)/t*100)/100:void 0,c=i==`neutral`?0:i===`bad`?-1:1,d=e=>{let t=Math.abs(e);return t>9.99?`999%+`:(0,X.default)(t).format(`0%`)},f=e=>typeof n==`function`?n(e):(0,X.default)(e).format(n??`0a`),p=o===void 0||o===0?`gray.500`:c===0?`fg.muted`:o*c>0?`green.500`:`red.500`;return(0,Q.jsxs)(u,{align:`start`,gap:1,children:[(0,Q.jsx)(r,{textStyle:`2xl`,fontWeight:`600`,children:e===void 0?(0,Q.jsx)(Rt,{takeSpace:!0,children:(0,Q.jsx)(s,{height:`1.5em`,width:`78px`})}):typeof n==`function`?n(e):(0,X.default)(e).format(n??`0a`)}),o!==void 0&&(0,Q.jsxs)(u,{align:`start`,gap:0,textStyle:`xs`,children:[o!==0&&(0,Q.jsxs)(l,{fontWeight:500,color:p,children:[o>0?`+`:`-`,d(o)]}),typeof t==`number`&&(0,Q.jsxs)(l,{color:`fg.muted`,children:[f(t),` previous`]})]})]})}var wr=[`summary`,`pie`,`donnut`],Tr=`101px`,Er={line:[Nt,Ot],bar:[Dt,wt],stacked_bar:[Dt,wt],horizontal_bar:[Dt,wt],area:[At,kt],stacked_area:[At,kt],scatter:[Mt,jt],monitor_graph:[At,kt]};function Dr({input:e,titleProps:t,hideGroupLabel:n=!1,filters:r,onDataPointClick:i,emptyState:a}){return(0,Q.jsx)(Or,{input:e,titleProps:t,hideGroupLabel:n,load:!!x().data,filters:r,onDataPointClick:i,emptyState:a})}var Or=q.memo(function({input:e,titleProps:t,hideGroupLabel:i=!1,load:o=!0,size:c,filters:d,onDataPointClick:h,emptyState:_}){let y=e.height??300,{filterParams:x,queryOpts:C}=f(),{daysDifference:w}=p(),T=S(),{project:E}=ne(),D=`analytics:hidden:${E?.id??``}:${e.graphId}`,[O,A]=(0,q.useState)(()=>{if(typeof window>`u`)return new Set;try{let e=localStorage.getItem(D);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}});(0,q.useEffect)(()=>{try{let e=localStorage.getItem(D);A(e?new Set(JSON.parse(e)):new Set)}catch{A(new Set)}},[D]);let j=(0,q.useId)(),re=(0,q.useCallback)(e=>{A(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(D,JSON.stringify([...n]))}catch{}return n})},[D]),M=(0,q.useCallback)(t=>{if(!E||!t.groupKey||!e.groupBy)return;let n={};if(e.groupBy===`metadata.model`)n.model=t.groupKey;else if(e.groupBy.startsWith(`metadata.`)){let r=It(e.groupBy.replace(`metadata.`,``),t.groupKey,t.groupKey);n={...n,...r}}else{let r=m[e.groupBy];r?n[r.urlKey]=t.groupKey:n[e.groupBy]=t.groupKey}t.startDate!=null&&(n.startDate=typeof t.startDate==`number`?new Date(t.startDate).toISOString():String(t.startDate)),t.endDate!=null&&(n.endDate=typeof t.endDate==`number`?new Date(t.endDate).toISOString():String(t.endDate)),T.push({pathname:`/${E.slug}/messages`,query:n},void 0,{shallow:!1})},[E,T,e.groupBy]),N=(0,q.useMemo)(()=>{if(h)return h;if([`pie`,`donnut`].includes(e.graphType)||[`bar`,`horizontal_bar`].includes(e.graphType)&&e.timeScale===`full`)return M},[h,e.graphType,e.timeScale,M]),P=(0,q.useMemo)(()=>{let t=e.graphType===`summary`?`full`:e.timeScale===`full`?e.timeScale:parseInt(e.timeScale.toString(),10);return typeof t==`number`&&t>=1440&&w<=2?60:t},[e.graphType,e.timeScale,w]),F=(0,q.useMemo)(()=>{if((e.graphType===`pie`||e.graphType===`donnut`)&&e.groupBy&&!e.series.some(e=>e.pipeline)){let t=e=>({metric:e.metric,aggregation:e.aggregation,key:e.key,subkey:e.subkey,filters:e.filters,asPercent:e.asPercent,name:e.name,colorSet:e.colorSet,pipeline:{field:`trace_id`,aggregation:`sum`}});return{...e,series:e.series.map(t)}}return e},[e]),I=b.analytics.getTimeseries.useQuery({...x,filters:{...x.filters,...d},...F,timeScale:P,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},{...C,enabled:C.enabled&&o}),ie=ee({error:I.error,fallbackTitle:`Couldn't refresh this chart`}),ae=b.analytics.getTimeseries.useQuery({...x,filters:{...x.filters,...d},...F,timeScale:`full`,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},{...C,enabled:C.enabled&&o&&e.graphType===`monitor_graph`}),L=jr(F,I),se=Array.from(new Set(L?.flatMap(e=>Object.keys(e).filter(e=>e!==`date`&&!e.startsWith(`previous`)))??[])),R=e.graphType===`scatter`||e.graphType===`line`?L:Fr(L,se,e.graphType===`monitor_graph`&&e.series[0]?.metric.includes(`pass_rate`)?1:0),ce=Object.fromEntries(se.map(e=>[e,R?.reduce((t,n)=>[...t,n[e]],[])??[]])),le=Object.fromEntries(Object.entries(ce).map(([e,t])=>[e,t.reduce((e,t)=>e+t,0)])),ue=se.toSorted((e,t)=>{let n=le[e]??0;return(le[t]??0)-n}),de=F.series,z=Object.fromEntries(de.map((e,t)=>[[t,e.metric,e.aggregation,e.pipeline?.field,e.pipeline?.aggregation,e.key].filter(e=>e!==void 0&&e!==``).join(`/`),e])),B=(0,q.useCallback)(t=>{let{series:n,groupKey:r}=$(z,t),a=e.groupBy&&r?_r(e.groupBy):void 0,o=r||`unknown`,s=r===void 0?``:`${i?``:a?.label.toLowerCase()+` `}${o}`;return e.series.length>1?(n?.name??t)+(s?` (${s})`:``):s?oe(s).replace(`Evaluation passed passed`,`Evaluation Passed`).replace(`Evaluation passed failed`,`Evaluation Failed`).replace(`Contains error`,`Traces`).replace(/^Evaluation label /i,``).replace(/^Thumbs up\/down /i,``):n?.name??t},[z,e.groupBy,e.series.length,i]),fe=(0,q.useMemo)(()=>e.graphType===`pie`||e.graphType===`donnut`?Mr(e,z,I,B).current.filter(e=>e.value>0):[],[e,z,I,B]),V=(e,t)=>{let{series:n,groupKey:r}=$(z,e),i=n?.colorSet??`grayTones`;if(i===`positiveNegativeNeutral`&&r){let[e,t,n]=[0,1,2];return ge(i,{positive:e,negative:t,neutral:n,error:t,failed:t,succeeded:e,skipped:n,processed:e,passed:e,"with error":t,"without error":e}[r]??n)}return ge(i,t)},pe=(e,t)=>typeof e==`function`?e(t):(0,X.default)(t).format(e??`0a`),me=Array.from(new Set(e.series.map(e=>e.aggregation===`cardinality`?`0a`:gr(e.metric)?.format??`0a`))),H=me.length===1?me[0]:``,U=Object.values(ce).flatMap(e=>e).filter(Number.isFinite),he=U.length>0?Math.max(...U):0,ge=tr(),_e=k(.3,.15),ve=te(`gray.400`),ye=k(`rgba(0, 0, 0, 0.08)`,`rgba(255, 255, 255, 0.08)`),be=k(`rgba(0, 0, 0, 0.1)`,`rgba(255, 255, 255, 0.1)`),xe=e=>xr({date:e,timeScale:P,daysDifference:w}),Se=(e,t,n)=>{if(n.dataKey===`date`)return xe(e);let{series:r}=$(z,n.payload?.key??n.dataKey),i=r?.metric&&gr(r.metric);return pe(r?.aggregation===`cardinality`?`0a`:i?.format,e)},W=t=>{let i=!I.isLoading&&I.data,o=wr.includes(e.graphType),c=i&&(U.length===0||L?.length===0||!o&&U.every(e=>e===0));return(0,Q.jsxs)(r,{width:`full`,height:`full`,position:`relative`,children:[I.isLoading&&e.graphType!==`summary`&&(0,Q.jsx)(r,{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,children:(0,Q.jsx)(a,{gap:1,align:`end`,opacity:.15,children:[35,55,25,70,45,65,40,55,30,60,50,35].map((e,t)=>(0,Q.jsx)(s,{width:`8px`,height:`${e}%`,maxHeight:`${e/100*(y-40)}px`,borderRadius:`sm`},t))})}),I.isFetching&&!I.isLoading&&(0,Q.jsx)(Rt,{children:(0,Q.jsx)(n,{position:`absolute`,right:4,top:4})}),I.error&&!I.data?(0,Q.jsx)(br,{error:I.error,onRetry:()=>void I.refetch()}):(0,Q.jsxs)(Q.Fragment,{children:[I.error&&I.data&&(0,Q.jsx)(`button`,{type:`button`,style:{position:`absolute`,right:16,top:16,zIndex:1,cursor:`pointer`,background:`none`,border:`none`,padding:0},"aria-label":`Retry loading chart data`,onClick:()=>void I.refetch(),title:ie,children:(0,Q.jsx)(g,{colorPalette:`red`,variant:`solid`,fontSize:`xs`,children:`Refresh failed — click to retry`})}),c&&e.graphType!==`monitor_graph`?_??(0,Q.jsxs)(u,{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,gap:2,children:[(0,Q.jsx)(a,{gap:1,align:`end`,opacity:.3,children:[40,65,30,80,50,70,45,60].map((e,t)=>(0,Q.jsx)(r,{width:`6px`,height:`${e}%`,maxHeight:`40px`,bg:`border`,borderRadius:`sm`},t))}),(0,Q.jsx)(l,{textStyle:`xs`,color:`fg.subtle`,children:`No data — try adjusting the date range`})]}):t]})]})};if(e.graphType===`summary`){let n=Mr(e,z,I,B),r=Object.fromEntries(n.previous.map(e=>[e.key,e])),i=Object.fromEntries(e.series.toReversed().map(e=>[e.metric+e.aggregation+e.pipeline?.field+e.pipeline?.aggregation,e]));return W((0,Q.jsx)(a,{gap:0,align:`start`,minHeight:Tr,overflowX:`auto`,width:`full`,children:(0,Q.jsxs)(v,{paddingBottom:3,width:`full`,gap:0,children:[I.isLoading&&Object.entries(i).map(([e,n])=>(0,Q.jsx)(Sr,{label:n.name,titleProps:t},e)),n.current.slice(0,10).map(e=>(0,Q.jsx)(Sr,{label:e.name,current:e.value,previous:r[e.key]?.value,format:e.metric?.format,increaseIs:e.metric?.increaseIs,noDataUrl:e.noDataUrl,titleProps:t},e.key))]})}))}if(e.graphType===`pie`||e.graphType===`donnut`)return W((0,Q.jsx)(gt,{height:y,children:(0,Q.jsxs)(er,{children:[(0,Q.jsx)(Pn,{data:fe,nameKey:`name`,dataKey:`value`,labelLine:!1,label:Ar,innerRadius:e.graphType===`donnut`?`50%`:0,onClick:(t,n)=>{if(N&&t&&typeof n==`number`&&fe[n]){let t=fe[n],{series:r,groupKey:i}=$(z,t.key);N({evaluatorId:r?.key||e.groupByKey||e.series[0]?.key,groupKey:i})}},style:{cursor:N?`pointer`:`default`},children:fe.map((e,t)=>(0,Q.jsx)(Tt,{fill:V(e.key,t)},`cell-${t}`))}),(0,Q.jsx)(st,{content:(0,Q.jsx)(zt,{}),formatter:Se,wrapperStyle:{zIndex:1e3}}),(0,Q.jsx)(xt,{wrapperStyle:{padding:`0 2rem`,flexWrap:`wrap`,zIndex:1,fontSize:11}})]})},R?e.graphId:`loading`));let[G,Ce]=Er[e.graphType],[we,Te]=e.graphType===`horizontal_bar`?[ft,Ve]:[Ve,ft];if([`bar`,`horizontal_bar`].includes(e.graphType)&&e.timeScale===`full`){let t=Mr(e,z,I,B),n=t.current.toSorted((e,t)=>t.value-e.value),r=Math.max(...t.current.map(e=>e.name.length)),i=Math.min(r*8,300);return W((0,Q.jsx)(gt,{height:y,children:(0,Q.jsxs)(Dt,{data:n,barCategoryGap:10,layout:e.graphType===`horizontal_bar`?`vertical`:void 0,children:[(0,Q.jsx)(we,{type:`category`,dataKey:`name`,width:e.graphType===`horizontal_bar`?i:void 0,height:e.graphType===`horizontal_bar`?void 0:i,interval:e.graphType===`horizontal_bar`?0:void 0,tickLine:!1,axisLine:!1,tick:{fill:ve},style:{fontSize:`11px`},angle:e.graphType===`horizontal_bar`?void 0:45,textAnchor:e.graphType===`horizontal_bar`?`end`:`start`}),(0,Q.jsx)(Te,{type:`number`,dataKey:`value`,domain:[0,e=>e>0?e:1],tick:{fill:ve},style:{fontSize:`11px`},tickFormatter:e=>typeof H==`function`?H(e):(0,X.default)(e).format(H)}),(0,Q.jsx)(st,{content:(0,Q.jsx)(zt,{}),formatter:Se,cursor:{fill:be},wrapperStyle:{zIndex:1e3}}),(0,Q.jsx)(wt,{dataKey:`value`,minPointSize:4,onClick:t=>{if(N&&t?.payload?.key){let n=t.payload.key,{series:r,groupKey:i}=$(z,n);N({evaluatorId:r?.key||e.groupByKey||e.series[0]?.key,groupKey:i})}},style:{cursor:N?`pointer`:`default`},children:n.map((e,t)=>(0,Q.jsx)(Tt,{fill:V(e.key,t)},`cell-${t}`))})]})},R?e.graphId:`loading`))}return e.graphType===`monitor_graph`?W((0,Q.jsx)(Ir,{input:e,seriesByKey:z,currentAndPreviousData:L,currentAndPreviousDataFilled:R,summaryTimeseries:ae,sortedKeys:ue,nameForSeries:B,getColor:ge,size:c,filterParams:x,height_:y,formatWith:pe,yAxisValueFormat:H,formatDate:xe})):W((0,Q.jsx)(gt,{height:y,children:(0,Q.jsxs)(G,{data:R,margin:{top:10,left:pe(H,he).length*6-5,right:24,bottom:0},layout:e.graphType===`horizontal_bar`?`vertical`:void 0,children:[(0,Q.jsx)(`defs`,{children:(ue??[]).map((e,t)=>(0,Q.jsxs)(`linearGradient`,{id:`gradient-${j}-${t}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,Q.jsx)(`stop`,{offset:`0%`,stopColor:V(e,t),stopOpacity:_e}),(0,Q.jsx)(`stop`,{offset:`100%`,stopColor:V(e,t),stopOpacity:.02})]},`gradient-${e}`))}),(0,Q.jsx)(vt,{vertical:e.graphType===`scatter`,strokeDasharray:`5 7`,stroke:ye}),(0,Q.jsx)(we,{type:`category`,dataKey:`date`,name:`Date`,tickFormatter:xe,tickLine:!1,axisLine:!1,tick:{fill:ve},style:{fontSize:`11px`}}),(0,Q.jsx)(Te,{type:`number`,axisLine:!1,tickLine:!1,tickCount:4,tickMargin:20,domain:[0,e=>e>0?e:1],tick:{fill:ve},style:{fontSize:`11px`},tickFormatter:e=>typeof H==`function`?H(e):(0,X.default)(e).format(H)}),(0,Q.jsx)(st,{content:(0,Q.jsx)(zt,{}),formatter:Se,cursor:{fill:be},labelFormatter:(t,n)=>e.graphType===`scatter`?``:xe(n[0]?.payload.date)+(e.includePrevious&&n[1]?.payload[`previous>date`]?` vs `+xe(n[1]?.payload[`previous>date`]):``),wrapperStyle:{zIndex:1e3}}),(0,Q.jsx)(xt,{wrapperStyle:{padding:`0 2rem`,flexWrap:`wrap`,zIndex:1,cursor:`pointer`,fontSize:11},onClick:e=>{let t=e.dataKey;t&&re(t.replace(/^previous>/,``))},formatter:(e,t)=>(0,Q.jsx)(`span`,{style:{opacity:t.dataKey&&O.has(t.dataKey.replace(/^previous>/,``))?.3:1},children:e})}),(ue??[]).map((t,n)=>{let r=V(t,n),i=V(t,n),a=[`area`,`stacked_area`].includes(e.graphType),o=[`bar`,`stacked_bar`,`horizontal_bar`].includes(e.graphType),{series:s,groupKey:c}=$(z,t),l=s?.key||e.groupByKey||e.series[0]?.key,u=O.has(t),d={};return o&&![`stacked_bar`].includes(e.graphType)&&(d.radius=[3,3,0,0]),(0,Q.jsxs)(q.Fragment,{children:[(0,Q.jsx)(Ce,{type:`monotone`,hide:u,dataKey:t,stroke:r,stackId:[`stacked_bar`,`stacked_area`].includes(e.graphType)?`same`:void 0,fill:a?`url(#gradient-${j}-${n})`:i,fillOpacity:o?.8:void 0,...d,strokeWidth:o?0:2.5,dot:!1,activeDot:e.graphType===`scatter`?void 0:{r:8},name:B(t),line:e.graphType===`scatter`&&e.connected?!0:void 0,onClick:t=>{if(h&&t){let n;n=[`bar`,`stacked_bar`,`horizontal_bar`].includes(e.graphType)?t.payload?.date||t.date||t.activePayload?.[0]?.payload?.date:t.date||t.payload?.date;let r,i;if(n&&[`bar`,`stacked_bar`,`horizontal_bar`].includes(e.graphType)&&typeof P==`number`){let e=new Date(n);r=e.toISOString(),i=new Date(e.getTime()+P*60*1e3).toISOString()}h({evaluatorId:l,groupKey:c,date:n,startDate:r,endDate:i})}},style:{cursor:h?`pointer`:`default`}},t),e.includePrevious&&(0,Q.jsx)(Ce,{type:`monotone`,hide:u,dataKey:`previous>`+t,stackId:[`stacked_bar`,`stacked_area`].includes(e.graphType)?`same`:void 0,stroke:V(t,n)+`99`,fill:V(t,n)+`99`,strokeWidth:2.5,strokeDasharray:e.graphType===`scatter`?void 0:`5 5`,dot:!1,activeDot:e.graphType===`scatter`?void 0:{r:8},name:`Previous `+B(t),line:e.graphType===`scatter`&&e.connected?!0:void 0},`previous>`+t)]},t)})]})},R?e.graphId:`loading`))},(e,t)=>JSON.stringify(e.input)===JSON.stringify(t.input)&&JSON.stringify(e.titleProps)===JSON.stringify(t.titleProps)&&JSON.stringify(e.filters)===JSON.stringify(t.filters)&&e.onDataPointClick===t.onDataPointClick),kr=Math.PI/180,Ar=({cx:e,cy:t,midAngle:n,innerRadius:r,outerRadius:i,percent:a})=>{let o=r+(i-r)*.5;return(0,Q.jsx)(`text`,{x:e+o*Math.cos(-n*kr),y:t+o*Math.sin(-n*kr),fill:`white`,textAnchor:`middle`,dominantBaseline:`central`,children:`${(a*100).toFixed(0)}%`})},$=(e,t)=>{let n,r=t,i=t.split(`>`);i.length==2&&(n=i[0],r=i[1]);let a=e[r];if(!a){let t=Object.keys(e).find(e=>e.startsWith(r+`/`)||e===r);t&&(a=e[t])}return{series:a,groupKey:n}},jr=(e,t)=>{let n=t.data&&Pr(e,t.data.currentPeriod),r=t.data&&Pr(e,t.data.previousPeriod);return n?.map((e,t)=>r?{...e,...Object.fromEntries(Object.entries(r[t]??{}).map(([e,t])=>[`previous>${e}`,t??0]))}:e)},Mr=(e,t,n,r)=>{let i=n.data&&Pr(e,n.data.currentPeriod),a=n.data&&Pr(e,n.data.previousPeriod),o=Nr(i??[]),s=Nr(a??[]),c=e=>Object.entries(e).map(([e,n])=>{let{series:i}=$(t,e),a=i?.metric&&gr(i.metric),o=n.reduce((e,t)=>e+(t??0),0),s=i?.aggregation===`cardinality`&&a?{...a,format:`0a`}:a;return{key:e,name:r(e),metric:s?i?.increaseIs?{...s,increaseIs:i.increaseIs}:s:void 0,value:o,noDataUrl:i?.noDataUrl}});return{current:c(o),previous:c(s)}},Nr=e=>{let t={};for(let n of e)for(let e of Object.keys(n))e!==`date`&&(t[e]||(t[e]=[]),t[e]?.push(n[e]??0));return t},Pr=(e,t)=>{let n=e.groupBy;return n?t.map(t=>{let r=t[n];if(!r||Object.keys(r).length===0)return{date:t.date};let i=Object.fromEntries(Object.entries(r).filter(([t])=>!(e.excludeUnknownBuckets&&t===`unknown`)).flatMap(([e,t])=>Object.entries(t).map(([t,n])=>[`${e}>${t}`,n??0])));return{date:t.date,...i}}):t},Fr=(e,t,n=0)=>e&&e.map(e=>{let r={...e};return t.forEach(e=>{(r[e]===null||r[e]===void 0)&&(r[e]=n);let t=`previous>${e}`;(r[t]===null||r[t]===void 0)&&(r[t]=n)}),r});function Ir({input:e,seriesByKey:t,sortedKeys:n,currentAndPreviousData:i,currentAndPreviousDataFilled:o,summaryTimeseries:c,nameForSeries:d,getColor:f,size:p,filterParams:m,height_:h,formatWith:_,yAxisValueFormat:v,formatDate:ee}){let y=Object.keys(t)[0]??``,b=d(y),x=y.includes(`pass_rate`),S=x?o?.map(e=>e[y]).filter(e=>e!=null):i?.map(e=>e[y]).filter(e=>e!=null),w=i?.map(e=>e[y]).filter(e=>e!=null),T=w&&w.length>0?w.reduce((e,t)=>e+t,0)/w.length:void 0,E=c.data?.currentPeriod?.[0]?.[y],D=typeof E==`number`?E:c.isError?T:void 0,O=D!==void 0,A=o?.length!==void 0&&(c.data!==void 0||c.isError),ne=te(`gray.400`),j=e.monitorGraph?.disabled?`grayTones`:D===void 0||D>.8||!A?`greenTones`:D<.4?`redTones`:`orangeTones`,re=S&&S.length>0?S.filter(Number.isFinite):[],M=x?1:re.length>0?Math.max(...re):1,P=k(-400,200),F=k(300,-300),I=k(-300,100),ie=f(j,0,0),ae=k(`none`,`0 0 20px ${ie}40, 0 0 40px ${ie}20`);return(0,Q.jsxs)(r,{width:`full`,height:`full`,position:`relative`,border:`1px solid`,borderColor:`border`,backgroundColor:f(j,0,P),borderRadius:`lg`,paddingTop:2,overflow:`hidden`,boxShadow:ae,children:[(0,Q.jsxs)(u,{position:`absolute`,bottom:p===`md`?8:0,left:p===`md`?20:0,zIndex:1,padding:8,gap:2,align:`start`,color:f(j,0,F),children:[(0,Q.jsxs)(a,{children:[e.monitorGraph?.isGuardrail&&(0,Q.jsxs)(g,{colorPalette:`blue`,variant:`solid`,size:`sm`,marginTop:`-3px`,children:[(0,Q.jsx)(C,{size:16}),`Guardrail`]}),(0,Q.jsxs)(l,{fontSize:`sm`,fontWeight:`medium`,paddingBottom:1,children:[b,e.monitorGraph?.disabled&&` (disabled)`]})]}),(0,Q.jsxs)(a,{gap:2,children:[(0,Q.jsx)(l,{fontSize:`2xl`,fontWeight:`bold`,children:A?O?(0,X.default)(D).format(x?`0%`:`0.[00]`):`-`:(0,Q.jsx)(s,{width:`56px`,height:`36px`})}),(0,Q.jsx)(l,{fontSize:`xs`,children:O?x?`Pass Rate`:`Average Score`:`No data yet`})]}),(0,Q.jsx)(l,{fontSize:`xs`,children:m.startDate&&m.endDate&&(()=>{let e=new Date().getTime(),t=Math.abs(Math.ceil((e-m.endDate)/(1e3*60*60*24))),n=Math.ceil((m.endDate-m.startDate)/(1e3*60*60*24));return t<=1?`Last ${n} days`:`${N(new Date(m.startDate),`MMM d`)} - ${N(new Date(m.endDate),`MMM d, yyyy`)}`})()})]}),(0,Q.jsx)(gt,{height:h,children:(0,Q.jsxs)(At,{data:o,margin:p===`md`?{top:10,left:_(v,M).length*6-5,right:24}:{},children:[p===`md`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ve,{type:`category`,dataKey:`date`,name:`Date`,tickFormatter:ee,tickLine:!1,axisLine:!1,tick:{fill:ne},style:{fontSize:`11px`}}),(0,Q.jsx)(ft,{type:`number`,axisLine:!1,tickLine:!1,tickCount:4,tickMargin:20,domain:[0,M],tick:{fill:ne},style:{fontSize:`11px`},tickFormatter:e=>typeof v==`function`?v(e):(0,X.default)(e).format(v)})]}),(n??[]).map((t,n)=>(0,Q.jsx)(kt,{type:`monotone`,dataKey:t,stroke:f(j,n,I),stackId:[`stacked_bar`,`stacked_area`].includes(e.graphType)?`same`:void 0,fill:f(j,n,I),strokeWidth:2.5,dot:!1,name:d(t)},t))]})},o?e.graphId:`loading`)]})}export{lr as a,gr as c,mr as i,pr as l,wr as n,dr as o,Cr as r,_r as s,Dr as t,fr as u};
2
+ //# sourceMappingURL=CustomGraph-C6j6slUs.js.map