@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,1015 +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{S as n,a as r,dn as i,fn as a,i as o,n as s,r as c,t as l}from"./portal-Sdfvrza9.js";import{S as u}from"./shiki-CS25xJLQ.js";import{t as d}from"./jsx-runtime-CFwixLRt.js";import{n as f,t as p}from"./v-stack-hkuSkmCA.js";import{Hn as m,Jn as h,Kn as g,Nn as _,Un as v,Vn as y,Wn as b,Yn as ee,qn as x}from"./ProjectAvatar-DtI9dT1f.js";import{p as S,t as C}from"./select-D17PWjH9.js";import{t as w}from"./badge-Cpc3eA-C.js";import{t as T}from"./tooltip-gjZ4s2dt.js";import{a as te,d as ne,i as re}from"./toaster-BsYkODqs.js";import{a as ie,d as ae,f as oe,i as se,m as ce,n as le,o as ue,p as de,r as fe,s as pe,t as me,u as he}from"./send-Dd5105kW.js";import{K as ge,t as _e}from"./Markdown-C9extmbX.js";import{t as ve}from"./icon-D6xQEiPb.js";import{a as E,n as ye,r as D,t as be}from"./field-BadoNaN5.js";import{a as O}from"./split-presence-props-CBmNxzZm.js";import{t as xe}from"./icon-button-Wlb_dGXL.js";import{v as Se}from"./fetchSSE-5rVPow_l.js";import{g as Ce,h as we,i as Te}from"./errors-e711UMq7.js";import{$ as Ee,Q as De,et as Oe}from"./immer-CFru3D02.js";import{n as ke}from"./api-l6Cnm0vQ.js";import{t as Ae}from"./mail-C7uKOOUF.js";import{t as je}from"./webhook-BotkB9Wo.js";import{An as Me}from"./lu-DlSq9Be4.js";import{An as k,En as A,Mn as Ne,Mr as j,Nn as Pe,Nt as Fe,Pn as Ie,Qn as Le,Tn as Re,Un as ze,Vn as Be,kn as Ve,mn as He,pn as Ue,t as We,vn as Ge,xn as M,yn as Ke,zn as qe}from"./index-CPtTUYLD.js";import{t as Je}from"./DatasetSelector-DJI4ZOko.js";import{t as Ye}from"./next-dynamic-DcKsrHUa.js";import{t as Xe}from"./AddParticipants-7HKlJHjI.js";import{t as Ze}from"./segmented-control-BNxU6DEN.js";import{t as Qe}from"./seriesIdentifier-nW7BcYaa.js";function $e(e){let t=new Map;return function(n,r){let i=n+(r?Object.entries(r).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(t.has(i))return t.get(i);let a=new e(n,r);return t.set(i,a),a}}var et=$e(Intl.Collator);function tt(e){let{locale:t,...n}=e||{},r=et(t||`en-US`,{usage:`search`,...n});function i(e){return e=e.normalize(`NFC`),r.resolvedOptions().ignorePunctuation&&(e=e.replace(/\p{P}/gu,``)),e}function a(e,t){return t.length===0?!0:(e=i(e),t=i(t),r.compare(e.slice(0,t.length),t)===0)}function o(e,t){return t.length===0?!0:(e=i(e),t=i(t),r.compare(e.slice(-t.length),t)===0)}function s(e,t){if(t.length===0)return!0;e=i(e),t=i(t);let n=0,a=t.length;for(;n+a<=e.length;n++){let i=e.slice(n,n+a);if(r.compare(t,i)===0)return!0}return!1}return{startsWith:a,endsWith:o,contains:s}}var N=e(t(),1);function nt(e){let t=n(),r=e.locale??t.locale;return(0,N.useMemo)(()=>tt({...e,locale:r}),[r,e])}function rt(e){let{initialItems:t=[],filter:n,limit:r,...i}=e,[a,o]=(0,N.useState)(t),[s,c]=(0,N.useState)(``),l=O(e=>{o(e),c(``)}),u=(0,N.useRef)(i);u.current=i;let d=(0,N.useCallback)(e=>S({...u.current,items:e}),[]);return{collection:(0,N.useMemo)(()=>{let e=a;s&&n&&(e=d(a).filter((e,t,r)=>n(e,s,r)).items);let t=r==null?e:e.slice(0,r);return S({...u.current,items:t})},[a,s,n,r,d]),filter:O(e=>{c(e||``)}),set:O(e=>{l(e)}),reset:O(()=>{l(t)}),clear:O(()=>{l([])}),insert:O((e,...t)=>{let n=d(a).insert(e,...t).items;l(n)}),insertBefore:O((e,...t)=>{let n=d(a).insertBefore(e,...t).items;l(n)}),insertAfter:O((e,...t)=>{let n=d(a).insertAfter(e,...t).items;l(n)}),remove:O((...e)=>{let t=d(a).remove(...e).items;l(t)}),move:O((e,t)=>{let n=d(a).move(e,t).items;l(n)}),moveBefore:O((e,...t)=>{let n=d(a).moveBefore(e,...t).items;l(n)}),moveAfter:O((e,...t)=>{let n=d(a).moveAfter(e,...t).items;l(n)}),reorder:O((e,t)=>{let n=d(a).reorder(e,t).items;l(n)}),append:O((...e)=>{let t=d(a).append(...e).items;l(t)}),upsert:O((e,t,n=`append`)=>{let r=d(a).upsert(e,t,n).items;l(r)}),prepend:O((...e)=>{let t=d(a).prepend(...e).items;l(t)}),update:O((e,t)=>{let n=d(a).update(e,t).items;l(n)})}}var it=ne(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),at=[`immediate`,`5min_digest`,`15min_digest`,`hourly_digest`],ot={immediate:`Immediate`,"5min_digest":`Every 5 minutes`,"15min_digest":`Every 15 minutes`,hourly_digest:`Every hour`},st={immediate:0,"5min_digest":300*1e3,"15min_digest":900*1e3,hourly_digest:3600*1e3},ct=3e4,lt=600*1e3,P=d(),F=qe(),ut=`{% if trigger.alertType %}({{ trigger.alertType }}) {% endif %}Trigger - {{ trigger.name }}`,dt=`# {% if trigger.alertType %}({{ trigger.alertType }}) {% endif %}{{ trigger.name }}
3
-
4
- This automation fired against {% if matches.size == 1 %}a matching trace{% else %}{{ matches.size }} matching traces{% endif %}.
5
- {% for m in matches %}{% if m.evaluation and m.evaluation.evaluatorName %}
6
-
7
- **{{ m.evaluation.evaluatorName }}**{% if m.evaluation.score != null %} — score {{ m.evaluation.score }}{% endif %}{% if m.evaluation.label %} ({{ m.evaluation.label }}){% endif %}{% if m.evaluation.passed == false %} — **failed**{% endif %}
8
- {% endif %}
9
-
10
- **Input**
11
- > {{ m.trace.input | truncate: 400 }}
12
-
13
- **Output**
14
- > {{ m.trace.output | truncate: 400 }}
15
-
16
- [View matched trace ↗]({{ m.trace.url }})
17
- {% endfor %}`,ft=`{% if trigger.alertType == 'INFO' %}ℹ️{% elsif trigger.alertType == 'WARNING' %}⚠️{% elsif trigger.alertType == 'CRITICAL' %}🔴{% else %}🔔{% endif %} *{{ trigger.name }}*{% if trigger.alertType %} _({{ trigger.alertType }})_{% endif %}
18
- {% for m in matches %}*Input:* {{ m.trace.input | truncate: 200 | mrkdwn_escape }}
19
- *Output:* {{ m.trace.output | truncate: 200 | mrkdwn_escape }}{% if m.evaluation and m.evaluation.evaluatorName %}
20
- *{{ m.evaluation.evaluatorName }}:*{% if m.evaluation.score != null %} {{ m.evaluation.score }}{% endif %}{% if m.evaluation.label %} ({{ m.evaluation.label | mrkdwn_escape }}){% endif %}{% endif %}
21
- <{{ m.trace.url }}|View trace>{% unless forloop.last %}
22
- {% endunless %}{% endfor %}`,pt=`[Alert] {{ trigger.name }} — {{ metric.label }} {{ condition.operatorLabel }} {{ condition.threshold }}`,mt=`# [Alert] {{ trigger.name }}
23
-
24
- **{{ metric.label }}** {{ condition.operatorLabel }} **{{ condition.threshold }}** over the {{ condition.timePeriodLabel }}.
25
- {% if reason == "heartbeat-absence" %}
26
- No qualifying data was seen in the window.
27
- {% endif %}
28
- Current value: **{{ currentValue }}**{% if previousValue != nil %} (was {{ previousValue }}){% endif %} — threshold: {{ condition.operatorLabel }} {{ condition.threshold }}.
29
- {% if sparkline != "" %}
30
- Trend: \`{{ sparkline }}\`
31
- {% endif %}
32
- [Open dashboard ↗]({{ graph.url }})`,ht=`:rotating_light: *{{ trigger.name | mrkdwn_escape }}*{% if trigger.alertType %} _({{ trigger.alertType }})_{% endif %}
33
- *{{ metric.label | mrkdwn_escape }}* {{ condition.operatorLabel }} *{{ condition.threshold }}* over the {{ condition.timePeriodLabel }}.{% if reason == "heartbeat-absence" %}
34
- No qualifying data was seen in the window.{% endif %}
35
- Current value: *{{ currentValue }}*{% if previousValue != nil %} (was {{ previousValue }}){% endif %} — threshold: {{ condition.operatorLabel }} {{ condition.threshold }}.{% if sparkline != "" %}
36
- Trend: \`{{ sparkline }}\`{% endif %}
37
- <{{ graph.url }}|Open dashboard>`,gt=`[
38
- {
39
- "type": "header",
40
- "text": {
41
- "type": "plain_text",
42
- "text": {{ trigger.name | prepend: ":rotating_light: " | json }},
43
- "emoji": true
44
- }
45
- },
46
- {% if trigger.alertType %}
47
- {
48
- "type": "context",
49
- "elements": [
50
- { "type": "mrkdwn", "text": {{ trigger.alertType | prepend: "*Alert type:* " | json }} }
51
- ]
52
- },
53
- {% endif %}
54
- {%- capture _metric_line -%}*{{ metric.label | mrkdwn_escape }}* {{ condition.operatorLabel }} *{{ condition.threshold }}* over the {{ condition.timePeriodLabel }}.{%- endcapture -%}
55
- {
56
- "type": "section",
57
- "text": { "type": "mrkdwn", "text": {{ _metric_line | json }} }
58
- },
59
- {%- capture _value_line -%}Current value: *{{ currentValue }}*{% if previousValue != nil %} (was {{ previousValue }}){% endif %} — threshold: {{ condition.operatorLabel }} {{ condition.threshold }}.{%- endcapture -%}
60
- {
61
- "type": "section",
62
- "text": { "type": "mrkdwn", "text": {{ _value_line | json }} }
63
- },
64
- {% if sparkline != "" %}
65
- {%- capture _trend_line -%}Trend: \`{{ sparkline }}\`{%- endcapture -%}
66
- {
67
- "type": "context",
68
- "elements": [
69
- { "type": "mrkdwn", "text": {{ _trend_line | json }} }
70
- ]
71
- },
72
- {% endif %}
73
- {%- capture _link -%}<{{ graph.url }}|Open dashboard>{%- endcapture -%}
74
- {
75
- "type": "context",
76
- "elements": [
77
- { "type": "mrkdwn", "text": {{ _link | json }} }
78
- ]
79
- },
80
- {
81
- "type": "divider"
82
- },
83
- {%- capture _footer_text -%}<{{ trigger.editUrl }}|Edit alert>{%- endcapture -%}
84
- {
85
- "type": "context",
86
- "elements": [
87
- { "type": "mrkdwn", "text": {{ _footer_text | json }} }
88
- ]
89
- }
90
- ]`,_t=`{
91
- "event": "trigger.matched",
92
- "trigger": { "id": {{ trigger.id | json }}, "name": {{ trigger.name | json }}{% if trigger.alertType %}, "alertType": {{ trigger.alertType | json }}{% endif %} },
93
- "project": { "name": {{ project.name | json }}, "slug": {{ project.slug | json }} },
94
- "digest": { "count": {{ digest.count | json }} },
95
- "matches": [{% for m in matches %}
96
- { "traceId": {{ m.trace.id | json }}, "url": {{ m.trace.url | json }},
97
- "input": {{ m.trace.input | json }}, "output": {{ m.trace.output | json }} }{% unless forloop.last %},{% endunless %}{% endfor %}
98
- ]
99
- }`,vt=`{
100
- "event": "alert.fired",
101
- "trigger": { "id": {{ trigger.id | json }}, "name": {{ trigger.name | json }}{% if trigger.alertType %}, "alertType": {{ trigger.alertType | json }}{% endif %} },
102
- "project": { "name": {{ project.name | json }}, "slug": {{ project.slug | json }} },
103
- "graph": { "name": {{ graph.name | json }}, "url": {{ graph.url | json }} },
104
- "metric": { "label": {{ metric.label | json }} },
105
- "condition": { "operator": {{ condition.operatorLabel | json }}, "threshold": {{ condition.threshold | json }}, "window": {{ condition.timePeriodLabel | json }} },
106
- "currentValue": {{ currentValue | json }}{% if previousValue != nil %},
107
- "previousValue": {{ previousValue | json }}{% endif %}
108
- }`,yt=`{
109
- "event": "report.scheduled",
110
- "trigger": { "id": {{ trigger.id | json }}, "name": {{ trigger.name | json }} },
111
- "project": { "name": {{ project.name | json }}, "slug": {{ project.slug | json }} },
112
- "report": { "source": {{ report.sourceLabel | json }}, "schedule": {{ report.scheduleLabel | json }}, "isEmpty": {{ report.isEmpty | json }} },
113
- "traces": [{% for t in traces %}
114
- { "traceId": {{ t.traceId | json }}, "url": {{ t.url | json }}, "input": {{ t.input | json }} }{% unless forloop.last %},{% endunless %}{% endfor %}
115
- ],
116
- "charts": [{% for chart in charts %}
117
- { "title": {{ chart.title | json }}{% unless chart.isEmpty %}, "total": {{ chart.total | json }}{% endunless %} }{% unless forloop.last %},{% endunless %}{% endfor %}
118
- ],
119
- "viewUrl": {{ viewUrl | json }}
120
- }`,bt={emailSubject:pt,emailBody:mt,slackString:ht,slackBlockKit:gt,webhookBody:vt},xt=`[
121
- {
122
- "type": "header",
123
- {%- capture _header_prefix -%}{% if trigger.alertType == 'INFO' %}ℹ️{% elsif trigger.alertType == 'WARNING' %}⚠️{% elsif trigger.alertType == 'CRITICAL' %}🔴{% else %}🔔{% endif %} {%- endcapture -%}
124
- "text": {
125
- "type": "plain_text",
126
- "text": {{ trigger.name | prepend: _header_prefix | json }},
127
- "emoji": true
128
- }
129
- },
130
- {% if trigger.alertType %}
131
- {
132
- "type": "context",
133
- "elements": [
134
- { "type": "mrkdwn", "text": {{ trigger.alertType | prepend: "*Alert type:* " | json }} }
135
- ]
136
- },
137
- {% endif %}
138
- {% for m in matches %}
139
- {
140
- "type": "section",
141
- "text": { "type": "mrkdwn", "text": {{ m.trace.input | truncate: 300 | mrkdwn_escape | prepend: "*Input:* " | json }} }
142
- },
143
- {
144
- "type": "section",
145
- "text": { "type": "mrkdwn", "text": {{ m.trace.output | truncate: 300 | mrkdwn_escape | prepend: "*Output:* " | json }} }
146
- },
147
- {% if m.evaluation and m.evaluation.evaluatorName %}
148
- {
149
- "type": "context",
150
- "elements": [
151
- { "type": "mrkdwn", "text": {{ m.evaluation.evaluatorName | prepend: "*" | append: "*" | json }} }{% if m.evaluation.score != null %},
152
- { "type": "mrkdwn", "text": "score {{ m.evaluation.score }}" }{% endif %}{% if m.evaluation.label %},
153
- { "type": "mrkdwn", "text": {{ m.evaluation.label | mrkdwn_escape | json }} }{% endif %}
154
- ]
155
- },
156
- {% endif %}
157
- {%- capture _trace_link -%}<{{ m.trace.url }}|View trace>{%- endcapture -%}
158
- {
159
- "type": "context",
160
- "elements": [
161
- { "type": "mrkdwn", "text": {{ _trace_link | json }} }
162
- ]
163
- },
164
- {% endfor %}
165
- {
166
- "type": "divider"
167
- },
168
- {%- capture _footer_text -%}<{{ trigger.editUrl }}|Edit automation>{%- endcapture -%}
169
- {
170
- "type": "context",
171
- "elements": [
172
- { "type": "mrkdwn", "text": {{ _footer_text | json }} }
173
- ]
174
- }
175
- ]`,St={emailSubject:ut,emailBody:dt,slackString:ft,slackBlockKit:xt,webhookBody:_t},Ct=`[Report] {{ trigger.name }} — {{ report.scheduleLabel }}`,wt=`# {{ trigger.name }}
176
-
177
- {{ report.sourceLabel }} · {{ report.scheduleLabel }}.
178
- {% if report.isEmpty %}
179
- Nothing to show for this period.
180
- {% else %}{% for t in traces %}- [{{ t.traceId }}]({{ t.url }}) — {{ t.input }} _({{ t.model }} · \${{ t.costUsd | round: 4 }} · {{ t.durationMs | round: 0 }} ms)_
181
- {% endfor %}{% for chart in charts %}- **{{ chart.title }}** — {% if chart.isEmpty %}no data{% else %}{{ chart.total | round: 2 }}{% endif %}
182
- {% endfor %}{% endif %}
183
- [View in LangWatch ↗]({{ viewUrl }})`,I=10,Tt={emailSubject:Ct,emailBody:wt,slackString:`:bar_chart: *{{ trigger.name | mrkdwn_escape }}*
184
- {{ report.sourceLabel | mrkdwn_escape }} · {{ report.scheduleLabel }}{% if report.isEmpty %}
185
- _Nothing to show for this period._{% else %}
186
- {% for t in traces limit: ${I} %}• <{{ t.url }}|{{ t.traceId }}> {{ t.input | mrkdwn_escape }}
187
- {% endfor %}{% if traces.size > ${I} %}_…and {{ traces.size | minus: ${I} }} more_
188
- {% endif %}{% for chart in charts limit: ${I} %}• *{{ chart.title | mrkdwn_escape }}* — {% if chart.isEmpty %}_no data_{% else %}{{ chart.total | round: 2 }}{% endif %}
189
- {% endfor %}{% if charts.size > ${I} %}_…and {{ charts.size | minus: ${I} }} more_
190
- {% endif %}{% endif %}
191
- <{{ viewUrl }}|View in LangWatch>`,slackBlockKit:`[
192
- {
193
- "type": "header",
194
- "text": { "type": "plain_text", "text": {{ trigger.name | prepend: ":bar_chart: " | json }}, "emoji": true }
195
- },
196
- {%- capture _sub -%}{{ report.sourceLabel }} · {{ report.scheduleLabel }}{%- endcapture -%}
197
- {
198
- "type": "section",
199
- "text": { "type": "mrkdwn", "text": {{ _sub | json }} }
200
- },
201
- {%- if report.isEmpty -%}
202
- {
203
- "type": "section",
204
- "text": { "type": "mrkdwn", "text": "_Nothing to show for this period._" }
205
- },
206
- {%- else -%}
207
- {%- capture _rows -%}{% for t in traces limit: ${I} %}• <{{ t.url }}|{{ t.traceId }}> {{ t.input | mrkdwn_escape }}
208
- {% endfor %}{% if traces.size > ${I} %}_…and {{ traces.size | minus: ${I} }} more_
209
- {% endif %}{% for chart in charts limit: ${I} %}• *{{ chart.title | mrkdwn_escape }}* — {% if chart.isEmpty %}_no data_{% else %}{{ chart.total | round: 2 }}{% endif %}
210
- {% endfor %}{% if charts.size > ${I} %}_…and {{ charts.size | minus: ${I} }} more_
211
- {% endif %}{%- endcapture -%}
212
- {
213
- "type": "section",
214
- "text": { "type": "mrkdwn", "text": {{ _rows | json }} }
215
- },
216
- {%- endif -%}
217
- {
218
- "type": "context",
219
- "elements": [{ "type": "mrkdwn", "text": {{ viewUrl | prepend: "<" | append: "|View in LangWatch>" | json }} }]
220
- }
221
- ]`,webhookBody:yt};function Et(e){switch(e){case`graphAlert`:return bt;case`report`:return Tt;case`trace`:return St}}var Dt=[{traceId:`trace_2x9fK3aQ`,input:`What is the capital of France?`,output:`The capital of France is Paris.`,metadata:{customer_id:`cust_123`,topic:`geography`},evaluation:{score:.92,passed:!0,label:`relevant`,evaluatorName:`Answer Relevancy`}}],Ot=[{path:`trigger.id`,type:`string`,description:`Stable identifier of the automation.`},{path:`trigger.name`,type:`string`,description:`The automation's configured name.`},{path:`trigger.alertType`,type:`'INFO' | 'WARNING' | 'CRITICAL' | null`,description:`Severity label, or null if unset.`},{path:`trigger.editUrl`,type:`string`,description:`Deep link to this automation's edit page.`},{path:`project.name`,type:`string`,description:`Human-readable project name.`},{path:`project.slug`,type:`string`,description:`URL-safe project slug.`},{path:`project.url`,type:`string`,description:`Absolute URL to the project home.`},{path:`digest.count`,type:`number`,description:`1 for immediate cadence; N for a digest.`},{path:`digest.windowStart`,type:`string | null`,description:`ISO-8601 — only set for digest cadences.`},{path:`digest.windowEnd`,type:`string | null`,description:`ISO-8601 — only set for digest cadences.`},{path:`matches`,type:`TemplateMatchVars[]`,description:"Canonical iteration surface. Immediate dispatch has length 1, a digest has N — iterate with `{% for m in matches %}` and the same template handles both."},{path:`match.trace.id`,type:`string | null`,description:`Trace ID that matched the conditions.`},{path:`match.trace.input`,type:`string`,description:`Captured input of the matched trace.`},{path:`match.trace.output`,type:`string`,description:`Captured output of the matched trace.`},{path:`match.trace.url`,type:`string`,description:`Deep link to the matched trace.`},{path:`match.trace.metadata`,type:`object`,description:`Trace metadata as a key/value object.`},{path:`match.evaluation.score`,type:`number | null`,description:`Evaluation score, when the trigger is evaluation-bound.`},{path:`match.evaluation.passed`,type:`boolean | null`,description:`Evaluation passed/failed verdict.`},{path:`match.evaluation.label`,type:`string | null`,description:`Optional evaluation label.`},{path:`match.evaluation.evaluatorName`,type:`string | null`,description:`Display name of the evaluator that ran.`}];function kt(e,t){return t===`digest`?e:e.filter(e=>e.path!==`digest.windowStart`&&e.path!==`digest.windowEnd`)}var L={SEND_EMAIL:`SEND_EMAIL`,ADD_TO_DATASET:`ADD_TO_DATASET`,ADD_TO_ANNOTATION_QUEUE:`ADD_TO_ANNOTATION_QUEUE`,SEND_SLACK_MESSAGE:`SEND_SLACK_MESSAGE`,SEND_WEBHOOK:`SEND_WEBHOOK`},At=A({annotators:Ue(A({id:k(),name:k()})).min(1,`Add at least one annotator.`)}),jt={action:L.ADD_TO_ANNOTATION_QUEUE,category:`action`,label:`Add to annotation queue`,description:`Queue matched traces for a human to label.`,actionParamsSchema:At},Mt=A({mapping:Ve(A({source:k(),key:k().optional(),subkey:k().optional(),selectedFields:Ue(k()).optional()})),expansions:Ue(k()).default([])}),Nt=A({datasetId:k().min(1,`Pick a dataset to append matched traces to.`),datasetMapping:Mt}),Pt={action:L.ADD_TO_DATASET,category:`action`,label:`Add to dataset`,description:`Append matched traces to a dataset for later evaluation.`,actionParamsSchema:Nt},Ft=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,It=A({members:Ue(k().regex(Ft,`Invalid email address`)).min(1,`Add at least one recipient.`)}),Lt={action:L.SEND_EMAIL,category:`notify`,label:`Email`,description:`Send an email to one or more team members or external recipients.`,actionParamsSchema:It};Ke([`string`,`block_kit`]);var Rt=Ke([`webhook`,`bot`]),zt=`__kept__`,Bt=A({slackDelivery:Rt.optional(),slackWebhook:k().optional(),slackBotToken:k().optional(),slackChannelId:k().optional(),slackBotTokenSet:He().optional()}).superRefine((e,t)=>{if((e.slackDelivery??`webhook`)===`webhook`){let n=e.slackWebhook?.trim();n?n.startsWith(`https://hooks.slack.com/`)||t.addIssue({code:`custom`,message:`Expected a Slack incoming webhook URL (https://hooks.slack.com/…).`,path:[`slackWebhook`]}):t.addIssue({code:`custom`,message:`A Slack incoming webhook URL is required.`,path:[`slackWebhook`]})}else e.slackChannelId?.trim()||t.addIssue({code:`custom`,message:`A Slack channel is required for a bot connection.`,path:[`slackChannelId`]})});function Vt(e){return e.slackDelivery??`webhook`}var Ht={action:L.SEND_SLACK_MESSAGE,category:`notify`,label:`Slack`,description:`Post a message to a Slack webhook when a trace matches.`,alertDescription:`Post a message to a Slack webhook when the alert fires.`,actionParamsSchema:Bt},Ut=[`POST`,`PUT`,`PATCH`],Wt=`__kept__`,Gt=Ke(Ut),Kt=new Set([`host`,`content-length`,`content-type`,`transfer-encoding`,`connection`]),qt=`x-langwatch-`;function Jt(e){let t=e.trim().toLowerCase();return Kt.has(t)||t.startsWith(qt)}var Yt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Xt(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.trim();if(!e||!Yt.test(e)||Jt(e))continue;let i=r.replace(/[\r\n\0]+/g,` `).trim();i&&(t[e]=i)}return t}function Zt(e){let t;try{t=new URL(e)}catch{return`Enter a valid URL.`}return t.protocol===`https:`?t.hostname?t.port!==``&&t.port!==`443`?`Only the default https port (443) is allowed.`:t.username||t.password?`The webhook URL cannot carry credentials.`:null:`The webhook URL needs a host.`:`The webhook URL must use https.`}var Qt=A({url:k().trim().min(1,`A webhook URL is required.`).superRefine((e,t)=>{let n=Zt(e);n&&t.addIssue({code:`custom`,message:n})}),method:Gt.default(`POST`),headers:Ve(k(),k()).default({}).transform(Xt),bodyTemplate:k().nullable().default(null)}),$t={action:L.SEND_WEBHOOK,category:`notify`,label:`Webhook`,description:`Send a JSON payload to your own endpoint when a trace matches.`,alertDescription:`Send a JSON payload to your own endpoint when the alert fires.`,actionParamsSchema:Qt};function en(){return{annotators:[]}}function tn(e){return e.annotators.length>0}function nn(e,t){let n=t.name||`(unnamed)`,r=e.annotators.length;return`${n} → ${r} annotator${r===1?``:`s`}`}function rn(e){let t=e.actionParams??{};return{annotators:Array.isArray(t.annotators)?t.annotators:[]}}function an(e){return{annotators:e.annotators}}function on({slice:e,onChange:t}){return(0,P.jsx)(Xe,{annotators:e.annotators,setAnnotators:n=>t({...e,annotators:typeof n==`function`?n(e.annotators):n}),queueDrawerOpen:{onOpen:()=>{},onClose:()=>{}},isTrigger:!0})}var sn={Icon:ze,initialSlice:en,isComplete:tn,summary:nn,fromTriggerRow:rn,toActionParams:an,ConfigForm:on},cn={mapping:{},expansions:[]},ln={trace_id:`trace_id`,timestamp:`timestamp`,input:`input`,question:`input`,user_input:`input`,output:`output`,answer:`output`,response:`output`,result:`output`,expected_output:`output`,total_cost:`metrics.total_cost`,contexts:`contexts.string_list`,spans:`spans`};function un(e){let t=ln[e.toLowerCase()];return t?{source:t,key:``,subkey:``}:{source:`metadata`,key:e,subkey:``}}function dn(e){return{mapping:Object.fromEntries(e.map(e=>[e.name,un(e.name)])),expansions:[]}}function fn(e){if(!e)return[];let t=Se.safeParse(e.columnTypes);return t.success?t.data:[]}function pn(e){return Object.keys(e.mapping).length>0}function mn(){return{datasetId:``,mapping:cn}}function hn(e){return e.datasetId.length>0&&pn(e.mapping)}function gn(e,t){return`${t.name||`(unnamed)`} → dataset ${e.datasetId||`(not chosen)`}`}function _n(e){let t=e.actionParams??{};return{datasetId:typeof t.datasetId==`string`?t.datasetId:``,mapping:t.datasetMapping&&typeof t.datasetMapping==`object`&&`mapping`in t.datasetMapping?t.datasetMapping:cn}}function vn(e){return{datasetId:e.datasetId,datasetMapping:e.mapping}}function yn({slice:e,onChange:t,ctx:n}){let r=ke.dataset.getAll.useQuery({projectId:n.projectId},{enabled:!!n.projectId,refetchOnWindowFocus:!1}),i=n=>{let i=r.data?.find(e=>e.id===n);t({...e,datasetId:n,mapping:dn(fn(i))})};return(0,N.useEffect)(()=>{if(!e.datasetId||pn(e.mapping))return;let n=r.data?.find(t=>t.id===e.datasetId);if(!n)return;let i=dn(fn(n));pn(i)&&t({...e,mapping:i})},[e.datasetId,e.mapping,r.data]),(0,P.jsxs)(p,{align:`stretch`,gap:3,children:[(0,P.jsx)(Je,{datasets:r.data,localStorageDatasetId:e.datasetId,errors:{},setValue:(e,t)=>i(t),onCreateNew:()=>{}}),(0,P.jsx)(f,{color:`fg.muted`,textStyle:`xs`,children:`Columns map to the matching trace fields automatically; refine the mapping from the dataset view after creating.`})]})}var bn={Icon:De,initialSlice:mn,isComplete:hn,summary:gn,fromTriggerRow:_n,toActionParams:vn,ConfigForm:yn};function R({variables:e}){return(0,P.jsxs)(v,{openDelay:150,closeDelay:120,children:[(0,P.jsx)(b,{asChild:!0,children:(0,P.jsx)(a.button,{type:`button`,"aria-label":`Show available variables`,color:`fg.muted`,cursor:`help`,display:`inline-flex`,alignItems:`center`,bg:`transparent`,border:`none`,p:0,_hover:{color:`fg`},children:(0,P.jsx)(re,{size:13})})}),(0,P.jsx)(l,{children:(0,P.jsx)(m,{children:(0,P.jsx)(y,{width:`340px`,padding:3,borderRadius:`lg`,background:`bg.panel`,boxShadow:`lg`,children:(0,P.jsxs)(p,{align:`stretch`,gap:2,maxHeight:`360px`,overflowY:`auto`,children:[(0,P.jsx)(f,{textStyle:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Available variables`}),e.map(e=>(0,P.jsxs)(i,{children:[(0,P.jsxs)(s,{gap:2,align:`baseline`,children:[(0,P.jsx)(f,{textStyle:`xs`,fontFamily:`mono`,fontWeight:`semibold`,children:e.path}),(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:e.type})]}),e.description?(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:e.description}):null]},e.path))]})})})})]})}function xn(e){return Me({tag:`svg`,attr:{viewBox:`0 0 448 512`},child:[{tag:`path`,attr:{d:`M94.12 315.1c0 25.9-21.16 47.06-47.06 47.06S0 341 0 315.1c0-25.9 21.16-47.06 47.06-47.06h47.06v47.06zm23.72 0c0-25.9 21.16-47.06 47.06-47.06s47.06 21.16 47.06 47.06v117.84c0 25.9-21.16 47.06-47.06 47.06s-47.06-21.16-47.06-47.06V315.1zm47.06-188.98c-25.9 0-47.06-21.16-47.06-47.06S139 32 164.9 32s47.06 21.16 47.06 47.06v47.06H164.9zm0 23.72c25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06H47.06C21.16 243.96 0 222.8 0 196.9s21.16-47.06 47.06-47.06H164.9zm188.98 47.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06h-47.06V196.9zm-23.72 0c0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06V79.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06V196.9zM283.1 385.88c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06v-47.06h47.06zm0-23.72c-25.9 0-47.06-21.16-47.06-47.06 0-25.9 21.16-47.06 47.06-47.06h117.84c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06H283.1z`},child:[]}]})(e)}function z(e,t){let n=``;for(let r of e)n+=r===`
222
- `?`
223
- `:t;return n}function Sn(e,t){let n=!1,r=0;for(;r<t;){let t=e.charCodeAt(r);if(t===92&&n){r+=2;continue}t===34&&(n=!n),r++}return n}var Cn={capture:`endcapture`,comment:`endcomment`},wn=RegExp(`^\\{%-?\\s*(${Object.keys(Cn).join(`|`)})\\b`);function Tn(e,t,n){let r=RegExp(`\\{%-?\\s*${n}\\s*-?%\\}`).exec(e.slice(t));return r?t+r.index+r[0].length:-1}function En(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e.indexOf(`{{`,r),a=e.indexOf(`{%`,r),o=i===-1?a:a===-1?i:Math.min(i,a);if(o===-1){n+=e.slice(r);break}n+=e.slice(r,o);let s=o===i,c=s?`}}`:`%}`,l=e.indexOf(c,o+2);if(l===-1){n+=e.slice(o);break}let u=l+2,d=e.slice(o,u),f=u-o,p=s?null:wn.exec(d);if(p){let i=Cn[p[1]],a=Tn(e,u,i);if(a!==-1){let i=e.slice(o,a);n+=z(i,` `),t.push({start:o,end:a,kind:`tag`}),r=a;continue}}let m;m=s?Sn(e,o)?z(d,`_`):f>=2&&!d.includes(`
224
- `)?`"${`_`.repeat(f-2)}"`:z(d,` `):z(d,` `),n+=m,t.push({start:o,end:u,kind:s?`output`:`tag`}),r=u}return{substituted:n,liquidRanges:t}}var Dn={$schema:`http://json-schema.org/draft-07/schema#`,title:`Slack Block Kit (allowlisted subset)`,type:`array`,items:{oneOf:[{title:`section`,type:`object`,required:[`type`],additionalProperties:!1,properties:{type:{const:`section`},block_id:{type:`string`},text:{type:`object`,required:[`type`,`text`],properties:{type:{enum:[`mrkdwn`,`plain_text`]},text:{type:`string`},emoji:{type:`boolean`}}},fields:{type:`array`,items:{type:`object`,required:[`type`,`text`],properties:{type:{enum:[`mrkdwn`,`plain_text`]},text:{type:`string`}}}}}},{title:`divider`,type:`object`,required:[`type`],additionalProperties:!1,properties:{type:{const:`divider`},block_id:{type:`string`}}},{title:`context`,type:`object`,required:[`type`,`elements`],additionalProperties:!1,properties:{type:{const:`context`},block_id:{type:`string`},elements:{type:`array`,items:{type:`object`,required:[`type`,`text`],properties:{type:{enum:[`mrkdwn`,`plain_text`]},text:{type:`string`}}}}}},{title:`header`,type:`object`,required:[`type`,`text`],additionalProperties:!1,properties:{type:{const:`header`},block_id:{type:`string`},text:{type:`object`,required:[`type`,`text`],properties:{type:{const:`plain_text`},text:{type:`string`},emoji:{type:`boolean`}}}}},{title:`markdown`,type:`object`,required:[`type`,`text`],additionalProperties:!1,properties:{type:{const:`markdown`},block_id:{type:`string`},text:{type:`string`}}}]}},On=new Map;function kn(e,t,n,r=[t]){On.set(t,{schema:n,fileMatch:r}),e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemas:Array.from(On.entries()).map(([e,t])=>({uri:`inmemory://schemas/${encodeURIComponent(e)}.schema.json`,fileMatch:t.fileMatch,schema:t.schema}))})}var B=`liquid`,V=`liquid-json`,An=`liquid-variables`,jn=new Set([`true`,`false`,`nil`,`null`,`empty`,`blank`,`and`,`or`,`not`,`contains`,`if`,`unless`,`else`,`elsif`,`endif`,`endunless`,`for`,`endfor`,`in`,`assign`,`capture`,`endcapture`,`forloop`]),Mn=new Map,Nn=!1,Pn=!1;function Fn(e){return e.split(/[.[]/)[0]??e}function In(e,t){Mn.set(e.uri.toString(),t)}function Ln(e){Mn.delete(e.uri.toString())}function Rn(e){return Mn.get(e.uri.toString())??[]}function zn(e){if(Nn||=(e.languages.register({id:B}),e.languages.setMonarchTokensProvider(B,{tokenizer:{root:[[/\{\{/,{token:`delimiter.liquid`,next:`@output`}],[/\{%/,{token:`delimiter.liquid`,next:`@tag`}],[/[^{]+/,``],[/\{/,``]],output:[[/\}\}/,{token:`delimiter.liquid`,next:`@pop`}],[/\|/,`operator.liquid`],[/[a-zA-Z_][\w.]*/,`variable.liquid`],[/[^}]/,``]],tag:[[/%\}/,{token:`delimiter.liquid`,next:`@pop`}],[/\b(if|elsif|else|endif|unless|endunless|for|endfor|in|assign|capture|endcapture)\b/,`keyword.liquid`],[/[a-zA-Z_][\w.]*/,`variable.liquid`],[/[^%]/,``]]}}),e.languages.register({id:V}),e.languages.setLanguageConfiguration(V,{brackets:[[`{`,`}`],[`[`,`]`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`"`,close:`"`},{open:`{{`,close:` }}`},{open:`{%`,close:` %}`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`"`,close:`"`}]}),e.languages.setMonarchTokensProvider(V,{defaultToken:``,tokenPostfix:`.liquid-json`,keywords:[`true`,`false`,`null`],tokenizer:{root:[[/\{\{/,{token:`delimiter.liquid`,next:`@liquidOutput`}],[/\{%/,{token:`delimiter.liquid`,next:`@liquidTag`}],[/[{}\[\]]/,`@brackets`],[/[,:]/,`delimiter`],[/"/,{token:`string.quote`,next:`@string`}],[/-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+\-]?\d+)?/,`number`],[/[a-zA-Z_]\w*/,{cases:{"@keywords":`keyword`,"@default":``}}],[/\s+/,`white`]],string:[[/\{\{/,{token:`delimiter.liquid`,next:`@liquidOutput`}],[/\{%/,{token:`delimiter.liquid`,next:`@liquidTag`}],[/[^"\\{]+/,`string`],[/\\(?:[\\"/bfnrt]|u[0-9A-Fa-f]{4})/,`string.escape`],[/\\/,`string`],[/\{/,`string`],[/"/,{token:`string.quote`,next:`@pop`}]],liquidOutput:[[/\}\}/,{token:`delimiter.liquid`,next:`@pop`}],[/\|/,`operator.liquid`],[/[a-zA-Z_][\w.]*/,`variable.liquid`],[/[^}]/,``]],liquidTag:[[/%\}/,{token:`delimiter.liquid`,next:`@pop`}],[/\b(if|elsif|else|endif|unless|endunless|for|endfor|in|assign|capture|endcapture)\b/,`keyword.liquid`],[/[a-zA-Z_][\w.]*/,`variable.liquid`],[/[^%]/,``]]}}),!0),!Pn){let t={triggerCharacters:[`.`,` `,`{`,`%`],provideCompletionItems:(t,n)=>{if(t.getLanguageId()===`liquid-json`){let e=t.getOffsetAt(n);if(!qn(t.getValue(),e))return null}let r=t.getLineContent(n.lineNumber).slice(0,n.column-1),i=/[\w.[\]]*$/.exec(r)?.[0]??``,a={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:n.column-i.length,endColumn:n.column},o=Rn(t).map(t=>({label:t.path,kind:e.languages.CompletionItemKind.Variable,insertText:t.path,range:a,detail:t.type,documentation:t.description?{value:t.description}:void 0})),s=[{label:`for m in matches`,kind:e.languages.CompletionItemKind.Snippet,insertText:`{% for m in matches %}
225
- $0
226
- {% endfor %}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a,detail:`Iterate matched traces`},{label:`if`,kind:e.languages.CompletionItemKind.Snippet,insertText:`{% if $1 %}
227
- $0
228
- {% endif %}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a,detail:`Conditional block`}];return{suggestions:[...o,...s]}}},n={provideHover:(e,t)=>{if(e.getLanguageId()===`liquid-json`){let n=e.getOffsetAt(t);if(!qn(e.getValue(),n))return null}let n=e.getWordAtPosition(t);if(!n)return null;let r=Rn(e).find(e=>Fn(e.path)===n.word);return r?{contents:[{value:`**${r.path}** — \`${r.type}\``},...r.description?[{value:r.description}]:[]]}:null}};for(let r of[B,V])e.languages.registerCompletionItemProvider(r,t),e.languages.registerHoverProvider(r,n);Pn=!0}}function Bn(e,t){for(let n of[/\{%-?\s*for\s+(\w+)\s+in\b/g,/\{%-?\s*assign\s+(\w+)\s*=/g,/\{%-?\s*capture\s+(\w+)\s*-?%\}/g]){let r;for(;(r=n.exec(e))!==null;)r[1]&&t.add(r[1])}}function Vn(e,t){let n=new Set(t.map(e=>Fn(e.path)));n.add(`forloop`),n.add(`matches`),Bn(e,n);let r=[...n].sort(),i=[],a=/\{\{-?([\s\S]*?)-?\}\}/g,o;for(;(o=a.exec(e))!==null;){let e=o[1]??``,t=e.split(`|`)[0]?.trim()??``,a=/^[a-zA-Z_][\w]*(?:\.[\w]+|\[\d+\])*/.exec(t);if(!a)continue;let s=a[0],c=Fn(s);if(jn.has(s)||jn.has(c)||n.has(c))continue;let l=o[0].indexOf(e)+e.indexOf(t)+t.indexOf(s);i.push({root:c,token:s,index:o.index+l,knownRoots:r})}return i}function Hn(e,t,n){let r=Vn(t.getValue(),n).map(n=>{let r=t.getPositionAt(n.index),i=t.getPositionAt(n.index+n.token.length);return{severity:e.MarkerSeverity.Warning,message:`Unknown variable "${n.root}". Known roots: ${n.knownRoots.join(`, `)}`,startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:i.lineNumber,endColumn:i.column}});e.editor.setModelMarkers(t,An,r)}function Un(e,t){e.editor.setModelMarkers(t,An,[])}var Wn=`liquid-json-schema`;function Gn(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}var H=new Map,Kn=!1;function qn(e,t){let n=e.lastIndexOf(`{{`,t-1),r=e.lastIndexOf(`{%`,t-1),i=Math.max(n,r);if(i===-1)return!1;let a=i===n?`}}`:`%}`,o=e.indexOf(a,i+2);return o===-1||o>=t}var Jn=[`"`,`:`,`,`,` `,`[`,`{`];function Yn(e,t){let n=e.languages.CompletionItemKind;switch(t){case 6:return n.Variable;case 10:return n.Property;case 12:return n.Value;case 14:return n.Keyword;case 15:return n.Snippet;default:return n.Value}}function Xn(e){if(e)return typeof e==`string`?e:{value:e.value}}function Zn(e){Kn||(Kn=!0,e.languages.registerCompletionItemProvider(V,{triggerCharacters:Jn,provideCompletionItems:async(t,n)=>{let r=t.getOffsetAt(n);if(qn(t.getValue(),r))return null;let i=H.get(t.uri.toString());if(!i)return null;let a=e.Uri.parse(i);if(!e.editor.getModel(a))return null;let o=await(await e.languages.json.getWorker())(a);if(!o.doComplete)return null;let s=await o.doComplete(a.toString(),{line:n.lineNumber-1,character:n.column-1});if(!s?.items)return{suggestions:[]};let c=t.getWordUntilPosition(n),l={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:c.startColumn,endColumn:c.endColumn};return{suggestions:s.items.map(t=>{let n=t.textEdit?.range?{startLineNumber:t.textEdit.range.start.line+1,startColumn:t.textEdit.range.start.character+1,endLineNumber:t.textEdit.range.end.line+1,endColumn:t.textEdit.range.end.character+1}:l;return{label:t.label,kind:Yn(e,t.kind),insertText:t.insertText??t.textEdit?.newText??t.label,insertTextRules:t.insertTextFormat===2?e.languages.CompletionItemInsertTextRule.InsertAsSnippet:void 0,sortText:t.sortText,filterText:t.filterText,detail:t.detail,documentation:Xn(t.documentation),range:n}})}}}),e.languages.registerHoverProvider(V,{provideHover:async(t,n)=>{let r=t.getOffsetAt(n);if(qn(t.getValue(),r))return null;let i=H.get(t.uri.toString());if(!i)return null;let a=e.Uri.parse(i),o=await(await e.languages.json.getWorker())(a);if(!o.doHover)return null;let s=await o.doHover(a.toString(),{line:n.lineNumber-1,character:n.column-1});return s?{contents:(Array.isArray(s.contents)?s.contents:[s.contents]).map(e=>e?typeof e==`string`?{value:e}:typeof e==`object`&&`value`in e?{value:String(e.value)}:null:null).filter(e=>e!==null)}:null}}))}function Qn(e){let{monaco:t,realModel:n,schema:r,shadowUri:i}=e;kn(t,i,r,[`**/${Gn(i)}`]);let a=t.Uri.parse(i),o=t.editor.getModel(a);o&&o.dispose();let s=En(n.getValue()),c=t.editor.createModel(s.substituted,`json`,a);H.set(n.uri.toString(),i),Zn(t);let l=()=>{let e=t.editor.getModelMarkers({resource:a}).map(e=>({severity:e.severity,message:e.message,startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn}));t.editor.setModelMarkers(n,Wn,e)},u=t.editor.onDidChangeMarkers(e=>{e.some(e=>e.toString()===a.toString())&&l()}),d=n.onDidChangeContent(()=>{let e=En(n.getValue());c.setValue(e.substituted)});return l(),{dispose:()=>{d.dispose(),u.dispose(),t.editor.setModelMarkers(n,Wn,[]),H.delete(n.uri.toString()),c.isDisposed()||c.dispose()}}}var $n=`#1e1e1e`;function er(e){return e===`vs-dark`?$n:`white`}function tr(e){let t=e.getDomNode();t&&t.addEventListener(`keydown`,e=>{e.key===`Escape`&&e.stopPropagation()},{capture:!0})}function nr(){let{colorMode:e}=Fe();return e===`dark`?`vs-dark`:`vs`}var rr=Ye(()=>u(()=>import(`./dist-WNeJk3KQ.js`),__vite__mapDeps([0,1,2])),{ssr:!1,loading:()=>(0,P.jsx)(i,{padding:4,color:`fg.muted`,children:`Loading editor...`})});function ir({label:e,usingDefault:t,onReset:n,trailing:r}){return(0,P.jsxs)(s,{gap:2,children:[(0,P.jsx)(f,{textStyle:`sm`,fontWeight:`semibold`,children:e}),r,t?(0,P.jsx)(w,{size:`sm`,colorPalette:`gray`,children:`Using default`}):(0,P.jsx)(o,{size:`xs`,variant:`ghost`,onClick:n,children:`Reset to default`})]})}function ar({triggerLabel:e,hint:t,open:n,onToggle:r,children:i}){return(0,P.jsxs)(p,{align:`stretch`,gap:0,children:[(0,P.jsxs)(a.button,{type:`button`,onClick:r,"aria-expanded":n,display:`inline-flex`,alignItems:`center`,gap:1,width:`fit-content`,bg:`transparent`,border:`none`,cursor:`pointer`,color:`fg.muted`,_hover:{color:`fg`},children:[n?(0,P.jsx)(Oe,{size:14}):(0,P.jsx)(Ee,{size:14}),(0,P.jsx)(f,{textStyle:`sm`,fontWeight:`medium`,children:e})]}),n?(0,P.jsxs)(p,{align:`stretch`,gap:2,pt:2,children:[t?(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:t}):null,i]}):null]})}var or={minimap:{enabled:!1},fontSize:13,wordWrap:`on`,automaticLayout:!0,scrollBeyondLastLine:!1,lineNumbers:`off`,tabSize:2,padding:{top:12}};function U({value:e,onChange:t,variables:n,language:r=B,height:a=`200px`,jsonSchema:o,jsonSchemaShadowUri:s}){let c=r===`liquid`||r===`liquid-json`,l=nr(),u=(0,N.useRef)(null),d=(0,N.useRef)(null),f=(0,N.useRef)(null),p=(0,N.useRef)(null),[m,h]=N.useState(!1);return(0,N.useEffect)(()=>()=>{f.current?.dispose(),p.current?.dispose(),d.current&&Ln(d.current),u.current&&d.current&&Un(u.current,d.current)},[]),(0,N.useEffect)(()=>{p.current?.dispose(),p.current=null;let e=u.current,t=d.current;if(!(!m||!e||!t)&&!(!o||!s))return p.current=Qn({monaco:e,realModel:t,schema:o,shadowUri:s}),()=>{p.current?.dispose(),p.current=null}},[m,o,s]),(0,P.jsx)(i,{border:`1px solid`,borderColor:`border`,borderRadius:`md`,overflow:`hidden`,height:a,background:er(l),children:(0,P.jsx)(rr,{height:`100%`,language:r,value:e,theme:l,beforeMount:e=>{zn(e)},onMount:(e,t)=>{u.current=t;let r=e.getModel();d.current=r,r&&In(r,n),c&&r&&Hn(t,r,n),c&&(f.current=e.onDidChangeModelContent(()=>{let r=e.getModel();r&&Hn(t,r,n)})),tr(e),h(!0)},onChange:e=>t(e??``),options:or})})}function sr({subject:e,html:t,previewHeight:n=`220px`}){return(0,P.jsxs)(p,{align:`stretch`,gap:1,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Subject`}),(0,P.jsx)(f,{fontWeight:`medium`,textStyle:`sm`,children:e}),(0,P.jsx)(i,{border:`1px solid`,borderColor:`border`,borderRadius:`md`,overflow:`hidden`,height:n,minHeight:`120px`,bg:`white`,css:{resize:`vertical`},children:(0,P.jsx)(`iframe`,{srcDoc:t,sandbox:``,title:`Email preview`,style:{width:`100%`,height:`100%`,border:`none`}})})]})}var cr=`lwBlockKitBuilder`;function lr({payload:e}){let t=(0,N.useMemo)(()=>{if(!(`blocks`in e))return null;let t=JSON.stringify({blocks:e.blocks});return`https://app.slack.com/block-kit-builder#${encodeURIComponent(t)}`},[e]),n=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!t)return;let e=n.current;if(e){if(e.closed){n.current=null;return}try{e.location.replace(t)}catch{}}},[t]);let r=()=>{t&&window.open(t,`_blank`,`noopener,noreferrer`)},a=()=>{if(!t)return;let e=n.current;if(e&&!e.closed){try{e.location.replace(t)}catch{}e.focus();return}let r=window.open(t,cr,`width=1200,height=900`);if(r)try{r.opener=null}catch{}n.current=r};if(`text`in e)return(0,P.jsx)(ur,{text:e.text});let c=e.blocks.length;return(0,P.jsx)(i,{bg:`bg.subtle`,borderRadius:`md`,padding:4,border:`1px solid`,borderColor:`border`,children:(0,P.jsxs)(p,{align:`stretch`,gap:3,children:[(0,P.jsxs)(p,{align:`stretch`,gap:1,children:[(0,P.jsx)(f,{textStyle:`sm`,fontWeight:`semibold`,children:`Preview in Slack's Block Kit Builder`}),(0,P.jsxs)(f,{textStyle:`xs`,color:`fg.muted`,children:[c===1?`1 block ready to preview.`:`${c} blocks ready to preview.`,` `,`Block Kit renders differently than plain text, so preview where it will run.`]})]}),(0,P.jsxs)(s,{gap:2,align:`center`,flexWrap:`wrap`,children:[(0,P.jsx)(T,{content:`Preview your blocks in Slack's Block Kit Builder. Opens once in a new tab.`,positioning:{placement:`top`},children:(0,P.jsxs)(o,{size:`sm`,colorPalette:`orange`,variant:`outline`,onClick:r,children:[(0,P.jsx)(te,{size:14}),` Open in Block Kit Builder`]})}),(0,P.jsx)(T,{content:`Live preview in Slack's Block Kit Builder. Updates as you edit.`,positioning:{placement:`top`},children:(0,P.jsxs)(o,{size:`sm`,colorPalette:`orange`,variant:`solid`,onClick:a,children:[(0,P.jsx)(it,{size:14}),` Open synced Block Kit Builder`]})})]})]})})}function ur({text:e}){let t=(0,N.useMemo)(()=>dr(e),[e]);return(0,P.jsxs)(i,{borderWidth:`1px`,borderColor:`border`,borderRadius:`lg`,overflow:`hidden`,bg:`bg.panel`,children:[(0,P.jsxs)(s,{gap:2,align:`center`,paddingX:3,paddingY:2,borderBottomWidth:`1px`,borderColor:`border`,bg:`bg.subtle`,children:[(0,P.jsx)(i,{color:`fg.muted`,children:(0,P.jsx)(xn,{size:12})}),(0,P.jsx)(f,{textStyle:`xs`,fontWeight:`semibold`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wide`,children:`Preview`}),(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`— how this message will appear in Slack`})]}),(0,P.jsx)(i,{padding:4,children:(0,P.jsx)(_e,{children:t})})]})}function dr(e){return e.replace(/<(https?:\/\/[^>|\s]+)\|([^>]+)>/g,(e,t,n)=>`[${n.trim()}](${t})`).replace(/(^|[^*\w])\*([^*\n][^*\n]*?[^*\n\s])\*(?=[^*\w]|$)/g,(e,t,n)=>`${t}**${n}**`).replace(/(^|[^*\w])\*([^*\s])\*(?=[^*\w]|$)/g,(e,t,n)=>`${t}**${n}**`).replace(/(^|[^~\w])~([^~\n][^~\n]*?[^~\n\s])~(?=[^~\w]|$)/g,(e,t,n)=>`${t}~~${n}~~`).replace(/([^\n])\n(?!\n)/g,`$1
229
- `)}function fr({onTestFire:e,loading:t,disabled:n,hint:r}){return e?(0,P.jsxs)(s,{gap:2,children:[(0,P.jsxs)(o,{size:`xs`,variant:`outline`,width:`fit-content`,loading:t,disabled:n,onClick:e,children:[(0,P.jsx)(ve,{boxSize:3,children:(0,P.jsx)(me,{})}),`Send a test`]}),r?(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:r}):null]}):null}var pr={value:``,usingDefault:!0};function mr(){return{members:[],subject:pr,body:pr}}function hr(e){return e.members.length>0}function gr(e,t){let n=t.name||`(unnamed)`,r=e.members.length;return`${n} → email to ${r} recipient${r===1?``:`s`}`}function _r(e){let t=e.actionParams??{};return{members:Array.isArray(t.members)?t.members:[],subject:{value:e.emailSubjectTemplate??``,usingDefault:e.emailSubjectTemplate==null},body:{value:e.emailBodyTemplate??``,usingDefault:e.emailBodyTemplate==null}}}function vr(e){return{members:e.members}}function yr(e){return{webhook:null}}function br(e){return{emailSubjectTemplate:e.subject.usingDefault?null:e.subject.value,emailBodyTemplate:e.body.usingDefault?null:e.body.value,slackTemplate:null,slackTemplateType:null}}function xr({slice:e,onChange:t,ctx:n}){let r=ke.team.getTeamWithMembers.useQuery({slug:n.teamSlug??``,organizationId:n.organizationId??``},{enabled:!!n.teamSlug&&!!n.organizationId}),a=(0,N.useMemo)(()=>(r.data?.members??[]).map(e=>e.user.email).filter(e=>typeof e==`string`),[r.data]),c=(0,N.useMemo)(()=>new Set(a),[a]),l=(0,N.useMemo)(()=>e.members.filter(e=>!c.has(e)),[e.members,c]),[u,d]=(0,N.useState)(``),[m,h]=(0,N.useState)(null),g=(n,r)=>{let i=r?[...e.members,n]:e.members.filter(e=>e!==n);t({...e,members:i})},_=()=>{let n=u.trim();if(n){if(!Ft.test(n)){h(`That doesn't look like a valid email address.`);return}if(e.members.includes(n)){h(`Already on the recipient list.`);return}t({...e,members:[...e.members,n]}),d(``),h(null)}},v=n=>{t({...e,members:e.members.filter(e=>e!==n)})},y=Et(n.sourceKind),b=e.subject.usingDefault?y.emailSubject:e.subject.value,ee=e.body.usingDefault?y.emailBody:e.body.value,x=n.preview,S=(0,N.useMemo)(()=>kt(n.variables,n.cadenceMode),[n.variables,n.cadenceMode]),[C,T]=(0,N.useState)(!e.subject.usingDefault||!e.body.usingDefault);return(0,P.jsxs)(p,{align:`stretch`,gap:4,children:[(0,P.jsxs)(E,{children:[(0,P.jsx)(D,{children:`Recipients`}),(0,P.jsx)(p,{align:`stretch`,gap:1,children:a.length===0?(0,P.jsx)(f,{color:`fg.muted`,textStyle:`sm`,children:`No team members found.`}):a.map(t=>(0,P.jsxs)(s,{as:`label`,cursor:`pointer`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:e.members.includes(t),onChange:e=>g(t,e.target.checked),"aria-label":`Send to ${t}`}),(0,P.jsx)(f,{children:t})]},t))})]}),(0,P.jsxs)(i,{children:[(0,P.jsx)(f,{textStyle:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:2,children:`External recipients`}),l.length===0?(0,P.jsx)(f,{textStyle:`sm`,color:`fg.muted`,mb:2,children:`None yet.`}):(0,P.jsx)(p,{align:`stretch`,gap:1,mb:2,children:l.map(e=>(0,P.jsxs)(s,{children:[(0,P.jsx)(f,{flex:`1`,minWidth:`0`,children:e}),(0,P.jsx)(w,{size:`sm`,colorPalette:`orange`,title:`This address is outside your team. The trigger payload — trace input, output, metadata — will leave your org.`,children:`External`}),(0,P.jsx)(o,{size:`xs`,variant:`ghost`,onClick:()=>v(e),"aria-label":`Remove ${e}`,children:(0,P.jsx)(Be,{size:14})})]},e))}),(0,P.jsxs)(s,{children:[(0,P.jsx)(j,{value:u,placeholder:`alerts@partner.com`,onChange:e=>{d(e.target.value),h(null)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_())}}),(0,P.jsx)(o,{variant:`outline`,onClick:_,disabled:!u.trim(),children:`Add email`})]}),m?(0,P.jsx)(f,{textStyle:`xs`,color:`fg.error`,mt:1,children:m}):null]}),(0,P.jsx)(fr,{onTestFire:n.onTestFire,loading:n.testFireLoading,disabled:!hr(e),hint:hr(e)?void 0:`Add a recipient first`}),(0,P.jsxs)(p,{align:`stretch`,gap:2,children:[(0,P.jsx)(f,{textStyle:`sm`,fontWeight:`semibold`,children:`Message`}),(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`We send a ready-made summary email. Customize the wording to change the subject or body.`}),(0,P.jsxs)(ar,{triggerLabel:`Customize wording`,open:C,onToggle:()=>T(e=>!e),children:[(0,P.jsx)(ir,{label:`Subject`,usingDefault:e.subject.usingDefault,onReset:()=>t({...e,subject:pr}),trailing:(0,P.jsx)(R,{variables:S})}),(0,P.jsx)(i,{"data-testid":`email-subject-editor`,children:(0,P.jsx)(U,{variables:S,height:`56px`,value:b,onChange:n=>t({...e,subject:{value:n,usingDefault:!1}})})}),(0,P.jsx)(ir,{label:`Body (Markdown + Liquid)`,usingDefault:e.body.usingDefault,onReset:()=>t({...e,body:pr}),trailing:(0,P.jsx)(R,{variables:S})}),(0,P.jsx)(i,{"data-testid":`email-body-editor`,children:(0,P.jsx)(U,{variables:S,height:`520px`,value:ee,onChange:n=>t({...e,body:{value:n,usingDefault:!1}})})})]})]}),x?(0,P.jsx)(sr,{subject:x.subject,html:x.html,previewHeight:`520px`}):null]})}var Sr={Icon:Ae,channel:`email`,initialSlice:mr,isComplete:hr,summary:gr,fromTriggerRow:_r,toActionParams:vr,testFireTarget:yr,templatesFromSlice:br,ConfigForm:xr},Cr=`{%- capture _see_all_url -%}
230
- {{ project.url }}/messages?startDate={{ digest.windowStart | url_encode }}&endDate={{ digest.windowEnd | url_encode }}
231
- {%- endcapture -%}
232
- {%- capture _window_label -%}
233
- {%- if digest.windowStart -%}{{ digest.windowStart | date: "%H:%M" }}–{{ digest.windowEnd | date: "%H:%M %Z" }}{%- endif -%}
234
- {%- endcapture -%}
235
- {%- capture _summary -%}
236
- *{{ digest.count }}* match{% if digest.count != 1 %}es{% endif %}{% if _window_label != "" %} · {{ _window_label }}{% endif %}
237
- {%- endcapture -%}
238
- [
239
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | prepend: "📊 " | truncate: 140 | json }}, "emoji": true } },
240
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _summary | json }} }] },
241
- { "type": "divider" }
242
- {%- for m in matches limit: 10 -%}
243
- {%- capture _row -%}
244
- {%- if m.evaluation %}\`{{ m.evaluation.score | default: "—" }}\` *{{ m.evaluation.evaluatorName | default: "eval" | mrkdwn_escape }}* · {% endif -%}
245
- _{{ m.trace.input | truncate: 120 | mrkdwn_escape }}_ · <{{ m.trace.url }}|↗>
246
- {%- endcapture -%}
247
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _row | json }} } }
248
- {%- endfor -%}
249
- {%- capture _more_label -%}
250
- {%- if digest.count > 10 %}See all {{ digest.count }} matches in LangWatch ↗{%- else -%}View these matches in LangWatch ↗{%- endif -%}
251
- {%- endcapture -%}
252
- {%- capture _more -%}
253
- <{{ _see_all_url }}|{{ _more_label }}>
254
- {%- endcapture -%}
255
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _more | json }} }] }
256
- ]
257
- `,wr=`{%- capture _see_all_url -%}
258
- {{ project.url }}/messages?startDate={{ digest.windowStart | url_encode }}&endDate={{ digest.windowEnd | url_encode }}
259
- {%- endcapture -%}
260
- {%- capture _window_label -%}
261
- {%- if digest.windowStart -%}{{ digest.windowStart | date: "%H:%M" }}–{{ digest.windowEnd | date: "%H:%M %Z" }}{%- endif -%}
262
- {%- endcapture -%}
263
- {%- capture _summary -%}
264
- *{{ digest.count }}* match{% if digest.count != 1 %}es{% endif %}{% if _window_label != "" %} · {{ _window_label }}{% endif %}
265
- {%- endcapture -%}
266
- {%- assign _groups = matches | group_by: "evaluation.evaluatorName" -%}
267
- {%- capture _segments -%}
268
- {%- for g in _groups limit: 12 -%}
269
- {% unless forloop.first %},{% endunless %}{ "label": {{ g.name | default: "Other" | truncate: 20 | json }}, "value": {{ g.items.size }} }
270
- {%- endfor -%}
271
- {%- endcapture -%}
272
- [
273
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | prepend: "📈 " | truncate: 140 | json }}, "emoji": true } },
274
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _summary | json }} }] }
275
- {%- if _groups.size > 0 -%}
276
- ,{ "type": "data_visualization", "block_id": "matches_by_evaluator", "title": "Matches by evaluator", "chart": { "type": "pie", "segments": [ {{ _segments }} ] } }
277
- {%- endif -%}
278
- ,{ "type": "divider" }
279
- {%- for g in _groups -%}
280
- {%- capture _row -%}
281
- *{{ g.name | default: "Other matches" | mrkdwn_escape }}* — {{ g.items.size }} match{% if g.items.size != 1 %}es{% endif %}
282
- {%- endcapture -%}
283
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _row | json }} } }
284
- {%- endfor -%}
285
- {%- capture _more -%}
286
- <{{ _see_all_url }}|See all {{ digest.count }} matches in LangWatch ↗>
287
- {%- endcapture -%}
288
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _more | json }} }] }
289
- ]
290
- `,Tr=`{%- capture _see_all_url -%}
291
- {{ project.url }}/messages?startDate={{ digest.windowStart | url_encode }}&endDate={{ digest.windowEnd | url_encode }}
292
- {%- endcapture -%}
293
- {%- capture _window_label -%}
294
- {%- if digest.windowStart -%}{{ digest.windowStart | date: "%H:%M" }}–{{ digest.windowEnd | date: "%H:%M %Z" }}{%- endif -%}
295
- {%- endcapture -%}
296
- {%- capture _summary -%}
297
- *{{ digest.count }}* match{% if digest.count != 1 %}es{% endif %}{% if _window_label != "" %} · {{ _window_label }}{% endif %}
298
- {%- endcapture -%}
299
- {%- assign _sliced = matches | slice: 0, 6 -%}
300
- {%- assign _groups = _sliced | group_by: "evaluation.evaluatorName" -%}
301
- [
302
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | prepend: "📊 " | truncate: 140 | json }}, "emoji": true } },
303
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _summary | json }} }] }
304
- {%- for g in _groups -%}
305
- ,{ "type": "divider" }
306
- {%- capture _grp -%}
307
- *{{ g.name | default: "Other" | mrkdwn_escape }}* · {{ g.items.size }} match{% if g.items.size != 1 %}es{% endif %}
308
- {%- endcapture -%}
309
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _grp | json }} }] }
310
- {%- for m in g.items -%}
311
- {%- capture _title -%}
312
- {% if m.evaluation.score != null %}\`{{ m.evaluation.score }}\` {% endif %}*{{ m.trace.metadata.model | default: "trace" | mrkdwn_escape }}* · <{{ m.trace.url }}|\`{{ m.trace.id | truncate: 12 }}\` ↗>
313
- {%- endcapture -%}
314
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _title | json }} } }
315
- {%- assign _i = m.trace.input | truncate: 600 -%}
316
- {%- assign _o = m.trace.output | truncate: 600 -%}
317
- {%- capture _rt -%}
318
- {%- if _i != "" -%}
319
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Input", "style": { "bold": true } }] },
320
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _i | json }} }] }
321
- {%- endif -%}
322
- {%- if _i != "" and _o != "" -%},{%- endif -%}
323
- {%- if _o != "" -%}
324
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Output", "style": { "bold": true } }] },
325
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _o | json }} }] }
326
- {%- endif -%}
327
- {%- endcapture -%}
328
- {%- if _rt != "" -%}
329
- ,{ "type": "rich_text", "elements": [ {{ _rt }} ] }
330
- {%- endif -%}
331
- {%- endfor -%}
332
- {%- endfor -%}
333
- {%- if digest.count > 6 -%}
334
- ,{ "type": "divider" }
335
- {%- capture _more -%}
336
- <{{ _see_all_url }}|See all {{ digest.count }} matches in LangWatch ↗>
337
- {%- endcapture -%}
338
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _more | json }} }] }
339
- {%- endif -%}
340
- ]
341
- `,Er=`{%- capture _summary -%}
342
- {{ digest.count }} match{% if digest.count != 1 %}es{% endif %}{% if digest.windowStart %} · window {{ digest.windowStart | date: "%H:%M" }}–{{ digest.windowEnd | date: "%H:%M" }}{% endif %}
343
- {%- endcapture -%}
344
- {%- capture _seeall -%}
345
- <{{ project.url }}/messages|See all {{ digest.count }} in LangWatch ↗>
346
- {%- endcapture -%}
347
- {%- capture _rows -%}
348
- {%- for m in matches limit: 20 -%}
349
- ,[
350
- { "type": "raw_text", "text": {{ m.evaluation.score | default: "—" | append: "" | json }} },
351
- { "type": "raw_text", "text": {{ m.evaluation.evaluatorName | default: "—" | append: "" | json }} },
352
- { "type": "raw_text", "text": {{ m.trace.input | truncate: 80 | default: "—" | append: "" | json }} },
353
- { "type": "rich_text", "elements": [{ "type": "rich_text_section", "elements": [{ "type": "link", "url": {{ m.trace.url | json }}, "text": "View" }] }] }
354
- ]
355
- {%- endfor -%}
356
- {%- endcapture -%}
357
- {%- capture _list -%}
358
- {%- for m in matches limit: 10 -%}
359
- {% if m.evaluation %}\`{{ m.evaluation.score | default: "—" }}\` *{{ m.evaluation.evaluatorName | default: "eval" | mrkdwn_escape }}* · {% endif %}_{{ m.trace.input | truncate: 80 | mrkdwn_escape }}_ · <{{ m.trace.url }}|↗>{% unless forloop.last %}
360
- {% endunless %}
361
- {%- endfor -%}
362
- {%- endcapture -%}
363
- [
364
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | truncate: 140 | json }}, "emoji": true } },
365
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _summary | json }} }] },
366
- { "type": "data_table", "caption": {{ _summary | json }}, "rows": [
367
- [
368
- { "type": "raw_text", "text": "Score" },
369
- { "type": "raw_text", "text": "Evaluator" },
370
- { "type": "raw_text", "text": "Input" },
371
- { "type": "raw_text", "text": "Link" }
372
- ]
373
- {{ _rows }}
374
- ] },
375
- { "type": "section", "text": { "type": "mrkdwn", "text": {{ _list | json }} } },
376
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _seeall | json }} }] }
377
- ]
378
- `,Dr=`{%- capture _header_text -%}
379
- {% if match.evaluation.passed == false %}🛑 {% else %}🔔 {% endif %}{{ trigger.name }}
380
- {%- endcapture -%}
381
- {%- capture _ctx_eval -%}
382
- {%- if match.evaluation %}*{{ match.evaluation.evaluatorName | default: "Evaluation" | mrkdwn_escape }}* \`{{ match.evaluation.score | default: "—" }}\`{% if match.evaluation.label %} · {{ match.evaluation.label | mrkdwn_escape }}{% endif %}{% if match.evaluation.passed == false %} · *failed*{% elsif match.evaluation.passed == true %} · *passed*{% endif %}{%- endif -%}
383
- {%- if match.evaluation and trigger.alertType %} · {% endif -%}
384
- {%- if trigger.alertType %}_{{ trigger.alertType }}_{%- endif -%}
385
- {%- endcapture -%}
386
- {%- capture _footer -%}
387
- \`{{ match.trace.id | truncate: 12 }}\`{% if match.trace.metadata.model %} · {{ match.trace.metadata.model | mrkdwn_escape }}{% endif %}{% if match.trace.metadata.duration_ms %} · {{ match.trace.metadata.duration_ms }}ms{% endif %}{% if match.trace.metadata.cost %} · \${{ match.trace.metadata.cost }}{% endif %} · <{{ match.trace.url }}|View in LangWatch ↗>
388
- {%- endcapture -%}
389
- {%- assign _input = match.trace.input | truncate: 1500 -%}
390
- {%- assign _output = match.trace.output | truncate: 1500 -%}
391
- {%- assign _out_first = match.trace.output | strip | slice: 0 -%}
392
- {%- capture _rt_body -%}
393
- {%- if _input != "" -%}
394
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Input", "style": { "bold": true } }] },
395
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _input | json }} }] }
396
- {%- endif -%}
397
- {%- if _input != "" and _output != "" -%},{%- endif -%}
398
- {%- if _output != "" -%}
399
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Output", "style": { "bold": true } }] },
400
- {%- if _out_first == "{" or _out_first == "[" -%}
401
- { "type": "rich_text_preformatted", "elements": [{ "type": "text", "text": {{ _output | json }} }] }
402
- {%- else -%}
403
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _output | json }} }] }
404
- {%- endif -%}
405
- {%- endif -%}
406
- {%- endcapture -%}
407
- [
408
- { "type": "header", "text": { "type": "plain_text", "text": {{ _header_text | truncate: 140 | json }}, "emoji": true } }
409
- {%- if _ctx_eval != "" -%}
410
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _ctx_eval | json }} }] }
411
- {%- endif -%}
412
- ,{ "type": "divider" }
413
- {%- if _rt_body != "" -%}
414
- ,{ "type": "rich_text", "elements": [ {{ _rt_body }} ] }
415
- {%- endif -%}
416
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _footer | json }} }] }
417
- ]
418
- `,Or=`{%- capture _level -%}
419
- {%- if match.evaluation.passed == false -%}error{%- elsif match.evaluation.passed == true -%}success{%- else -%}warning{%- endif -%}
420
- {%- endcapture -%}
421
- {%- capture _alert_text -%}
422
- {%- if match.evaluation -%}*{{ match.evaluation.evaluatorName | default: "Evaluation" | mrkdwn_escape }}*{% if match.evaluation.passed == false %} failed{% elsif match.evaluation.passed == true %} passed{% endif %}{% if match.evaluation.score != null %} · score {{ match.evaluation.score }}{% endif %}{% if match.evaluation.label %} · {{ match.evaluation.label | mrkdwn_escape }}{% endif %}{%- else -%}Evaluation result for {{ trigger.name | mrkdwn_escape }}{%- endif -%}
423
- {%- endcapture -%}
424
- {%- capture _header_text -%}
425
- {% if match.evaluation.passed == false %}🛑 {% else %}🔔 {% endif %}{{ trigger.name }}
426
- {%- endcapture -%}
427
- {%- capture _ctx_eval -%}
428
- {%- if match.evaluation %}*{{ match.evaluation.evaluatorName | default: "Evaluation" | mrkdwn_escape }}* \`{{ match.evaluation.score | default: "—" }}\`{% if match.evaluation.passed == false %} · *failed*{% elsif match.evaluation.passed == true %} · *passed*{% endif %}{%- endif -%}
429
- {%- if trigger.alertType %} · _{{ trigger.alertType }}_{% endif -%}
430
- {%- endcapture -%}
431
- {%- capture _footer -%}
432
- \`{{ match.trace.id | truncate: 12 }}\` · <{{ match.trace.url }}|View trace ↗>
433
- {%- endcapture -%}
434
- {%- assign _input = match.trace.input | truncate: 1500 -%}
435
- {%- assign _output = match.trace.output | truncate: 1500 -%}
436
- {%- assign _out_first = match.trace.output | strip | slice: 0 -%}
437
- {%- capture _rt_body -%}
438
- {%- if _input != "" -%}
439
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Input", "style": { "bold": true } }] },
440
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _input | json }} }] }
441
- {%- endif -%}
442
- {%- if _input != "" and _output != "" -%},{%- endif -%}
443
- {%- if _output != "" -%}
444
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Output", "style": { "bold": true } }] },
445
- {%- if _out_first == "{" or _out_first == "[" -%}
446
- { "type": "rich_text_preformatted", "elements": [{ "type": "text", "text": {{ _output | json }} }] }
447
- {%- else -%}
448
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _output | json }} }] }
449
- {%- endif -%}
450
- {%- endif -%}
451
- {%- endcapture -%}
452
- [
453
- { "type": "alert", "level": {{ _level | json }}, "text": { "type": "mrkdwn", "text": {{ _alert_text | truncate: 190 | json }} } },
454
- { "type": "header", "text": { "type": "plain_text", "text": {{ _header_text | truncate: 140 | json }}, "emoji": true } }
455
- {%- if _ctx_eval != "" -%}
456
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _ctx_eval | json }} }] }
457
- {%- endif -%}
458
- ,{ "type": "divider" }
459
- {%- if _rt_body != "" -%}
460
- ,{ "type": "rich_text", "elements": [ {{ _rt_body }} ] }
461
- {%- endif -%}
462
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _footer | json }} }] }
463
- ]
464
- `,kr=`{%- capture _emoji -%}{% if trigger.alertType == 'INFO' %}ℹ️{% elsif trigger.alertType == 'CRITICAL' %}🔴{% else %}🚨{% endif %}{%- endcapture -%}
465
- {%- capture _metric_field -%}
466
- *Metric*
467
- {{ metric.label | mrkdwn_escape }}
468
- {%- endcapture -%}
469
- {%- capture _condition_field -%}
470
- *Condition*
471
- {{ condition.operatorLabel }} {{ condition.threshold }} over the {{ condition.timePeriodLabel }}
472
- {%- endcapture -%}
473
- {%- capture _value_field -%}
474
- *Current value*
475
- {{ currentValue }}{% if previousValue != nil %} (was {{ previousValue }}){% endif %}
476
- {%- endcapture -%}
477
- {%- capture _links -%}
478
- <{{ graph.url }}|Open dashboard ↗> · <{{ trigger.editUrl }}|Edit alert>
479
- {%- endcapture -%}
480
- [
481
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | truncate: 140 | prepend: " " | prepend: _emoji | json }}, "emoji": true } },
482
- { "type": "section", "fields": [
483
- { "type": "mrkdwn", "text": {{ _metric_field | json }} },
484
- { "type": "mrkdwn", "text": {{ _condition_field | json }} },
485
- { "type": "mrkdwn", "text": {{ _value_field | json }} }
486
- ] }
487
- {%- if sparkline != "" -%}
488
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ sparkline | prepend: "Trend: \`" | append: "\`" | json }} }] }
489
- {%- endif -%}
490
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _links | json }} }] }
491
- ]
492
- `,Ar=`{%- capture _emoji -%}{% if trigger.alertType == 'INFO' %}ℹ️{% elsif trigger.alertType == 'CRITICAL' %}🔴{% else %}🚨{% endif %}{%- endcapture -%}
493
- {%- capture _metric_field -%}
494
- *Metric*
495
- {{ metric.label | mrkdwn_escape }}
496
- {%- endcapture -%}
497
- {%- capture _condition_field -%}
498
- *Condition*
499
- {{ condition.operatorLabel }} {{ condition.threshold }} over the {{ condition.timePeriodLabel }}
500
- {%- endcapture -%}
501
- {%- capture _value_field -%}
502
- *Current value*
503
- {{ currentValue }}{% if previousValue != nil %} (was {{ previousValue }}){% endif %}
504
- {%- endcapture -%}
505
- {%- comment -%}
506
- \`history\` runs oldest-first and can hold far more points than the chart shows.
507
- A plain \`limit: 20\` would plot the OLDEST 20 buckets — the breach that fired the
508
- alert would be missing from its own chart. So skip ahead to the last 20 buckets
509
- with an offset, keeping the series chronological for the x-axis.
510
- {%- endcomment -%}
511
- {%- assign _history_size = history | size -%}
512
- {%- assign _chart_offset = _history_size | minus: 20 -%}
513
- {%- if _chart_offset < 0 -%}{%- assign _chart_offset = 0 -%}{%- endif -%}
514
- {%- capture _points -%}
515
- {%- for point in history offset: _chart_offset limit: 20 -%}
516
- {% unless forloop.first %},{% endunless %}{ "label": {{ point.timestamp | date: "%H:%M" | json }}, "value": {{ point.value }} }
517
- {%- endfor -%}
518
- {%- endcapture -%}
519
- {%- capture _categories -%}
520
- {%- for point in history offset: _chart_offset limit: 20 -%}
521
- {% unless forloop.first %},{% endunless %}{{ point.timestamp | date: "%H:%M" | json }}
522
- {%- endfor -%}
523
- {%- endcapture -%}
524
- {%- assign _newest_first = history | reverse -%}
525
- {%- capture _recent -%}
526
- Recent: {% for point in _newest_first limit: 8 %}\`{{ point.timestamp | date: "%H:%M" }}\` {{ point.value }}{% unless forloop.last %} · {% endunless %}{% endfor %}
527
- {%- endcapture -%}
528
- {%- capture _links -%}
529
- <{{ graph.url }}|Open dashboard ↗> · <{{ trigger.editUrl }}|Edit alert>
530
- {%- endcapture -%}
531
- [
532
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | truncate: 140 | prepend: " " | prepend: _emoji | json }}, "emoji": true } },
533
- { "type": "section", "fields": [
534
- { "type": "mrkdwn", "text": {{ _metric_field | json }} },
535
- { "type": "mrkdwn", "text": {{ _condition_field | json }} },
536
- { "type": "mrkdwn", "text": {{ _value_field | json }} }
537
- ] }
538
- {%- if reason == "heartbeat-absence" -%}
539
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": "_No qualifying data was seen in the window._" } }
540
- {%- endif -%}
541
- {%- if history != empty -%}
542
- ,{ "type": "data_visualization", "block_id": "metric_trend", "title": {{ metric.label | truncate: 50 | json }}, "chart": { "type": "area", "series": [{ "name": {{ metric.label | truncate: 20 | json }}, "data": [ {{ _points }} ] }], "axis_config": { "categories": [ {{ _categories }} ], "x_label": "Time", "y_label": {{ metric.label | truncate: 50 | json }} } } }
543
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _recent | json }} }] }
544
- {%- endif -%}
545
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _links | json }} }] }
546
- ]
547
- `,jr=`{%- capture _emoji -%}{% if trigger.alertType == 'INFO' %}ℹ️{% elsif trigger.alertType == 'CRITICAL' %}🔴{% else %}🚨{% endif %}{%- endcapture -%}
548
- {%- capture _metric_field -%}
549
- *Metric*
550
- {{ metric.label | mrkdwn_escape }}
551
- {%- endcapture -%}
552
- {%- capture _condition_field -%}
553
- *Condition*
554
- {{ condition.operatorLabel }} {{ condition.threshold }} over the {{ condition.timePeriodLabel }}
555
- {%- endcapture -%}
556
- {%- capture _value_field -%}
557
- *Current value*
558
- {{ currentValue }}{% if previousValue != nil %} (was {{ previousValue }}){% endif %}
559
- {%- endcapture -%}
560
- {%- comment -%}
561
- \`history\` runs oldest-first and can hold far more points than a message should
562
- carry, so reverse it FIRST and take from the newest end. \`limit\` applies before
563
- \`reversed\` in a Liquid for-tag, so \`for point in history reversed limit: 20\`
564
- would take the OLDEST 20 and show them under a "Recent values" caption — the
565
- breach that fired the alert would not appear in its own message.
566
- {%- endcomment -%}
567
- {%- assign _newest_first = history | reverse -%}
568
- {%- capture _rows -%}
569
- {%- for point in _newest_first limit: 20 -%}
570
- ,[
571
- { "type": "raw_text", "text": {{ point.timestamp | date: "%H:%M" | json }} },
572
- { "type": "raw_number", "value": {{ point.value }}, "text": {{ point.value | append: "" | json }} }
573
- ]
574
- {%- endfor -%}
575
- {%- endcapture -%}
576
- {%- capture _recent -%}
577
- Recent: {% for point in _newest_first limit: 8 %}\`{{ point.timestamp | date: "%H:%M" }}\` {{ point.value }}{% unless forloop.last %} · {% endunless %}{% endfor %}
578
- {%- endcapture -%}
579
- {%- capture _links -%}
580
- <{{ graph.url }}|Open dashboard ↗> · <{{ trigger.editUrl }}|Edit alert>
581
- {%- endcapture -%}
582
- [
583
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | truncate: 140 | prepend: " " | prepend: _emoji | json }}, "emoji": true } },
584
- { "type": "section", "fields": [
585
- { "type": "mrkdwn", "text": {{ _metric_field | json }} },
586
- { "type": "mrkdwn", "text": {{ _condition_field | json }} },
587
- { "type": "mrkdwn", "text": {{ _value_field | json }} }
588
- ] }
589
- {%- if history != empty -%}
590
- ,{ "type": "data_table", "caption": {{ metric.label | truncate: 60 | prepend: "Recent values — " | json }}, "rows": [
591
- [
592
- { "type": "raw_text", "text": "Time" },
593
- { "type": "raw_text", "text": "Value" }
594
- ]
595
- {{ _rows }}
596
- ] }
597
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _recent | json }} }] }
598
- {%- endif -%}
599
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _links | json }} }] }
600
- ]
601
- `,Mr=`{%- capture _level -%}
602
- {%- if reason == "heartbeat-absence" -%}warning{%- elsif reason == "heartbeat-resolve" -%}success{%- else -%}error{%- endif -%}
603
- {%- endcapture -%}
604
- {%- capture _header -%}
605
- {% if reason == "heartbeat-absence" %}🔇 No data: {{ trigger.name }}{% elsif reason == "heartbeat-resolve" %}✅ Recovered: {{ trigger.name }}{% else %}🚨 {{ trigger.name }}{% endif %}
606
- {%- endcapture -%}
607
- {%- capture _lead -%}
608
- {% if reason == "heartbeat-absence" %}No qualifying data was seen for *{{ metric.label | mrkdwn_escape }}* in the {{ condition.timePeriodLabel }}.{% elsif reason == "heartbeat-resolve" %}*{{ metric.label | mrkdwn_escape }}* is reporting again and back within threshold.{% else %}*{{ metric.label | mrkdwn_escape }}* {{ condition.operatorLabel }} {{ condition.threshold }} over the {{ condition.timePeriodLabel }}.{% endif %}
609
- {%- endcapture -%}
610
- {%- capture _detail -%}
611
- Expected *{{ metric.label | mrkdwn_escape }}* {{ condition.operatorLabel }} {{ condition.threshold }} · checked {{ occurredAt | date: "%b %d, %H:%M" }}
612
- {%- endcapture -%}
613
- {%- capture _links -%}
614
- <{{ graph.url }}|Open dashboard ↗> · <{{ trigger.editUrl }}|Edit alert>
615
- {%- endcapture -%}
616
- [
617
- { "type": "alert", "level": {{ _level | json }}, "text": { "type": "mrkdwn", "text": {{ _lead | truncate: 190 | json }} } },
618
- { "type": "header", "text": { "type": "plain_text", "text": {{ _header | truncate: 140 | json }}, "emoji": true } },
619
- { "type": "section", "text": { "type": "mrkdwn", "text": {{ _lead | json }} } },
620
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _detail | json }} }] },
621
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _links | json }} }] }
622
- ]
623
- `,Nr=`{%- capture _emoji -%}{% if trigger.alertType == 'INFO' %}ℹ️{% elsif trigger.alertType == 'CRITICAL' %}🔴{% else %}🚨{% endif %}{%- endcapture -%}
624
- {%- capture _line -%}
625
- {{ _emoji }} *{{ trigger.name | mrkdwn_escape }}* · {{ metric.label | mrkdwn_escape }} {{ condition.operatorLabel }} {{ condition.threshold }} — now {{ currentValue }} · <{{ graph.url }}|Open dashboard ↗>
626
- {%- endcapture -%}
627
- [
628
- { "type": "section", "text": { "type": "mrkdwn", "text": {{ _line | json }} } }
629
- ]
630
- `,Pr=`{%- capture _level -%}
631
- {%- if reason == "heartbeat-resolve" -%}success{%- elsif reason == "heartbeat-absence" -%}warning{%- else -%}error{%- endif -%}
632
- {%- endcapture -%}
633
- {%- capture _header -%}
634
- {% if reason == "heartbeat-resolve" %}✅ Recovered: {{ trigger.name }}{% elsif reason == "heartbeat-absence" %}🔇 No data: {{ trigger.name }}{% else %}🚨 {{ trigger.name }}{% endif %}
635
- {%- endcapture -%}
636
- {%- capture _lead -%}
637
- {% if reason == "heartbeat-resolve" %}*{{ metric.label | mrkdwn_escape }}* is back within threshold ({{ condition.operatorLabel }} {{ condition.threshold }} over the {{ condition.timePeriodLabel }}).{% elsif reason == "heartbeat-absence" %}No qualifying data was seen for *{{ metric.label | mrkdwn_escape }}* in the {{ condition.timePeriodLabel }}.{% else %}*{{ metric.label | mrkdwn_escape }}* {{ condition.operatorLabel }} {{ condition.threshold }} over the {{ condition.timePeriodLabel }}.{% endif %}
638
- {%- endcapture -%}
639
- {%- capture _was_field -%}
640
- *Was*
641
- {{ previousValue | default: "—" }}
642
- {%- endcapture -%}
643
- {%- capture _now_field -%}
644
- *Now*
645
- {{ currentValue }}
646
- {%- endcapture -%}
647
- {%- capture _when -%}
648
- {{ occurredAt | date: "%b %d, %H:%M" }}
649
- {%- endcapture -%}
650
- {%- capture _links -%}
651
- <{{ graph.url }}|Open dashboard ↗> · <{{ trigger.editUrl }}|Edit alert>
652
- {%- endcapture -%}
653
- [
654
- { "type": "alert", "level": {{ _level | json }}, "text": { "type": "mrkdwn", "text": {{ _lead | truncate: 190 | json }} } },
655
- { "type": "header", "text": { "type": "plain_text", "text": {{ _header | truncate: 140 | json }}, "emoji": true } },
656
- { "type": "section", "text": { "type": "mrkdwn", "text": {{ _lead | json }} } },
657
- { "type": "section", "fields": [
658
- { "type": "mrkdwn", "text": {{ _was_field | json }} },
659
- { "type": "mrkdwn", "text": {{ _now_field | json }} }
660
- ] },
661
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _when | json }} }] },
662
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _links | json }} }] }
663
- ]
664
- `,Fr=`{%- assign chart = charts | first -%}
665
- {%- capture _sub -%}
666
- {{ chart.title | default: report.sourceLabel | mrkdwn_escape }} · {{ report.scheduleLabel }}
667
- {%- endcapture -%}
668
- {%- comment -%}
669
- Slack plots at most 20 points per series. A \`limit: 20\` would chart only the
670
- FIRST 20 buckets — a week-long report would show its first few hours and call it
671
- the week. So take every Nth bucket instead: the chart still spans the whole
672
- period, at a coarser resolution.
673
- {%- endcomment -%}
674
- {%- assign _bucket_count = chart.categories | size -%}
675
- {%- assign _stride = _bucket_count | divided_by: 20.0 | ceil -%}
676
- {%- if _stride < 1 -%}{%- assign _stride = 1 -%}{%- endif -%}
677
- {%- capture _chart_json -%}
678
- {%- if chart.type == "pie" -%}
679
- { "type": "pie", "segments": [
680
- {%- for seg in chart.segments limit: 8 -%}
681
- {% unless forloop.first %},{% endunless %}{ "label": {{ seg.label | truncate: 40 | json }}, "value": {{ seg.value }} }
682
- {%- endfor -%}
683
- ] }
684
- {%- else -%}
685
- { "type": {{ chart.type | json }}, "series": [
686
- {%- for s in chart.series limit: 5 -%}
687
- {% unless forloop.first %},{% endunless %}{ "name": {{ s.name | truncate: 20 | json }}, "data": [
688
- {%- for p in s.data -%}
689
- {%- assign _keep = forloop.index0 | modulo: _stride -%}
690
- {%- if _keep == 0 -%}{% unless forloop.first %},{% endunless %}{ "label": {{ p.label | json }}, "value": {{ p.value }} }{%- endif -%}
691
- {%- endfor -%}
692
- ] }
693
- {%- endfor -%}
694
- ], "axis_config": { "categories": [
695
- {%- for c in chart.categories -%}
696
- {%- assign _keep = forloop.index0 | modulo: _stride -%}
697
- {%- if _keep == 0 -%}{% unless forloop.first %},{% endunless %}{{ c | json }}{%- endif -%}
698
- {%- endfor -%}
699
- ], "x_label": "Time", "y_label": {{ chart.title | truncate: 50 | json }} } }
700
- {%- endif -%}
701
- {%- endcapture -%}
702
- {%- assign _series_count = chart.series | size -%}
703
- {%- capture _headline -%}
704
- *{{ chart.total | round: 2 }}* over this period{% if _series_count > 1 %} · {{ _series_count }} series{% endif %}
705
- {%- endcapture -%}
706
- {%- capture _view -%}
707
- <{{ viewUrl }}|Open in LangWatch ↗> · {{ occurredAt | date: "%b %d, %H:%M" }}
708
- {%- endcapture -%}
709
- [
710
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | prepend: "📈 " | truncate: 140 | json }}, "emoji": true } },
711
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _sub | json }} }] }
712
- {%- if report.isEmpty -%}
713
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": "_No data for this period._" } }
714
- {%- else -%}
715
- ,{ "type": "data_visualization", "block_id": "report_chart", "title": {{ chart.title | truncate: 50 | json }}, "chart": {{ _chart_json }} }
716
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _headline | json }} } }
717
- {%- endif -%}
718
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _view | json }} }] }
719
- ]
720
- `,Ir=`{%- assign chart = charts | first -%}
721
- {%- capture _sub -%}
722
- {{ report.scheduleLabel }}
723
- {%- endcapture -%}
724
- {%- capture _body -%}
725
- {%- if report.isEmpty -%}
726
- No data for this period.
727
- {%- else -%}
728
- *{{ chart.total | round: 2 }}* · {{ chart.title | truncate: 60 | mrkdwn_escape }}
729
- {%- endif -%}
730
- {%- endcapture -%}
731
- {%- comment -%}
732
- Slack plots at most 20 points per series. A \`limit: 20\` would chart only the
733
- FIRST 20 buckets of the period, so take every Nth bucket instead — the chart
734
- still spans the whole period, at a coarser resolution.
735
- {%- endcomment -%}
736
- {%- assign _bucket_count = chart.categories | size -%}
737
- {%- assign _stride = _bucket_count | divided_by: 20.0 | ceil -%}
738
- {%- if _stride < 1 -%}{%- assign _stride = 1 -%}{%- endif -%}
739
- {%- capture _chart_json -%}
740
- {%- if chart.type == "pie" -%}
741
- { "type": "pie", "segments": [
742
- {%- for seg in chart.segments limit: 8 -%}
743
- {% unless forloop.first %},{% endunless %}{ "label": {{ seg.label | truncate: 40 | json }}, "value": {{ seg.value }} }
744
- {%- endfor -%}
745
- ] }
746
- {%- else -%}
747
- { "type": {{ chart.type | json }}, "series": [
748
- {%- for s in chart.series limit: 5 -%}
749
- {% unless forloop.first %},{% endunless %}{ "name": {{ s.name | truncate: 20 | json }}, "data": [
750
- {%- for p in s.data -%}
751
- {%- assign _keep = forloop.index0 | modulo: _stride -%}
752
- {%- if _keep == 0 -%}{% unless forloop.first %},{% endunless %}{ "label": {{ p.label | json }}, "value": {{ p.value }} }{%- endif -%}
753
- {%- endfor -%}
754
- ] }
755
- {%- endfor -%}
756
- ], "axis_config": { "categories": [
757
- {%- for c in chart.categories -%}
758
- {%- assign _keep = forloop.index0 | modulo: _stride -%}
759
- {%- if _keep == 0 -%}{% unless forloop.first %},{% endunless %}{{ c | json }}{%- endif -%}
760
- {%- endfor -%}
761
- ], "x_label": "Time", "y_label": {{ chart.title | truncate: 50 | json }} } }
762
- {%- endif -%}
763
- {%- endcapture -%}
764
- {%- capture _view -%}
765
- <{{ viewUrl }}|Open in LangWatch ↗> · {{ occurredAt | date: "%b %d, %H:%M" }}
766
- {%- endcapture -%}
767
- [
768
- { "type": "card",
769
- "title": { "type": "mrkdwn", "text": {{ trigger.name | prepend: "📈 " | truncate: 150 | json }} },
770
- "subtitle": { "type": "mrkdwn", "text": {{ _sub | truncate: 150 | json }} },
771
- "body": { "type": "mrkdwn", "text": {{ _body | json }} }
772
- }
773
- {%- unless report.isEmpty -%}
774
- ,{ "type": "data_visualization", "block_id": "report_chart", "title": {{ chart.title | truncate: 50 | json }}, "chart": {{ _chart_json }} }
775
- {%- endunless -%}
776
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _view | json }} }] }
777
- ]
778
- `,Lr=`{%- capture _sub -%}
779
- {{ report.sourceLabel | mrkdwn_escape }} · {{ report.scheduleLabel }}
780
- {%- endcapture -%}
781
- {%- comment -%}
782
- Slack plots at most 20 points per series. A \`limit: 20\` would chart only the
783
- FIRST 20 buckets of the period, so each panel takes every Nth bucket instead —
784
- the chart still spans the whole period, at a coarser resolution.
785
- {%- endcomment -%}
786
- {%- capture _panels -%}
787
- {%- for chart in charts limit: 8 -%}
788
- {%- if chart.isEmpty -%}{%- continue -%}{%- endif -%}
789
- {%- assign _bucket_count = chart.categories | size -%}
790
- {%- assign _stride = _bucket_count | divided_by: 20.0 | ceil -%}
791
- {%- if _stride < 1 -%}{%- assign _stride = 1 -%}{%- endif -%}
792
- {%- capture _chart_json -%}
793
- {%- if chart.type == "pie" -%}
794
- { "type": "pie", "segments": [
795
- {%- for seg in chart.segments limit: 8 -%}
796
- {% unless forloop.first %},{% endunless %}{ "label": {{ seg.label | truncate: 40 | json }}, "value": {{ seg.value }} }
797
- {%- endfor -%}
798
- ] }
799
- {%- else -%}
800
- { "type": {{ chart.type | json }}, "series": [
801
- {%- for s in chart.series limit: 5 -%}
802
- {% unless forloop.first %},{% endunless %}{ "name": {{ s.name | truncate: 20 | json }}, "data": [
803
- {%- for p in s.data -%}
804
- {%- assign _keep = forloop.index0 | modulo: _stride -%}
805
- {%- if _keep == 0 -%}{% unless forloop.first %},{% endunless %}{ "label": {{ p.label | json }}, "value": {{ p.value }} }{%- endif -%}
806
- {%- endfor -%}
807
- ] }
808
- {%- endfor -%}
809
- ], "axis_config": { "categories": [
810
- {%- for c in chart.categories -%}
811
- {%- assign _keep = forloop.index0 | modulo: _stride -%}
812
- {%- if _keep == 0 -%}{% unless forloop.first %},{% endunless %}{{ c | json }}{%- endif -%}
813
- {%- endfor -%}
814
- ], "x_label": "Time", "y_label": {{ chart.title | truncate: 50 | json }} } }
815
- {%- endif -%}
816
- {%- endcapture -%}
817
- ,{ "type": "data_visualization", "block_id": {{ chart.id | prepend: "panel_" | json }}, "title": {{ chart.title | truncate: 50 | json }}, "chart": {{ _chart_json }} }
818
- {%- endfor -%}
819
- {%- endcapture -%}
820
- {%- capture _headlines -%}
821
- {% for chart in charts limit: 8 %}• *{{ chart.title | truncate: 50 | mrkdwn_escape }}* — {% if chart.isEmpty %}_no data_{% else %}{{ chart.total | round: 2 }}{% endif %}{% unless forloop.last %}
822
- {% endunless %}{% endfor %}
823
- {%- endcapture -%}
824
- {%- capture _view -%}
825
- <{{ viewUrl }}|Open dashboard ↗> · {{ occurredAt | date: "%b %d, %H:%M" }}
826
- {%- endcapture -%}
827
- [
828
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | prepend: "📊 " | truncate: 140 | json }}, "emoji": true } },
829
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _sub | json }} }] }
830
- {%- if report.isEmpty -%}
831
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": "_No data for this period._" } }
832
- {%- else -%}
833
- {{ _panels }}
834
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _headlines | json }} } }
835
- {%- endif -%}
836
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _view | json }} }] }
837
- ]
838
- `,Rr=`{%- capture _sub -%}
839
- {{ report.sourceLabel | mrkdwn_escape }} · {{ report.scheduleLabel }}
840
- {%- endcapture -%}
841
- {%- capture _rows_md -%}
842
- {% for t in traces limit: 20 %}• <{{ t.url }}|\`{{ t.traceId | truncate: 10 }}\`> {{ t.input | truncate: 90 | mrkdwn_escape }}
843
- _{{ t.model | default: "unknown model" }} · \${{ t.costUsd | round: 4 }} · {{ t.durationMs | round: 0 }} ms_{% unless forloop.last %}
844
- {% endunless %}{% endfor %}
845
- {%- endcapture -%}
846
- {%- capture _view -%}
847
- <{{ viewUrl }}|View in LangWatch ↗> · {{ occurredAt | date: "%b %d, %H:%M" }}
848
- {%- endcapture -%}
849
- [
850
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | prepend: "📊 " | truncate: 140 | json }}, "emoji": true } },
851
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _sub | json }} }] }
852
- {%- if report.isEmpty -%}
853
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": "_Nothing matched in this window._" } }
854
- {%- else -%}
855
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _rows_md | json }} } }
856
- {%- endif -%}
857
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _view | json }} }] }
858
- ]
859
- `,zr=`{%- capture _sub -%}
860
- {{ report.sourceLabel | mrkdwn_escape }} · {{ report.scheduleLabel }}
861
- {%- endcapture -%}
862
- {%- assign _count = traces | size -%}
863
- {%- assign _total_cost = 0 -%}
864
- {%- for t in traces -%}{%- assign _total_cost = _total_cost | plus: t.costUsd -%}{%- endfor -%}
865
- {%- capture _body -%}
866
- {%- if report.isEmpty -%}
867
- Nothing matched in this window.
868
- {%- else -%}
869
- *{{ _count }}* {% if _count == 1 %}trace{% else %}traces{% endif %} · \${{ _total_cost | round: 4 }} total
870
- {%- endif -%}
871
- {%- endcapture -%}
872
- {%- capture _rows_md -%}
873
- {% for t in traces limit: 10 %}• <{{ t.url }}|\`{{ t.traceId | truncate: 10 }}\`> {{ t.input | truncate: 80 | mrkdwn_escape }}{% unless forloop.last %}
874
- {% endunless %}{% endfor %}
875
- {%- endcapture -%}
876
- {%- capture _view -%}
877
- <{{ viewUrl }}|View in LangWatch ↗> · {{ occurredAt | date: "%b %d, %H:%M" }}
878
- {%- endcapture -%}
879
- [
880
- { "type": "card",
881
- "title": { "type": "mrkdwn", "text": {{ trigger.name | prepend: "📊 " | truncate: 150 | json }} },
882
- "subtitle": { "type": "mrkdwn", "text": {{ _sub | truncate: 150 | json }} },
883
- "body": { "type": "mrkdwn", "text": {{ _body | json }} }
884
- }
885
- {%- unless report.isEmpty -%}
886
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _rows_md | json }} } }
887
- {%- endunless -%}
888
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _view | json }} }] }
889
- ]
890
- `,Br=`{%- capture _sub -%}
891
- {{ report.sourceLabel | mrkdwn_escape }} · {{ report.scheduleLabel }}
892
- {%- endcapture -%}
893
- {%- capture _table_rows -%}
894
- {%- for t in traces limit: 30 -%}
895
- {%- capture _cost -%}\${{ t.costUsd | round: 4 }}{%- endcapture -%}
896
- {%- capture _dur -%}{{ t.durationMs | round: 0 }} ms{%- endcapture -%}
897
- {%- capture _what -%}{{ t.input | default: t.traceId }}{%- endcapture -%}
898
- ,[ { "type": "raw_text", "text": {{ _what | truncate: 80 | json }} }, { "type": "raw_text", "text": {{ t.model | default: "—" | truncate: 28 | json }} }, { "type": "raw_number", "value": {{ t.costUsd }}, "text": {{ _cost | json }} }, { "type": "raw_number", "value": {{ t.durationMs }}, "text": {{ _dur | json }} } ]
899
- {%- endfor -%}
900
- {%- endcapture -%}
901
- {%- capture _fallback -%}
902
- {% for t in traces limit: 10 %}• <{{ t.url }}|\`{{ t.traceId | truncate: 10 }}\`> {{ t.input | truncate: 70 | mrkdwn_escape }}{% unless forloop.last %}
903
- {% endunless %}{% endfor %}
904
- {%- endcapture -%}
905
- {%- capture _view -%}
906
- <{{ viewUrl }}|View in LangWatch ↗> · {{ occurredAt | date: "%b %d, %H:%M" }}
907
- {%- endcapture -%}
908
- [
909
- { "type": "header", "text": { "type": "plain_text", "text": {{ trigger.name | prepend: "📊 " | truncate: 140 | json }}, "emoji": true } },
910
- { "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _sub | json }} }] }
911
- {%- if report.isEmpty -%}
912
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": "_Nothing matched in this window._" } }
913
- {%- else -%}
914
- ,{ "type": "data_table", "caption": {{ report.sourceLabel | truncate: 120 | json }}, "rows": [
915
- [ { "type": "raw_text", "text": "Trace" }, { "type": "raw_text", "text": "Model" }, { "type": "raw_text", "text": "Cost" }, { "type": "raw_text", "text": "Duration" } ]
916
- {{ _table_rows }}
917
- ] }
918
- ,{ "type": "section", "text": { "type": "mrkdwn", "text": {{ _fallback | json }} } }
919
- {%- endif -%}
920
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _view | json }} }] }
921
- ]
922
- `,Vr=`{%- capture _header_text -%}
923
- {% if trigger.alertType == 'INFO' %}ℹ️ {% elsif trigger.alertType == 'CRITICAL' %}🔴 {% elsif trigger.alertType == 'WARNING' %}⚠️ {% else %}🔔 {% endif %}{{ trigger.name }}
924
- {%- endcapture -%}
925
- {%- capture _ctx_eval -%}
926
- {%- if match.evaluation %}*{{ match.evaluation.evaluatorName | default: "Evaluation" | mrkdwn_escape }}*{% if match.evaluation.score != null %} \`{{ match.evaluation.score }}\`{% endif %}{% if match.evaluation.label %} · {{ match.evaluation.label | mrkdwn_escape }}{% endif %}{%- endif -%}
927
- {%- if match.evaluation and trigger.alertType %} · {% endif -%}
928
- {%- if trigger.alertType %}_{{ trigger.alertType }}_{%- endif -%}
929
- {%- endcapture -%}
930
- {%- capture _footer -%}
931
- \`{{ match.trace.id | truncate: 12 }}\`{% if match.trace.metadata.model %} · {{ match.trace.metadata.model | mrkdwn_escape }}{% endif %}{% if match.trace.metadata.duration_ms %} · {{ match.trace.metadata.duration_ms }}ms{% endif %}{% if match.trace.metadata.cost %} · \${{ match.trace.metadata.cost }}{% endif %} · <{{ match.trace.url }}|View in LangWatch ↗>
932
- {%- endcapture -%}
933
- {%- assign _input = match.trace.input | truncate: 1500 -%}
934
- {%- assign _output = match.trace.output | truncate: 1500 -%}
935
- {%- capture _rt_body -%}
936
- {%- if _input != "" -%}
937
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Input", "style": { "bold": true } }] },
938
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _input | json }} }] }
939
- {%- endif -%}
940
- {%- if _input != "" and _output != "" -%},{%- endif -%}
941
- {%- if _output != "" -%}
942
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Output", "style": { "bold": true } }] },
943
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _output | json }} }] }
944
- {%- endif -%}
945
- {%- endcapture -%}
946
- [
947
- { "type": "header", "text": { "type": "plain_text", "text": {{ _header_text | truncate: 140 | json }}, "emoji": true } }
948
- {%- if _ctx_eval != "" -%}
949
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _ctx_eval | json }} }] }
950
- {%- endif -%}
951
- {%- if _rt_body != "" -%}
952
- ,{ "type": "rich_text", "elements": [ {{ _rt_body }} ] }
953
- {%- endif -%}
954
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _footer | json }} }] }
955
- ]
956
- `,Hr=`{%- capture _line -%}
957
- {% if trigger.alertType == 'INFO' %}ℹ️{% elsif trigger.alertType == 'CRITICAL' %}🔴{% elsif trigger.alertType == 'WARNING' %}⚠️{% else %}🔔{% endif %} *{{ trigger.name | mrkdwn_escape }}*{% if match.evaluation %} · {{ match.evaluation.evaluatorName | default: "eval" | mrkdwn_escape }} \`{{ match.evaluation.score | default: "—" }}\`{% endif %} · _{{ match.trace.input | truncate: 140 | mrkdwn_escape }}_ · <{{ match.trace.url }}|View ↗>
958
- {%- endcapture -%}
959
- [
960
- { "type": "section", "text": { "type": "mrkdwn", "text": {{ _line | json }} } }
961
- ]
962
- `,Ur=`{%- capture _title -%}
963
- {% if match.evaluation.passed == false %}🛑 {% else %}🔔 {% endif %}{{ trigger.name | mrkdwn_escape }}
964
- {%- endcapture -%}
965
- {%- capture _subtitle -%}
966
- {%- if match.evaluation %}*{{ match.evaluation.evaluatorName | default: "Evaluation" | mrkdwn_escape }}*{% if match.evaluation.score != null %} \`{{ match.evaluation.score }}\`{% endif %}{% if match.evaluation.passed == false %} · failed{% elsif match.evaluation.passed == true %} · passed{% endif %}{%- else -%}Matched trace{%- endif -%}
967
- {%- if trigger.alertType %} · {{ trigger.alertType }}{% endif -%}
968
- {%- endcapture -%}
969
- {%- assign _snippet_src = match.trace.input | default: match.trace.output -%}
970
- {%- capture _card_body -%}
971
- {{ _snippet_src | truncate: 190 | mrkdwn_escape }}
972
- {%- endcapture -%}
973
- {%- capture _footer -%}
974
- \`{{ match.trace.id | truncate: 12 }}\`{% if match.trace.metadata.model %} · {{ match.trace.metadata.model | mrkdwn_escape }}{% endif %}{% if match.trace.metadata.duration_ms %} · {{ match.trace.metadata.duration_ms }}ms{% endif %}{% if match.trace.metadata.cost %} · \${{ match.trace.metadata.cost }}{% endif %} · <{{ match.trace.url }}|View trace ↗>
975
- {%- endcapture -%}
976
- {%- assign _input = match.trace.input | truncate: 1500 -%}
977
- {%- assign _output = match.trace.output | truncate: 1500 -%}
978
- {%- capture _rt_body -%}
979
- {%- if _input != "" -%}
980
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Input", "style": { "bold": true } }] },
981
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _input | json }} }] }
982
- {%- endif -%}
983
- {%- if _input != "" and _output != "" -%},{%- endif -%}
984
- {%- if _output != "" -%}
985
- { "type": "rich_text_section", "elements": [{ "type": "text", "text": "Output", "style": { "bold": true } }] },
986
- { "type": "rich_text_quote", "elements": [{ "type": "text", "text": {{ _output | json }} }] }
987
- {%- endif -%}
988
- {%- endcapture -%}
989
- [
990
- { "type": "card",
991
- "title": { "type": "mrkdwn", "text": {{ _title | truncate: 150 | json }} },
992
- "subtitle": { "type": "mrkdwn", "text": {{ _subtitle | truncate: 150 | json }} }
993
- {%- if _card_body != "" -%}
994
- ,"body": { "type": "mrkdwn", "text": {{ _card_body | json }} }
995
- {%- endif -%}
996
- }
997
- {%- if _rt_body != "" -%}
998
- ,{ "type": "rich_text", "elements": [ {{ _rt_body }} ] }
999
- {%- endif -%}
1000
- ,{ "type": "context", "elements": [{ "type": "mrkdwn", "text": {{ _footer | json }} }] }
1001
- ]
1002
- `,Wr=[`1.5`,`1`,`2`,`1.5`,`2.5`,`2`,`3`],Gr=[`1`,`1.5`,`1.5`,`2`,`2.5`,`3`,`3.5`];function Kr({palette:e}){return(0,P.jsx)(i,{bg:`${e}.subtle`,borderLeftWidth:`3px`,borderLeftColor:`${e}.solid`,borderRadius:`xs`,px:`1.5`,py:`1`,children:(0,P.jsx)(i,{h:`2`,bg:`${e}.fg`,borderRadius:`xs`,w:`70%`,opacity:.7})})}function qr({kind:e}){switch(e){case`header`:return(0,P.jsx)(i,{h:`3`,bg:`fg`,borderRadius:`xs`,w:`80%`});case`context`:return(0,P.jsx)(i,{h:`1.5`,bg:`fg.muted`,borderRadius:`xs`,w:`60%`});case`section`:return(0,P.jsx)(i,{h:`2.5`,bg:`fg.muted`,borderRadius:`xs`,w:`90%`});case`bullet`:return(0,P.jsxs)(s,{gap:`1.5`,w:`full`,children:[(0,P.jsx)(i,{h:`1.5`,w:`1.5`,bg:`fg.muted`,borderRadius:`full`,flexShrink:0}),(0,P.jsx)(i,{h:`2`,bg:`fg.muted`,borderRadius:`xs`,flex:`1`})]});case`md`:return(0,P.jsx)(i,{h:`4`,bg:`blue.subtle`,borderLeftWidth:`2px`,borderLeftColor:`blue.fg`,borderRadius:`xs`,w:`full`});case`fields`:return(0,P.jsxs)(s,{gap:`2`,w:`full`,children:[(0,P.jsx)(i,{h:`2.5`,bg:`fg.muted`,borderRadius:`xs`,flex:`1`}),(0,P.jsx)(i,{h:`2.5`,bg:`fg.muted`,borderRadius:`xs`,flex:`1`})]});case`spark`:return(0,P.jsx)(s,{gap:`0.5`,alignItems:`flex-end`,h:`3`,children:Wr.map((e,t)=>(0,P.jsx)(i,{w:`1`,h:e,bg:`fg.muted`,borderRadius:`xs`},t))});case`quote`:return(0,P.jsx)(i,{borderLeftWidth:`2px`,borderLeftColor:`border.emphasized`,pl:`1.5`,w:`full`,children:(0,P.jsx)(i,{h:`3`,bg:`fg.muted`,borderRadius:`xs`,w:`85%`})});case`table`:return(0,P.jsx)(c,{gap:`0.5`,w:`full`,children:[0,1,2].map(e=>(0,P.jsx)(s,{gap:`0.5`,w:`full`,children:[0,1,2].map(t=>(0,P.jsx)(i,{h:`1.5`,flex:`1`,bg:e===0?`fg.muted`:`border`,borderRadius:`xs`},t))},e))});case`card`:return(0,P.jsxs)(i,{borderWidth:`1px`,borderColor:`border.emphasized`,borderRadius:`sm`,bg:`bg.subtle`,p:`1.5`,children:[(0,P.jsxs)(s,{gap:`1.5`,align:`start`,children:[(0,P.jsx)(i,{h:`5`,w:`5`,bg:`bg.emphasized`,borderRadius:`xs`,flexShrink:0}),(0,P.jsxs)(c,{gap:`1`,flex:`1`,children:[(0,P.jsx)(i,{h:`2.5`,bg:`fg`,borderRadius:`xs`,w:`70%`}),(0,P.jsx)(i,{h:`1.5`,bg:`fg.muted`,borderRadius:`xs`,w:`50%`})]})]}),(0,P.jsx)(i,{h:`1.5`,bg:`fg.muted`,borderRadius:`xs`,w:`90%`,mt:`1.5`})]});case`chart`:return(0,P.jsx)(i,{borderBottomWidth:`1px`,borderBottomColor:`border`,pb:`0.5`,children:(0,P.jsx)(s,{gap:`0.5`,alignItems:`flex-end`,h:`8`,w:`full`,children:Gr.map((e,t)=>(0,P.jsx)(i,{flex:`1`,h:e,bg:`blue.solid`,borderRadius:`xs`},t))})});case`pie`:return(0,P.jsx)(s,{justify:`center`,w:`full`,children:(0,P.jsx)(i,{h:`10`,w:`10`,borderRadius:`full`,borderWidth:`4px`,borderTopColor:`blue.solid`,borderRightColor:`green.solid`,borderBottomColor:`orange.solid`,borderLeftColor:`purple.solid`})});case`alertSuccess`:return(0,P.jsx)(Kr,{palette:`green`});case`alertWarning`:return(0,P.jsx)(Kr,{palette:`orange`});case`alertError`:return(0,P.jsx)(Kr,{palette:`red`});case`divider`:return(0,P.jsx)(i,{h:`px`,bg:`border`,w:`full`,my:`1`})}}function W({rows:e}){return(0,P.jsx)(c,{gap:`1.5`,align:`stretch`,children:e.map((e,t)=>(0,P.jsx)(qr,{kind:e},t))})}function Jr(){return(0,P.jsx)(W,{rows:[`header`,`context`,`quote`,`quote`,`context`]})}function Yr(){return(0,P.jsx)(W,{rows:[`section`]})}function Xr(){return(0,P.jsx)(W,{rows:[`header`,`context`,`divider`,`quote`,`quote`,`context`]})}function Zr(){return(0,P.jsx)(W,{rows:[`card`,`quote`,`quote`,`context`]})}function Qr(){return(0,P.jsx)(W,{rows:[`alertError`,`context`,`divider`,`quote`,`quote`,`context`]})}function $r(){return(0,P.jsx)(W,{rows:[`header`,`context`,`divider`,`bullet`,`bullet`,`bullet`,`bullet`,`context`]})}function ei(){return(0,P.jsx)(W,{rows:[`header`,`context`,`pie`,`bullet`,`bullet`,`context`]})}function ti(){return(0,P.jsx)(W,{rows:[`header`,`context`,`divider`,`bullet`,`quote`,`quote`,`divider`,`bullet`,`quote`,`quote`]})}function ni(){return(0,P.jsx)(W,{rows:[`header`,`context`,`table`,`context`]})}function ri(){return(0,P.jsx)(W,{rows:[`header`,`fields`,`fields`,`spark`,`context`]})}function ii(){return(0,P.jsx)(W,{rows:[`header`,`fields`,`chart`,`context`,`context`]})}function ai(){return(0,P.jsx)(W,{rows:[`section`]})}function oi(){return(0,P.jsx)(W,{rows:[`alertSuccess`,`section`,`fields`,`context`]})}function si(){return(0,P.jsx)(W,{rows:[`alertWarning`,`section`,`context`]})}function ci(){return(0,P.jsx)(W,{rows:[`header`,`fields`,`table`,`context`]})}function li(){return(0,P.jsx)(W,{rows:[`header`,`context`,`bullet`,`bullet`,`context`]})}function ui(){return(0,P.jsx)(W,{rows:[`card`,`section`,`bullet`,`context`]})}function di(){return(0,P.jsx)(W,{rows:[`header`,`context`,`table`,`context`]})}function fi(){return(0,P.jsx)(W,{rows:[`header`,`context`,`chart`,`section`,`context`]})}function pi(){return(0,P.jsx)(W,{rows:[`card`,`chart`,`context`]})}function mi(){return(0,P.jsx)(W,{rows:[`header`,`context`,`chart`,`chart`,`section`,`context`]})}var hi=[{id:`trace_alert_compact`,displayName:`Compact alert`,emoji:`🔔`,tagline:`Header and evaluation, then the trace's input and output as quoted text.`,deliveryNote:`1 message per trace`,cadenceFit:`immediate`,kind:`trace`,source:Vr,Wireframe:Jr},{id:`trace_alert_one_liner`,displayName:`One-liner`,emoji:`💬`,tagline:`A single line: automation name, score, input snippet, link. Minimal noise.`,deliveryNote:`1 message per trace`,cadenceFit:`immediate`,kind:`trace`,source:Hr,Wireframe:Yr},{id:`eval_failure_detailed`,displayName:`Eval failure detail`,emoji:`🛑`,tagline:`Names the failing evaluator, then quotes the trace's input and output.`,deliveryNote:`1 message per trace`,cadenceFit:`immediate`,kind:`trace`,recommendedForEvaluationFilter:!0,source:Dr,Wireframe:Xr},{id:`trace_card_rich`,displayName:`Rich trace card`,emoji:`🗂️`,tagline:`A summary card with the evaluation and input, then the full input and output.`,deliveryNote:`1 message per trace`,cadenceFit:`immediate`,kind:`trace`,source:Ur,Wireframe:Zr},{id:`eval_failure_rich`,displayName:`Eval failure banner`,emoji:`🛑`,tagline:`A colour-coded banner for the verdict, then quoted input and output.`,deliveryNote:`1 message per trace`,cadenceFit:`immediate`,kind:`trace`,recommendedForEvaluationFilter:!0,gatedBlock:`alert`,source:Or,Wireframe:Qr},{id:`digest_compact`,displayName:`Digest — compact`,emoji:`📊`,tagline:`One line per matched trace. Best for hourly windows or busy channels.`,deliveryNote:`all matches, 1 message`,cadenceFit:`digest`,kind:`trace`,source:Cr,Wireframe:$r},{id:`digest_evaluator_rollup`,displayName:`Digest — evaluator chart`,emoji:`🥧`,tagline:`A pie chart of matches by evaluator, with the counts listed. No trace content.`,deliveryNote:`all matches, 1 message`,cadenceFit:`digest`,kind:`trace`,gatedBlock:`data_visualization`,source:wr,Wireframe:ei},{id:`digest_inline_rich`,displayName:`Digest — inline rich`,emoji:`📇`,tagline:`Full input and output for every matched trace, grouped by evaluator. Suits 5-15 min windows.`,deliveryNote:`all matches, 1 message`,cadenceFit:`digest`,kind:`trace`,source:Tr,Wireframe:ti},{id:`digest_table`,displayName:`Digest — table`,emoji:`🧮`,tagline:`Every matched trace as a row in a grid: score, evaluator, input, link.`,deliveryNote:`all matches, 1 message`,cadenceFit:`digest`,kind:`trace`,gatedBlock:`data_table`,source:Er,Wireframe:ni},{id:`graph_alert_compact`,displayName:`Alert — compact`,emoji:`🚨`,tagline:`Metric, condition, and current value as fields, with a trend line.`,deliveryNote:`1 message per alert`,cadenceFit:`immediate`,kind:`graphAlert`,source:kr,Wireframe:ri},{id:`graph_alert_detailed`,displayName:`Alert — detailed`,emoji:`📈`,tagline:`A chart of the metric's recent values with the breach in context.`,deliveryNote:`1 message per alert`,cadenceFit:`immediate`,kind:`graphAlert`,gatedBlock:`data_visualization`,source:Ar,Wireframe:ii},{id:`graph_alert_one_liner`,displayName:`One-liner`,emoji:`⚡`,tagline:`A single line: severity, metric, threshold, current value, link.`,deliveryNote:`1 message per alert`,cadenceFit:`immediate`,kind:`graphAlert`,source:Nr,Wireframe:ai},{id:`graph_alert_resolved`,displayName:`Recovered / resolved`,emoji:`✅`,tagline:`A recovery banner when the metric is back within threshold, with a was to now value.`,deliveryNote:`1 message per alert`,cadenceFit:`immediate`,kind:`graphAlert`,gatedBlock:`alert`,source:Pr,Wireframe:oi},{id:`graph_alert_no_data`,displayName:`No-data heartbeat`,emoji:`🔇`,tagline:`A no-data banner for heartbeat monitors, framing a silent metric as missing data.`,deliveryNote:`1 message per alert`,cadenceFit:`immediate`,kind:`graphAlert`,gatedBlock:`alert`,source:Mr,Wireframe:si},{id:`graph_alert_history_table`,displayName:`History table`,emoji:`🗓️`,tagline:`The metric's recent values as a Time and Value grid instead of a sparkline.`,deliveryNote:`1 message per alert`,cadenceFit:`immediate`,kind:`graphAlert`,gatedBlock:`data_table`,source:jr,Wireframe:ci},{id:`report_table`,displayName:`Table of traces`,emoji:`🧮`,tagline:`Every matching trace as a row: input, model, cost, and duration.`,deliveryNote:`1 message per report`,cadenceFit:`both`,kind:`report`,reportSources:[`traceQuery`],gatedBlock:`data_table`,source:Br,Wireframe:di},{id:`report_digest`,displayName:`List of traces`,emoji:`📊`,tagline:`One line per matching trace, with its model, cost, and duration beneath.`,deliveryNote:`1 message per report`,cadenceFit:`both`,kind:`report`,reportSources:[`traceQuery`],source:Rr,Wireframe:li},{id:`report_summary_card`,displayName:`Summary card`,emoji:`🗂️`,tagline:`A card with the trace count and total cost, then the traces listed.`,deliveryNote:`1 message per report`,cadenceFit:`both`,kind:`report`,reportSources:[`traceQuery`],source:zr,Wireframe:ui},{id:`report_chart`,displayName:`Chart`,emoji:`📈`,tagline:`The graph plotted over the period, with its headline value.`,deliveryNote:`1 message per report`,cadenceFit:`both`,kind:`report`,reportSources:[`customGraph`],gatedBlock:`data_visualization`,source:Fr,Wireframe:fi},{id:`report_chart_card`,displayName:`Chart card`,emoji:`🗂️`,tagline:`A card leading with the headline value, then the chart.`,deliveryNote:`1 message per report`,cadenceFit:`both`,kind:`report`,reportSources:[`customGraph`],gatedBlock:`data_visualization`,source:Ir,Wireframe:pi},{id:`report_dashboard`,displayName:`Dashboard panels`,emoji:`🧭`,tagline:`Every panel on the dashboard, each as its own chart.`,deliveryNote:`1 message per report`,cadenceFit:`both`,kind:`report`,reportSources:[`dashboard`],autoFor:`dashboard`,gatedBlock:`data_visualization`,source:Lr,Wireframe:mi}];function gi({cadence:e,hasEvaluationFilter:t,kind:n,reportSource:r}){return n===`report`?r===`dashboard`?`report_dashboard`:r===`customGraph`?`report_chart`:`report_table`:n===`graphAlert`?`graph_alert_compact`:e===`digest`?`digest_inline_rich`:t?`eval_failure_detailed`:`trace_alert_compact`}function _i(e){return hi.some(t=>t.autoFor!==void 0&&t.autoFor===e)}function vi({cadence:e,kind:t,reportSource:n}){return hi.filter(r=>r.kind!==t||r.cadenceFit!==`both`&&r.cadenceFit!==e?!1:t===`report`?r.autoFor===void 0?n===void 0?!0:(r.reportSources??[]).includes(n):!1:!0)}function yi(e){return hi.find(t=>t.source===e)}var bi=`Needs a Slack app connection`;function xi({kind:e,cadence:t,reportSource:n}){return e===`report`?n===`customGraph`?`Your report sends a graph, so every layout plots it. The thumbnail shows structure, not the final look.`:`Your report sends the traces that match, so every layout lists them. The thumbnail shows structure, not the final look.`:e===`graphAlert`?`Each layout sends one message when the alert fires. The thumbnail shows structure, not the final look.`:t===`digest`?`Your cadence bundles every trace matched in the window into one digest message. Pick a starting layout — the thumbnail shows structure, not the final look.`:`Each matching trace sends its own message. Pick a starting layout — the thumbnail shows structure, not the final look.`}function Si({cadence:e,kind:t,reportSource:n,deliveryMethod:r,hasEvaluationFilter:i,currentSource:a,onSelect:o,onSelectOtherCadence:l}){let u=vi({cadence:e,kind:t,reportSource:n}),d=e===`digest`?`immediate`:`digest`,p=vi({cadence:d,kind:t,reportSource:n}).filter(e=>e.cadenceFit!==`both`),[m,v]=(0,N.useState)(!1),y=gi({cadence:e,hasEvaluationFilter:i,kind:t,reportSource:n});return(0,P.jsxs)(c,{gap:2,align:`stretch`,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:xi({kind:t,cadence:e,reportSource:n})}),(0,P.jsx)(_,{columns:{base:2,md:Math.min(u.length,3)},gap:3,alignItems:`stretch`,children:u.map(e=>(0,P.jsx)(Ci,{option:e,isSelected:e.source===a,isDefault:e.id===y,locked:r===`webhook`&&!!e.gatedBlock,lockedNote:bi,onClick:()=>o(e)},e.id))}),t!==`graphAlert`&&p.length>0?(0,P.jsxs)(x,{open:m,onOpenChange:e=>v(e.open),children:[(0,P.jsx)(h,{asChild:!0,children:(0,P.jsxs)(s,{cursor:`pointer`,gap:1,color:`fg.muted`,width:`fit-content`,children:[m?(0,P.jsx)(Oe,{size:14}):(0,P.jsx)(Ee,{size:14}),(0,P.jsx)(f,{textStyle:`xs`,children:d===`digest`?`${p.length} more layouts for digest cadences`:`${p.length} more layouts for the Immediate cadence`})]})}),(0,P.jsx)(g,{children:(0,P.jsxs)(c,{gap:2,align:`stretch`,pt:2,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:d===`digest`?`These layouts bundle every match in a window into one message. Picking one switches this automation's cadence to a 5-minute digest — you can adjust the window in the Cadence section.`:`These layouts send one message per matching trace. Picking one switches this automation's cadence to Immediate.`}),(0,P.jsx)(_,{columns:{base:2,md:Math.min(p.length,3)},gap:3,alignItems:`stretch`,children:p.map(e=>(0,P.jsx)(Ci,{option:e,isSelected:e.source===a,isDefault:!1,locked:r===`webhook`&&!!e.gatedBlock,lockedNote:bi,onClick:()=>l(e)},e.id))})]})})]}):null]})}function Ci({option:e,isSelected:t,isDefault:n,locked:r,lockedNote:a,onClick:o}){let{Wireframe:l}=e;return(0,P.jsx)(`button`,{type:`button`,onClick:o,disabled:r,"aria-pressed":t,"aria-label":`Use ${e.displayName} template`,style:{textAlign:`left`,width:`100%`,height:`100%`,cursor:r?`not-allowed`:void 0},children:(0,P.jsx)(i,{height:`full`,borderWidth:t?`2px`:`1px`,borderColor:t?`border.emphasized`:`border`,borderRadius:`md`,bg:`bg.panel/60`,padding:3,opacity:r?.6:1,transition:`border-color 120ms ease`,_hover:r?void 0:{borderColor:`border.emphasized`},children:(0,P.jsxs)(c,{gap:2,align:`stretch`,height:`full`,children:[(0,P.jsxs)(s,{gap:2,children:[(0,P.jsx)(f,{textStyle:`md`,children:e.emoji}),(0,P.jsx)(f,{textStyle:`sm`,fontWeight:`medium`,children:e.displayName}),n?(0,P.jsx)(w,{size:`sm`,colorPalette:`orange`,variant:`subtle`,children:`Default`}):null]}),(0,P.jsx)(i,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`sm`,padding:2,bg:`bg.subtle`,height:`120px`,overflow:`hidden`,flexShrink:0,children:(0,P.jsx)(l,{})}),r&&a?(0,P.jsx)(w,{size:`xs`,variant:`subtle`,colorPalette:`gray`,alignSelf:`start`,children:a}):(0,P.jsx)(w,{size:`xs`,variant:`surface`,alignSelf:`start`,children:e.deliveryNote}),(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,lineClamp:2,children:e.tagline})]})})})}var G={value:``,usingDefault:!0};function wi(){return{deliveryMethod:`bot`,webhook:``,botToken:``,channelId:``,botTokenAlreadySet:!1,isLegacyWebhook:!1,templateType:`block_kit`,template:G}}function Ti(e){return e.deliveryMethod===`bot`?e.channelId.trim().length>0&&(e.botToken.trim().length>0||e.botTokenAlreadySet):e.webhook.trim().length>0}function Ei(e,t){let n=t.name||`(unnamed)`;if(e.deliveryMethod===`bot`){let t=e.channelId.trim();return`${n} → Slack app${t?` ${t}`:` (channel not set)`}`}return`${n} → Slack webhook${e.webhook?` set`:` (not set)`}`}function Di(e){let t=e.actionParams??{},n=Vt(t);return{deliveryMethod:n,isLegacyWebhook:n===`webhook`,webhook:typeof t.slackWebhook==`string`?t.slackWebhook:``,botToken:``,channelId:typeof t.slackChannelId==`string`?t.slackChannelId:``,botTokenAlreadySet:t.slackBotTokenSet===!0,templateType:e.slackTemplateType===`block_kit`?`block_kit`:`string`,template:{value:e.slackTemplate??``,usingDefault:e.slackTemplate==null}}}function Oi(e){if(e.deliveryMethod===`bot`){let t=e.botToken.trim(),n=t.length>0?t:e.botTokenAlreadySet?zt:``;return{slackDelivery:`bot`,slackChannelId:e.channelId,slackBotToken:n}}return{slackDelivery:`webhook`,slackWebhook:e.webhook}}function ki(e){return e.deliveryMethod===`bot`?{webhook:null,botDestination:{channelId:e.channelId,botToken:e.botToken.trim()||null}}:{webhook:e.webhook||null,botDestination:null}}var Ai=[{value:`webhook`,label:`Incoming webhook`},{value:`bot`,label:`Slack app (bot)`}],ji=`display_information:
1003
- name: LangWatch
1004
- features:
1005
- bot_user:
1006
- display_name: LangWatch
1007
- always_online: false
1008
- oauth_config:
1009
- scopes:
1010
- bot:
1011
- - chat:write
1012
- - chat:write.public
1013
- - channels:read
1014
- - groups:read`;function Mi({onUpgrade:e}){return(0,P.jsx)(i,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,bg:`bg.subtle`,padding:3,children:(0,P.jsxs)(s,{justify:`space-between`,gap:3,align:`center`,children:[(0,P.jsxs)(p,{align:`start`,gap:0,children:[(0,P.jsx)(f,{textStyle:`xs`,fontWeight:`medium`,color:`fg`,children:`Get charts, tables, and alert banners`}),(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Move this automation to a Slack app to unlock the richer templates.`})]}),(0,P.jsx)(o,{size:`xs`,variant:`outline`,flexShrink:0,onClick:e,children:`Switch to a Slack app`})]})})}function Ni(e){return{value:e.id,label:`${e.isPrivate?`🔒 `:`#`}${e.name}`}}function Pi(e){return/[.!?]$/.test(e)?e:`${e}.`}function Fi({projectId:e,automationId:t,slice:n,onChange:i}){let a=ke.automation.listSlackChannels.useMutation(),c=n.botToken.trim(),u=a.data?.channels,d=u??[],p=n=>{h.current=n,a.mutate({projectId:e,botToken:c||null,automationId:t},{onError:e=>console.error(`[slack] listSlackChannels failed`,e)})},m=c?/^xoxb-/.test(c)?`typed:${c}`:null:n.botTokenAlreadySet||t?`stored`:null,h=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!m||h.current===m)return;let e=m.startsWith(`typed:`)?600:0,t=setTimeout(()=>p(m),e);return()=>clearTimeout(t)},[m]);let{contains:g}=nt({sensitivity:`base`}),{collection:_,filter:v,set:y}=rt({initialItems:[],filter:g}),[b,ee]=(0,N.useState)(``),x=(0,N.useMemo)(()=>new Set((u??[]).map(e=>e.id)),[u]);(0,N.useEffect)(()=>{let e=(u??[]).map(Ni);y(b&&!x.has(b)?[...e,{value:b,label:b}]:e)},[u,b]);let[S,C]=(0,N.useState)(``),w=(0,N.useRef)(!1),T=(0,N.useRef)(null),te=()=>{let e=T.current;T.current=null,e!==null&&e!==n.channelId&&(x.has(e)||ee(e),C(e),i({...n,channelId:e}))};(0,N.useEffect)(()=>{if(w.current)return;let e=(u??[]).find(e=>e.id===n.channelId);e&&C(e.id)},[u,n.channelId]);let ne=c.length>0||n.botTokenAlreadySet||!!t,re=a.data?.error&&a.data.error!==`no_token`?a.data.error:null,me=a.data?.gaps??[],ge=[me.includes(`private_channels_hidden`)?`Private channels aren't listed — your Slack app needs the groups:read permission. Reinstall it with the manifest above.`:null,me.includes(`page_cap`)?`This workspace has more channels than we can list here, so some are missing.`:null].filter(e=>e!==null),_e=ge.length?`${ge.join(` `)} Type the channel name or paste its ID above to use one that isn't shown.`:null,ve=a.isError?`${Pi(Te({error:a.error,fallbackTitle:`Couldn't load channels`}))} You can still type the channel above.`:re===`missing_scope`?`Add the channels:read permission to your Slack app and reinstall it to pick from a list — you can still type the channel above.`:re?`Couldn't load channels from Slack. Check the token, or type the channel above.`:_e;return(0,P.jsxs)(E,{children:[(0,P.jsxs)(s,{justify:`space-between`,align:`center`,width:`full`,children:[(0,P.jsx)(D,{children:`Channel`}),ne?(0,P.jsx)(o,{variant:`plain`,size:`xs`,height:`auto`,paddingX:0,color:`fg.muted`,_hover:{color:`fg`},disabled:a.isPending,onClick:()=>p(m??`manual:${Date.now()}`),children:a.isPending?`Loading…`:`Reload`}):null]}),(0,P.jsxs)(de,{collection:_,size:`sm`,width:`full`,allowCustomValue:!0,openOnClick:!0,value:S?[S]:[],defaultInputValue:n.channelId,onValueChange:e=>{T.current=null,C(e.value[0]??``),i({...n,channelId:e.value[0]??``})},onInputValueChange:e=>{(0,N.startTransition)(()=>v(e.inputValue)),e.reason===`input-change`&&(w.current=!0,T.current=e.inputValue)},onOpenChange:e=>{e.open&&v(``)},children:[(0,P.jsxs)(fe,{children:[(0,P.jsx)(ue,{placeholder:a.isPending?`Loading channels…`:`#alerts or C0123…`,onBlur:te,onKeyDown:e=>{e.key===`Enter`&&te()}}),(0,P.jsxs)(ie,{children:[a.isPending?(0,P.jsx)(r,{size:`xs`}):null,(0,P.jsx)(ce,{})]})]}),(0,P.jsx)(l,{children:(0,P.jsx)(oe,{zIndex:`max`,children:(0,P.jsxs)(le,{children:[(0,P.jsx)(se,{children:a.isPending?`Loading channels…`:d.length===0?`Type a channel name or ID`:`No match — press Enter to use what you typed`}),_.items.map(e=>(0,P.jsxs)(pe,{item:e,children:[(0,P.jsx)(ae,{children:e.label}),(0,P.jsx)(he,{})]},e.value))]})})})]}),ve?(0,P.jsx)(f,{textStyle:`xs`,color:a.isError?`fg.error`:`fg.muted`,pt:1,children:ve}):null]})}function Ii(e){return{emailSubjectTemplate:null,emailBodyTemplate:null,slackTemplate:e.template.value.trim().length>0?e.template.value:null,slackTemplateType:e.templateType}}function Li(e){return{allowGatedBlocks:e.deliveryMethod===`bot`}}function Ri({slice:e,onChange:t,ctx:n}){let r=e.templateType===`block_kit`,a=n.sourceKind===`report`,s=a&&_i(n.reportSourceKind),c=Et(n.sourceKind),l=r?c.slackBlockKit:c.slackString,u=e.template.value||l,d=n.preview,m=(0,N.useMemo)(()=>kt(n.variables,n.cadenceMode),[n.variables,n.cadenceMode]),[h,g]=(0,N.useState)(r&&!e.template.usingDefault&&!yi(e.template.value)?`code`:`template`);return(0,N.useEffect)(()=>{let r=yi(e.template.value);if(!r)return;let i=r.cadenceFit!==`both`&&r.cadenceFit!==n.cadenceMode,a=r.kind!==n.sourceKind,o=r.kind===`report`&&n.reportSourceKind!==void 0&&!(r.reportSources??[]).includes(n.reportSourceKind);!i&&!a&&!o||t({...e,template:G})},[n.cadenceMode,n.sourceKind,n.reportSourceKind]),(0,N.useEffect)(()=>{if(!a||!r||!e.template.usingDefault)return;let i=gi({cadence:n.cadenceMode,hasEvaluationFilter:n.hasEvaluationFilter,kind:`report`,reportSource:n.reportSourceKind}),o=hi.find(e=>e.id===i);!o||e.template.value===o.source||t({...e,template:{value:o.source,usingDefault:!0}})},[a,r,e.template.usingDefault,n.reportSourceKind,n.cadenceMode]),(0,P.jsxs)(p,{align:`stretch`,gap:4,children:[e.isLegacyWebhook?(0,P.jsxs)(E,{children:[(0,P.jsx)(D,{children:`Connection`}),(0,P.jsx)(Ze,{size:`sm`,value:e.deliveryMethod,onValueChange:({value:n})=>{n&&t({...e,deliveryMethod:n})},items:Ai}),(0,P.jsx)(ye,{children:e.deliveryMethod===`webhook`?`This automation uses a webhook. Move it to a Slack app for charts, tables, and alert banners.`:`Renders charts, tables, and alert banners.`})]}):null,e.deliveryMethod===`bot`?(0,P.jsx)(zi,{slice:e,onChange:t,projectId:n.projectId,automationId:n.automationId}):(0,P.jsxs)(p,{align:`stretch`,gap:3,children:[(0,P.jsx)(Mi,{onUpgrade:()=>t({...e,deliveryMethod:`bot`})}),(0,P.jsxs)(E,{children:[(0,P.jsx)(D,{children:`Slack webhook URL`}),(0,P.jsx)(j,{value:e.webhook,onChange:n=>t({...e,webhook:n.target.value}),placeholder:`https://hooks.slack.com/services/...`}),(0,P.jsx)(Bi,{projectId:n.projectId,currentWebhook:e.webhook,onPick:n=>t({...e,webhook:n})})]})]}),(0,P.jsx)(fr,{onTestFire:n.onTestFire,loading:n.testFireLoading,disabled:!Ti(e),hint:Ti(e)?void 0:e.deliveryMethod===`bot`?`Add a token and channel first`:`Add a webhook URL first`}),(0,P.jsx)(ir,{label:`Message`,usingDefault:e.template.usingDefault,onReset:()=>t({...e,template:G}),trailing:(0,P.jsx)(R,{variables:m})}),r?(0,P.jsxs)(p,{align:`stretch`,gap:3,children:[(0,P.jsx)(Ze,{size:`sm`,alignSelf:`start`,value:h,onValueChange:({value:e})=>{e&&g(e)},items:[{value:`template`,label:`Template`},{value:`code`,label:`Code`}]}),h===`template`?s?(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Every panel on the dashboard is sent as its own chart. There's nothing to lay out; switch to Code to edit the message yourself.`}):(0,P.jsx)(Si,{cadence:n.cadenceMode,kind:n.sourceKind,reportSource:n.reportSourceKind,deliveryMethod:e.deliveryMethod,hasEvaluationFilter:n.hasEvaluationFilter,currentSource:u,onSelect:n=>t({...e,template:{value:n.source,usingDefault:!1}}),onSelectOtherCadence:r=>{n.setNotificationCadence(r.cadenceFit===`digest`?`5min_digest`:`immediate`),t({...e,template:{value:r.source,usingDefault:!1}})}}):(0,P.jsxs)(p,{align:`stretch`,gap:2,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Write the layout yourself in Block Kit. Values in braces fill in from your trace or alert when the message sends.`}),(0,P.jsx)(i,{"data-testid":`slack-code-editor`,children:(0,P.jsx)(U,{variables:m,height:`320px`,language:V,value:u,onChange:n=>t({...e,template:{value:n,usingDefault:!1}}),jsonSchema:Dn,jsonSchemaShadowUri:`file:///automation/slack-block-kit-shadow.json`})})]}),d?(0,P.jsx)(lr,{payload:d.payload}):null,(0,P.jsx)(o,{variant:`plain`,size:`xs`,width:`fit-content`,paddingX:0,color:`fg.muted`,_hover:{color:`fg`},onClick:()=>t({...e,templateType:`string`,template:G}),children:`Write the message as plain text instead`})]}):(0,P.jsxs)(p,{align:`stretch`,gap:3,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Write the message Slack will post. Markdown and variables are supported.`}),(0,P.jsx)(i,{"data-testid":`slack-text-editor`,children:(0,P.jsx)(U,{variables:m,height:`200px`,value:u,onChange:n=>t({...e,template:{value:n,usingDefault:!1}})})}),d?(0,P.jsx)(lr,{payload:d.payload}):null,(0,P.jsx)(o,{variant:`plain`,size:`xs`,width:`fit-content`,paddingX:0,color:`fg.muted`,_hover:{color:`fg`},onClick:()=>t({...e,templateType:`block_kit`,template:G}),children:`Use a guided template instead`})]})]})}function zi({slice:e,onChange:t,projectId:n,automationId:r}){let a=(0,N.useRef)(null),[c,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(!1),m=e.botTokenAlreadySet&&e.botToken.length===0;return(0,P.jsxs)(p,{align:`stretch`,gap:3,children:[(0,P.jsx)(i,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,bg:`bg.subtle`,padding:3,children:(0,P.jsxs)(p,{align:`stretch`,gap:2,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg`,children:`Post to your Slack workspace with a bot token. Create a Slack app, then paste its token below.`}),(0,P.jsxs)(s,{gap:3,children:[(0,P.jsxs)(We,{href:`https://api.slack.com/apps`,isExternal:!0,textStyle:`xs`,fontWeight:`medium`,display:`inline-flex`,alignItems:`center`,gap:1,children:[`Create a Slack app `,(0,P.jsx)(te,{size:12})]}),(0,P.jsx)(o,{variant:`plain`,size:`xs`,height:`auto`,paddingX:0,color:`fg.muted`,_hover:{color:`fg`},onClick:()=>{navigator.clipboard?.writeText(ji),d(!0),setTimeout(()=>d(!1),1500)},children:u?`Manifest copied`:`Copy app manifest`})]}),(0,P.jsx)(ar,{triggerLabel:`Setup steps`,open:c,onToggle:()=>l(e=>!e),children:(0,P.jsxs)(Ce,{as:`ol`,gap:1,paddingLeft:4,children:[(0,P.jsx)(we,{children:(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Create the app with “From a manifest” and paste the copied manifest — it sets the permissions for you.`})}),(0,P.jsx)(we,{children:(0,P.jsxs)(f,{textStyle:`xs`,color:`fg.muted`,children:[`Install it to your workspace and copy the Bot User OAuth Token (`,(0,P.jsx)(ee,{size:`sm`,children:`xoxb-`}),`).`]})}),(0,P.jsx)(we,{children:(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Public channels work straight away. To post to a private channel, add the app to that channel first.`})})]})})]})}),(0,P.jsxs)(E,{children:[(0,P.jsx)(D,{children:`Bot User OAuth Token`}),(0,P.jsx)(j,{ref:a,type:`password`,autoComplete:`off`,value:e.botToken,onChange:n=>t({...e,botToken:n.target.value}),placeholder:e.botTokenAlreadySet?`•••••••• (unchanged, leave blank to keep)`:`xoxb-…`}),m?(0,P.jsxs)(s,{gap:1,pt:1,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`A token is already saved.`}),(0,P.jsx)(o,{variant:`plain`,size:`xs`,height:`auto`,paddingX:0,color:`fg.muted`,_hover:{color:`fg`},onClick:()=>a.current?.focus(),children:`Replace token`})]}):null]}),(0,P.jsx)(Fi,{projectId:n,automationId:r,slice:e,onChange:t})]})}function Bi({projectId:e,currentWebhook:t,onPick:n}){let r=ke.automation.getTriggers.useQuery({projectId:e},{enabled:!!e,refetchOnWindowFocus:!1}),i=(0,N.useMemo)(()=>{let e=new Set,n=[];for(let i of r.data??[]){if(i.action!==`SEND_SLACK_MESSAGE`)continue;let r=(i.actionParams??{}).slackWebhook;r&&r!==t&&(e.has(r)||(e.add(r),n.push({value:r,label:i.name})))}return n},[r.data,t]),a=(0,N.useMemo)(()=>S({items:i}),[i]);return r.isLoading||i.length===0?null:(0,P.jsxs)(C.Root,{collection:a,value:[],onValueChange:({value:e})=>{let t=e[0];t&&n(t)},mt:2,children:[(0,P.jsx)(C.Trigger,{children:(0,P.jsx)(C.ValueText,{placeholder:`Reuse webhook from another automation…`})}),(0,P.jsx)(C.Content,{children:i.map(e=>(0,P.jsx)(C.Item,{item:e,children:(0,P.jsx)(f,{children:e.label})},e.value))})]})}var Vi={Icon:xn,channel:`slack`,initialSlice:wi,isComplete:Ti,summary:Ei,fromTriggerRow:Di,toActionParams:Oi,testFireTarget:ki,templatesFromSlice:Ii,previewOptions:Li,ConfigForm:Ri};function K(e){return e.shared.category===`notify`}var Hi=0;function Ui(e){return Hi+=1,{id:`hdr_${Hi}`,name:``,value:``,kept:!1,...e}}var Wi={value:``,usingDefault:!0};function Gi(){return{url:``,method:`POST`,headers:[],template:Wi}}function Ki(e){return Zt(e.url.trim())===null}function qi(e,t){let n=t.name||`(unnamed)`,r=(()=>{try{return new URL(e.url).hostname}catch{return null}})();return`${n} → ${e.method} ${r??`(URL not set)`}`}function Ji(e){let t=e.actionParams??{},n=Object.entries(t.headers??{}).map(([e,t])=>Ui(t===`__kept__`?{name:e,kept:!0}:{name:e,value:t}));return{url:typeof t.url==`string`?t.url:``,method:Ut.includes(t.method)?t.method:`POST`,headers:n,template:{value:t.bodyTemplate??``,usingDefault:t.bodyTemplate==null}}}function Yi(e){let t={};for(let n of e){let e=n.name.trim();e&&(t[e]=n.kept?Wt:n.value)}return t}function Xi(e){return e.template.value.trim().length>0?e.template.value:null}function Zi(e){return{url:e.url.trim(),method:e.method,headers:Yi(e.headers),bodyTemplate:Xi(e)}}function Qi(e){return{webhook:null,webhookDestination:{url:e.url.trim(),method:e.method,headers:Yi(e.headers),bodyTemplate:Xi(e)}}}function $i(e){return{emailSubjectTemplate:null,emailBodyTemplate:null,slackTemplate:null,slackTemplateType:null}}function ea({attempt:e}){let t=e?.channel===`webhook`?e:null;return t?t.status===`success`?(0,P.jsxs)(f,{textStyle:`xs`,color:`fg.success`,"data-testid":`webhook-test-result`,children:[`Delivered`,t.httpStatus?` — HTTP ${t.httpStatus}`:``,`.`]}):(0,P.jsxs)(p,{align:`start`,gap:0,"data-testid":`webhook-test-result`,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.error`,fontWeight:`medium`,children:t.errorTitle??`Test request failed`}),t.errorDetail?(0,P.jsx)(f,{textStyle:`xs`,color:`fg.error`,children:t.errorDetail}):null]}):null}function ta({slice:e,onChange:t}){let n=(n,r)=>{let i=e.headers.map((e,t)=>t===n?r:e);t({...e,headers:i})},r=n=>t({...e,headers:e.headers.filter((e,t)=>t!==n)});return(0,P.jsxs)(E,{children:[(0,P.jsx)(D,{children:`Headers`}),(0,P.jsxs)(p,{align:`stretch`,gap:2,width:`full`,children:[e.headers.map((e,t)=>{let i=e.name.trim()!==``&&Jt(e.name);return(0,P.jsxs)(p,{align:`stretch`,gap:1,children:[(0,P.jsxs)(s,{gap:2,children:[(0,P.jsx)(j,{size:`sm`,flex:`1`,value:e.name,placeholder:`Authorization`,onChange:r=>n(t,{...e,name:r.target.value,kept:!1})}),(0,P.jsx)(j,{size:`sm`,flex:`2`,value:e.value,placeholder:e.kept?`•••••• (saved)`:`Bearer …`,onChange:r=>n(t,{...e,value:r.target.value,kept:!1})}),(0,P.jsx)(xe,{size:`sm`,variant:`ghost`,"aria-label":`Remove header`,onClick:()=>r(t),children:(0,P.jsx)(ge,{size:14})})]}),i?(0,P.jsx)(f,{textStyle:`xs`,color:`fg.error`,children:`This header is set by LangWatch and will be ignored.`}):null]},e.id)}),(0,P.jsxs)(o,{size:`xs`,variant:`outline`,width:`fit-content`,onClick:()=>t({...e,headers:[...e.headers,Ui()]}),children:[(0,P.jsx)(Le,{size:13}),` Add header`]})]}),(0,P.jsx)(ye,{children:`Sent with every request — for example an Authorization header your endpoint expects. Values are stored encrypted and never shown again.`})]})}var na=Ut.map(e=>({value:e,label:e}));function ra({slice:e,onChange:t,ctx:n}){let r=e.url.trim()===``?null:Zt(e.url.trim()),a=Et(n.sourceKind),o=e.template.value||a.webhookBody,s=(0,N.useMemo)(()=>kt(n.variables,n.cadenceMode),[n.variables,n.cadenceMode]),c=n.preview;return(0,P.jsxs)(p,{align:`stretch`,gap:4,children:[(0,P.jsxs)(E,{invalid:!!r,children:[(0,P.jsx)(D,{children:`Endpoint URL`}),(0,P.jsx)(j,{value:e.url,onChange:n=>t({...e,url:n.target.value}),placeholder:`https://example.com/hooks/langwatch`}),r?(0,P.jsx)(be,{children:r}):(0,P.jsx)(ye,{children:`An https endpoint you control. The request body is JSON.`})]}),(0,P.jsxs)(E,{children:[(0,P.jsx)(D,{children:`Method`}),(0,P.jsx)(Ze,{size:`sm`,value:e.method,onValueChange:({value:n})=>{n&&t({...e,method:n})},items:na})]}),(0,P.jsx)(ta,{slice:e,onChange:t}),(0,P.jsxs)(p,{align:`start`,gap:2,children:[(0,P.jsx)(fr,{onTestFire:n.onTestFire,loading:n.testFireLoading,disabled:!Ki(e),hint:Ki(e)?void 0:`Add a valid https URL first`}),(0,P.jsx)(ea,{attempt:n.lastTestAttempt})]}),(0,P.jsx)(ir,{label:`JSON body`,usingDefault:e.template.usingDefault,onReset:()=>t({...e,template:Wi}),trailing:(0,P.jsx)(R,{variables:s})}),(0,P.jsxs)(p,{align:`stretch`,gap:2,children:[(0,P.jsx)(f,{textStyle:`xs`,color:`fg.muted`,children:`Write the JSON your endpoint receives. Values in braces fill in from your trace or alert when the request sends.`}),(0,P.jsx)(i,{"data-testid":`webhook-body-editor`,children:(0,P.jsx)(U,{variables:s,height:`280px`,language:V,value:o,onChange:n=>t({...e,template:{value:n,usingDefault:!1}})})}),c?(0,P.jsxs)(i,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,bg:`bg.subtle`,padding:3,"data-testid":`webhook-preview`,children:[(0,P.jsxs)(f,{textStyle:`xs`,fontWeight:`medium`,color:`fg.muted`,mb:1,children:[c.payload.method,` `,c.payload.url||`(no URL yet)`]}),(0,P.jsx)(f,{as:`pre`,textStyle:`xs`,fontFamily:`mono`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:ia(c.payload.body)}),c.errors.length>0?(0,P.jsxs)(f,{textStyle:`xs`,color:`fg.error`,mt:1,children:[c.errors[0],` — the default body will be sent instead.`]}):null]}):null]})]})}function ia(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}var aa={Icon:je,channel:`webhook`,initialSlice:Gi,isComplete:Ki,summary:qi,fromTriggerRow:Ji,toActionParams:Zi,testFireTarget:Qi,templatesFromSlice:$i,ConfigForm:ra},q={[F.TriggerAction.SEND_EMAIL]:{shared:Lt,client:Sr},[F.TriggerAction.SEND_SLACK_MESSAGE]:{shared:Ht,client:Vi},[F.TriggerAction.SEND_WEBHOOK]:{shared:$t,client:aa},[F.TriggerAction.ADD_TO_DATASET]:{shared:Pt,client:bn},[F.TriggerAction.ADD_TO_ANNOTATION_QUEUE]:{shared:jt,client:sn}};Object.values(q).filter(e=>K(e)),Object.values(q).filter(e=>e.shared.category===`action`);function oa(){return{[F.TriggerAction.SEND_EMAIL]:Sr.initialSlice(),[F.TriggerAction.SEND_SLACK_MESSAGE]:Vi.initialSlice(),[F.TriggerAction.SEND_WEBHOOK]:aa.initialSlice(),[F.TriggerAction.ADD_TO_DATASET]:bn.initialSlice(),[F.TriggerAction.ADD_TO_ANNOTATION_QUEUE]:sn.initialSlice()}}var sa=[`gt`,`lt`,`gte`,`lte`,`eq`],ca=[1,5,15,30,60,1440],la=Ke(sa),ua=Ne([M(1),M(5),M(15),M(30),M(60),M(1440)]),da=A({threshold:Re().finite(),operator:la,timePeriod:ua,seriesName:k().min(1,`Pick a series to monitor.`)});function fa(e){if(typeof e!=`object`||!e)return null;let t=da.safeParse(e);return t.success?{...e,...t.data}:null}function J(e){return Date.UTC(e.y,e.m-1,e.d,e.h,e.i,e.s)}function pa(e,t){return e.y===t.y&&e.m===t.m&&e.d===t.d&&e.h===t.h&&e.i===t.i&&e.s===t.s}function ma(e,t){let n=new Date(Date.parse(e));if(isNaN(n))throw Error(`Invalid ISO8601 passed to timezone parser.`);let r=e.substring(9);return r.includes(`Z`)||r.includes(`+`)||r.includes(`-`)?_a(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),`Etc/UTC`):_a(n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),t)}function ha(e,t,n){return ga(ma(e,t),n)}function ga(e,t){let n=new Date(J(e)),r=Y(n,e.tz),i=J(e)-J(r),a=new Date(n.getTime()+i),o=Y(a,e.tz);if(pa(o,e)){let t=new Date(a.getTime()-36e5);return pa(Y(t,e.tz),e)?t:a}let s=new Date(a.getTime()+J(e)-J(o));if(pa(Y(s,e.tz),e))return s;if(t)throw Error(`Invalid date passed to fromTZ()`);return a.getTime()>s.getTime()?a:s}function Y(e,t){let n,r;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,hour12:!1}),r=n.formatToParts(e)}catch(e){let n=e instanceof Error?e.message:String(e);throw RangeError(`toTZ: Invalid timezone '${t}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${n}`)}let i={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let e of r)(e.type===`year`||e.type===`month`||e.type===`day`||e.type===`hour`||e.type===`minute`||e.type===`second`)&&(i[e.type]=parseInt(e.value,10));if(isNaN(i.year)||isNaN(i.month)||isNaN(i.day)||isNaN(i.hour)||isNaN(i.minute)||isNaN(i.second))throw Error(`toTZ: Failed to parse all date components from timezone '${t}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(i)}`);return i.hour===24&&(i.hour=0),{y:i.year,m:i.month,d:i.day,h:i.hour,i:i.minute,s:i.second,tz:t}}function _a(e,t,n,r,i,a,o){return{y:e,m:t,d:n,h:r,i,s:a,tz:o}}var va=[1,2,4,8,16],ya=class{pattern;timezone;mode;alternativeWeekdays;sloppyRanges;second;minute;hour;day;month;dayOfWeek;year;lastDayOfMonth;lastWeekday;nearestWeekdays;starDOM;starDOW;starYear;useAndLogic;constructor(e,t,n){this.pattern=e,this.timezone=t,this.mode=n?.mode??`auto`,this.alternativeWeekdays=n?.alternativeWeekdays??!1,this.sloppyRanges=n?.sloppyRanges??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern==`string`||this.pattern instanceof String))throw TypeError(`CronPattern: Pattern has to be of type string.`);this.pattern.indexOf(`@`)>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let e=this.pattern.match(/\S+/g)||[``],t=e.length;if(e.length<5||e.length>7)throw TypeError(`CronPattern: invalid configuration format ('`+this.pattern+`'), exactly five, six, or seven space separated parts are required.`);if(this.mode!==`auto`){let e;switch(this.mode){case`5-part`:e=5;break;case`6-part`:e=6;break;case`7-part`:e=7;break;case`5-or-6-parts`:e=[5,6];break;case`6-or-7-parts`:e=[6,7];break;default:e=0}if(!(Array.isArray(e)?e.includes(t):t===e)){let n=Array.isArray(e)?e.join(` or `):e.toString();throw TypeError(`CronPattern: mode '${this.mode}' requires exactly ${n} parts, but pattern '${this.pattern}' has ${t} parts.`)}}if(e.length===5&&e.unshift(`0`),e.length===6&&e.push(`*`),e[3].toUpperCase()===`LW`?(this.lastWeekday=!0,e[3]=``):e[3].toUpperCase().indexOf(`L`)>=0&&(e[3]=e[3].replace(/L/gi,``),this.lastDayOfMonth=!0),e[3]==`*`&&(this.starDOM=!0),e[6]==`*`&&(this.starYear=!0),e[4].length>=3&&(e[4]=this.replaceAlphaMonths(e[4])),e[5].length>=3&&(e[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(e[5]):this.replaceAlphaDays(e[5])),e[5].startsWith(`+`)&&(this.useAndLogic=!0,e[5]=e[5].substring(1),e[5]===``))throw TypeError(`CronPattern: Day-of-week field cannot be empty after '+' modifier.`);switch(e[5]==`*`&&(this.starDOW=!0),this.pattern.indexOf(`?`)>=0&&(e[0]=e[0].replace(/\?/g,`*`),e[1]=e[1].replace(/\?/g,`*`),e[2]=e[2].replace(/\?/g,`*`),e[3]=e[3].replace(/\?/g,`*`),e[4]=e[4].replace(/\?/g,`*`),e[5]=e[5].replace(/\?/g,`*`),e[6]&&=e[6].replace(/\?/g,`*`)),this.mode){case`5-part`:e[0]=`0`,e[6]=`*`;break;case`6-part`:e[6]=`*`;break;case`5-or-6-parts`:e[6]=`*`;break;case`6-or-7-parts`:break;case`7-part`:case`auto`:break}this.throwAtIllegalCharacters(e),this.partToArray(`second`,e[0],0,1),this.partToArray(`minute`,e[1],0,1),this.partToArray(`hour`,e[2],0,1),this.partToArray(`day`,e[3],-1,1),this.partToArray(`month`,e[4],-1,1);let n=this.alternativeWeekdays?-1:0;this.partToArray(`dayOfWeek`,e[5],n,63),this.partToArray(`year`,e[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(e,t,n,r){let i=this[e],a=e===`day`&&this.lastDayOfMonth,o=e===`day`&&this.lastWeekday;if(t===``&&!a&&!o)throw TypeError(`CronPattern: configuration entry `+e+` (`+t+`) is empty, check for trailing spaces.`);if(t===`*`)return i.fill(r);let s=t.split(`,`);if(s.length>1)for(let t=0;t<s.length;t++)this.partToArray(e,s[t],n,r);else t.indexOf(`-`)!==-1&&t.indexOf(`/`)!==-1?this.handleRangeWithStepping(t,e,n,r):t.indexOf(`-`)===-1?t.indexOf(`/`)===-1?t!==``&&this.handleNumber(t,e,n,r):this.handleStepping(t,e,n,r):this.handleRange(t,e,n,r)}throwAtIllegalCharacters(e){for(let t=0;t<e.length;t++)if((t===3?/[^/*0-9,\-WwLl]+/:t===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(e[t]))throw TypeError(`CronPattern: configuration entry `+t+` (`+e[t]+`) contains illegal characters.`)}handleNumber(e,t,n,r){let i=this.extractNth(e,t),a=e.toUpperCase().includes(`W`);if(t!==`day`&&a)throw TypeError(`CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.`);a&&(t=`nearestWeekdays`);let o=parseInt(i[0],10)+n;if(isNaN(o))throw TypeError(`CronPattern: `+t+` is not a number: '`+e+`'`);this.setPart(t,o,i[1]||r)}setPart(e,t,n){if(!Object.prototype.hasOwnProperty.call(this,e))throw TypeError(`CronPattern: Invalid part specified: `+e);if(e===`dayOfWeek`){if(t===7&&(t=0),t<0||t>6)throw RangeError(`CronPattern: Invalid value for dayOfWeek: `+t);this.setNthWeekdayOfMonth(t,n);return}if(e===`second`||e===`minute`){if(t<0||t>=60)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`hour`){if(t<0||t>=24)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`day`||e===`nearestWeekdays`){if(t<0||t>=31)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`month`){if(t<0||t>=12)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`year`&&(t<1||t>=1e4))throw RangeError(`CronPattern: Invalid value for `+e+`: `+t+` (supported range: 1-9999)`);this[e][t]=n}validateNotNaN(e,t){if(isNaN(e))throw TypeError(t)}validateRange(e,t,n,r,i){if(e>t)throw TypeError(`CronPattern: From value is larger than to value: '`+i+`'`);if(n!==void 0){if(n===0)throw TypeError(`CronPattern: Syntax error, illegal stepping: 0`);if(n>this[r].length)throw TypeError(`CronPattern: Syntax error, steps cannot be greater than maximum value of part (`+this[r].length+`)`)}}handleRangeWithStepping(e,t,n,r){if(e.toUpperCase().includes(`W`))throw TypeError(`CronPattern: Syntax error, W is not allowed in ranges with stepping.`);let i=this.extractNth(e,t),a=i[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(a===null)throw TypeError(`CronPattern: Syntax error, illegal range with stepping: '`+e+`'`);let[,o,s,c]=a,l=parseInt(o,10)+n,u=parseInt(s,10)+n,d=parseInt(c,10);this.validateNotNaN(l,`CronPattern: Syntax error, illegal lower range (NaN)`),this.validateNotNaN(u,`CronPattern: Syntax error, illegal upper range (NaN)`),this.validateNotNaN(d,`CronPattern: Syntax error, illegal stepping: (NaN)`),this.validateRange(l,u,d,t,e);for(let e=l;e<=u;e+=d)this.setPart(t,e,i[1]||r)}extractNth(e,t){let n=e,r;if(n.includes(`#`)){if(t!==`dayOfWeek`)throw Error(`CronPattern: nth (#) only allowed in day-of-week field`);r=n.split(`#`)[1],n=n.split(`#`)[0]}else if(n.toUpperCase().endsWith(`L`)){if(t!==`dayOfWeek`)throw Error(`CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)`);r=`L`,n=n.slice(0,-1)}return[n,r]}handleRange(e,t,n,r){if(e.toUpperCase().includes(`W`))throw TypeError(`CronPattern: Syntax error, W is not allowed in a range.`);let i=this.extractNth(e,t),a=i[0].split(`-`);if(a.length!==2)throw TypeError(`CronPattern: Syntax error, illegal range: '`+e+`'`);let o=parseInt(a[0],10)+n,s=parseInt(a[1],10)+n;this.validateNotNaN(o,`CronPattern: Syntax error, illegal lower range (NaN)`),this.validateNotNaN(s,`CronPattern: Syntax error, illegal upper range (NaN)`),this.validateRange(o,s,void 0,t,e);for(let e=o;e<=s;e++)this.setPart(t,e,i[1]||r)}handleStepping(e,t,n,r){if(e.toUpperCase().includes(`W`))throw TypeError(`CronPattern: Syntax error, W is not allowed in parts with stepping.`);let i=this.extractNth(e,t),a=i[0].split(`/`);if(a.length!==2)throw TypeError(`CronPattern: Syntax error, illegal stepping: '`+e+`'`);if(this.sloppyRanges)a[0]===``&&(a[0]=`*`);else{if(a[0]===``)throw TypeError(`CronPattern: Syntax error, stepping with missing prefix ('`+e+`') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.`);if(a[0]!==`*`)throw TypeError(`CronPattern: Syntax error, stepping with numeric prefix ('`+e+`') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.`)}let o=0;a[0]!==`*`&&(o=parseInt(a[0],10)+n);let s=parseInt(a[1],10);this.validateNotNaN(s,`CronPattern: Syntax error, illegal stepping: (NaN)`),this.validateRange(0,this[t].length-1,s,t,e);for(let e=o;e<this[t].length;e+=s)this.setPart(t,e,i[1]||r)}replaceAlphaDays(e){return e.replace(/-sun/gi,`-7`).replace(/sun/gi,`0`).replace(/mon/gi,`1`).replace(/tue/gi,`2`).replace(/wed/gi,`3`).replace(/thu/gi,`4`).replace(/fri/gi,`5`).replace(/sat/gi,`6`)}replaceAlphaDaysQuartz(e){return e.replace(/sun/gi,`1`).replace(/mon/gi,`2`).replace(/tue/gi,`3`).replace(/wed/gi,`4`).replace(/thu/gi,`5`).replace(/fri/gi,`6`).replace(/sat/gi,`7`)}replaceAlphaMonths(e){return e.replace(/jan/gi,`1`).replace(/feb/gi,`2`).replace(/mar/gi,`3`).replace(/apr/gi,`4`).replace(/may/gi,`5`).replace(/jun/gi,`6`).replace(/jul/gi,`7`).replace(/aug/gi,`8`).replace(/sep/gi,`9`).replace(/oct/gi,`10`).replace(/nov/gi,`11`).replace(/dec/gi,`12`)}handleNicknames(e){let t=e.trim().toLowerCase();if(t===`@yearly`||t===`@annually`)return`0 0 1 1 *`;if(t===`@monthly`)return`0 0 1 * *`;if(t===`@weekly`)return`0 0 * * 0`;if(t===`@daily`||t===`@midnight`)return`0 0 * * *`;if(t===`@hourly`)return`0 * * * *`;if(t===`@reboot`)throw TypeError(`CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.`);return e}setNthWeekdayOfMonth(e,t){if(typeof t!=`number`&&t.toUpperCase()===`L`)this.dayOfWeek[e]=this.dayOfWeek[e]|32;else if(t===63)this.dayOfWeek[e]=63;else if(t<6&&t>0)this.dayOfWeek[e]=this.dayOfWeek[e]|va[t-1];else throw TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`)}},ba=[31,28,31,30,31,30,31,31,30,31,30,31],X=[[`month`,`year`,0],[`day`,`month`,-1],[`hour`,`day`,0],[`minute`,`hour`,0],[`second`,`minute`,0]],Z=class e{tz;ms;second;minute;hour;day;month;year;constructor(t,n){if(this.tz=n,t&&t instanceof Date)if(!isNaN(t))this.fromDate(t);else throw TypeError(`CronDate: Invalid date passed to CronDate constructor`);else if(t==null)this.fromDate(new Date);else if(t&&typeof t==`string`)this.fromString(t);else if(t instanceof e)this.fromCronDate(t);else throw TypeError(`CronDate: Invalid type (`+typeof t+`) passed to CronDate constructor`)}getLastDayOfMonth(e,t){return t===1?new Date(Date.UTC(e,t+1,0)).getUTCDate():ba[t]}getLastWeekday(e,t){let n=this.getLastDayOfMonth(e,t),r=new Date(Date.UTC(e,t,n)).getUTCDay();return r===0?n-2:r===6?n-1:n}getNearestWeekday(e,t,n){let r=this.getLastDayOfMonth(e,t);if(n>r)return-1;let i=new Date(Date.UTC(e,t,n)).getUTCDay();return i===0?n===r?n-2:n+1:i===6?n===1?n+2:n-1:n}isNthWeekdayOfMonth(e,t,n,r){let i=new Date(Date.UTC(e,t,n)).getUTCDay(),a=0;for(let r=1;r<=n;r++)new Date(Date.UTC(e,t,r)).getUTCDay()===i&&a++;if(r&63&&va[a-1]&r)return!0;if(r&32){let r=this.getLastDayOfMonth(e,t);for(let a=n+1;a<=r;a++)if(new Date(Date.UTC(e,t,a)).getUTCDay()===i)return!1;return!0}return!1}fromDate(e){if(this.tz!==void 0)if(typeof this.tz==`number`)this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes()+this.tz,this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),this.apply();else try{let t=Y(e,this.tz);this.ms=e.getMilliseconds(),this.second=t.s,this.minute=t.i,this.hour=t.h,this.day=t.d,this.month=t.m-1,this.year=t.y}catch(e){let t=e instanceof Error?e.message:String(e);throw TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${t}`)}else this.ms=e.getMilliseconds(),this.second=e.getSeconds(),this.minute=e.getMinutes(),this.hour=e.getHours(),this.day=e.getDate(),this.month=e.getMonth(),this.year=e.getFullYear()}fromCronDate(e){this.tz=e.tz,this.year=e.year,this.month=e.month,this.day=e.day,this.hour=e.hour,this.minute=e.minute,this.second=e.second,this.ms=e.ms}apply(){if(this.month>11||this.month<0||this.day>ba[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let e=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes(),this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),!0}else return!1}fromString(e){if(typeof this.tz==`number`){let t=ha(e);this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes(),this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),this.apply()}else return this.fromDate(ha(e,this.tz))}findNext(e,t,n,r){return this._findMatch(e,t,n,r,1)}_findMatch(e,t,n,r,i){let a=this[t],o;n.lastDayOfMonth&&(o=this.getLastDayOfMonth(this.year,this.month));let s=!n.starDOW&&t==`day`?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,c=this[t]+r,l=i===1?e=>e<n[t].length:e=>e>=0;for(let u=c;l(u);u+=i){let i=n[t][u];if(t===`day`&&!i){for(let e=0;e<n.nearestWeekdays.length;e++)if(n.nearestWeekdays[e]){let t=this.getNearestWeekday(this.year,this.month,e-r);if(t===-1)continue;if(t===u-r){i=1;break}}}if(t===`day`&&n.lastWeekday){let e=this.getLastWeekday(this.year,this.month);u-r===e&&(i=1)}if(t===`day`&&n.lastDayOfMonth&&u-r==o&&(i=1),t===`day`&&!n.starDOW){let t=n.dayOfWeek[(s+(u-r-1))%7];if(t&&t&63)t=+!!this.isNthWeekdayOfMonth(this.year,this.month,u-r,t);else if(t)throw Error(`CronDate: Invalid value for dayOfWeek encountered. ${t}`);n.useAndLogic?i&&=t:!e.domAndDow&&!n.starDOM?i||=t:i&&=t}if(i)return this[t]=u-r,a===this[t]?1:2}return 3}recurse(e,t,n){if(n===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let t=-1;for(let n=this.year+1;n<e.year.length&&n<1e4;n++)if(e.year[n]===1){t=n;break}if(t===-1)return null;this.year=t,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let r=this.findNext(t,X[n][0],e,X[n][2]);if(r>1){let i=n+1;for(;i<X.length;)this[X[i][0]]=-X[i][2],i++;if(r===3){if(this[X[n][1]]++,this[X[n][0]]=-X[n][2],this.apply(),n===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=e.year.length)return null}return this.recurse(e,t,0)}else if(this.apply())return this.recurse(e,t,n-1)}return n+=1,n>=X.length?this:(e.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(e,t,n)}increment(e,t,n){return this.second+=t.interval!==void 0&&t.interval>1&&n?t.interval:1,this.ms=0,this.apply(),this.recurse(e,t,0)}decrement(e,t){return this.second-=t.interval!==void 0&&t.interval>1?t.interval:1,this.ms=0,this.apply(),this.recurseBackward(e,t,0,0)}recurseBackward(e,t,n,r=0){if(r>1e4)return null;if(n===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let t=-1;for(let n=this.year-1;n>=0;n--)if(e.year[n]===1){t=n;break}if(t===-1)return null;this.year=t,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let i=this.findPrevious(t,X[n][0],e,X[n][2]);if(i>1){let a=n+1;for(;a<X.length;){let t=X[a][0],n=X[a][2],r=this.getMaxPatternValue(t,e,n);this[t]=r,a++}if(i===3){if(this[X[n][1]]--,n===0){let e=this.getLastDayOfMonth(this.year,this.month);this.day>e&&(this.day=e)}if(n===1)if(this.day<=0)this.day=1;else{let e=this.year,t=this.month;for(;t<0;)t+=12,e--;for(;t>11;)t-=12,e++;let n=t===1?new Date(Date.UTC(e,t+1,0)).getUTCDate():ba[t];this.day>n&&(this.day=n)}this.apply();let i=X[n][0],a=X[n][2],o=this.getMaxPatternValue(i,e,a);if(i===`day`){let e=this.getLastDayOfMonth(this.year,this.month);this[i]=Math.min(o,e)}else this[i]=o;if(this.apply(),n===0){let t=X[1][2],n=this.getMaxPatternValue(`day`,e,t),r=this.getLastDayOfMonth(this.year,this.month),i=Math.min(n,r);i!==this.day&&(this.day=i,this.hour=this.getMaxPatternValue(`hour`,e,X[2][2]),this.minute=this.getMaxPatternValue(`minute`,e,X[3][2]),this.second=this.getMaxPatternValue(`second`,e,X[4][2]))}if(n===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(e,t,0,r+1)}else if(this.apply())return this.recurseBackward(e,t,n-1,r+1)}return n+=1,n>=X.length?this:this.year<0?null:this.recurseBackward(e,t,n,r+1)}getMaxPatternValue(e,t,n){if(e===`day`&&t.lastDayOfMonth||e===`day`&&!t.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let r=t[e].length-1;r>=0;r--)if(t[e][r])return r-n;return t[e].length-1-n}findPrevious(e,t,n,r){return this._findMatch(e,t,n,r,-1)}getDate(e){return e||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz==`number`?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):ga(_a(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(e,t){if(!e.starYear&&(this.year<0||this.year>=e.year.length||e.year[this.year]===0))return!1;for(let n=0;n<X.length;n++){let r=X[n][0],i=X[n][2],a=this[r];if(a+i<0||a+i>=e[r].length)return!1;let o=e[r][a+i];if(r===`day`){if(!o){for(let t=0;t<e.nearestWeekdays.length;t++)if(e.nearestWeekdays[t]){let e=this.getNearestWeekday(this.year,this.month,t-i);if(e!==-1&&e===a){o=1;break}}}if(e.lastWeekday&&a===this.getLastWeekday(this.year,this.month)&&(o=1),e.lastDayOfMonth&&a===this.getLastDayOfMonth(this.year,this.month)&&(o=1),!e.starDOW){let n=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),r=e.dayOfWeek[(n+(a-1))%7];r&&r&63&&(r=+!!this.isNthWeekdayOfMonth(this.year,this.month,a,r)),e.useAndLogic?o&&=r:!t.domAndDow&&!e.starDOM?o||=r:o&&=r}}if(!o)return!1}return!0}};function xa(e){if(e===void 0&&(e={}),delete e.name,e.legacyMode!==void 0&&e.domAndDow===void 0?e.domAndDow=!e.legacyMode:e.domAndDow===void 0&&(e.domAndDow=!1),e.legacyMode=!e.domAndDow,e.paused=e.paused===void 0?!1:e.paused,e.maxRuns=e.maxRuns===void 0?1/0:e.maxRuns,e.catch=e.catch===void 0?!1:e.catch,e.interval=e.interval===void 0?0:parseInt(e.interval.toString(),10),e.utcOffset=e.utcOffset===void 0?void 0:parseInt(e.utcOffset.toString(),10),e.dayOffset=e.dayOffset===void 0?0:parseInt(e.dayOffset.toString(),10),e.unref=e.unref===void 0?!1:e.unref,e.mode=e.mode===void 0?`auto`:e.mode,e.alternativeWeekdays=e.alternativeWeekdays===void 0?!1:e.alternativeWeekdays,e.sloppyRanges=e.sloppyRanges===void 0?!1:e.sloppyRanges,![`auto`,`5-part`,`6-part`,`7-part`,`5-or-6-parts`,`6-or-7-parts`].includes(e.mode))throw Error(`CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.`);if(e.startAt&&=new Z(e.startAt,e.timezone),e.stopAt&&=new Z(e.stopAt,e.timezone),e.interval!==null){if(isNaN(e.interval))throw Error(`CronOptions: Supplied value for interval is not a number`);if(e.interval<0)throw Error(`CronOptions: Supplied value for interval can not be negative`)}if(e.utcOffset!==void 0){if(isNaN(e.utcOffset))throw Error(`CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.`);if(e.utcOffset<-870||e.utcOffset>870)throw Error(`CronOptions: utcOffset out of bounds.`);if(e.utcOffset!==void 0&&e.timezone)throw Error(`CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.`)}if(e.unref!==!0&&e.unref!==!1)throw Error(`CronOptions: Unref should be either true, false or undefined(false).`);if(e.dayOffset!==void 0&&e.dayOffset!==0&&isNaN(e.dayOffset))throw Error(`CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.`);return e}function Q(e){return Object.prototype.toString.call(e)===`[object Function]`||typeof e==`function`||e instanceof Function}function Sa(e){return Q(e)}function Ca(e){typeof Deno<`u`&&typeof Deno.unrefTimer<`u`?Deno.unrefTimer(e):e&&typeof e.unref<`u`&&e.unref()}var wa=30*1e3,Ta=[],Ea=class{name;options;_states;fn;getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(e){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let t=this.options.dayOffset*24*60*60*1e3;return new Date(e.getTime()+t)}return e}constructor(e,t,n){let r,i;if(Q(t))i=t;else if(typeof t==`object`)r=t;else if(t!==void 0)throw Error(`Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).`);if(Q(n))i=n;else if(typeof n==`object`)r=n;else if(n!==void 0)throw Error(`Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).`);if(this.name=r?.name,this.options=xa(r),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:r?r.maxRuns:void 0,paused:r?r.paused:!1,pattern:new ya(`* * * * *`,void 0,{mode:`auto`})},e&&(e instanceof Date||typeof e==`string`&&e.indexOf(`:`)>0)?this._states.once=new Z(e,this.getTz()):this._states.pattern=new ya(e,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(Ta.find(e=>e.name===this.name))throw Error(`Cron: Tried to initialize new named job '`+this.name+`', but name already taken.`);Ta.push(this)}return i!==void 0&&Sa(i)&&(this.fn=i,this.schedule()),this}nextRun(e){let t=this._next(e);return t?this.applyDayOffset(t.getDate(!1)):null}nextRuns(e,t){this._states.maxRuns!==void 0&&e>this._states.maxRuns&&(e=this._states.maxRuns);let n=t||this._states.currentRun||void 0;return this._enumerateRuns(e,n,`next`)}previousRuns(e,t){return this._enumerateRuns(e,t||void 0,`previous`)}_enumerateRuns(e,t,n){let r=[],i=t?new Z(t,this.getTz()):null,a=n===`next`?this._next:this._previous;for(;e--;){let e=a.call(this,i);if(!e)break;let t=e.getDate(!1);r.push(this.applyDayOffset(t)),i=e}return r}match(e){if(this._states.once){let t=new Z(e,this.getTz());t.ms=0;let n=new Z(this._states.once,this.getTz());return n.ms=0,t.getTime()===n.getTime()}let t=new Z(e,this.getTz());return t.ms=0,t.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let e=this.nextRun(this._states.currentRun),t=!this._states.paused,n=this.fn!==void 0,r=!this._states.kill;return t&&n&&r&&e!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(e){let t=this._next(e);return t?e instanceof Z||e instanceof Date?t.getTime()-e.getTime():t.getTime()-new Z(e).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let e=Ta.indexOf(this);e>=0&&Ta.splice(e,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(e){if(e&&this.fn)throw Error(`Cron: It is not allowed to schedule two functions using the same Croner instance.`);e&&(this.fn=e);let t=this.msToNext(),n=this.nextRun(this._states.currentRun);return t==null||isNaN(t)||n===null?this:(t>wa&&(t=wa),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(n),t),this._states.currentTimeout&&this.options.unref&&Ca(this._states.currentTimeout),this)}async _trigger(e){this._states.blocking=!0,this._states.currentRun=new Z(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(e){if(Q(this.options.catch))try{this.options.catch(e,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new Z(e,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(e){let t=new Date,n=!this._states.paused&&t.getTime()>=e.getTime(),r=this._states.blocking&&this.options.protect;n&&!r?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):n&&r&&Q(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(e){let t=!!(e||this._states.currentRun),n=!1;!e&&this.options.startAt&&this.options.interval&&([e,t]=this._calculatePreviousRun(e,t),n=!e),e=new Z(e,this.getTz()),this.options.startAt&&e&&e.getTime()<this.options.startAt.getTime()&&(e=this.options.startAt);let r=this._states.once||new Z(e,this.getTz());return!n&&r!==this._states.once&&(r=r.increment(this._states.pattern,this.options,t)),this._states.once&&this._states.once.getTime()<=e.getTime()||r===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&r.getTime()>=this.options.stopAt.getTime()?null:r}_previous(e){let t=new Z(e,this.getTz());this.options.stopAt&&t.getTime()>this.options.stopAt.getTime()&&(t=this.options.stopAt);let n=new Z(t,this.getTz());return this._states.once?this._states.once.getTime()<t.getTime()?this._states.once:null:(n=n.decrement(this._states.pattern,this.options),n===null||this.options.startAt&&n.getTime()<this.options.startAt.getTime()?null:n)}_calculatePreviousRun(e,t){let n=new Z(void 0,this.getTz()),r=e;if(this.options.startAt.getTime()<=n.getTime()){r=this.options.startAt;let e=r.getTime()+this.options.interval*1e3;for(;e<=n.getTime();)r=new Z(r,this.getTz()).increment(this._states.pattern,this.options,!0),e=r.getTime()+this.options.interval*1e3;t=!0}return r===null&&(r=void 0),[r,t]}},Da=k().min(1).max(64),Oa=k().min(1).max(120),ka=900*1e3,Aa=5,ja=5,Ma=A({cron:Oa,timezone:Da}).superRefine(({cron:e,timezone:t},n)=>{let r=(e,t)=>{n.addIssue({code:Ie.custom,path:[e],message:t})};try{new Intl.DateTimeFormat(`en-US`,{timeZone:t})}catch{r(`timezone`,`"${t}" is not a known timezone. Pick an IANA zone such as "Europe/Amsterdam" or "UTC".`);return}if(e.trim().split(/\s+/).length!==ja){r(`cron`,`A report schedule is a 5-field cron expression (minute hour day-of-month month day-of-week), for example "0 9 * * 1".`);return}let i;try{i=new Ea(e,{timezone:t}).nextRuns(Aa,new Date)}catch{r(`cron`,`"${e}" is not a valid cron expression.`);return}if(i.length<2){r(`cron`,`"${e}" does not run on a repeating schedule. Pick a schedule that comes due more than once.`);return}Math.min(...i.slice(1).map((e,t)=>e.getTime()-i[t].getTime()))<9e5&&r(`cron`,`A report can send at most every ${ka/6e4} minutes. This schedule sends more often than that.`)}),Na=Ge(`kind`,[A({kind:M(`dashboard`),dashboardId:k().min(1)}),A({kind:M(`customGraph`),customGraphId:k().min(1)}),A({kind:M(`traceQuery`),filters:Ve(k(),Pe()).default({}),metric:k().optional(),topN:Re().int().min(1).max(100).default(5)})]);A({source:Na,schedule:Ma,compareToPrevious:He().default(!1)});function Pa({cron:e,timezone:t}){if(e.trim()===``)return`Enter a cron schedule.`;let n=Ma.safeParse({cron:e,timezone:t.trim()||`UTC`});return n.success?null:n.error.issues[0]?.message??`This schedule can't be saved.`}function Fa({cron:e,timezone:t}){return Pa({cron:e,timezone:t})===null}var Ia={frequency:`weekly`,hour:9,minute:0,dayOfWeek:1,dayOfMonth:1},La=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],Ra=[{value:1,short:`Mon`,long:`Monday`},{value:2,short:`Tue`,long:`Tuesday`},{value:3,short:`Wed`,long:`Wednesday`},{value:4,short:`Thu`,long:`Thursday`},{value:5,short:`Fri`,long:`Friday`},{value:6,short:`Sat`,long:`Saturday`},{value:0,short:`Sun`,long:`Sunday`}],za={daily:`Daily`,weekly:`Weekly`,monthly:`Monthly`};function Ba(e){let t=e%100;if(t>=11&&t<=13)return`${e}th`;switch(e%10){case 1:return`${e}st`;case 2:return`${e}nd`;case 3:return`${e}rd`;default:return`${e}th`}}var Va=e=>String(e).padStart(2,`0`);function Ha(e){return`${Va(e.hour)}:${Va(e.minute)}`}function Ua(e){let{minute:t,hour:n}=e;switch(e.frequency){case`daily`:return`${t} ${n} * * *`;case`weekly`:return`${t} ${n} * * ${e.dayOfWeek}`;case`monthly`:return`${t} ${n} ${e.dayOfMonth} * *`}}function Wa(e,t,n){if(!/^\d+$/.test(e))return null;let r=Number(e);return r>=t&&r<=n?r:null}function Ga(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let[n,r,i,a,o]=t,s=Wa(n??``,0,59),c=Wa(r??``,0,23);if(s===null||c===null||a!==`*`)return null;let l={hour:c,minute:s,dayOfWeek:1,dayOfMonth:1};if(i===`*`&&o===`*`)return{...l,frequency:`daily`};if(i===`*`&&o!==`*`){let e=Wa(o??``,0,6);return e===null?null:{...l,frequency:`weekly`,dayOfWeek:e}}if(i!==`*`&&o===`*`){let e=Wa(i??``,1,31);return e===null?null:{...l,frequency:`monthly`,dayOfMonth:e}}return null}function Ka(e,t){let n=Ha(e),r=t.trim()||`UTC`;switch(e.frequency){case`daily`:return`Sends every day at ${n} (${r})`;case`weekly`:return`Sends every ${La[e.dayOfWeek]??`day`} at ${n} (${r})`;case`monthly`:return`Sends on the ${Ba(e.dayOfMonth)} of each month at ${n} (${r})`}}function qa(e,t){let n=Ga(e);return n?Ka(n,t):`${e.trim()} (${t.trim()||`UTC`})`}function Ja(){try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;return e&&e.length>0?e:`UTC`}catch{return`UTC`}}var Ya=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`America/Sao_Paulo`,`Europe/London`,`Europe/Amsterdam`,`Europe/Berlin`,`Europe/Paris`,`Europe/Madrid`,`Europe/Moscow`,`Africa/Johannesburg`,`Asia/Dubai`,`Asia/Kolkata`,`Asia/Singapore`,`Asia/Shanghai`,`Asia/Tokyo`,`Australia/Sydney`,`Pacific/Auckland`];function Xa(){try{if(typeof Intl.supportedValuesOf==`function`){let e=Intl.supportedValuesOf(`timeZone`);if(e.length>0)return e}}catch{}return Ya}function Za(e){let t=new Map;for(let n of e){let e=n.indexOf(`/`),r=e===-1?`General`:n.slice(0,e),i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.entries()].sort(([e],[t])=>e===`General`?-1:t===`General`?1:e.localeCompare(t)).map(([e,t])=>({region:e,zones:t.sort()}))}var $={sourceKind:`traceQuery`,customGraphId:null,dashboardId:null,topN:5,cron:`0 9 * * 1`,timezone:`UTC`},Qa={seriesName:``,operator:`gt`,threshold:0,timePeriod:60},$a={action:null,name:``,alertType:null,source:`trace`,filters:{},filterQuery:null,customGraphId:null,graphAlert:Qa,report:$,notificationCadence:`5min_digest`,traceDebounceMs:ct,cadenceConfirmed:!1,slices:oa()};function eo(e,t){switch(t.type){case`HYDRATE`:return t.value;case`SET_ACTION`:return{...e,action:t.value};case`SET_NAME`:return{...e,name:t.value};case`SET_ALERT_TYPE`:return{...e,alertType:t.value};case`SET_SOURCE`:return t.value===`customGraph`?{...e,source:`customGraph`,filters:{},filterQuery:null,action:e.action===`SEND_EMAIL`||e.action===`SEND_SLACK_MESSAGE`?e.action:null}:t.value===`report`?{...e,source:`report`,filters:{},customGraphId:null,alertType:null,action:e.action===`SEND_EMAIL`||e.action===`SEND_SLACK_MESSAGE`?e.action:null}:{...e,source:`trace`,customGraphId:null,alertType:null};case`SET_CUSTOM_GRAPH_ID`:return{...e,customGraphId:t.value};case`SET_FILTERS`:return{...e,filters:t.value};case`SET_FILTER_QUERY`:return{...e,filterQuery:t.value};case`SET_GRAPH_ALERT`:return{...e,graphAlert:t.value};case`SET_REPORT`:return{...e,report:t.value};case`SET_CADENCE`:return{...e,notificationCadence:t.value,cadenceConfirmed:!0};case`SET_TRACE_DEBOUNCE_MS`:return{...e,traceDebounceMs:t.value,cadenceConfirmed:!0};case`CONFIRM_CADENCE`:return e.cadenceConfirmed?e:{...e,cadenceConfirmed:!0};case`SET_SLICE`:return{...e,slices:{...e.slices,[t.action]:t.slice}}}}function to(e,t){switch(e){case`customGraph`:return{title:t?`Edit alert`:`New alert`,saveButton:t?`Save alert`:`Create alert`,createdToast:`Alert created`,updatedToast:`Alert updated`,noun:`alert`};case`report`:return{title:t?`Edit schedule`:`New schedule`,saveButton:t?`Save schedule`:`Create schedule`,createdToast:`Schedule created`,updatedToast:`Schedule updated`,noun:`schedule`};case`trace`:return{title:t?`Edit automation`:`Add automation`,saveButton:t?`Save changes`:`Create automation`,createdToast:`Automation created`,updatedToast:`Automation updated`,noun:`automation`}}}function no(e){if(!e.action)return null;let t=q[e.action];return K(t)?t.client.channel:null}var ro={emailSubjectTemplate:null,emailBodyTemplate:null,slackTemplate:null,slackTemplateType:null};function io(e){if(!e.action)return ro;let t=q[e.action];return K(t)?t.client.templatesFromSlice(e.slices[e.action]):ro}function ao({draft:e,projectId:t,channel:n,webhook:r,botDestination:i,webhookDestination:a,automationId:o,graphName:s,seriesLabel:c}){let l=e.source===`customGraph`,u=e.source===`report`;return{projectId:t,channel:n,trigger:{name:e.name||`Your automation`,alertType:e.alertType},draft:io(e),webhook:r,botDestination:i??null,webhookDestination:a??null,...o?{automationId:o}:{},graphAlert:l?{graphName:s??void 0,metricLabel:c??void 0,operator:e.graphAlert.operator,threshold:e.graphAlert.threshold,timePeriodMinutes:e.graphAlert.timePeriod}:null,report:u?{sourceKind:e.report.sourceKind,scheduleLabel:qa(e.report.cron,e.report.timezone)}:null}}function oo(e){return e.action?q[e.action].client.toActionParams(e.slices[e.action]):{}}function so(e){return Object.values(e).some(e=>e&&(Array.isArray(e)?e.length>0:Object.keys(e).length>0))}function co(e){if(e.source===`customGraph`)return e.customGraphId!==null&&e.graphAlert.seriesName.length>0;if(e.source===`report`){let t=e.report;return t.sourceKind===`traceQuery`||t.sourceKind===`customGraph`&&t.customGraphId!==null||t.sourceKind===`dashboard`&&t.dashboardId!==null}return lo(e.filterQuery)||so(e.filters)}function lo(e){return(e??``).trim().length>0}function uo(e){return e.source===`customGraph`?Number.isFinite(e.graphAlert.threshold):e.source===`report`?Fa({cron:e.report.cron,timezone:e.report.timezone}):!0}function fo(e){return!co(e)||!uo(e)?!1:e.source===`customGraph`?e.alertType!==null:!0}function po(e){return e.action?q[e.action].client.isComplete(e.slices[e.action]):!1}var mo={gt:`greater than`,lt:`less than`,gte:`greater than or equal`,lte:`less than or equal`,eq:`equal to`},ho={1:`1 minute`,5:`5 minutes`,15:`15 minutes`,30:`30 minutes`,60:`1 hour`,1440:`1 day`};function go(e){return e.action?q[e.action].client.summary(e.slices[e.action],{name:e.name}):`Choose a type first`}function _o(e){return e.action?K(q[e.action]):!1}function vo(e){let t=fa(e);return t?{operator:t.operator,timePeriod:t.timePeriod,threshold:t.threshold,seriesName:t.seriesName}:Qa}function yo(e){if(typeof e!=`object`||!e)return $;let{source:t,schedule:n}=e,r={...$,cron:typeof n?.cron==`string`?n.cron:$.cron,timezone:typeof n?.timezone==`string`&&n.timezone.trim()!==``?n.timezone:$.timezone},i=Na.safeParse(t);if(!i.success)return r;let a=i.data;return{...r,sourceKind:a.kind,customGraphId:a.kind===`customGraph`?a.customGraphId:null,dashboardId:a.kind===`dashboard`?a.dashboardId:null,topN:a.kind===`traceQuery`?a.topN:$.topN}}function bo(e){let t={cron:e.cron,timezone:e.timezone};return e.sourceKind===`customGraph`?{source:{kind:`customGraph`,customGraphId:e.customGraphId??``},schedule:t,compareToPrevious:!1}:e.sourceKind===`dashboard`?{source:{kind:`dashboard`,dashboardId:e.dashboardId??``},schedule:t,compareToPrevious:!1}:{source:{kind:`traceQuery`,filters:{},topN:e.topN},schedule:t,compareToPrevious:!1}}function xo(e){if(!e||typeof e!=`object`)return[];let t=e.series;return Array.isArray(t)?t.map((t,n)=>{let r=Qe(e,n);if(!r)return null;let i=t??{},a=r.split(`/`).slice(1).join(` / `);return{key:r,label:(typeof i.name==`string`&&i.name.length>0?i.name:null)??`Series ${n+1}: ${a}`}}).filter(e=>e!==null):[]}function So(e,t){return t?xo(e).find(e=>e.key===t)?.label??null:null}export{Za as A,Ot as B,Ia as C,Pa as D,Ua as E,Ha as F,_t as G,ut as H,ca as I,st as J,Et as K,q as L,Ga as M,Ka as N,Ja as O,Xa as P,K as R,io as S,Ra as T,xt as U,dt as V,ft as W,lt as X,ct as Y,at as Z,no as _,ho as a,bo as b,uo as c,go as d,vo as f,_o as g,so as h,mo as i,Ba as j,qa as k,fo as l,lo as m,So as n,oo as o,yo as p,ot as q,$a as r,ao as s,xo as t,po as u,to as v,za as w,co as x,eo as y,Dt as z};
1015
- //# sourceMappingURL=seriesOptions-CDRg_FIS.js.map