@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
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{i as n,n as r}from"./portal-Sdfvrza9.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{t as a}from"./heading-C0sACr0w.js";import{t as o}from"./v-stack-hkuSkmCA.js";import{n as s}from"./toaster-BsYkODqs.js";import{n as c}from"./personalProject-DMRX2-SI.js";import{t as l}from"./spacer-C38e7o6r.js";import{n as u}from"./api-l6Cnm0vQ.js";import{o as d}from"./trpcError-CFsR-0nB.js";import{r as f}from"./next-router-CWLrMXvP.js";import{Mr as p,Vt as m,W as h}from"./index-CPtTUYLD.js";import{t as g}from"./useLicenseEnforcement-DOI0dcqD.js";import{t as _}from"./HorizontalFormControl-lYiaIlzD.js";var v=e(t()),y=i();function b({open:e=!0,onClose:t}){let i=f(),{project:b}=m(),x=b?.id??``,S=b?.slug??``,{closeDrawer:C}=h(),{checkAndProceed:w}=g(`dashboards`),T=u.useContext(),E=u.dashboards.getAll.useQuery({projectId:x},{enabled:!!x}),D=u.dashboards.create.useMutation(),O=`Dashboard ${(E.data??[]).length+1}`,[k,A]=(0,v.useState)(O);(0,v.useEffect)(()=>{e&&A(e=>e.trim()?e:O)},[O,e]);let j=()=>{t?t():C()},M=()=>{k.trim()&&w(()=>{D.mutate({projectId:x,name:k.trim()},{onSuccess:e=>{E.refetch(),T.licenseEnforcement.checkLimit.invalidate(),i.push(`/${S}/analytics/reports?dashboard=${e.id}`),j()},onError:e=>{d(e)||s.create({title:`Error creating dashboard`,type:`error`,duration:3e3,meta:{closable:!0}})}})})};return(0,y.jsx)(c.Root,{open:e,placement:`end`,size:`lg`,onOpenChange:({open:e})=>{e||j()},children:(0,y.jsxs)(c.Content,{bg:`bg`,children:[(0,y.jsxs)(c.Header,{children:[(0,y.jsx)(c.CloseTrigger,{onClick:j}),(0,y.jsx)(a,{size:`lg`,children:`Create Dashboard`})]}),(0,y.jsx)(c.Body,{children:(0,y.jsxs)(o,{align:`stretch`,gap:6,children:[(0,y.jsx)(_,{label:`Name`,helper:`Give it a name that identifies what this dashboard will focus on`,children:(0,y.jsx)(p,{autoFocus:!0,placeholder:`Dashboard name`,value:k,onChange:e=>A(e.target.value),onKeyDown:e=>{e.key===`Enter`&&M()}})}),(0,y.jsxs)(r,{width:`full`,children:[(0,y.jsx)(l,{}),(0,y.jsx)(n,{colorPalette:`blue`,onClick:M,disabled:!k.trim(),loading:D.isPending,children:`Create Dashboard`})]})]})})]})})}export{b as DashboardNameDrawer};
2
- //# sourceMappingURL=DashboardNameDrawer-WriiQpWZ.js.map
@@ -1,2 +0,0 @@
1
- import{t as e}from"./jsx-runtime-CFwixLRt.js";import{n as t}from"./toaster-BsYkODqs.js";import{t as n}from"./errors-e711UMq7.js";import{n as r}from"./api-l6Cnm0vQ.js";import{Vt as i,W as a}from"./index-CPtTUYLD.js";import{PrivacyRuleDrawer as o}from"./data-privacy-BuolZ3DI.js";var s=e();function c({editScopeType:e,editScopeId:c,editPersonalOnly:l}){let{closeDrawer:u}=a(),{project:d,organization:f}=i(),p=d?.id??``,m=r.useUtils(),h=r.dataPrivacy.getSnapshot.useQuery({projectId:p},{enabled:!!p}),g=r.dataPrivacy.setForScope.useMutation(),_=h.data;return _?.available?(0,s.jsx)(o,{open:!0,editingRule:e&&c?_.rules.find(t=>t.scopeType===e&&t.scopeId===c&&t.personalOnly===(l===`true`))??null:null,onClose:u,available:_.available,audienceOptions:_.audienceOptions,effectiveTeam:_.effectiveTeam,effectiveOrganization:_.effectiveOrganization,projectId:p,currentTeamId:d?.teamId??null,currentOrganizationId:f?.id??null,isSaving:g.isLoading,onSave:async(e,r)=>{try{await Promise.all(e.map(e=>g.mutateAsync({projectId:p,scope:{scopeType:e.scopeType,scopeId:e.scopeId},personalOnly:!!e.personalOnly,config:r}))),m.dataPrivacy.getSnapshot.invalidate({projectId:p}),t.create({title:e.length>1?`Privacy rule saved for ${e.length} scopes`:`Privacy rule saved`,type:`success`}),u()}catch(e){n({error:e,fallbackTitle:`Couldn't save the privacy rule`})}}}):null}export{c as DataPrivacyRuleDrawer};
2
- //# sourceMappingURL=DataPrivacyRuleDrawer-BWcEQSs7.js.map
@@ -1,2 +0,0 @@
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{tr as d}from"./ProjectAvatar-DtI9dT1f.js";import{t as f}from"./tooltip-gjZ4s2dt.js";import{n as p}from"./toaster-BsYkODqs.js";import{i as m,n as h,s as g}from"./grid-DVy6ELOp.js";import{t as _}from"./icon-button-Wlb_dGXL.js";import{T as v,n as y,x as b}from"./fetchSSE-5rVPow_l.js";import{t as x}from"./errors-e711UMq7.js";import{n as ee,r as te,t as ne}from"./native-select-DL2k8x0o.js";import{t as S}from"./spacer-C38e7o6r.js";import{D as C}from"./immer-CFru3D02.js";import{n as w}from"./api-l6Cnm0vQ.js";import{g as T,m as E}from"./trpcError-CFsR-0nB.js";import{St as D,Vt as re}from"./index-CPtTUYLD.js";import{t as O}from"./arrow-right-B4BUj4mB.js";import{t as k}from"./check-CcrJKf5P.js";import{t as A}from"./chevron-left-Dtuhk1wQ.js";import{t as j}from"./chevron-right-Bdb_y7iR.js";import{t as ie}from"./download-CuvC-TAo.js";import{t as ae}from"./edit-2-B0IA_tY5.js";import{r as oe,t as M}from"./AddOrEditDatasetDrawer-DKQT3n1Q.js";import{t as se}from"./plus-10dP8Fmk.js";import{t as ce}from"./trash-2-Bq5tW_xF.js";import{t as le}from"./upload-C_eEH6OA.js";import{t as ue}from"./x-ePIIvo_k.js";import{i as de,n as fe,r as pe,t as me}from"./lib-epD9Y2nV.js";import{t as he}from"./ColumnTypeIcon-Bh1MI0_N.js";import{i as ge,r as _e,t as N}from"./TableCell-Cbtwk2YR.js";import{t as P}from"./papaparse.min-cQwnxGCG.js";import{t as ve}from"./SelectionActionBar-fxhOYCmO.js";import{t as F}from"./UploadCSVDrawer-BTttuVHZ.js";var I=e(t()),ye=e(P()),L=o(),be=[10,25,50,100];function xe({pageSize:e,pageSizeOptions:t,disabled:n,onPageSizeChange:r}){return(0,L.jsxs)(v,{align:`center`,gap:.5,children:[(0,L.jsx)(l,{textStyle:`xs`,color:`fg.subtle`,flexShrink:0,children:`Rows`}),t.map(t=>{let a=e===t;return(0,L.jsx)(i,{variant:`ghost`,size:`2xs`,disabled:n||a,color:a?`fg`:`fg.subtle`,fontWeight:a?`semibold`:`normal`,onClick:()=>r(t),paddingX:1.5,minWidth:`auto`,"data-testid":`pagination-size-${t}`,children:t},t)})]})}function R({currentPage:e,totalPages:t,disabled:n,onPageChange:r}){return(0,L.jsxs)(v,{gap:1,children:[(0,L.jsx)(_,{"aria-label":`Previous page`,variant:`ghost`,size:`xs`,disabled:n||e<=1,onClick:()=>r(e-1),"data-testid":`pagination-prev`,children:(0,L.jsx)(A,{size:14})}),(0,L.jsx)(_,{"aria-label":`Next page`,variant:`ghost`,size:`xs`,disabled:n||e>=t,onClick:()=>r(e+1),"data-testid":`pagination-next`,children:(0,L.jsx)(j,{size:14})})]})}function Se({page:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:i,pageSizeOptions:a=be,isLoading:o=!1,navDisabled:c=!1,unitLabel:u}){let d=Math.max(1,Math.ceil(n/t)),f=Math.min(Math.max(1,e),d);return!o&&n===0?null:(0,L.jsxs)(v,{align:`center`,justify:`flex-end`,gap:3,paddingX:2,paddingY:1.5,borderTopWidth:`1px`,borderColor:`border.muted`,flexShrink:0,"data-testid":`pagination`,children:[o?(0,L.jsx)(s,{height:`14px`,width:`200px`,borderRadius:`sm`}):(0,L.jsxs)(L.Fragment,{children:[i&&(0,L.jsx)(xe,{pageSize:t,pageSizeOptions:a,disabled:c,onPageSizeChange:i}),(0,L.jsxs)(l,{textStyle:`xs`,color:`fg.subtle`,"data-testid":`pagination-indicator`,children:[`Page `,f,` of `,d,u?` (${n.toLocaleString()} ${u})`:``]})]}),(0,L.jsx)(R,{currentPage:f,totalPages:d,disabled:o||c,onPageChange:r})]})}function Ce({isOpen:e,onClose:t,datasetId:n,columnTypes:o,onUpdateDataset:s}){let{project:c}=re(),u=w.datasetRecord.getAll.useQuery({projectId:c?.id??``,datasetId:n??``},{enabled:!!c&&!!n,refetchOnWindowFocus:!1}),[d,f]=(0,I.useState)([]),[m,h]=(0,I.useState)([]),[g,_]=(0,I.useState)([]),[v,x]=(0,I.useState)([]),[C,T]=(0,I.useState)({}),[E,k]=(0,I.useState)(!1),A=w.datasetRecord.create.useMutation(),j=e=>{h(e.slice(0,1)[0]),x(e)};function ie(e,t,n){let r=t.indexOf(n);return r===-1?``:e[r]}let ae=e=>{let t=[];v.slice(1).forEach(n=>{let r={id:y()};for(let{name:t}of o)r[t]=ie(n,m,e[t]??``);t.push(r)}),f(t),j(v)},M=(0,I.useCallback)(()=>(o??[]).map(({name:e})=>e).every(e=>Object.keys(C).includes(e)),[o,C]);(0,I.useEffect)(()=>{k(M())},[M,C]);let se=e=>t=>{let n=t;!e||!n||(C[e]=n,T(t=>({...t,[e]:n})),ae(C))},ce=()=>{let e;try{e=b.parse({entries:oe(d,o)})}catch(e){console.error(e),p.create({title:`Error processing CSV`,type:`error`,duration:5e3,meta:{closable:!0}});return}s&&s(e.entries),n&&A.mutate({projectId:c?.id??``,datasetId:n,...e},{onSuccess:()=>{u.refetch(),f([]),T({}),t(),p.create({title:`CSV uploaded successfully`,type:`success`,duration:5e3,meta:{closable:!0}})},onError:()=>{p.create({title:`Error uploading CSV`,description:`Please make sure you have the right formatting and that the columns are correct`,type:`error`,duration:5e3,meta:{closable:!0}})}})},le=(0,I.useMemo)(()=>(o??[]).map(({name:e})=>e).map(e=>({value:e})),[o]);return(0,I.useEffect)(()=>{e&&(f([]),T({}),h([]),x([]),_([]))},[e]),(0,L.jsx)(D.Root,{open:e,onOpenChange:({open:e})=>!e&&t(),children:(0,L.jsxs)(D.Content,{bg:`bg`,children:[(0,L.jsxs)(D.Header,{children:[(0,L.jsx)(D.Title,{children:`Add rows from CSV`}),(0,L.jsx)(D.CloseTrigger,{})]}),(0,L.jsxs)(D.Body,{children:[(0,L.jsx)(F,{onUploadAccepted:({data:e})=>{j(e)},children:e=>{if(e)return le.map((e,t)=>(0,L.jsxs)(a,{marginY:2,children:[(0,L.jsx)(r,{width:200,children:(0,L.jsxs)(te,{children:[(0,L.jsxs)(ne,{placeholder:`Select column`,onChange:t=>{se(e.value)(t.target.value)},value:C[e.value],children:[m.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e)),(0,L.jsx)(`option`,{value:``,children:`Set empty`})]}),(0,L.jsx)(ee,{})]})}),(0,L.jsx)(O,{}),(0,L.jsx)(S,{}),(0,L.jsx)(l,{children:e.value})]},t))}}),g.length>0&&(0,L.jsx)(l,{color:`red`,children:`Please check columns have valid formatting`})]}),(0,L.jsxs)(D.Footer,{children:[(0,L.jsx)(i,{variant:`ghost`,mr:3,onClick:t,children:`Close`}),(0,L.jsx)(i,{colorPalette:`blue`,disabled:d.length===0||!E||g.length>0,onClick:ce,loading:A.isLoading,children:`Upload`})]})]})})}var we=new Intl.NumberFormat(`en-US`),Te=e=>we.format(e);function Ee(e,t,n){let r=t.map(e=>e.name),i=n.map(e=>e.name),a=new Map;if(r.length===i.length)for(let e=0;e<i.length;e++){let t=r[e],n=i[e];t!==n&&!i.includes(t)&&!r.includes(n)&&a.set(n,t)}return e.map(e=>{let t={id:e.id};for(let n of i){let r=e[a.get(n)??n];r!==void 0&&(t[n]=r)}return t})}var z=0,B=()=>`new_${Date.now()}_${z+=1}`,V=e=>({id:B(),...Object.fromEntries(e.map(e=>[e.name,``]))});function De(){return T((e,t)=>({dbDatasetId:void 0,columns:[],records:[],pendingSavedChanges:{},editingCell:void 0,selectedCell:void 0,selectedRows:new Set,expandedCells:new Set,rowHeightMode:`compact`,autosave:{state:`idle`},setData:({columns:t,records:n,dbDatasetId:r})=>{e({columns:t,records:n,dbDatasetId:r,selectedRows:new Set,editingCell:void 0,selectedCell:void 0,expandedCells:new Set})},upsertExternalRecord:n=>{let{records:r}=t(),i=r.findIndex(e=>e.id===n.id),a=[...r];i===-1?a.push(n):a[i]={...a[i],...n},e({records:a})},removeExternalRecord:n=>{e({records:t().records.filter(e=>e.id!==n)})},setCellValue:(n,r,i,a)=>{let{columns:o,records:s,dbDatasetId:c,pendingSavedChanges:l}=t(),u=o.find(e=>e.id===i);if(!u)return;let d=[...s];for(;d.length<=r;)d.push(V(o));let f={...d[r],[u.name]:a};if(d[r]=f,!c){e({records:d});return}let p={...l[c]??{}};for(let e=s.length;e<d.length;e++){let t=d[e];if(t.id!==f.id){let{id:e,...n}=t;p[t.id]=n}}let m=r>=s.length;p[f.id]=m?(()=>{let{id:e,...t}=f;return t})():{...p[f.id]??{},[u.name]:a},e({records:d,pendingSavedChanges:{...l,[c]:p}})},addRow:()=>{let{columns:n,records:r}=t(),i=V(n);return e({records:[...r,i]}),r.length},deleteSelectedRows:()=>{let{records:n,selectedRows:r,dbDatasetId:i,pendingSavedChanges:a}=t();if(r.size===0)return;let o=n.filter((e,t)=>!r.has(t)),s=n.filter((e,t)=>r.has(t));if(!i){e({records:o,selectedRows:new Set,selectedCell:void 0,editingCell:void 0});return}let c={...a[i]??{}};for(let e of s)c[e.id]={_delete:!0};e({records:o,selectedRows:new Set,selectedCell:void 0,editingCell:void 0,pendingSavedChanges:{...a,[i]:c}})},setEditingCell:t=>e({editingCell:t}),setSelectedCell:t=>e({selectedCell:t}),toggleRowSelection:n=>{let r=new Set(t().selectedRows);r.has(n)?r.delete(n):r.add(n),e({selectedRows:r})},selectAllRows:t=>{e({selectedRows:new Set(Array.from({length:t},(e,t)=>t))})},clearRowSelection:()=>e({selectedRows:new Set}),toggleCellExpanded:(n,r)=>{let i=`${n}-${r}`,a=new Set(t().expandedCells);a.has(i)?a.delete(i):a.add(i),e({expandedCells:a})},setRowHeightMode:t=>e({rowHeightMode:t,expandedCells:new Set}),clearPendingChange:(n,r)=>{let i={...t().pendingSavedChanges},a={...i[n]??{}};delete a[r],Object.keys(a).length===0?delete i[n]:i[n]=a,e({pendingSavedChanges:i})},setAutosave:(t,n)=>e({autosave:{state:t,error:n}})}))}var Oe=({projectId:e,pendingSavedChanges:t,resolveFullRecord:n,clearPendingChange:r,onStatus:i,onRecordsDeleted:a})=>{let o=(0,I.useRef)(null),s=(0,I.useRef)(0),c=w.datasetRecord.update.useMutation(),l=w.datasetRecord.deleteMany.useMutation(),u=(0,I.useRef)(c);u.current=c;let d=(0,I.useRef)(l);d.current=l;let f=(0,I.useRef)(t);f.current=t;let p=(0,I.useRef)(n);p.current=n;let m=(0,I.useRef)(i);m.current=i;let h=(0,I.useRef)(a);h.current=a;let g=(0,I.useRef)(!1);(0,I.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let _=(0,I.useCallback)(()=>{m.current(`saved`),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{m.current(`idle`)},2e3)},[]),v=(0,I.useCallback)(()=>{s.current+=1,m.current(`saving`)},[]),y=(0,I.useCallback)(()=>{s.current!==0||!g.current||(g.current=!1,h.current?.())},[]),b=(0,I.useCallback)(()=>{s.current=Math.max(0,s.current-1),s.current===0&&(_(),y())},[y,_]),x=(0,I.useCallback)(e=>{s.current=Math.max(0,s.current-1),m.current(`error`,e.message),y()},[y]);(0,I.useEffect)(()=>{if(!e)return;let n=Object.keys(t);if(n.length===0)return;let i=setTimeout(()=>{for(let t of n){let n=f.current[t];if(!n)continue;let i=[],a=[];for(let[e,t]of Object.entries(n))!t||Object.keys(t).length===0||(`_delete`in t&&t._delete===!0?i.push(e):a.push(e));i.length>0&&(v(),d.current.mutate({projectId:e,datasetId:t,recordIds:i},{onSuccess:()=>{for(let e of i)r(t,e);g.current=!0,b()},onError:e=>{console.error(`Failed to delete saved records:`,e),x(e)}}));for(let n of a){let i=p.current(t,n);if(!i)continue;let{id:a,...o}=i;v(),u.current.mutate({projectId:e,datasetId:t,recordId:n,updatedRecord:o},{onSuccess:()=>{r(t,n),b()},onError:e=>{console.error(`Failed to sync saved record:`,e),x(e)}})}}},500);return()=>clearTimeout(i)},[t,e,r,v,b,x])},H=(e,t)=>{let n=[];n.push({id:`__checkbox__`,type:`checkbox`});for(let t of e)n.push({id:t.id,type:`dataset`});for(let e of t)n.push({id:`target.${e.id}`,type:`target`});return n},ke=({datasetColumns:e,targets:t,displayRowCount:n,editingCell:r,selectedCell:i,setSelectedCell:a,setEditingCell:o,toggleRowSelection:s})=>{let c=H(e,t);return(0,I.useEffect)(()=>{let e=e=>{if(r||!i)return;let t=c.findIndex(e=>e.id===i.columnId);if(t===-1)return;let l=c[t];switch(e.key){case`Enter`:case` `:e.preventDefault(),l?.type===`checkbox`?s(i.row):l?.type===`dataset`&&o({row:i.row,columnId:i.columnId});break;case`ArrowUp`:e.preventDefault(),i.row>0&&a({row:i.row-1,columnId:i.columnId});break;case`ArrowDown`:e.preventDefault(),i.row<n-1&&a({row:i.row+1,columnId:i.columnId});break;case`ArrowLeft`:e.preventDefault(),t>0&&a({row:i.row,columnId:c[t-1].id});break;case`ArrowRight`:e.preventDefault(),t<c.length-1&&a({row:i.row,columnId:c[t+1].id});break;case`Tab`:e.preventDefault(),e.shiftKey?t>0?a({row:i.row,columnId:c[t-1].id}):i.row>0&&a({row:i.row-1,columnId:c[c.length-1].id}):t<c.length-1?a({row:i.row,columnId:c[t+1].id}):i.row<n-1&&a({row:i.row+1,columnId:c[0].id});break;case`Escape`:e.preventDefault(),a(void 0);break}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r,i,c,n,a,o,s]),c},U=160;function Ae({rows:e,scrollContainer:t,columnCount:n,selectedRows:r,activeDatasetId:i,isLoading:a,shouldVirtualize:o,disableVirtualization:s,displayRowCount:c,trailingSpacerWidth:l}){let u=C({count:c,getScrollElement:(0,I.useCallback)(()=>t,[t]),estimateSize:(0,I.useCallback)(()=>U,[]),overscan:5,enabled:o&&!!t});if(s||!o)return(0,L.jsx)(L.Fragment,{children:e.map(e=>(0,L.jsxs)(`tr`,{"data-index":e.index,"data-selected":r.has(e.index)?`true`:void 0,children:[e.getVisibleCells().map(t=>(0,L.jsx)(N,{cell:t,rowIndex:e.index,activeDatasetId:i,isLoading:a},t.id)),l?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`td`,{style:{width:`auto`}}),(0,L.jsx)(`td`,{style:{width:l,minWidth:l}})]}):null]},e.id))});let d=u.getVirtualItems(),f=u.getTotalSize(),p=d.length>0?d[0]?.start??0:0,m=d.length>0?f-(d[d.length-1]?.end??0):0;return(0,L.jsxs)(L.Fragment,{children:[p>0&&(0,L.jsx)(`tr`,{children:(0,L.jsx)(`td`,{style:{height:`${p}px`,padding:0},colSpan:n})}),d.map(t=>{let n=e[t.index];return n?(0,L.jsxs)(`tr`,{"data-index":t.index,style:{height:`${U}px`},"data-selected":r.has(n.index)?`true`:void 0,children:[n.getVisibleCells().map(e=>(0,L.jsx)(N,{cell:e,rowIndex:n.index,activeDatasetId:i,isLoading:a},e.id)),l?(0,L.jsx)(`td`,{colSpan:2,style:{width:`auto`,minWidth:l}}):null]},n.id):null}),m>0&&(0,L.jsx)(`tr`,{children:(0,L.jsx)(`td`,{style:{height:`${m}px`,padding:0},colSpan:n})})]})}var je=I.memo(Ae),Me=36,Ne=100,Pe=50,W=e=>e.map((e,t)=>({id:`${e.name}_${t}`,name:e.name,type:e.type})),G=e=>e==null?``:typeof e==`string`?e:JSON.stringify(e),Fe=(e,t)=>e.map(e=>({id:e.id,...Object.fromEntries(t.map(t=>[t.name,G(e[t.name])]))}));function K({datasetId:e,inMemoryDataset:t,onUpdateDataset:n,title:o,hideButtons:s=!1,isEmbedded:f=!1,floatingSelectionBar:p=!1,canEditDatasetRecord:_=!0,bottomSpace:v,controllerRef:y,onColumnsChanged:b,editorPortalRef:ee,headerActions:te,readEnabled:ne=!0}){let{project:C}=re(),[T]=(0,I.useState)(()=>De()),D=d(),O=d(),[k,A]=(0,I.useState)(1),[j,oe]=(0,I.useState)(Pe),N=w.datasetRecord.listPaginated.useQuery({projectId:C?.id??``,datasetId:e??``,page:k,limit:j},{enabled:!!C&&!!e&&ne,refetchOnWindowFocus:!1,keepPreviousData:!0,refetchOnReconnect:!1,staleTime:0,onError:e=>x({error:e,fallbackTitle:`Couldn't load dataset`})}),P=e?N.data?.count:void 0,F=Math.max(1,Math.ceil((P??0)/j)),be=Math.min(k,F),xe=be>=F;(0,I.useEffect)(()=>{if(P==null)return;let e=Math.max(1,Math.ceil(P/j));k>e&&A(e)},[P,j,k]);let R=e?N.data?.name:t?.name,we=(0,I.useMemo)(()=>e?N.data?.columnTypes??[]:t?.columnTypes??[],[e,N.data]),z=(0,I.useRef)(!1),B=(0,I.useRef)(null),V=N.isPreviousData;(0,I.useEffect)(()=>{if(e&&N.data&&!V){let t=W(N.data.columnTypes??[]),n=Fe((N.data.datasetRecords??[]).map(e=>({id:e.id,...e.entry})),N.data.columnTypes??[]);T.getState().setData({columns:t,records:n,dbDatasetId:e}),z.current=!0,B.current=T.getState().records}else!e&&t&&!z.current&&(T.getState().setData({columns:W(t.columnTypes),records:Fe(t.datasetRecords,t.columnTypes),dbDatasetId:void 0}),z.current=!0,B.current=T.getState().records)},[e,N.data,V,T]),(0,I.useEffect)(()=>{if(y)return y.current={addRow:e=>T.getState().upsertExternalRecord(e),updateRow:e=>T.getState().upsertExternalRecord(e),removeRow:e=>T.getState().removeExternalRecord(e),getColumns:()=>T.getState().columns},()=>{y.current=null}},[y,T]);let H=E(T,e=>e.columns),U=E(T,e=>e.records),Ae=E(T,e=>e.pendingSavedChanges),G=E(T,e=>e.editingCell),K=E(T,e=>e.selectedCell),q=E(T,e=>e.selectedRows),Re=E(T,e=>e.expandedCells),ze=E(T,e=>e.rowHeightMode),Be=E(T,e=>e.autosave),{setCellValue:Ve,setEditingCell:He,setSelectedCell:J,toggleCellExpanded:Ue,toggleRowSelection:Y,selectAllRows:We,clearRowSelection:X,deleteSelectedRows:Ge,addRow:Ke,clearPendingChange:qe,setAutosave:Je}=T.getState(),Ye=(0,I.useRef)(n);Ye.current=n;let Xe=(0,I.useRef)({datasetId:t?.datasetId,name:t?.name});(0,I.useEffect)(()=>{if(!e)return T.subscribe((e,t)=>{z.current&&e.records!==t.records&&B.current!==e.records&&(B.current=e.records,Ye.current?.({datasetId:Xe.current.datasetId,name:Xe.current.name,columnTypes:e.columns.map(({name:e,type:t})=>({name:e,type:t})),datasetRecords:e.records.map(e=>({...e}))}))})},[e,T]);let Ze=(0,I.useCallback)((e,t)=>T.getState().records.find(e=>e.id===t),[T]),Qe=(0,I.useCallback)((e,t)=>Je(e,t),[Je]);Oe({projectId:C?.id,pendingSavedChanges:Ae,resolveFullRecord:Ze,clearPendingChange:qe,onStatus:Qe,onRecordsDeleted:e?()=>{N.refetch()}:void 0});let Z=U.length,$e=!e||xe,Q=$e?Math.max(Z+1,3):Z,et=Be.state===`saving`||(e?Object.keys(Ae[e]??{}).length>0:!1),tt=P??Z,nt=(0,I.useMemo)(()=>Array.from({length:Q},(e,t)=>{let n=U[t],r=Object.fromEntries(H.map(e=>[e.id,n?.[e.name]??``]));return{rowIndex:t,dataset:r,isEmpty:Object.values(r).every(e=>e===``)}}),[U,H,Q]),rt=(0,I.useMemo)(()=>pe(),[]),it=q.size===Z&&Z>0,at=fe({data:nt,columns:(0,I.useMemo)(()=>{let e=[];e.push(rt.display({id:`select`,header:()=>(0,L.jsxs)(g,{size:`sm`,top:`1px`,"aria-label":`Select all rows`,checked:it,onCheckedChange:()=>{it?X():We(Z)},children:[(0,L.jsx)(m,{}),(0,L.jsx)(h,{})]}),cell:e=>(0,L.jsx)(Ie,{rowIndex:e.row.index,checked:q.has(e.row.index),onToggle:Y}),size:Me,enableResizing:!1,meta:{columnType:`checkbox`,columnId:`__checkbox__`}}));for(let t of H)e.push(rt.accessor(e=>e.dataset[t.id],{id:`dataset.${t.id}`,header:()=>(0,L.jsxs)(a,{gap:1,children:[(0,L.jsx)(he,{type:t.type}),(0,L.jsx)(l,{fontSize:`13px`,fontWeight:`medium`,children:t.name})]}),cell:e=>e.getValue(),meta:{columnType:`dataset`,columnId:t.id,dataType:t.type}}));return e},[rt,H,it,Z,q,X,We,Y]),getCoreRowModel:de()}),$=(0,I.useRef)(null),[ot,st]=(0,I.useState)(null);(0,I.useEffect)(()=>{if(!$.current)return;let e=$.current.parentElement;for(;e;){let t=window.getComputedStyle(e);if(t.overflow===`auto`||t.overflowY===`auto`){st(e);break}e=e.parentElement}},[]),(0,I.useEffect)(()=>{let e=e=>{T.getState().selectedCell&&($.current?.contains(e.target)||J(void 0))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[T,J]),ke({datasetColumns:H,targets:[],displayRowCount:Q,editingCell:G,selectedCell:K,setSelectedCell:J,setEditingCell:He,toggleRowSelection:Y});let ct=(0,I.useMemo)(()=>({rowHeightMode:ze,expandedCells:Re,editingCell:G,selectedCell:K,setCellValue:Ve,setEditingCell:He,setSelectedCell:J,toggleCellExpanded:Ue,toggleRowSelection:Y,editorPortalRef:ee}),[ze,Re,G,K,Ve,He,J,Ue,Y,ee]),lt=Z>Ne,ut=w.datasetRecord.download.useMutation(),dt=(0,I.useCallback)(async()=>{let t=H,n=T.getState().records;if(e)try{let r=await ut.mutateAsync({projectId:C?.id??``,datasetId:e}),i=r?.columnTypes??[];t=W(i),n=Fe((r?.datasetRecords??[]).map(e=>({id:e.id,...e.entry})),i)}catch(e){x({error:e,fallbackTitle:`Couldn't download dataset`});return}let r=ye.default.unparse({fields:t.map(e=>e.name),data:n.map(e=>t.map(t=>e[t.name]??``))}),i=window.URL.createObjectURL(new Blob([r])),a=document.createElement(`a`);a.href=i;let o=`${R?.toLowerCase().replace(/ /g,`_`)??`draft_dataset`}.csv`;a.setAttribute(`download`,o),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(i)},[H,e,R,ut,C?.id,T]),ft=(0,I.useCallback)(()=>{Ke()},[Ke]);return(0,L.jsxs)(u,{align:`stretch`,gap:3,width:`full`,height:f?`full`:void 0,"data-testid":`dataset-editor-table`,children:[(0,L.jsxs)(a,{gap:3,align:`center`,width:`full`,children:[o===void 0&&R?(0,L.jsx)(c,{"data-testid":`dataset-title`,children:R}):typeof o==`string`?(0,L.jsx)(c,{size:`md`,children:o}):o,(0,L.jsxs)(l,{fontSize:`13px`,color:`fg.muted`,"data-testid":`dataset-row-count`,children:[Te(tt),` `,tt===1?`record`:`records`]}),e&&(0,L.jsx)(Le,{state:Be.state,error:Be.error}),(0,L.jsx)(S,{}),!p&&q.size>0&&(0,L.jsxs)(i,{size:`sm`,colorPalette:`red`,variant:`outline`,"data-testid":`delete-selected-rows`,onClick:()=>Ge(),children:[(0,L.jsx)(ue,{size:14}),` Delete `,q.size,` `,q.size===1?`row`:`rows`]}),!s&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(i,{size:`sm`,variant:`ghost`,"data-testid":`download-csv`,loading:ut.isLoading,onClick:()=>void dt(),children:[(0,L.jsx)(ie,{size:16}),` Download as CSV`]}),e&&(0,L.jsxs)(i,{size:`sm`,variant:`ghost`,"data-testid":`add-rows-from-csv`,onClick:()=>O.onOpen(),children:[(0,L.jsx)(le,{size:16}),` Add rows`]}),_&&(0,L.jsxs)(i,{size:`sm`,variant:`outline`,"data-testid":`edit-columns`,onClick:()=>D.onOpen(),children:[(0,L.jsx)(ae,{size:14}),` Edit columns`]})]}),te]}),(0,L.jsx)(r,{width:`full`,overflowY:`auto`,flex:f?1:void 0,maxHeight:f?void 0:`calc(100vh - 250px)`,borderWidth:`1px`,borderColor:`border.emphasized`,borderRadius:`md`,css:{..._e,"& table":{width:`100%`,borderCollapse:`separate`,borderSpacing:0,tableLayout:`fixed`},"& thead th":{position:`sticky`,top:0,zIndex:2}},children:(0,L.jsx)(ge,{value:ct,children:(0,L.jsxs)(`table`,{ref:$,"data-testid":`dataset-editor-grid`,children:[(0,L.jsxs)(`colgroup`,{children:[(0,L.jsx)(`col`,{style:{width:Me}}),H.map(e=>(0,L.jsx)(`col`,{},e.id))]}),(0,L.jsx)(`thead`,{children:at.getHeaderGroups().map(e=>(0,L.jsx)(`tr`,{children:e.headers.map(e=>(0,L.jsx)(`th`,{children:e.isPlaceholder?null:me(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,L.jsx)(`tbody`,{children:(0,L.jsx)(je,{rows:at.getRowModel().rows,scrollContainer:ot,columnCount:at.getAllColumns().length,selectedRows:q,activeDatasetId:e??`in-memory`,isLoading:!!e&&N.isLoading,shouldVirtualize:lt,disableVirtualization:!1,displayRowCount:Q})})]})})}),(0,L.jsxs)(a,{children:[$e&&(0,L.jsxs)(i,{size:`sm`,variant:`ghost`,"data-testid":`add-row`,onClick:ft,children:[(0,L.jsx)(se,{size:14}),` Add row`]}),(0,L.jsx)(S,{})]}),e&&(0,L.jsx)(Se,{page:be,pageSize:j,totalCount:tt,isLoading:N.isLoading,navDisabled:et,onPageChange:e=>{X(),A(e)},onPageSizeChange:e=>{X(),oe(e),A(1)}}),v&&(0,L.jsx)(r,{height:v,flexShrink:0}),p&&q.size>0&&(0,L.jsx)(ve,{label:`${q.size} selected`,onClear:X,testId:`dataset-selection-bar`,children:(0,L.jsxs)(i,{size:`xs`,variant:`outline`,colorPalette:`red`,"data-testid":`delete-selected-rows`,onClick:()=>Ge(),children:[(0,L.jsx)(ce,{size:14}),` Delete`]})}),D.open&&(0,L.jsx)(M,{open:D.open,onClose:D.onClose,datasetToSave:{datasetId:e,name:R??void 0,columnTypes:we},localOnly:!e,onSuccess:n=>{if(D.onClose(),e)N.refetch(),b?.(n.columnTypes);else{let e=T.getState(),r=Ee(e.records,e.columns,n.columnTypes);Xe.current={datasetId:t?.datasetId,name:n.name},e.setData({columns:W(n.columnTypes),records:r,dbDatasetId:void 0})}}}),e&&O.open&&(0,L.jsx)(Ce,{isOpen:O.open,onClose:()=>{O.onClose(),N.refetch()},datasetId:e,columnTypes:we})]})}function Ie({rowIndex:e,checked:t,onToggle:n}){return(0,L.jsxs)(g,{size:`sm`,"aria-label":`Select row ${e+1}`,checked:t,onCheckedChange:()=>n(e),onClick:e=>e.stopPropagation(),children:[(0,L.jsx)(m,{}),(0,L.jsx)(h,{})]})}function Le({state:e,error:t}){return e===`saving`?(0,L.jsxs)(a,{gap:1,color:`fg.muted`,"data-testid":`save-status-saving`,children:[(0,L.jsx)(n,{size:`xs`}),(0,L.jsx)(l,{fontSize:`12px`,children:`Saving…`})]}):e===`saved`?(0,L.jsxs)(a,{gap:1,color:`green.fg`,"data-testid":`save-status-saved`,children:[(0,L.jsx)(k,{size:13}),(0,L.jsx)(l,{fontSize:`12px`,children:`Saved`})]}):e===`error`?(0,L.jsx)(f,{content:t??`Unknown error`,children:(0,L.jsxs)(a,{gap:1,color:`red.fg`,"data-testid":`save-status-error`,children:[(0,L.jsx)(ue,{size:13}),(0,L.jsx)(l,{fontSize:`12px`,children:`Failed to save`})]})}):null}export{Oe as i,je as n,ke as r,K as t};
2
- //# sourceMappingURL=DatasetEditorTable-BLbB_Sn-.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,fn as 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"./api-l6Cnm0vQ.js";import{Mr as u,Vt as d,lt as f}from"./index-CPtTUYLD.js";import{t as p}from"./database-BBiIYDDI.js";import{t as m}from"./search-dG0R10px.js";import{t as h}from"./record-count-C2ru-dV5.js";var g=e(t()),_=o();function v({enabled:e=!0,onSelect:t}){let{project:i}=d(),[o,s]=(0,g.useState)(``),u=l.dataset.getAll.useQuery({projectId:i?.id??``},{enabled:!!i?.id&&e}),f=(0,g.useMemo)(()=>{if(!u.data)return[];let e=u.data.filter(e=>e.status===`ready`||e.status==null),t=o.toLowerCase().trim();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[u.data,o]);return(0,_.jsxs)(c,{gap:4,align:`stretch`,flex:1,overflow:`hidden`,width:`full`,children:[(0,_.jsx)(y,{value:o,onChange:s}),(0,_.jsx)(c,{gap:2,align:`stretch`,flex:1,overflowY:`auto`,children:u.isLoading?(0,_.jsx)(a,{justify:`center`,paddingY:8,children:(0,_.jsx)(n,{size:`md`})}):f.length===0?(0,_.jsx)(r,{paddingY:8,textAlign:`center`,color:`fg.muted`,children:o?`No datasets match your search`:`No datasets found in this project`}):f.map(e=>(0,_.jsx)(b,{name:e.name,columnCount:e.columnTypes.length,entryCount:h(e),updatedAt:e.updatedAt,onClick:()=>t({datasetId:e.id,name:e.name,columnTypes:e.columnTypes})},e.id))})]})}function y({value:e,onChange:t}){return(0,_.jsxs)(r,{position:`relative`,children:[(0,_.jsx)(r,{position:`absolute`,left:3,top:`50%`,transform:`translateY(-50%)`,color:`fg.subtle`,zIndex:1,children:(0,_.jsx)(m,{size:16})}),(0,_.jsx)(u,{placeholder:`Search datasets...`,"data-testid":`dataset-picker-search`,value:e,onChange:e=>t(e.target.value),paddingLeft:10})]})}function b({name:e,columnCount:t,entryCount:n,updatedAt:o,onClick:l}){return(0,_.jsx)(i.button,{type:`button`,onClick:l,padding:4,borderRadius:`md`,border:`1px solid`,borderColor:`border`,bg:`bg.panel`,textAlign:`left`,width:`full`,_hover:{borderColor:`blue.muted`,bg:`blue.subtle`},transition:`all 0.15s`,"data-testid":`dataset-card-${e}`,children:(0,_.jsxs)(a,{gap:3,children:[(0,_.jsx)(r,{color:`blue.fg`,children:(0,_.jsx)(p,{size:20})}),(0,_.jsxs)(c,{align:`start`,gap:0,flex:1,children:[(0,_.jsx)(s,{fontWeight:`medium`,fontSize:`sm`,children:e}),(0,_.jsxs)(a,{gap:2,fontSize:`xs`,color:`fg.muted`,children:[(0,_.jsxs)(s,{children:[n,` entries`]}),(0,_.jsx)(s,{children:`•`}),(0,_.jsxs)(s,{children:[t,` columns`]}),(0,_.jsx)(s,{children:`•`}),(0,_.jsxs)(s,{children:[`Updated`,` `,f(new Date(o),{addSuffix:!0})]})]})]})]})})}export{v as t};
2
- //# sourceMappingURL=DatasetPickerList-CDIBTAQW.js.map
@@ -1,2 +0,0 @@
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{i as o,n as s,s as c}from"./grid-DVy6ELOp.js";import{i as l,n as u,r as d,t as f}from"./lib-epD9Y2nV.js";import{t as p}from"./ColumnTypeIcon-Bh1MI0_N.js";import{i as m,n as h,r as g,t as _}from"./TableCell-Cbtwk2YR.js";var v=e(t()),y=i(),b=36,x=48,S=e=>e==null?``:typeof e==`string`?e:JSON.stringify(e);function C({rows:e,columns:t,maxColumns:i=8,maxHeight:C,background:w,isSelectable:T=!1,onToggleRow:E,onToggleAll:D,onCellEdit:O,onRowClick:k,editorPortalRef:A}){let j=(0,v.useMemo)(()=>t.slice(0,i).map((e,t)=>({id:`${e.name}_${t}`,name:e.name,type:e.type})),[t,i]),M=(0,v.useMemo)(()=>e.map((e,t)=>{let n=Object.fromEntries(j.map(t=>[t.id,S(e[t.name])]));return{rowIndex:t,dataset:n,isEmpty:Object.values(n).every(e=>e===``)}}),[e,j]),[N,P]=(0,v.useState)(void 0),[F,I]=(0,v.useState)(void 0),[L,R]=(0,v.useState)(()=>new Set),z=T&&e.length>0&&e.every(e=>!!e.isSelected),B=(0,v.useMemo)(()=>({rowHeightMode:`compact`,expandedCells:L,editingCell:F,selectedCell:N,setCellValue:(e,t,n,r)=>{let i=j.find(e=>e.id===n);if(!i)return;let a=r;if(h.includes(i.type))try{a=JSON.parse(r)}catch{}O?.(t,i.name,a)},setEditingCell:O?I:()=>void 0,setSelectedCell:P,toggleCellExpanded:(e,t)=>{R(n=>{let r=new Set(n),i=`${e}-${t}`;return r.has(i)?r.delete(i):r.add(i),r})},toggleRowSelection:t=>{E?.(t,!e[t]?.isSelected)},editorPortalRef:A}),[L,F,N,j,O,E,e,A]),V=(0,v.useMemo)(()=>d(),[]),H=u({data:M,columns:(0,v.useMemo)(()=>{let t=[];T?t.push(V.display({id:`select`,header:()=>(0,y.jsxs)(c,{size:`sm`,top:`1px`,"aria-label":`Select all rows`,checked:z,onCheckedChange:()=>D?.(!z),children:[(0,y.jsx)(o,{}),(0,y.jsx)(s,{})]}),cell:t=>(0,y.jsxs)(c,{size:`sm`,"aria-label":`Select row ${t.row.index+1}`,checked:!!e[t.row.index]?.isSelected,onCheckedChange:()=>E?.(t.row.index,!e[t.row.index]?.isSelected),onClick:e=>e.stopPropagation(),children:[(0,y.jsx)(o,{}),(0,y.jsx)(s,{})]}),size:b,enableResizing:!1,meta:{columnType:`checkbox`,columnId:`__checkbox__`}})):t.push(V.display({id:`rowNumber`,header:()=>(0,y.jsx)(a,{fontSize:`13px`,color:`fg.muted`,children:`#`}),cell:e=>(0,y.jsx)(a,{fontSize:`13px`,color:`fg.muted`,children:e.row.index+1}),size:x,enableResizing:!1}));for(let e of j)t.push(V.accessor(t=>t.dataset[e.id],{id:`dataset.${e.id}`,header:()=>(0,y.jsxs)(r,{gap:1,children:[(0,y.jsx)(p,{type:e.type}),(0,y.jsx)(a,{fontSize:`13px`,fontWeight:`medium`,children:e.name})]}),cell:e=>e.getValue(),meta:{columnType:`dataset`,columnId:e.id,dataType:e.type}}));return t},[V,j,T,z,e,D,E]),getCoreRowModel:l()});return(0,y.jsx)(n,{width:`full`,maxHeight:C,overflowY:`auto`,background:w,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,css:{...g,"& table":{width:`100%`,borderCollapse:`separate`,borderSpacing:0,tableLayout:`fixed`},"& thead th":{position:`sticky`,top:0,zIndex:2},"& tbody tr:last-child td:first-child":{borderBottomLeftRadius:`var(--chakra-radii-md)`},"& tbody tr:last-child td:last-child":{borderBottomRightRadius:`var(--chakra-radii-md)`}},children:(0,y.jsx)(m,{value:B,children:(0,y.jsxs)(`table`,{"data-testid":`dataset-preview-table`,children:[(0,y.jsxs)(`colgroup`,{children:[(0,y.jsx)(`col`,{style:{width:T?b:x}}),j.map(e=>(0,y.jsx)(`col`,{},e.id))]}),(0,y.jsx)(`thead`,{children:H.getHeaderGroups().map(e=>(0,y.jsx)(`tr`,{children:e.headers.map(e=>(0,y.jsx)(`th`,{children:e.isPlaceholder?null:f(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,y.jsx)(`tbody`,{children:H.getRowModel().rows.map(t=>(0,y.jsx)(`tr`,{"data-index":t.index,"data-selected":e[t.index]?.isSelected?`true`:void 0,onClick:k?()=>k(t.index):void 0,style:k?{cursor:`pointer`}:void 0,children:t.getVisibleCells().map(e=>(0,y.jsx)(_,{cell:e,rowIndex:t.index,activeDatasetId:`preview`},e.id))},t.id))})]})})})}export{C as t};
2
- //# sourceMappingURL=DatasetPreviewTable-UuBrd6hv.js.map
@@ -1,2 +0,0 @@
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{p as i,t as a}from"./select-D17PWjH9.js";import{t as o}from"./field-BadoNaN5.js";import{t as s}from"./HorizontalFormControl-lYiaIlzD.js";var c=e(t()),l=r();function u({datasets:e,localStorageDatasetId:t,errors:r,setValue:u,onCreateNew:d}){let f=i({items:e?.map(e=>({label:e.name,value:e.id}))??[]}),[p,m]=(0,c.useState)(t?[t]:[]);return(0,c.useEffect)(()=>{m(t?[t]:[])},[t]),(0,l.jsxs)(s,{label:`Dataset`,helper:`Add to an existing dataset or create a new one`,invalid:!!r.datasetId,children:[(0,l.jsxs)(a.Root,{collection:f,value:p,onValueChange:e=>{let t=e.value[0]??``;m(e.value),u(`datasetId`,t)},children:[(0,l.jsx)(a.Trigger,{children:(0,l.jsx)(a.ValueText,{placeholder:`Select Dataset`})}),(0,l.jsx)(a.Content,{portalled:!1,children:f.items.map(e=>(0,l.jsx)(a.Item,{item:e,children:e.label},e.value))})]}),r.datasetId&&(0,l.jsx)(o,{children:r.datasetId.message}),(0,l.jsx)(n,{colorPalette:`blue`,onClick:()=>{m([]),u(`datasetId`,``),d()},minWidth:`fit-content`,variant:`plain`,marginTop:2,fontWeight:`normal`,children:`+ Create New`})]})}export{u as t};
2
- //# sourceMappingURL=DatasetSelector-DJI4ZOko.js.map
@@ -1,2 +0,0 @@
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-gjZ4s2dt.js";import{n as l}from"./toaster-BsYkODqs.js";import{n as u}from"./personalProject-DMRX2-SI.js";import{t as d}from"./errors-e711UMq7.js";import{$ as f,et as p}from"./immer-CFru3D02.js";import{n as m}from"./api-l6Cnm0vQ.js";import{t as h}from"./ScopeChipPicker-B3xHf0Ii.js";import{Vt as g,W as _}from"./index-CPtTUYLD.js";import{c as v,l as y}from"./registry-B64xvGV5.js";import{r as b}from"./constants-c0j3xvrs.js";import{r as x}from"./ModelSelector-4R-dc-Ny.js";import{t as S}from"./latestAliases-BsL8GXW2.js";import{n as C}from"./ProviderModelSelector-Cg5Lbc1U.js";var w=e(t()),T=a(),E=[`DEFAULT`,`FAST`,`LANGY`,`EMBEDDINGS`],D={DEFAULT:`Default`,FAST:`Fast`,LANGY:`Langy`,EMBEDDINGS:`Embeddings`},O={DEFAULT:`Picked when a prompt or evaluator is created, and any high-stakes call without a specific override.`,FAST:`Background and assistive surfaces like search, autocomplete, commit messages, topic clustering.`,LANGY:`The model Langy chats and works with.`,EMBEDDINGS:`Semantic vectors used by topic clustering and similar features.`};function k({options:e,role:t}){return e.filter(e=>v(e,t))}function A({options:e,featureKey:t}){return e.filter(e=>y({modelId:e,featureKey:t}))}function j({editingId:e}){let t=m.useContext(),n=m.modelProvider.saveDefaultModelsConfig.useMutation(),{project:a}=g(),{closeDrawer:o}=_(),c=m.modelProvider.getDefaultModelsForProject.useQuery({projectId:a?.id??``},{enabled:!!a?.id}),f=e?c.data?.configs.find(t=>t.id===e):void 0,p=c.data?.available??{organization:null,teams:[],projects:[]},h=c.data?.features??[],v=c.data?.effective??{DEFAULT:null,FAST:null,LANGY:null,EMBEDDINGS:null},y=o,C=()=>{},[D,O]=(0,w.useState)([]),[k,A]=(0,w.useState)({}),[j,N]=(0,w.useState)({DEFAULT:!1,FAST:!1,LANGY:!1,EMBEDDINGS:!1}),[P,I]=(0,w.useState)(!1);(0,w.useEffect)(()=>{f?(O(f.scopes.map(e=>({scopeType:e.type,scopeId:e.id}))),A({...f.config})):(O([]),A({})),N({DEFAULT:!1,FAST:!1,LANGY:!1,EMBEDDINGS:!1})},[!0,f]);let L=m.modelProvider.getInheritedValuesForScopes.useQuery({projectId:a?.id??``,scopes:D.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId})),excludeConfigId:f?.id},{enabled:!!a?.id&&D.length>0&&!0}).data?.inherited??{},R=(0,w.useMemo)(()=>{let e={DEFAULT:[],FAST:[],LANGY:[],EMBEDDINGS:[]};for(let t of h)e[t.role]?.push(t);return e},[h]),z=m.modelProvider.listAllForProjectForFrontend.useQuery({projectId:a?.id??``},{enabled:!!a?.id&&!0,refetchOnMount:!1}),B=(0,w.useMemo)(()=>{let e=z.isLoading,t=z.isError,n=(z.data?.providers??[]).filter(e=>e.enabled===!0).map(e=>[e.provider,e]),r=new Set(n.map(([e])=>e)),i=[];for(let e of S)r.has(e)&&(i.push(`${e}/latest`),i.push(`${e}/latest-mini`));let a=i=>{if(e)return x.filter(e=>e.mode===i).map(e=>e.value);if(t||n.length===0)return[];let a=x.filter(e=>{if(e.mode!==i)return!1;let t=e.value.split(`/`)[0]??``;return r.has(t)}).map(e=>e.value),o=[];for(let[e,t]of n){if(!t)continue;let n=i===`embedding`?t.customEmbeddingsModels??[]:t.customModels??[];for(let t of n)t?.modelId&&o.push(`${e}/${t.modelId}`)}return Array.from(new Set([...o,...a]))},o=a(`chat`);return{DEFAULT:[...i,...o],FAST:[...i,...o],LANGY:[...i,...o],EMBEDDINGS:a(`embedding`)}},[z.data]),V=(0,w.useMemo)(()=>b(z.data?.providers??[]),[z.data]),H=(0,w.useCallback)((e,t)=>{A(n=>{let r={...n};return t===null||t===``||t===`__inherit__`?delete r[e]:r[e]=t,r})},[]),U=D.length>0&&!P,W=(0,w.useCallback)(async()=>{if(U){I(!0);try{await n.mutateAsync({id:f?.id,config:k,scopes:D.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId}))}),await Promise.all([t.modelProvider.getDefaultModelsForProject.invalidate(),t.modelProvider.getResolvedDefault.invalidate()]),l.create({title:f?`Config updated`:`Config added`,type:`success`,duration:2500,meta:{closable:!0}}),y()}catch(e){d({error:e,fallbackTitle:f?`Couldn't save the default model`:`Couldn't add the default model`})}finally{I(!1)}}},[U,n,f,k,D,t,C,y]);return(0,T.jsx)(u.Root,{open:!0,onOpenChange:e=>{e.open||y()},size:`md`,children:(0,T.jsxs)(u.Content,{"data-testid":`default-model-override-drawer`,portalled:!1,children:[(0,T.jsxs)(u.Header,{children:[(0,T.jsx)(u.Title,{children:f?`Edit default models`:`Add default models`}),(0,T.jsx)(u.CloseTrigger,{})]}),(0,T.jsx)(u.Body,{children:(0,T.jsxs)(s,{align:`stretch`,gap:5,children:[(0,T.jsx)(F,{scopes:D,onChange:O,available:p}),(0,T.jsx)(s,{align:`stretch`,gap:2,children:E.map(e=>(0,T.jsx)(M,{role:e,config:k,features:R[e],effective:v[e],inheritedForRole:L[e]??null,inheritedForFeature:L,expanded:j[e],onToggleExpand:()=>N(t=>({...t,[e]:!t[e]})),modelOptions:B[e],onSetOverride:H,displayNames:V},e))})]})}),(0,T.jsx)(u.Footer,{children:(0,T.jsxs)(i,{width:`full`,justify:`flex-end`,gap:2,children:[(0,T.jsx)(r,{variant:`outline`,size:`sm`,onClick:y,children:`Cancel`}),(0,T.jsx)(r,{colorPalette:`orange`,size:`sm`,onClick:W,disabled:!U,loading:P,"data-testid":`config-save`,children:f?`Save changes`:`Add config`})]})})]})})}function M({role:e,config:t,features:r,effective:a,inheritedForRole:l,inheritedForFeature:u,expanded:d,onToggleExpand:m,modelOptions:h,onSetOverride:g,displayNames:_}){let v=t[e]??``,y=l?.model??a?.model,b=P(l,a),x=r.length>0,S=d?p:f,w=e===`EMBEDDINGS`&&h.length===0;return(0,T.jsxs)(n,{"data-testid":`role-row-${e.toLowerCase()}`,width:`full`,"data-unsupported-at-scope":w||void 0,children:[(0,T.jsxs)(i,{gap:2,align:`center`,paddingY:1,opacity:w?.55:1,children:[(0,T.jsx)(c,{content:O[e],children:(0,T.jsx)(n,{flexShrink:0,cursor:`help`,"data-testid":`role-row-${e.toLowerCase()}-label`,children:(0,T.jsx)(o,{fontWeight:`medium`,fontSize:`sm`,children:D[e]})})}),(0,T.jsx)(n,{flex:1}),(0,T.jsx)(n,{width:`240px`,flexShrink:0,children:(0,T.jsx)(C,{model:v,options:k({options:h,role:e}),onChange:t=>g(e,t),inheritOption:b,disabled:w,displayNames:_})}),x?(0,T.jsx)(n,{as:`button`,onClick:m,cursor:`pointer`,color:`fg.muted`,flexShrink:0,padding:1,"data-testid":`role-row-${e.toLowerCase()}-expand`,children:(0,T.jsx)(S,{size:16})}):(0,T.jsx)(n,{width:`24px`,flexShrink:0})]}),w&&(0,T.jsx)(o,{fontSize:`xs`,color:`fg.muted`,paddingLeft:1,paddingBottom:1,"data-testid":`role-row-embeddings-unsupported-hint`,children:`No provider configured at this scope ships an embedding API. Add an embedding-capable provider (OpenAI, Voyage, Cohere) to unlock topic clustering and semantic search.`}),x&&d&&(0,T.jsx)(s,{align:`stretch`,gap:1,paddingLeft:4,paddingBottom:1,"data-testid":`role-row-${e.toLowerCase()}-features`,children:r.map(n=>(0,T.jsx)(N,{feature:n,override:t[n.key]??``,roleLevelOverride:t[e]??``,inheritedForFeature:u[n.key]??null,inheritedForRole:l,inheritedRoleModel:y,modelOptions:h,onSetOverride:g,displayNames:_},n.key))})]})}function N({feature:e,override:t,roleLevelOverride:r,inheritedForFeature:a,inheritedForRole:s,inheritedRoleModel:l,modelOptions:u,onSetOverride:d,displayNames:f}){let p;return p=r?{model:r,label:`Inherit (role default in this config)`}:P(a,null)??P(s,null)??(l?{model:l,label:`Inherit (role default)`}:void 0),(0,T.jsxs)(i,{gap:2,align:`center`,"data-testid":`feature-row-${e.key}`,children:[(0,T.jsx)(c,{content:e.description,children:(0,T.jsx)(n,{flexShrink:0,cursor:`help`,children:(0,T.jsx)(o,{fontSize:`sm`,children:e.displayName})})}),(0,T.jsx)(n,{flex:1}),(0,T.jsx)(n,{width:`240px`,flexShrink:0,children:(0,T.jsx)(C,{model:t,options:A({options:u,featureKey:e.key}),onChange:t=>d(e.key,t),inheritOption:p??void 0,displayNames:f})}),(0,T.jsx)(n,{width:`24px`,flexShrink:0})]})}function P(e,t){if(e)return e.source===`inferred`?void 0:{model:e.model,label:e.scope?`Inherit (from ${e.scope})`:`Inherit`};if(t)return t.source===`system`?void 0:{model:t.model,label:t.scope?`Inherit (from ${t.scope})`:`Inherit`}}function F({scopes:e,onChange:t,available:n}){return(0,T.jsx)(h,{value:e,onChange:t,organizationId:n.organization?.id,organizationName:n.organization?.name,availableTeams:n.teams,availableProjects:n.projects})}export{j as DefaultModelOverrideDrawer,A as featureRowModelOptions,k as roleSelectModelOptions};
2
- //# sourceMappingURL=DefaultModelOverrideDrawer-DfGbPivl.js.map
@@ -1,2 +0,0 @@
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,t as a}from"./v-stack-hkuSkmCA.js";import{Mr as o,St as s}from"./index-CPtTUYLD.js";var c=e(t()),l=r();function u({title:e=`Are you really sure?`,description:t=`There is no going back, so if you're sure you want to delete this annotation score, type 'delete' below:`,open:r,onClose:u,onConfirm:d}){let[f,p]=(0,c.useState)(``),m=(0,c.useRef)(null);return(0,c.useEffect)(()=>{p(``)},[r]),(0,l.jsx)(s.Root,{open:r,onOpenChange:u,placement:`center`,initialFocusEl:()=>m.current,children:(0,l.jsxs)(s.Content,{bg:`bg`,children:[(0,l.jsx)(s.CloseTrigger,{}),(0,l.jsx)(s.Header,{children:(0,l.jsx)(s.Title,{fontSize:`md`,fontWeight:`500`,children:e})}),(0,l.jsx)(s.Body,{children:(0,l.jsxs)(a,{align:`start`,gap:4,children:[(0,l.jsx)(i,{children:t}),(0,l.jsx)(o,{placeholder:`Type 'delete' to confirm`,value:f,autoFocus:!0,onChange:e=>{e.stopPropagation(),p(e.target.value)},ref:m,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&f.toLowerCase()===`delete`&&(d(),u())}})]})}),(0,l.jsxs)(s.Footer,{children:[(0,l.jsx)(n,{variant:`outline`,mr:3,onClick:e=>{e.stopPropagation(),u()},children:`Cancel`}),(0,l.jsx)(n,{colorPalette:`red`,onClick:e=>{e.stopPropagation(),f.toLowerCase()===`delete`&&(d(),u())},disabled:f.toLowerCase()!==`delete`,children:`Delete`})]})]})})}export{u as t};
2
- //# sourceMappingURL=DeleteConfirmationDialog-w7WZ7lHP.js.map
@@ -1,2 +0,0 @@
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";import{t as a}from"./tooltip-gjZ4s2dt.js";import{t as o}from"./icon-D6xQEiPb.js";import{Pt as s,t as c}from"./index-CPtTUYLD.js";import{t as l}from"./book-open-d9AKoJH3.js";import{t as u}from"./external-link-D1QPrDiK.js";var d={xs:`12px`,sm:`16px`,md:`24px`,lg:`32px`,xl:`40px`,"2xl":`48px`},f=n();function p(t){let{label:n,size:o=`md`,icon:c,iconSize:l,selected:u,onClick:p,ariaLabel:m,badge:h}=t,g=c?.type===`with-label`?c.icon:c,_=c?.type===`with-label`?c.label:void 0,v=d[l??`md`]??`24px`,y=s(g?.type===`themed`?g.lightSrc:``,g?.type===`themed`?g.darkSrc:``),b=s(`orange.400`,`orange.800`),x=s(`orange.50`,`orange.950/30`),S=s(!1,!0),C=g?.type===`themed`?y:g?.src,w=g?.alt,T=o===`sm`?`72px`:`96px`;return(0,f.jsx)(a,{content:n,positioning:{placement:`bottom`},showArrow:!0,openDelay:0,children:(0,f.jsxs)(e,{role:`button`,tabIndex:0,"aria-label":h?`${m}, ${h}`:m,"aria-pressed":u,onClick:p,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p())},cursor:`pointer`,position:`relative`,w:T,h:T,flexShrink:0,borderRadius:`lg`,borderWidth:S?`1px`:u?`2px`:`1px`,borderStyle:`solid`,borderColor:u?b:`border.subtle`,bg:u?x:`bg.panel`,boxShadow:u?S?`0 6px 28px rgba(237,137,38,0.06)`:`0 0 0 1px var(--chakra-colors-orange-100)`:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,_hover:{borderColor:u?S?`orange.emphasized`:b:`border.emphasized`,bg:u?x:S?`bg.muted`:`gray.50`,boxShadow:u?S?`0 6px 28px rgba(237,137,38,0.06)`:`0 0 0 1px var(--chakra-colors-orange-100)`:`sm`,transform:`translateY(-1px)`},children:[h?(0,f.jsx)(r,{position:`absolute`,top:`-8px`,left:`50%`,transform:`translateX(-50%)`,fontSize:`9px`,fontWeight:`600`,letterSpacing:`0.02em`,lineHeight:`1`,paddingX:1.5,paddingY:`3px`,borderRadius:`full`,background:`orange.solid`,color:`white`,whiteSpace:`nowrap`,pointerEvents:`none`,children:h}):null,(0,f.jsx)(i,{gap:+!!_,align:`center`,justify:`center`,style:{filter:u?`grayscale(0%)`:`grayscale(100%)`,transition:`filter 0.2s ease`},children:c?(0,f.jsxs)(f.Fragment,{children:[C?(0,f.jsx)(`img`,{src:C,alt:w,style:{width:v,height:v,objectFit:`contain`,display:`block`}}):(0,f.jsx)(e,{w:v,h:v,"aria-hidden":!0}),_&&(0,f.jsx)(r,{textStyle:o===`sm`?`2xs`:`xs`,fontWeight:`medium`,color:`fg.muted`,textAlign:`center`,lineHeight:`tight`,children:_})]}):(0,f.jsx)(r,{textStyle:`sm`,fontWeight:`normal`,color:`fg.muted`,textAlign:`center`,children:n})})]})})}function m({docs:e,label:n}){return!e||!e.internal&&!e.external?null:(0,f.jsxs)(t,{gap:3,color:`fg.muted`,fontSize:`xs`,justify:`flex-start`,align:`center`,pt:1,children:[e.internal&&(0,f.jsx)(c,{href:`https://docs.langwatch.ai${e.internal}`,isExternal:!0,children:(0,f.jsxs)(t,{gap:1,_hover:{color:`fg`},transition:`color 0.2s`,children:[(0,f.jsx)(o,{size:`xs`,children:(0,f.jsx)(l,{size:12})}),(0,f.jsx)(r,{children:`LangWatch Docs`})]})}),e.internal&&e.external?(0,f.jsx)(r,{"aria-hidden":!0,children:`•`}):null,e.external&&(0,f.jsx)(c,{href:e.external,isExternal:!0,children:(0,f.jsxs)(t,{gap:1,_hover:{color:`fg`},transition:`color 0.2s`,children:[(0,f.jsx)(o,{size:`xs`,children:(0,f.jsx)(u,{size:12})}),(0,f.jsxs)(r,{children:[n,` Docs`]})]})})]})}export{p as n,m as t};
2
- //# sourceMappingURL=DocsLinks-vsvIA7dY.js.map
@@ -1,2 +0,0 @@
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"./skeleton-0JSrjbwm.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{Mt as l,mn as u}from"./ProjectAvatar-DtI9dT1f.js";import{t as d}from"./tooltip-gjZ4s2dt.js";import{a as f,r as p}from"./field-BadoNaN5.js";import{i as m,t as h}from"./alert-CPsXih3K.js";import{n as g,r as _,t as v}from"./native-select-DL2k8x0o.js";import{t as y}from"./spacer-C38e7o6r.js";import{s as b,tt as x}from"./immer-CFru3D02.js";import{n as S}from"./api-l6Cnm0vQ.js";import{a as C,n as ee,r as w,t as T}from"./PropertySectionTitle-Da2IdhM3.js";import{c as E,o as D,t as O,u as k}from"./index.esm-Cpy5fWo1.js";import{Mr as A,Vt as te,an as j,cn as M,dn as N,ln as P,nn as F,rn as ne,sn as re,t as ie,tn as ae,un as I}from"./index-CPtTUYLD.js";import{t as L}from"./info-DRDUmL_M.js";import{t as oe}from"./plus-10dP8Fmk.js";import{t as se}from"./trash-2-Bq5tW_xF.js";import{t as R}from"./x-ePIIvo_k.js";import{i as z,n as B}from"./stringCasing-Cx6SsTTf.js";import{t as V}from"./HorizontalFormControl-lYiaIlzD.js";import{t as H}from"./switch-DGatWO8v.js";import{t as U}from"./SmallLabel-Dh74EKHT.js";import{n as W}from"./getEvaluator-irVFciCL.js";import{a as G,i as K,n as q,t as ce}from"./ModelSelector-4R-dc-Ny.js";var J=e(t()),Y=a(),X=({runWhat:e,nodeProvidersWithoutCustomKeys:t})=>(0,Y.jsx)(m,{status:`warning`,children:(0,Y.jsx)(h,{children:(0,Y.jsxs)(c,{align:`start`,width:`full`,children:[(0,Y.jsx)(i,{paddingBottom:3,children:(0,Y.jsxs)(s,{children:[`You need to set up your own API keys for the following providers to be able to `,e,`:`]})}),(0,Y.jsx)(c,{align:`start`,width:`full`,gap:3,children:t.map(e=>(0,Y.jsxs)(i,{width:`full`,children:[(0,Y.jsx)(n,{height:6,width:6,children:b[e]}),(0,Y.jsx)(s,{color:`fg`,children:z(e)}),(0,Y.jsx)(y,{}),(0,Y.jsx)(ie,{href:`/settings/model-providers`,isExternal:!0,children:(0,Y.jsx)(r,{colorPalette:`orange`,size:`sm`,children:`Add keys`})})]},e))})]})})}),Z=[`model`,`max_tokens`,`temperature`,`top_p`,`frequency_penalty`,`presence_penalty`,`seed`,`top_k`,`min_p`,`repetition_penalty`,`reasoning`,`verbosity`],Q=({prefix:e})=>{let{setValue:t,control:r}=E(),a=k({control:r,name:Z.map(t=>`${e}.${t}`)}),s=(0,J.useMemo)(()=>{let e={};return Z.forEach((t,n)=>{let r=a[n];r!==void 0&&(e[t]=r)}),e.model=e.model??``,e},[a]),c=(0,J.useCallback)(n=>{let r=new Map;for(let[e,t]of Object.entries(n))r.set(C(e),t);for(let n of Z)t(`${e}.${n}`,r.get(n),{shouldDirty:!0})},[e,t]),{isEmpty:d,isLoading:f}=K(q,s.model,`chat`);return f?(0,Y.jsx)(o,{width:`full`,height:`40px`,borderRadius:`md`}):d?(0,Y.jsx)(G,{size:`sm`}):(0,Y.jsxs)(l.Root,{positioning:{placement:`bottom-start`},children:[(0,Y.jsx)(l.Trigger,{asChild:!0,children:(0,Y.jsxs)(i,{width:`full`,paddingY:2,paddingX:3,borderRadius:`md`,border:`1px solid`,borderColor:`border`,cursor:`pointer`,_hover:{bg:`gray.50`},transition:`background 0.15s`,justify:`space-between`,children:[(0,Y.jsx)(ee,{model:s.model}),(0,Y.jsx)(n,{color:`fg.muted`,children:(0,Y.jsx)(u,{size:16})})]})}),(0,Y.jsx)(w,{values:s,onChange:c})]})},le=({selectorOptions:e,field:t,fieldName:n,variant:r})=>{let{modelOption:i}=K(e,t.value,n===`model`?`chat`:`embedding`),a=i?.isDisabled??!1;return(0,Y.jsxs)(c,{align:`start`,width:`full`,children:[(0,Y.jsx)(ce,{options:e,model:t.value,onChange:e=>t.onChange(e),mode:n===`model`?`chat`:`embedding`,size:r===`studio`?`sm`:`md`}),a&&(0,Y.jsx)(X,{runWhat:`run this evaluation`,nodeProvidersWithoutCustomKeys:[t.value.split(`/`)[0]??`unknown`]})]})},$={swap_and_confirm:{helper:`Run two judge calls with A/B positions swapped; tie on disagreement. Doubles judge cost.`,tooltip:`Studies show that swapping can reduce position bias from 68% to 51% (PandaLM paper).`}},ue={cost:{label:`Cost`,tooltip:`Per-candidate model spend (USD), summed across the candidate's run. Injected so the judge can prefer cheaper options when quality is comparable. Use cautiously — judges may over-weight cost.`},duration:{label:`Duration`,tooltip:`Per-candidate wall-clock latency (ms) for this row's call. For aggregate views, p95 is reported in the leaderboard — the value sent to the judge here is the single-row time.`}},de=({fieldName:e,options:t,variant:r})=>{let{control:a}=E();return(0,Y.jsx)(O,{name:e,control:a,defaultValue:[],render:({field:{value:e,onChange:a}})=>{let o=Array.isArray(e)?e:[],s=e=>{a(o.includes(e)?o.filter(t=>t!==e):[...o,e])};return(0,Y.jsx)(c,{align:`start`,gap:2,width:`full`,children:t.map(e=>{let t=ue[e]??{label:e,tooltip:e},a=o.includes(e);return(0,Y.jsxs)(i,{gap:2,width:`full`,children:[(0,Y.jsx)(H,{id:`metric-${e}`,checked:a,onCheckedChange:({checked:t})=>{t!==a&&s(e)},size:r===`studio`?`sm`:`md`}),(0,Y.jsxs)(p,{htmlFor:`metric-${e}`,marginBottom:`0`,fontWeight:r===`studio`?400:void 0,fontSize:r===`studio`?`13px`:void 0,cursor:`pointer`,children:[`Include `,t.label.toLowerCase()]}),(0,Y.jsx)(d,{content:t.tooltip,showArrow:!0,positioning:{placement:`top`},children:(0,Y.jsx)(n,{as:`span`,display:`inline-flex`,color:`fg.subtle`,_hover:{color:`fg.muted`},cursor:`help`,children:(0,Y.jsx)(L,{size:14})})})]},e)})})}})},fe=({fieldSchema:e,fieldName:t,prefix:a,evaluator:o,variant:s=`default`,renderField:l})=>{let{control:u}=E(),{fields:d,append:f,remove:p}=D({control:u,name:a?`${a}.${t}`:t}),m=e,h=(0,J.useMemo)(()=>m.element instanceof M?Object.fromEntries(Object.entries(m.element.shape).flatMap(([e,t])=>t instanceof N&&t.options.length>0?[[e,t.options[0].value]]:[])):{},[m.element]);return(0,Y.jsxs)(c,{align:`start`,width:`full`,children:[s===`studio`&&(0,Y.jsx)(r,{position:`absolute`,right:0,top:`-36px`,padding:0,size:`sm`,variant:`ghost`,onClick:()=>f(h),children:(0,Y.jsx)(oe,{size:16})}),d.map((e,a)=>(0,Y.jsx)(n,{borderLeft:m.element instanceof M?`4px solid`:void 0,borderLeftColor:s===`studio`?`border`:`orange.400`,width:`full`,children:(0,Y.jsxs)(i,{borderLeftColor:`reset`,padding:m.element instanceof M?3:0,paddingRight:s===`studio`?0:3,width:`full`,align:`start`,position:`relative`,children:[(0,Y.jsx)(r,{position:`absolute`,right:0,top:0,padding:0,size:`sm`,variant:`ghost`,onClick:()=>p(a),color:`fg.subtle`,children:s===`studio`?(0,Y.jsx)(se,{size:14}):(0,Y.jsx)(R,{size:18})}),(0,Y.jsx)(n,{width:s===`studio`?`100%`:`95%`,children:l(m.element,`${t}.${a}`,o)})]})},e.id)),s!==`studio`&&(0,Y.jsx)(r,{onClick:()=>f(h),children:`Add`})]})},pe=({schema:e,evaluatorType:t,prefix:n,errors:r,variant:a=`default`,onlyFields:o,skipFields:l})=>{let{control:u,register:m}=E(),{project:h}=te(),y=S.modelProvider.getResolvedDefault.useQuery({projectId:h?.id??``,featureKey:`prompt.create_default`},{enabled:!!h?.id}),b=S.modelProvider.getResolvedDefault.useQuery({projectId:h?.id??``,featureKey:`analytics.topic_clustering_embeddings`},{enabled:!!h?.id}),C=(e,t,r,o=!1)=>{let s=n?`${n}.${t}`:t,l=r?.settings?.[t]?.default;t===`model`&&(l=y.data?.model??``),t===`embeddings_model`&&(l=b.data?.model??``);let d=e instanceof P?e.unwrap():e,h=t.split(`.`).toReversed()[0]??``;if(d instanceof ne)return C(d._def.innerType,t,r,o);if(d instanceof re)return(0,Y.jsx)(A,{type:`number`,size:a===`studio`?`sm`:`md`,step:typeof l==`number`&&Math.round(l)!=l?`0.01`:`1`,...m(s,{setValueAs:e=>+e})});if(d instanceof F)return(0,Y.jsx)(f,{children:(0,Y.jsxs)(i,{width:`full`,gap:2,children:[(0,Y.jsx)(O,{name:s,control:u,render:({field:{onChange:e,onBlur:t,value:n,name:r,ref:i}})=>(0,Y.jsx)(H,{id:s,checked:n,onCheckedChange:({checked:t})=>e(t),onBlur:t,name:r,ref:i,size:a===`studio`?`sm`:`md`,paddingLeft:a===`studio`?2:void 0})}),!o&&(0,Y.jsx)(p,{htmlFor:s,marginBottom:`0`,fontWeight:a===`studio`?400:void 0,fontSize:a===`studio`?`13px`:void 0,children:B(t.split(`.`).toReversed()[0]??``)})]})});if(d instanceof N||d instanceof j||d instanceof I&&(t===`model`||t===`embeddings_model`)){let n=d instanceof N?d.options:d instanceof j?[{value:d.value}]:q.map(e=>({value:e}));if((t===`model`||t===`embeddings_model`)&&r?.name!==`OpenAI Moderation`){let e=n.map(e=>e.value);return(0,Y.jsx)(O,{name:s,control:u,render:({field:n})=>(0,Y.jsx)(le,{selectorOptions:e,field:n,fieldName:t,variant:a})})}return(0,Y.jsx)(O,{name:s,control:u,render:({field:t})=>(0,Y.jsxs)(_,{size:a===`studio`?`sm`:`md`,children:[(0,Y.jsxs)(v,{...t,onChange:e=>{let r=n.map(e=>e.value);e.target.value===``?t.onChange(void 0):!isNaN(+e.target.value)&&r.includes(+e.target.value)?t.onChange(+e.target.value):t.onChange(e.target.value)},children:[e instanceof P&&(0,Y.jsx)(`option`,{value:``}),n.map((e,t)=>(0,Y.jsx)(`option`,{value:e.value,children:e.value},t))]}),(0,Y.jsx)(g,{})]})})}else if(d instanceof I)return[`topic`,`name`].includes(h)||!isNaN(+h)?(0,Y.jsx)(A,{size:a===`studio`?`sm`:`md`,...m(s)}):(0,Y.jsx)(x,{size:a===`studio`?`sm`:`md`,...m(s)});else if(d instanceof ae){let e=d.element,i=e instanceof N&&e.options.every(e=>e instanceof j);return h===`include_metrics`&&i?(0,Y.jsx)(de,{fieldName:s,options:e.options.map(e=>e.value),variant:a}):(0,Y.jsx)(fe,{fieldSchema:d,fieldName:t,prefix:n,evaluator:r,variant:a,renderField:C})}else if(d instanceof M)return(0,Y.jsx)(c,{width:`full`,gap:2,children:Object.keys(d.shape).map(e=>(0,Y.jsxs)(c,{align:`start`,width:`full`,children:[!(d.shape[e]instanceof F)&&(0,Y.jsx)(U,{children:t.startsWith(`rubrics.`)?`Level ${parseInt(t.split(`.`)[1]??`0`)+1}`:z(e)}),C(d.shape[e],`${t}.${e}`,r)]},e))});return null};return(0,Y.jsx)(Y.Fragment,{children:((e,u=``)=>{if(e instanceof M){let p=W(t),m=Object.keys(e.shape),h=m.includes(`model`),g=m.includes(`max_tokens`),_=h&&g,v=_?m.filter(e=>e!==`model`&&e!==`max_tokens`):m;return(0,Y.jsxs)(Y.Fragment,{children:[_?a===`studio`?(0,Y.jsxs)(c,{as:`form`,align:`start`,gap:3,width:`full`,children:[(0,Y.jsx)(i,{width:`full`,children:(0,Y.jsx)(T,{children:`Model`})}),(0,Y.jsx)(f,{children:(0,Y.jsx)(Q,{prefix:n})})]},`llm-config`):(0,Y.jsx)(J.Fragment,{children:(0,Y.jsx)(V,{label:`Model`,tooltip:`The model to use for evaluation`,children:(0,Y.jsx)(Q,{prefix:n})})},`llm-config`):null,v.filter(e=>!l?.includes(e)).filter(e=>o?o.includes(e):!0).map(t=>{let n=e.shape[t],o=n instanceof P,l=p?.settings?.[t].description??``,m=r&&t in r&&!!r[t],h=$[t];return a===`studio`?(0,Y.jsxs)(c,{as:`form`,align:`start`,gap:3,width:`full`,children:[(0,Y.jsxs)(i,{width:`full`,children:[(0,Y.jsx)(T,{children:B(t)}),o&&(0,Y.jsx)(s,{color:`fg.muted`,fontSize:`12px`,children:`(optional)`}),l&&(0,Y.jsx)(d,{content:l,positioning:{placement:`top`},children:(0,Y.jsx)(L,{size:14})})]}),(0,Y.jsx)(f,{invalid:m,children:C(n,u?`${u}.${t}`:t,p,!0)})]},t):(0,Y.jsx)(J.Fragment,{children:(0,Y.jsx)(V,{label:B(t)+(o?` (Optional)`:``),helper:h?.helper,tooltip:h?.tooltip??l,invalid:m,children:C(n,u?`${u}.${t}`:t,p,!0)})},t)})]})}return null})(e)})};export{X as n,pe as t};
2
- //# sourceMappingURL=DynamicZodForm-lW0sHL84.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-WNeJk3KQ.js","assets/rolldown-runtime-DAXXjFlN.js","assets/react-BUD3sqOU.js"])))=>i.map(i=>d[i]);
2
- 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{S as a}from"./shiki-CS25xJLQ.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{n as u}from"./toaster-BsYkODqs.js";import{n as d}from"./personalProject-DMRX2-SI.js";import{n as f}from"./api-l6Cnm0vQ.js";import{Nt as p,Vt as m,W as h}from"./index-CPtTUYLD.js";import{t as g}from"./HorizontalFormControl-lYiaIlzD.js";import{t as _}from"./switch-DGatWO8v.js";import{n as v,r as y}from"./types-X7bcC-zw.js";import{t as b}from"./next-dynamic-DcKsrHUa.js";import{t as x}from"./FieldsFilters-B46wbf2n.js";var S=e(t()),C=o(),w=b(()=>a(()=>import(`./dist-WNeJk3KQ.js`),__vite__mapDeps([0,1,2])),{ssr:!1,loading:()=>(0,C.jsx)(n,{padding:4,color:`fg.muted`,children:`Loading editor...`})});function T(e){return Array.isArray(e)?e.length>0:Object.values(e).some(e=>Array.isArray(e)?e.length>0:Object.values(e).some(e=>e.length>0))}function E(e){try{let t=JSON.parse(e),n=y.safeParse(t);if(!n.success)return{success:!1,message:n.error.errors[0]?.message??`Invalid filter structure`};let{sanitized:r,unknownFields:i}=v(n.data);return{success:!0,rawFilters:n.data,sanitized:r,unknownFields:i}}catch{return{success:!1,message:`Invalid JSON syntax`}}}function D({automationId:e}){let{project:t}=m(),{colorMode:a}=p(),o=f.automation.updateTriggerFilters.useMutation(),y=f.useContext(),{closeDrawer:b}=h(),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(`{}`),[j,M]=(0,S.useState)(null),N=(0,S.useRef)(k);N.current=k;let[P,F]=(0,S.useState)({}),I=(0,S.useRef)(void 0);f.automation.getTriggerById.useQuery({triggerId:e??``,projectId:t?.id??``},{enabled:!!e&&!!t?.id,onSuccess:n=>{let r=`${t?.id}:${e}`;if(I.current===r)return;let i=JSON.parse(n?.filters),{sanitized:a}=v(i);F(Object.entries(a).reduce((e,[t,n])=>(Array.isArray(n)?n.length>0&&(e[t]=n):typeof n==`object`&&n&&(e[t]=n),e),{})),A(JSON.stringify(i,null,2)),I.current=r}});let L=(0,S.useCallback)(()=>Object.fromEntries(Object.entries(P).filter(([e,t])=>t!==void 0&&T(t))),[P]),R=(0,S.useCallback)(()=>{A(JSON.stringify(L(),null,2)),M(null)},[L]),z=e=>{if(e&&!D)R();else if(!e&&D){let e=E(N.current);if(!e.success){u.create({title:`Invalid filter structure`,description:e.message,type:`error`,meta:{closable:!0}});return}if(Object.keys(e.rawFilters).length>0&&Object.keys(e.sanitized).length===0){u.create({title:`Unsupported filters only`,description:`This automation only contains unsupported legacy filters. Add a supported filter before switching to visual mode.`,type:`error`,meta:{closable:!0}});return}e.unknownFields.length>0&&u.create({title:`Unsupported filters hidden in visual mode`,description:`Visual mode does not support: ${e.unknownFields.join(`, `)}`,type:`warning`,meta:{closable:!0}}),F(e.sanitized),M(null)}O(e)},B=e=>{let t=E(e);if(!t.success)return M(t.message),t;if(Object.keys(t.rawFilters).length>0&&Object.keys(t.sanitized).length===0){let e=`This automation only contains unsupported legacy filters. Add at least one supported filter before saving.`;return M(e),{success:!1,message:e}}return M(null),t};return(0,C.jsx)(d.Root,{open:!0,placement:`end`,size:`lg`,onOpenChange:({open:e})=>!e&&b(),children:(0,C.jsxs)(d.Content,{bg:`bg`,children:[(0,C.jsxs)(d.Header,{children:[(0,C.jsx)(d.CloseTrigger,{}),(0,C.jsx)(s,{children:`Edit Automation Filter`})]}),(0,C.jsx)(d.Body,{children:(0,C.jsxs)(l,{align:`stretch`,gap:4,children:[(0,C.jsxs)(i,{justify:`flex-end`,children:[(0,C.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Code mode`}),(0,C.jsx)(_,{checked:D,onCheckedChange:({checked:e})=>z(e)})]}),D?(0,C.jsxs)(l,{align:`stretch`,gap:2,children:[(0,C.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Edit the automation filters as JSON.`}),(0,C.jsx)(n,{border:`1px solid`,borderColor:j?`red.500`:`border`,borderRadius:`md`,overflow:`hidden`,height:`400px`,background:a===`dark`?`#1E1E1E`:`#FFFFFF`,children:(0,C.jsx)(w,{height:`100%`,language:`json`,defaultValue:k,theme:a===`dark`?`vs-dark`:`vs`,onChange:e=>{let t=e??`{}`;A(t),B(t)},options:{minimap:{enabled:!1},fontSize:13,wordWrap:`on`,automaticLayout:!0,scrollBeyondLastLine:!1,lineNumbers:`on`,tabSize:2,padding:{top:12}}})}),j&&(0,C.jsx)(c,{fontSize:`sm`,color:`red.500`,children:j})]}):(0,C.jsx)(g,{label:`Current filters`,helper:`Add or remove filters to the automation.`,minWidth:`calc(50% - 16px)`,children:(0,C.jsx)(x,{filters:P,setFilters:e=>F(t=>({...t,...e}))})}),(0,C.jsx)(i,{justifyContent:`flex-end`,marginY:5,children:(0,C.jsx)(r,{colorPalette:`blue`,type:`submit`,minWidth:`fit-content`,loading:o.isLoading,onClick:()=>{let n;if(D){let e=B(k);if(!e.success){u.create({title:`Error`,description:j??`Invalid filter JSON`,type:`error`,meta:{closable:!0}});return}n=e.sanitized}else n=L();if(Object.keys(n).length===0){u.create({title:`Error`,description:`Please add at least one filter`,type:`error`,meta:{closable:!0}});return}o.mutate({projectId:t?.id??``,triggerId:e??``,filters:n},{onSuccess:()=>{u.create({title:`Automation Updated`,description:`You have successfully updated the automation`,type:`success`,meta:{closable:!0}}),y.automation.getTriggers.invalidate(),b()},onError:()=>{u.create({title:`Error`,description:`Error updating automation`,type:`error`,meta:{closable:!0}})}})},children:`Update Filters`})})]})})]})})}export{D as EditAutomationFilterDrawer};
3
- //# sourceMappingURL=EditAutomationFilterDrawer-UZGlf7Jf.js.map
@@ -1,4 +0,0 @@
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"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{C as u,S as d,b as f,x as p,y as m}from"./shikiAdapter-CbWAxLvq.js";import{n as h}from"./toaster-BsYkODqs.js";import{K as g,q as _}from"./Markdown-C9extmbX.js";import{t as v}from"./grid-DVy6ELOp.js";import{a as y,i as b,n as x,t as S}from"./field-BadoNaN5.js";import{a as ee,i as te,r as C}from"./alert-CPsXih3K.js";import{n as w}from"./personalProject-DMRX2-SI.js";import{t as T}from"./grid-item-CKAuKzga.js";import{s as E,tt as D}from"./immer-CFru3D02.js";import{n as O}from"./api-l6Cnm0vQ.js";import{t as k}from"./ScopeChipPicker-B3xHf0Ii.js";import{t as A}from"./eye-off-C1m7ZwkW.js";import{S as j}from"./lu-DlSq9Be4.js";import{An as ne,En as re,Mn as ie,Mr as M,Qn as ae,Vt as oe,W as se}from"./index-CPtTUYLD.js";import{n as ce}from"./useFeatureFlag-Do1Ecu3l.js";import{t as le}from"./switch-DGatWO8v.js";import{a as ue,i as N,n as de,r as P}from"./CodexCodingDefaultsAsk-CKLyE8Ty.js";import{t as F}from"./useModelProvidersSettings-CzJv8_Jy.js";import{i as I}from"./registry-B64xvGV5.js";import{a as fe,i as pe,n as me,o as he,s as ge,t as _e}from"./ModelProviderCustomModelInput-DUwvNeux.js";import{c as ve,d as L,i as ye,o as R,u as be}from"./modelProviderHelpers-P2Cogc-H.js";import{t as z}from"./SmallLabel-Dh74EKHT.js";import{n as B}from"./registry-BG_TsdUI.js";import{t as xe}from"./ProviderScopeChips-D7HJW6Ht.js";var V=e(t());function Se({providerKey:e,displayKeys:t,customKeys:n}){return(0,V.useMemo)(()=>{let r=I[e];return R({keysSchema:r?.keysSchema,fieldSchemas:t,values:n,optionalKeys:r?.optionalKeys})},[e,t,n])}var H=o(),U={rateLimitRpm:``,rateLimitTpm:``,rateLimitRpd:``,fallbackPriorityGlobal:``,providerConfigJson:``};function W(e){return e==null?``:String(e)}function G(e){if(e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.trunc(t):null}function K(e){if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return``}}function Ce(e){return{rateLimitRpm:W(e.rateLimitRpm),rateLimitTpm:W(e.rateLimitTpm),rateLimitRpd:W(e.rateLimitRpd),fallbackPriorityGlobal:W(e.fallbackPriorityGlobal),providerConfigJson:K(e.providerConfig)}}function we(e){let t=null;if(e.providerConfigJson.trim()){let n=JSON.parse(e.providerConfigJson);if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`Provider config must be a JSON object`);t=n}return{rateLimitRpm:G(e.rateLimitRpm),rateLimitTpm:G(e.rateLimitTpm),rateLimitRpd:G(e.rateLimitRpd),fallbackPriorityGlobal:G(e.fallbackPriorityGlobal),providerConfig:t}}function Te({modelProviderId:e,draft:t,onDraftChange:n,jsonError:i,initial:o,accordionValue:s,onAccordionValueChange:h}){let g=e=>r=>n({...t,[e]:r}),_=e=>{if(!e)return`—`;let t=typeof e==`string`?new Date(e):e;return Number.isFinite(t.getTime())?t.toLocaleString():String(e)};return(0,H.jsx)(u,{collapsible:!0,width:`full`,value:s,onValueChange:e=>h(e.value),children:(0,H.jsxs)(m,{value:`advanced-gateway`,width:`full`,children:[(0,H.jsx)(d,{paddingY:2,children:(0,H.jsxs)(a,{width:`full`,justify:`space-between`,children:[(0,H.jsx)(z,{children:`Advanced (Gateway)`}),(0,H.jsx)(p,{children:(0,H.jsx)(j,{})})]})}),(0,H.jsx)(f,{children:e?(0,H.jsxs)(l,{align:`start`,width:`full`,gap:3,paddingTop:2,children:[(0,H.jsxs)(a,{width:`full`,align:`start`,gap:3,children:[(0,H.jsxs)(y,{children:[(0,H.jsx)(z,{children:`RPM`}),(0,H.jsx)(M,{type:`number`,min:0,placeholder:`No cap`,value:t.rateLimitRpm,onChange:e=>g(`rateLimitRpm`)(e.target.value)}),(0,H.jsx)(x,{children:`Requests per minute.`})]}),(0,H.jsxs)(y,{children:[(0,H.jsx)(z,{children:`TPM`}),(0,H.jsx)(M,{type:`number`,min:0,placeholder:`No cap`,value:t.rateLimitTpm,onChange:e=>g(`rateLimitTpm`)(e.target.value)}),(0,H.jsx)(x,{children:`Tokens per minute.`})]}),(0,H.jsxs)(y,{children:[(0,H.jsx)(z,{children:`RPD`}),(0,H.jsx)(M,{type:`number`,min:0,placeholder:`No cap`,value:t.rateLimitRpd,onChange:e=>g(`rateLimitRpd`)(e.target.value)}),(0,H.jsx)(x,{children:`Requests per day.`})]})]}),(0,H.jsxs)(y,{children:[(0,H.jsx)(z,{children:`Fallback priority`}),(0,H.jsx)(M,{type:`number`,placeholder:`Auto`,value:t.fallbackPriorityGlobal,onChange:e=>g(`fallbackPriorityGlobal`)(e.target.value)}),(0,H.jsx)(x,{children:`Order used when a Virtual Key has no Routing Policy. Lower tries first. Tiebreak by creation order.`})]}),(0,H.jsxs)(y,{children:[(0,H.jsx)(z,{children:`Provider config (JSON)`}),(0,H.jsx)(D,{rows:4,placeholder:`{
2
- "region": "us-east-1"
3
- }`,fontFamily:`mono`,fontSize:`xs`,value:t.providerConfigJson,onChange:e=>g(`providerConfigJson`)(e.target.value)}),i?(0,H.jsx)(c,{fontSize:`xs`,color:`red.500`,children:i}):(0,H.jsx)(x,{children:`Provider-specific routing hints. Bedrock region, Azure deployment override, etc.`})]}),(0,H.jsxs)(r,{width:`full`,borderTop:`1px solid`,borderColor:`border.muted`,paddingTop:2,children:[(0,H.jsx)(z,{children:`Health (read-only)`}),(0,H.jsxs)(l,{align:`start`,gap:1,fontSize:`xs`,color:`fg.muted`,children:[(0,H.jsxs)(c,{children:[`Status: `,o.healthStatus??`UNKNOWN`]}),(0,H.jsxs)(c,{children:[`Last checked: `,_(o.lastHealthCheckAt)]}),(0,H.jsxs)(c,{children:[`Circuit opened: `,_(o.circuitOpenedAt)]}),o.disabledAt&&(0,H.jsxs)(c,{color:`red.500`,children:[`Disabled at: `,_(o.disabledAt)]})]})]})]}):(0,H.jsx)(r,{width:`full`,paddingY:2,children:(0,H.jsx)(c,{fontSize:`xs`,color:`gray.500`,children:`Save the provider first to configure rate limits and routing hints.`})})})]})})}var Ee=({provider:e,error:t})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(te,{status:`warning`,children:[(0,H.jsx)(C,{}),(0,H.jsxs)(ee,{children:[`The `,e.provider,` provider credentials is managed by LangWatch for your organization.`]})]}),(0,H.jsx)(y,{invalid:!!t,children:(0,H.jsx)(S,{children:t})})]}),q=e=>B.find(t=>t.backendModelProviderKey===e)?.fieldMetadata,De=({state:e,actions:t,provider:n,fieldErrors:i,setFieldErrors:a,projectId:o,organizationId:s,apiKeyValidationError:c,onApiKeyValidationClear:u})=>{let{data:d}=O.modelProvider.isManagedProvider.useQuery({organizationId:s??``,provider:n.provider},{enabled:!!s}),f=d?.managed??!1,p=q(n.provider),m=Se({providerKey:n.provider,displayKeys:e.displayKeys,customKeys:e.customKeys});return(0,V.useEffect)(()=>{f&&t.setManaged(!0)},[f]),f?(0,H.jsx)(Ee,{provider:n,error:e.errors.customKeysRoot}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l,{align:`stretch`,gap:3,width:`full`,children:Object.keys(e.displayKeys).map(n=>{let o=p?.[n]?.description,s=!m.has(n),l=L(n),d=!!i[n];return(0,H.jsxs)(y,{required:!s,invalid:d,width:`full`,children:[(0,H.jsxs)(z,{children:[n,!s&&(0,H.jsx)(b,{})]}),(0,H.jsx)(r,{width:`full`,children:(0,H.jsx)(M,{value:e.customKeys[n]??``,onChange:e=>{t.setCustomKey(n,e.target.value),i[n]&&a(e=>{let t={...e};return delete t[n],t}),u&&c&&u()},type:l?`password`:`text`,autoComplete:`off`,placeholder:s?`optional`:void 0,width:`full`})}),o&&(0,H.jsx)(x,{children:o}),i[n]&&(0,H.jsx)(S,{children:i[n]})]},n)})}),c&&(0,H.jsx)(y,{invalid:!0,children:(0,H.jsx)(S,{children:c})}),e.errors.customKeysRoot&&(0,H.jsx)(y,{invalid:!0,children:(0,H.jsx)(S,{children:e.errors.customKeysRoot})})]})},Oe=({state:e,actions:t,provider:n})=>n.provider!==`azure`&&n.provider!==`custom`&&n.provider!==`azure_safety`?null:(0,H.jsxs)(l,{width:`full`,align:`start`,paddingTop:4,children:[e.extraHeaders.length>0&&(0,H.jsxs)(v,{templateColumns:`auto auto auto auto`,gap:4,rowGap:2,width:`full`,children:[(0,H.jsx)(T,{color:`fg.muted`,colSpan:4,children:(0,H.jsx)(z,{children:`Extra Headers`})}),e.extraHeaders.map((e,n)=>(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(T,{children:(0,H.jsx)(M,{value:e.key,onChange:e=>t.setExtraHeaderKey(n,e.target.value),placeholder:`Header name`,autoComplete:`off`,width:`full`})}),(0,H.jsx)(T,{children:(0,H.jsx)(M,{value:e.value,onChange:e=>t.setExtraHeaderValue(n,e.target.value),type:e.concealed?`password`:`text`,placeholder:`Header value`,autoComplete:`off`,width:`full`})}),(0,H.jsx)(T,{children:(0,H.jsx)(i,{size:`sm`,variant:`ghost`,onClick:()=>t.toggleExtraHeaderConcealed(n),children:e.concealed?(0,H.jsx)(A,{size:16}):(0,H.jsx)(_,{size:16})})}),(0,H.jsx)(T,{children:(0,H.jsx)(i,{size:`sm`,variant:`ghost`,colorPalette:`red`,onClick:()=>t.removeExtraHeader(n),children:(0,H.jsx)(g,{size:16})})})]},n))]}),(0,H.jsx)(a,{width:`full`,justify:`end`,children:(0,H.jsxs)(i,{size:`xs`,variant:`outline`,onClick:t.addExtraHeader,children:[(0,H.jsx)(ae,{size:16}),`Add Header`]})})]}),J={PROJECT:`Only this project can use this provider.`,TEAM:`Every project in the team inherits this provider.`,ORGANIZATION:`Every project in the organization inherits this provider.`};function Y(e){if(e.length===0)return`Pick at least one scope to grant access.`;if(e.length===1)return J[e[0].scopeType];let t=e.reduce((e,t)=>(e[t.scopeType]=(e[t.scopeType]??0)+1,e),{}),n=[];return t.ORGANIZATION&&n.push(`the organization`),t.TEAM&&n.push(t.TEAM===1?`1 team`:`${t.TEAM} teams`),t.PROJECT&&n.push(t.PROJECT===1?`1 project`:`${t.PROJECT} projects`),`Shared across ${n.join(` + `)}.`}function ke({state:e,actions:t,provider:n,teamId:r,teamName:i,organizationId:a,organizationName:o,projectId:s,projectName:u,availableTeams:d,availableProjects:f}){let p=!!n.id,m=!!(a??r);if(p){let e=n.scopes&&n.scopes.length>0?n.scopes.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId})):n.scopeType?[{scopeType:n.scopeType,scopeId:n.scopeId??``}]:[{scopeType:`PROJECT`,scopeId:s??``}];return!m&&e.every(e=>e.scopeType===`PROJECT`)?null:(0,H.jsxs)(l,{align:`start`,width:`full`,gap:2,children:[(0,H.jsx)(z,{children:`Scope`}),(0,H.jsx)(xe,{scopes:e}),(0,H.jsx)(c,{fontSize:`xs`,color:`gray.600`,children:Y(e)}),(0,H.jsx)(c,{fontSize:`xs`,color:`gray.500`,children:`Scope is fixed after create. To change it, delete and recreate at the new scope.`})]})}return m?(0,H.jsxs)(l,{align:`start`,width:`full`,gap:1.5,children:[(0,H.jsx)(z,{children:`Scope`}),(0,H.jsx)(k,{value:e.scopes,onChange:e=>t.setScopes(e),organizationId:a,organizationName:o,teamId:r,teamName:i,projectId:s,projectName:u,availableTeams:d,availableProjects:f,label:``,currentOrganizationId:a??null,currentTeamId:r??null,currentProjectId:s??null})]}):null}var X=({projectId:e,organizationId:t,modelProviderId:n,providerKey:o})=>{let{providers:s}=F({projectId:e}),{providers:u,isReady:d}=ue(),{closeDrawer:f}=se(),{project:p,team:m,organization:g,hasPermission:_}=oe(),v=_(`organization:manage`),S=_(`team:manage`),ee=(0,V.useMemo)(()=>{if(!s)return 1;let e=Object.values(s).filter(e=>e.enabled).length;return s[o]?.enabled??!1?e:e+1},[s,o]),[te,C]=(0,V.useState)({}),{enabled:w}=ce(`release_ui_ai_gateway_menu_enabled`,{organizationId:g?.id,enabled:!!g?.id}),[T,E]=(0,V.useState)(U),[D,O]=(0,V.useState)(null),k=N(n),A=(0,V.useMemo)(()=>k?P({providers:u,modelProviderId:n}):void 0,[k,u,n]),j=k&&!A,ae=j&&d,L=(0,V.useMemo)(()=>A??{provider:o,enabled:!1,customKeys:null,models:null,embeddingsModels:null,disabledByDefault:!0,deploymentMapping:null,extraHeaders:[]},[A,o]),R=L.enabled&&(!L.customKeys||Object.keys(L.customKeys).length===0),B=L.id;(0,V.useEffect)(()=>{if(!w){E(U),O(null);return}E(Ce({rateLimitRpm:L.rateLimitRpm??null,rateLimitTpm:L.rateLimitTpm??null,rateLimitRpd:L.rateLimitRpd??null,fallbackPriorityGlobal:L.fallbackPriorityGlobal??null,providerConfig:L.providerConfig})),O(null),K([])},[w,B]);let xe=(0,V.useMemo)(()=>w?Ce({rateLimitRpm:L.rateLimitRpm??null,rateLimitTpm:L.rateLimitTpm??null,rateLimitRpd:L.rateLimitRpd??null,fallbackPriorityGlobal:L.fallbackPriorityGlobal??null,providerConfig:L.providerConfig}):U,[w,L]),W=JSON.stringify(T)!==JSON.stringify(xe),[G,K]=(0,V.useState)([]),Ee=(0,V.useCallback)(()=>{if(!w)return null;try{let e=we(T);return O(null),e}catch(e){throw O(e instanceof Error?e.message:`Invalid JSON`),K([`advanced-gateway`]),e}},[w,T]),[q,J]=fe({provider:L,projectId:e,enabledProvidersCount:ee,isUsingEnvVars:R,teamId:m?.id,organizationId:g?.id,canManageOrganization:v,canManageTeam:S,getAdvancedPayload:Ee,onSuccess:()=>{f()}}),Y=I[L.provider],X=Y?.type===`llm`,Z=Se({providerKey:L.provider,displayKeys:q.displayKeys,customKeys:q.customKeys}),Q=Y?.authFlow===`oauth-device`,{validate:Ae,isValidating:je,validationError:Me,clearError:$}=he(L.provider,q.customKeys,e,g?.id,q.scopes),{probeRequired:Ne,recordRefusal:Pe,clearRefusal:Fe,saveLabel:Ie}=ge({customKeys:q.customKeys,resetKey:B}),Le=(0,V.useCallback)(async()=>{C({}),$();let e=ve(q.customKeys),t=be(q.customKeys,q.initialKeys);if(Y?.keysSchema&&!Q&&(!R||t)){let e=ie([Y.keysSchema,re({MANAGED:ne()})]),t={...q.customKeys},n=e.safeParse(t);if(!n.success){let e=n.error,t=pe(e),r=e.issues.find(e=>!e.path?.length)?.message;if(r){let e=ye({requiredKeys:Z,values:q.customKeys})[0]??Object.keys(q.displayKeys)[0];e&&!t[e]&&(t[e]=r)}C(t);return}}if(X&&!Q&&e&&Ne){if(!await Ae()){Pe();return}Fe()}J.submit()},[Ne,Pe,Fe,X,Q,R,Y,Z,q.customKeys,q.displayKeys,q.initialKeys,J,Ae,$]);return(0,H.jsxs)(l,{gap:4,align:`start`,width:`full`,children:[ae&&(0,H.jsx)(c,{color:`red.500`,fontSize:`sm`,children:`This provider configuration no longer exists. It may have been deleted from another session.`}),(0,H.jsxs)(l,{align:`start`,width:`full`,gap:4,children:[(0,H.jsxs)(y,{width:`full`,required:!0,children:[(0,H.jsxs)(z,{children:[`Name`,(0,H.jsx)(b,{})]}),(0,H.jsx)(r,{width:`full`,children:(0,H.jsx)(M,{value:q.name,onChange:e=>J.setName(e.target.value),placeholder:L.provider,width:`full`,maxLength:128})}),(0,H.jsx)(x,{children:`Distinguish multiple instances (e.g. "OpenAI – EU prod" vs "OpenAI – Dev").`})]}),X&&L.provider===`azure`&&(0,H.jsx)(y,{children:(0,H.jsx)(le,{onCheckedChange:e=>{J.setUseApiGateway(e.checked)},checked:q.useApiGateway,children:`Use API Gateway`})}),(0,H.jsx)(ke,{state:q,actions:J,provider:L,teamId:m?.id,teamName:m?.name,organizationId:g?.id,organizationName:g?.name,projectId:p?.id,projectName:p?.name,availableTeams:g?.teams?.map(e=>({id:e.id,name:e.name}))??[],availableProjects:g?.teams?.flatMap(e=>e.projects.map(t=>({id:t.id,name:`${t.name} · ${e.name}`,teamId:e.id})))??[]}),Q?(0,H.jsx)(me,{projectId:p?.id??``,scopes:q.scopes,setAsCodingDefaults:!1,onConnected:e=>{de.getState().request({projectId:p?.id??``,scopes:q.scopes}),h.create({title:`Codex connected`,description:e.email?`Signed in as ${e.email}`:void 0,type:`success`}),f()}}):(0,H.jsx)(De,{state:q,actions:J,provider:L,fieldErrors:te,setFieldErrors:C,projectId:e,organizationId:t,apiKeyValidationError:Me,onApiKeyValidationClear:$}),(0,H.jsx)(Oe,{state:q,actions:J,provider:L}),X&&!Q&&(0,H.jsx)(_e,{state:q,actions:J,provider:L}),w&&(0,H.jsx)(Te,{modelProviderId:L.id,draft:T,onDraftChange:e=>{E(e),O(null)},jsonError:D,accordionValue:G,onAccordionValueChange:K,initial:{healthStatus:L.healthStatus,circuitOpenedAt:L.circuitOpenedAt,lastHealthCheckAt:L.lastHealthCheckAt,disabledAt:L.disabledAt}}),(0,H.jsx)(a,{width:`full`,justify:`end`,children:(0,H.jsx)(i,{size:`sm`,colorPalette:`orange`,loading:q.isSaving||je,disabled:j||!q.isDirty&&!W,onClick:Le,children:Ie})})]})]})},Z=e=>{let{projectId:t,organizationId:i,modelProviderId:o,providerKey:c}=e,{closeDrawer:u}=se(),{providers:d,isLoading:f}=F({projectId:t}),{providers:p,isLoading:m}=ue(),h=N(o),g=h?P({providers:p,modelProviderId:o}):d?.[c],_=``;g&&(_=I[g.provider]?.name||g.provider);let v=_,y=!!t&&(f||!d)||h&&m;return(0,H.jsx)(w.Root,{open:!0,placement:`end`,size:`xl`,onOpenChange:({open:e})=>{e||u()},modal:!1,children:(0,H.jsxs)(w.Content,{bg:`bg`,children:[(0,H.jsxs)(w.Header,{children:[(0,H.jsx)(a,{children:(0,H.jsx)(w.CloseTrigger,{})}),(0,H.jsxs)(a,{gap:3,children:[g&&(0,H.jsx)(r,{width:`28px`,height:`28px`,children:E[g.provider]}),(0,H.jsx)(s,{as:`h2`,children:v})]})]}),(0,H.jsx)(w.Body,{children:y?(0,H.jsx)(l,{height:`200px`,justify:`center`,children:(0,H.jsx)(n,{})}):(0,H.jsx)(X,{projectId:t,organizationId:i,modelProviderId:o,providerKey:c})})]})})};export{Z as EditModelProviderDrawer};
4
- //# sourceMappingURL=EditModelProviderDrawer-FxE8Cjfj.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{i as n,n as r}from"./portal-Sdfvrza9.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{t as a}from"./heading-C0sACr0w.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{p as c,t as l}from"./select-D17PWjH9.js";import{n as u}from"./toaster-BsYkODqs.js";import{a as d,r as f,t as p}from"./field-BadoNaN5.js";import{n as m}from"./personalProject-DMRX2-SI.js";import{l as h,t as g,u as _}from"./errors-e711UMq7.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,Vt as C,W as w}from"./index-CPtTUYLD.js";var T=e(t()),E=i();function D({open:e=!0,projectId:t,projectName:i,currentTeamId:D}){let{organization:O}=C(),{closeDrawer:k}=w(),A=y.useContext(),j=y.team.getTeamsWithMembers.useQuery({organizationId:O?.id??``},{enabled:!!O}),M=b({defaultValues:{name:i??``,teamId:D??``}}),{register:N,handleSubmit:P,formState:{errors:F,isDirty:I},control:L}=M,R=y.project.update.useMutation(),z=(0,T.useMemo)(()=>(j.data??[]).filter(e=>!e.isPersonal).map(e=>({label:e.name,value:e.id})),[j.data]),B=(0,T.useMemo)(()=>c({items:z}),[z]),V=(0,T.useCallback)(e=>{t&&R.mutate({projectId:t,...e.name!==i&&{name:e.name},...e.teamId!==D&&{teamId:e.teamId}},{onSuccess:()=>{A.team.getTeamsWithRoleBindings.invalidate(),A.team.getTeamsWithMembers.invalidate(),A.organization.getAll.invalidate(),u.create({title:`Project updated`,type:`success`,duration:5e3,meta:{closable:!0}}),k()},onError:e=>{_({error:e,form:M,hasFormErrorSlot:!0})||g({error:e,fallbackTitle:`Couldn't update the project`})}})},[R,t,i,D,A,k,M]);return(0,E.jsx)(m.Root,{open:e,placement:`end`,size:`lg`,onOpenChange:({open:e})=>{e||k()},children:(0,E.jsxs)(m.Content,{bg:`bg`,children:[(0,E.jsxs)(m.Header,{children:[(0,E.jsx)(m.CloseTrigger,{onClick:k}),(0,E.jsx)(a,{children:`Edit Project`})]}),(0,E.jsx)(m.Body,{children:(0,E.jsx)(`form`,{onSubmit:P(V),children:(0,E.jsxs)(s,{align:`stretch`,gap:6,children:[(0,E.jsx)(h,{form:M}),(0,E.jsx)(o,{fontSize:`sm`,color:`fg.muted`,children:`Update the project name or move it to a different team. Moving a project changes which team members inherit access.`}),(0,E.jsxs)(d,{invalid:!!F.name,children:[(0,E.jsx)(f,{children:`Project Name`}),(0,E.jsx)(S,{...N(`name`,{required:`Project name is required`,minLength:{value:1,message:`Name is required`}}),placeholder:`AI Project`}),F.name&&(0,E.jsx)(p,{children:F.name.message})]}),(0,E.jsxs)(d,{invalid:!!F.teamId,children:[(0,E.jsx)(f,{children:`Team`}),(0,E.jsx)(x,{control:L,name:`teamId`,rules:{required:`Team is required`},render:({field:e})=>(0,E.jsxs)(l.Root,{collection:B,value:[e.value],onValueChange:t=>{let n=t.value[0];n&&e.onChange(n)},children:[(0,E.jsx)(l.Trigger,{children:(0,E.jsx)(l.ValueText,{placeholder:`Select team`,children:()=>z.find(t=>t.value===e.value)?.label??`Select team`})}),(0,E.jsx)(l.Content,{paddingY:2,children:z.map(e=>(0,E.jsx)(l.Item,{item:e,children:e.label},e.value))})]})}),F.teamId&&(0,E.jsx)(p,{children:F.teamId.message})]}),(0,E.jsxs)(r,{width:`full`,children:[(0,E.jsx)(v,{}),(0,E.jsx)(n,{colorPalette:`orange`,type:`submit`,loading:R.isLoading,disabled:!I||R.isLoading,children:`Save`})]})]})})})]})})}export{D as EditProjectDrawer};
2
- //# sourceMappingURL=EditProjectDrawer-DvGgMwQg.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/emoji-picker-react.esm-DCArsP-j.js","assets/rolldown-runtime-DAXXjFlN.js","assets/react-BUD3sqOU.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{i as n,n as r}from"./portal-Sdfvrza9.js";import{S as i}from"./shiki-CS25xJLQ.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{Bn as c,Ln as l,Mt as u}from"./ProjectAvatar-DtI9dT1f.js";import{t as d}from"./spacer-C38e7o6r.js";import{t as f}from"./x-ePIIvo_k.js";import{t as p}from"./next-dynamic-DcKsrHUa.js";var m=e(t()),h=a();function g({open:e,onClose:t,title:i,unstyled:a=!1,children:l}){let[p,g]=(0,m.useState)(e);return(0,m.useEffect)(()=>{g(e)},[e]),p?(0,h.jsxs)(u.Root,{open:p,onOpenChange:()=>{setTimeout(()=>g(!1),10),setTimeout(t,300)},positioning:{placement:`bottom`},children:[(0,h.jsx)(c,{position:`absolute`,left:0,width:`100%`,height:`32px`,zIndex:-1}),a?l:(0,h.jsxs)(u.Content,{minWidth:`600px`,gap:0,children:[(0,h.jsxs)(r,{width:`full`,paddingX:4,paddingY:2,paddingRight:1,borderBottomWidth:`1px`,borderColor:`border`,children:[(0,h.jsx)(o,{fontSize:`14px`,fontWeight:500,children:i}),(0,h.jsx)(d,{}),(0,h.jsx)(n,{size:`sm`,variant:`ghost`,onClick:t,children:(0,h.jsx)(f,{size:16})})]}),(0,h.jsx)(s,{paddingY:2,paddingX:4,width:`full`,align:`start`,children:l})]})]}):null}var _=`native`,v=`PREVIEW`,y=p(()=>i(()=>import(`./emoji-picker-react.esm-DCArsP-j.js`).then(e=>e.default),__vite__mapDeps([0,1,2])),{ssr:!1,loading:()=>(0,h.jsx)(`div`,{style:{padding:16},children:`Loading emoji picker...`})});function b({open:e,onClose:t,onChange:n,...r}){return(0,h.jsx)(g,{open:e,onClose:t,title:`Workflow Icon`,unstyled:!0,children:(0,h.jsx)(l,{marginRight:4,position:`absolute`,marginTop:`72px`,...r,children:(0,h.jsx)(y,{emojiStyle:_,skinTonePickerLocation:v,onEmojiClick:e=>{n(e.emoji),t()}})})})}export{b as t};
3
- //# sourceMappingURL=EmojiPickerModal-DOTbYgFl.js.map
@@ -1,2 +0,0 @@
1
- import{dn as e,i as t}from"./portal-Sdfvrza9.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{t as r}from"./skeleton-0JSrjbwm.js";import{t as i}from"./heading-C0sACr0w.js";import{n as a,t as o}from"./v-stack-hkuSkmCA.js";import{wn as s}from"./ProjectAvatar-DtI9dT1f.js";import{t as c}from"./useActivePlan-fRQ_etI2.js";var l=n();function u({children:n,featureName:u,description:d}){let{isEnterprise:f,isLoading:p}=c();return p?(0,l.jsxs)(o,{align:`stretch`,gap:4,padding:8,children:[(0,l.jsx)(r,{height:`32px`,width:`240px`}),(0,l.jsx)(r,{height:`120px`}),(0,l.jsx)(r,{height:`200px`})]}):f?(0,l.jsx)(l.Fragment,{children:n}):(0,l.jsx)(e,{padding:8,children:(0,l.jsx)(e,{maxWidth:`640px`,marginX:`auto`,marginY:12,padding:8,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`lg`,backgroundColor:`bg.subtle`,children:(0,l.jsxs)(o,{align:`start`,gap:4,children:[(0,l.jsx)(e,{color:`fg.muted`,children:(0,l.jsx)(s,{size:32})}),(0,l.jsx)(i,{as:`h2`,size:`lg`,children:u}),(0,l.jsx)(a,{color:`fg.muted`,fontSize:`sm`,children:d??`${u} is available on Enterprise plans. Upgrade to unlock this surface for your organization.`}),(0,l.jsx)(t,{asChild:!0,size:`sm`,colorPalette:`orange`,children:(0,l.jsx)(`a`,{href:`/settings/subscription`,children:`Upgrade →`})})]})})})}export{u as t};
2
- //# sourceMappingURL=EnterpriseLockedSurface-CM8Sj7hf.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";var n=e(t()),r=[`children`];function i(e,t){if(e==null)return{};var n,r,i=a(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function a(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}var o=(0,n.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function s(e){var t=e.children,a=i(e,r);return n.createElement(o.Provider,{value:a},t)}export{s as t};
2
- //# sourceMappingURL=ErrorBarContext-Bpz3-JDH.js.map
@@ -1,107 +0,0 @@
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,t as o}from"./v-stack-hkuSkmCA.js";import{a as s,f as c}from"./toaster-BsYkODqs.js";import{o as l}from"./Markdown-C9extmbX.js";import{n as u,r as d,t as f}from"./native-select-DL2k8x0o.js";import{At as p,Et as m,Ot as h,Tt as g,kt as _,wt as v}from"./index-CPtTUYLD.js";import{t as y}from"./evaluators-6oHFfk5m.js";import{n as b,t as x}from"./langwatchEndpointEnv-nAxLDTZN.js";var S=e(t()),C=i();function w({evaluator:e,open:t,onClose:i}){let[w,T]=(0,S.useState)(`online`),[E,D]=(0,S.useState)(`python`);if(!e)return null;let O=e.slug??`your-evaluator-slug`,k=e.name??`My Evaluator`,A=e.config?.evaluatorType??``,j=A?y[A]:null,M=()=>{let e=[...j?.requiredFields??[],...j?.optionalFields??[]];return e.length===0?` "input": row["input"],
2
- "output": output,`:e.map(e=>e===`output`?` "${e}": output,`:e===`input`?` "${e}": row["input"],`:e===`contexts`?` "${e}": row["contexts"],`:e===`expected_output`?` "${e}": row["expected_output"],`:e===`expected_contexts`?` "${e}": row["expected_contexts"],`:e===`conversation`?` "${e}": row["conversation"],`:` "${e}": "",`).join(`
3
- `)},N=()=>{let e=[...j?.requiredFields??[],...j?.optionalFields??[]];return e.length===0?` "input": "",
4
- "output": "",`:e.map(e=>` "${e}": "",`).join(`
5
- `)},P=()=>{let e=[...j?.requiredFields??[],...j?.optionalFields??[]];return e.length===0?` input: item.input,
6
- output: output,`:e.map(e=>e===`input`?` input: item.input,`:e===`output`?` output: output,`:` ${e}: item.${e},`).join(`
7
- `)},F=()=>{let e=[...j?.requiredFields??[],...j?.optionalFields??[]];return e.length===0?` input: "", // your input value
8
- output: "", // your output value`:e.map(e=>` ${e}: "", // your ${e} value`).join(`
9
- `)},I=()=>{let e=[...j?.requiredFields??[],...j?.optionalFields??[]];return e.length===0?`"input": "input content",
10
- "output": "output content"`:e.map(e=>`"${e}": "your ${e}"`).join(`,
11
- `)},L=`${b()}import langwatch
12
-
13
- df = langwatch.datasets.get_dataset("dataset-id").to_pandas()
14
-
15
- experiment = langwatch.experiment.init("my-experiment")
16
-
17
- for index, row in experiment.loop(df.iterrows()):
18
- # your execution code here
19
- output = your_llm_call(row["input"])
20
-
21
- experiment.evaluate(
22
- "evaluators/${O}",
23
- index=index,
24
- data={
25
- ${M()}
26
- },
27
- settings={}
28
- )`,R=`${b()}import { LangWatch } from "langwatch";
29
-
30
- const langwatch = new LangWatch();
31
-
32
- // Fetch dataset from LangWatch
33
- const dataset = await langwatch.datasets.get("your-dataset-slug");
34
-
35
- const experiment = await langwatch.experiments.init("my-experiment");
36
-
37
- await experiment.run(
38
- dataset.entries.map((e) => e.entry),
39
- async ({ item, index }) => {
40
- // Run your LLM/agent
41
- const output = await myLLM(item.input);
42
-
43
- // Evaluate the output
44
- await experiment.evaluate("evaluators/${O}", {
45
- index,
46
- data: {
47
- ${P()}
48
- },
49
- });
50
- },
51
- { concurrency: 4 }
52
- );`,z=`${b()}import langwatch
53
-
54
- @langwatch.span()
55
- def my_llm_step():
56
- ... # your existing code
57
- result = langwatch.evaluation.evaluate(
58
- "evaluators/${O}",
59
- name="${k}",
60
- data={
61
- ${N()}
62
- },
63
- settings={},
64
- )
65
- print(result)`,B=`${b()}import { LangWatch } from "langwatch";
66
-
67
- const langwatch = new LangWatch();
68
-
69
- async function myLLMStep(input: string): Promise<string> {
70
- // ... your existing code
71
-
72
- // Call the evaluator
73
- const result = await langwatch.evaluations.evaluate("evaluators/${O}", {
74
- name: "${k}",
75
- data: {
76
- ${F()}
77
- },
78
- settings: {},
79
- });
80
-
81
- console.log(result);
82
- return result;
83
- }`,V=`# Set your API key
84
- API_KEY="$LANGWATCH_API_KEY"
85
-
86
- # Use curl to send the POST request
87
- curl -X POST "${x()}/api/evaluations/evaluators/${O}/evaluate" \\
88
- -H "X-Auth-Token: $API_KEY" \\
89
- -H "Content-Type: application/json" \\
90
- -d @- <<EOF
91
- {
92
- "name": "${k}",
93
- "data": {
94
- ${I()}
95
- },
96
- "settings": {}
97
- }
98
- EOF
99
-
100
- # Response:
101
- # {
102
- # "status": "processed",
103
- # "passed": true,
104
- # "score": 1,
105
- # "details": "possible explanation"
106
- # }`,H=()=>{if(w===`experiment`)switch(E){case`python`:return L;case`typescript`:return R;case`bash`:return V;default:return L}else switch(E){case`python`:return z;case`typescript`:return B;case`bash`:return V;default:return z}},U=()=>{switch(E){case`python`:return`python`;case`typescript`:return`typescript`;case`bash`:return`bash`;default:return`python`}},W=w===`experiment`?`https://docs.langwatch.ai/evaluations/experiments/overview`:`https://docs.langwatch.ai/evaluations/online-evaluation/overview`;return(0,C.jsx)(_,{open:t,onOpenChange:({open:e})=>!e&&i(),size:`xl`,children:(0,C.jsxs)(m,{maxWidth:`800px`,children:[(0,C.jsx)(h,{children:(0,C.jsx)(p,{children:`Use via API`})}),(0,C.jsx)(g,{}),(0,C.jsx)(v,{paddingBottom:6,children:(0,C.jsxs)(o,{align:`stretch`,gap:4,children:[(0,C.jsx)(n,{children:(0,C.jsxs)(a,{fontSize:`sm`,color:`fg.muted`,children:[`Evaluator: `,(0,C.jsx)(`strong`,{children:e.name}),e.slug&&(0,C.jsxs)(a,{as:`span`,color:`fg.subtle`,children:[` `,`(`,e.slug,`)`]})]})}),(0,C.jsxs)(r,{gap:4,children:[(0,C.jsxs)(d,{width:`200px`,children:[(0,C.jsxs)(f,{value:w,onChange:e=>T(e.target.value),"data-testid":`usage-mode-select`,children:[(0,C.jsx)(`option`,{value:`online`,children:`Online Evaluation`}),(0,C.jsx)(`option`,{value:`experiment`,children:`Experiment (Batch)`})]}),(0,C.jsx)(u,{})]}),(0,C.jsxs)(d,{width:`170px`,children:[(0,C.jsxs)(f,{value:E,onChange:e=>D(e.target.value),"data-testid":`language-select`,children:[(0,C.jsx)(`option`,{value:`python`,children:`Python`}),(0,C.jsx)(`option`,{value:`typescript`,children:`TypeScript`}),(0,C.jsx)(`option`,{value:`bash`,children:`cURL`})]}),(0,C.jsx)(u,{})]})]}),(0,C.jsx)(n,{borderRadius:`md`,overflow:`hidden`,width:`full`,children:(0,C.jsx)(l,{code:H(),language:U(),style:{padding:`16px`,width:`100%`}})}),(0,C.jsxs)(o,{align:`start`,gap:2,children:[(0,C.jsxs)(a,{fontSize:`sm`,color:`fg.muted`,children:[`Set the `,(0,C.jsx)(`code`,{children:`LANGWATCH_API_KEY`}),` environment variable with your API key.`,` `,(0,C.jsxs)(c,{href:`/settings/api-keys`,color:`blue.500`,display:`inline-flex`,alignItems:`center`,gap:1,children:[`Find your API key `,(0,C.jsx)(s,{size:12})]})]}),(0,C.jsxs)(a,{fontSize:`sm`,color:`fg.muted`,children:[`Learn more about`,` `,w===`experiment`?`running experiments`:`online evaluations`,` `,`in our`,` `,(0,C.jsxs)(c,{href:W,color:`blue.500`,display:`inline-flex`,alignItems:`center`,gap:1,target:`_blank`,children:[`documentation `,(0,C.jsx)(s,{size:12})]})]})]})]})})]})})}export{w as t};
107
- //# sourceMappingURL=EvaluatorApiUsageDialog-Bnv6z6m_.js.map
@@ -1,2 +0,0 @@
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{n as l}from"./personalProject-DMRX2-SI.js";import{Q as u}from"./immer-CFru3D02.js";import{t as d}from"./brain-BX4ydSFF.js";import{t as f}from"./code-MiD0yvEx.js";import{t as p}from"./star-DpfQOsot.js";import{n as m}from"./lu-DlSq9Be4.js";import{Hn as h,I as g,Tr as _,W as v,qn as y}from"./index-CPtTUYLD.js";import{n as b,t as x}from"./react-B5vhk-dA.js";import{i as S,n as C,r as w,t as T}from"./EvaluatorEditorShared-Dlnmyfw9.js";import{n as E,t as D}from"./EvaluatorTypeSelectorContent-BTrBItgE.js";var O=e(t()),k=a(),A=[{id:`expected_answer`,icon:_,title:`Expected Answer`,description:`Compare output against expected values (exact match, similarity)`},{id:`llm_judge`,icon:d,title:`LLM as Judge`,description:`Use LLM to evaluate quality based on criteria`},{id:`rag`,icon:u,title:`RAG Quality`,description:`Evaluate retrieval and generation quality`},{id:`quality`,icon:p,title:`Quality Aspects`,description:`Check language, structure, and formatting`},{id:`safety`,icon:y,title:`Safety`,description:`Check for PII, prompt injection, and harmful content`}],j={category:0,type:1,editor:2},M={enter:e=>({x:e>0?`100%`:`-100%`}),center:{x:0},exit:e=>({x:e>0?`-100%`:`100%`})},N={type:`spring`,stiffness:420,damping:42,mass:1},P={position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,overflow:`hidden`};function F(e){let{closeDrawer:t,openDrawer:a,canGoBack:u,goBack:d}=v(),p=g(),_=e.onClose??t,y=e.onSelectCategory??p.onSelectCategory,F=e.onSelectWorkflow??(()=>a(`workflowSelectorForEvaluator`)),L=e.onSelectCode??(()=>a(`codeEvaluatorEditor`)),R=e.open!==!1&&e.open!==void 0,[z,B]=(0,O.useState)({step:`category`});(0,O.useEffect)(()=>{R||B({step:`category`})},[R]);let V=j[z.step],H=(0,O.useRef)(V),U=V>=H.current?1:-1;(0,O.useEffect)(()=>{H.current=V},[V]);let W=z.step===`editor`,G=W?z.evaluatorType:void 0,K=W?z.category:void 0,q=S({open:R&&W,onClose:_,evaluatorType:G,category:K,isOpen:R&&W}),J=e=>{y?.(e),B({step:`type`,category:e})},Y=e=>t=>{B({step:`editor`,category:e,evaluatorType:t})},X=()=>{if(z.step===`editor`){q.flushLocalConfig(),B({step:`type`,category:z.category});return}if(z.step===`type`){B({step:`category`});return}u&&d()},Z=z.step!==`category`||u,Q=z.step===`editor`?(0,k.jsx)(w,{controller:q}):(0,k.jsx)(o,{children:z.step===`type`?E[z.category]:`Choose Evaluator Category`});return(0,k.jsx)(l.Root,{open:R,onOpenChange:({open:e})=>!e&&_(),size:`lg`,modal:!1,children:(0,k.jsxs)(l.Content,{bg:`bg`,children:[(0,k.jsx)(l.CloseTrigger,{}),(0,k.jsx)(l.Header,{children:(0,k.jsxs)(i,{gap:2,minH:`32px`,children:[Z&&(0,k.jsx)(r,{variant:`ghost`,size:`sm`,onClick:X,padding:1,minWidth:`auto`,"data-testid":`back-button`,children:(0,k.jsx)(m,{size:20})}),Q]})}),(0,k.jsx)(l.Body,{display:`flex`,flexDirection:`column`,overflow:`hidden`,padding:0,position:`relative`,children:(0,k.jsxs)(b,{initial:!1,custom:U,mode:`popLayout`,children:[z.step===`category`&&(0,k.jsx)(x.div,{custom:U,variants:M,initial:`enter`,animate:`center`,exit:`exit`,transition:N,style:P,children:(0,k.jsxs)(c,{gap:4,align:`stretch`,flex:1,overflowY:`auto`,children:[(0,k.jsx)(s,{color:`fg.muted`,fontSize:`sm`,paddingX:6,paddingTop:4,children:`Select a category to see available evaluators, or create a custom one.`}),(0,k.jsxs)(c,{gap:3,align:`stretch`,paddingX:6,paddingBottom:4,children:[A.map(e=>(0,k.jsx)(I,{...e,onClick:()=>J(e.id)},e.id)),(0,k.jsx)(n,{borderTopWidth:`1px`,borderColor:`border`,paddingTop:3,children:(0,k.jsxs)(c,{gap:3,align:`stretch`,children:[(0,k.jsx)(I,{id:`code`,icon:f,title:`Custom (Code)`,description:`Write a custom Python evaluator`,onClick:L}),(0,k.jsx)(I,{id:`workflow`,icon:h,title:`Custom (from Workflow)`,description:`Create a new workflow for custom evaluation logic`,onClick:F})]})})]})]})},`category`),z.step===`type`&&(0,k.jsx)(x.div,{custom:U,variants:M,initial:`enter`,animate:`center`,exit:`exit`,transition:N,style:P,children:(0,k.jsx)(D,{category:z.category,onSelect:Y(z.category),onClose:_})},`type-${z.category}`),z.step===`editor`&&(0,k.jsx)(x.div,{custom:U,variants:M,initial:`enter`,animate:`center`,exit:`exit`,transition:N,style:P,children:(0,k.jsx)(T,{controller:q})},`editor-${z.evaluatorType}`)]})}),(0,k.jsx)(l.Footer,{borderTopWidth:`1px`,borderColor:`border`,children:z.step===`editor`?(0,k.jsx)(C,{controller:q,onCancel:_}):(0,k.jsx)(r,{variant:`outline`,onClick:_,children:`Cancel`})})]})})}function I({id:e,icon:t,title:r,description:a,onClick:o}){return(0,k.jsx)(n,{as:`button`,onClick:o,padding:4,borderRadius:`lg`,border:`1px solid`,borderColor:`border`,bg:`bg.panel`,textAlign:`left`,width:`full`,_hover:{borderColor:`green.muted`,bg:`green.subtle`},transition:`all 0.15s`,"data-testid":`evaluator-category-${e}`,children:(0,k.jsxs)(i,{gap:3,align:`start`,children:[(0,k.jsx)(n,{padding:1,borderRadius:`md`,bg:`green.subtle`,color:`green.fg`,children:(0,k.jsx)(t,{size:18})}),(0,k.jsxs)(c,{align:`start`,gap:1,flex:1,children:[(0,k.jsx)(s,{fontWeight:`500`,fontSize:`sm`,children:r}),(0,k.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:a})]})]})})}export{F as EvaluatorCategorySelectorDrawer};
2
- //# sourceMappingURL=EvaluatorCategorySelectorDrawer-DPt4B9Ey.js.map
@@ -1,2 +0,0 @@
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"./personalProject-DMRX2-SI.js";import{n as i}from"./lu-DlSq9Be4.js";import{W as a}from"./index-CPtTUYLD.js";import{i as o,n as s,r as c,t as l}from"./EvaluatorEditorShared-Dlnmyfw9.js";var u=n();function d(n){let{canGoBack:d,goBack:f}=a(),p=n.open!==!1&&n.open!==void 0,m=o({...n,isOpen:p});return(0,u.jsx)(r.Root,{open:p,onOpenChange:({open:e})=>!e&&m.handleClose(),size:`lg`,closeOnInteractOutside:!0,modal:!1,children:(0,u.jsxs)(r.Content,{bg:`bg`,children:[(0,u.jsx)(r.CloseTrigger,{}),(0,u.jsx)(r.Header,{children:(0,u.jsxs)(t,{gap:2,children:[d&&(0,u.jsx)(e,{variant:`ghost`,size:`sm`,onClick:f,padding:1,minWidth:`auto`,"data-testid":`back-button`,children:(0,u.jsx)(i,{size:20})}),(0,u.jsx)(c,{controller:m})]})}),(0,u.jsx)(r.Body,{display:`flex`,flexDirection:`column`,overflow:`hidden`,padding:0,children:(0,u.jsx)(l,{controller:m})}),(0,u.jsx)(r.Footer,{borderTopWidth:`1px`,borderColor:`border`,children:(0,u.jsx)(s,{controller:m})})]})})}export{d as EvaluatorEditorDrawer};
2
- //# sourceMappingURL=EvaluatorEditorDrawer-C1OQ89no.js.map
@@ -1,43 +0,0 @@
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{r 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{Nn as d}from"./ProjectAvatar-DtI9dT1f.js";import{t as f}from"./tooltip-gjZ4s2dt.js";import{a as p}from"./toaster-BsYkODqs.js";import{L as m}from"./Markdown-C9extmbX.js";import{a as h,r as g,t as _}from"./field-BadoNaN5.js";import{l as v,t as y,u as b}from"./errors-e711UMq7.js";import{t as x}from"./spacer-C38e7o6r.js";import{n as S}from"./api-l6Cnm0vQ.js";import"./variables-DF2_abiB.js";import{c as C,n as ee,s as w,u as T}from"./index.esm-Cpy5fWo1.js";import{G as te,I as E,Mr as D,Qn as O,R as k,Vn as A,Vt as ne,W as re,cn as ie,t as j,z as M}from"./index-CPtTUYLD.js";import{t as ae}from"./debounce-BJsF8wQY.js";import{t as oe}from"./useLicenseEnforcement-DOI0dcqD.js";import{t as N}from"./switch-DGatWO8v.js";import{t as P}from"./FieldInfoTooltip-BlO6fteF.js";import{n as se,t as ce}from"./evaluators-6oHFfk5m.js";import{t as le}from"./getEvaluator-irVFciCL.js";import{n as F}from"./VariablesSection-hjZ5pmeK.js";import{n as ue}from"./WorkflowCard-SFB2TN6O.js";import"./types-CCALFpCT.js";import{t as I}from"./DynamicZodForm-lW0sHL84.js";import{n as L,t as R}from"./useTargetName-nPyk8kf-.js";import{t as z}from"./variantDisambiguation-Cqxyafug.js";import{t as B}from"./EvaluatorMappingsSection-uZ95zEz_.js";var V=e(t()),H=e=>{let{project:t}=ne(),n=t?.id??``,r=S.useQueries(t=>e.map(e=>t.prompts.getByIdOrHandle({idOrHandle:e?.promptId??``,projectId:n},{enabled:e?.type===`prompt`&&!!e.promptId&&!!n,staleTime:6e4})));return e.map((e,t)=>{if(!e)return;let n=e.localPromptConfig?.outputs,i=(n??[]).some(e=>e.type===`json_schema`&&!e.json_schema);if(n&&n.length>0&&!i)return n;let a=e.outputs,o=(a??[]).some(e=>e.type===`json_schema`&&!e.json_schema);if(a&&a.length>0&&!o)return a;if(r[t]?.isLoading)return;let s=r[t]?.data?.outputs;return o?s:s??a})},U=[4,3],W=e=>{if(e<=1)return 1;if(e<5)return e;for(let t of U)if(e%t===0)return t;let t=U[0],n=0;for(let r of U){let i=e%r;i>n&&(n=i,t=r)}return t},G=o(),K=`Pick the best of N candidate replies to the task.
2
-
3
- Task: {input}
4
- Reference: {golden}
5
-
6
- Candidates:
7
- {candidates}
8
-
9
- Look across the candidates and decide which one is the best reply.
10
- Briefly explain WHY it's better than the others, then pick the winning
11
- slot label. Use "tie" only when no candidate is clearly better.
12
- `,q=`Pick the best of N candidate replies.
13
-
14
- Reference: {golden}
15
-
16
- Candidates:
17
- {candidates}
18
-
19
- Compare each candidate against the reference answer and decide which one
20
- is closest. Briefly explain WHY it's better than the others, then pick the
21
- winning slot label. Use "tie" only when no candidate is clearly better.
22
- `,J=`Pick the best of N candidate replies to the task — there is no reference
23
- answer, so compare them on their own merits.
24
-
25
- Task: {input}
26
-
27
- Candidates:
28
- {candidates}
29
-
30
- Look across the candidates and decide which one is the best reply.
31
- Briefly explain WHY it's better than the others, then pick the winning
32
- slot label. Use "tie" only when no candidate is clearly better.
33
- `,Y=`Pick the best of N candidate replies — there is no task description or
34
- reference answer, so compare them on their own merits.
35
-
36
- Candidates:
37
- {candidates}
38
-
39
- Look across the candidates and decide which one is the best reply.
40
- Briefly explain WHY it's better than the others, then pick the winning
41
- slot label. Use "tie" only when no candidate is clearly better.
42
- `,X=[K,q,J,Y];function Z({hasGolden:e,hasInput:t}){return e?t?K:q:t?J:Y}function de({value:e,onChange:t,targets:n,datasetColumns:r,datasetName:i}){let[a,o]=(0,V.useState)(e);(0,V.useEffect)(()=>{o(e)},[e]);let s=(0,V.useRef)(a);(0,V.useEffect)(()=>{s.current=a},[a]);let c=e=>{let n={...s.current,...e};s.current=n,o(n),t(n)};return(0,G.jsxs)(u,{align:`stretch`,gap:3,children:[(0,G.jsx)(Q,{draft:a,update:c,targets:n}),(0,G.jsxs)(d,{columns:{base:1,md:2},gap:3,children:[(0,G.jsx)(ge,{draft:a,update:c,datasetColumns:r,datasetName:i}),(0,G.jsx)(_e,{draft:a,update:c,datasetColumns:r,datasetName:i})]}),(0,G.jsx)(ve,{draft:a,update:c}),(0,G.jsx)(ye,{draft:a,update:c})]})}function Q({draft:e,update:t,targets:n}){let r=e.variants??[],a=n.filter(e=>!r.includes(e.id)),o=e.variantOutputPaths??{},s=(0,V.useMemo)(()=>r.map(e=>n.find(t=>t.id===e)),[r,n]),c=L(s),u=H(s),f=(0,V.useMemo)(()=>z(c.map((e,t)=>e||r[t]||`Variant ${t+1}`)),[c,r]),p=e=>t({variants:[...r,e]}),_=e=>{let{[e]:n,...i}=o;t({variants:r.filter(t=>t!==e),variantOutputPaths:Object.keys(i).length?i:void 0})},v=(e,n)=>{let r={...o};n.length>0?r[e]=n:delete r[e],t({variantOutputPaths:Object.keys(r).length?r:void 0})},y=W(r.length);return(0,G.jsxs)(h,{required:!0,flex:`1`,children:[(0,G.jsxs)(g,{fontSize:`13px`,color:`fg.muted`,marginBottom:2,children:[`Variants (pick 2 or more)`,(0,G.jsx)(P,{testId:`comparison-variants-info`,trigger:`hover`,description:`The columns whose outputs are compared. If a column is already scored by its own evaluators, those scores are passed to the judge along with the output, so it can take them into account.`})]}),(0,G.jsx)(d,{columns:y,gap:3,width:`100%`,"data-testid":`comparison-variants-grid`,"data-columns":y,children:r.map((e,t)=>{let r=n.find(t=>t.id===e);return r?(0,G.jsx)(fe,{target:r,name:f[t]??``,outputs:u[t],path:o[e],onPathChange:t=>v(e,t),onRemove:()=>_(e)},e):null})}),(0,G.jsxs)(m.Root,{children:[(0,G.jsx)(m.Trigger,{asChild:!0,children:(0,G.jsxs)(i,{variant:`outline`,colorPalette:`gray`,size:`sm`,fontWeight:`normal`,marginTop:r.length>0?3:0,alignSelf:`start`,"data-testid":`comparison-add-variant`,disabled:a.length===0,children:[(0,G.jsx)(O,{size:14}),(0,G.jsx)(l,{fontSize:`13px`,children:r.length===0?`Add a variant`:`Add another`})]})}),(0,G.jsx)(m.Content,{portalled:!0,maxHeight:`240px`,overflowY:`auto`,children:a.length===0?(0,G.jsx)(m.Item,{value:`__empty__`,disabled:!0,children:(0,G.jsx)(l,{fontSize:`13px`,color:`fg.subtle`,children:`All targets already added`})}):a.map(e=>(0,G.jsx)(he,{target:e,onAdd:()=>p(e.id)},e.id))})]})]})}function fe({target:e,name:t,outputs:n,path:o,onPathChange:s,onRemove:c}){let d=t||e.id,f=me(n??[]),p=(0,V.useMemo)(()=>({id:e.id,name:d,type:e.type===`agent`?`agent`:`signature`,fields:f.map(e=>({name:e.label,type:`str`}))}),[e.id,e.type,d,f]),m=f.find(e=>$(e.path,o??[])),h=m?{type:`source`,sourceId:e.id,path:[m.label]}:void 0;return(0,G.jsxs)(u,{align:`stretch`,gap:1.5,padding:2.5,borderWidth:`1px`,borderColor:`border`,borderRadius:`md`,bg:`bg.subtle`,"data-testid":`comparison-variant-card-${e.id}`,children:[(0,G.jsxs)(a,{justify:`space-between`,gap:1,children:[(0,G.jsx)(l,{fontSize:`13px`,fontWeight:`medium`,lineClamp:1,title:d,children:d}),(0,G.jsx)(i,{variant:`ghost`,size:`xs`,minWidth:`auto`,padding:0,height:`18px`,onClick:c,"aria-label":`Remove ${d}`,"data-testid":`comparison-variant-chip-${e.id}-remove`,children:(0,G.jsx)(A,{size:12})})]}),f.length>1&&(0,G.jsx)(r,{"data-testid":`comparison-variant-output-${e.id}`,children:(0,G.jsx)(F,{mapping:h,availableSources:[p],placeholder:`Whole output`,inputTestId:`comparison-variant-output-${e.id}-input`,onMappingChange:e=>{if(!e){s([]);return}let t=e.type===`source`?e.path.at(-1):e.value;s(f.find(e=>e.label===t)?.path??[])}})})]})}function $(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function pe(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.properties;return!t||typeof t!=`object`||Array.isArray(t)?[]:Object.keys(t)}function me(e){let t=e??[],n=t.length===1;return t.flatMap(e=>{let t=e.type===`json_schema`?pe(e.json_schema):[];if(t.length===0)return[{label:e.identifier,path:[e.identifier]}];let r=t.map(t=>({label:`${e.identifier}.${t}`,path:n&&e.identifier===`output`?[t]:[e.identifier,t]}));return n?r:[{label:e.identifier,path:[e.identifier]},...r]})}function he({target:e,onAdd:t}){let n=R(e)??e.id;return(0,G.jsx)(m.Item,{value:e.id,onClick:t,"data-testid":`comparison-variant-option-${e.id}`,children:(0,G.jsx)(l,{fontSize:`13px`,children:n})})}function ge({draft:e,update:t,datasetColumns:n,datasetName:i}){let a=C(),o=T({control:a?.control,name:`settings.has_golden_answer`}),s=T({control:a?.control,name:`settings.prompt`}),c=(0,V.useCallback)(e=>typeof e==`string`&&X.some(t=>e.trim()===t.trim()),[]);(0,V.useEffect)(()=>{if(!a||typeof o!=`boolean`||typeof s!=`string`||!c(s))return;let e=Z({hasGolden:o!==!1,hasInput:!0});e!==s&&a.setValue(`settings.prompt`,e,{shouldDirty:!0,shouldTouch:!0})},[a,o,s,c]);let l=e=>{a?.setValue(`settings.has_golden_answer`,e,{shouldDirty:!0,shouldTouch:!0}),t({hasGoldenAnswer:e,...e?{}:{goldenField:``}})};(0,V.useEffect)(()=>{typeof o==`boolean`&&o!==e.hasGoldenAnswer&&t({hasGoldenAnswer:o,...o===!1?{goldenField:``}:{}})},[o,e.hasGoldenAnswer]);let u=(0,V.useMemo)(()=>[{id:`dataset`,name:i??`Dataset`,type:`dataset`,fields:n.map(e=>({name:e.name,type:`str`}))}],[n,i]),d=e.goldenField?{type:`source`,sourceId:`dataset`,path:[e.goldenField]}:void 0;return(0,G.jsx)(r,{children:(0,G.jsxs)(h,{required:!0,flex:`1`,children:[(0,G.jsxs)(g,{fontSize:`13px`,color:`fg.muted`,marginBottom:1,children:[`Golden field`,(0,G.jsx)(P,{testId:`comparison-golden-field-info`,trigger:`hover`,description:`The dataset column holding the reference answer the judge compares each candidate against — usually expected_output. Pick None to judge on merits alone.`})]}),(0,G.jsx)(r,{"data-testid":`comparison-golden-field`,children:(0,G.jsx)(F,{mapping:d,availableSources:u,placeholder:`None — judge on merits`,inputTestId:`comparison-golden-field-input`,onMappingChange:e=>{if(!e){l(!1),t({goldenField:``});return}let n=e.type===`source`?e.path.at(-1):e.value;l(!0),t({goldenField:n??``})}})})]})})}function _e({draft:e,update:t,datasetColumns:n,datasetName:i}){let a=(0,V.useMemo)(()=>[{id:`dataset`,name:i??`Dataset`,type:`dataset`,fields:n.map(e=>({name:e.name,type:`str`}))}],[n,i]),o=e.inputField?{type:`source`,sourceId:`dataset`,path:[e.inputField]}:void 0;return(0,G.jsx)(r,{children:(0,G.jsxs)(h,{flex:`1`,children:[(0,G.jsxs)(g,{fontSize:`13px`,color:`fg.muted`,marginBottom:1,children:[`Input field`,(0,G.jsx)(P,{testId:`comparison-input-field-info`,trigger:`hover`,description:`The dataset column that gives the judge task context. Leave on auto to use an input column when one exists.`})]}),(0,G.jsx)(r,{"data-testid":`comparison-input-field`,children:(0,G.jsx)(F,{mapping:o,availableSources:a,placeholder:`Auto-detect input context`,inputTestId:`comparison-input-field-input`,onMappingChange:e=>{if(!e){t({inputField:void 0});return}t({inputField:(e.type===`source`?e.path.at(-1):e.value)??void 0})}})})]})})}function ve({draft:e,update:t}){let n=C(),i=(T({control:n?.control,name:`settings.randomize_order`})??e.randomizeOrder)!==!1,o=e=>{n?.setValue(`settings.randomize_order`,e,{shouldDirty:!0,shouldTouch:!0}),t({randomizeOrder:e})};return(0,G.jsx)(r,{paddingTop:2,children:(0,G.jsxs)(a,{justify:`space-between`,align:`start`,children:[(0,G.jsxs)(a,{gap:0,align:`center`,children:[(0,G.jsx)(l,{fontSize:`13px`,fontWeight:`medium`,children:`Shuffle candidate order`}),(0,G.jsx)(P,{testId:`comparison-randomize-order-info`,trigger:`hover`,description:`Judges tend to favour whichever candidate they read first. Shuffling each row's candidates cancels that out. The same row always gets the same order, so re-running gives you comparable verdicts.`})]}),(0,G.jsx)(N,{checked:i,onCheckedChange:({checked:e})=>o(e),inputProps:{"aria-label":`Shuffle candidate order`},"data-testid":`comparison-randomize-order`})]})})}function ye({draft:e,update:t}){let n=C(),i=T({control:n?.control,name:`settings.include_metrics`})??e.includeMetrics??[],o=(0,V.useCallback)(({metric:e,on:r})=>{let a=r?Array.from(new Set([...i,e])):i.filter(t=>t!==e);n?.setValue(`settings.include_metrics`,a,{shouldDirty:!0,shouldTouch:!0}),t({includeMetrics:a})},[i,n,t]);return(0,G.jsxs)(r,{paddingTop:2,children:[(0,G.jsxs)(a,{gap:0,align:`center`,marginBottom:2,children:[(0,G.jsx)(l,{fontSize:`11px`,fontWeight:`bold`,textTransform:`uppercase`,letterSpacing:`wide`,color:`fg.muted`,children:`Include metrics during judgment`}),(0,G.jsx)(P,{testId:`comparison-include-metrics-info`,trigger:`hover`,description:`Inject per-candidate cost and latency into the judge prompt so it can prefer the cheaper or faster variant when quality is comparable.`})]}),(0,G.jsxs)(u,{align:`stretch`,gap:2,children:[(0,G.jsxs)(a,{justify:`space-between`,children:[(0,G.jsx)(l,{fontSize:`13px`,children:`Include cost`}),(0,G.jsx)(N,{checked:i.includes(`cost`),onCheckedChange:({checked:e})=>o({metric:`cost`,on:e}),inputProps:{"aria-label":`Include cost`},"data-testid":`comparison-include-cost`})]}),(0,G.jsxs)(a,{justify:`space-between`,children:[(0,G.jsx)(l,{fontSize:`13px`,children:`Include duration`}),(0,G.jsx)(N,{checked:i.includes(`duration`),onCheckedChange:({checked:e})=>o({metric:`duration`,on:e}),inputProps:{"aria-label":`Include duration`},"data-testid":`comparison-include-duration`})]})]})]})}var be={variants:[],hasGoldenAnswer:!1,goldenField:``,includeMetrics:[],randomizeOrder:!0},xe=e=>e===`langevals/select_best_compare`||e===`langevals/pairwise_compare`;function Se(e){let{project:t}=ne(),{closeDrawer:n,canGoBack:r,goBack:i}=re(),a=E(),o=te(),s=S.useContext(),{checkAndProceed:c}=oe(`evaluators`),l=e.onClose??n,u=M(`evaluatorEditor`),d=e.onSave??u?.onSave??a.onSave,f=e.evaluatorId??o.evaluatorId??a.evaluatorId,p=e.mappingsConfig??a.mappingsConfig,m=u?.onMappingChange,h=a.comparisonContext,g=u?.onComparisonChange,[_,v]=(0,V.useState)(h?.initialComparison??be),x=h?.initialComparison;(0,V.useEffect)(()=>{v(x??be)},[x]);let C=(0,V.useCallback)(e=>{v(e),g?.(e)},[g]),ee=e.saveButtonText??a.saveButtonText,T=e.onLocalConfigChange??u?.onLocalConfigChange,D=e.initialLocalConfig??a.initialLocalConfig,{isOpen:O}=e,A=S.evaluators.getById.useQuery({id:f??``,projectId:t?.id??``},{enabled:!!f&&!!t?.id&&O}),j=A.data?.type===`workflow`,N=A.data?.config?.evaluatorType,P=e.evaluatorType??o.evaluatorType??a.evaluatorType??N,F=P?ce[P]:void 0,ue=(0,V.useMemo)(()=>{let e=A.data?.fields;return e&&e.length>0?{requiredFields:e.filter(e=>!e.optional).map(e=>e.identifier),optionalFields:e.filter(e=>e.optional).map(e=>e.identifier)}:F},[A.data?.fields,F]),I=(0,V.useMemo)(()=>{if(P)return se.shape[P]?.shape?.settings},[P]),L=S.modelProvider.getResolvedDefault.useQuery({projectId:t?.id??``,featureKey:`prompt.create_default`},{enabled:!!t?.id&&O}),R=S.modelProvider.getResolvedDefault.useQuery({projectId:t?.id??``,featureKey:`analytics.topic_clustering_embeddings`},{enabled:!!t?.id&&O}),z=(0,V.useMemo)(()=>!F||!t?{}:le(F,{defaultModel:L.data?.model??null,embeddingsModel:R.data?.model??null})??{},[F,t,L.data?.model,R.data?.model]),B=!!(P?.startsWith(`langevals/llm_`)&&P!==`langevals/llm_answer_match`),H=w({defaultValues:{name:B?``:F?.name??``,settings:z}}),[U,W]=(0,V.useState)(!1),G=(0,V.useRef)(null);(0,V.useEffect)(()=>{if(!F||f)return;let e=P??F.name??`unknown`;G.current!==e&&(H.reset({name:B?``:F.name,settings:z}),G.current=e)},[F,f,P,z,H,B]);let K=(0,V.useRef)(null),q=(0,V.useRef)(T);q.current=T;let J=(0,V.useRef)(null);(0,V.useEffect)(()=>{if(A.data){let e=A.data.config,t={name:A.data.name,settings:e?.settings??{}};if(K.current=t,J.current!==A.data.id){J.current=A.data.id;let e=D?{name:D.name,settings:D.settings??t.settings}:t;H.reset(e),W(!!D)}}},[A.data,H,D]);let Y=(0,V.useMemo)(()=>ae(e=>{q.current?.(e)},300,{leading:!0}),[]);(0,V.useEffect)(()=>{let e=H.watch(e=>{let t=K.current,n=!1;if(t){let r=e.name?.trim()!==t.name.trim(),i=JSON.stringify(e.settings)!==JSON.stringify(t.settings);n=r||i}else n=!0;W(n),q.current&&(n?Y({name:e.name??``,settings:e.settings}):(Y.cancel(),q.current(void 0)))});return()=>{e.unsubscribe(),Y.cancel()}},[H,Y]);let X=S.evaluators.create.useMutation({onSuccess:e=>{s.evaluators.getAll.invalidate({projectId:t?.id??``}),q.current?.(void 0),!(M(`evaluatorEditor`)?.onSave??d)?.({id:e.id,name:e.name,evaluatorType:P})&&(k().length>1?i():l())},onError:e=>{b({error:e,form:H,hasFormErrorSlot:!0})||y({error:e,fallbackTitle:`Couldn't create evaluator`})}}),Z=S.evaluators.update.useMutation({onSuccess:e=>{s.evaluators.getAll.invalidate({projectId:t?.id??``}),s.evaluators.getById.invalidate({id:e.id,projectId:t?.id??``}),q.current?.(void 0);let n=e.config;K.current={name:e.name,settings:n?.settings??{}},W(!1),!(M(`evaluatorEditor`)?.onSave??d)?.({id:e.id,name:e.name})&&(k().length>1?i():l())},onError:e=>{b({error:e,form:H,hasFormErrorSlot:!0})||y({error:e,fallbackTitle:`Couldn't save evaluator`})}}),de=X.isPending||Z.isPending,Q=H.watch(`name`),fe=!xe(P)||_.variants.filter(Boolean).length>=2,$=!!Q&&Q.trim().length>0&&fe,pe=(0,V.useCallback)(()=>{if(!t?.id||!$)return;if(f&&j){let e=H.getValues().name.trim();if(e!==(A.data?.name?.trim()??``))Z.mutate({id:f,projectId:t.id,name:e});else{if((M(`evaluatorEditor`)?.onSave??d)?.({id:f,name:A.data?.name??``}))return;k().length>1?i():l()}return}if(!P)return;let e=H.getValues(),n={evaluatorType:P,settings:e.settings};f?Z.mutate({id:f,projectId:t.id,name:e.name.trim(),config:n}):c(()=>{X.mutate({projectId:t.id,name:e.name.trim(),type:`evaluator`,config:n})})},[t?.id,f,P,j,$,H,X,Z,c,d,l,i,A.data?.name]),me=(0,V.useCallback)(()=>{if(U){if(T){Y.flush(),l();return}if(!window.confirm(`You have unsaved changes. Are you sure you want to close?`))return}r?i():l()},[U,T,r,i,l,Y]),he=(0,V.useCallback)(()=>{K.current&&(Y.cancel(),H.reset(K.current),W(!1),T?.(void 0))},[H,T,Y]),ge=(0,V.useCallback)(()=>{Y.flush(),l()},[Y,l]),_e=(0,V.useCallback)(()=>{Y.flush()},[Y]),ve=I instanceof ie&&Object.keys(I.shape).length>0,ye=F?.name??`Configure Evaluator`,Se=A.data?.workflowId?{workflowId:A.data.workflowId,workflowName:A.data.workflowName,workflowIcon:A.data.workflowIcon,updatedAt:A.data.updatedAt}:void 0;return{form:H,evaluatorId:f,evaluatorType:P,evaluatorDef:F,effectiveEvaluatorDef:ue,isLoadingEvaluator:A.isLoading,workflowCard:Se,isWorkflowEvaluator:j,hasSettings:ve,settingsSchema:I,projectSlug:t?.slug,hasUnsavedChanges:U,isSaving:de,isValid:$,saveButtonText:ee,mappingsConfig:p,onMappingChange:m,comparisonContext:h,expectsComparisonContext:!!o.targetId,comparison:_,onComparisonChange:g?C:void 0,onLocalConfigChange:T,title:ye,handleSave:pe,handleClose:me,handleDiscard:he,handleApply:ge,flushLocalConfig:_e}}function Ce({controller:e}){let{form:t,evaluatorId:i,evaluatorType:o,evaluatorDef:s,effectiveEvaluatorDef:c,isLoadingEvaluator:d,workflowCard:f,isWorkflowEvaluator:m,hasSettings:y,settingsSchema:b,projectSlug:x,mappingsConfig:S,onMappingChange:C,comparisonContext:w,expectsComparisonContext:T,comparison:te,onComparisonChange:E}=e,O=xe(o);return i&&d||O&&!w&&T?(0,G.jsx)(a,{justify:`center`,paddingY:8,children:(0,G.jsx)(n,{size:`md`})}):(0,G.jsx)(ee,{...t,children:(0,G.jsxs)(u,{gap:4,align:`stretch`,flex:1,paddingX:6,paddingY:4,overflowY:`auto`,children:[(0,G.jsx)(v,{form:t}),s?.description&&(0,G.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:s.description}),(0,G.jsxs)(h,{required:!0,invalid:!!t.formState.errors.name,children:[(0,G.jsx)(g,{children:`Evaluator Name`}),(0,G.jsx)(D,{...t.register(`name`),placeholder:`Enter evaluator name`,"data-testid":`evaluator-name-input`}),(0,G.jsx)(_,{children:t.formState.errors.name?.message})]}),y&&o&&b&&(0,G.jsx)(I,{schema:b,evaluatorType:o,prefix:`settings`,errors:t.formState.errors.settings,variant:`default`,skipFields:O?[`swap_and_confirm`,`randomize_order`,`allow_tie`,`has_golden_answer`,`include_metrics`]:void 0}),m&&f&&(0,G.jsxs)(u,{gap:4,paddingTop:4,align:`stretch`,children:[(0,G.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:`This evaluator is powered by a workflow. Click below to open the workflow editor:`}),(0,G.jsx)(j,{href:`/${x}/studio/${f.workflowId}`,"data-testid":`open-workflow-link`,target:`_blank`,children:(0,G.jsx)(ue,{name:f.workflowName??`Workflow`,icon:f.workflowIcon,updatedAt:f.updatedAt,action:(0,G.jsx)(p,{size:16,color:`var(--chakra-colors-fg-muted)`}),width:`300px`})})]}),!y&&!O&&(!S||!C)&&!m&&(0,G.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:`This evaluator does not have any settings to configure.`}),O&&w&&E&&(0,G.jsx)(r,{paddingTop:4,children:(0,G.jsx)(de,{value:te,onChange:E,targets:w.targets,datasetColumns:w.datasetColumns,datasetName:w.datasetName})}),!O&&S&&C&&(0,G.jsx)(r,{paddingTop:4,children:(0,G.jsx)(B,{evaluatorDef:c,level:S.level,providedSources:S.availableSources,initialMappings:S.initialMappings,onMappingChange:C,scrollToMissingOnMount:!0})})]})})}function we({controller:e,onCancel:t}){let{evaluatorId:n,hasUnsavedChanges:r,isSaving:o,isValid:s,saveButtonText:c,onLocalConfigChange:l,onComparisonChange:u,handleSave:d,handleDiscard:f,handleApply:p,handleClose:m}=e,h=!!u;return l?(0,G.jsxs)(a,{width:`full`,children:[r&&(0,G.jsx)(i,{variant:`outline`,size:`sm`,onClick:f,"data-testid":`evaluator-discard-button`,children:`Discard`}),(0,G.jsx)(x,{}),(0,G.jsx)(i,{variant:`outline`,size:`sm`,onClick:d,disabled:!s||o,loading:o,"data-testid":`evaluator-save-button`,children:`Save`}),(0,G.jsx)(i,{colorPalette:`blue`,size:`sm`,onClick:p,disabled:h&&(!s||o),"data-testid":`evaluator-apply-button`,children:`Apply`})]}):(0,G.jsxs)(a,{gap:3,children:[(0,G.jsx)(i,{variant:`outline`,onClick:t??m,children:`Cancel`}),(0,G.jsx)(i,{colorPalette:`green`,onClick:d,disabled:!s||o,loading:o,"data-testid":`save-evaluator-button`,children:c??(n?`Save Changes`:`Create Evaluator`)})]})}function Te({controller:e}){let{title:t,hasUnsavedChanges:n,onLocalConfigChange:r}=e;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(c,{children:t}),n&&r&&(0,G.jsx)(f,{content:`Unpublished modifications`,positioning:{placement:`top`},openDelay:0,showArrow:!0,children:(0,G.jsx)(s,{size:`10px`,bg:`orange.400`})})]})}export{Se as i,we as n,Te as r,Ce as t};
43
- //# sourceMappingURL=EvaluatorEditorShared-Dlnmyfw9.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,dn as t,n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i,t as a}from"./v-stack-hkuSkmCA.js";import{o}from"./toaster-BsYkODqs.js";import{K as s}from"./Markdown-C9extmbX.js";import{n as c}from"./personalProject-DMRX2-SI.js";import{n as l}from"./api-l6Cnm0vQ.js";import{t as u}from"./square-pen-BeEJLs7r.js";import{t as d}from"./arrow-up-BNJSVMQt.js";import{t as f}from"./refresh-cw-CjWtrqB1.js";import{D as p,Tr as m,Vn as h,Vt as g,W as _}from"./index-CPtTUYLD.js";var v=r(),y={"evaluators.create":{label:`Created`,icon:m},"evaluators.update":{label:`Updated`,icon:u},"evaluators.delete":{label:`Deleted`,icon:s},"evaluators.cascadeArchive":{label:`Archived`,icon:s},"evaluators.copy":{label:`Replicated`,icon:o},"evaluators.pushToCopies":{label:`Pushed to replicas`,icon:d},"evaluators.syncFromSource":{label:`Synced from source`,icon:f}};function b(e){return y[e]??{label:e,icon:h}}function x({evaluatorId:r,evaluatorName:o}){let{closeDrawer:s}=_(),{project:u}=g(),{data:d,isLoading:f,isError:m}=l.evaluators.getHistory.useQuery({evaluatorId:r,projectId:u?.id??``},{enabled:!!u?.id&&!!r});return(0,v.jsx)(c.Root,{open:!0,placement:`end`,size:`md`,onOpenChange:s,children:(0,v.jsxs)(c.Content,{bg:`bg`,children:[(0,v.jsxs)(c.Header,{children:[(0,v.jsx)(i,{fontWeight:`semibold`,fontSize:`lg`,children:`${o} history`}),(0,v.jsx)(c.CloseTrigger,{})]}),(0,v.jsxs)(c.Body,{children:[f&&(0,v.jsx)(n,{justify:`center`,paddingY:8,children:(0,v.jsx)(e,{})}),m&&(0,v.jsx)(i,{role:`alert`,color:`red.fg`,textAlign:`center`,paddingY:8,children:`Failed to load history.`}),!f&&!m&&(!d||d.length===0)&&(0,v.jsx)(i,{color:`fg.muted`,textAlign:`center`,paddingY:8,children:`No history recorded yet.`}),d&&d.length>0&&(0,v.jsx)(a,{gap:0,align:`stretch`,children:d.map((e,r)=>{let{label:o,icon:s}=b(e.action),c=r===d.length-1;return(0,v.jsxs)(n,{align:`start`,gap:3,children:[(0,v.jsxs)(a,{gap:0,align:`center`,flexShrink:0,width:`24px`,children:[(0,v.jsx)(t,{bg:`blue.subtle`,borderRadius:`full`,padding:1,mt:`2px`,children:(0,v.jsx)(s,{size:12,color:`var(--chakra-colors-blue-fg)`})}),!c&&(0,v.jsx)(t,{width:`1px`,flex:1,minHeight:`24px`,bg:`border.muted`})]}),(0,v.jsxs)(a,{align:`start`,gap:0,paddingBottom:4,flex:1,children:[(0,v.jsx)(i,{fontWeight:`medium`,fontSize:`sm`,children:o}),(0,v.jsxs)(i,{color:`fg.muted`,fontSize:`xs`,children:[e.user?.name??e.user?.email??`Unknown user`,` `,`· `,p(new Date(e.createdAt).getTime())]})]})]},e.id)})})]})]})})}export{x as EvaluatorHistoryDrawer};
2
- //# sourceMappingURL=EvaluatorHistoryDrawer-BFqreRNY.js.map
@@ -1,2 +0,0 @@
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"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{L as u,r as d}from"./Markdown-C9extmbX.js";import{t as f}from"./icon-button-Wlb_dGXL.js";import{n as p}from"./personalProject-DMRX2-SI.js";import{n as m}from"./api-l6Cnm0vQ.js";import{t as h}from"./circle-check-big-D-K-PM08.js";import{t as g}from"./code-MiD0yvEx.js";import{Wt as _,_n as v,q as y}from"./lu-DlSq9Be4.js";import{Hn as b,I as x,Qn as S,Vt as C,W as w,lt as T,z as E}from"./index-CPtTUYLD.js";import{t as D}from"./evaluators-6oHFfk5m.js";import"./types-CCALFpCT.js";import{n as O}from"./EvaluatorSelection-CLClnlPT.js";import{t as k}from"./EvaluatorApiUsageDialog-Bnv6z6m_.js";var A=e(t()),j=o();function M(e){let{project:t}=C(),{closeDrawer:r,openDrawer:o}=w(),c=x(),u=m.useContext(),f=E(`evaluatorList`),h=e.onClose??r,g=e.onSelect??f?.onSelect??c.onSelect,_=e.onCreateNew??f?.onCreateNew??c.onCreateNew??(()=>o(`evaluatorCategorySelector`)),v=e.open!==!1&&e.open!==void 0,y=e.title??`Choose Evaluator`,b=e.createLabel??`New Evaluator`,T=e.itemLabel??`evaluator`,D=m.evaluators.getAll.useQuery({projectId:t?.id??``},{enabled:!!t?.id&&v}),O=e.filterEvaluatorType?D.data?.filter(t=>t.config?.evaluatorType===e.filterEvaluatorType):D.data?.filter(e=>{let t=e.config?.evaluatorType;return t!==`langevals/select_best_compare`&&t!==`langevals/pairwise_compare`}),M=m.evaluators.delete.useMutation({onSuccess:()=>{u.evaluators.getAll.invalidate({projectId:t?.id??``})}}),P=e=>{g?.(e)},I=e=>{if(e.type===`code`){o(`codeEvaluatorEditor`,{evaluatorId:e.id});return}let t=e.config;o(`evaluatorEditor`,{evaluatorId:e.id,evaluatorType:t?.evaluatorType})},L=e=>{V(e)},[R,z]=(0,A.useState)(null),[B,V]=(0,A.useState)(null),H=e=>{z(e)};return(0,j.jsxs)(p.Root,{open:v,onOpenChange:({open:e})=>!e&&h(),size:`md`,modal:!1,children:[(0,j.jsxs)(p.Content,{bg:`bg`,children:[(0,j.jsx)(p.CloseTrigger,{}),(0,j.jsx)(p.Header,{children:(0,j.jsxs)(a,{gap:2,justify:`space-between`,width:`full`,children:[(0,j.jsx)(s,{children:y}),(0,j.jsxs)(i,{size:`sm`,colorScheme:`blue`,onClick:_,"data-testid":`new-evaluator-button`,children:[(0,j.jsx)(S,{size:16}),b]})]})}),(0,j.jsx)(p.Body,{display:`flex`,flexDirection:`column`,overflow:`hidden`,padding:0,children:(0,j.jsx)(l,{gap:4,align:`stretch`,flex:1,overflow:`hidden`,children:(0,j.jsx)(l,{gap:2,align:`stretch`,flex:1,overflowY:`auto`,paddingX:6,paddingBottom:4,children:D.isLoading?(0,j.jsx)(a,{justify:`center`,paddingY:8,children:(0,j.jsx)(n,{size:`md`})}):O?.length===0?(0,j.jsx)(N,{onCreateNew:_,itemLabel:T}):O?.map(e=>(0,j.jsx)(F,{evaluator:e,onClick:()=>P(e),onEdit:()=>I(e),onDelete:()=>L(e),onUseFromApi:()=>H(e)},e.id))})})}),(0,j.jsx)(p.Footer,{borderTopWidth:`1px`,borderColor:`border`,children:(0,j.jsx)(i,{variant:`outline`,onClick:h,children:`Cancel`})})]}),(0,j.jsx)(k,{evaluator:R,open:!!R,onClose:()=>z(null)}),(0,j.jsx)(d,{open:!!B,onOpenChange:e=>{e||V(null)},title:`Delete evaluator`,message:`Are you sure you want to delete "${B?.name??``}"?`,confirmLabel:`Delete`,tone:`danger`,loading:M.isLoading,onConfirm:()=>{B&&M.mutate({id:B.id,projectId:t?.id??``},{onSettled:()=>V(null)})}})]})}function N({onCreateNew:e,itemLabel:t}){return(0,j.jsxs)(l,{paddingY:24,gap:4,textAlign:`center`,children:[(0,j.jsx)(r,{padding:4,borderRadius:`full`,bg:`green.subtle`,color:`green.fg`,children:(0,j.jsx)(h,{size:32})}),(0,j.jsxs)(l,{gap:1,children:[(0,j.jsxs)(c,{fontWeight:`medium`,color:`fg`,children:[`No `,t,`s yet`]}),(0,j.jsxs)(c,{fontSize:`sm`,color:`fg.muted`,children:[`Create your first `,t,` to get started`]})]}),(0,j.jsxs)(i,{colorScheme:`blue`,onClick:e,"data-testid":`create-first-evaluator-button`,children:[(0,j.jsx)(S,{size:16}),`Create your first ${t}`]})]})}var P=e=>{if(!e)return``;let t=D[e];return t?O[t.name]??t.name:e};function F({evaluator:e,onClick:t,onEdit:n,onDelete:i,onUseFromApi:o}){let s=e.config?.evaluatorType??``,d=e.type===`workflow`?`Workflow`:e.type===`code`?`Code`:P(s);return(0,j.jsx)(r,{role:`button`,tabIndex:0,cursor:`pointer`,onClick:t,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},padding:4,borderRadius:`md`,border:`1px solid`,borderColor:`border`,bg:`bg.panel`,textAlign:`left`,width:`full`,_hover:{borderColor:`green.muted`,bg:`green.subtle`},transition:`all 0.15s`,"data-testid":`evaluator-card-${e.id}`,position:`relative`,children:(0,j.jsxs)(a,{gap:3,align:`start`,children:[(0,j.jsx)(r,{color:`green.fg`,paddingTop:1,children:e.type===`workflow`?(0,j.jsx)(b,{size:16}):e.type===`code`?(0,j.jsx)(g,{size:16}):(0,j.jsx)(h,{size:16})}),(0,j.jsxs)(l,{align:`start`,gap:0,flex:1,children:[(0,j.jsx)(c,{fontWeight:`medium`,fontSize:`13px`,children:e.name}),(0,j.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,lineClamp:1,children:[d&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{children:d}),(0,j.jsx)(`span`,{style:{margin:`0 4px`},children:` • `})]}),(0,j.jsxs)(`span`,{children:[`Updated`,` `,T(new Date(e.updatedAt),{addSuffix:!0})]})]})]}),(0,j.jsxs)(u.Root,{children:[(0,j.jsx)(u.Trigger,{asChild:!0,children:(0,j.jsx)(f,{variant:`ghost`,size:`xs`,"aria-label":`Actions`,onClick:e=>e.stopPropagation(),"data-testid":`evaluator-menu-${e.id}`,children:(0,j.jsx)(y,{})})}),(0,j.jsxs)(u.Content,{children:[(0,j.jsxs)(u.Item,{value:`edit`,onClick:e=>{e.stopPropagation(),n()},"data-testid":`evaluator-edit-${e.id}`,children:[(0,j.jsx)(_,{size:14}),`Edit`]}),(0,j.jsxs)(u.Item,{value:`use-from-api`,onClick:e=>{e.stopPropagation(),o()},"data-testid":`evaluator-use-api-${e.id}`,children:[(0,j.jsx)(g,{size:14}),`Use via API`]}),(0,j.jsxs)(u.Item,{value:`delete`,onClick:e=>{e.stopPropagation(),i()},color:`red.500`,"data-testid":`evaluator-delete-${e.id}`,children:[(0,j.jsx)(v,{size:14}),`Delete`]})]})]})]})})}export{M as EvaluatorListDrawer};
2
- //# sourceMappingURL=EvaluatorListDrawer-B5GkvEER.js.map
@@ -1,2 +0,0 @@
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{n as i}from"./v-stack-hkuSkmCA.js";import{f as a}from"./trpcError-CFsR-0nB.js";import"./variables-DF2_abiB.js";import{Vt as o}from"./index-CPtTUYLD.js";import{c as s,l as c}from"./tracesMapping-DpjIOyAg.js";import{t as l}from"./useProjectSpanNames-jFO9A6Re.js";import{t as u}from"./VariablesSection-hjZ5pmeK.js";import{i as d}from"./mappingValidation-C-AT88B0.js";var f=e(t()),p=r();a(`EvaluatorMappingsSection`);function m({evaluatorDef:e,level:t,providedSources:r,initialMappings:a,onMappingChange:m,scrollToMissingOnMount:h=!1,variant:g}){let{project:_}=o(),{spanNames:v,metadataKeys:y}=l({projectId:r?void 0:_?.id}),b=(0,f.useMemo)(()=>r||(t===`thread`?s():c(v,y)),[r,t,v,y]),[x,S]=(0,f.useState)(a),C=(0,f.useRef)(null),w=(0,f.useRef)(!1);(0,f.useEffect)(()=>{S(a)},[a]);let T=(0,f.useMemo)(()=>{let t=e?.requiredFields??[],n=e?.optionalFields??[],r=[...t,...n],i=d(t,n,x),a=new Set(i.missingRequiredFields);return!i.hasAnyMapping&&i.missingRequiredFields.length===0&&r.length>0&&a.add(r[0]),a},[e,x]);(0,f.useEffect)(()=>{if(h&&!w.current&&T.size>0&&C.current){let e=setTimeout(()=>{let e=Array.from(T)[0],t=C.current?.querySelector(`[data-testid="missing-mapping-input"], [data-variable-id="${e}"]`);t?t.scrollIntoView({behavior:`smooth`,block:`center`}):C.current?.scrollIntoView({behavior:`smooth`,block:`start`}),w.current=!0},100);return()=>clearTimeout(e)}},[h,T]);let E=(0,f.useCallback)((e,t)=>{S(n=>{let r={...n};return t?r[e]=t:delete r[e],r}),m&&m(e,t)},[m]),D=(0,f.useMemo)(()=>[...e?.requiredFields??[],...e?.optionalFields??[]].map(e=>({identifier:e,type:`str`})),[e]);return D.length===0?(0,p.jsx)(i,{fontSize:`sm`,color:`fg.muted`,children:`This evaluator does not require any input mappings.`}):(0,p.jsx)(n,{ref:C,children:(0,p.jsx)(u,{title:`Variables`,variables:D,onChange:()=>{},showMappings:!0,availableSources:b,mappings:x,onMappingChange:E,readOnly:!0,missingMappingIds:T,showMissingMappingsError:g!==`studio`})})}export{m as t};
2
- //# sourceMappingURL=EvaluatorMappingsSection-uZ95zEz_.js.map
@@ -1,2 +0,0 @@
1
- import{dn as e,n as t}from"./portal-Sdfvrza9.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{t as r}from"./heading-C0sACr0w.js";import{n as i,t as a}from"./v-stack-hkuSkmCA.js";import{t as o}from"./badge-Cpc3eA-C.js";import{t as s}from"./tooltip-gjZ4s2dt.js";import{t as c}from"./grid-DVy6ELOp.js";import{t as l}from"./grid-item-CKAuKzga.js";import{i as u,o as d,r as f,t as p}from"./tabs-U8n5D55_.js";import{i as m,r as h}from"./tag-BN5IoWjW.js";import{n as g}from"./api-l6Cnm0vQ.js";import{r as _}from"./next-router-CWLrMXvP.js";import{Vt as v,en as y,n as b,t as x}from"./index-CPtTUYLD.js";import{t as S}from"./plus-10dP8Fmk.js";import{t as C}from"./shield-Da9CJWs3.js";import{i as w}from"./stringCasing-Cx6SsTTf.js";import{t as T}from"./evaluators-6oHFfk5m.js";var E=e=>window.location.search.includes(e)?new URLSearchParams(window.location.search).get(e)===`1`:!!y[e],D=n(),O={"Azure Content Safety":`Content Safety`,"OpenAI Moderation":`Moderation`,"Azure Jailbreak Detection":`Jailbreak Detection`,"Presidio PII Detection":`PII Detection`,"Lingua Language Detection":`Language Detection`,"Azure Prompt Shield":`Prompt Injection Detection`},k=[`ragas/faithfulness`,`ragas/response_context_precision`,`ragas/response_context_recall`,`ragas/response_relevancy`,`ragas/summarization_score`,`lingua/language_detection`,`langevals/valid_format`,`ragas/factual_correctness`];function A({form:n}){let y=_(),{project:A}=v(),j=y.query.tab??`safety`,M=g.evaluations.availableEvaluators.useQuery({projectId:A?.id??``},{enabled:!!A}),N=g.evaluations.availableCustomEvaluators.useQuery({projectId:A?.id??``},{enabled:!!A}),P=[...Object.entries(M.data??T).filter(([e,t])=>!e.startsWith(`example/`)&&!e.startsWith(`legacy/`)).sort(([e,t],[n,r])=>{let i=k.indexOf(e),a=k.indexOf(n);return i===-1?999:a===-1?-999:i-a}),...(N.data??[]).map(e=>[`custom/${e.id}`,{name:e.name,description:e.description,category:`custom`,requiredFields:[]}])],F=[`safety`,`policy`,`rag`,`quality`,`custom`],I={};for(let e of F)I[e]=P.filter(t=>Array.isArray(t)&&typeof t[1]==`object`&&`category`in t[1]&&t[1].category===e);return E(`NEXT_PUBLIC_FEATURE_BETA_ANNOTATIONS_TRAINED`)&&I.custom.push([`custom`,{name:`Automated Annotations Evaluator`,description:`Optimize your own evaluator, fine-tuned on your project's annotation scores to mimic human review scores and reasoning and automatically evaluate messages just like your team members would`,category:`custom`,isGuardrail:!1,requiredFields:[],optionalFields:[],settings:{},result:{},beta:!0,envVars:[],missingEnvVars:[]}]),(0,D.jsxs)(u,{colorPalette:`orange`,defaultValue:j,value:j,onValueChange:e=>{y.replace({pathname:y.pathname,query:{...y.query,tab:e.value}})},children:[(0,D.jsx)(f,{children:Object.keys(I).map(e=>(0,D.jsx)(d,{value:e,children:w(e)},e))}),Object.entries(I).map(([u,d])=>(0,D.jsx)(p,{value:u,paddingX:0,children:(0,D.jsxs)(c,{templateColumns:`repeat(3, 1fr)`,gap:6,children:[d.map(([c,u])=>{let d=!!u.unavailable||u.missingEnvVars&&u.missingEnvVars.length>0;return(0,D.jsx)(l,{width:`full`,padding:6,borderRadius:6,boxShadow:`0px 4px 10px 0px rgba(0, 0, 0, 0.06)`,cursor:d?`default`:`pointer`,role:`button`,_hover:d?void 0:{background:`gray.200`},onClick:()=>{d||(n.setValue(`checkType`,c),y.push({pathname:y.pathname.replace(`/choose`,``),query:y.query}))},color:d?`gray.400`:void 0,background:d?`gray.50`:`white`,children:(0,D.jsxs)(a,{align:`start`,gap:4,position:`relative`,children:[u.isGuardrail&&(0,D.jsx)(s,{content:`This evaluator can be used as a guardrail`,positioning:{placement:`top`},children:(0,D.jsx)(e,{position:`absolute`,right:`-12px`,top:`-12px`,background:`blue.100`,borderRadius:`100%`,padding:`4px`,children:(0,D.jsx)(C,{})})}),(0,D.jsxs)(t,{children:[u.beta&&(0,D.jsx)(m,{size:`sm`,colorPalette:`pink`,paddingX:2,fontSize:`14px`,marginLeft:`-4px`,children:(0,D.jsx)(h,{children:`Beta`})}),(0,D.jsx)(r,{as:`h2`,size:`sm`,children:O[u.name]??u.name})]}),u.unavailable&&(0,D.jsx)(s,{content:u.unavailable.howToEnable,positioning:{placement:`top`},children:(0,D.jsx)(m,{colorPalette:`orange`,borderRadius:`8px`,padding:`4px 8px`,lineHeight:`1.5em`,children:(0,D.jsx)(h,{children:`Not installed on this server`})})}),!u.unavailable&&u.missingEnvVars&&u.missingEnvVars.length>0&&(0,D.jsx)(s,{content:u.missingEnvVars.join(`, `),positioning:{placement:`top`},children:(0,D.jsx)(m,{colorPalette:`orange`,borderRadius:`8px`,padding:`4px 8px`,lineHeight:`1.5em`,children:(0,D.jsx)(h,{children:`Evaluator disabled, missing env vars`})})}),(0,D.jsx)(i,{children:u.description.replace(`Google DLP PII detects`,`Detects`)}),(0,D.jsxs)(t,{wrap:`wrap`,children:[u.requiredFields.includes(`contexts`)&&(0,D.jsx)(x,{asChild:!0,href:`https://docs.langwatch.ai/rags/rags-context-tracking`,target:`_blank`,rel:`noopener noreferrer`,children:(0,D.jsx)(b,{href:`https://docs.langwatch.ai/rags/rags-context-tracking`,children:(0,D.jsx)(s,{content:`Only messages with contexts can run this evaluation, click for more info`,positioning:{placement:`top`},children:(0,D.jsx)(o,{colorPalette:`orange`,whiteSpace:`nowrap`,children:`Requires Contexts`})})})}),u.requiredFields.includes(`expected_output`)&&(0,D.jsx)(x,{asChild:!0,href:`https://docs.langwatch.ai/docs/expected_output`,target:`_blank`,rel:`noopener noreferrer`,children:(0,D.jsx)(b,{href:`https://docs.langwatch.ai/docs/expected_output`,children:(0,D.jsx)(s,{content:`Only messages with expected outputs can run this evaluation, click for more info`,positioning:{placement:`top`},children:(0,D.jsx)(o,{colorPalette:`blue`,backgroundColor:`blue.50`,color:`blue.700`,whiteSpace:`nowrap`,children:`Requires Expected Output`})})})}),u.requiredFields.includes(`expected_contexts`)&&(0,D.jsx)(x,{asChild:!0,href:`https://docs.langwatch.ai/docs/expected_contexts`,target:`_blank`,rel:`noopener noreferrer`,children:(0,D.jsx)(b,{href:`https://docs.langwatch.ai/docs/expected_contexts`,children:(0,D.jsx)(s,{content:`Only messages with expected contexts can run this evaluation, click for more info`,positioning:{placement:`top`},children:(0,D.jsx)(o,{colorPalette:`purple`,backgroundColor:`purple.50`,color:`purple.700`,whiteSpace:`nowrap`,children:`Requires Expected Contexts`})})})})]})]})},c)}),u===`custom`&&(0,D.jsx)(l,{as:x,href:`/${A?.slug}/workflows`,border:`dashed`,borderColor:`border.emphasized`,borderWidth:3,borderRadius:6,padding:6,display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`200px`,_hover:{background:`gray.50`,textDecoration:`none`},children:(0,D.jsxs)(a,{gap:3,children:[(0,D.jsx)(e,{p:3,borderRadius:`full`,bg:`bg.muted`,children:(0,D.jsx)(S,{size:24,color:`gray`})}),(0,D.jsx)(i,{color:`fg.muted`,children:`Create Custom Evaluator`})]})})]})},u))]})}export{O as n,A as t};
2
- //# sourceMappingURL=EvaluatorSelection-CLClnlPT.js.map
@@ -1,2 +0,0 @@
1
- import{dn as e,i as t,n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i,t as a}from"./v-stack-hkuSkmCA.js";import{$ as o}from"./immer-CFru3D02.js";import{t as s}from"./circle-check-big-D-K-PM08.js";var c=r();function l({selectedEvaluator:r,onSelectClick:l,onEditClick:u,placeholder:d=`Select Evaluator`,showSlug:f=!1}){return r?(0,c.jsx)(t,{onClick:u??l,variant:`outline`,width:`full`,paddingX:4,borderRadius:`xl`,cursor:`pointer`,size:`2xl`,fontSize:`14px`,boxShadow:`inset 0 -2px 5px 0px rgba(0, 0, 0, 0.03)`,children:(0,c.jsxs)(n,{justify:`space-between`,width:`full`,children:[(0,c.jsxs)(n,{gap:3,children:[(0,c.jsx)(e,{color:`green.500`,children:(0,c.jsx)(s,{size:20})}),(0,c.jsxs)(a,{width:`full`,align:`start`,lineHeight:1,textAlign:`left`,children:[(0,c.jsx)(i,{fontWeight:`medium`,lineClamp:1,children:r.name}),f&&r.slug&&(0,c.jsx)(i,{fontSize:`xs`,color:`gray.500`,fontFamily:`mono`,fontWeight:`normal`,lineClamp:1,children:r.slug})]})]}),(0,c.jsx)(e,{color:`gray.400`,children:(0,c.jsx)(o,{size:20})})]})}):(0,c.jsx)(t,{onClick:l,variant:`outline`,width:`full`,paddingX:4,borderRadius:`xl`,cursor:`pointer`,size:`2xl`,fontSize:`14px`,boxShadow:`inset 0 -2px 5px 0px rgba(0, 0, 0, 0.03)`,children:(0,c.jsxs)(n,{justify:`space-between`,width:`full`,children:[(0,c.jsx)(i,{color:`gray.500`,children:d}),(0,c.jsx)(e,{color:`gray.400`,children:(0,c.jsx)(o,{size:20})})]})})}export{l as t};
2
- //# sourceMappingURL=EvaluatorSelectionBox-VWh5DBap.js.map
@@ -1,2 +0,0 @@
1
- import{dn as e,i as t,n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i,t as a}from"./v-stack-hkuSkmCA.js";import{t as o}from"./tooltip-gjZ4s2dt.js";import{n as s}from"./api-l6Cnm0vQ.js";import{r as c}from"./next-router-CWLrMXvP.js";import{Y as l}from"./lu-DlSq9Be4.js";import{Vt as u,W as d}from"./index-CPtTUYLD.js";import{t as f}from"./evaluators-6oHFfk5m.js";var p=r(),m={"langevals/exact_match":`expected_answer`,"langevals/llm_answer_match":`expected_answer`,"ragas/factual_correctness":`expected_answer`,"ragas/rouge_score":`expected_answer`,"ragas/bleu_score":`expected_answer`,"langevals/llm_boolean":`llm_judge`,"langevals/llm_score":`llm_judge`,"langevals/llm_category":`llm_judge`,"ragas/faithfulness":`rag`,"ragas/response_relevancy":`rag`,"ragas/response_context_recall":`rag`,"ragas/response_context_precision":`rag`,"ragas/context_f1":`rag`,"langevals/sentiment":`quality`,"lingua/language_detection":`quality`,"ragas/summarization_score":`quality`,"langevals/valid_format":`quality`,"langevals/query_resolution":`quality`,"ragas/sql_query_equivalence":`quality`,"ragas/rubrics_based_scoring":`llm_judge`,"presidio/pii_detection":`safety`,"langwatch/api_keys_and_secrets_detection":`safety`,"azure/prompt_injection":`safety`,"azure/jailbreak":`safety`,"azure/content_safety":`safety`,"openai/moderation":`safety`,"langevals/competitor_blocklist":`safety`,"langevals/competitor_llm":`safety`,"langevals/competitor_llm_function_call":`safety`,"langevals/off_topic":`safety`,"langevals/basic":`ignored`,"langevals/similarity":`ignored`,"langevals/pairwise_compare":`ignored`,"langevals/select_best_compare":`ignored`,"legacy/ragas_answer_correctness":`ignored`,"legacy/ragas_answer_relevancy":`ignored`,"legacy/ragas_context_precision":`ignored`,"legacy/ragas_context_recall":`ignored`,"legacy/ragas_context_relevancy":`ignored`,"legacy/ragas_context_utilization":`ignored`,"legacy/ragas_faithfulness":`ignored`,"ragas/context_precision":`ignored`,"ragas/context_recall":`ignored`};function h(){let e={};for(let[t,n]of Object.entries(m))n!==`ignored`&&(e[n]??=[]).push(t);return e}var g=h(),_={expected_answer:`Expected Answer`,llm_judge:`LLM as Judge`,rag:`RAG Quality`,quality:`Quality Aspects`,safety:`Safety`};function v({category:e,onSelect:t,onClose:n}){let{openDrawer:r}=d(),o=c(),{project:l}=u(),m=e?g[e]??[]:[],h=s.evaluations.availableEvaluators.useQuery({projectId:l?.id??``},{enabled:!!l?.id}),_=n=>{if(t){t(n);return}r(`evaluatorEditor`,{evaluatorType:n,category:e})},v=()=>{n?.(),o.push({pathname:`/settings/model-providers`,query:{"drawer.open":`editModelProvider`,"drawer.providerKey":`azure_safety`}})};return(0,p.jsxs)(a,{gap:4,align:`stretch`,flex:1,overflow:`hidden`,children:[(0,p.jsx)(i,{color:`fg.muted`,fontSize:`sm`,paddingX:6,paddingTop:4,children:`Select an evaluator to configure and save.`}),(0,p.jsx)(a,{gap:3,align:`stretch`,paddingX:6,paddingBottom:4,overflowY:`auto`,children:m.map(e=>{let t=f[e];if(!t)return null;let n=h.data?.[e],r=n?.missingEnvVars??[],i=e.startsWith(`azure/`),a=n?.unavailable,o=!!a||i&&r.length>0;return(0,p.jsx)(y,{evaluatorType:e,name:t.name,description:t.description,disabled:o,disabledTooltip:a?`${a.reason} ${a.howToEnable}`:o?`Configure Azure Safety provider in Settings → Model Providers`:void 0,disabledCta:o&&!a?{label:`Configure Azure Safety`,onClick:v}:void 0,onClick:()=>_(e)},e)})})]})}function y({evaluatorType:r,name:s,description:c,disabled:u,disabledTooltip:d,disabledCta:f,onClick:m}){let h=`evaluator-type-${r.replace(`/`,`-`)}`,g=(0,p.jsx)(e,{as:u?`div`:`button`,onClick:u?void 0:m,padding:4,borderRadius:`lg`,border:`1px solid`,borderColor:`border`,bg:u?`gray.50`:`bg.panel`,color:u?`gray.400`:void 0,cursor:u?`default`:`pointer`,textAlign:`left`,width:`full`,_hover:u?void 0:{borderColor:`green.muted`,bg:`green.subtle`},transition:`all 0.15s`,"data-testid":h,"data-disabled":u?`true`:void 0,children:(0,p.jsxs)(a,{align:`start`,gap:2,children:[(0,p.jsx)(i,{fontWeight:`500`,fontSize:`sm`,children:s}),(0,p.jsx)(i,{fontSize:`xs`,color:u?`gray.400`:`fg.muted`,lineClamp:2,children:c}),u&&f&&(0,p.jsx)(t,{variant:`plain`,size:`xs`,height:`auto`,padding:0,color:`orange.600`,fontSize:`xs`,fontWeight:`500`,onClick:e=>{e.stopPropagation(),f.onClick()},"data-testid":`${h}-cta`,children:(0,p.jsxs)(n,{gap:1,children:[(0,p.jsx)(i,{children:f.label}),(0,p.jsx)(l,{size:12})]})})]})});return u&&d?(0,p.jsx)(o,{content:d,positioning:{placement:`top`},children:g}):g}export{_ as n,v as t};
2
- //# sourceMappingURL=EvaluatorTypeSelectorContent-BTrBItgE.js.map
@@ -1,2 +0,0 @@
1
- import{i as e,n as t}from"./portal-Sdfvrza9.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{t as r}from"./heading-C0sACr0w.js";import{n as i}from"./personalProject-DMRX2-SI.js";import{n as a}from"./lu-DlSq9Be4.js";import{G as o,I as s,W as c}from"./index-CPtTUYLD.js";import{n as l,t as u}from"./EvaluatorTypeSelectorContent-BTrBItgE.js";var d=n();function f(n){let{closeDrawer:f,canGoBack:p,goBack:m}=c(),h=s(),g=o(),_=n.onClose??f,v=n.onSelect??h.onSelect,y=n.category??g.category??h.category,b=n.open!==!1&&n.open!==void 0;return(0,d.jsx)(i.Root,{open:b,onOpenChange:({open:e})=>!e&&_(),size:`md`,modal:!1,children:(0,d.jsxs)(i.Content,{bg:`bg`,children:[(0,d.jsx)(i.CloseTrigger,{}),(0,d.jsx)(i.Header,{children:(0,d.jsxs)(t,{gap:2,children:[p&&(0,d.jsx)(e,{variant:`ghost`,size:`sm`,onClick:m,padding:1,minWidth:`auto`,"data-testid":`back-button`,children:(0,d.jsx)(a,{size:20})}),(0,d.jsx)(r,{children:y?l[y]:`Select Evaluator`})]})}),(0,d.jsx)(i.Body,{display:`flex`,flexDirection:`column`,overflow:`hidden`,padding:0,children:(0,d.jsx)(u,{category:y,onSelect:v,onClose:_})}),(0,d.jsx)(i.Footer,{borderTopWidth:`1px`,borderColor:`border`,children:(0,d.jsx)(e,{variant:`outline`,onClick:_,children:`Cancel`})})]})})}export{f as EvaluatorTypeSelectorDrawer};
2
- //# sourceMappingURL=EvaluatorTypeSelectorDrawer-0T-zwQQZ.js.map