@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.
- package/README.md +3 -3
- package/feature-map.json +4 -2
- package/langevals/evaluators/langevals/langevals_langevals/select_best_compare.py +165 -5
- package/langevals/evaluators/langevals/tests/test_select_best_compare.py +471 -9
- package/langevals/ts-integration/evaluators.generated.ts +83 -63
- package/langwatch/.env.example +7 -0
- package/langwatch/biome.jsonc +23 -0
- package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-DKvtbwGG.js +2 -0
- package/langwatch/dist/client/assets/AddDatasetRecordDrawer-D1vOO9OS.js +6 -0
- package/langwatch/dist/client/assets/AddOrEditAnnotationScore-zxFsPi_K.js +2 -0
- package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-soYSKpT_.js +2 -0
- package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-BHJmgYGv.js +3 -0
- package/langwatch/dist/client/assets/AddParticipants-z6X3xaWh.js +2 -0
- package/langwatch/dist/client/assets/AgentHistoryDrawer-kb5K4X01.js +2 -0
- package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Cf-aA1pn.js +5 -0
- package/langwatch/dist/client/assets/AgentListDrawer-z4OL5IVm.js +2 -0
- package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-Ky7GOYHj.js +2 -0
- package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-CAszeo8y.js +2 -0
- package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-DWrxkhIq.js +2 -0
- package/langwatch/dist/client/assets/AiGatewayLayout-BqznP5T2.js +2 -0
- package/langwatch/dist/client/assets/AnnotationsTable-C9n949u_.js +2 -0
- package/langwatch/dist/client/assets/AreaChart-PNFZHqkl.js +2 -0
- package/langwatch/dist/client/assets/AuthCard-D14g-b3Y.js +2 -0
- package/langwatch/dist/client/assets/AutomationDrawer-Cjo9egay.js +112 -0
- package/langwatch/dist/client/assets/BarChart-B23ShI5J.js +4 -0
- package/langwatch/dist/client/assets/BatchEvaluationSummary-CmkigWIn.js +2 -0
- package/langwatch/dist/client/assets/BudgetEditDrawer-nkQpQiY0.js +2 -0
- package/langwatch/dist/client/assets/CartesianChart-Ci1mTvgb.js +54 -0
- package/langwatch/dist/client/assets/CascadeArchiveDialog-BPqLe1Ai.js +2 -0
- package/langwatch/dist/client/assets/ChartTooltip-BMGa2HEK.js +2 -0
- package/langwatch/dist/client/assets/ChatWindow-BBsct-iS.js +5 -0
- package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-DOqtlBKU.js +9 -0
- package/langwatch/dist/client/assets/CodexCodingDefaultsAsk--UfSQyVR.js +2 -0
- package/langwatch/dist/client/assets/ColorfulBlockIcons-zwwbjL9F.js +6 -0
- package/langwatch/dist/client/assets/ColumnTypeIcon-CZZ6Esh0.js +2 -0
- package/langwatch/dist/client/assets/ComparisonLeaderboardDrawer-ChH7KNaX.js +4 -0
- package/langwatch/dist/client/assets/ConfirmDialog-CWzCY4sN.js +2 -0
- package/langwatch/dist/client/assets/ContactSalesBlock-B3w2lKdE.js +2 -0
- package/langwatch/dist/client/assets/Conversation-BhvQmXJ-.js +2 -0
- package/langwatch/dist/client/assets/CopyInput-Qeb_2bgP.js +2 -0
- package/langwatch/dist/client/assets/CopyableInputWithPrefix-Bp04WBtM.js +2 -0
- package/langwatch/dist/client/assets/CreateProjectDrawer-Dg_yrbka.js +2 -0
- package/langwatch/dist/client/assets/CreateTeamDrawer-CLJnKmFE.js +2 -0
- package/langwatch/dist/client/assets/CustomGraph-C6j6slUs.js +2 -0
- package/langwatch/dist/client/assets/DashboardLayout-Cn5-9Ye2.js +96 -0
- package/langwatch/dist/client/assets/DashboardNameDrawer-BvGn3rsq.js +2 -0
- package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-Wx7PJ_9S.js +2 -0
- package/langwatch/dist/client/assets/DatasetEditorTable-Ca3bmQrl.js +2 -0
- package/langwatch/dist/client/assets/DatasetPickerList-RZLjPQ2S.js +2 -0
- package/langwatch/dist/client/assets/DatasetPreviewTable-Ck22Wy4h.js +2 -0
- package/langwatch/dist/client/assets/DatasetSelector-BxeSHSDD.js +2 -0
- package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-ncleLyuX.js +2 -0
- package/langwatch/dist/client/assets/DeleteConfirmationDialog-Br5m12kp.js +2 -0
- package/langwatch/dist/client/assets/DocsLinks-D-I122gH.js +2 -0
- package/langwatch/dist/client/assets/DynamicZodForm-BUbQBluG.js +2 -0
- package/langwatch/dist/client/assets/EditAutomationFilterDrawer-Bci7dGy6.js +3 -0
- package/langwatch/dist/client/assets/EditModelProviderDrawer-CdUQa5qQ.js +4 -0
- package/langwatch/dist/client/assets/EditProjectDrawer-DDMa3VNp.js +2 -0
- package/langwatch/dist/client/assets/EmojiPickerModal-BLskXRKS.js +3 -0
- package/langwatch/dist/client/assets/EnterpriseLockedSurface-CGy3NpuC.js +2 -0
- package/langwatch/dist/client/assets/ErrorBarContext-CUuF6tzC.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Dw6JMkKa.js +107 -0
- package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-F1nHh-cP.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorEditorDrawer-eotRSQPT.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorEditorShared-BLZXXMFD.js +43 -0
- package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-Bx_uZmkb.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorListDrawer--2JYBA1w.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorMappingsSection-DCqvgq8G.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorSelection-BTMe6CCC.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorSelectionBox-CDxYA37_.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BDgiQ_Gu.js +2 -0
- package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-D4HFeq77.js +2 -0
- package/langwatch/dist/client/assets/ExecutionState-xp8LG59p.js +2 -0
- package/langwatch/dist/client/assets/FeatureFlagsDrawer-DIplgYQy.js +2 -0
- package/langwatch/dist/client/assets/FieldInfoTooltip-C_hEtQpK.js +2 -0
- package/langwatch/dist/client/assets/FieldsFilters-Ci5mVooQ.js +2 -0
- package/langwatch/dist/client/assets/FilterDisplay-BKjP30tt.js +2 -0
- package/langwatch/dist/client/assets/FilterSidebar-Cgxbpfi7.js +2 -0
- package/langwatch/dist/client/assets/FormatMoney-LZE9c_pf.js +2 -0
- package/langwatch/dist/client/assets/FoundryDrawer-DjVyu6Ww.js +2 -0
- package/langwatch/dist/client/assets/FullLogo-DRBt8v39.js +2 -0
- package/langwatch/dist/client/assets/GovernanceLayout-Baar1Fc8.js +2 -0
- package/langwatch/dist/client/assets/GraphsLayout-RNsRoPhs.js +2 -0
- package/langwatch/dist/client/assets/GroupBindingInputRow-BxvXd1EU.js +2 -0
- package/langwatch/dist/client/assets/GuardrailsDrawer-BtsfIXzD.js +91 -0
- package/langwatch/dist/client/assets/History-B3CO9rUC.js +17 -0
- package/langwatch/dist/client/assets/HorizontalFormControl-CpxShF8O.js +2 -0
- package/langwatch/dist/client/assets/HoverableBigText-BMBnTTnr.js +2 -0
- package/langwatch/dist/client/assets/InstallCliCard-DO5HE9Zk.js +2 -0
- package/langwatch/dist/client/assets/IntegratePaneShell-Bc7i3AU3.js +8 -0
- package/langwatch/dist/client/assets/InviteMemberDrawer-CiQbGDVl.js +2 -0
- package/langwatch/dist/client/assets/IsolatedErrorBoundary-QK1gsCee.js +2 -0
- package/langwatch/dist/client/assets/LLMModelCostDrawer-K4uPc99h.js +2 -0
- package/langwatch/dist/client/assets/LangyContextTarget-Dxr919ue.js +2 -0
- package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-CnBBcfON.js +2 -0
- package/langwatch/dist/client/assets/Legend-C-o-ebW-.js +6 -0
- package/langwatch/dist/client/assets/Line-CbuF_DU9.js +2 -0
- package/langwatch/dist/client/assets/LineChart-CjG7MhLF.js +2 -0
- package/langwatch/dist/client/assets/ListTable-Dq11zhPy.js +2 -0
- package/langwatch/dist/client/assets/LoadingScreen-BRa1kl7f.js +2 -0
- package/langwatch/dist/client/assets/Markdown-Cip8Rj5C.js +35 -0
- package/langwatch/dist/client/assets/MenuLink-CEEzPpsg.js +2 -0
- package/langwatch/dist/client/assets/MessageCard-Nbu21sIo.js +2 -0
- package/langwatch/dist/client/assets/MetadataTag-CQmOL4su.js +5 -0
- package/langwatch/dist/client/assets/ModelProviderCustomModelInput-s8Z1JIfQ.js +2 -0
- package/langwatch/dist/client/assets/ModelProviderScreen-BkZVsCiO.js +2 -0
- package/langwatch/dist/client/assets/ModelSelector-BjEx9IlF.js +2 -0
- package/langwatch/dist/client/assets/MyLayout-Dr6t6Ogu.js +2 -0
- package/langwatch/dist/client/assets/NavigationFooter-GfOzirbT.js +2 -0
- package/langwatch/dist/client/assets/NewWorkflowForm-uqnhwRpZ.js +2 -0
- package/langwatch/dist/client/assets/NoDataInfoBlock-Busjhz63.js +2 -0
- package/langwatch/dist/client/assets/OnboardingContainer-BGhio01s.js +2 -0
- package/langwatch/dist/client/assets/OnlineEvaluationDrawer-DyCVUUmz.js +2 -0
- package/langwatch/dist/client/assets/OpsPageShell-GqOT9Ezv.js +2 -0
- package/langwatch/dist/client/assets/OttlEditor-BYyg1quG.js +3 -0
- package/langwatch/dist/client/assets/OverflownText-q6WIx911.js +2 -0
- package/langwatch/dist/client/assets/ProjectAvatar-B0tbfKzY.js +43 -0
- package/langwatch/dist/client/assets/ProjectLangyLayout-Du3nxtBV.js +82 -0
- package/langwatch/dist/client/assets/PromptEditorDrawer-DeL8XgdG.js +2 -0
- package/langwatch/dist/client/assets/PromptListDrawer-y4bmNt4t.js +2 -0
- package/langwatch/dist/client/assets/PropertySectionTitle-CK55WvKi.js +37 -0
- package/langwatch/dist/client/assets/ProviderModelSelector-B-0vpQ2t.js +2 -0
- package/langwatch/dist/client/assets/ProviderScopeChips-DN3rtvAE.js +2 -0
- package/langwatch/dist/client/assets/PushToCopiesDialog-Ry_M3FuH.js +2 -0
- package/langwatch/dist/client/assets/ReferenceDot-DrNtDSrg.js +2 -0
- package/langwatch/dist/client/assets/RenderInputOutput-DqsCnspr.js +261 -0
- package/langwatch/dist/client/assets/ScatterChart-jarSkvrF.js +2 -0
- package/langwatch/dist/client/assets/ScenarioFormDrawer-DvJcYmkQ.js +2 -0
- package/langwatch/dist/client/assets/ScenarioInputMappingSection-BewVLFCZ.js +2 -0
- package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-BAPna8ym.js +3 -0
- package/langwatch/dist/client/assets/ScopeChipPicker-pQ061i-c.js +2 -0
- package/langwatch/dist/client/assets/SearchInput-DH_qIhwi.js +2 -0
- package/langwatch/dist/client/assets/SectionNavigationLayout-DwPBnqYj.js +2 -0
- package/langwatch/dist/client/assets/SelectDatasetDrawer-8MPCEZID.js +2 -0
- package/langwatch/dist/client/assets/SelectionActionBar-C2SOsiow.js +2 -0
- package/langwatch/dist/client/assets/SeriesFilterDrawer-d5DYEKTZ.js +2 -0
- package/langwatch/dist/client/assets/SettingsLayout-ZI47ZjuT.js +2 -0
- package/langwatch/dist/client/assets/SetupWithAgentButton-CNTb3Avj.js +4 -0
- package/langwatch/dist/client/assets/ShikiCommandBox-u0WEsz_9.js +5 -0
- package/langwatch/dist/client/assets/SpanDetails-L_YT0nxH.js +3 -0
- package/langwatch/dist/client/assets/SubscriptionPage-CaUbKJjG.js +2 -0
- package/langwatch/dist/client/assets/SuiteFormDrawer-BjUQdKq8.js +2 -0
- package/langwatch/dist/client/assets/Symbols-R6sphPWl.js +2 -0
- package/langwatch/dist/client/assets/TabButton-8Oc9UYh8.js +3 -0
- package/langwatch/dist/client/assets/TableCell-Ci8ylzki.js +2 -0
- package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-DSKFRtdD.js +2 -0
- package/langwatch/dist/client/assets/TeamForm-CL9ycvq0.js +2 -0
- package/langwatch/dist/client/assets/TeamUserRoleField-D0ZTlKiH.js +2 -0
- package/langwatch/dist/client/assets/TraceDetails-JolY6sXJ.js +9 -0
- package/langwatch/dist/client/assets/TraceDetailsDrawer-lgPzHJ3L.js +2 -0
- package/langwatch/dist/client/assets/TraceIdPeek-DDi0ChdF.js +2 -0
- package/langwatch/dist/client/assets/TracesMapping-BPXT_-h4.js +2 -0
- package/langwatch/dist/client/assets/UpgradeModalContent-DmGd0n65.js +2 -0
- package/langwatch/dist/client/assets/UploadCSVDrawer-haYFZH65.js +3 -0
- package/langwatch/dist/client/assets/VariablesSection-DW_-pHw8.js +2 -0
- package/langwatch/dist/client/assets/VersionBadge-BrsZ4NP1.js +2 -0
- package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9tl6d9Q.js +1161 -0
- package/langwatch/dist/client/assets/ViewAutomationDrawer-DliGiKaC.js +2 -0
- package/langwatch/dist/client/assets/VirtualKeySecretReveal-B9QMNIxJ.js +54 -0
- package/langwatch/dist/client/assets/WelcomeLayout-DZ1ue0he.js +2 -0
- package/langwatch/dist/client/assets/WithFeatureFlagGuard-CgkIIt3_.js +2 -0
- package/langwatch/dist/client/assets/WithPermissionGuard-Da_hdEdq.js +2 -0
- package/langwatch/dist/client/assets/WorkflowCard-C_ClnTV_.js +2 -0
- package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-DozYRazW.js +2 -0
- package/langwatch/dist/client/assets/_...path_-Da4obdgF.js +2 -0
- package/langwatch/dist/client/assets/_Uint8Array-BKsS4AYJ.js +2 -0
- package/langwatch/dist/client/assets/__...path__-hjRUlcmj.js +22 -0
- package/langwatch/dist/client/assets/_baseAssignValue-B0IP5NGP.js +2 -0
- package/langwatch/dist/client/assets/_baseClone-DWP1OuEe.js +2 -0
- package/langwatch/dist/client/assets/_baseEach-Bv6waMUN.js +2 -0
- package/langwatch/dist/client/assets/_baseFor-K5aTWdeA.js +2 -0
- package/langwatch/dist/client/assets/_experiment_-Cv2h4AYK.js +2 -0
- package/langwatch/dist/client/assets/_id_-BoubOQoS.js +2 -0
- package/langwatch/dist/client/assets/_id_-BuzJEIUf.js +2 -0
- package/langwatch/dist/client/assets/_id_-BzLlrR7z.js +2 -0
- package/langwatch/dist/client/assets/_id_-DAzjJ7AY.js +2 -0
- package/langwatch/dist/client/assets/_id_-Dc2UAWAO.js +2 -0
- package/langwatch/dist/client/assets/_id_-DwutdLKk.js +2 -0
- package/langwatch/dist/client/assets/_id_-H7-5DI5r.js +2 -0
- package/langwatch/dist/client/assets/_project_-DTuunSJZ.js +8 -0
- package/langwatch/dist/client/assets/_runId_-BGhwmwQj.js +7 -0
- package/langwatch/dist/client/assets/_shell-ChQAHWWX.js +2 -0
- package/langwatch/dist/client/assets/_slug_-D6Y2wsW5.js +2 -0
- package/langwatch/dist/client/assets/_slug_-DLKkXVG8.js +2 -0
- package/langwatch/dist/client/assets/_slug_-yLo6E4BE.js +17 -0
- package/langwatch/dist/client/assets/_team_-TUptH6wK.js +2 -0
- package/langwatch/dist/client/assets/_workflow_-B_flNNON.js +3 -0
- package/langwatch/dist/client/assets/_workflow_-DUyBeEF1.js +25 -0
- package/langwatch/dist/client/assets/accept-BtE8pbrP.js +2 -0
- package/langwatch/dist/client/assets/activity-BDNvBEBL.js +1 -0
- package/langwatch/dist/client/assets/agents-CZnWSlhu.js +2 -0
- package/langwatch/dist/client/assets/alerts-BDNvBEBL.js +1 -0
- package/langwatch/dist/client/assets/all-in7z_yGY.js +2 -0
- package/langwatch/dist/client/assets/analytics-C8m2qboV.js +2 -0
- package/langwatch/dist/client/assets/annotation-scores-hmT53w46.js +2 -0
- package/langwatch/dist/client/assets/annotations-DwouO48Z.js +2 -0
- package/langwatch/dist/client/assets/anomaly-rules-DoJdIoCt.js +2 -0
- package/langwatch/dist/client/assets/api-keys-CykxAxvG.js +4 -0
- package/langwatch/dist/client/assets/asaplangy-D3J00Q-Z.js +5 -0
- package/langwatch/dist/client/assets/audit-log-Dy4vcEeJ.js +2 -0
- package/langwatch/dist/client/assets/auth-IqMSC5k1.js +2 -0
- package/langwatch/dist/client/assets/authentication-BqVl7Fh-.js +2 -0
- package/langwatch/dist/client/assets/authorize-BGMc1Gzv.js +2 -0
- package/langwatch/dist/client/assets/authorize-DhHzBVUd.js +2 -0
- package/langwatch/dist/client/assets/automations-BDNvBEBL.js +1 -0
- package/langwatch/dist/client/assets/automations-BhzNESFp.js +2 -0
- package/langwatch/dist/client/assets/billing-plans-D_IT1cHz.js +2 -0
- package/langwatch/dist/client/assets/blank-Ct2wtHyX.js +2 -0
- package/langwatch/dist/client/assets/blobs-Dwi1OImQ.js +2 -0
- package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CnAsMlS_.js +133 -0
- package/langwatch/dist/client/assets/budgets-Cn5gXQK_.js +3 -0
- package/langwatch/dist/client/assets/bug-reports-feRha8NA.js +2 -0
- package/langwatch/dist/client/assets/cache-rules-T0g7jfVv.js +2 -0
- package/langwatch/dist/client/assets/choose-D7SJAjkq.js +2 -0
- package/langwatch/dist/client/assets/chunk-EX3LRPZG-DkekrL-i.js +232 -0
- package/langwatch/dist/client/assets/chunk-FWX5IMBZ-2uc49Oqf.js +3 -0
- package/langwatch/dist/client/assets/chunk-PUDLZKDR-CdFvlX4m.js +157 -0
- package/langwatch/dist/client/assets/chunk-RYQCIY6F-BLUBc3em.js +2 -0
- package/langwatch/dist/client/assets/chunk-V7JOEXUC-daLm26hJ.js +207 -0
- package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-CDA8LHAw.js +2 -0
- package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-CDA8LHAw.js +2 -0
- package/langwatch/dist/client/assets/clsx-CjueKrWZ.js +2 -0
- package/langwatch/dist/client/assets/codeAgentConfig-BGKq9uCt.js +7 -0
- package/langwatch/dist/client/assets/codingDefaultSync-BHSxIX3Y.js +2 -0
- package/langwatch/dist/client/assets/configure-CrBmyV7I.js +4 -0
- package/langwatch/dist/client/assets/constants-CDt5HyiB.js +2 -0
- package/langwatch/dist/client/assets/custom-wRFdLdR4.js +12 -0
- package/langwatch/dist/client/assets/custom_evaluator-C4ikBFuX.js +31 -0
- package/langwatch/dist/client/assets/dagre-VKFMJZFB-BElJnuGp.js +5 -0
- package/langwatch/dist/client/assets/dagre-VMur7wh6.js +2 -0
- package/langwatch/dist/client/assets/data-privacy-DAIYO4AS.js +2 -0
- package/langwatch/dist/client/assets/data-retention-6spK_HnV.js +2 -0
- package/langwatch/dist/client/assets/datasets-_6-oF4ZW.js +2 -0
- package/langwatch/dist/client/assets/debounce-CS9Z04io.js +2 -0
- package/langwatch/dist/client/assets/defaultModelState-B2tL23ua.js +2 -0
- package/langwatch/dist/client/assets/dejaview-Cde-wWV4.js +2 -0
- package/langwatch/dist/client/assets/departments-Cm-0ZxEt.js +2 -0
- package/langwatch/dist/client/assets/devices-DmiWzGY2.js +2 -0
- package/langwatch/dist/client/assets/dist-C4xeXVRv.js +6 -0
- package/langwatch/dist/client/assets/drawerFromUrl-CKr5SifD.js +2 -0
- package/langwatch/dist/client/assets/edit-CLmkWTOM.js +62 -0
- package/langwatch/dist/client/assets/email-suppressions-cqwH0a9N.js +2 -0
- package/langwatch/dist/client/assets/erDiagram-Q63AITRT-Byy32QYy.js +86 -0
- package/langwatch/dist/client/assets/error-D8QCVS4R.js +2 -0
- package/langwatch/dist/client/assets/errors-mlatPkMI.js +2 -0
- package/langwatch/dist/client/assets/evaluations-BBoYdpZy.js +2 -0
- package/langwatch/dist/client/assets/evaluations-DhzXchFj.js +2 -0
- package/langwatch/dist/client/assets/evaluators-BtHslgaT.js +2 -0
- package/langwatch/dist/client/assets/evaluators-_EDCn-tQ.js +148 -0
- package/langwatch/dist/client/assets/experiments-CffarahA.js +1 -0
- package/langwatch/dist/client/assets/feature-flags-mcBTRF0E.js +2 -0
- package/langwatch/dist/client/assets/fetchSSE-CnJPAkno.js +3 -0
- package/langwatch/dist/client/assets/fieldset-kmG3NTVs.js +2 -0
- package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-CY9NG0NN.js +1 -0
- package/langwatch/dist/client/assets/forgot-password-wo5Sna-0.js +2 -0
- package/langwatch/dist/client/assets/formatMoney-ClmqgvaY.js +2 -0
- package/langwatch/dist/client/assets/formatTargetOutput-DXvqMkYJ.js +2 -0
- package/langwatch/dist/client/assets/foundry-CfvGgfP0.js +477 -0
- package/langwatch/dist/client/assets/gateway-Be0EsD57.js +2 -0
- package/langwatch/dist/client/assets/getEvaluator-D2EjIa3G.js +2 -0
- package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-D2oUP3Tn.js +2 -0
- package/langwatch/dist/client/assets/governance-YZL-Q4Vy.js +2 -0
- package/langwatch/dist/client/assets/graphlib-DsLTzvlk.js +2 -0
- package/langwatch/dist/client/assets/grid-MxZhegzw.js +2 -0
- package/langwatch/dist/client/assets/groups-BmusUt3C.js +2 -0
- package/langwatch/dist/client/assets/guardrails-DAx8mDop.js +2 -0
- package/langwatch/dist/client/assets/handled-error-DbmvFmFF.js +2 -0
- package/langwatch/dist/client/assets/http-C64lOZI7.js +7 -0
- package/langwatch/dist/client/assets/identifierUtils-C2FgAR6z.js +2 -0
- package/langwatch/dist/client/assets/immer-DImI3Uq2.js +14 -0
- package/langwatch/dist/client/assets/index-8SbDirJv.js +68 -0
- package/langwatch/dist/client/assets/ingestion-source-detail-PQbeRniA.js +19 -0
- package/langwatch/dist/client/assets/ingestion-sources-CCyiAKHP.js +12 -0
- package/langwatch/dist/client/assets/integrations-WSl7N8v9.js +2 -0
- package/langwatch/dist/client/assets/isArrayLikeObject-DQ6J5Gh8.js +2 -0
- package/langwatch/dist/client/assets/isSymbol-DQQCRrSw.js +2 -0
- package/langwatch/dist/client/assets/langyHomeSuggestions-czH603Eu.js +2 -0
- package/langwatch/dist/client/assets/license-BXfbZQgG.js +2 -0
- package/langwatch/dist/client/assets/licenseStatusUtils-CeEgqpQ1.js +2 -0
- package/langwatch/dist/client/assets/lu-BSZWBZXU.js +2 -0
- package/langwatch/dist/client/assets/map-DUpZ7PrO.js +2 -0
- package/langwatch/dist/client/assets/mappingValidation-C7knTdfD.js +2 -0
- package/langwatch/dist/client/assets/me-DbCM2fI8.js +7 -0
- package/langwatch/dist/client/assets/me-DgXzEkaD.js +2 -0
- package/langwatch/dist/client/assets/members-CNILhgB4.js +2 -0
- package/langwatch/dist/client/assets/mermaid.core-1LNrQSiZ.js +12 -0
- package/langwatch/dist/client/assets/messages-CIoUj-2S.js +2 -0
- package/langwatch/dist/client/assets/metrics-Ba4ghWyR.js +2 -0
- package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-BsK9qdX4.js +97 -0
- package/langwatch/dist/client/assets/model-costs-Cmo-7iNN.js +2 -0
- package/langwatch/dist/client/assets/model-providers-DNeQW-T1.js +2 -0
- package/langwatch/dist/client/assets/modelProviderHelpers-BgYFTBND.js +2 -0
- package/langwatch/dist/client/assets/my-queue-DAyfQ6lp.js +2 -0
- package/langwatch/dist/client/assets/normalizeComparison-QGQpERT7.js +2 -0
- package/langwatch/dist/client/assets/not-found-BFkr8OS7.js +2 -0
- package/langwatch/dist/client/assets/now-BWCCq_PO.js +2 -0
- package/langwatch/dist/client/assets/onboarding-DAAoh3gE.js +2 -0
- package/langwatch/dist/client/assets/online-evaluations-DbC0C3ct.js +2 -0
- package/langwatch/dist/client/assets/ops-BnGgY3gP.js +2 -0
- package/langwatch/dist/client/assets/organizations-D-hWxeYL.js +2 -0
- package/langwatch/dist/client/assets/pages-BthWVZpr.js +2 -0
- package/langwatch/dist/client/assets/persistence-NkzSPIBC.js +2 -0
- package/langwatch/dist/client/assets/personalProject-C9vU_vdl.js +2 -0
- package/langwatch/dist/client/assets/plans-B_rx4bLE.js +2 -0
- package/langwatch/dist/client/assets/preconditionFieldUtils-ryKgG9T1.js +2 -0
- package/langwatch/dist/client/assets/product-BuY5Xwg3.js +2 -0
- package/langwatch/dist/client/assets/project-C2NjfKL8.js +2 -0
- package/langwatch/dist/client/assets/projections-rLpLV9w3.js +2 -0
- package/langwatch/dist/client/assets/projects-BF0LrAID.js +2 -0
- package/langwatch/dist/client/assets/promptHandle-BT-5THDj.js +2 -0
- package/langwatch/dist/client/assets/prompts-BHe5aLJx.js +8 -0
- package/langwatch/dist/client/assets/radio-group-BPt-WSZX.js +2 -0
- package/langwatch/dist/client/assets/registry-olFQKglt.js +2 -0
- package/langwatch/dist/client/assets/reports-BLYN6Q1s.js +2 -0
- package/langwatch/dist/client/assets/request-DFzKYavU.js +2 -0
- package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-CRtGWC_J.js +85 -0
- package/langwatch/dist/client/assets/reset-password-DYZspdMQ.js +2 -0
- package/langwatch/dist/client/assets/role-bindings-FmulBsng.js +2 -0
- package/langwatch/dist/client/assets/roles-RLhR-aqL.js +2 -0
- package/langwatch/dist/client/assets/routing-policies-ljceihkc.js +5 -0
- package/langwatch/dist/client/assets/scenarios-BQqYDDZG.js +2 -0
- package/langwatch/dist/client/assets/scheduler-BFnKJjAw.js +2 -0
- package/langwatch/dist/client/assets/schedules-BDNvBEBL.js +1 -0
- package/langwatch/dist/client/assets/scim-Bmka9JwE.js +2 -0
- package/langwatch/dist/client/assets/seatTypeCopy-fhsCX-T3.js +2 -0
- package/langwatch/dist/client/assets/secrets-Cwr6m0Ec.js +2 -0
- package/langwatch/dist/client/assets/segment-group-BktqF-NE.js +2 -0
- package/langwatch/dist/client/assets/segmented-control-Dux7mG6V.js +2 -0
- package/langwatch/dist/client/assets/select-BvA110t-.js +2 -0
- package/langwatch/dist/client/assets/send-KqbwnHm5.js +2 -0
- package/langwatch/dist/client/assets/sequenceView-CXTCS8lF.js +5 -0
- package/langwatch/dist/client/assets/seriesOptions-B04NlY20.js +1015 -0
- package/langwatch/dist/client/assets/settings-U355L_I1.js +2 -0
- package/langwatch/dist/client/assets/setup-BlSoABYV.js +2 -0
- package/langwatch/dist/client/assets/shikiAdapter-Ctbe7cQu.js +3 -0
- package/langwatch/dist/client/assets/showSuiteRunError-D2fez5Ub.js +2 -0
- package/langwatch/dist/client/assets/signin-DyT1qLoq.js +2 -0
- package/langwatch/dist/client/assets/signup-D8m3PZ3b.js +2 -0
- package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-iaTfadDT.js +2 -0
- package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-DH-TUWs1.js +2 -0
- package/langwatch/dist/client/assets/subscription-_ypR9RT2.js +3 -0
- package/langwatch/dist/client/assets/subscriptions-BRPlrnsz.js +2 -0
- package/langwatch/dist/client/assets/suggestionUI-BvF9IL3n.js +106 -0
- package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-DT3qutmi.js +3 -0
- package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-Chcqm6v8.js +9 -0
- package/langwatch/dist/client/assets/switch-BZp2DIfW.js +2 -0
- package/langwatch/dist/client/assets/switch-C1DNHB2v.js +2 -0
- package/langwatch/dist/client/assets/tabs-B6CQXTUQ.js +2 -0
- package/langwatch/dist/client/assets/teams-B3Yc0LtS.js +2 -0
- package/langwatch/dist/client/assets/teams-Df3DGQGZ.js +2 -0
- package/langwatch/dist/client/assets/tool-catalog-CpVqJ_Dp.js +7 -0
- package/langwatch/dist/client/assets/toolIcons-CwYXl2Eu.js +2 -0
- package/langwatch/dist/client/assets/tooltip-CM-lMDNU.js +2 -0
- package/langwatch/dist/client/assets/topic-clustering-DEtDEXOU.js +2 -0
- package/langwatch/dist/client/assets/topics-BGSBPvH8.js +2 -0
- package/langwatch/dist/client/assets/traceStore-C-SeEWpA.js +55 -0
- package/langwatch/dist/client/assets/traces-hMC5nfWE.js +289 -0
- package/langwatch/dist/client/assets/tracesMapping-CJhNJ9Ej.js +3 -0
- package/langwatch/dist/client/assets/tracking-in5OR8uP.js +2 -0
- package/langwatch/dist/client/assets/types-DNh2n8ZE.js +2 -0
- package/langwatch/dist/client/assets/types-OZJZgbcd.js +2 -0
- package/langwatch/dist/client/assets/types-nw9Z9F-v.js +2 -0
- package/langwatch/dist/client/assets/undo-2-CYjzz3Fj.js +2 -0
- package/langwatch/dist/client/assets/usage-BMXYHJUH.js +2 -0
- package/langwatch/dist/client/assets/usage-Da6wBDdP.js +2 -0
- package/langwatch/dist/client/assets/use-generic-onboarding-flow-eie3NRF5.js +2 -0
- package/langwatch/dist/client/assets/useActivePlan-Dsa3BYxd.js +2 -0
- package/langwatch/dist/client/assets/useAllPromptsForProject-BS-h_uSZ.js +2 -0
- package/langwatch/dist/client/assets/useAnnotationQueues-BMo2kZ_n.js +2 -0
- package/langwatch/dist/client/assets/useAvailableEvaluators-DkZ2Yt1F.js +2 -0
- package/langwatch/dist/client/assets/useCyclingVerb-BTWaxKR2.js +2 -0
- package/langwatch/dist/client/assets/useDepartmentColumn-xoZ52lPP.js +2 -0
- package/langwatch/dist/client/assets/useEvaluationsV3Store-CjI63SqB.js +2 -0
- package/langwatch/dist/client/assets/useExportTraces-kA2TFkjy.js +2 -0
- package/langwatch/dist/client/assets/useFeatureFlag-BjAcqOFH.js +2 -0
- package/langwatch/dist/client/assets/usePersonalContext-BGjy_Vrg.js +2 -0
- package/langwatch/dist/client/assets/useProjectSpanNames-DV-N8Iqc.js +2 -0
- package/langwatch/dist/client/assets/useProjectsForCopy-C63wLMNr.js +2 -0
- package/langwatch/dist/client/assets/useRunViaApiTabs-DMsq4RV1.js +50 -0
- package/langwatch/dist/client/assets/useShowLangy-C1pPUZqz.js +2 -0
- package/langwatch/dist/client/assets/useSimulationUpdateListener-ufWGuGhO.js +2 -0
- package/langwatch/dist/client/assets/useTargetName-DRCsNovZ.js +2 -0
- package/langwatch/dist/client/assets/useTargetNameMap-2sQCSyzN.js +2 -0
- package/langwatch/dist/client/assets/useTraceDetailsDrawer-CWSKPTh_.js +2 -0
- package/langwatch/dist/client/assets/useTraceUpdateListener-DqLF7KuU.js +2 -0
- package/langwatch/dist/client/assets/useUrlScopeFilter-BmRsU3rU.js +2 -0
- package/langwatch/dist/client/assets/useVariantMetrics-CK9aOmIb.js +2 -0
- package/langwatch/dist/client/assets/useWorkflowStore-CWWkoMW1.js +8 -0
- package/langwatch/dist/client/assets/users-B9jauEWz.js +2 -0
- package/langwatch/dist/client/assets/users-C8IaWy9-.js +2 -0
- package/langwatch/dist/client/assets/users-DIbzKO8Q.js +2 -0
- package/langwatch/dist/client/assets/v3-C9Ud_O3k.js +2 -0
- package/langwatch/dist/client/assets/variables-Dox25KUK.js +396 -0
- package/langwatch/dist/client/assets/viewStore-BCIvcW8n.js +2 -0
- package/langwatch/dist/client/assets/virtual-keys-D-qkAFBv.js +2 -0
- package/langwatch/dist/client/assets/welcome-CnjW7kg3.js +16 -0
- package/langwatch/dist/client/assets/wizard-CUCaNag_.js +2 -0
- package/langwatch/dist/client/assets/workbench-N1DutXtL.js +2 -0
- package/langwatch/dist/client/assets/workflows-D2XRYWpS.js +3 -0
- package/langwatch/dist/client/assets/wrap-D_XqGHIU.js +2 -0
- package/langwatch/dist/client/index.html +4 -4
- package/langwatch/dist/scenario-child-process.js +7 -0
- package/langwatch/e2e/auth-regression/better-auth-sso-smoketest.ts +72 -0
- package/langwatch/ee/LICENSE.md +52 -18
- package/langwatch/ee/README.md +15 -6
- package/langwatch/ee/admin/routes/__tests__/admin.integration.test.ts +1 -1
- package/langwatch/ee/admin/routes/admin.ts +1 -1
- package/langwatch/ee/audit-log/auditLog.ts +51 -0
- package/langwatch/ee/billing/__tests__/planLimits.unit.test.ts +6 -6
- package/langwatch/ee/billing/__tests__/planProvider.unit.test.ts +21 -33
- package/langwatch/ee/billing/__tests__/subscription.service.unit.test.ts +1 -0
- package/langwatch/ee/billing/__tests__/usage-limit.service.unit.test.ts +17 -17
- package/langwatch/ee/billing/planLimits.ts +1 -37
- package/langwatch/ee/billing/planProvider.ts +0 -13
- package/langwatch/ee/governance/reactors/__tests__/gatewayBudgetSync.reactor.unit.test.ts +39 -0
- package/langwatch/ee/governance/reactors/__tests__/governanceKpisSync.reactor.unit.test.ts +33 -0
- package/langwatch/ee/governance/reactors/__tests__/governanceOcsfEventsSync.reactor.unit.test.ts +33 -0
- package/langwatch/ee/governance/reactors/__tests__/governanceReactorsPreEnqueueGate.unit.test.ts +243 -0
- package/langwatch/ee/governance/reactors/gatewayBudgetSync.reactor.ts +391 -185
- package/langwatch/ee/governance/reactors/governanceKpisSync.reactor.ts +14 -7
- package/langwatch/ee/governance/reactors/governanceOcsfEventsSync.reactor.ts +97 -81
- package/langwatch/ee/governance/services/governanceAttributeKeys.ts +17 -0
- package/langwatch/ee/licensing/__tests__/constants.unit.test.ts +4 -6
- package/langwatch/ee/licensing/__tests__/defaults.unit.test.ts +63 -86
- package/langwatch/ee/licensing/__tests__/fixtures/testLicenses.ts +18 -0
- package/langwatch/ee/licensing/__tests__/licenseGenerationService.unit.test.ts +52 -16
- package/langwatch/ee/licensing/__tests__/licenseHandler.integration.test.ts +199 -15
- package/langwatch/ee/licensing/__tests__/mintedPlan.unit.test.ts +110 -0
- package/langwatch/ee/licensing/__tests__/planMapping.unit.test.ts +4 -29
- package/langwatch/ee/licensing/__tests__/planTemplates.unit.test.ts +0 -61
- package/langwatch/ee/licensing/__tests__/validation.unit.test.ts +69 -0
- package/langwatch/ee/licensing/constants.ts +11 -59
- package/langwatch/ee/licensing/defaults.ts +20 -32
- package/langwatch/ee/licensing/licenseGenerationService.ts +6 -19
- package/langwatch/ee/licensing/licenseHandler.ts +109 -92
- package/langwatch/ee/licensing/mintedPlan.ts +57 -0
- package/langwatch/ee/licensing/ossBaselineFloor.ts +45 -0
- package/langwatch/ee/licensing/planInfo.ts +0 -13
- package/langwatch/ee/licensing/planMapping.ts +0 -13
- package/langwatch/ee/licensing/planTemplates.ts +8 -42
- package/langwatch/ee/licensing/types.ts +24 -29
- package/langwatch/ee/licensing/validation.ts +13 -1
- package/langwatch/ee/scim/__tests__/scim-token.service.unit.test.ts +110 -0
- package/langwatch/ee/scim/__tests__/scim.costCenter.integration.test.ts +171 -0
- package/langwatch/ee/scim/__tests__/scim.service.unit.test.ts +415 -0
- package/langwatch/ee/scim/routes.ts +585 -0
- package/langwatch/ee/scim/scim-group.service.ts +465 -0
- package/langwatch/ee/scim/scim-role-resolver.ts +48 -0
- package/langwatch/ee/scim/scim-role-resolver.unit.test.ts +93 -0
- package/langwatch/ee/scim/scim-token.service.ts +71 -0
- package/langwatch/ee/scim/scim.service.ts +554 -0
- package/langwatch/ee/scim/scim.types.ts +149 -0
- package/langwatch/ee/scim/webhooks.ts +170 -0
- package/langwatch/ee/sso/__tests__/fallbackName.test.ts +142 -0
- package/langwatch/ee/sso/__tests__/matching.test.ts +126 -0
- package/langwatch/ee/sso/__tests__/parseIssuerUrl.test.ts +59 -0
- package/langwatch/ee/sso/__tests__/sso-gate.test.ts +459 -0
- package/langwatch/ee/sso/__tests__/sso-license.repository.test.ts +53 -0
- package/langwatch/ee/sso/__tests__/ssoPathGate.test.ts +182 -0
- package/langwatch/ee/sso/__tests__/ssoRouteTableCanary.test.ts +186 -0
- package/langwatch/ee/sso/matching.ts +48 -0
- package/langwatch/ee/sso/providers.ts +271 -0
- package/langwatch/ee/sso/sso-gate.ts +294 -0
- package/langwatch/ee/sso/sso-license.repository.ts +47 -0
- package/langwatch/ee/sso/ssoPathGate.ts +127 -0
- package/langwatch/package.json +1 -1
- package/langwatch/prisma/migrations/20260802120000_organization_user_disabled_at/migration.sql +7 -0
- package/langwatch/prisma/schema.prisma +8 -0
- package/langwatch/scripts/check-feature-parity.ts +0 -4
- package/langwatch/src/__tests__/noBinarySourceFiles.unit.test.ts +56 -0
- package/langwatch/src/app/api/agents/[[...route]]/app.ts +0 -2
- package/langwatch/src/app/api/agents/__tests__/agents-rest-api.integration.test.ts +0 -22
- package/langwatch/src/app/api/dashboards/[[...route]]/app.ts +0 -2
- package/langwatch/src/app/api/dashboards/__tests__/dashboard-rest-api.integration.test.ts +0 -18
- package/langwatch/src/app/api/dataset/[[...route]]/app.ts +0 -33
- package/langwatch/src/app/api/dataset/__tests__/dataset-rest-api.integration.test.ts +0 -24
- package/langwatch/src/app/api/dataset/__tests__/dataset-upload-api.integration.test.ts +0 -25
- package/langwatch/src/app/api/evaluators/[[...route]]/app.v1.ts +0 -2
- package/langwatch/src/app/api/export/scenario-runs/[[...route]]/app.ts +250 -0
- package/langwatch/src/app/api/export/scenario-runs/__tests__/scenario-run-export-route.integration.test.ts +336 -0
- package/langwatch/src/app/api/graphs/[[...route]]/app.ts +0 -2
- package/langwatch/src/app/api/middleware/__tests__/error-handler.unit.test.ts +4 -4
- package/langwatch/src/app/api/middleware/index.ts +0 -1
- package/langwatch/src/app/api/monitors/[[...route]]/app.ts +0 -2
- package/langwatch/src/app/api/projects/[[...route]]/app.ts +28 -8
- package/langwatch/src/app/api/prompts/[[...route]]/app.v1.ts +0 -2
- package/langwatch/src/app/api/scenario-events/[[...route]]/app.ts +0 -5
- package/langwatch/src/app/api/scenarios/[[...route]]/app.v1.ts +0 -2
- package/langwatch/src/app/api/shared/errors.ts +14 -0
- package/langwatch/src/app/api/simulation-runs/__tests__/simulation-run-platform-url.integration.test.ts +6 -3
- package/langwatch/src/app/api/suites/[[...route]]/app.ts +0 -2
- package/langwatch/src/app/api/teams/[[...route]]/app.ts +22 -1
- package/langwatch/src/app/api/teams/__tests__/teams-rest-api.integration.test.ts +146 -0
- package/langwatch/src/app/api/traces/[[...route]]/app.v1.ts +114 -0
- package/langwatch/src/app/api/triggers/[[...route]]/app.ts +0 -2
- package/langwatch/src/components/AddMembersForm.tsx +25 -5
- package/langwatch/src/components/AddOrEditDatasetDrawer.tsx +1 -9
- package/langwatch/src/components/ComparisonLeaderboardDrawer.tsx +496 -0
- package/langwatch/src/components/LicenseStatus.tsx +14 -16
- package/langwatch/src/components/__tests__/ComparisonLeaderboardDrawer.gate.integration.test.tsx +146 -0
- package/langwatch/src/components/__tests__/LicenseStatus.integration.test.tsx +129 -0
- package/langwatch/src/components/__tests__/UpgradeModal.integration.test.tsx +358 -68
- package/langwatch/src/components/agents/AgentCodeEditorDrawer.tsx +7 -14
- package/langwatch/src/components/agents/AgentHttpEditorDrawer.tsx +7 -14
- package/langwatch/src/components/agents/WorkflowSelectorDrawer.tsx +1 -15
- package/langwatch/src/components/analytics/DashboardNameDrawer.tsx +20 -26
- package/langwatch/src/components/auth/AuthCard.tsx +41 -0
- package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResults.tsx +72 -0
- package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResultsTable.tsx +109 -2
- package/langwatch/src/components/batch-evaluation-results/ComparisonCharts.tsx +241 -77
- package/langwatch/src/components/batch-evaluation-results/ComparisonLeaderboardChart.tsx +355 -0
- package/langwatch/src/components/batch-evaluation-results/ComparisonTable.tsx +437 -75
- package/langwatch/src/components/batch-evaluation-results/LeaderboardStep.tsx +105 -0
- package/langwatch/src/components/batch-evaluation-results/LeaderboardTrustPanel.tsx +464 -0
- package/langwatch/src/components/batch-evaluation-results/LeaderboardVerdictPanel.tsx +354 -0
- package/langwatch/src/components/batch-evaluation-results/PairwiseLeaderboard.tsx +553 -0
- package/langwatch/src/components/batch-evaluation-results/ParetoScatterChart.tsx +512 -0
- package/langwatch/src/components/batch-evaluation-results/TradeoffSummaryLine.tsx +58 -0
- package/langwatch/src/components/batch-evaluation-results/WinRateChart.tsx +12 -4
- package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.filter-overflow.integration.test.tsx +8 -1
- package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.leaderboard-gate.integration.test.tsx +192 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.test.tsx +8 -1
- package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonTable.group-by-metadata.integration.test.tsx +352 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/bootstrapMeanCI.unit.test.ts +98 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/buildAxisLabels.unit.test.ts +134 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/buildPairwiseComparisons.test.ts +95 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/buildTrustChecks.unit.test.ts +551 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeBTLeaderboard.test.ts +428 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeBandClipping.unit.test.ts +125 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeComparability.unit.test.ts +208 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeJudgeBiasChecks.unit.test.ts +186 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeLeaderboardVerdict.test.ts +288 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeParetoDominance.unit.test.ts +599 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeSampleAdequacy.unit.test.ts +212 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeScoreBarScale.unit.test.ts +104 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/computeVariantMetrics.test.ts +99 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/detectComparisonColumns.test.ts +133 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/formatLeaderboardHeadline.unit.test.ts +252 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/formatTradeoffSummary.unit.test.ts +219 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/leaderboardCache.unit.test.ts +128 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/panelAgreement.unit.test.ts +165 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/paretoScatterPoints.unit.test.ts +95 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/scoreSeparation.unit.test.ts +314 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/variantMetricsSymmetry.unit.test.ts +129 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/verdictSafety.unit.test.ts +438 -0
- package/langwatch/src/components/batch-evaluation-results/__tests__/winMatrixHasPairwiseDetail.unit.test.ts +126 -0
- package/langwatch/src/components/batch-evaluation-results/bootstrapMeanCI.ts +78 -0
- package/langwatch/src/components/batch-evaluation-results/buildPairwiseComparisons.ts +30 -0
- package/langwatch/src/components/batch-evaluation-results/chartAxisLabels.ts +98 -0
- package/langwatch/src/components/batch-evaluation-results/computeBTLeaderboard.ts +814 -0
- package/langwatch/src/components/batch-evaluation-results/computeComparability.ts +305 -0
- package/langwatch/src/components/batch-evaluation-results/computeJudgeBiasChecks.ts +175 -0
- package/langwatch/src/components/batch-evaluation-results/computeLeaderboardVerdict.ts +277 -0
- package/langwatch/src/components/batch-evaluation-results/computeParetoDominance.ts +283 -0
- package/langwatch/src/components/batch-evaluation-results/computeSampleAdequacy.ts +91 -0
- package/langwatch/src/components/batch-evaluation-results/computeVariantMetrics.ts +236 -0
- package/langwatch/src/components/batch-evaluation-results/computeWinMatrixShape.ts +61 -0
- package/langwatch/src/components/batch-evaluation-results/formatLeaderboardHeadline.ts +139 -0
- package/langwatch/src/components/batch-evaluation-results/formatTradeoffSummary.ts +126 -0
- package/langwatch/src/components/batch-evaluation-results/mulberry32.ts +19 -0
- package/langwatch/src/components/batch-evaluation-results/scoreSeparation.ts +102 -0
- package/langwatch/src/components/batch-evaluation-results/types.ts +82 -9
- package/langwatch/src/components/batch-evaluation-results/useBTLeaderboard.ts +137 -0
- package/langwatch/src/components/batch-evaluation-results/usePairwiseSort.ts +78 -0
- package/langwatch/src/components/batch-evaluation-results/useResultsGrouping.ts +119 -0
- package/langwatch/src/components/batch-evaluation-results/useShowComparisonLeaderboard.ts +43 -0
- package/langwatch/src/components/batch-evaluation-results/useVariantMetrics.ts +106 -0
- package/langwatch/src/components/checks/DynamicZodForm.tsx +9 -0
- package/langwatch/src/components/drawerRegistry.ts +5 -0
- package/langwatch/src/components/evaluations/OnlineEvaluationDrawer.tsx +13 -20
- package/langwatch/src/components/evaluators/EvaluatorEditorShared.tsx +16 -20
- package/langwatch/src/components/evaluators/WorkflowSelectorForEvaluatorDrawer.tsx +1 -15
- package/langwatch/src/components/experiments/CreateExperimentButton.tsx +13 -17
- package/langwatch/src/components/license/LicenseDetailsCard.tsx +72 -23
- package/langwatch/src/components/license/LicenseGeneratorForm.tsx +0 -60
- package/langwatch/src/components/license/LicenseLoadError.tsx +23 -0
- package/langwatch/src/components/license/OverSeatsCallout.tsx +68 -0
- package/langwatch/src/components/license/ResourceLimitsDisplay.tsx +0 -74
- package/langwatch/src/components/license/__tests__/OverSeatsCallout.integration.test.tsx +56 -0
- package/langwatch/src/components/license/__tests__/ResourceLimitsDisplay.unit.test.ts +8 -135
- package/langwatch/src/components/license/__tests__/licenseStatusUtils.unit.test.ts +68 -13
- package/langwatch/src/components/license/__tests__/planFormDefaults.unit.test.ts +11 -11
- package/langwatch/src/components/license/__tests__/useLicenseActions.integration.test.ts +185 -0
- package/langwatch/src/components/license/licenseStatusUtils.ts +21 -17
- package/langwatch/src/components/license/planFormDefaults.ts +3 -18
- package/langwatch/src/components/license/useLicenseActions.ts +26 -3
- package/langwatch/src/components/me/PersonalRecentTracesTable.tsx +4 -0
- package/langwatch/src/components/ops/projections/BulkReplayWizard.tsx +23 -1
- package/langwatch/src/components/plans/PlansComparisonPage.tsx +18 -0
- package/langwatch/src/components/plans/__tests__/PlansComparisonPage.integration.test.tsx +17 -0
- package/langwatch/src/components/plans/__tests__/planCurrentResolver.unit.test.ts +19 -0
- package/langwatch/src/components/plans/planCurrentResolver.ts +13 -0
- package/langwatch/src/components/projects/CreateProjectDrawer.tsx +36 -40
- package/langwatch/src/components/prompts/PromptEditorDrawer.tsx +9 -15
- package/langwatch/src/components/prompts/__tests__/PromptEditorDrawer.test.tsx +0 -1
- package/langwatch/src/components/scenarios/ScenarioCreateModal.tsx +3 -5
- package/langwatch/src/components/scenarios/ScenarioFormDrawer.tsx +2 -32
- package/langwatch/src/components/settings/CreateTeamDrawer.tsx +31 -35
- package/langwatch/src/components/settings/EnterpriseCapabilitiesSection.tsx +236 -0
- package/langwatch/src/components/settings/InfoWithoutSelecting.tsx +25 -0
- package/langwatch/src/components/settings/OrganizationUserRoleField.tsx +21 -2
- package/langwatch/src/components/settings/__tests__/EnterpriseCapabilitiesSection.integration.test.tsx +173 -0
- package/langwatch/src/components/settings/__tests__/seatTypeCopy.unit.test.ts +94 -0
- package/langwatch/src/components/settings/__tests__/seatTypeExplanation.integration.test.tsx +126 -0
- package/langwatch/src/components/settings/seatTypeCopy.ts +29 -0
- package/langwatch/src/components/subscription/SubscriptionPage.tsx +0 -1
- package/langwatch/src/components/subscription/__tests__/subscription-test-setup.ts +0 -13
- package/langwatch/src/components/subscription/billing-plans.ts +3 -12
- package/langwatch/src/components/suites/RunHistoryFilters.tsx +55 -3
- package/langwatch/src/components/suites/RunHistoryPanel.tsx +44 -0
- package/langwatch/src/components/suites/ScenarioRunExportDialog.tsx +92 -0
- package/langwatch/src/components/suites/SuiteFormDrawer.tsx +4 -20
- package/langwatch/src/components/suites/__tests__/AllRunsPanel.integration.test.tsx +3 -0
- package/langwatch/src/components/suites/__tests__/RunHistoryEmptyState.integration.test.tsx +45 -0
- package/langwatch/src/components/suites/__tests__/RunHistoryLiveWindow.integration.test.tsx +135 -0
- package/langwatch/src/components/suites/__tests__/ScenarioRunExportUi.integration.test.tsx +227 -0
- package/langwatch/src/components/suites/__tests__/SuiteDetailPanel.integration.test.tsx +3 -0
- package/langwatch/src/components/suites/run-history-transforms.ts +1 -28
- package/langwatch/src/components/suites/useExportScenarioRuns.ts +333 -0
- package/langwatch/src/components/suites/useRunHistoryPagination.ts +14 -0
- package/langwatch/src/components/upgrade-modal/LimitContent.tsx +3 -154
- package/langwatch/src/env-create.mjs +4 -0
- package/langwatch/src/features/errors/logic/codes.ts +2 -1
- package/langwatch/src/features/errors/logic/presentation.ts +8 -3
- package/langwatch/src/features/langy/__tests__/presentLangyToolError.unit.test.ts +1 -1
- package/langwatch/src/features/langy/logic/langyToolFailure.ts +4 -7
- package/langwatch/src/features/traces-v2/components/TraceDrawer/conversationView/TurnSteps.tsx +1 -1
- package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/DrawerHeader.tsx +34 -0
- package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/__tests__/utils.unit.test.ts +74 -0
- package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/TerminalView.tsx +57 -3
- package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/__tests__/TerminalView.integration.test.tsx +43 -3
- package/langwatch/src/features/traces-v2/components/TraceTable/columns.ts +7 -0
- package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/ContextSizeCell.tsx +48 -0
- package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/__tests__/ContextSizeCell.integration.test.tsx +57 -0
- package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/index.ts +2 -0
- package/langwatch/src/features/traces-v2/components/shared/TokenBreakdownTooltip.tsx +22 -0
- package/langwatch/src/features/traces-v2/lens/capabilities.ts +2 -0
- package/langwatch/src/features/traces-v2/types/trace.ts +2 -0
- package/langwatch/src/hooks/__tests__/useLicenseEnforcement.unit.test.tsx +18 -30
- package/langwatch/src/hooks/__tests__/useOrganizationTeamProject.personal-workspace.integration.test.tsx +30 -0
- package/langwatch/src/hooks/__tests__/usePostHogIdentify.unit.test.ts +3 -3
- package/langwatch/src/hooks/useMemberDisableAction.ts +53 -0
- package/langwatch/src/hooks/useOrganizationTeamProject.ts +8 -7
- package/langwatch/src/optimization_studio/components/Evaluate.tsx +39 -46
- package/langwatch/src/optimization_studio/components/workflow/NewWorkflowForm.tsx +22 -30
- package/langwatch/src/pages/[project]/analytics/custom/index.tsx +1 -6
- package/langwatch/src/pages/api/experiment/__tests__/init.unit.test.ts +2 -87
- package/langwatch/src/pages/api/experiment/init.ts +7 -60
- package/langwatch/src/pages/auth/__tests__/forgot-password.integration.test.tsx +38 -3
- package/langwatch/src/pages/auth/forgot-password.tsx +19 -23
- package/langwatch/src/pages/auth/reset-password.tsx +2 -23
- package/langwatch/src/pages/settings/__tests__/authentication.integration.test.tsx +7 -0
- package/langwatch/src/pages/settings/__tests__/team-settings.refused-save.integration.test.tsx +253 -0
- package/langwatch/src/pages/settings/authentication.tsx +7 -2
- package/langwatch/src/pages/settings/license.tsx +4 -3
- package/langwatch/src/pages/settings/members.tsx +126 -34
- package/langwatch/src/pages/settings/teams/[team].tsx +73 -20
- package/langwatch/src/pages/settings/usage.tsx +7 -8
- package/langwatch/src/prompts/prompt-playground/components/sidebar/AddPromptButton.tsx +3 -8
- package/langwatch/src/server/api/routers/__tests__/annotation.tenant-references.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/apiKey.myBindings.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/apiKey.nameById.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/apiKey.restricted-permissions.unit.test.ts +4 -1
- package/langwatch/src/server/api/routers/__tests__/automations.router.integration.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/bugReports.gating.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/enterprise-guards.integration.test.ts +0 -4
- package/langwatch/src/server/api/routers/__tests__/evaluators.tenant-workflow.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/graphs.tenant-dashboard.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/langy.turnErrors.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/langyGithub.access-order.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/license.integration.test.ts +1 -17
- package/langwatch/src/server/api/routers/__tests__/licenseEnforcement.reportLimitBlocked.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/monitors.copy.integration.test.ts +1 -11
- package/langwatch/src/server/api/routers/__tests__/organization.acceptInvite.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/organization.setMemberDisabled.integration.test.ts +306 -0
- package/langwatch/src/server/api/routers/__tests__/personal-workspace-invariants.integration.test.ts +794 -0
- package/langwatch/src/server/api/routers/__tests__/plan.getActivePlan.integration.test.ts +0 -1
- package/langwatch/src/server/api/routers/__tests__/project.getHasFirstMessage.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/project.regenerateApiKey.unit.test.ts +2 -2
- package/langwatch/src/server/api/routers/__tests__/prompts.copy.integration.test.ts +0 -58
- package/langwatch/src/server/api/routers/__tests__/prompts.duplicate.integration.test.ts +0 -54
- package/langwatch/src/server/api/routers/__tests__/publicEnv.test.ts +60 -0
- package/langwatch/src/server/api/routers/__tests__/secrets.reserved-names.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/team.update.multi-binding.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/traces.4991-full-resolution.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/tracesV2.transcript-read.unit.test.ts +121 -0
- package/langwatch/src/server/api/routers/__tests__/translate.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/user.changePassword.unit.test.ts +105 -0
- package/langwatch/src/server/api/routers/__tests__/user.deactivation.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/__tests__/user.register.unit.test.ts +67 -5
- package/langwatch/src/server/api/routers/__tests__/workflows.generateCommitMessage.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/agents.ts +0 -6
- package/langwatch/src/server/api/routers/analytics/__tests__/dataForFilter.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/apiKey.ts +1 -1
- package/langwatch/src/server/api/routers/automations.ts +0 -4
- package/langwatch/src/server/api/routers/bugReports.ts +1 -1
- package/langwatch/src/server/api/routers/copyEvaluatorToProject.ts +2 -5
- package/langwatch/src/server/api/routers/dashboards.ts +0 -2
- package/langwatch/src/server/api/routers/dataset.ts +0 -9
- package/langwatch/src/server/api/routers/emailSuppression.ts +1 -1
- package/langwatch/src/server/api/routers/evaluators.ts +0 -4
- package/langwatch/src/server/api/routers/experiments.ts +0 -14
- package/langwatch/src/server/api/routers/export.ts +65 -24
- package/langwatch/src/server/api/routers/graphs.ts +0 -2
- package/langwatch/src/server/api/routers/group.ts +6 -0
- package/langwatch/src/server/api/routers/langyEgress.ts +1 -1
- package/langwatch/src/server/api/routers/langyGithub.ts +1 -1
- package/langwatch/src/server/api/routers/license.ts +44 -36
- package/langwatch/src/server/api/routers/licenseEnforcement.ts +0 -21
- package/langwatch/src/server/api/routers/modelProviders.ts +1 -1
- package/langwatch/src/server/api/routers/monitors.ts +0 -6
- package/langwatch/src/server/api/routers/onboarding/__tests__/onboarding.personal-workspace.integration.test.ts +8 -15
- package/langwatch/src/server/api/routers/onboarding/onboarding.router.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/onboarding/setProductInterest.integration.test.ts +1 -1
- package/langwatch/src/server/api/routers/ops.ts +2 -0
- package/langwatch/src/server/api/routers/organization.ts +67 -1
- package/langwatch/src/server/api/routers/project.ts +74 -36
- package/langwatch/src/server/api/routers/prompts/prompts.trpc-router.ts +0 -10
- package/langwatch/src/server/api/routers/publicEnv.ts +7 -3
- package/langwatch/src/server/api/routers/scenarios/__tests__/simulation-runner.router.unit.test.ts +1 -1
- package/langwatch/src/server/api/routers/scenarios/scenario-crud.router.ts +0 -4
- package/langwatch/src/server/api/routers/scimToken.ts +1 -1
- package/langwatch/src/server/api/routers/suites/suite.router.ts +0 -3
- package/langwatch/src/server/api/routers/team.ts +48 -39
- package/langwatch/src/server/api/routers/tracesV2.schemas.ts +2 -0
- package/langwatch/src/server/api/routers/tracesV2.ts +76 -20
- package/langwatch/src/server/api/routers/user.ts +16 -6
- package/langwatch/src/server/api/routers/workflows.ts +0 -7
- package/langwatch/src/server/api/trpc.ts +1 -1
- package/langwatch/src/server/api-key/__tests__/api-key.service.legacy-ceiling.unit.test.ts +379 -0
- package/langwatch/src/server/api-key/__tests__/api-key.service.safety.unit.test.ts +3 -0
- package/langwatch/src/server/api-key/__tests__/api-key.service.unit.test.ts +3 -0
- package/langwatch/src/server/api-key/api-key.service.ts +63 -22
- package/langwatch/src/server/api-router.ts +5 -3
- package/langwatch/src/server/app-layer/__tests__/tracing.unit.test.ts +142 -0
- package/langwatch/src/server/app-layer/clients/clickhouse/__tests__/cold-scan-detector.coverage.unit.test.ts +2 -0
- package/langwatch/src/server/app-layer/clients/clickhouse/windowed-read.ts +15 -0
- package/langwatch/src/server/app-layer/dependencies.ts +8 -0
- package/langwatch/src/server/app-layer/evaluations/repositories/__tests__/evaluation-run.resolver-window.unit.test.ts +103 -0
- package/langwatch/src/server/app-layer/evaluations/repositories/evaluation-run.clickhouse.repository.ts +35 -1
- package/langwatch/src/server/app-layer/groups/group.service.ts +37 -0
- package/langwatch/src/server/app-layer/groups/repositories/group.prisma.repository.ts +9 -0
- package/langwatch/src/server/app-layer/groups/repositories/group.repository.ts +8 -0
- package/langwatch/src/server/app-layer/langy/__tests__/langyConversationMemory.unit.test.ts +1 -1
- package/langwatch/src/server/app-layer/langy/__tests__/langyTurnContext.unit.test.ts +0 -0
- package/langwatch/src/server/app-layer/langy/langyConversationMemory.ts +1 -1
- package/langwatch/src/server/app-layer/logs/repositories/__tests__/canonical-log-record.clickhouse.repository.unit.test.ts +54 -0
- package/langwatch/src/server/app-layer/logs/repositories/canonical-log-record.clickhouse.repository.ts +29 -12
- package/langwatch/src/server/app-layer/ops/__tests__/integration/pending-counter-reconcile.integration.test.ts +240 -0
- package/langwatch/src/server/app-layer/ops/__tests__/integration/replay-full-rebuild.integration.test.ts +390 -0
- package/langwatch/src/server/app-layer/ops/__tests__/replay.service.unit.test.ts +105 -1
- package/langwatch/src/server/app-layer/ops/replay.service.ts +47 -0
- package/langwatch/src/server/app-layer/ops/repositories/__tests__/queue.redis.repository.reconcile-pending.unit.test.ts +752 -0
- package/langwatch/src/server/app-layer/ops/repositories/queue.redis.repository.ts +597 -48
- package/langwatch/src/server/app-layer/organizations/__tests__/organization.service.unit.test.ts +1 -0
- package/langwatch/src/server/app-layer/organizations/organization.service.ts +16 -0
- package/langwatch/src/server/app-layer/organizations/repositories/organization.prisma.repository.ts +63 -2
- package/langwatch/src/server/app-layer/organizations/repositories/organization.repository.ts +15 -0
- package/langwatch/src/server/app-layer/presets.ts +27 -13
- package/langwatch/src/server/app-layer/projects/__tests__/project-service-update.unit.test.ts +100 -0
- package/langwatch/src/server/app-layer/projects/project.service.ts +145 -6
- package/langwatch/src/server/app-layer/projects/repositories/project.prisma.repository.ts +2 -16
- package/langwatch/src/server/app-layer/projects/repositories/project.repository.ts +2 -13
- package/langwatch/src/server/app-layer/simulations/__tests__/scenario-run-export-sweep.integration.test.ts +370 -0
- package/langwatch/src/server/app-layer/simulations/repositories/simulation.clickhouse.repository.ts +302 -7
- package/langwatch/src/server/app-layer/simulations/repositories/simulation.repository.ts +62 -0
- package/langwatch/src/server/app-layer/subscription/__tests__/composite-plan-provider.unit.test.ts +2 -28
- package/langwatch/src/server/app-layer/subscription/__tests__/self-hosted-plan-provider.unit.test.ts +101 -0
- package/langwatch/src/server/app-layer/subscription/self-hosted-plan-provider.ts +34 -0
- package/langwatch/src/server/app-layer/teams/team.service.ts +27 -0
- package/langwatch/src/server/app-layer/traces/__tests__/claude-code-span-enrichment.unit.test.ts +179 -0
- package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-span-filter.unit.test.ts +50 -0
- package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-transcript.derivation.unit.test.ts +331 -0
- package/langwatch/src/server/app-layer/traces/__tests__/trace-io-extraction.service.unit.test.ts +20 -0
- package/langwatch/src/server/app-layer/traces/canonicalisation/__tests__/structuredIO.test.ts +22 -1
- package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/claudeCode.unit.test.ts +217 -0
- package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/codex.unit.test.ts +133 -0
- package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/vercel.unit.test.ts +79 -0
- package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/_constants.ts +9 -0
- package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/claudeCode.ts +429 -6
- package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/codex.ts +158 -70
- package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/vercel.ts +26 -8
- package/langwatch/src/server/app-layer/traces/claude-code-span-enrichment.ts +89 -1
- package/langwatch/src/server/app-layer/traces/coding-agent-span-filter.ts +23 -1
- package/langwatch/src/server/app-layer/traces/coding-agent-transcript.derivation.ts +330 -75
- package/langwatch/src/server/app-layer/traces/repositories/__tests__/span-storage.resolver-window.unit.test.ts +108 -0
- package/langwatch/src/server/app-layer/traces/repositories/__tests__/trace-list.clickhouse.repository.integration.test.ts +31 -2
- package/langwatch/src/server/app-layer/traces/repositories/span-storage.clickhouse.repository.ts +36 -1
- package/langwatch/src/server/app-layer/traces/repositories/trace-list.clickhouse.repository.ts +7 -0
- package/langwatch/src/server/app-layer/traces/trace-io-extraction.service.ts +8 -1
- package/langwatch/src/server/app-layer/traces/trace-list.service.ts +10 -0
- package/langwatch/src/server/app-layer/tracing.ts +47 -0
- package/langwatch/src/server/app-layer/usage/usage.service.ts +0 -80
- package/langwatch/src/server/better-auth/__tests__/hooks.test.ts +72 -0
- package/langwatch/src/server/better-auth/__tests__/index.test.ts +31 -9
- package/langwatch/src/server/better-auth/__tests__/resetRecoversOauthUser.test.ts +128 -0
- package/langwatch/src/server/better-auth/__tests__/ssoGate.hook.test.ts +321 -0
- package/langwatch/src/server/better-auth/hooks.ts +46 -1
- package/langwatch/src/server/better-auth/index.ts +123 -284
- package/langwatch/src/server/clickhouse/__tests__/replicatedEngineGuard.unit.test.ts +301 -0
- package/langwatch/src/server/clickhouse/goose.ts +8 -0
- package/langwatch/src/server/clickhouse/migrations/00064_replicate_gateway_budget_scope_totals.sql +291 -0
- package/langwatch/src/server/clickhouse/migrations/00065_replicate_trace_analytics_rollup.sql +143 -0
- package/langwatch/src/server/clickhouse/migrations/00066_replicate_evaluation_analytics_rollup.sql +115 -0
- package/langwatch/src/server/datasets/__tests__/dataset-chunking.unit.test.ts +0 -0
- package/langwatch/src/server/evaluations/evaluators.generated.ts +83 -63
- package/langwatch/src/server/event-sourcing/pipeline/__tests__/staticBuilder.validations.unit.test.ts +46 -0
- package/langwatch/src/server/event-sourcing/pipeline/processManagerDefinition.ts +14 -0
- package/langwatch/src/server/event-sourcing/pipeline/staticBuilder.ts +8 -0
- package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/__tests__/graphTriggerActivity.groupKey.unit.test.ts +55 -0
- package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/graphTriggerActivity.subscriber.ts +23 -0
- package/langwatch/src/server/event-sourcing/pipelines/blob-maintenance/process-manager/blobCleanup.process.ts +6 -4
- package/langwatch/src/server/event-sourcing/pipelines/coding-agent-processing/schemas/constants.ts +6 -4
- package/langwatch/src/server/event-sourcing/pipelines/evaluation-processing/pipeline.ts +9 -1
- package/langwatch/src/server/event-sourcing/pipelines/log-processing/__tests__/logCommandCoalescing.unit.test.ts +174 -0
- package/langwatch/src/server/event-sourcing/pipelines/log-processing/pipeline.ts +7 -0
- package/langwatch/src/server/event-sourcing/pipelines/log-processing/schemas/constants.ts +19 -0
- package/langwatch/src/server/event-sourcing/pipelines/metric-processing/__tests__/metricCommandCoalescing.unit.test.ts +137 -0
- package/langwatch/src/server/event-sourcing/pipelines/metric-processing/pipeline.ts +7 -0
- package/langwatch/src/server/event-sourcing/pipelines/metric-processing/schemas/constants.ts +19 -0
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/__tests__/aiSdkStructuredOutput.integration.test.ts +199 -0
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/pipeline.ts +9 -1
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/spanStorageGroupKey.unit.test.ts +98 -0
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummaryClaudeCodeLift.unit.test.ts +187 -1
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorage.mapProjection.ts +10 -1
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorageGroupKey.ts +63 -0
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/traceSummary.foldProjection.ts +85 -18
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/__tests__/projectMetadata.groupKey.unit.test.ts +140 -0
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/projectMetadata.reactor.ts +23 -0
- package/langwatch/src/server/event-sourcing/projections/__tests__/projectionRouter.mapReactorCollapse.unit.test.ts +260 -0
- package/langwatch/src/server/event-sourcing/projections/foldProjection.types.ts +6 -3
- package/langwatch/src/server/event-sourcing/projections/global/__tests__/billingMeterDispatch.groupKey.unit.test.ts +139 -0
- package/langwatch/src/server/event-sourcing/projections/global/billingMeterDispatch.reactor.ts +27 -1
- package/langwatch/src/server/event-sourcing/projections/projectionRouter.ts +58 -41
- package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/blobSweeper.integration.test.ts +149 -0
- package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.decodeDrop.integration.test.ts +12 -1
- package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.integration.test.ts +45 -0
- package/langwatch/src/server/event-sourcing/queues/groupQueue/blobSweeper.ts +130 -22
- package/langwatch/src/server/event-sourcing/queues/groupQueue/scripts.ts +46 -0
- package/langwatch/src/server/event-sourcing/replay/__tests__/traceAnalyticsRollupReplay.integration.test.ts +356 -0
- package/langwatch/src/server/event-sourcing/replay/replayService.ts +7 -0
- package/langwatch/src/server/event-sourcing/services/queues/__tests__/queueManager.commandGroupKey.test.ts +114 -2
- package/langwatch/src/server/event-sourcing/services/queues/queueManager.ts +13 -9
- package/langwatch/src/server/experiments-v3/execution/__tests__/buildTargetMetadata.unit.test.ts +93 -0
- package/langwatch/src/server/experiments-v3/execution/__tests__/orchestratorStorageDispatch.unit.test.ts +57 -0
- package/langwatch/src/server/experiments-v3/execution/__tests__/resultMapper.test.ts +180 -13
- package/langwatch/src/server/experiments-v3/execution/orchestrator.ts +40 -8
- package/langwatch/src/server/experiments-v3/execution/resultMapper.ts +81 -22
- package/langwatch/src/server/experiments-v3/execution/types.ts +8 -0
- package/langwatch/src/server/export/scenario-runs/__tests__/csv-serializer.unit.test.ts +732 -0
- package/langwatch/src/server/export/scenario-runs/__tests__/scenario-run-export.service.unit.test.ts +303 -0
- package/langwatch/src/server/export/scenario-runs/csv-serializer.ts +383 -0
- package/langwatch/src/server/export/scenario-runs/errors.ts +44 -0
- package/langwatch/src/server/export/scenario-runs/scenario-run-export.service.ts +200 -0
- package/langwatch/src/server/export/scenario-runs/types.ts +64 -0
- package/langwatch/src/server/featureFlag/frontendFeatureFlags.ts +4 -0
- package/langwatch/src/server/featureFlag/registry.ts +7 -0
- package/langwatch/src/server/gateway/virtualKey.service.ts +2 -2
- package/langwatch/src/server/license-enforcement/__tests__/constants.unit.test.ts +2 -10
- package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.integration.test.ts +17 -194
- package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.unit.test.ts +3 -301
- package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.service.unit.test.ts +51 -137
- package/langwatch/src/server/license-enforcement/__tests__/license-limit-guard.unit.test.ts +46 -13
- package/langwatch/src/server/license-enforcement/__tests__/usage-stats.service.unit.test.ts +1 -3
- package/langwatch/src/server/license-enforcement/constants.ts +0 -26
- package/langwatch/src/server/license-enforcement/index.ts +0 -5
- package/langwatch/src/server/license-enforcement/license-enforcement.repository.ts +4 -227
- package/langwatch/src/server/license-enforcement/license-enforcement.service.ts +0 -52
- package/langwatch/src/server/license-enforcement/types.ts +8 -17
- package/langwatch/src/server/license-enforcement/usage-stats.service.ts +0 -32
- package/langwatch/src/server/modelProviders/__tests__/governanceSignup.providerScope.integration.test.ts +1 -1
- package/langwatch/src/server/rbac/__tests__/apiKeyCeilingStaleness.unit.test.ts +5 -0
- package/langwatch/src/server/rbac/__tests__/role-binding-resolver.ceiling.unit.test.ts +108 -3
- package/langwatch/src/server/rbac/role-binding-resolver.ts +147 -1
- package/langwatch/src/server/role/__tests__/role-service-rolebinding.unit.test.ts +2 -0
- package/langwatch/src/server/role/role.service.ts +15 -1
- package/langwatch/src/server/role-bindings/__tests__/role-binding.service.tenant.unit.test.ts +2 -0
- package/langwatch/src/server/role-bindings/personal-team-scope.ts +105 -0
- package/langwatch/src/server/role-bindings/role-binding.service.ts +10 -2
- package/langwatch/src/server/routes/__tests__/github-langy-install.integration.test.ts +1 -1
- package/langwatch/src/server/routes/auth.ts +6 -1
- package/langwatch/src/server/routes/github-langy.ts +1 -1
- package/langwatch/src/server/scenarios/__tests__/scenario-archive.integration.test.ts +11 -15
- package/langwatch/src/server/scenarios/scenario-run-category.ts +48 -0
- package/langwatch/src/server/stored-objects/__tests__/coerce-content-to-array.unit.test.ts +0 -0
- package/langwatch/src/server/stored-objects/__tests__/scenario-events-ingest.integration.test.ts +2 -6
- package/langwatch/src/server/teams/team.service.ts +14 -1
- package/langwatch/src/server/tracer/types.ts +3 -0
- package/langwatch/src/server/traces/__tests__/trace-service-claude-enrichment.unit.test.ts +85 -0
- package/langwatch/src/server/traces/mappers/__tests__/trace-summary.mapper.test.ts +106 -0
- package/langwatch/src/server/traces/mappers/trace-summary.mapper.ts +59 -0
- package/langwatch/src/server/traces/projection/catalog.ts +3 -0
- package/langwatch/src/server/traces/trace.service.ts +21 -1
- package/langwatch/src/server/workers/__tests__/livenessThread.unit.test.ts +133 -0
- package/langwatch/src/server/workers/startWorkers.ts +250 -29
- package/langwatch/src/utils/__tests__/api.unit.test.ts +15 -15
- package/langwatch/src/utils/constants.ts +1 -0
- package/langwatch/src/utils/lambdaFetch.ts +0 -0
- package/langwatch/test-setup.ts +9 -0
- package/mcp-server/dist/chunk-FMQIE5DL.js +2328 -0
- package/mcp-server/dist/create-mcp-server.js +1 -1
- package/mcp-server/dist/discover-evaluator-schema-HYPFWGNN.js +2191 -0
- package/mcp-server/dist/http-server-UBX7YFXE.js +24466 -0
- package/mcp-server/dist/index.js +49 -33
- package/package.json +1 -1
- package/packages/server/dist/cli.cjs +1 -1
- package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-BeOD83jA.js +0 -2
- package/langwatch/dist/client/assets/AddDatasetRecordDrawer-jHTYLVuB.js +0 -6
- package/langwatch/dist/client/assets/AddOrEditAnnotationScore-DW5VXwj8.js +0 -2
- package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-6ycw-4n0.js +0 -2
- package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-DKQT3n1Q.js +0 -3
- package/langwatch/dist/client/assets/AddParticipants-7HKlJHjI.js +0 -2
- package/langwatch/dist/client/assets/AgentHistoryDrawer-B1kjJyfj.js +0 -2
- package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Dkex2eS8.js +0 -5
- package/langwatch/dist/client/assets/AgentListDrawer-B-ab-fJ_.js +0 -2
- package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-CBUwY7Q0.js +0 -2
- package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-DZr-iX29.js +0 -2
- package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-C1AYXbvP.js +0 -2
- package/langwatch/dist/client/assets/AiGatewayLayout-BFUOyL-l.js +0 -2
- package/langwatch/dist/client/assets/AnnotationsTable-CnwGxhJg.js +0 -2
- package/langwatch/dist/client/assets/AreaChart-BZjKjRMD.js +0 -2
- package/langwatch/dist/client/assets/AutomationDrawer-BTtX7UXo.js +0 -112
- package/langwatch/dist/client/assets/BatchEvaluationSummary-CFBL50E9.js +0 -2
- package/langwatch/dist/client/assets/BudgetEditDrawer-DhNs7V2e.js +0 -2
- package/langwatch/dist/client/assets/CartesianChart-CgGSWzzH.js +0 -54
- package/langwatch/dist/client/assets/CascadeArchiveDialog-BOcl2osO.js +0 -2
- package/langwatch/dist/client/assets/ChartTooltip-BKs8as3o.js +0 -4
- package/langwatch/dist/client/assets/ChatWindow-B-UHoZDM.js +0 -5
- package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-jdmrD4H5.js +0 -9
- package/langwatch/dist/client/assets/CodexCodingDefaultsAsk-CKLyE8Ty.js +0 -2
- package/langwatch/dist/client/assets/ColorfulBlockIcons-Ctm_Gy50.js +0 -6
- package/langwatch/dist/client/assets/ColumnTypeIcon-Bh1MI0_N.js +0 -2
- package/langwatch/dist/client/assets/ConfirmDialog-CbyD4lof.js +0 -2
- package/langwatch/dist/client/assets/ContactSalesBlock-3LFiXNMY.js +0 -2
- package/langwatch/dist/client/assets/Conversation-C27uRW0p.js +0 -2
- package/langwatch/dist/client/assets/CopyInput-BJ8UDgiW.js +0 -2
- package/langwatch/dist/client/assets/CopyableInputWithPrefix-DhfQEE7R.js +0 -2
- package/langwatch/dist/client/assets/CreateProjectDrawer-f6ESIihF.js +0 -2
- package/langwatch/dist/client/assets/CreateTeamDrawer-CsScDzr3.js +0 -2
- package/langwatch/dist/client/assets/CustomGraph-DOp8hQmM.js +0 -2
- package/langwatch/dist/client/assets/DashboardLayout-BhHe0vIT.js +0 -96
- package/langwatch/dist/client/assets/DashboardNameDrawer-WriiQpWZ.js +0 -2
- package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-BWcEQSs7.js +0 -2
- package/langwatch/dist/client/assets/DatasetEditorTable-BLbB_Sn-.js +0 -2
- package/langwatch/dist/client/assets/DatasetPickerList-CDIBTAQW.js +0 -2
- package/langwatch/dist/client/assets/DatasetPreviewTable-UuBrd6hv.js +0 -2
- package/langwatch/dist/client/assets/DatasetSelector-DJI4ZOko.js +0 -2
- package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-DfGbPivl.js +0 -2
- package/langwatch/dist/client/assets/DeleteConfirmationDialog-w7WZ7lHP.js +0 -2
- package/langwatch/dist/client/assets/DocsLinks-vsvIA7dY.js +0 -2
- package/langwatch/dist/client/assets/DynamicZodForm-lW0sHL84.js +0 -2
- package/langwatch/dist/client/assets/EditAutomationFilterDrawer-UZGlf7Jf.js +0 -3
- package/langwatch/dist/client/assets/EditModelProviderDrawer-FxE8Cjfj.js +0 -4
- package/langwatch/dist/client/assets/EditProjectDrawer-DvGgMwQg.js +0 -2
- package/langwatch/dist/client/assets/EmojiPickerModal-DOTbYgFl.js +0 -3
- package/langwatch/dist/client/assets/EnterpriseLockedSurface-CM8Sj7hf.js +0 -2
- package/langwatch/dist/client/assets/ErrorBarContext-Bpz3-JDH.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Bnv6z6m_.js +0 -107
- package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-DPt4B9Ey.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorEditorDrawer-C1OQ89no.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorEditorShared-Dlnmyfw9.js +0 -43
- package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-BFqreRNY.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorListDrawer-B5GkvEER.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorMappingsSection-uZ95zEz_.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorSelection-CLClnlPT.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorSelectionBox-VWh5DBap.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BTrBItgE.js +0 -2
- package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-0T-zwQQZ.js +0 -2
- package/langwatch/dist/client/assets/ExecutionState-BPNxLkdI.js +0 -2
- package/langwatch/dist/client/assets/FeatureFlagsDrawer-CpSauosT.js +0 -2
- package/langwatch/dist/client/assets/FieldInfoTooltip-BlO6fteF.js +0 -2
- package/langwatch/dist/client/assets/FieldsFilters-B46wbf2n.js +0 -2
- package/langwatch/dist/client/assets/FilterDisplay-BzhnJIar.js +0 -2
- package/langwatch/dist/client/assets/FilterSidebar-CbZF27X2.js +0 -2
- package/langwatch/dist/client/assets/FormatMoney-vCZvmGG1.js +0 -2
- package/langwatch/dist/client/assets/FoundryDrawer-DskBXiS5.js +0 -2
- package/langwatch/dist/client/assets/FullLogo-Db9M_uOO.js +0 -2
- package/langwatch/dist/client/assets/GovernanceLayout-DiDbO74a.js +0 -2
- package/langwatch/dist/client/assets/GraphsLayout-BCvqg3RK.js +0 -2
- package/langwatch/dist/client/assets/GroupBindingInputRow-DQP7aETW.js +0 -2
- package/langwatch/dist/client/assets/GuardrailsDrawer-CHV6LBxp.js +0 -91
- package/langwatch/dist/client/assets/History-hXXVv0A2.js +0 -17
- package/langwatch/dist/client/assets/HorizontalFormControl-lYiaIlzD.js +0 -2
- package/langwatch/dist/client/assets/HoverableBigText-CIhevUVt.js +0 -2
- package/langwatch/dist/client/assets/InstallCliCard-CJKSPLJ_.js +0 -2
- package/langwatch/dist/client/assets/IntegratePaneShell-BpcA5j4P.js +0 -8
- package/langwatch/dist/client/assets/InviteMemberDrawer-DiuPqGoS.js +0 -2
- package/langwatch/dist/client/assets/IsolatedErrorBoundary-CZ4MnYEN.js +0 -2
- package/langwatch/dist/client/assets/LLMModelCostDrawer-D1G0lU1N.js +0 -2
- package/langwatch/dist/client/assets/LangyContextTarget-CIlp_Zew.js +0 -2
- package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-Cd0jbm0t.js +0 -2
- package/langwatch/dist/client/assets/Legend-DY68SncN.js +0 -6
- package/langwatch/dist/client/assets/Line-B2wakHWw.js +0 -2
- package/langwatch/dist/client/assets/LineChart-Bb84FSVR.js +0 -2
- package/langwatch/dist/client/assets/ListTable-8idtTXBY.js +0 -2
- package/langwatch/dist/client/assets/LoadingScreen-DQ62wqSN.js +0 -2
- package/langwatch/dist/client/assets/Markdown-C9extmbX.js +0 -35
- package/langwatch/dist/client/assets/MenuLink-CVzOs3K8.js +0 -2
- package/langwatch/dist/client/assets/MessageCard--GCYkR2M.js +0 -2
- package/langwatch/dist/client/assets/MetadataTag-CSCPlbDN.js +0 -5
- package/langwatch/dist/client/assets/ModelProviderCustomModelInput-DUwvNeux.js +0 -2
- package/langwatch/dist/client/assets/ModelProviderScreen-BVBKstQm.js +0 -2
- package/langwatch/dist/client/assets/ModelSelector-4R-dc-Ny.js +0 -2
- package/langwatch/dist/client/assets/MyLayout-DCMYTSgX.js +0 -2
- package/langwatch/dist/client/assets/NavigationFooter-1VNOUoV6.js +0 -2
- package/langwatch/dist/client/assets/NewWorkflowForm-CsYSc1Vr.js +0 -2
- package/langwatch/dist/client/assets/NoDataInfoBlock-C8x5bzL0.js +0 -2
- package/langwatch/dist/client/assets/OnboardingContainer-e4kVlnyx.js +0 -2
- package/langwatch/dist/client/assets/OnlineEvaluationDrawer-D2jYsSON.js +0 -2
- package/langwatch/dist/client/assets/OpsPageShell-Ch1rtwuD.js +0 -2
- package/langwatch/dist/client/assets/OttlEditor-baChQv3o.js +0 -3
- package/langwatch/dist/client/assets/OverflownText-CY4Y__oL.js +0 -2
- package/langwatch/dist/client/assets/ProjectAvatar-DtI9dT1f.js +0 -43
- package/langwatch/dist/client/assets/ProjectLangyLayout-Cl7GB9zi.js +0 -82
- package/langwatch/dist/client/assets/PromptEditorDrawer-BLIu4fKV.js +0 -2
- package/langwatch/dist/client/assets/PromptListDrawer-BHC9jUMJ.js +0 -2
- package/langwatch/dist/client/assets/PropertySectionTitle-Da2IdhM3.js +0 -37
- package/langwatch/dist/client/assets/ProviderModelSelector-Cg5Lbc1U.js +0 -2
- package/langwatch/dist/client/assets/ProviderScopeChips-D7HJW6Ht.js +0 -2
- package/langwatch/dist/client/assets/PushToCopiesDialog-B_hvn6aW.js +0 -2
- package/langwatch/dist/client/assets/ReferenceDot-DbjBc6Dh.js +0 -2
- package/langwatch/dist/client/assets/RenderInputOutput-BntIB-Ae.js +0 -261
- package/langwatch/dist/client/assets/ScenarioFormDrawer-BORe6ffA.js +0 -2
- package/langwatch/dist/client/assets/ScenarioInputMappingSection-DVpK_-Qh.js +0 -2
- package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-MJhw77cs.js +0 -3
- package/langwatch/dist/client/assets/ScopeChipPicker-B3xHf0Ii.js +0 -2
- package/langwatch/dist/client/assets/SearchInput-C7YbWRUQ.js +0 -2
- package/langwatch/dist/client/assets/SectionNavigationLayout-CIP_2Nxf.js +0 -2
- package/langwatch/dist/client/assets/SelectDatasetDrawer-D_nCx9JT.js +0 -2
- package/langwatch/dist/client/assets/SelectionActionBar-fxhOYCmO.js +0 -2
- package/langwatch/dist/client/assets/SeriesFilterDrawer-zoWjjTxC.js +0 -2
- package/langwatch/dist/client/assets/SettingsLayout-sixsNIX_.js +0 -2
- package/langwatch/dist/client/assets/SetupWithAgentButton-Bhxb1yOj.js +0 -4
- package/langwatch/dist/client/assets/ShikiCommandBox-CN1W-H2m.js +0 -5
- package/langwatch/dist/client/assets/SpanDetails-DavcMtlr.js +0 -3
- package/langwatch/dist/client/assets/SubscriptionPage-gPKGn08f.js +0 -2
- package/langwatch/dist/client/assets/SuiteFormDrawer-C_5urLUY.js +0 -2
- package/langwatch/dist/client/assets/TabButton-Cp8UA45p.js +0 -3
- package/langwatch/dist/client/assets/TableCell-Cbtwk2YR.js +0 -2
- package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-B0xHR5hC.js +0 -2
- package/langwatch/dist/client/assets/TeamForm-DvN0gccP.js +0 -2
- package/langwatch/dist/client/assets/TeamUserRoleField-DD6lt16j.js +0 -2
- package/langwatch/dist/client/assets/TraceDetails-DZtIKcmo.js +0 -9
- package/langwatch/dist/client/assets/TraceDetailsDrawer-DKgyPTw5.js +0 -2
- package/langwatch/dist/client/assets/TraceIdPeek-7T88rBev.js +0 -2
- package/langwatch/dist/client/assets/TracesMapping-CYIUxk62.js +0 -2
- package/langwatch/dist/client/assets/UpgradeModalContent-eXy8pG4-.js +0 -2
- package/langwatch/dist/client/assets/UploadCSVDrawer-BTttuVHZ.js +0 -3
- package/langwatch/dist/client/assets/VariablesSection-hjZ5pmeK.js +0 -2
- package/langwatch/dist/client/assets/VersionBadge-BPxGh4w7.js +0 -2
- package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9EYtw_g.js +0 -1161
- package/langwatch/dist/client/assets/ViewAutomationDrawer-H_lJU8lG.js +0 -2
- package/langwatch/dist/client/assets/VirtualKeySecretReveal-5GeVsP9d.js +0 -54
- package/langwatch/dist/client/assets/WelcomeLayout-CDTLOa4d.js +0 -2
- package/langwatch/dist/client/assets/WithFeatureFlagGuard-OePuXWRG.js +0 -2
- package/langwatch/dist/client/assets/WithPermissionGuard-Cr6Aljmy.js +0 -2
- package/langwatch/dist/client/assets/WorkflowCard-SFB2TN6O.js +0 -2
- package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-C9JwDruB.js +0 -2
- package/langwatch/dist/client/assets/_...path_-Cgdgmf5W.js +0 -2
- package/langwatch/dist/client/assets/_Uint8Array-DZ50H-2q.js +0 -2
- package/langwatch/dist/client/assets/__...path__-CwRP2Csi.js +0 -22
- package/langwatch/dist/client/assets/_baseAssignValue-BqKt0w0a.js +0 -2
- package/langwatch/dist/client/assets/_baseClone-DCKy3Vq2.js +0 -2
- package/langwatch/dist/client/assets/_baseEach-BGeacxUS.js +0 -2
- package/langwatch/dist/client/assets/_baseFor-BQgMStOx.js +0 -2
- package/langwatch/dist/client/assets/_experiment_-UwR3aJGK.js +0 -2
- package/langwatch/dist/client/assets/_id_-7nn1sxUS.js +0 -2
- package/langwatch/dist/client/assets/_id_-BGN_cxTM.js +0 -2
- package/langwatch/dist/client/assets/_id_-C39KWPCF.js +0 -2
- package/langwatch/dist/client/assets/_id_-CLpZ89Xl.js +0 -2
- package/langwatch/dist/client/assets/_id_-CYndCW2V.js +0 -2
- package/langwatch/dist/client/assets/_id_-CfWpUbg4.js +0 -2
- package/langwatch/dist/client/assets/_id_-npXkLrUc.js +0 -2
- package/langwatch/dist/client/assets/_project_-B7G8spwK.js +0 -8
- package/langwatch/dist/client/assets/_runId_-BSik_ZD4.js +0 -7
- package/langwatch/dist/client/assets/_shell-BGaZUKLi.js +0 -2
- package/langwatch/dist/client/assets/_slug_-BN6BJfW8.js +0 -17
- package/langwatch/dist/client/assets/_slug_-C7DGk6aN.js +0 -2
- package/langwatch/dist/client/assets/_slug_-DOlOZ10W.js +0 -2
- package/langwatch/dist/client/assets/_team_-B9rXOt0D.js +0 -2
- package/langwatch/dist/client/assets/_workflow_-BJIdrL-L.js +0 -25
- package/langwatch/dist/client/assets/_workflow_-BKcndaRn.js +0 -3
- package/langwatch/dist/client/assets/accept-CSdmIcux.js +0 -2
- package/langwatch/dist/client/assets/activity-QICCt22J.js +0 -1
- package/langwatch/dist/client/assets/agents--fK5G7M5.js +0 -2
- package/langwatch/dist/client/assets/alerts-QICCt22J.js +0 -1
- package/langwatch/dist/client/assets/all-yOqzcthm.js +0 -2
- package/langwatch/dist/client/assets/analytics-CjMLTwIY.js +0 -2
- package/langwatch/dist/client/assets/annotation-scores-sPTr7fKF.js +0 -2
- package/langwatch/dist/client/assets/annotations-Ye3ttmrc.js +0 -2
- package/langwatch/dist/client/assets/anomaly-rules-DwSc-85q.js +0 -2
- package/langwatch/dist/client/assets/api-keys-CKyHUAXs.js +0 -4
- package/langwatch/dist/client/assets/asaplangy-6A4CIIRR.js +0 -5
- package/langwatch/dist/client/assets/audit-log-DQ9_D13G.js +0 -2
- package/langwatch/dist/client/assets/auth-CHp-bSLm.js +0 -2
- package/langwatch/dist/client/assets/authentication-CktawfTg.js +0 -2
- package/langwatch/dist/client/assets/authorize-BSFPddoX.js +0 -2
- package/langwatch/dist/client/assets/authorize-YWRIgnuS.js +0 -2
- package/langwatch/dist/client/assets/automations-CI-QD_zf.js +0 -2
- package/langwatch/dist/client/assets/automations-QICCt22J.js +0 -1
- package/langwatch/dist/client/assets/billing-plans-DUVLJ_Sk.js +0 -2
- package/langwatch/dist/client/assets/blank-CqHTkVM2.js +0 -2
- package/langwatch/dist/client/assets/blobs-B_lHV3eu.js +0 -2
- package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CQSMftlX.js +0 -133
- package/langwatch/dist/client/assets/budgets-D0yk2zkk.js +0 -3
- package/langwatch/dist/client/assets/bug-reports-D48JQaYJ.js +0 -2
- package/langwatch/dist/client/assets/cache-rules-BLbEe56I.js +0 -2
- package/langwatch/dist/client/assets/choose-CR8H5_AF.js +0 -2
- package/langwatch/dist/client/assets/chunk-EX3LRPZG-CULySKMF.js +0 -232
- package/langwatch/dist/client/assets/chunk-FWX5IMBZ-vsHlz4qh.js +0 -3
- package/langwatch/dist/client/assets/chunk-PUDLZKDR-ByJfzd90.js +0 -157
- package/langwatch/dist/client/assets/chunk-RYQCIY6F-DW5yDiZP.js +0 -2
- package/langwatch/dist/client/assets/chunk-V7JOEXUC-rGVlZXkP.js +0 -207
- package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-DjpCOWYp.js +0 -2
- package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-DjpCOWYp.js +0 -2
- package/langwatch/dist/client/assets/codeAgentConfig-DlJOMg8p.js +0 -7
- package/langwatch/dist/client/assets/codingDefaultSync-C3S2VHmn.js +0 -2
- package/langwatch/dist/client/assets/configure-BPQgl6jf.js +0 -4
- package/langwatch/dist/client/assets/constants-Bb5Vi_Bd.js +0 -2
- package/langwatch/dist/client/assets/custom-D79e_fnJ.js +0 -12
- package/langwatch/dist/client/assets/custom_evaluator-DgcItmbH.js +0 -31
- package/langwatch/dist/client/assets/dagre-BqI7WPId.js +0 -2
- package/langwatch/dist/client/assets/dagre-VKFMJZFB-BJj7ndf9.js +0 -5
- package/langwatch/dist/client/assets/data-privacy-BuolZ3DI.js +0 -2
- package/langwatch/dist/client/assets/data-retention-yWQxxUQF.js +0 -2
- package/langwatch/dist/client/assets/datasets-u_OgZHiv.js +0 -2
- package/langwatch/dist/client/assets/debounce-BJsF8wQY.js +0 -2
- package/langwatch/dist/client/assets/defaultModelState-DY_b79Yj.js +0 -2
- package/langwatch/dist/client/assets/dejaview-DSjI4vi2.js +0 -2
- package/langwatch/dist/client/assets/departments-C3oaBPyA.js +0 -2
- package/langwatch/dist/client/assets/devices-O_ZVZdxA.js +0 -2
- package/langwatch/dist/client/assets/dist-Dd3SzC15.js +0 -6
- package/langwatch/dist/client/assets/drawerFromUrl-DaNSDEzf.js +0 -2
- package/langwatch/dist/client/assets/edit-CswmqyLU.js +0 -62
- package/langwatch/dist/client/assets/email-suppressions-B8AuxWio.js +0 -2
- package/langwatch/dist/client/assets/erDiagram-Q63AITRT-DIiR5G9i.js +0 -86
- package/langwatch/dist/client/assets/error-nKFTkytv.js +0 -2
- package/langwatch/dist/client/assets/errors-e711UMq7.js +0 -2
- package/langwatch/dist/client/assets/evaluations-Cg9PywKJ.js +0 -2
- package/langwatch/dist/client/assets/evaluations-xuA_g6-G.js +0 -2
- package/langwatch/dist/client/assets/evaluators-6oHFfk5m.js +0 -146
- package/langwatch/dist/client/assets/evaluators-CBPI9nP9.js +0 -2
- package/langwatch/dist/client/assets/experiments-DHsdWtPG.js +0 -1
- package/langwatch/dist/client/assets/feature-flags-e-cVnxOK.js +0 -2
- package/langwatch/dist/client/assets/fetchSSE-5rVPow_l.js +0 -3
- package/langwatch/dist/client/assets/fieldset-BNLAUiqD.js +0 -2
- package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-DlrfK-aL.js +0 -1
- package/langwatch/dist/client/assets/forgot-password-B_FXHTn9.js +0 -2
- package/langwatch/dist/client/assets/formatMoney-DRwvOSzZ.js +0 -2
- package/langwatch/dist/client/assets/formatTargetOutput-CkKef3lk.js +0 -2
- package/langwatch/dist/client/assets/foundry-U39hnXil.js +0 -477
- package/langwatch/dist/client/assets/gateway-DZnsUBnP.js +0 -2
- package/langwatch/dist/client/assets/getEvaluator-irVFciCL.js +0 -2
- package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-BFtcAGI_.js +0 -2
- package/langwatch/dist/client/assets/governance-BBQIXSQ_.js +0 -2
- package/langwatch/dist/client/assets/graphlib-Bg9XziCe.js +0 -2
- package/langwatch/dist/client/assets/grid-DVy6ELOp.js +0 -2
- package/langwatch/dist/client/assets/groups-DYnJ4U2W.js +0 -2
- package/langwatch/dist/client/assets/guardrails-DdKPd-Zs.js +0 -2
- package/langwatch/dist/client/assets/handled-error-CI7XXA3n.js +0 -2
- package/langwatch/dist/client/assets/http-DSF_1QKT.js +0 -7
- package/langwatch/dist/client/assets/identifierUtils-B50FmQLB.js +0 -2
- package/langwatch/dist/client/assets/immer-CFru3D02.js +0 -14
- package/langwatch/dist/client/assets/index-CPtTUYLD.js +0 -68
- package/langwatch/dist/client/assets/ingestion-source-detail-BLfzu5Yv.js +0 -19
- package/langwatch/dist/client/assets/ingestion-sources-BcwE_tRu.js +0 -12
- package/langwatch/dist/client/assets/integrations-D220c59Q.js +0 -2
- package/langwatch/dist/client/assets/isArrayLikeObject-DUy1V36n.js +0 -2
- package/langwatch/dist/client/assets/isSymbol-COuSxi_J.js +0 -2
- package/langwatch/dist/client/assets/langyHomeSuggestions-6NtCcdnH.js +0 -2
- package/langwatch/dist/client/assets/license-Be6bs3wD.js +0 -2
- package/langwatch/dist/client/assets/licenseStatusUtils-YSS0xL-G.js +0 -2
- package/langwatch/dist/client/assets/lu-DlSq9Be4.js +0 -2
- package/langwatch/dist/client/assets/map-7tkBBrDN.js +0 -2
- package/langwatch/dist/client/assets/mappingValidation-C-AT88B0.js +0 -2
- package/langwatch/dist/client/assets/me-BHRwGQAJ.js +0 -7
- package/langwatch/dist/client/assets/me-DyaTjlbw.js +0 -2
- package/langwatch/dist/client/assets/members-Dn5oJBlv.js +0 -2
- package/langwatch/dist/client/assets/mermaid.core-krP_t-L5.js +0 -12
- package/langwatch/dist/client/assets/messages-CN1bd906.js +0 -2
- package/langwatch/dist/client/assets/metrics-Do8QhcIC.js +0 -2
- package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-DBef2D4I.js +0 -97
- package/langwatch/dist/client/assets/model-costs-D6eiVgIz.js +0 -2
- package/langwatch/dist/client/assets/model-providers-CiSkvGtd.js +0 -2
- package/langwatch/dist/client/assets/modelProviderHelpers-P2Cogc-H.js +0 -2
- package/langwatch/dist/client/assets/my-queue-D1aRcnMh.js +0 -2
- package/langwatch/dist/client/assets/normalizeComparison-BY-r_dYf.js +0 -2
- package/langwatch/dist/client/assets/not-found-BiyummjJ.js +0 -2
- package/langwatch/dist/client/assets/now-flOUcolU.js +0 -2
- package/langwatch/dist/client/assets/onboarding-D3dMDvS6.js +0 -2
- package/langwatch/dist/client/assets/online-evaluations-Dk2ygUi2.js +0 -2
- package/langwatch/dist/client/assets/ops-Djcw5_lX.js +0 -2
- package/langwatch/dist/client/assets/organizations-F6Q6gYJ3.js +0 -2
- package/langwatch/dist/client/assets/pages-BXwixFEM.js +0 -2
- package/langwatch/dist/client/assets/persistence-DZOtzFnQ.js +0 -2
- package/langwatch/dist/client/assets/personalProject-DMRX2-SI.js +0 -2
- package/langwatch/dist/client/assets/plans-C_VYB2VX.js +0 -2
- package/langwatch/dist/client/assets/preconditionFieldUtils-B7QfymK4.js +0 -2
- package/langwatch/dist/client/assets/product-D0RNZ3Ls.js +0 -2
- package/langwatch/dist/client/assets/project-ZTQzA2gY.js +0 -2
- package/langwatch/dist/client/assets/projections-DocSauqq.js +0 -2
- package/langwatch/dist/client/assets/projects-ClyGKBO9.js +0 -2
- package/langwatch/dist/client/assets/promptHandle-Cen_6YRW.js +0 -2
- package/langwatch/dist/client/assets/prompts-CLb2R5Fd.js +0 -8
- package/langwatch/dist/client/assets/radio-group-CWz2nJi3.js +0 -2
- package/langwatch/dist/client/assets/registry-B64xvGV5.js +0 -2
- package/langwatch/dist/client/assets/reports-C-XbHSdJ.js +0 -2
- package/langwatch/dist/client/assets/request-C3Wgq2B3.js +0 -2
- package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-9g84jNsR.js +0 -85
- package/langwatch/dist/client/assets/reset-password-ohopJtIH.js +0 -2
- package/langwatch/dist/client/assets/role-bindings-BQ31P1EO.js +0 -2
- package/langwatch/dist/client/assets/roles-CQDx2TP6.js +0 -2
- package/langwatch/dist/client/assets/routing-policies-uvNo9gfx.js +0 -5
- package/langwatch/dist/client/assets/scenarios-CpA_eExG.js +0 -2
- package/langwatch/dist/client/assets/scheduler-CgzNzJjP.js +0 -2
- package/langwatch/dist/client/assets/schedules-QICCt22J.js +0 -1
- package/langwatch/dist/client/assets/scim-BivWilDe.js +0 -2
- package/langwatch/dist/client/assets/secrets-Dp2ang1r.js +0 -2
- package/langwatch/dist/client/assets/segment-group-DQ4SkpwM.js +0 -2
- package/langwatch/dist/client/assets/segmented-control-BNxU6DEN.js +0 -2
- package/langwatch/dist/client/assets/select-D17PWjH9.js +0 -2
- package/langwatch/dist/client/assets/send-Dd5105kW.js +0 -2
- package/langwatch/dist/client/assets/sequenceView-FFm7w152.js +0 -5
- package/langwatch/dist/client/assets/seriesOptions-CDRg_FIS.js +0 -1015
- package/langwatch/dist/client/assets/settings-aFAaBCpo.js +0 -2
- package/langwatch/dist/client/assets/setup-BqCpBMpq.js +0 -2
- package/langwatch/dist/client/assets/shikiAdapter-CbWAxLvq.js +0 -3
- package/langwatch/dist/client/assets/showSuiteRunError-B2iiQdeh.js +0 -2
- package/langwatch/dist/client/assets/signin-C6AzSXTw.js +0 -2
- package/langwatch/dist/client/assets/signup-Co9SguQP.js +0 -2
- package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-CDfCuyr-.js +0 -2
- package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-mNUL4OCz.js +0 -2
- package/langwatch/dist/client/assets/subscription-BYrIJoC0.js +0 -3
- package/langwatch/dist/client/assets/subscriptions-CrupW2oH.js +0 -2
- package/langwatch/dist/client/assets/suggestionUI-0NFK2m-V.js +0 -106
- package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-aY42sUsR.js +0 -3
- package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-BQgl3Mwz.js +0 -9
- package/langwatch/dist/client/assets/switch-DGatWO8v.js +0 -2
- package/langwatch/dist/client/assets/switch-mtnuJtgJ.js +0 -2
- package/langwatch/dist/client/assets/tabs-U8n5D55_.js +0 -2
- package/langwatch/dist/client/assets/teams-CMzKSSEB.js +0 -2
- package/langwatch/dist/client/assets/teams-DBNLpvFi.js +0 -2
- package/langwatch/dist/client/assets/tool-catalog-DgWWHys3.js +0 -7
- package/langwatch/dist/client/assets/toolIcons-DmISNQ_S.js +0 -2
- package/langwatch/dist/client/assets/tooltip-gjZ4s2dt.js +0 -2
- package/langwatch/dist/client/assets/topic-clustering-wc06nKYO.js +0 -2
- package/langwatch/dist/client/assets/topics-DbjuJKH7.js +0 -2
- package/langwatch/dist/client/assets/traceStore-By6b3pBZ.js +0 -55
- package/langwatch/dist/client/assets/traces-DjQaBgiE.js +0 -289
- package/langwatch/dist/client/assets/tracesMapping-DpjIOyAg.js +0 -3
- package/langwatch/dist/client/assets/tracking-D4oUOPlm.js +0 -2
- package/langwatch/dist/client/assets/types-CCALFpCT.js +0 -2
- package/langwatch/dist/client/assets/types-DfJmP3wn.js +0 -2
- package/langwatch/dist/client/assets/types-X7bcC-zw.js +0 -2
- package/langwatch/dist/client/assets/usage-B3fH-bNu.js +0 -2
- package/langwatch/dist/client/assets/usage-YeRzOlEs.js +0 -2
- package/langwatch/dist/client/assets/use-generic-onboarding-flow-DZY28ya2.js +0 -2
- package/langwatch/dist/client/assets/useActivePlan-fRQ_etI2.js +0 -2
- package/langwatch/dist/client/assets/useAllPromptsForProject-DCZJ0_-p.js +0 -2
- package/langwatch/dist/client/assets/useAnnotationQueues-ByLqaEs6.js +0 -2
- package/langwatch/dist/client/assets/useAvailableEvaluators-BKFN_L8t.js +0 -2
- package/langwatch/dist/client/assets/useCompoundLicenseCheck-BqNF-zzC.js +0 -2
- package/langwatch/dist/client/assets/useCyclingVerb-DSHVFfHS.js +0 -2
- package/langwatch/dist/client/assets/useDepartmentColumn-D1DF_PiG.js +0 -2
- package/langwatch/dist/client/assets/useEvaluationsV3Store-Bc6Q5CKo.js +0 -2
- package/langwatch/dist/client/assets/useExportTraces-BqLmfd8N.js +0 -2
- package/langwatch/dist/client/assets/useFeatureFlag-Do1Ecu3l.js +0 -2
- package/langwatch/dist/client/assets/useInviteActions-DwPlKWmS.js +0 -2
- package/langwatch/dist/client/assets/useLicenseEnforcement-DOI0dcqD.js +0 -2
- package/langwatch/dist/client/assets/usePersonalContext-CggG6KVI.js +0 -2
- package/langwatch/dist/client/assets/useProjectSpanNames-jFO9A6Re.js +0 -2
- package/langwatch/dist/client/assets/useProjectsForCopy-B8F_BY79.js +0 -2
- package/langwatch/dist/client/assets/useRunViaApiTabs-Cr0_nbbp.js +0 -50
- package/langwatch/dist/client/assets/useShowLangy-kmjRxLHs.js +0 -2
- package/langwatch/dist/client/assets/useSimulationUpdateListener-BQB61L8b.js +0 -2
- package/langwatch/dist/client/assets/useTargetName-nPyk8kf-.js +0 -2
- package/langwatch/dist/client/assets/useTargetNameMap-C2bPHyhD.js +0 -2
- package/langwatch/dist/client/assets/useTraceDetailsDrawer-CL82mHNA.js +0 -2
- package/langwatch/dist/client/assets/useTraceUpdateListener-r6BQdcuk.js +0 -2
- package/langwatch/dist/client/assets/useUrlScopeFilter-DFlXMn0U.js +0 -2
- package/langwatch/dist/client/assets/useWorkflowStore-DGHQA8ai.js +0 -8
- package/langwatch/dist/client/assets/users-D5W8Qjjj.js +0 -2
- package/langwatch/dist/client/assets/users-DFyHT5UO.js +0 -2
- package/langwatch/dist/client/assets/users-rKylpyh9.js +0 -2
- package/langwatch/dist/client/assets/v3-NB4P-Pc3.js +0 -2
- package/langwatch/dist/client/assets/variables-DF2_abiB.js +0 -396
- package/langwatch/dist/client/assets/viewStore-DtvCfAUF.js +0 -2
- package/langwatch/dist/client/assets/virtual-keys-DW1kPrjW.js +0 -2
- package/langwatch/dist/client/assets/welcome-DJsfSWej.js +0 -16
- package/langwatch/dist/client/assets/wizard-D2X_QMNx.js +0 -2
- package/langwatch/dist/client/assets/workbench-fZ1KK4fN.js +0 -2
- package/langwatch/dist/client/assets/workflows-CY65pvqY.js +0 -3
- package/langwatch/dist/client/assets/wrap-DlWOPhPw.js +0 -2
- package/langwatch/src/app/api/middleware/__tests__/resource-limit-enforcement.integration.test.ts +0 -278
- package/langwatch/src/app/api/middleware/__tests__/resource-limit.unit.test.ts +0 -299
- package/langwatch/src/app/api/middleware/resource-limit.ts +0 -147
- package/langwatch/src/app/api/scenario-events/[[...route]]/scenario-set-limit.ts +0 -54
- package/langwatch/src/app/api/scenario-events/__tests__/scenario-set-limit.unit.test.ts +0 -195
- package/langwatch/src/app/api/scenario-events/scenario-set-limit.stress.test.ts +0 -216
- package/langwatch/src/components/__tests__/UpgradeModal.unit.test.tsx +0 -103
- package/langwatch/src/hooks/useCompoundLicenseCheck.ts +0 -41
- package/langwatch/src/pages/api/experiment/init.stress.test.ts +0 -130
- package/langwatch/src/server/api/routers/__tests__/project.create.planLimit.integration.test.ts +0 -370
- package/langwatch/src/server/api/routers/__tests__/team.createTeamWithMembers.planLimit.integration.test.ts +0 -251
- package/langwatch/src/server/app-layer/usage/__tests__/usage-service-checkScenarioSetLimit.unit.test.ts +0 -322
- package/langwatch/src/server/app-layer/usage/errors.ts +0 -24
- package/langwatch/src/server/auditLog.ts +0 -49
- package/langwatch/src/server/better-auth/__tests__/fallbackName.test.ts +0 -141
- package/langwatch/src/server/better-auth/__tests__/parseIssuerUrl.test.ts +0 -58
- package/langwatch/src/server/better-auth/__tests__/sso.test.ts +0 -125
- package/langwatch/src/server/better-auth/sso.ts +0 -47
- package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummary.coalesce.unit.test.ts +0 -33
- package/langwatch/src/server/license-enforcement/__tests__/limit-breakdown.unit.test.ts +0 -101
- package/langwatch/src/server/license-enforcement/__tests__/personal-workspaces-excluded.integration.test.ts +0 -391
- package/langwatch/src/server/license-enforcement/enforcement.middleware.ts +0 -103
- package/langwatch/src/server/license-enforcement/limit-breakdown.ts +0 -96
- package/langwatch/src/server/routes/scim.ts +0 -583
- package/langwatch/src/server/routes/webhooks.ts +0 -168
- package/langwatch/src/server/scim/__tests__/scim-token.service.unit.test.ts +0 -109
- package/langwatch/src/server/scim/__tests__/scim.costCenter.integration.test.ts +0 -170
- package/langwatch/src/server/scim/__tests__/scim.service.unit.test.ts +0 -414
- package/langwatch/src/server/scim/scim-group.service.ts +0 -464
- package/langwatch/src/server/scim/scim-role-resolver.ts +0 -47
- package/langwatch/src/server/scim/scim-role-resolver.unit.test.ts +0 -92
- package/langwatch/src/server/scim/scim-token.service.ts +0 -70
- package/langwatch/src/server/scim/scim.service.ts +0 -553
- package/langwatch/src/server/scim/scim.types.ts +0 -148
- package/mcp-server/dist/chunk-DSB77X63.js +0 -2328
- package/mcp-server/dist/discover-evaluator-schema-OFEADIJY.js +0 -2175
- package/mcp-server/dist/http-server-YVM4PRTC.js +0 -24466
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./skeleton-0JSrjbwm.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{Yn as u}from"./ProjectAvatar-DtI9dT1f.js";import{t as d}from"./badge-Cpc3eA-C.js";import{t as f}from"./tooltip-gjZ4s2dt.js";import{n as p}from"./personalProject-DMRX2-SI.js";import{L as m,a as h,i as g,n as _}from"./seriesOptions-CDRg_FIS.js";import{t as v}from"./spacer-C38e7o6r.js";import{n as y}from"./api-l6Cnm0vQ.js";import{D as b,Vt as x,W as S,dt as C,pt as w,zn as T}from"./index-CPtTUYLD.js";import{t as E}from"./calendar-1UGS14fV.js";import{t as D}from"./FilterDisplay-BzhnJIar.js";import{t as O}from"./trending-up-CTX3qy-C.js";var k=T(),A=e(t()),j=a();function M(e,t){let n=w(t,e);if(n<1)return`${Math.max(C(t,e),1)}s`;if(n<60)return`${n}m`;let r=Math.floor(n/60),i=n%60;return i>0?`${r}h ${i}m`:`${r}h`}function N(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:null}catch{return null}}function P({automationId:e}){let{project:t}=x(),{openDrawer:n,closeDrawer:a}=S(),b=y.automation.getTriggerById.useQuery({triggerId:e,projectId:t?.id??``},{enabled:!!t?.id}),C=y.automation.getRecentFires.useQuery({triggerId:e,projectId:t?.id??``,limit:20},{enabled:!!t?.id}),w=y.automation.getWebhookDeliveries.useQuery({triggerId:e,projectId:t?.id??``,limit:50},{enabled:!!t?.id&&b.data?.action===`SEND_WEBHOOK`}),T=b.data,A=!!T?.customGraphId,M=T?.action===`SEND_WEBHOOK`,P=T?.triggerKind===k.TriggerKind.REPORT,I=T?.actionParams??{},L=y.graphs.getById.useQuery({projectId:t?.id??``,id:T?.customGraphId??``},{enabled:!!t?.id&&!!T?.customGraphId,retry:!1}),z=y.dataset.getAll.useQuery({projectId:t?.id??``},{enabled:!!t?.id&&T?.action===`ADD_TO_DATASET`}),B=I.datasetId?z.data?.find(e=>e.id===I.datasetId)?.name??null:null;return(0,j.jsx)(p.Root,{open:!0,placement:`end`,size:`md`,onOpenChange:({open:e})=>{e||a()},children:(0,j.jsxs)(p.Content,{bg:`bg`,children:[(0,j.jsxs)(p.Header,{children:[(0,j.jsx)(p.CloseTrigger,{}),(0,j.jsxs)(l,{align:`start`,gap:1,children:[b.isLoading?(0,j.jsx)(o,{height:`24px`,width:`200px`}):(0,j.jsx)(s,{size:`md`,children:T?.name??(A?`Alert`:P?`Schedule`:`Automation`)}),A?(0,j.jsxs)(d,{colorPalette:`purple`,gap:1,children:[(0,j.jsx)(O,{size:12}),`Alert`]}):P?(0,j.jsxs)(d,{colorPalette:`purple`,gap:1,children:[(0,j.jsx)(E,{size:12}),`Schedule`]}):T?(0,j.jsx)(d,{colorPalette:`gray`,children:`Automation`}):null]})]}),(0,j.jsx)(p.Body,{children:(0,j.jsxs)(l,{align:`stretch`,gap:6,children:[(0,j.jsxs)(l,{align:`start`,gap:1,children:[(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,children:`Type`}),(0,j.jsx)(c,{textStyle:`sm`,children:T?m[T.action]?.shared.label??T.action:null})]}),(0,j.jsxs)(l,{align:`start`,gap:1,children:[(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,children:`Destination`}),(()=>{if(!T)return null;switch(T.action){case`SEND_SLACK_MESSAGE`:return I.slackWebhook?(0,j.jsx)(f,{content:I.slackWebhook,children:(0,j.jsx)(c,{textStyle:`sm`,lineClamp:1,width:`fit-content`,cursor:`help`,children:`Slack webhook`})}):(0,j.jsx)(c,{textStyle:`sm`,children:`Slack webhook`});case`SEND_EMAIL`:return I.members?.length?(0,j.jsx)(c,{textStyle:`sm`,wordBreak:`break-all`,children:I.members.join(`, `)}):null;case`SEND_WEBHOOK`:{let e=`Webhook`;try{e=I.url?new URL(I.url).hostname:e}catch{}return(0,j.jsxs)(c,{textStyle:`sm`,wordBreak:`break-all`,children:[I.method??`POST`,` `,e]})}case`ADD_TO_DATASET`:return B?(0,j.jsx)(c,{textStyle:`sm`,children:B}):null;case`ADD_TO_ANNOTATION_QUEUE`:return I.annotators?.length?(0,j.jsx)(c,{textStyle:`sm`,wordBreak:`break-all`,children:I.annotators.map(e=>e.name).join(`, `)}):null;default:return null}})()??(0,j.jsx)(c,{textStyle:`sm`,children:`None`})]}),(0,j.jsxs)(l,{align:`start`,gap:1,width:`full`,children:[(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,children:`Conditions`}),(()=>{if(!T)return null;if(A){let e=I.operator?g[I.operator]:null,t=I.timePeriod?h[I.timePeriod]:null;return(0,j.jsxs)(c,{textStyle:`sm`,children:[I.seriesName?_(L.data?.graph,I.seriesName)??I.seriesName:`Metric`,e?` ${e}`:``,I.threshold===void 0?``:` ${I.threshold}`,t?` over ${t}`:``]})}if(T.filterQuery)return(0,j.jsx)(u,{size:`sm`,variant:`surface`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:T.filterQuery});if(T.filters&&typeof T.filters==`string`){let e=N(T.filters);if(e&&Object.keys(e).length>0)return(0,j.jsx)(D,{filters:T.filters,hasBorder:!0})}return(0,j.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`No conditions`})})()]}),(0,j.jsxs)(l,{align:`start`,gap:2,width:`full`,children:[(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,children:`Recent fires`}),C.isLoading?(0,j.jsx)(o,{height:`60px`,width:`full`}):(C.data??[]).length===0?(0,j.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:A?`This alert has not fired yet.`:`This automation has not fired yet.`}):(0,j.jsx)(F,{fires:C.data??[],isGraphAlert:A})]}),M?(0,j.jsxs)(l,{align:`start`,gap:2,width:`full`,children:[(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,children:`Recent deliveries`}),w.isLoading?(0,j.jsx)(o,{height:`60px`,width:`full`}):(w.data??[]).length===0?(0,j.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`No delivery attempts recorded yet.`}):(0,j.jsx)(R,{deliveries:w.data??[]})]}):null]})}),(0,j.jsx)(p.Footer,{children:(0,j.jsxs)(i,{width:`full`,children:[(0,j.jsx)(v,{}),(0,j.jsx)(r,{colorPalette:`orange`,onClick:()=>n(`automation`,{automationId:e}),children:`Edit`})]})})]})})}function F({fires:e,isGraphAlert:t}){return(0,j.jsx)(l,{align:`stretch`,gap:0,width:`full`,borderWidth:`1px`,borderColor:`border`,borderRadius:`md`,overflow:`hidden`,children:(t?e.map(e=>{let t=new Date(e.createdAt),n=!e.resolvedAt;return{key:e.id,dot:n?`red.solid`:`green.solid`,label:n?`Firing`:`Resolved`,detail:n?`still firing`:`${b(t.getTime())} · lasted ${M(t,new Date(e.resolvedAt))}`,detailColor:n?`red.fg`:`fg.muted`}}):I(e).map(e=>({key:e.key,dot:`green.solid`,label:e.count===1?`Fired once`:`Fired ${e.count} times`,detail:e.label,detailColor:`fg.muted`}))).map(e=>(0,j.jsxs)(i,{gap:2.5,paddingX:3,paddingY:2,borderBottomWidth:`1px`,borderColor:`border`,_last:{borderBottomWidth:0},children:[(0,j.jsx)(n,{boxSize:2,borderRadius:`full`,flexShrink:0,bg:e.dot}),(0,j.jsx)(c,{textStyle:`sm`,flex:`1`,minWidth:`0`,children:e.label}),(0,j.jsx)(c,{textStyle:`xs`,color:e.detailColor,flexShrink:0,whiteSpace:`nowrap`,children:e.detail})]},e.key))})}function I(e){let t=[];for(let n of e){let e=b(new Date(n.createdAt).getTime())??``,r=t[t.length-1];r&&r.label===e?r.count++:t.push({key:n.id,label:e,count:1})}return t}var L={success:`green.solid`,retryable:`yellow.solid`,terminal:`red.solid`,pending:`gray.solid`};function R({deliveries:e}){let t=[],n=new Map;for(let r of e){let e=n.get(r.dispatchId);e||(e=[],n.set(r.dispatchId,e),t.push({dispatchId:r.dispatchId,attempts:e})),e.push(r)}for(let e of t)e.attempts.reverse();return(0,j.jsx)(l,{align:`stretch`,gap:2,width:`full`,children:t.map(e=>(0,j.jsx)(l,{align:`stretch`,gap:0,width:`full`,borderWidth:`1px`,borderColor:`border`,borderRadius:`md`,overflow:`hidden`,children:e.attempts.map((t,n)=>(0,j.jsx)(B,{attempt:t,index:n,total:e.attempts.length},t.id))},e.dispatchId))})}function z(e){if(e!==null){if(e===429)return`The endpoint asked us to slow down. Delivery backs off and retries.`;if(e===408||e>=500)return`The endpoint had a server error. Delivery retries automatically.`;if(e>=400)return`The endpoint rejected the request. Check its authentication and the payload it expects.`}}function B({attempt:e,index:t,total:r}){let[a,o]=(0,A.useState)(!1),s=e.responseStatus==null?e.error??`No response`:`HTTP ${e.responseStatus}`,d=e.outcome===`success`?void 0:z(e.responseStatus),f=!!(e.error??d??e.response);return(0,j.jsxs)(n,{borderBottomWidth:`1px`,borderColor:`border`,_last:{borderBottomWidth:0},children:[(0,j.jsxs)(i,{as:`button`,gap:2.5,paddingX:3,paddingY:2,width:`full`,textAlign:`left`,cursor:f?`pointer`:`default`,onClick:()=>f&&o(e=>!e),children:[(0,j.jsx)(n,{boxSize:2,borderRadius:`full`,flexShrink:0,bg:L[e.outcome]}),(0,j.jsxs)(c,{textStyle:`sm`,flex:`1`,minWidth:`0`,children:[r>1?`Attempt ${t+1} · `:``,s]}),(0,j.jsxs)(c,{textStyle:`xs`,color:`fg.muted`,flexShrink:0,whiteSpace:`nowrap`,children:[e.latencyMs==null?``:`${e.latencyMs}ms · `,b(new Date(e.firedAt).getTime())]})]}),a&&f?(0,j.jsxs)(l,{align:`stretch`,gap:2,paddingX:3,paddingBottom:3,children:[e.error?(0,j.jsx)(u,{fontSize:`xs`,width:`full`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:e.error}):null,e.response?.body?(0,j.jsx)(u,{fontSize:`xs`,width:`full`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:e.response.body}):null,e.response?.headers?(0,j.jsx)(l,{align:`stretch`,gap:.5,children:Object.entries(e.response.headers).map(([e,t])=>(0,j.jsxs)(u,{fontSize:`xs`,width:`full`,whiteSpace:`pre-wrap`,children:[e,`: `,t]},e))}):null,d?(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,children:d}):null]}):null]})}export{P as ViewAutomationDrawer};
|
|
2
|
-
//# sourceMappingURL=ViewAutomationDrawer-H_lJU8lG.js.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/shiki-CS25xJLQ.js","assets/rolldown-runtime-DAXXjFlN.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{S as o}from"./shiki-CS25xJLQ.js";import{t as s}from"./jsx-runtime-CFwixLRt.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{_ as u,d,f,h as p,l as m,m as h,p as g,u as _,v}from"./shikiAdapter-CbWAxLvq.js";import{At as y,Yn as b,jt as x}from"./ProjectAvatar-DtI9dT1f.js";import{t as S}from"./badge-Cpc3eA-C.js";import{f as C,n as w,o as T,s as E}from"./toaster-BsYkODqs.js";import{O as D,nt as O,q as ee}from"./Markdown-C9extmbX.js";import{a as k,n as te,r as A}from"./field-BadoNaN5.js";import{a as j,i as ne,n as re,r as M,t as N}from"./alert-CPsXih3K.js";import{t as P}from"./icon-button-Wlb_dGXL.js";import{n as F}from"./personalProject-DMRX2-SI.js";import{r as ie,t as ae}from"./native-select-DL2k8x0o.js";import{t as oe}from"./spacer-C38e7o6r.js";import{a as se,o as I,r as ce,s as le,t as L}from"./tabs-U8n5D55_.js";import{$ as ue,et as de,s as R,tt as fe}from"./immer-CFru3D02.js";import{t as z}from"./wrap-DlWOPhPw.js";import{n as B}from"./api-l6Cnm0vQ.js";import{n as V,t as H}from"./ScopeChipPicker-B3xHf0Ii.js";import{t as pe}from"./eye-off-C1m7ZwkW.js";import{t as me}from"./usePublicEnv-ue4-Igop.js";import{An as U,En as W,Mr as G,Nr as K,Nt as he,St as q,Tn as J,Un as ge,Vt as _e,_r as ve,pn as Y,ur as ye,yn as be}from"./index-CPtTUYLD.js";import{t as X}from"./SmallLabel-Dh74EKHT.js";import{t as Z}from"./FieldInfoTooltip-BlO6fteF.js";import{n as xe}from"./registry-BG_TsdUI.js";import{t as Se}from"./ProviderScopeChips-D7HJW6Ht.js";import{t as Ce}from"./formatBudgetUsd-BYb25IkY.js";import{t as we}from"./gatewayErrorCopy-m051Zq8m.js";var Q=e(t());function Te(e,t,n,r){let i=xe.find(t=>t.backendModelProviderKey===e),a=n[0]??r?.[0]?.modelId,o=i?.defaultModel??a;return o?`${e}/${o}`:t.toLowerCase()}function Ee(e,t){let n=new Map;for(let t of e)t.teamId&&n.set(t.id,t.teamId);return{organizationId:t,teamOfProject:n}}function De(e){return e.enabled===!0&&!e.disabledAt}function Oe(e,t,n){if(e.length===0||t.length===0)return[];let r=(e,t)=>{if(e.scopeType===`ORGANIZATION`)return e.scopeId===n.organizationId;if(e.scopeType===`TEAM`){if(t.scopeType===`ORGANIZATION`)return!1;if(t.scopeType===`TEAM`)return e.scopeId===t.scopeId;let r=n.teamOfProject.get(t.scopeId);return e.scopeId===r}return e.scopeType===`PROJECT`?t.scopeType===`PROJECT`&&e.scopeId===t.scopeId:!1},i={ORGANIZATION:0,TEAM:1,PROJECT:2},a=new Map;for(let n of t){if(!n.id||!De(n))continue;let t;for(let a of n.scopes)e.some(e=>r(a,e))&&(!t||i[a.scopeType]<i[t.scopeType])&&(t=a);if(!t)continue;let o=n.models??[],s=n.customModels?.length??0,c=n.name??n.provider;a.set(n.id,{id:n.id,provider:n.provider,label:c,modelCount:o.length+s,definedAt:t,defaultModel:Te(n.provider,c,o,n.customModels)})}return Array.from(a.values()).sort((e,t)=>e.label.localeCompare(t.label))}function ke(e){let{scopes:t,providers:n,availableProjects:r,organizationId:i}=e;return Oe(t,n,Ee(r,i))[0]?.defaultModel}var $=s(),Ae={limitUsd:``,window:`DAY`};function je(e){let t=Number.parseFloat(e);return Number.isFinite(t)?Number.isInteger(t)?`${t}`:Ce(t).replace(/^\$/,``):e}function Me(e){if(!e.limitUsd.trim())return`No max spending for this key`;let t=je(e.limitUsd);switch(e.window){case`DAY`:return`Max $${t}/day, resets 00:00 UTC`;case`WEEK`:return`Max $${t}/week, resets Monday 00:00 UTC`;case`MONTH`:return`Max $${t}/month, resets on the 1st 00:00 UTC`}}function Ne(e){let t=e.limitUsd.trim();if(!t)return null;if(!/^\d+(\.\d+)?$/.test(t))return`Budget must be a positive amount.`;let n=Number.parseFloat(t);return!Number.isFinite(n)||n<=0?`Budget must be a positive amount.`:null}function Pe({value:e,onChange:t,organizationId:n,scopes:i,traceProjectId:o,principalUserId:s,virtualKeyId:u}){return(0,$.jsxs)(l,{align:`start`,width:`full`,gap:1.5,children:[(0,$.jsxs)(a,{gap:1,alignItems:`center`,children:[(0,$.jsx)(X,{children:`Budget`}),(0,$.jsx)(Z,{description:`The most this key may spend per period. Enforced by the gateway: once the limit is reached, requests through this key are refused until the period resets. Leave empty for no cap on the key itself; budgets on the organization, team, project or your account still apply.`,docHref:`/ai-gateway/budgets`,testId:`vk-budget-info`})]}),(0,$.jsxs)(a,{gap:2,width:`full`,maxWidth:`340px`,children:[(0,$.jsxs)(r,{position:`relative`,flex:1,children:[(0,$.jsx)(c,{position:`absolute`,left:3,top:`50%`,transform:`translateY(-50%)`,color:`fg.muted`,fontSize:`sm`,pointerEvents:`none`,children:`$`}),(0,$.jsx)(G,{value:e.limitUsd,onChange:n=>t({...e,limitUsd:n.target.value}),placeholder:`No limit`,inputMode:`decimal`,paddingLeft:7,"aria-label":`Budget limit in USD`,"data-testid":`vk-budget-limit`})]}),(0,$.jsx)(ie,{size:`md`,width:`140px`,children:(0,$.jsxs)(ae,{value:e.window,"aria-label":`Budget period`,"data-testid":`vk-budget-window`,onChange:n=>t({...e,window:n.target.value??`DAY`}),children:[(0,$.jsx)(`option`,{value:`DAY`,children:`per day`}),(0,$.jsx)(`option`,{value:`WEEK`,children:`per week`}),(0,$.jsx)(`option`,{value:`MONTH`,children:`per month`})]})})]}),(0,$.jsx)(c,{fontSize:`xs`,color:e.limitUsd.trim()?`fg`:`fg.muted`,"data-testid":`vk-budget-annotation`,children:Me(e)}),(0,$.jsx)(Fe,{organizationId:n,scopes:i,traceProjectId:o,principalUserId:s,virtualKeyId:u})]})}function Fe({organizationId:e,scopes:t,traceProjectId:n,principalUserId:r,virtualKeyId:i}){let o=(B.virtualKeys.applicableBudgets.useQuery({organizationId:e,scopes:t,traceProjectId:n??null,principalUserId:r??null,virtualKeyId:i??null},{enabled:!!e&&t.length>0}).data??[]).filter(e=>!(i&&e.managedByVirtualKeyId===i));return o.length===0?null:(0,$.jsxs)(l,{align:`stretch`,width:`full`,gap:0,borderWidth:`1px`,borderColor:`border.subtle`,borderRadius:`md`,marginTop:1,"data-testid":`vk-applicable-budgets`,children:[(0,$.jsx)(c,{fontSize:`2xs`,fontWeight:`semibold`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wide`,paddingX:2.5,paddingTop:2,children:`Inherited budgets`}),o.map(e=>(0,$.jsxs)(a,{paddingX:2.5,paddingY:1.5,gap:2,fontSize:`xs`,_notLast:{borderBottomWidth:`1px`,borderColor:`border.subtle`},children:[(0,$.jsx)(c,{fontWeight:`medium`,lineClamp:1,children:e.scopeLabel}),e.providerLabel&&(0,$.jsxs)(S,{variant:`subtle`,colorPalette:`blue`,fontSize:`2xs`,children:[e.providerLabel,` only`]}),e.isPerMember&&(0,$.jsx)(S,{variant:`subtle`,colorPalette:`cyan`,fontSize:`2xs`,children:`per member`}),(0,$.jsx)(oe,{}),(0,$.jsxs)(c,{color:`fg.muted`,whiteSpace:`nowrap`,children:[Ce(e.spentUsd),` of `,Ce(e.limitUsd),` /`,` `,e.window.toLowerCase()]})]},e.id))]})}function Ie(e,t){switch(e.kind){case`PROJECT`:return e.projectId?[{scopeType:`PROJECT`,scopeId:e.projectId}]:null;case`PERSONAL`:return t.personalProjectId?[{scopeType:`PROJECT`,scopeId:t.personalProjectId}]:null;case`TEAM`:return e.teamId&&e.traceProjectId?[{scopeType:`TEAM`,scopeId:e.teamId}]:null;case`ORGANIZATION`:return e.traceProjectId?[{scopeType:`ORGANIZATION`,scopeId:t.organizationId}]:null}}function Le(e){switch(e.kind){case`PROJECT`:case`PERSONAL`:return null;case`TEAM`:case`ORGANIZATION`:return e.traceProjectId}}function Re(e,t){switch(e.kind){case`PROJECT`:return e.projectId?null:`Pick the project this key belongs to.`;case`PERSONAL`:return t.personalProjectId?null:`Resolving your personal workspace…`;case`TEAM`:return e.teamId?e.traceProjectId?null:`Pick the project where traces and costs land.`:`Pick the team this key belongs to.`;case`ORGANIZATION`:return e.traceProjectId?null:`Pick the project where traces and costs land.`}}function ze(e,t){if(!e)return null;let n=t.availableProjects.find(t=>t.id===e);return n?n.name.split(` · `)[0]??n.name:null}var Be=[{kind:`PROJECT`,label:`Project`,icon:(0,$.jsx)(ye,{size:14,"aria-hidden":!0})},{kind:`PERSONAL`,label:`Personal`,icon:(0,$.jsx)(V,{size:14,"aria-hidden":!0})},{kind:`TEAM`,label:`Team`,icon:(0,$.jsx)(ge,{size:14,"aria-hidden":!0})},{kind:`ORGANIZATION`,label:`Organization`,icon:(0,$.jsx)(ve,{size:14,"aria-hidden":!0})}];function Ve({value:e,onChange:t,ctx:n,canCreateShared:r}){let o=(0,Q.useMemo)(()=>Be.filter(e=>r||e.kind===`PROJECT`||e.kind===`PERSONAL`),[r]),s=(e,t,r)=>(0,$.jsx)(l,{align:`start`,width:`full`,gap:1,children:(0,$.jsx)(H,{value:t?[{scopeType:`PROJECT`,scopeId:t}]:[],onChange:e=>r(e[0]?.scopeId??null),organizationId:n.organizationId,organizationName:n.organizationName,availableTeams:n.availableTeams,availableProjects:n.availableProjects,allowedScopeTypes:[`PROJECT`],variant:`single-select`,label:e,placeholder:`Select a project`,showSummary:!1})});return(0,$.jsxs)(l,{align:`start`,width:`full`,gap:1.5,children:[(0,$.jsxs)(a,{gap:1,alignItems:`center`,children:[(0,$.jsx)(X,{children:`Ownership`}),(0,$.jsx)(Z,{description:`Who can see and manage this key, and where its traces and costs land. Project keys belong to one project; personal keys live in your own workspace; team and organization keys are shared with everyone in that team or organization.`,docHref:`/ai-gateway/virtual-keys#creating-a-vk`,testId:`vk-ownership-info`})]}),(0,$.jsx)(z,{gap:2,role:`group`,"aria-label":`Ownership`,children:o.map(n=>{let r=e.kind===n.kind;return(0,$.jsx)(i,{type:`button`,size:`xs`,variant:r?`solid`:`outline`,"aria-pressed":r,onClick:()=>t({...e,kind:n.kind}),"data-testid":`vk-ownership-${n.kind.toLowerCase()}`,children:(0,$.jsxs)(a,{gap:1,children:[n.icon,(0,$.jsx)(c,{children:n.label})]})},n.kind)})}),e.kind===`PROJECT`&&(0,$.jsxs)($.Fragment,{children:[n.availableProjects.length>1&&s(``,e.projectId,n=>t({...e,projectId:n})),(e=>e&&(0,$.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,"data-testid":`vk-trace-destination`,children:[`Traces and costs land in `,e,`.`]}))(ze(e.projectId,n))]}),e.kind===`PERSONAL`&&(0,$.jsx)(c,{fontSize:`xs`,color:`fg.muted`,"data-testid":`vk-trace-destination`,children:`Only you can use this key. Traces and costs land in your personal workspace.`}),e.kind===`TEAM`&&(0,$.jsxs)($.Fragment,{children:[n.availableTeams.length>1&&(0,$.jsx)(H,{value:e.teamId?[{scopeType:`TEAM`,scopeId:e.teamId}]:[],onChange:n=>t({...e,teamId:n[0]?.scopeId??null}),organizationId:n.organizationId,organizationName:n.organizationName,availableTeams:n.availableTeams,availableProjects:[],allowedScopeTypes:[`TEAM`],variant:`single-select`,label:``,placeholder:`Select a team`,showSummary:!1}),s(`Traces and costs land in`,e.traceProjectId,n=>t({...e,traceProjectId:n}))]}),e.kind===`ORGANIZATION`&&s(`Traces and costs land in`,e.traceProjectId,n=>t({...e,traceProjectId:n}))]})}function He({scopes:e,principal:t,ctx:n}){let r=e.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId,name:e.scopeType===`ORGANIZATION`?n.organizationName:e.scopeType===`TEAM`?n.availableTeams.find(t=>t.id===e.scopeId)?.name:ze(e.scopeId,n)??void 0})),i=e.filter(e=>e.scopeType===`PROJECT`),o=i.length===1?ze(i[0].scopeId,n):null;return(0,$.jsxs)(l,{align:`start`,width:`full`,gap:1.5,children:[(0,$.jsxs)(a,{gap:1,alignItems:`center`,children:[(0,$.jsx)(X,{children:`Ownership`}),(0,$.jsx)(Z,{description:`Ownership is fixed after create so trace attribution never silently shifts. To move a key, revoke it and create a new one where it should live.`,docHref:`/ai-gateway/virtual-keys#creating-a-vk`,testId:`vk-ownership-info`})]}),(0,$.jsx)(Se,{scopes:r,principal:t}),(0,$.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,"data-testid":`vk-trace-destination`,children:[`Traces and costs land in`,` `,o??`the organization's governance inbox`,`.`]})]})}function Ue(e){if(!e)return[];let t=e.models??[],n=(e.customModels??[]).map(e=>e.modelId);return[...new Set([...t,...n])]}function We({mp:e,raw:t,allProviders:n,checked:o,onCheck:s,scopeName:u,modelsAllowed:d,onModelsAllowedChange:f}){let[p,m]=(0,Q.useState)(!1),h=Ue(t),g=`${e.provider}/`,_=d.filter(e=>e.startsWith(g)),v=new Set(_),y=(e,t)=>{let n=`${g}${e}`,r=d.filter(e=>e!==n);f(t?[...r,n]:r)},b=e.provider in R?R[e.provider]:null;return(0,$.jsxs)(l,{align:`stretch`,gap:0,borderWidth:`1px`,borderColor:`border.subtle`,borderRadius:`md`,children:[(0,$.jsxs)(a,{paddingX:2,paddingY:1.5,gap:2,children:[(0,$.jsx)(D,{size:`sm`,checked:o,disabled:n,onCheckedChange:e=>s(e.checked===!0),inputProps:{"aria-label":e.label},"data-testid":`vk-provider-${e.id}`}),(0,$.jsx)(r,{width:`16px`,height:`16px`,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,css:{"& > svg":{width:`100%`,height:`100%`}},children:b}),(0,$.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,children:e.label}),(0,$.jsx)(r,{flex:1}),(0,$.jsx)(Se,{size:`xs`,scopes:[{scopeType:e.definedAt.scopeType,scopeId:e.definedAt.scopeId,name:u}]}),h.length>0&&(0,$.jsx)(i,{type:`button`,variant:`ghost`,size:`2xs`,color:`fg.muted`,onClick:()=>m(e=>!e),"aria-expanded":p,"data-testid":`vk-provider-${e.id}-models-toggle`,children:(0,$.jsxs)(a,{gap:.5,children:[p?(0,$.jsx)(de,{size:12,"aria-hidden":!0}):(0,$.jsx)(ue,{size:12,"aria-hidden":!0}),(0,$.jsx)(c,{fontSize:`xs`,children:_.length>0?`${_.length} of ${h.length} models`:`${h.length} ${h.length===1?`model`:`models`}`})]})})]}),p&&h.length>0&&(0,$.jsxs)(r,{borderTopWidth:`1px`,borderColor:`border.subtle`,paddingX:2,paddingY:2,children:[(0,$.jsx)(c,{fontSize:`2xs`,color:`fg.muted`,marginBottom:1.5,children:_.length===0?`All models allowed. Check models to restrict.`:`Only the checked models are allowed.`}),(0,$.jsx)(z,{gap:2,children:h.map(e=>(0,$.jsx)(D,{size:`sm`,checked:v.has(`${g}${e}`),onCheckedChange:t=>y(e,t.checked===!0),inputProps:{"aria-label":`${g}${e}`},"data-testid":`vk-model-${g}${e}`,children:(0,$.jsx)(c,{fontSize:`xs`,fontFamily:`mono`,children:e})},e))})]})]})}var Ge={allProviders:!0,providerIds:[],modelsAllowed:[]};function Ke(e,t){let n=new Set(t.map(e=>e.id));return{providersAllowed:e.allProviders?null:e.providerIds.filter(e=>n.has(e)),modelsAllowed:e.modelsAllowed.length>0?e.modelsAllowed:null}}function qe(e,t){if(e.allProviders)return null;let n=new Set(t.map(e=>e.id));return e.providerIds.filter(e=>n.has(e)).length===0?`Select at least one provider, or allow all providers.`:null}function Je({value:e,onChange:t,scopes:r,organizationId:i,organizationName:o,availableTeams:s,availableProjects:u,providers:d,isLoading:f}){let p=(0,Q.useMemo)(()=>Ee(u,i),[u,i]),m=(0,Q.useMemo)(()=>Oe(r,d,p),[r,d,p]),h=(0,Q.useMemo)(()=>new Map(d.filter(e=>e.id).map(e=>[e.id,e])),[d]),g=(0,Q.useMemo)(()=>({organizationName:o,teamNames:new Map(s.map(e=>[e.id,e.name])),projectNames:new Map(u.map(e=>{let t=e.name.split(` · `)[0]??e.name;return[e.id,t]}))}),[s,u,o]),_=e=>{switch(e.scopeType){case`ORGANIZATION`:return g.organizationName;case`TEAM`:return g.teamNames.get(e.scopeId);case`PROJECT`:return g.projectNames.get(e.scopeId)}},v=(0,Q.useMemo)(()=>new Set(e.providerIds),[e]),y=n=>{t(n?{...e,allProviders:!0,providerIds:[]}:{...e,allProviders:!1,providerIds:m.map(e=>e.id)})},b=(n,r)=>{let i=new Set(v);r?i.add(n):i.delete(n),t({...e,allProviders:!1,providerIds:[...i]})},x=qe(e,m);return(0,$.jsxs)(l,{align:`start`,width:`full`,gap:1.5,children:[(0,$.jsxs)(a,{gap:1,alignItems:`center`,children:[(0,$.jsx)(X,{children:`Provider access`}),(0,$.jsx)(Z,{description:`Which model providers this key may dispatch to. 'All providers' keeps the key current: providers added to its scope later become reachable without editing the key. An explicit selection stays exactly as picked. Expand a provider to limit which of its models the key may call.`,docHref:`/ai-gateway/virtual-keys`,testId:`vk-provider-access-info`})]}),f?(0,$.jsxs)(a,{gap:2,children:[(0,$.jsx)(n,{size:`xs`}),(0,$.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`Resolving providers…`})]}):r.length===0?(0,$.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`Pick an ownership above to see the providers this key can reach.`}):m.length===0?(0,$.jsxs)(l,{align:`stretch`,gap:1,width:`full`,borderWidth:`1px`,borderColor:`orange.200`,borderRadius:`md`,background:`orange.50`,padding:3,children:[(0,$.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,children:`No model providers reachable from this ownership.`}),(0,$.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`Add one at`,` `,(0,$.jsx)(c,{as:`span`,fontFamily:`mono`,children:`/settings/model-providers`}),` `,`first; the key cannot route requests without a provider.`]})]}):(0,$.jsxs)(l,{align:`stretch`,width:`full`,gap:1,children:[(0,$.jsx)(a,{paddingX:.5,paddingY:1,children:(0,$.jsx)(D,{size:`sm`,checked:e.allProviders,onCheckedChange:e=>y(e.checked===!0),inputProps:{"aria-label":`All providers`},"data-testid":`vk-providers-all`,children:(0,$.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,children:`All providers`})})}),m.map(n=>(0,$.jsx)(We,{mp:n,raw:h.get(n.id),allProviders:e.allProviders,checked:e.allProviders||v.has(n.id),onCheck:e=>b(n.id,e),scopeName:_(n.definedAt),modelsAllowed:e.modelsAllowed,onModelsAllowedChange:n=>t({...e,modelsAllowed:n})},n.id)),x&&(0,$.jsx)(c,{fontSize:`xs`,color:`red.600`,"data-testid":`vk-providers-invalid`,children:x})]})]})}var Ye={mode:`NONE`,policyId:null};function Xe(e){return e.routingMode===`POLICY`&&e.routingPolicyId?{mode:`POLICY`,policyId:e.routingPolicyId}:e.routingMode===`FALLBACK_ALL`?{mode:`FALLBACK_ALL`,policyId:null}:!e.routingMode&&e.routingPolicyId?{mode:`POLICY`,policyId:e.routingPolicyId}:Ye}function Ze(e){return e.mode===`POLICY`?`POLICY:${e.policyId}`:e.mode}function Qe(e){return e.startsWith(`POLICY:`)?{mode:`POLICY`,policyId:e.slice(7)}:e===`FALLBACK_ALL`?{mode:`FALLBACK_ALL`,policyId:null}:Ye}function $e({value:e,onChange:t,policies:n}){return(0,$.jsxs)(l,{align:`start`,width:`full`,gap:1.5,children:[(0,$.jsxs)(a,{gap:1,alignItems:`center`,children:[(0,$.jsx)(X,{children:`Routing`}),(0,$.jsx)(Z,{description:`What happens when the provider serving a request fails. 'No fallback' surfaces the provider's error to the caller. 'Fall back' retries the request on the next eligible provider, which sends it to a different vendor. A routing policy pins an explicit ordered provider list.`,docHref:`/ai-gateway/routing-policies`,testId:`vk-routing-info`})]}),(0,$.jsx)(x,{value:Ze(e),onValueChange:e=>{e.value&&t(Qe(e.value))},size:`sm`,children:(0,$.jsxs)(l,{align:`start`,gap:1.5,children:[(0,$.jsx)(y,{value:`NONE`,"data-testid":`vk-routing-none`,children:(0,$.jsx)(c,{fontSize:`sm`,children:`Default: no fallback`})}),(0,$.jsx)(y,{value:`FALLBACK_ALL`,"data-testid":`vk-routing-fallback-all`,children:(0,$.jsx)(c,{fontSize:`sm`,children:`Fall back to all eligible providers`})}),(e.mode===`POLICY`&&e.policyId&&!n.some(t=>t.id===e.policyId)?[...n,{id:e.policyId,name:`Current policy`}]:n).map(e=>(0,$.jsx)(y,{value:`POLICY:${e.id}`,"data-testid":`vk-routing-policy-${e.id}`,children:(0,$.jsx)(c,{fontSize:`sm`,children:e.name})},e.id))]})})]})}var et=be([`respect`,`force`,`disable`]),tt=be([`5xx`,`timeout`,`rate_limit_exceeded`,`network_error`,`circuit_breaker`]),nt=W({direction:be([`pre`,`post`,`stream_chunk`]),guardrailIds:Y(U()).default([])});function rt(e){let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=[...n.trim()].slice(0,128).join(``).trim();if(e!==``&&(t.add(e),t.size===32))break}return[...t]}W({modelsAllowed:Y(U()).nullable().default(null),providersAllowed:Y(U()).nullable().default(null).transform(e=>e&&e.length>0?e:null),cache:W({mode:et.default(`respect`),ttlS:J().int().nonnegative().default(3600)}).default({mode:`respect`,ttlS:3600}),fallback:W({on:Y(tt).default([`5xx`,`timeout`,`rate_limit_exceeded`]),timeoutMs:J().int().positive().default(3e4),maxAttempts:J().int().positive().default(3)}).default({on:[`5xx`,`timeout`,`rate_limit_exceeded`],timeoutMs:3e4,maxAttempts:3}),guardrailAttachments:Y(nt).default([]),rateLimits:W({rpm:J().int().nullable().default(null),tpm:J().int().nullable().default(null),rpd:J().int().nullable().default(null)}).default({rpm:null,tpm:null,rpd:null}),metadata:W({label:U().optional(),tags:Y(U()).default([]).transform(rt)}).default({tags:[]})});var it=`Group this key's traffic by team, app, or environment. Every trace this key sends carries its tags as labels, so anyone with access to the project can see them and filter on them. A cache rule that lists tags applies to any key carrying all of them. Saving keeps the first 32 tags, trims each to 128 characters, and drops blanks and repeats.`,at=32*258;function ot(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function st(e){let t=ot(e),n=new Set(t).size>32,r=t.some(e=>[...e].length>128),i=[];return n&&i.push(`Only the first 32 tags will be saved.`),r&&i.push(`Tags longer than 128 characters will be shortened.`),i.length>0?i.join(` `):null}var ct=new Set([`DAY`,`WEEK`,`MONTH`]);function lt({organizationId:e,vk:t,onOpenChange:n,onSaved:r}){let{organization:o}=_e(),[s,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(Ae),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,T]=(0,Q.useState)(Ge),[E,D]=(0,Q.useState)(Xe({routingMode:`NONE`,routingPolicyId:null})),[ee,j]=(0,Q.useState)(`respect`),[ne,re]=(0,Q.useState)(3600),[M,N]=(0,Q.useState)(``),[P,se]=(0,Q.useState)(``),[I,ce]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{if(!t)return;u(t.name),f(t.description??``),m((t.config.metadata?.tags??[]).join(`, `)),j(t.config.cache?.mode??`respect`),re(t.config.cache?.ttlS??3600),N(t.config.rateLimits?.rpm?.toString()??``),se(t.config.rateLimits?.tpm?.toString()??``),ce(t.config.rateLimits?.rpd?.toString()??``);let e=t.config.providersAllowed??null;T({allProviders:!e||e.length===0,providerIds:e??[],modelsAllowed:t.config.modelsAllowed??[]}),D(Xe({routingMode:t.routingMode??null,routingPolicyId:t.routingPolicyId})),g(Ae),v(!1),b(!1),S(!1)},[t]);let le=(0,Q.useMemo)(()=>o?.teams?.map(e=>({id:e.id,name:e.name}))??[],[o?.teams]),L=(0,Q.useMemo)(()=>o?.teams?.flatMap(e=>e.projects.map(t=>({id:t.id,name:`${t.name} · ${e.name}`,teamId:e.id})))??[],[o?.teams]),ue=B.useContext(),de=B.routingPolicy.list.useQuery({organizationId:e},{enabled:!!t&&!!e}),R=B.modelProvider.listAllForOrganizationForFrontend.useQuery({organizationId:e},{enabled:!!t&&!!e}),z=B.virtualKeys.applicableBudgets.useQuery({organizationId:e,scopes:t?.scopes??[],traceProjectId:t?.traceProjectId??null,principalUserId:t?.principalUserId??null,virtualKeyId:t?.id??null},{enabled:!!t&&!!e&&(t?.scopes.length??0)>0});(0,Q.useEffect)(()=>{if(!t||_||y||!z.data)return;let e=z.data.find(e=>e.managedByVirtualKeyId===t.id&&ct.has(e.window));if(e){let t=Number.parseFloat(e.limitUsd);g({limitUsd:Number.isFinite(t)?String(t):e.limitUsd,window:e.window}),S(!0)}v(!0)},[t,_,y,z.data]);let V=B.virtualKeys.update.useMutation({onSuccess:async()=>{await ue.virtualKeys.list.invalidate({organizationId:e}),await ue.virtualKeys.applicableBudgets.invalidate()}}),H=R.data?.providers??[],pe=de.data??[],me=(0,Q.useMemo)(()=>Oe(t?.scopes??[],H,Ee(L,e)),[t?.scopes,H,L,e]),U=st(p),W=()=>{V.isPending||n(!1)},K=s?Ne(h)||(R.isLoading?`Loading providers…`:qe(C,me)||null):`Name is required.`;return(0,$.jsx)(F.Root,{open:!!t,onOpenChange:()=>W(),placement:`end`,size:`md`,children:(0,$.jsxs)(F.Content,{bg:`bg`,children:[(0,$.jsxs)(F.Header,{children:[(0,$.jsx)(F.Title,{children:`Edit virtual key`}),(0,$.jsx)(F.CloseTrigger,{})]}),(0,$.jsx)(F.Body,{children:(0,$.jsxs)(l,{align:`stretch`,gap:4,children:[(0,$.jsxs)(k,{required:!0,children:[(0,$.jsxs)(A,{children:[`Name`,(0,$.jsx)(Z,{description:`Human-readable identifier shown in the list and audit log. Must be unique within the organization. Rename is non-breaking: the VK id + secret remain the same.`,docHref:`/ai-gateway/virtual-keys#creating-a-vk`})]}),(0,$.jsx)(G,{value:s,onChange:e=>u(e.target.value),maxLength:128})]}),(0,$.jsxs)(k,{children:[(0,$.jsx)(A,{children:`Description`}),(0,$.jsx)(fe,{value:d,onChange:e=>f(e.target.value)})]}),(0,$.jsxs)(k,{children:[(0,$.jsxs)(A,{children:[`Tags`,(0,$.jsx)(Z,{description:it,docHref:`/ai-gateway/cache-control#cache-rules`,testId:`vk-tags-info`})]}),(0,$.jsx)(G,{value:p,onChange:e=>m(e.target.value),placeholder:`e.g. tier=enterprise, team=ml`,maxLength:at}),U&&(0,$.jsx)(te,{color:`orange.600`,children:U})]}),t&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{}),(0,$.jsx)(He,{scopes:t.scopes,principal:t.principalUserId&&t.principalUser?t.principalUser:void 0,ctx:{organizationName:o?.name,availableTeams:le,availableProjects:L}}),(0,$.jsx)(O,{}),(0,$.jsx)(Pe,{value:h,onChange:e=>{b(!0),g(e)},organizationId:e,scopes:t.scopes,traceProjectId:t.traceProjectId??null,principalUserId:t.principalUserId??null,virtualKeyId:t.id}),(0,$.jsx)(O,{}),(0,$.jsx)(Je,{value:C,onChange:T,scopes:t.scopes,organizationId:e,organizationName:o?.name,availableTeams:le,availableProjects:L,providers:H,isLoading:R.isLoading}),(0,$.jsx)(O,{}),(0,$.jsx)($e,{value:E,onChange:D,policies:pe})]}),(0,$.jsx)(O,{}),(0,$.jsxs)(a,{children:[(0,$.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:`Cache control`}),(0,$.jsx)(Z,{description:`Per-VK default cache mode; the X-LangWatch-Cache request header and matching cache rules override per request. Provider-agnostic: Anthropic uses explicit cache_control markers, OpenAI/Azure cache prompts automatically, Gemini supports cachedContent references.`,docHref:`/ai-gateway/cache-control`})]}),(0,$.jsxs)(a,{gap:4,align:`flex-start`,children:[(0,$.jsxs)(k,{flex:1,children:[(0,$.jsx)(A,{children:`Mode`}),(0,$.jsx)(ie,{size:`sm`,children:(0,$.jsxs)(ae,{value:ee,onChange:e=>j(e.target.value??`respect`),children:[(0,$.jsx)(`option`,{value:`respect`,children:`Respect: pass provider cache directives through unchanged`}),(0,$.jsx)(`option`,{value:`disable`,children:`Disable: strip cache directives before dispatch`}),(0,$.jsx)(`option`,{value:`force`,children:`Force: inject cache_control on Anthropic (OpenAI auto, Gemini WARN)`})]})})]}),(0,$.jsxs)(k,{flex:1,children:[(0,$.jsx)(A,{children:`TTL (seconds)`}),(0,$.jsx)(G,{value:ne.toString(),onChange:e=>re(Math.max(0,Number.parseInt(e.target.value,10)||0)),inputMode:`numeric`})]})]}),(0,$.jsx)(O,{}),(0,$.jsxs)(a,{children:[(0,$.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:`Rate limits`}),(0,$.jsx)(Z,{description:`Per-VK caps on the gateway hot path, blank = unlimited. Enforced in-memory on every gateway replica; on breach the gateway returns HTTP 429 with Retry-After and X-LangWatch-RateLimit-Dimension. Changes propagate to all replicas within ~60s.`,docHref:`/ai-gateway/rate-limits`})]}),(0,$.jsxs)(a,{gap:4,align:`flex-start`,children:[(0,$.jsxs)(k,{flex:1,children:[(0,$.jsx)(A,{children:`rpm`}),(0,$.jsx)(G,{value:M,onChange:e=>N(e.target.value),placeholder:`unlimited`,inputMode:`numeric`}),(0,$.jsx)(te,{children:`Requests / minute`})]}),(0,$.jsxs)(k,{flex:1,children:[(0,$.jsxs)(A,{children:[`tpm`,(0,$.jsx)(Z,{description:`Tokens / minute; requires pre-request token estimation and ships with Redis-coordinated cluster counters (v1.1).`,docHref:`/ai-gateway/rate-limits`})]}),(0,$.jsx)(G,{value:P,placeholder:`deferred`,inputMode:`numeric`,disabled:!0}),(0,$.jsx)(te,{children:`Tokens / minute`})]}),(0,$.jsxs)(k,{flex:1,children:[(0,$.jsx)(A,{children:`rpd`}),(0,$.jsx)(G,{value:I,onChange:e=>ce(e.target.value),placeholder:`unlimited`,inputMode:`numeric`}),(0,$.jsx)(te,{children:`Requests / day`})]})]})]})}),(0,$.jsx)(F.Footer,{children:(0,$.jsxs)(a,{width:`full`,children:[K&&(0,$.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:K}),(0,$.jsx)(oe,{}),(0,$.jsx)(i,{variant:`ghost`,onClick:W,disabled:V.isPending,children:`Cancel`}),(0,$.jsx)(i,{colorPalette:`orange`,onClick:async()=>{if(t){if(K){w.create({title:K,type:`error`});return}try{let i=Ke(C,me),a=h.limitUsd.trim();await V.mutateAsync({organizationId:e,id:t.id,name:s,description:d||null,routingMode:E.mode,routingPolicyId:E.mode===`POLICY`?E.policyId:null,budget:a?{limitUsd:a,window:h.window}:x?null:void 0,config:{providersAllowed:i.providersAllowed,modelsAllowed:i.modelsAllowed,cache:{mode:ee,ttlS:ne},rateLimits:{rpm:M?Number.parseInt(M,10):null,tpm:P?Number.parseInt(P,10):null,rpd:I?Number.parseInt(I,10):null},metadata:{tags:ot(p)}}}),r(),n(!1)}catch(e){w.create({title:we(e,`Failed to update virtual key`),type:`error`})}}},loading:V.isPending,disabled:!!K,children:`Save changes`})]})})]})})}var ut=`https://gateway.langwatch.ai/v1`;function dt(e,t){return e||(t?`${t.replace(/\/+$/,``)}/v1`:ut)}function ft({secret:e,gatewayBaseUrl:t,title:n=`Usage example`,model:r=`gpt-5-mini`}){let{colorMode:i}=he(),a=me(),s=e??`$LANGWATCH_VK_SECRET`,y=dt(t,a.data?.GATEWAY_BASE_URL),b=!e,x=(0,Q.useMemo)(()=>{let e=`The full secret is shown only once during create or rotate. If you do not have it saved, rotate to mint a fresh one.`,t=b?`# ${e}\n# Set LANGWATCH_VK_SECRET in your shell, or paste the secret in place of $LANGWATCH_VK_SECRET below.\n\n`:``,n=b?`// ${e}\n// Set LANGWATCH_VK_SECRET in your shell, or paste the secret in place of $LANGWATCH_VK_SECRET below.\n\n`:``,i=b?3:0,a=b?3:0,o=b?3:0,c=b?3:0,l=`${t}from openai import OpenAI
|
|
3
|
-
|
|
4
|
-
client = OpenAI(
|
|
5
|
-
base_url="${y}",
|
|
6
|
-
api_key="${s}",
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
response = client.chat.completions.create(
|
|
10
|
-
model="${r}",
|
|
11
|
-
messages=[{"role": "user", "content": "Hello"}],
|
|
12
|
-
)
|
|
13
|
-
print(response.choices[0].message.content)`,u=`${n}import OpenAI from "openai";
|
|
14
|
-
|
|
15
|
-
const client = new OpenAI({
|
|
16
|
-
baseURL: "${y}",
|
|
17
|
-
apiKey: "${s}",
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const response = await client.chat.completions.create({
|
|
21
|
-
model: "${r}",
|
|
22
|
-
messages: [{ role: "user", content: "Hello" }],
|
|
23
|
-
});
|
|
24
|
-
console.log(response.choices[0].message.content);`,d=`${n}package main
|
|
25
|
-
|
|
26
|
-
import (
|
|
27
|
-
\t"context"
|
|
28
|
-
\t"fmt"
|
|
29
|
-
|
|
30
|
-
\topenai "github.com/openai/openai-go"
|
|
31
|
-
\t"github.com/openai/openai-go/option"
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
func main() {
|
|
35
|
-
\tclient := openai.NewClient(
|
|
36
|
-
\t\toption.WithBaseURL("${y}"),
|
|
37
|
-
\t\toption.WithAPIKey("${s}"),
|
|
38
|
-
\t)
|
|
39
|
-
|
|
40
|
-
\tresponse, _ := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
|
|
41
|
-
\t\tModel: "${r}",
|
|
42
|
-
\t\tMessages: []openai.ChatCompletionMessageParamUnion{
|
|
43
|
-
\t\t\topenai.UserMessage("Hello"),
|
|
44
|
-
\t\t},
|
|
45
|
-
\t})
|
|
46
|
-
\tfmt.Println(response.Choices[0].Message.Content)
|
|
47
|
-
}`,f=`${t}curl ${y}/chat/completions \\
|
|
48
|
-
-H "Authorization: Bearer ${s}" \\
|
|
49
|
-
-H "Content-Type: application/json" \\
|
|
50
|
-
-d '{
|
|
51
|
-
"model": "${r}",
|
|
52
|
-
"messages": [{"role": "user", "content": "Hello"}]
|
|
53
|
-
}'`;return[{key:`python`,title:`Python`,code:l,language:`python`,highlightLines:[4+i,5+i]},{key:`typescript`,title:`TypeScript`,code:u,language:`typescript`,highlightLines:[4+a,5+a]},{key:`go`,title:`Go`,code:d,language:`go`,highlightLines:[13+o,14+o]},{key:`bash`,title:`cURL`,code:f,language:`bash`,highlightLines:[1+c,2+c]}]},[y,s,b,r]),S=le({defaultValue:`python`}),w=x.find(e=>e.key===S.value)??x[0],T=x.filter(e=>e.key!==S.value),E=(0,Q.useMemo)(()=>v({async load(){let{createHighlighter:e}=await o(async()=>{let{createHighlighter:e}=await import(`./shiki-CS25xJLQ.js`).then(e=>e.o);return{createHighlighter:e}},__vite__mapDeps([0,1]));return e({langs:[`typescript`,`python`,`go`,`bash`],themes:[`github-dark`,`github-light`]})},theme:i===`dark`?`github-dark`:`github-light`}),[i]);return(0,$.jsxs)(l,{align:`stretch`,gap:2,children:[(0,$.jsx)(c,{fontWeight:`medium`,children:n}),(0,$.jsxs)(c,{textStyle:`xs`,color:`fg.muted`,children:[`Works with any OpenAI-compatible SDK or coding assistant (Claude Code, Codex, Cursor, Aider).`,` `,(0,$.jsx)(C,{href:`https://langwatch.ai/docs/ai-gateway/quickstart`,color:`orange.600`,target:`_blank`,rel:`noreferrer`,children:`Read more →`})]}),(0,$.jsx)(se,{value:S,size:`sm`,variant:`line`,children:(0,$.jsx)(u,{value:E,children:(0,$.jsx)(K,{children:()=>(0,$.jsxs)(p,{code:w.code,language:w.language,size:`sm`,meta:{highlightLines:w.highlightLines,colorScheme:i},transition:`all 0.3s ease`,bg:`bg.panel/60`,borderRadius:`xl`,border:`1px solid`,borderColor:`border`,backdropFilter:`blur(20px) saturate(1.3)`,boxShadow:`0 2px 16px rgba(0,0,0,0.04)`,overflow:`hidden`,children:[(0,$.jsxs)(h,{borderBottomWidth:`1px`,borderColor:`border`,children:[(0,$.jsx)(ce,{w:`full`,border:`0`,ms:`-1`,children:x.map(e=>(0,$.jsx)(I,{colorPalette:`teal`,value:e.key,textStyle:`xs`,"data-testid":`vk-usage-tab-${e.key}`,children:e.title},e.key))}),(0,$.jsx)(g,{asChild:!0,children:(0,$.jsx)(P,{variant:`ghost`,size:`2xs`,mr:`-4px`,children:(0,$.jsx)(f,{})})})]}),(0,$.jsxs)(d,{transition:`background-color 0.3s ease, color 0.3s ease`,css:{"& pre, & code":{transition:`background-color 0.3s ease, color 0.3s ease`}},overflow:`scroll`,children:[T.map(e=>(0,$.jsx)(L,{value:e.key},e.key)),(0,$.jsx)(L,{pt:`1`,value:w.key,children:(0,$.jsx)(m,{children:(0,$.jsx)(_,{})})})]})]})})})})]})}function pt({open:e,onClose:t,keyName:n,secret:o,model:s,kind:u=`create`}){let[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1);return(0,$.jsx)(q.Root,{open:e,onOpenChange:()=>{},role:`alertdialog`,closeOnInteractOutside:!1,closeOnEscape:!1,children:(0,$.jsxs)(q.Content,{bg:`bg`,maxWidth:`560px`,children:[(0,$.jsx)(q.Header,{children:(0,$.jsx)(q.Title,{children:u===`rotate`?`Save your rotated secret`:`Save your virtual key secret`})}),(0,$.jsx)(q.Body,{children:(0,$.jsxs)(l,{align:`stretch`,gap:4,children:[(0,$.jsxs)(ne,{status:`warning`,children:[(0,$.jsx)(M,{}),(0,$.jsxs)(N,{children:[(0,$.jsx)(j,{children:`You will only see this secret once.`}),(0,$.jsx)(re,{children:`LangWatch stores only a hash. Copy and save the raw secret in your password manager or secret store before closing.`})]})]}),u===`rotate`&&(0,$.jsxs)(ne,{status:`info`,children:[(0,$.jsx)(M,{}),(0,$.jsxs)(N,{children:[(0,$.jsx)(j,{children:`24-hour grace window active.`}),(0,$.jsx)(re,{children:`The previous secret keeps working for 24 hours so clients can roll over gradually. After that it hard-fails with a 401 even though this key stays active.`})]})]}),(0,$.jsxs)(l,{align:`start`,gap:1,children:[(0,$.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Virtual key name`}),(0,$.jsx)(c,{fontWeight:`medium`,children:n})]}),(0,$.jsxs)(l,{align:`stretch`,gap:2,children:[(0,$.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Secret`}),(0,$.jsxs)(a,{border:`1px solid`,borderColor:`border.subtle`,borderRadius:`md`,padding:2,gap:2,children:[(0,$.jsx)(r,{flex:1,overflowX:`auto`,children:(0,$.jsx)(b,{fontSize:`sm`,bg:`transparent`,paddingX:0,whiteSpace:`nowrap`,children:d?o:mt(o)})}),(0,$.jsx)(P,{"aria-label":d?`Hide secret`:`Reveal secret`,variant:`ghost`,size:`sm`,onClick:()=>f(e=>!e),children:d?(0,$.jsx)(pe,{size:14}):(0,$.jsx)(ee,{size:14})}),(0,$.jsx)(P,{"aria-label":`Copy secret`,variant:`ghost`,size:`sm`,onClick:async()=>{await navigator.clipboard.writeText(o),m(!0),window.setTimeout(()=>m(!1),1500)},children:p?(0,$.jsx)(E,{size:14}):(0,$.jsx)(T,{size:14})})]})]}),(0,$.jsx)(O,{}),(0,$.jsx)(ft,{secret:o,model:s})]})}),(0,$.jsx)(q.Footer,{children:(0,$.jsxs)(a,{width:`full`,gap:4,children:[(0,$.jsxs)(a,{children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`vk-secret-confirm`,checked:h,onChange:e=>g(e.target.checked)}),(0,$.jsx)(`label`,{htmlFor:`vk-secret-confirm`,children:(0,$.jsx)(c,{fontSize:`sm`,children:`I've saved the secret in a safe place.`})})]}),(0,$.jsx)(r,{flex:1}),(0,$.jsx)(i,{colorPalette:`orange`,onClick:()=>{f(!1),m(!1),g(!1),t()},disabled:!h,children:`Close`})]})})]})})}function mt(e){return e.length<=14?`••••`:`${e.slice(0,14)}${`•`.repeat(Math.max(0,e.length-14))}`}export{Oe as C,ke as S,Le as _,it as a,Ne as b,Ye as c,Je as d,qe as f,Ie as g,Re as h,at as i,$e as l,Ve as m,ft as n,ot as o,Ke as p,lt as r,st as s,pt as t,Ge as u,Ae as v,Ee as x,Pe as y};
|
|
54
|
-
//# sourceMappingURL=VirtualKeySecretReveal-5GeVsP9d.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r}from"./portal-Sdfvrza9.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{t as a}from"./heading-C0sACr0w.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{f as c,n as l}from"./toaster-BsYkODqs.js";import{nt as u}from"./Markdown-C9extmbX.js";import{a as d,i as f,r as p}from"./alert-CPsXih3K.js";import{t as m}from"./container-Cxi_AjD-.js";import{n as h}from"./api-l6Cnm0vQ.js";import{t as g}from"./usePublicEnv-ue4-Igop.js";import{An as _,Y as v,x as y}from"./lu-DlSq9Be4.js";import{Vt as b,t as x}from"./index-CPtTUYLD.js";import{n as S,t as C}from"./tracking-D4oUOPlm.js";import{t as w}from"./CopyableInputWithPrefix-DhfQEE7R.js";var T=e(t()),E=i(),D=()=>{let{project:e}=b(),t=h.integrationsChecks.getCheckStatus.useQuery({projectId:e?.id??``},{enabled:!!e,refetchOnWindowFocus:!0,refetchOnMount:!1,staleTime:1/0});return(0,T.useEffect)(()=>{t.data?.firstMessage&&S(`integration_checks_first_message`,{project_id:e?.id}),t.data?.integrated&&S(`integration_checks_first_integration`,{project_id:e?.id}),t.data?.workflows&&S(`integration_checks_first_workflow`,{project_id:e?.id}),t.data?.onlineEvaluations&&S(`integration_checks_first_evaluation`,{project_id:e?.id}),t.data?.triggers&&S(`integration_checks_first_alert`,{project_id:e?.id}),t.data?.datasets&&S(`integration_checks_first_dataset`,{project_id:e?.id}),t.data?.customGraphs&&S(`integration_checks_first_custom_dashboard`,{project_id:e?.id})},[t.data?.customGraphs,t.data?.datasets,t.data?.onlineEvaluations,t.data?.firstMessage,t.data?.integrated,t.data?.triggers,t.data?.workflows,e?.id]),t};function O(e){return _({tag:`svg`,attr:{viewBox:`0 0 448 512`},child:[{tag:`path`,attr:{d:`M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z`},child:[]}]})(e)}function k(e){return _({tag:`svg`,attr:{viewBox:`0 0 448 512`},child:[{tag:`path`,attr:{d:`M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z`},child:[]}]})(e)}function A(e){return _({tag:`svg`,attr:{viewBox:`0 0 640 512`},child:[{tag:`path`,attr:{d:`M400.1 194.8C389.2 197.6 380.2 199.1 371 202.4C363.7 204.3 356.3 206.3 347.8 208.5L347.2 208.6C343 209.8 342.6 209.9 338.7 205.4C334 200.1 330.6 196.7 324.1 193.5C304.4 183.9 285.4 186.7 267.7 198.2C246.5 211.9 235.6 232.2 235.9 257.4C236.2 282.4 253.3 302.9 277.1 306.3C299.1 309.1 316.9 301.7 330.9 285.8C333 283.2 334.9 280.5 337 277.5V277.5L337 277.5C337.8 276.5 338.5 275.4 339.3 274.2H279.2C272.7 274.2 271.1 270.2 273.3 264.9C277.3 255.2 284.8 239 289.2 230.9C290.1 229.1 292.3 225.1 296.1 225.1H397.2C401.7 211.7 409 198.2 418.8 185.4C441.5 155.5 468.1 139.9 506 133.4C537.8 127.8 567.7 130.9 594.9 149.3C619.5 166.1 634.7 188.9 638.8 218.8C644.1 260.9 631.9 295.1 602.1 324.4C582.4 345.3 557.2 358.4 528.2 364.3C522.6 365.3 517.1 365.8 511.7 366.3C508.8 366.5 506 366.8 503.2 367.1C474.9 366.5 449 358.4 427.2 339.7C411.9 326.4 401.3 310.1 396.1 291.2C392.4 298.5 388.1 305.6 382.1 312.3C360.5 341.9 331.2 360.3 294.2 365.2C263.6 369.3 235.3 363.4 210.3 344.7C187.3 327.2 174.2 304.2 170.8 275.5C166.7 241.5 176.7 210.1 197.2 184.2C219.4 155.2 248.7 136.8 284.5 130.3C313.8 124.1 341.8 128.4 367.1 145.6C383.6 156.5 395.4 171.4 403.2 189.5C405.1 192.3 403.8 193.9 400.1 194.8zM48.3 200.4C47.05 200.4 46.74 199.8 47.36 198.8L53.91 190.4C54.53 189.5 56.09 188.9 57.34 188.9H168.6C169.8 188.9 170.1 189.8 169.5 190.7L164.2 198.8C163.6 199.8 162 200.7 161.1 200.7L48.3 200.4zM1.246 229.1C0 229.1-.3116 228.4 .3116 227.5L6.855 219.1C7.479 218.2 9.037 217.5 10.28 217.5H152.4C153.6 217.5 154.2 218.5 153.9 219.4L151.4 226.9C151.1 228.1 149.9 228.8 148.6 228.8L1.246 229.1zM75.72 255.9C75.1 256.8 75.41 257.7 76.65 257.7L144.6 258C145.5 258 146.8 257.1 146.8 255.9L147.4 248.4C147.4 247.1 146.8 246.2 145.5 246.2H83.2C81.95 246.2 80.71 247.1 80.08 248.1L75.72 255.9zM577.2 237.9C577 235.3 576.9 233.1 576.5 230.9C570.9 200.1 542.5 182.6 512.9 189.5C483.9 196 465.2 214.4 458.4 243.7C452.8 268 464.6 292.6 487 302.6C504.2 310.1 521.3 309.2 537.8 300.7C562.4 287.1 575.8 268 577.4 241.2C577.3 240 577.3 238.9 577.2 237.9z`},child:[]}]})(e)}function j(e){return _({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M4.5 11h-2V9H1v6h1.5v-2.5h2V15H6V9H4.5zm2.5-.5h1.5V15H10v-4.5h1.5V9H7zm5.5 0H14V15h1.5v-4.5H17V9h-4.5zm9-1.5H18v6h1.5v-2h2c.8 0 1.5-.7 1.5-1.5v-1c0-.8-.7-1.5-1.5-1.5m0 2.5h-2v-1h2z`},child:[]},{tag:`path`,attr:{fill:`none`,d:`M24 24H0V0h24z`},child:[]}]})(e)}var M=[{icon:(0,E.jsx)(O,{size:16,color:`#4584b6`}),label:`Get started using our Python SDK`,href:`https://docs.langwatch.ai/integration/python/guide`,event:`integration_guide_click`,language:`python`,bg:`blue.50`},{icon:(0,E.jsx)(k,{size:16,color:`#2563eb`}),label:`Follow the TypeScript guide`,href:`https://docs.langwatch.ai/integration/typescript/guide`,event:`integration_guide_click`,language:`typescript`,bg:`cyan.50`},{icon:(0,E.jsx)(A,{size:16,color:`#00ADD8`}),label:`Get going with our Golang SDK`,href:`https://github.com/langwatch/langwatch/tree/main/sdk-go`,event:`integration_guide_click`,language:`golang`,bg:`gray.100`},{icon:(0,E.jsx)(j,{size:16,color:`grey.500`}),label:`Integrate directly with the LangWatch API`,href:`https://docs.langwatch.ai/integration/rest-api`,event:`integration_guide_click`,language:`rest`,bg:`gray.100`}],N=({guide:e,onClick:t})=>(0,E.jsxs)(c,{as:`a`,href:e.href,target:`_blank`,rel:`noopener noreferrer`,display:`flex`,alignItems:`center`,gap:3,px:3,py:2,borderRadius:`md`,borderWidth:1,borderColor:`border`,_hover:{textDecoration:`none`,bg:`bg.muted`,borderColor:`border.emphasized`},transition:`all 0.2s`,onClick:t,"aria-label":e.label+` (opens in a new tab)`,children:[e.icon,(0,E.jsx)(o,{flex:1,textAlign:`left`,children:e.label}),(0,E.jsx)(r,{as:`span`,color:`fg.subtle`,ml:1,display:`flex`,alignItems:`center`,children:(0,E.jsx)(v,{size:16})})]}),P=()=>{let{project:e}=b();return(0,E.jsx)(s,{gap:2,fontSize:`sm`,align:`stretch`,width:`full`,children:M.map(t=>(0,E.jsx)(N,{guide:t,onClick:()=>C(t.event,{language:t.language,project_id:e?.id})},t.href))})},F=()=>{let{project:e}=b(),t=g(),i=!!D().data?.firstMessage,c=e?.apiKey??``,m=t.data?.BASE_HOST??``;async function h({withBashPrefix:t}){C(`api_key_copy`,{project_id:e?.id});try{await navigator.clipboard.writeText(t?`LANGWATCH_API_KEY=${c}`:c),l.create({title:`Copied`,description:`API key copied to clipboard`,type:`success`,meta:{closable:!0}})}catch{l.create({title:`Copy failed`,description:`Couldn't copy the API key. Please try again.`,type:`error`,meta:{closable:!0}})}}async function _({withBashPrefix:t}){C(`endpoint_copy`,{project_id:e?.id});try{await navigator.clipboard.writeText(t?`LANGWATCH_ENDPOINT=${m}`:m),l.create({title:`Copied`,description:`Endpoint copied to clipboard`,type:`success`,meta:{closable:!0}})}catch{l.create({title:`Copy failed`,description:`Couldn't copy the endpoint. Please try again.`,type:`error`,meta:{closable:!0}})}}return(0,E.jsxs)(s,{minH:`80px`,boxShadow:`sm`,borderRadius:`xl`,bg:`bg`,p:4,gap:2,align:`stretch`,children:[(0,E.jsxs)(r,{mb:1,children:[(0,E.jsx)(a,{size:`md`,textAlign:`left`,children:`Connect to LangWatch`}),(0,E.jsx)(o,{fontSize:`xs`,color:`fg.muted`,textAlign:`left`,children:`Follow the instructions on our docs to setup your project with LangWatch!`})]}),(0,E.jsxs)(s,{align:`start`,gap:1,fontSize:`sm`,w:`full`,mb:1,children:[(0,E.jsxs)(s,{align:`start`,children:[(0,E.jsx)(o,{fontSize:`sm`,color:`fg`,fontWeight:`medium`,children:`API key`}),(0,E.jsx)(o,{fontSize:`xs`,color:`fg.muted`,fontWeight:`normal`,mt:-1,children:`Keep it secret, keep it safe. Don't let this key fall into prying eyes.`})]}),(0,E.jsx)(w,{prefix:`LANGWATCH_API_KEY=`,value:c,ariaLabel:`API key`,showVisibilityToggle:!0,onCopy:h})]}),m&&m!==`https://app.langwatch.ai`&&(0,E.jsxs)(s,{align:`start`,gap:1,fontSize:`sm`,w:`full`,mb:1,children:[(0,E.jsxs)(s,{align:`start`,children:[(0,E.jsx)(o,{fontSize:`sm`,color:`fg`,fontWeight:`medium`,children:`Endpoint`}),(0,E.jsx)(o,{fontSize:`xs`,color:`fg.muted`,fontWeight:`normal`,mt:-1,children:`This is the endpoint you should configure in your SDK to send data to LangWatch.`})]}),(0,E.jsx)(w,{prefix:`LANGWATCH_ENDPOINT=`,value:m,ariaLabel:`Endpoint`,onCopy:_})]}),(0,E.jsx)(r,{mt:1,children:i?(0,E.jsxs)(f,{size:`sm`,borderStartWidth:`3px`,borderStartColor:`green.500`,colorPalette:`green`,title:`Integration configured`,children:[(0,E.jsx)(p,{children:(0,E.jsx)(y,{size:16})}),(0,E.jsx)(d,{children:`Integration configured — traces are being received`})]}):(0,E.jsxs)(f,{size:`sm`,borderStartWidth:`3px`,borderStartColor:`orange.400`,colorPalette:`orange`,title:`Waiting for first trace...`,children:[(0,E.jsx)(p,{children:(0,E.jsx)(n,{size:`sm`})}),(0,E.jsx)(d,{children:`Waiting for first trace...`})]})}),(0,E.jsx)(u,{marginY:4}),(0,E.jsx)(P,{}),i?(0,E.jsxs)(f,{colorPalette:`orange`,borderRadius:`md`,children:[(0,E.jsx)(p,{}),(0,E.jsxs)(d,{children:[`Ready to go deeper? Set up`,(0,E.jsxs)(x,{href:`https://docs.langwatch.ai/evaluations`,isExternal:!0,ml:1,textDecoration:`underline`,textDecorationStyle:`dashed`,children:[`Evaluations`,(0,E.jsx)(v,{})]}),` `,`to automatically score your LLM outputs.`]})]}):(0,E.jsxs)(f,{colorPalette:`orange`,borderRadius:`md`,children:[(0,E.jsx)(p,{}),(0,E.jsxs)(d,{children:[`Pick a guide above, or check our`,(0,E.jsxs)(x,{href:`https://docs.langwatch.ai/integration`,isExternal:!0,ml:1,textDecoration:`underline`,textDecorationStyle:`dashed`,children:[`step-by-step integration docs`,(0,E.jsx)(v,{})]}),` `,`to start sending traces.`]})]})]})},I=()=>(0,E.jsx)(r,{minH:`100vh`,py:6,px:2,w:`full`,children:(0,E.jsx)(m,{maxW:`container.md`,w:`full`,mx:`auto`,children:(0,E.jsx)(s,{gap:{base:4,md:6},align:`start`,children:(0,E.jsx)(s,{gap:6,w:`full`,pt:16,children:(0,E.jsx)(F,{})})})})});export{I as t};
|
|
2
|
-
//# sourceMappingURL=WelcomeLayout-CDTLOa4d.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CFwixLRt.js";import{Vt as t}from"./DashboardLayout-BhHe0vIT.js";import{Vt as n}from"./index-CPtTUYLD.js";import{n as r}from"./useFeatureFlag-Do1Ecu3l.js";import{t as i}from"./LoadingScreen-DQ62wqSN.js";var a=e();function o(e,o){return function(s){let{bypassOnboardingRedirect:c=!1}=o??{},l=o=>{let{organization:l,isLoading:u}=n(c?{redirectToOnboarding:!1,redirectToProjectOnboarding:!1}:void 0),d=l?.id??``,{enabled:f,isLoading:p}=r(e,{organizationId:d,enabled:!!d});return u||d&&p?(0,a.jsx)(i,{}):f?(0,a.jsx)(s,{...o}):(0,a.jsx)(t,{})};return l.displayName=`withFeatureFlagGuard(${s.displayName??s.name??`Component`})`,l}}export{o as t};
|
|
2
|
-
//# sourceMappingURL=WithFeatureFlagGuard-OePuXWRG.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{dn as e}from"./portal-Sdfvrza9.js";import{t}from"./jsx-runtime-CFwixLRt.js";import{n}from"./v-stack-hkuSkmCA.js";import{fn as r}from"./ProjectAvatar-DtI9dT1f.js";import{a as i,i as a,n as o,r as s,t as c}from"./alert-CPsXih3K.js";import{Vt as l}from"./index-CPtTUYLD.js";var u=t();function d({message:t,alertProps:l={},permission:d}){let f=`You don't have permission to view this content. Required permission: ${d}. Ask your team administrator to request access.`,p=t??f;return(0,u.jsx)(e,{padding:4,children:(0,u.jsxs)(a,{status:`warning`,...l,children:[(0,u.jsx)(s,{children:(0,u.jsx)(r,{size:16})}),(0,u.jsxs)(c,{children:[(0,u.jsx)(i,{children:`Access Restricted`}),(0,u.jsx)(o,{children:(0,u.jsx)(n,{children:p})})]})]})})}function f(e,t){return function(n){let{fallbackComponent:r=d,layoutComponent:i,customMessage:a,bypassOnboardingRedirect:o=!1}=t??{},s=t=>{let{hasAnyPermission:s,isLoading:c}=l(o?{redirectToOnboarding:!1,redirectToProjectOnboarding:!1}:void 0);if(c)return(0,u.jsx)(n,{...t});if(!s(e)){let t=(0,u.jsx)(r,{permission:e,message:a});return i?(0,u.jsx)(i,{children:t}):t}return(0,u.jsx)(n,{...t})};return s.displayName=`withPermissionGuard(${n.displayName??n.name??`Component`})`,s}}export{d as n,f as t};
|
|
2
|
-
//# sourceMappingURL=WithPermissionGuard-Cr6Aljmy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i,t as a}from"./v-stack-hkuSkmCA.js";import{t as o}from"./tooltip-gjZ4s2dt.js";import{n as s}from"./toaster-BsYkODqs.js";import{L as c,O as l}from"./Markdown-C9extmbX.js";import{t as u}from"./errors-e711UMq7.js";import{t as d}from"./spacer-C38e7o6r.js";import{n as f}from"./api-l6Cnm0vQ.js";import{D as p,Vt as m}from"./index-CPtTUYLD.js";import{t as h}from"./arrow-up-D_DfWcfb.js";import{r as g}from"./ColorfulBlockIcons-Ctm_Gy50.js";import{t as _}from"./copy-DPUyWClX.js";import{t as v}from"./more-vertical-CnKfgTmQ.js";import{t as y}from"./refresh-cw-C7FbMWoi.js";import{t as b}from"./trash-2-Bq5tW_xF.js";import{t as x}from"./CascadeArchiveDialog-BOcl2osO.js";import{n as S,t as C}from"./useProjectsForCopy-B8F_BY79.js";import{t as w}from"./PushToCopiesDialog-B_hvn6aW.js";var T=e(t()),E=r(),D=({open:e,onClose:t,workflowId:n,workflowName:r})=>{let{project:i}=m(),a=f.useContext(),o=f.workflow.copy.useMutation(),s=C(`workflows:create`),[c,u]=(0,T.useState)(!1);return i?(0,E.jsx)(S,{open:e,onClose:t,onSuccess:()=>void a.workflow.getAll.invalidate(),title:`Replicate Workflow`,entityLabel:`Workflow`,sourceName:r,sourceId:n,sourceProjectId:i.id,projects:s,onCopy:async({projectId:e,sourceProjectId:t,copyDatasets:r})=>{await o.mutateAsync({workflowId:n,projectId:e,sourceProjectId:t,copyDatasets:!!r})},isLoading:o.isLoading,extraContent:(0,E.jsx)(l,{checked:c,onCheckedChange:e=>u(!!e.checked),children:`Replicate associated dataset`}),getExtraCopyParams:()=>({copyDatasets:c})}):null},O=({open:e,onClose:t,workflowId:n,workflowName:r})=>{let{project:i}=m(),a=f.workflow.pushToCopies.useMutation(),o=f.useContext(),[s,c]=(0,T.useState)(new Set),{data:l,isLoading:u,error:d}=f.workflow.getCopies.useQuery({projectId:i?.id??``,workflowId:n},{enabled:e&&!!i?.id&&!!n}),[p,h]=(0,T.useState)([]);return(0,T.useEffect)(()=>{l&&(h(l),c(new Set(l.map(e=>e.id))))},[l]),(0,E.jsx)(w,{open:e,onClose:t,entityLabel:`Workflow`,sourceName:r,copies:p,isLoading:u,error:d,selectedCopyIds:s,onToggleCopy:e=>{let t=new Set(s);t.has(e)?t.delete(e):t.add(e),c(t)},onPush:async()=>{if(!i)throw Error(`No project available for push`);let e=await a.mutateAsync({workflowId:n,projectId:i.id,copyIds:Array.from(s)});return await o.workflow.getAll.invalidate(),e},pushLoading:a.isLoading,bodyIntro:`Select which replicas to push the latest version to:`,emptyMessage:(0,E.jsx)(E.Fragment,{children:`No replicas found. This may be because you don't have workflows:update permission on the replica projects, or the replicas have been archived.`}),onSuccess:()=>c(new Set)})};function k(e){return(0,E.jsx)(a,{align:`start`,padding:4,gap:2,borderRadius:`xl`,background:`bg.panel`,boxShadow:`md`,height:`142px`,cursor:`pointer`,role:`button`,transition:`all 0.2s ease-in-out`,border:`1px solid`,borderColor:`border.muted`,_hover:{boxShadow:`xl`,textDecoration:`none`},...e,children:e.children})}function A({name:e,icon:t,updatedAt:r,action:a,...o}){return(0,E.jsxs)(k,{paddingX:0,...o,children:[(0,E.jsxs)(n,{gap:4,paddingX:4,paddingBottom:2,width:`full`,children:[(0,E.jsx)(g,{icon:t,size:`lg`}),(0,E.jsx)(d,{}),a]}),(0,E.jsx)(d,{}),(0,E.jsx)(i,{paddingX:4,color:`fg`,fontSize:`sm`,fontWeight:500,children:e}),r&&(0,E.jsx)(i,{paddingX:4,color:`fg.subtle`,fontSize:`12px`,children:p(typeof r==`number`?r:r.getTime())})]})}function j({workflowId:e,query:t,name:r,icon:a,description:l,children:S,...C}){let{project:w}=m(),A=f.workflow.archive.useMutation(),j=f.workflow.cascadeArchive.useMutation(),M=f.workflow.syncFromSource.useMutation(),[N,P]=(0,T.useState)(!1),[F,I]=(0,T.useState)(!1),[L,R]=(0,T.useState)(!1),z=f.workflow.getRelatedEntities.useQuery({workflowId:e??``,projectId:w?.id??``},{enabled:N&&!!e&&!!w?.id}),B=e?t?.data?.find(t=>t.id===e):void 0,V=!!B?.copiedFromWorkflowId,H=(B?._count?.copiedWorkflows??0)>0,U=B?.copiedFrom?`${B.copiedFrom.project.team.organization.name} / ${B.copiedFrom.project.team.name} / ${B.copiedFrom.project.name}`:void 0,W=(0,T.useCallback)(()=>{!e||!w||M.mutate({workflowId:e,projectId:w.id},{onSuccess:()=>{t?.refetch(),s.create({title:`Workflow updated`,description:`Workflow "${r}" has been updated from source.`,type:`success`,meta:{closable:!0}})},onError:e=>u({error:e,fallbackTitle:`Couldn't update workflow from source`})})},[M,e,w,t,r]),G=(0,T.useCallback)(()=>{R(!0)},[]),K=(0,T.useCallback)(()=>{!e||!w||((z.data?.evaluators.length??0)>0||(z.data?.agents.length??0)>0?j.mutate({workflowId:e,projectId:w.id},{onSuccess:e=>{P(!1),t?.refetch();let n=[];e.archivedEvaluatorsCount>0&&n.push(`${e.archivedEvaluatorsCount} evaluator${e.archivedEvaluatorsCount>1?`s`:``}`),e.archivedAgentsCount>0&&n.push(`${e.archivedAgentsCount} agent${e.archivedAgentsCount>1?`s`:``}`),e.deletedMonitorsCount>0&&n.push(`${e.deletedMonitorsCount} online evaluation${e.deletedMonitorsCount>1?`s`:``}`),s.create({title:`Workflow "${r}" deleted`,description:n.length>0?`Also deleted: ${n.join(`, `)}`:void 0,type:`success`,meta:{closable:!0}})},onError:e=>u({error:e,fallbackTitle:`Couldn't delete workflow`})}):A.mutate({workflowId:e,projectId:w.id},{onSuccess:()=>{P(!1),t?.refetch(),s.create({title:`Workflow "${r}" deleted`,type:`success`,meta:{closable:!0}})},onError:e=>u({error:e,fallbackTitle:`Couldn't delete workflow`})}))},[A,j,r,w,t,z.data,e]);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(k,{paddingX:0,...C,children:[(0,E.jsxs)(n,{gap:4,paddingX:4,paddingBottom:2,width:`full`,children:[(0,E.jsx)(g,{icon:a,size:`lg`}),l&&(0,E.jsx)(i,{color:`fg`,fontSize:`sm`,fontWeight:500,children:r}),(0,E.jsx)(d,{}),e&&(0,E.jsxs)(c.Root,{children:[(0,E.jsx)(c.Trigger,{className:`js-inner-menu`,children:(0,E.jsx)(v,{size:16})}),(0,E.jsxs)(c.Content,{className:`js-inner-menu`,children:[V&&(0,E.jsx)(o,{content:U?`Copied from: ${U}`:void 0,disabled:!U,positioning:{placement:`right`},showArrow:!0,children:(0,E.jsxs)(c.Item,{value:`sync`,onClick:()=>W(),children:[(0,E.jsx)(y,{size:16}),` Update from source`]})}),H&&(0,E.jsxs)(c.Item,{value:`push`,onClick:()=>G(),children:[(0,E.jsx)(h,{size:16}),` Push to replicas`]}),(0,E.jsxs)(c.Item,{value:`copy`,onClick:()=>I(!0),children:[(0,E.jsx)(_,{size:16}),` Replicate to another project`]}),(0,E.jsxs)(c.Item,{value:`delete`,color:`red.500`,onClick:()=>P(!0),children:[(0,E.jsx)(b,{size:16}),` Delete`]})]})]})]}),S,!l&&(0,E.jsx)(d,{}),(0,E.jsx)(i,{paddingX:4,color:`fg`,fontSize:`sm`,fontWeight:l?void 0:500,children:l??r}),(0,E.jsx)(i,{paddingX:4,color:`fg.subtle`,fontSize:`12px`,children:p(B?.updatedAt?.getTime()??0)})]}),(0,E.jsx)(x,{open:N,onClose:()=>P(!1),onConfirm:K,isLoading:j.isPending||A.isPending,isLoadingRelated:z.isLoading,entityType:`workflow`,entityName:r,relatedEntities:{evaluators:z.data?.evaluators,agents:z.data?.agents,monitors:z.data?.monitors}}),e&&(0,E.jsx)(D,{open:F,onClose:()=>I(!1),workflowId:e,workflowName:r}),e&&(0,E.jsx)(O,{open:L,onClose:()=>R(!1),workflowId:e,workflowName:r})]})}export{A as n,j as t};
|
|
2
|
-
//# sourceMappingURL=WorkflowCard-SFB2TN6O.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./heading-C0sACr0w.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{tr as l}from"./ProjectAvatar-DtI9dT1f.js";import{a as u,r as d,t as f}from"./field-BadoNaN5.js";import{n as p}from"./personalProject-DMRX2-SI.js";import{l as ee,t as m,u as h}from"./errors-e711UMq7.js";import{tt as te}from"./immer-CFru3D02.js";import{n as g}from"./api-l6Cnm0vQ.js";import{r as _}from"./next-router-CWLrMXvP.js";import{n as v}from"./lu-DlSq9Be4.js";import{s as y}from"./index.esm-Cpy5fWo1.js";import{I as b,Mr as x,Vt as S,W as C,z as w}from"./index-CPtTUYLD.js";import{t as ne}from"./tracking-D4oUOPlm.js";import{t as T}from"./useLicenseEnforcement-DOI0dcqD.js";import{t as E}from"./useCompoundLicenseCheck-BqNF-zzC.js";import{t as D}from"./EmojiPickerModal-DOTbYgFl.js";import{n as O}from"./NewWorkflowForm-CsYSc1Vr.js";import{t as k}from"./custom_evaluator-DgcItmbH.js";var A=e(t()),j=a();function M(e){let{project:t}=S(),{closeDrawer:a,canGoBack:M,goBack:N}=C(),P=b(),F=g.useContext(),I=_(),L=l(),R=e.onClose??a,z=w(`workflowSelectorForEvaluator`),B=e.onSave??z?.onSave??P.onSave,re=e.open!==!1&&e.open!==void 0,V=T(`evaluators`),H=T(`workflows`),[U]=(0,A.useState)(O()),W=y({defaultValues:{name:e.evaluatorName??``,icon:U,description:``}}),{register:G,handleSubmit:K,watch:q,setValue:J,formState:{errors:Y}}=W,X=q(`icon`),ie=q(`name`),Z=g.workflow.create.useMutation(),Q=g.evaluators.create.useMutation({onSuccess:e=>{F.evaluators.getAll.invalidate({projectId:t?.id??``}),B?.({id:e.id,name:e.name,workflowId:e.workflowId??``})}}),$=Z.isPending||Q.isPending,ae=(0,A.useCallback)(async e=>{if(t)try{let n={...k,name:e.name,description:e.description,icon:e.icon??U},r=await Z.mutateAsync({projectId:t.id,dsl:n,commitMessage:`Workflow creation for evaluator`,publish:!0});ne(`workflow_create`,{project_id:t.id}),await Q.mutateAsync({projectId:t.id,name:e.name.trim(),type:`workflow`,config:{},workflowId:r.workflow.id}),R(),I.push(`/${t.slug}/studio/${r.workflow.id}`)}catch(e){if(console.error(`Error creating workflow evaluator:`,e),h({error:e,form:W,hasFormErrorSlot:!0}))return;m({error:e,fallbackTitle:`Couldn't create workflow evaluator`})}},[t,U,Z,Q,R,I,W]),oe=ie?.trim().length>0;return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(p.Root,{open:re,onOpenChange:({open:e})=>!e&&R(),size:`md`,modal:!1,children:(0,j.jsxs)(p.Content,{bg:`bg`,children:[(0,j.jsx)(p.CloseTrigger,{}),(0,j.jsx)(p.Header,{children:(0,j.jsxs)(i,{gap:2,children:[M&&(0,j.jsx)(r,{variant:`ghost`,size:`sm`,onClick:N,padding:1,minWidth:`auto`,"data-testid":`back-button`,children:(0,j.jsx)(v,{size:20})}),(0,j.jsx)(o,{children:`Create Workflow Evaluator`})]})}),(0,j.jsx)(p.Body,{display:`flex`,flexDirection:`column`,overflow:`hidden`,padding:0,children:(0,j.jsxs)(c,{gap:4,align:`stretch`,flex:1,overflow:`hidden`,children:[(0,j.jsx)(s,{color:`fg.muted`,fontSize:`sm`,paddingX:6,paddingTop:4,children:`Create a new workflow to use as a custom evaluator. You'll be taken to the workflow editor to configure the evaluation logic.`}),(0,j.jsx)(n,{paddingX:6,children:(0,j.jsxs)(c,{gap:4,align:`stretch`,children:[(0,j.jsx)(ee,{form:W}),(0,j.jsxs)(u,{invalid:!!Y.name||!!Y.icon,children:[(0,j.jsx)(D,{open:L.open,onClose:L.onClose,onChange:e=>{J(`icon`,e),L.onClose()}}),(0,j.jsx)(d,{children:`Name and Icon`}),(0,j.jsxs)(i,{children:[(0,j.jsx)(r,{variant:`outline`,onClick:L.onOpen,fontSize:`18px`,children:X}),(0,j.jsx)(x,{...G(`name`,{required:`Name is required`}),placeholder:`Enter evaluator name`,"data-testid":`evaluator-name-input`})]}),(0,j.jsx)(f,{children:Y.name?.message??Y.icon?.message})]}),(0,j.jsxs)(u,{invalid:!!Y.description,children:[(0,j.jsx)(d,{children:`Description (optional)`}),(0,j.jsx)(te,{...G(`description`),placeholder:`What does this evaluator check?`}),(0,j.jsx)(f,{children:Y.description?.message})]})]})})]})}),(0,j.jsx)(p.Footer,{borderTopWidth:`1px`,borderColor:`border`,children:(0,j.jsxs)(i,{gap:3,children:[(0,j.jsx)(r,{variant:`outline`,onClick:R,children:`Cancel`}),(0,j.jsx)(r,{colorPalette:`green`,onClick:()=>{E([H,V],()=>void K(ae)())},disabled:!oe||$,loading:$,"data-testid":`save-evaluator-button`,children:`Create & Open Editor`})]})})]})})})}export{M as WorkflowSelectorForEvaluatorDrawer};
|
|
2
|
-
//# sourceMappingURL=WorkflowSelectorForEvaluatorDrawer-C9JwDruB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{r}from"./next-router-CWLrMXvP.js";import{Vt as i}from"./index-CPtTUYLD.js";import{t as a}from"./LoadingScreen-DQ62wqSN.js";var o=e(t()),s=n();function c(){let{project:e}=i(),t=r(),{path:n}=t.query;return(0,o.useEffect)(()=>{let r=setTimeout(()=>{t.push(`/`)},5e3);return e&&Array.isArray(n)&&(clearTimeout(r),t.push(`/${e.slug}/${n.join(`/`)}`)),()=>clearTimeout(r)},[n,e,t]),(0,s.jsx)(a,{})}export{c as default};
|
|
2
|
-
//# sourceMappingURL=_...path_-Cgdgmf5W.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,r,s as i}from"./fetchSSE-5rVPow_l.js";var a=Array.isArray,o=`[object AsyncFunction]`,s=`[object Function]`,c=`[object GeneratorFunction]`,l=`[object Proxy]`;function u(t){if(!r(t))return!1;var n=e(t);return n==s||n==c||n==o||n==l}var d=i[`__core-js_shared__`],f=function(){var e=/[^.]+$/.exec(d&&d.keys&&d.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function ee(e){return!!f&&f in e}var te=Function.prototype.toString;function p(e){if(e!=null){try{return te.call(e)}catch{}try{return e+``}catch{}}return``}var ne=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,ie=Function.prototype,ae=Object.prototype,oe=ie.toString,se=ae.hasOwnProperty,ce=RegExp(`^`+oe.call(se).replace(ne,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function le(e){return!r(e)||ee(e)?!1:(u(e)?ce:re).test(p(e))}function ue(e,t){return e?.[t]}function m(e,t){var n=ue(e,t);return le(n)?n:void 0}var h=m(i,`WeakMap`),de=function(){try{var e=m(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),fe=9007199254740991,pe=/^(?:0|[1-9]\d*)$/;function me(e,t){var n=typeof e;return t??=fe,!!t&&(n==`number`||n!=`symbol`&&pe.test(e))&&e>-1&&e%1==0&&e<t}function g(e,t){return e===t||e!==e&&t!==t}var he=9007199254740991;function _(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=he}function v(e){return e!=null&&_(e.length)&&!u(e)}var ge=Object.prototype;function _e(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||ge)}function ve(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ye=`[object Arguments]`;function y(t){return n(t)&&e(t)==ye}var b=Object.prototype,be=b.hasOwnProperty,xe=b.propertyIsEnumerable,x=y(function(){return arguments}())?y:function(e){return n(e)&&be.call(e,`callee`)&&!xe.call(e,`callee`)};function Se(){return!1}var S=typeof exports==`object`&&exports&&!exports.nodeType&&exports,C=S&&typeof module==`object`&&module&&!module.nodeType&&module,w=C&&C.exports===S?i.Buffer:void 0,T=(w?w.isBuffer:void 0)||Se,Ce=`[object Arguments]`,we=`[object Array]`,Te=`[object Boolean]`,Ee=`[object Date]`,De=`[object Error]`,Oe=`[object Function]`,ke=`[object Map]`,Ae=`[object Number]`,je=`[object Object]`,Me=`[object RegExp]`,Ne=`[object Set]`,Pe=`[object String]`,Fe=`[object WeakMap]`,Ie=`[object ArrayBuffer]`,Le=`[object DataView]`,Re=`[object Float32Array]`,ze=`[object Float64Array]`,Be=`[object Int8Array]`,Ve=`[object Int16Array]`,He=`[object Int32Array]`,Ue=`[object Uint8Array]`,We=`[object Uint8ClampedArray]`,Ge=`[object Uint16Array]`,Ke=`[object Uint32Array]`,E={};E[Re]=E[ze]=E[Be]=E[Ve]=E[He]=E[Ue]=E[We]=E[Ge]=E[Ke]=!0,E[Ce]=E[we]=E[Ie]=E[Te]=E[Le]=E[Ee]=E[De]=E[Oe]=E[ke]=E[Ae]=E[je]=E[Me]=E[Ne]=E[Pe]=E[Fe]=!1;function qe(t){return n(t)&&_(t.length)&&!!E[e(t)]}function D(e){return function(t){return e(t)}}var O=typeof exports==`object`&&exports&&!exports.nodeType&&exports,k=O&&typeof module==`object`&&module&&!module.nodeType&&module,A=k&&k.exports===O&&t.process,j=function(){try{return k&&k.require&&k.require(`util`).types||A&&A.binding&&A.binding(`util`)}catch{}}(),M=j&&j.isTypedArray,N=M?D(M):qe,Je=Object.prototype.hasOwnProperty;function P(e,t){var n=a(e),r=!n&&x(e),i=!n&&!r&&T(e),o=!n&&!r&&!i&&N(e),s=n||r||i||o,c=s?ve(e.length,String):[],l=c.length;for(var u in e)(t||Je.call(e,u))&&!(s&&(u==`length`||i&&(u==`offset`||u==`parent`)||o&&(u==`buffer`||u==`byteLength`||u==`byteOffset`)||me(u,l)))&&c.push(u);return c}function F(e,t){return function(n){return e(t(n))}}var Ye=F(Object.keys,Object),Xe=Object.prototype.hasOwnProperty;function I(e){if(!_e(e))return Ye(e);var t=[];for(var n in Object(e))Xe.call(e,n)&&n!=`constructor`&&t.push(n);return t}function L(e){return v(e)?P(e):I(e)}var R=m(Object,`create`);function Ze(){this.__data__=R?R(null):{},this.size=0}function Qe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var $e=`__lodash_hash_undefined__`,et=Object.prototype.hasOwnProperty;function tt(e){var t=this.__data__;if(R){var n=t[e];return n===$e?void 0:n}return et.call(t,e)?t[e]:void 0}var nt=Object.prototype.hasOwnProperty;function rt(e){var t=this.__data__;return R?t[e]!==void 0:nt.call(t,e)}var it=`__lodash_hash_undefined__`;function at(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=R&&t===void 0?it:t,this}function z(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}z.prototype.clear=Ze,z.prototype.delete=Qe,z.prototype.get=tt,z.prototype.has=rt,z.prototype.set=at;function ot(){this.__data__=[],this.size=0}function B(e,t){for(var n=e.length;n--;)if(g(e[n][0],t))return n;return-1}var st=Array.prototype.splice;function ct(e){var t=this.__data__,n=B(t,e);return n<0?!1:(n==t.length-1?t.pop():st.call(t,n,1),--this.size,!0)}function lt(e){var t=this.__data__,n=B(t,e);return n<0?void 0:t[n][1]}function ut(e){return B(this.__data__,e)>-1}function dt(e,t){var n=this.__data__,r=B(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function V(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}V.prototype.clear=ot,V.prototype.delete=ct,V.prototype.get=lt,V.prototype.has=ut,V.prototype.set=dt;var H=m(i,`Map`);function ft(){this.size=0,this.__data__={hash:new z,map:new(H||V),string:new z}}function pt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function U(e,t){var n=e.__data__;return pt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function mt(e){var t=U(this,e).delete(e);return this.size-=+!!t,t}function ht(e){return U(this,e).get(e)}function gt(e){return U(this,e).has(e)}function _t(e,t){var n=U(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function W(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}W.prototype.clear=ft,W.prototype.delete=mt,W.prototype.get=ht,W.prototype.has=gt,W.prototype.set=_t;function G(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function vt(){this.__data__=new V,this.size=0}function yt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function bt(e){return this.__data__.get(e)}function xt(e){return this.__data__.has(e)}var St=200;function Ct(e,t){var n=this.__data__;if(n instanceof V){var r=n.__data__;if(!H||r.length<St-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new W(r)}return n.set(e,t),this.size=n.size,this}function K(e){var t=this.__data__=new V(e);this.size=t.size}K.prototype.clear=vt,K.prototype.delete=yt,K.prototype.get=bt,K.prototype.has=xt,K.prototype.set=Ct;function q(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function J(){return[]}var wt=Object.prototype.propertyIsEnumerable,Tt=Object.getOwnPropertySymbols,Et=Tt?function(e){return e==null?[]:(e=Object(e),q(Tt(e),function(t){return wt.call(e,t)}))}:J;function Dt(e,t,n){var r=t(e);return a(e)?r:G(r,n(e))}function Ot(e){return Dt(e,L,Et)}var Y=m(i,`DataView`),X=m(i,`Promise`),Z=m(i,`Set`),kt=`[object Map]`,At=`[object Object]`,jt=`[object Promise]`,Mt=`[object Set]`,Nt=`[object WeakMap]`,Q=`[object DataView]`,Pt=p(Y),Ft=p(H),It=p(X),Lt=p(Z),Rt=p(h),$=e;(Y&&$(new Y(new ArrayBuffer(1)))!=Q||H&&$(new H)!=kt||X&&$(X.resolve())!=jt||Z&&$(new Z)!=Mt||h&&$(new h)!=Nt)&&($=function(t){var n=e(t),r=n==At?t.constructor:void 0,i=r?p(r):``;if(i)switch(i){case Pt:return Q;case Ft:return kt;case It:return jt;case Lt:return Mt;case Rt:return Nt}return n});var zt=$,Bt=i.Uint8Array;export{_ as C,u as D,de as E,a as O,v as S,me as T,j as _,Dt as a,x as b,q as c,W as d,L as f,N as g,P as h,Ot as i,K as l,F as m,zt as n,Et as o,I as p,Z as r,J as s,Bt as t,G as u,D as v,g as w,_e as x,T as y};
|
|
2
|
-
//# sourceMappingURL=_Uint8Array-DZ50H-2q.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./skeleton-0JSrjbwm.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{An as u,B as d,I as f,L as p,R as m,Tn as h,c as g,s as _}from"./ProjectAvatar-DtI9dT1f.js";import{t as v}from"./tooltip-gjZ4s2dt.js";import{c as y,d as b,n as x,s as S}from"./toaster-BsYkODqs.js";import{P as C,nt as w}from"./Markdown-C9extmbX.js";import{t as T}from"./grid-DVy6ELOp.js";import{t as E}from"./icon-D6xQEiPb.js";import{L as D,t as O}from"./DashboardLayout-BhHe0vIT.js";import{r as k,t as A}from"./card-By_Mbslh.js";import{t as j}from"./icon-button-Wlb_dGXL.js";import{a as ee,i as M,n as te,r as ne,t as N}from"./empty-state-T8EYr5NF.js";import{r as re,t as ie}from"./errors-e711UMq7.js";import{n as P,r as F,t as I}from"./native-select-DL2k8x0o.js";import{t as L}from"./spacer-C38e7o6r.js";import{$ as R,D as ae,R as oe,et as se}from"./immer-CFru3D02.js";import{n as z}from"./api-l6Cnm0vQ.js";import{p as ce}from"./trpcError-CFsR-0nB.js";import{t as B}from"./chart-column-C_0m1L5h.js";import{t as V}from"./circle-check-big-D-K-PM08.js";import{t as le}from"./layers-SRlsNtld.js";import{t as ue}from"./panel-left-open-Bf-QpV_2.js";import{t as de}from"./ban-j_wknngy.js";import{t as H}from"./layout-grid-DMvOyIz5.js";import{t as U}from"./panel-right-open-Pt-tdj9B.js";import{t as fe}from"./refresh-cw-CjWtrqB1.js";import{t as W}from"./repeat-BKgk_yGi.js";import{t as pe}from"./square-CjSARahU.js";import{t as me}from"./target-HEjqRNmI.js";import{r as he}from"./next-router-CWLrMXvP.js";import{C as G,L as ge,On as _e,i as ve,kn as ye,kt as be}from"./lu-DlSq9Be4.js";import{$n as xe,Ar as Se,O as Ce,Pr as we,Qn as Te,St as K,Vn as Ee,Vt as q,W as De,ct as Oe,dr as ke,ir as Ae,mr as je,nr as Me,pr as Ne}from"./index-CPtTUYLD.js";import{t as Pe}from"./settings-CPGvaBMI.js";import{t as Fe}from"./WithPermissionGuard-Cr6Aljmy.js";import{t as Ie}from"./dist-CtqZVBlK.js";import{a as J,i as Le,n as Re,t as ze}from"./MetricStatsTooltip-Cs-SC-pW.js";import{a as Be,c as Ve,d as He,f as Ue,g as We,h as Ge,i as Ke,l as qe,m as Je,n as Ye,o as Xe,p as Ze,r as Qe,s as $e,t as et,u as tt}from"./useSimulationUpdateListener-BQB61L8b.js";import{t as nt}from"./useTargetNameMap-C2bPHyhD.js";import{t as rt}from"./SearchInput-C7YbWRUQ.js";import{n as it,t as at}from"./showSuiteRunError-B2iiQdeh.js";import{t as ot}from"./LangyContextTarget-CIlp_Zew.js";import{n as st}from"./SetupWithAgentButton-Bhxb1yOj.js";import{n as ct,r as lt,t as ut}from"./PassRateIndicator-jhcYmbDL.js";var dt=b(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),ft=b(`loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),pt=b(`repeat-2`,[[`path`,{d:`m2 9 3-3 3 3`,key:`1ltn5i`}],[`path`,{d:`M13 18H7a2 2 0 0 1-2-2V6`,key:`1r6tfw`}],[`path`,{d:`m22 15-3 3-3-3`,key:`4rnwn2`}],[`path`,{d:`M11 6h6a2 2 0 0 1 2 2v10`,key:`2f72bc`}]]),Y=e(t()),X=o();function mt({scrollRef:e,fadeAfterPx:t=100}={}){let[n,i]=(0,Y.useState)(+!e),a=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{if(!e)return;let n,r=!1,o=()=>{let s=e.current;if(!s){n=requestAnimationFrame(o);return}r=!0;let c=()=>{i(Math.min(s.scrollTop/t,1))};c(),s.addEventListener(`scroll`,c,{passive:!0}),a.current=()=>s.removeEventListener(`scroll`,c)};return n=requestAnimationFrame(o),()=>{r||cancelAnimationFrame(n),a.current?.(),a.current=null}},[e,t]),(0,X.jsxs)(r,{width:`full`,flexShrink:0,position:`relative`,opacity:n,transition:`opacity 0.15s ease-out`,children:[(0,X.jsx)(r,{width:`full`,height:`1px`,bg:`border.muted`}),(0,X.jsx)(r,{width:`full`,height:`4px`,background:`linear-gradient(to bottom, var(--chakra-colors-border-muted), transparent)`,opacity:.4,position:`absolute`,zIndex:1})]})}var ht=(0,Y.createContext)(Date.now());function gt(){return(0,Y.useContext)(ht)}var _t={pass:`
|
|
2
|
-
radial-gradient(ellipse at 0% 100%, rgba(134, 239, 172, 0.55) 0%, transparent 50%),
|
|
3
|
-
radial-gradient(ellipse at 100% 50%, rgba(72, 187, 120, 0.5) 0%, transparent 45%),
|
|
4
|
-
radial-gradient(ellipse at 70% 0%, rgba(56, 161, 105, 0.55) 0%, transparent 50%),
|
|
5
|
-
linear-gradient(160deg, rgba(56, 161, 105, 0.58) 0%, rgba(104, 211, 145, 0.52) 100%)
|
|
6
|
-
`,cancelled:`
|
|
7
|
-
radial-gradient(ellipse at 0% 100%, rgba(226, 232, 240, 0.55) 0%, transparent 50%),
|
|
8
|
-
radial-gradient(ellipse at 100% 50%, rgba(160, 174, 192, 0.5) 0%, transparent 45%),
|
|
9
|
-
radial-gradient(ellipse at 70% 0%, rgba(113, 128, 150, 0.55) 0%, transparent 50%),
|
|
10
|
-
linear-gradient(160deg, rgba(113, 128, 150, 0.58) 0%, rgba(160, 174, 192, 0.52) 100%)
|
|
11
|
-
`,fail:`
|
|
12
|
-
radial-gradient(ellipse at 0% 100%, rgba(254, 178, 178, 0.55) 0%, transparent 50%),
|
|
13
|
-
radial-gradient(ellipse at 100% 50%, rgba(245, 101, 101, 0.5) 0%, transparent 45%),
|
|
14
|
-
radial-gradient(ellipse at 70% 0%, rgba(229, 62, 62, 0.55) 0%, transparent 50%),
|
|
15
|
-
linear-gradient(160deg, rgba(229, 62, 62, 0.58) 0%, rgba(252, 129, 129, 0.52) 100%)
|
|
16
|
-
`,stalled:`
|
|
17
|
-
radial-gradient(ellipse at 0% 100%, rgba(251, 211, 141, 0.55) 0%, transparent 50%),
|
|
18
|
-
radial-gradient(ellipse at 100% 50%, rgba(236, 201, 75, 0.5) 0%, transparent 45%),
|
|
19
|
-
radial-gradient(ellipse at 70% 0%, rgba(214, 158, 46, 0.55) 0%, transparent 50%),
|
|
20
|
-
linear-gradient(160deg, rgba(214, 158, 46, 0.58) 0%, rgba(236, 201, 75, 0.52) 100%)
|
|
21
|
-
`},vt={[m.SUCCESS]:`pass`,[m.FAILED]:`fail`,[m.ERROR]:`fail`,[m.CANCELLED]:`cancelled`,[m.STALLED]:`stalled`,[m.IN_PROGRESS]:`cancelled`,[m.PENDING]:`cancelled`,[m.QUEUED]:`cancelled`,[m.RUNNING]:`cancelled`},yt={[m.SUCCESS]:`green.solid/20`,[m.FAILED]:`red.solid/30`,[m.ERROR]:`red.solid/30`,[m.CANCELLED]:`gray.solid/15`,[m.STALLED]:`yellow.solid/30`,[m.IN_PROGRESS]:`gray.solid/15`,[m.PENDING]:`gray.solid/15`,[m.QUEUED]:`gray.solid/15`,[m.RUNNING]:`gray.solid/15`};function bt(e){return{isComplete:f[e].isComplete,lightModeGradient:_t[vt[e]],scrim:yt[e]}}function xt({status:e}){let{isComplete:t,lightModeGradient:n,scrim:i}=bt(e);return t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(r,{"aria-hidden":!0,"data-testid":`simulation-status-overlay-light`,position:`absolute`,inset:0,background:n,display:{base:`block`,_dark:`none`},zIndex:1,pointerEvents:`none`}),(0,X.jsx)(r,{"aria-hidden":!0,"data-testid":`simulation-status-overlay-dark`,position:`absolute`,bottom:0,left:0,right:0,height:`65%`,bgGradient:`to-t`,gradientFrom:i,gradientTo:`transparent`,display:{base:`none`,_dark:`block`},zIndex:1,pointerEvents:`none`})]}):null}function St({title:e,isComplete:t}){return(0,X.jsx)(r,{py:2,px:3,w:`100%`,position:`relative`,zIndex:2,children:(0,X.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:t?`white`:`fg`,lineClamp:2,children:e})})}function Ct(){return(0,X.jsxs)(l,{p:4,gap:4,align:`stretch`,height:`100%`,css:{"@keyframes shimmer":{"0%":{opacity:.4},"50%":{opacity:.7},"100%":{opacity:.4}}},children:[(0,X.jsx)(a,{justify:`flex-end`,children:(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`32px`,w:`65%`,css:{animation:`shimmer 1.5s ease-in-out infinite`}})}),(0,X.jsxs)(l,{align:`flex-start`,gap:2,children:[(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`14px`,w:`90%`,css:{animation:`shimmer 1.5s ease-in-out 0.15s infinite`}}),(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`14px`,w:`75%`,css:{animation:`shimmer 1.5s ease-in-out 0.3s infinite`}}),(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`14px`,w:`60%`,css:{animation:`shimmer 1.5s ease-in-out 0.45s infinite`}})]}),(0,X.jsx)(a,{justify:`flex-end`,children:(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`28px`,w:`50%`,css:{animation:`shimmer 1.5s ease-in-out 0.6s infinite`}})}),(0,X.jsxs)(l,{align:`flex-start`,gap:2,children:[(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`14px`,w:`85%`,css:{animation:`shimmer 1.5s ease-in-out 0.75s infinite`}}),(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`14px`,w:`70%`,css:{animation:`shimmer 1.5s ease-in-out 0.9s infinite`}})]})]})}function wt({description:e}){return(0,X.jsxs)(l,{height:`100%`,justify:`center`,align:`center`,gap:4,p:4,css:{"@keyframes ripple":{"0%":{transform:`scale(0.8)`,opacity:.4},"50%":{transform:`scale(1)`,opacity:.15},"100%":{transform:`scale(0.8)`,opacity:.4}}},children:[(0,X.jsx)(r,{position:`relative`,w:`64px`,h:`64px`,children:[0,1,2].map(e=>(0,X.jsx)(r,{position:`absolute`,inset:`${e*8}px`,borderRadius:`full`,border:`1px solid`,borderColor:`fg.muted`,css:{animation:`ripple 2.4s ease-in-out ${e*.4}s infinite`}},e))}),e&&(0,X.jsx)(c,{fontSize:`xs`,color:`fg.muted`,textAlign:`center`,lineClamp:2,maxW:`90%`,children:e})]})}function Tt({children:e}){return(0,X.jsx)(A,{p:0,height:`100%`,overflow:`hidden`,position:`relative`,w:`100%`,children:(0,X.jsx)(r,{height:`100%`,width:`100%`,position:`relative`,children:e})})}function Et({status:e}){let t=f[e],i=p[e],o=e===m.RUNNING||e===m.IN_PROGRESS,s=e===m.PENDING||e===m.QUEUED;return(0,X.jsx)(r,{position:`absolute`,bottom:3,left:`50%`,transform:`translateX(-50%)`,zIndex:10,pointerEvents:`none`,children:(0,X.jsxs)(a,{gap:1.5,px:3,py:1,borderRadius:`full`,bg:`${t.colorPalette}.subtle/85`,boxShadow:`xs`,borderWidth:`1px`,borderColor:`${t.colorPalette}.muted/50`,color:`${t.colorPalette}.fg`,children:[o||s?(0,X.jsx)(n,{size:`xs`,color:`currentColor`}):(0,X.jsx)(i,{size:12,color:`currentColor`}),(0,X.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,textTransform:`capitalize`,lineHeight:`1`,children:t.label})]})})}function Dt({title:e,description:t,status:n,isActive:i,isLoading:a,isAwaitingMessages:o,children:s}){let c=n?f[n].isComplete:!1,u=c&&!i;return(0,X.jsxs)(k,{height:`100%`,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`xl`,position:`relative`,bg:`bg.panel`,boxShadow:`sm`,transition:`border-color 0.15s ease, box-shadow 0.15s ease`,_hover:{borderColor:`border.emphasized`,boxShadow:`md`},css:{overflow:`hidden !important`,contain:`content`,"&:hover .simulation-card-content":{opacity:1},"& .simulation-chat-scroll":{scrollbarWidth:`none`},"&:hover .simulation-chat-scroll":{scrollbarWidth:`thin`},"& .simulation-chat-scroll::-webkit-scrollbar":{display:`none`},"&:hover .simulation-chat-scroll::-webkit-scrollbar":{display:`block`,width:`6px`}},children:[(0,X.jsxs)(l,{height:`100%`,gap:0,children:[!a&&(0,X.jsx)(St,{title:e,isComplete:c}),(0,X.jsx)(r,{className:`simulation-card-content`,opacity:u?.8:1,transition:`opacity 0.3s ease`,height:`100%`,width:`100%`,overflow:`hidden`,paddingBottom:n?`40px`:void 0,children:a?(0,X.jsx)(Ct,{}):o?(0,X.jsx)(wt,{description:t}):(0,X.jsx)(Tt,{children:s})})]}),c&&n&&(0,X.jsx)(xt,{status:n}),n&&(0,X.jsx)(Et,{status:n})]})}function Ot(e){if(typeof e==`string`){try{let t=JSON.parse(e);if(Array.isArray(t))return kt(t)}catch{}return e}return Array.isArray(e)?kt(e):``}function kt(e){return e.filter(e=>typeof e==`object`&&!!e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(` `)}function At({isUser:e,children:t}){return(0,X.jsx)(r,{bg:e?`blue.subtle`:`bg.muted`,color:`fg`,borderRadius:`lg`,borderTopRightRadius:e?`sm`:`lg`,borderTopLeftRadius:e?`lg`:`sm`,paddingX:2.5,paddingY:1.5,fontSize:`xs`,lineClamp:3,children:t})}function jt(){return(0,X.jsx)(r,{display:`flex`,gap:`3px`,alignItems:`center`,height:`14px`,css:{"@keyframes pulse-dot":{"0%, 80%, 100%":{opacity:.3},"40%":{opacity:1}}},children:[0,1,2].map(e=>(0,X.jsx)(r,{width:`5px`,height:`5px`,borderRadius:`full`,bg:`fg.muted`,animation:`pulse-dot 1.4s infinite`,style:{animationDelay:`${e*.2}s`}},e))})}function Mt({messages:e,streamingMessages:t}){let n=new Set((e??[]).map(e=>e.id).filter(Boolean)),i=(t??[]).filter(e=>!n.has(e.messageId));return(!e||e.length===0)&&i.length===0?(0,X.jsxs)(l,{align:`stretch`,gap:1.5,padding:3,height:`100%`,justifyContent:`flex-end`,css:{"@keyframes shimmer":{"0%":{opacity:.3},"50%":{opacity:.55},"100%":{opacity:.3}}},children:[(0,X.jsx)(r,{alignSelf:`flex-end`,maxWidth:`65%`,children:(0,X.jsx)(r,{bg:`bg.muted`,borderRadius:`lg`,h:`28px`,w:`100%`,css:{animation:`shimmer 2s ease-in-out infinite`}})}),(0,X.jsxs)(l,{align:`flex-start`,gap:1,maxWidth:`80%`,children:[(0,X.jsx)(r,{bg:`bg.subtle`,borderRadius:`lg`,h:`12px`,w:`100%`,css:{animation:`shimmer 2s ease-in-out 0.2s infinite`}}),(0,X.jsx)(r,{bg:`bg.subtle`,borderRadius:`lg`,h:`12px`,w:`70%`,css:{animation:`shimmer 2s ease-in-out 0.4s infinite`}})]})]}):(0,X.jsxs)(l,{align:`stretch`,gap:1.5,padding:3,height:`100%`,overflow:`hidden`,justifyContent:`flex-end`,children:[(e??[]).slice(-8).map((e,t)=>{let n=`tool_calls`in e&&e.tool_calls?e.tool_calls:`toolCalls`in e&&e.toolCalls?e.toolCalls:null;if(n)return n.map((n,i)=>(0,X.jsxs)(a,{alignSelf:`flex-start`,gap:1,children:[(0,X.jsx)(r,{color:`orange.fg`,children:(0,X.jsx)(Pe,{size:10})}),(0,X.jsx)(c,{fontSize:`2xs`,color:`orange.fg`,fontWeight:`medium`,lineClamp:1,children:n.function?.name??`tool`})]},`${e.id??t}-tc-${i}`));if(e.role===`tool`){let n=Ot(e.content);return n?(0,X.jsx)(r,{alignSelf:`flex-start`,maxWidth:`85%`,children:(0,X.jsx)(r,{bg:`bg.subtle`,borderRadius:`lg`,paddingX:2.5,paddingY:1.5,fontSize:`xs`,color:`fg.muted`,lineClamp:2,children:n})},e.id??t):null}let i=Ot(e.content);if(!i||i===`None`)return null;let o=e.role===`user`;return(0,X.jsx)(r,{alignSelf:o?`flex-end`:`flex-start`,maxWidth:`85%`,children:(0,X.jsx)(At,{isUser:o,children:i})},e.id??t)}),i.map(e=>{let t=e.role===`user`;return(0,X.jsx)(r,{alignSelf:t?`flex-end`:`flex-start`,maxWidth:`85%`,children:(0,X.jsx)(At,{isUser:t,children:e.content||(0,X.jsx)(jt,{})})},e.messageId)})]})}function Nt({onCancelJobSuccess:e,onCancelJobError:t,onCancelBatchSuccess:n,onCancelBatchError:r}={}){let i=z.scenarios.cancelJob.useMutation({onSuccess:n=>{n.cancelled?e?.():t?.({message:`Job could not be cancelled — it may have already completed`})},onError:e=>{t?.(e)}}),a=z.scenarios.cancelBatchRun.useMutation({onSuccess:()=>{n?.()},onError:e=>{r?.(e)}});return{cancelJob:(0,Y.useCallback)(e=>{i.mutate(e)},[i]),cancelBatchRun:(0,Y.useCallback)(e=>{a.mutate(e)},[a]),isCancellingJob:i.isPending,isCancellingBatch:a.isPending}}var Pt=5e3;function Ft(){let{project:e}=q(),t=z.useContext();return(0,Y.useCallback)(n=>{!e?.id||!n||t.scenarios.getRunState.prefetch({projectId:e.id,scenarioRunId:n},{staleTime:Pt})},[e?.id,t])}function It({scenarioRun:e,targetName:t,onClick:i,iteration:o,onCancel:s,isCancelling:l=!1}){let u=Be({scenarioName:e.name??e.scenarioId,targetName:t,iteration:o}),f=Ft(),p=()=>f(e.scenarioRunId);return(0,X.jsx)(ot,{target:oe({scenarioId:e.scenarioRunId,name:u}),children:(0,X.jsxs)(r,{position:`relative`,borderRadius:`lg`,children:[(0,X.jsx)(r,{as:`button`,onClick:i,onMouseEnter:p,onFocus:p,cursor:`pointer`,height:`200px`,textAlign:`left`,width:`full`,"aria-label":`View details for ${u}`,children:(0,X.jsx)(Dt,{title:u,status:e.status,children:(0,X.jsx)(Mt,{messages:e.messages})})}),s&&d(e.status)&&(0,X.jsxs)(a,{as:`span`,role:`button`,tabIndex:l?-1:0,gap:1,paddingX:2,paddingY:.5,borderRadius:`md`,border:`1px solid`,borderColor:`border`,fontSize:`xs`,color:`fg`,bg:`bg.panel`,cursor:l?`default`:`pointer`,opacity:l?.6:1,_hover:l?void 0:{bg:`bg.muted`,borderColor:`border.emphasized`},position:`absolute`,top:2,right:2,zIndex:1,onClick:e=>{e.stopPropagation(),l||s()},onKeyDown:e=>{!l&&(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),s())},"aria-label":`Stop run`,"aria-disabled":l,"data-testid":`cancel-run-button`,children:[l?(0,X.jsx)(n,{size:`xs`}):(0,X.jsx)(pe,{size:10}),(0,X.jsx)(c,{fontSize:`xs`,children:`Stop`})]})]})})}var Lt={[m.SUCCESS]:`Passed`,[m.FAILED]:`Failed`,[m.ERROR]:`Failed`,[m.CANCELLED]:`Cancelled`,[m.STALLED]:`Stalled`,[m.IN_PROGRESS]:`Running`,[m.PENDING]:`Pending`,[m.QUEUED]:`Queued`,[m.RUNNING]:`Running`},Rt=new Set([m.SUCCESS,m.FAILED,m.ERROR]);function zt({status:e,results:t}){let n=Lt[e];if(!Rt.has(e)||!t)return n;let r=t.metCriteria.length,i=r+t.unmetCriteria.length;return i===0?n:`${n} (${r}/${i})`}var Bt={[m.SUCCESS]:`green.500`,[m.FAILED]:`red.500`,[m.ERROR]:`red.500`,[m.STALLED]:`yellow.500`,[m.CANCELLED]:`gray.400`,[m.IN_PROGRESS]:`orange.400`,[m.PENDING]:`gray.400`,[m.QUEUED]:`blue.400`,[m.RUNNING]:`orange.400`};function Vt({scenarioRun:e}){let t=e.roleCosts??{},n=e.roleLatencies??{},i=Object.keys(n).filter(e=>n[e]&&n[e].length>0),o=Object.keys(t).filter(e=>t[e]&&t[e].length>0);return(0,X.jsx)(l,{align:`stretch`,gap:0,fontSize:`12px`,minWidth:`180px`,color:`fg`,children:(0,X.jsxs)(l,{align:`stretch`,gap:2,padding:2,children:[e.durationInMs>0&&(0,X.jsxs)(a,{justify:`space-between`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Duration`}),(0,X.jsx)(c,{fontWeight:`medium`,children:J(e.durationInMs)})]}),e.totalCost!=null&&(0,X.jsxs)(a,{justify:`space-between`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Total Cost`}),(0,X.jsx)(c,{fontWeight:`medium`,children:Le(e.totalCost)})]}),i.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(r,{borderTopWidth:`1px`,borderColor:`border.emphasized`,marginX:-2}),(0,X.jsx)(c,{color:`fg`,fontWeight:`semibold`,children:`Latency`}),i.map(e=>{let t=n[e],r=t.reduce((e,t)=>e+t,0)/t.length;return(0,X.jsxs)(a,{justify:`space-between`,paddingLeft:2,children:[(0,X.jsx)(c,{color:`fg.muted`,children:e}),(0,X.jsx)(c,{fontWeight:`medium`,children:J(r)})]},`lat-${e}`)})]}),o.length>0&&(0,X.jsxs)(X.Fragment,{children:[i.length===0&&(0,X.jsx)(r,{borderTopWidth:`1px`,borderColor:`border.emphasized`,marginX:-2}),(0,X.jsx)(c,{color:`fg`,fontWeight:`semibold`,children:`Cost`}),o.map(e=>{let n=t[e].reduce((e,t)=>e+t,0);return(0,X.jsxs)(a,{justify:`space-between`,paddingLeft:2,children:[(0,X.jsx)(c,{color:`fg.muted`,children:e}),(0,X.jsx)(c,{fontWeight:`medium`,children:Le(n)})]},`cost-${e}`)})]})]})})}function Ht({status:e}){return e===m.QUEUED||e===m.RUNNING?(0,X.jsx)(n,{size:`xs`,"data-testid":`queued-spinner`}):(0,X.jsx)(r,{width:`10px`,height:`10px`,borderRadius:`full`,bg:Bt[e]??`gray.400`,flexShrink:0})}function Ut({scenarioRun:e,targetName:t,onClick:i,iteration:o,onCancel:s,isCancelling:l=!1}){let u=Be({scenarioName:e.name??e.scenarioId,targetName:t,iteration:o}),p=f[e.status],m=s&&d(e.status),h=e.durationInMs>0||e.totalCost!=null,g=Ft(),_=()=>g(e.scenarioRunId);return(0,X.jsx)(ot,{target:oe({scenarioId:e.scenarioRunId,name:u}),children:(0,X.jsx)(r,{position:`relative`,className:`group`,borderRadius:`lg`,borderBottom:`1px solid`,_last:{border:`none`},borderColor:`border.subtle`,_hover:{borderColor:`transparent`},children:(0,X.jsxs)(a,{as:`button`,width:`full`,paddingX:4,paddingY:2,gap:4,_hover:{bg:`bg.muted/80`},borderRadius:`lg`,cursor:`pointer`,onClick:i,onMouseEnter:_,onFocus:_,tabIndex:0,"aria-label":`View details for ${u}`,children:[(0,X.jsxs)(a,{children:[(0,X.jsx)(Ht,{status:e.status}),(0,X.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:p.fgColor,minWidth:`43px`,textAlign:`left`,whiteSpace:`nowrap`,children:zt({status:e.status,results:e.results??void 0})})]}),(0,X.jsx)(c,{fontSize:`sm`,textAlign:`left`,truncate:!0,children:u}),m&&(0,X.jsxs)(a,{as:`span`,role:`button`,tabIndex:l?-1:0,gap:1,paddingX:2,paddingY:.5,borderRadius:`md`,border:`1px solid`,borderColor:`gray.300`,fontSize:`xs`,color:`fg.default`,cursor:l?`default`:`pointer`,opacity:l?.6:1,flexShrink:0,_hover:l?void 0:{bg:`gray.100`,borderColor:`gray.400`},onClick:e=>{e.stopPropagation(),l||s?.()},onKeyDown:e=>{!l&&(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),s?.())},"aria-label":`Stop run`,"aria-disabled":l,"data-testid":`cancel-run-button`,children:[l?(0,X.jsx)(n,{size:`xs`}):(0,X.jsx)(pe,{size:10}),(0,X.jsx)(c,{fontSize:`xs`,children:`Stop`})]}),(0,X.jsx)(r,{flex:1}),h&&(0,X.jsx)(v,{content:(0,X.jsx)(Vt,{scenarioRun:e}),contentProps:{padding:0},positioning:{placement:`bottom`},interactive:!0,children:(0,X.jsxs)(a,{gap:2,flexShrink:0,color:`fg.subtle`,children:[e.durationInMs>0&&(0,X.jsx)(c,{fontSize:`11px`,children:J(e.durationInMs)}),e.totalCost!=null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{color:`gray.300`,children:`⋅`}),(0,X.jsx)(c,{fontSize:`xs`,children:Le(e.totalCost)})]})]})})]})})})}var Wt=30,Gt=200,Kt=16,qt=16,Jt=216,Yt=37,Xt=(0,Y.memo)(function({scenarioRun:e,targetName:t,onScenarioRunClick:n,iteration:r,onCancelRun:i,isCancelling:a}){let o=(0,Y.useCallback)(()=>n(e),[n,e]),s=(0,Y.useCallback)(()=>i?.(e),[i,e]);return(0,X.jsx)(It,{scenarioRun:e,targetName:t,onClick:o,iteration:r,onCancel:i?s:void 0,isCancelling:a})});function Zt(e){return e.scenarioRuns.length>Wt?(0,X.jsx)(en,{...e}):(0,X.jsx)(Qt,{...e})}function Qt({scenarioRuns:e,viewMode:t,resolveTargetName:n,onScenarioRunClick:r,iterationMap:i,onCancelRun:a,cancellingJobId:o}){return t===`grid`?(0,X.jsx)(T,{templateColumns:`repeat(auto-fill, minmax(250px, 1fr))`,gap:4,padding:4,position:`relative`,zIndex:0,"data-testid":`scenario-grid`,children:e.map(e=>(0,X.jsx)(Xt,{scenarioRun:e,targetName:n(e),onScenarioRunClick:r,iteration:i.get(e.scenarioRunId),onCancelRun:a,isCancelling:o===e.scenarioRunId},e.scenarioRunId))}):(0,X.jsx)(l,{align:`stretch`,gap:0,"data-testid":`scenario-list`,children:e.map(e=>(0,X.jsx)(Ut,{scenarioRun:e,targetName:n(e),onClick:()=>r(e),iteration:i.get(e.scenarioRunId),onCancel:a?()=>a(e):void 0,isCancelling:o===e.scenarioRunId},e.scenarioRunId))})}function $t(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);if(/(auto|scroll)/.test(e.overflow+e.overflowY))return t;t=t.parentElement}return document.documentElement}function en({scenarioRuns:e,viewMode:t,resolveTargetName:n,onScenarioRunClick:r,iterationMap:i,onCancelRun:a,cancellingJobId:o}){let s=(0,Y.useRef)(null),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(1),f=t===`grid`;(0,Y.useLayoutEffect)(()=>{s.current&&l($t(s.current))},[]),(0,Y.useLayoutEffect)(()=>{if(!s.current||!f)return;let e=s.current.clientWidth-qt*2;d(Math.max(1,Math.floor((e+Kt)/266)))},[f]),(0,Y.useEffect)(()=>{if(!s.current||!f)return;let e=s.current,t=new ResizeObserver(()=>{let t=e.clientWidth-qt*2;d(Math.max(1,Math.floor((t+Kt)/266)))});return t.observe(e),()=>t.disconnect()},[f]);let p=0;if(s.current&&c){let e=s.current.getBoundingClientRect(),t=c.getBoundingClientRect();p=Math.round(e.top-t.top+c.scrollTop)}let m=f?Math.ceil(e.length/u):e.length,h=f?Jt:Yt,g=ae({count:m,getScrollElement:(0,Y.useCallback)(()=>c,[c]),estimateSize:(0,Y.useCallback)(()=>h,[h]),overscan:5,scrollMargin:p,enabled:!!c}),_=g.getVirtualItems(),v=g.getTotalSize();return f?(0,X.jsx)(`div`,{ref:s,style:{height:v+qt*2,width:`100%`,position:`relative`,flexShrink:0},"data-testid":`scenario-grid`,children:_.map(t=>{let s=t.index*u,c=e.slice(s,s+u);return(0,X.jsx)(`div`,{style:{position:`absolute`,top:qt,left:qt,right:qt,height:Gt,transform:`translateY(${t.start-g.options.scrollMargin}px)`,display:`grid`,gridTemplateColumns:`repeat(${u}, 1fr)`,gap:Kt},children:c.map(e=>(0,X.jsx)(Xt,{scenarioRun:e,targetName:n(e),onScenarioRunClick:r,iteration:i.get(e.scenarioRunId),onCancelRun:a,isCancelling:o===e.scenarioRunId},e.scenarioRunId))},t.index)})}):(0,X.jsx)(`div`,{ref:s,style:{height:v,width:`100%`,position:`relative`,flexShrink:0},"data-testid":`scenario-list`,children:_.map(t=>{let s=e[t.index];return s?(0,X.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:t.size,transform:`translateY(${t.start-g.options.scrollMargin}px)`},children:(0,X.jsx)(Ut,{scenarioRun:s,targetName:n(s),onClick:()=>r(s),iteration:i.get(s.scenarioRunId),onCancel:a?()=>a(s):void 0,isCancelling:o===s.scenarioRunId})},s.scenarioRunId):null})})}function tn({batch:e,resolveTargetName:t,onScenarioRunClick:n,viewMode:i,onCancelRun:o,cancellingJobId:s}){let u=(0,Y.useMemo)(()=>Xe({batchRun:e}),[e]),d=(0,Y.useMemo)(()=>Ve({scenarioRuns:e.scenarioRuns}),[e.scenarioRuns]),f=gt();return(0,X.jsxs)(l,{align:`stretch`,gap:0,children:[(0,X.jsxs)(a,{paddingX:4,paddingY:2,gap:2,"data-testid":`batch-sub-header`,children:[(0,X.jsx)(c,{fontSize:`xs`,color:`fg.subtle`,children:Ce(e.timestamp,f)}),(0,X.jsx)(r,{flex:1}),(0,X.jsx)(nn,{summary:u})]}),(0,X.jsx)(Zt,{scenarioRuns:e.scenarioRuns,viewMode:i,resolveTargetName:t,onScenarioRunClick:n,iterationMap:d,onCancelRun:o,cancellingJobId:s})]})}function nn({summary:e}){let t=[];return e.passedCount>0&&t.push({count:e.passedCount,color:`green.500`,label:`passed`}),e.failedCount>0&&t.push({count:e.failedCount,color:`red.500`,label:`failed`}),e.stalledCount>0&&t.push({count:e.stalledCount,color:`yellow.500`,label:`stalled`}),e.cancelledCount>0&&t.push({count:e.cancelledCount,color:`fg.muted`,label:`cancelled`}),e.inProgressCount>0&&t.push({count:e.inProgressCount,color:`orange.500`,label:`running`}),e.queuedCount>0&&t.push({count:e.queuedCount,color:`blue.500`,label:`queued`}),t.length===0?null:(0,X.jsx)(a,{gap:2,children:t.map(e=>(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(r,{width:`6px`,height:`6px`,borderRadius:`full`,bg:e.color,flexShrink:0}),(0,X.jsxs)(c,{fontSize:`xs`,color:`fg.subtle`,children:[e.count,` `,e.label]})]},e.label))})}function rn(e){let t=[];return e.failedCount>0&&t.push(`${e.failedCount} failed`),e.stalledCount>0&&t.push(`${e.stalledCount} stalled`),e.cancelledCount>0&&t.push(`${e.cancelledCount} cancelled`),t.length>0?`(${t.join(`, `)})`:null}function an({summary:e}){let t=rn(e);return(0,X.jsx)(l,{align:`stretch`,gap:0,fontSize:`12px`,minWidth:`220px`,color:`fg`,children:(0,X.jsxs)(l,{align:`stretch`,gap:2,padding:2,children:[(0,X.jsxs)(a,{justify:`space-between`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Pass`}),(0,X.jsxs)(a,{gap:1.5,children:[(0,X.jsx)(ut,{passRate:e.passRate}),(0,X.jsx)(c,{fontWeight:`medium`,color:ct(e.passRate),children:e.passRate===null?`-`:`${Math.round(e.passRate)}%`})]})]}),(0,X.jsxs)(a,{justify:`space-between`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Completed`}),(0,X.jsxs)(c,{fontWeight:`medium`,children:[e.completedCount,`/`,e.totalCount,t&&(0,X.jsx)(c,{as:`span`,color:`red.300`,marginLeft:1,children:t})]})]}),e.agentLatencyStats?(0,X.jsx)(v,{content:(0,X.jsx)(Re,{stats:e.agentLatencyStats}),positioning:{placement:`right`},openDelay:100,interactive:!0,children:(0,X.jsxs)(a,{justify:`space-between`,cursor:`pointer`,_hover:{bg:`bg.muted`},marginX:-2,paddingX:2,paddingY:.5,borderRadius:`md`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Avg Agent Latency`}),(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(E,{as:ge,color:`fg.muted`,boxSize:3}),(0,X.jsx)(c,{fontWeight:`medium`,children:J(e.averageAgentLatencyMs)}),(0,X.jsx)(E,{as:G,boxSize:3,color:`fg.subtle`})]})]})}):e.averageAgentLatencyMs===null?null:(0,X.jsxs)(a,{justify:`space-between`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Avg Agent Latency`}),(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(E,{as:ge,color:`fg.muted`,boxSize:3}),(0,X.jsx)(c,{fontWeight:`medium`,children:J(e.averageAgentLatencyMs)})]})]}),e.agentCostStats?(0,X.jsx)(v,{content:(0,X.jsx)(ze,{stats:e.agentCostStats}),positioning:{placement:`right`},openDelay:100,interactive:!0,children:(0,X.jsxs)(a,{justify:`space-between`,cursor:`pointer`,_hover:{bg:`bg.muted`},marginX:-2,paddingX:2,paddingY:.5,borderRadius:`md`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Avg Agent Cost`}),(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(c,{fontWeight:`medium`,children:Le(e.averageAgentCost)}),(0,X.jsx)(E,{as:G,boxSize:3,color:`fg.subtle`})]})]})}):null,e.totalDurationMs!==null&&(0,X.jsxs)(a,{justify:`space-between`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Total Duration`}),(0,X.jsx)(c,{fontWeight:`medium`,children:J(e.totalDurationMs)})]}),e.totalCost!==null&&(0,X.jsxs)(a,{justify:`space-between`,children:[(0,X.jsx)(c,{color:`fg.muted`,children:`Total Cost`}),(0,X.jsx)(c,{fontWeight:`medium`,children:Le(e.totalCost)})]})]})})}function on({summary:e}){let{isOpen:t,handleMouseEnter:n,handleMouseLeave:r}=lt(150),i=e.inProgressCount>0||e.queuedCount>0;return(0,X.jsx)(v,{content:(0,X.jsx)(an,{summary:e}),contentProps:{padding:0,onMouseEnter:n,onMouseLeave:r},positioning:{placement:`bottom`},open:t,interactive:!0,children:(0,X.jsxs)(a,{gap:2,fontSize:`12px`,color:`fg.muted`,paddingX:2,paddingY:1,borderRadius:`lg`,border:`1px solid`,borderColor:`border`,cursor:`default`,_hover:{borderColor:`border.emphasized`,bg:`bg.muted`},"data-testid":`run-metrics-summary`,onMouseEnter:n,onMouseLeave:r,overflow:`hidden`,children:[i&&(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(E,{as:ye,boxSize:3,color:`blue.fg`}),(0,X.jsxs)(c,{color:`blue.fg`,fontWeight:`medium`,children:[e.completedCount,`/`,e.totalCount]})]}),!i&&e.totalCount>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{fontWeight:`600`,children:`Pass`}),(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(ut,{passRate:e.passRate}),(0,X.jsx)(c,{color:ct(e.passRate),fontWeight:`medium`,children:e.passRate===null?`-`:`${Math.round(e.passRate)}%`})]})]}),i&&e.completedCount>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{fontWeight:`600`,children:`Pass`}),(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(ut,{passRate:e.passRate}),(0,X.jsx)(c,{color:ct(e.passRate),fontWeight:`medium`,children:e.passRate===null?`-`:`${Math.round(e.passRate)}%`})]})]}),e.totalDurationMs!==null&&(0,X.jsxs)(a,{gap:1,children:[(0,X.jsx)(E,{as:ge,boxSize:3}),(0,X.jsx)(c,{fontWeight:`medium`,children:J(e.totalDurationMs)})]}),e.totalCost!==null&&(0,X.jsx)(c,{fontWeight:`medium`,children:Le(e.totalCost)})]})})}function sn({group:e,summary:t,isExpanded:n,onToggle:i,onScenarioRunClick:o,resolveTargetName:s,viewMode:l=`grid`,onCancelRun:u,cancellingJobId:d}){let f=e.scenarioRuns.length,p=(0,Y.useMemo)(()=>tt({runs:e.scenarioRuns}),[e.scenarioRuns]);return(0,X.jsxs)(r,{children:[(0,X.jsx)(r,{padding:2,paddingBottom:0,width:`full`,position:`sticky`,top:0,zIndex:20,children:(0,X.jsxs)(a,{as:`button`,width:`full`,paddingX:4,paddingY:3,gap:3,flexWrap:`nowrap`,cursor:`pointer`,onClick:i,className:`group`,"aria-expanded":n,"aria-label":`${e.groupLabel} group`,bg:`color-mix(in srgb, var(--chakra-colors-bg-panel) var(--lw-panel-alpha, 70%), transparent)`,backdropFilter:`var(--lw-backdrop-blur, blur(12px) saturate(140%))`,borderWidth:`1px`,borderColor:`border.muted`,transition:`border-color 0.15s ease`,_hover:{borderColor:`border.emphasized`},"data-testid":`group-row-header`,borderRadius:`lg`,boxShadow:`xs`,children:[n?(0,X.jsx)(se,{size:14,style:{flexShrink:0}}):(0,X.jsx)(R,{size:14,style:{flexShrink:0}}),(0,X.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,color:`fg.default`,truncate:!0,minWidth:0,flexShrink:1,children:e.groupLabel}),(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,children:`·`}),(0,X.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,flexShrink:0,children:[f,` `,f===1?`run`:`runs`]}),(0,X.jsx)(r,{flex:1}),(0,X.jsx)(r,{flexShrink:0,children:(0,X.jsx)(on,{summary:t})})]})}),(0,X.jsx)(r,{padding:2,children:n&&(0,X.jsxs)(X.Fragment,{children:[p.map(e=>(0,X.jsx)(tn,{batch:e,resolveTargetName:s,onScenarioRunClick:o,viewMode:l,onCancelRun:u,cancellingJobId:d},e.batchRunId)),e.scenarioRuns.length===0&&(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,paddingX:4,paddingY:3,children:`No scenario runs in this group.`})]})})]})}var cn={none:`None`,scenario:`Scenario`,target:`Target`};function ln({scenarioOptions:e,filters:t,onFiltersChange:n,groupBy:r,onGroupByChange:i,groupByOptions:o=[...Qe],viewMode:s,onViewModeChange:l}){return(0,X.jsxs)(a,{gap:3,flexWrap:`wrap`,justifyContent:`space-between`,children:[(0,X.jsxs)(a,{gap:3,flexWrap:`wrap`,children:[(0,X.jsxs)(F,{size:`sm`,width:`auto`,minWidth:`150px`,children:[(0,X.jsxs)(I,{value:t.scenarioId,onChange:e=>n({...t,scenarioId:e.target.value}),"aria-label":`Filter by scenario`,children:[(0,X.jsx)(`option`,{value:``,children:`All Scenarios`}),e.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,X.jsx)(P,{})]}),(0,X.jsxs)(F,{size:`sm`,width:`auto`,minWidth:`120px`,children:[(0,X.jsxs)(I,{value:t.passFailStatus,onChange:e=>n({...t,passFailStatus:e.target.value}),"aria-label":`Filter by pass/fail status`,children:[(0,X.jsx)(`option`,{value:``,children:`All Statuses`}),(0,X.jsx)(`option`,{value:`pass`,children:`Pass`}),(0,X.jsx)(`option`,{value:`fail`,children:`Fail`}),(0,X.jsx)(`option`,{value:`stalled`,children:`Stalled`})]}),(0,X.jsx)(P,{})]})]}),(0,X.jsxs)(a,{gap:3,children:[l&&(0,X.jsxs)(a,{gap:1,role:`group`,"aria-label":`View mode`,children:[(0,X.jsx)(j,{"aria-label":`List view`,"aria-pressed":s===`list`,size:`xs`,variant:s===`list`?`solid`:`ghost`,onClick:()=>l(`list`),children:(0,X.jsx)(Ae,{size:14})}),(0,X.jsx)(j,{"aria-label":`Grid view`,"aria-pressed":s===`grid`,size:`xs`,variant:s===`grid`?`solid`:`ghost`,onClick:()=>l(`grid`),children:(0,X.jsx)(H,{size:14})})]}),i&&(0,X.jsxs)(a,{gap:2,children:[(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,whiteSpace:`nowrap`,children:`Group by:`}),(0,X.jsxs)(F,{size:`sm`,width:`auto`,minWidth:`120px`,children:[(0,X.jsx)(I,{value:r??`none`,onChange:e=>i(e.target.value),"aria-label":`Group by`,children:o.map(e=>(0,X.jsx)(`option`,{value:e,children:cn[e]},e))}),(0,X.jsx)(P,{})]})]})]})]})}function un(){return(0,X.jsx)(r,{padding:2,paddingBottom:0,width:`full`,children:(0,X.jsxs)(a,{width:`full`,paddingX:4,paddingY:3,gap:3,bg:`bg.panel/70`,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`lg`,boxShadow:`xs`,children:[(0,X.jsx)(s,{height:`14px`,width:`14px`,borderRadius:`sm`}),(0,X.jsx)(s,{height:`14px`,width:`120px`}),(0,X.jsx)(s,{height:`12px`,width:`48px`}),(0,X.jsx)(r,{flex:1}),(0,X.jsx)(s,{height:`22px`,width:`160px`,borderRadius:`lg`})]})})}function dn(){return(0,X.jsxs)(l,{height:`200px`,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`xl`,bg:`bg.panel`,boxShadow:`sm`,padding:3,align:`stretch`,gap:3,children:[(0,X.jsx)(s,{height:`12px`,width:`70%`}),(0,X.jsx)(r,{flex:1}),(0,X.jsx)(s,{height:`26px`,width:`55%`,borderRadius:`lg`,alignSelf:`flex-end`}),(0,X.jsx)(s,{height:`26px`,width:`75%`,borderRadius:`lg`}),(0,X.jsx)(s,{height:`26px`,width:`45%`,borderRadius:`lg`,alignSelf:`flex-end`})]})}function fn({sections:e=2}){return(0,X.jsx)(l,{align:`stretch`,gap:0,"data-testid":`run-history-skeleton`,role:`status`,"aria-busy":`true`,"aria-label":`Loading runs`,children:Array.from({length:e}).map((e,t)=>(0,X.jsxs)(r,{children:[(0,X.jsx)(un,{}),(0,X.jsx)(T,{templateColumns:`repeat(auto-fill, minmax(250px, 1fr))`,gap:4,padding:4,children:Array.from({length:3-t}).map((e,t)=>(0,X.jsx)(dn,{},t))})]},t))})}function pn(e){return e.loading?(0,X.jsx)(mn,{suiteName:e.suiteName}):(0,X.jsx)(hn,{...e})}function mn({suiteName:e}){return(0,X.jsxs)(r,{children:[(0,X.jsx)(r,{padding:2,paddingBottom:0,width:`full`,position:`sticky`,top:0,zIndex:20,children:(0,X.jsxs)(a,{width:`full`,paddingX:4,paddingY:3,gap:3,flexWrap:`nowrap`,bg:`color-mix(in srgb, var(--chakra-colors-bg-panel) var(--lw-panel-alpha, 70%), transparent)`,backdropFilter:`var(--lw-backdrop-blur, blur(12px) saturate(140%))`,borderWidth:`1px`,borderColor:`border.muted`,"data-testid":`run-row-header`,borderRadius:`lg`,boxShadow:`xs`,children:[(0,X.jsx)(n,{size:`xs`,color:`fg.muted`,css:{flexShrink:0,height:`14px`,width:`14px`}}),e&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,color:`fg.default`,flexShrink:0,children:e}),(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,children:`·`})]}),(0,X.jsx)(c,{fontSize:`xs`,color:`fg.subtle`,flexShrink:0,children:`Starting...`}),(0,X.jsx)(r,{flex:1}),(0,X.jsx)(r,{paddingY:1,paddingX:2,borderRadius:`lg`,border:`1px solid transparent`,children:(0,X.jsx)(c,{fontSize:`12px`,visibility:`hidden`,children:`\xA0`})})]})}),(0,X.jsx)(r,{padding:2})]})}function hn({batchRun:e,summary:t,isExpanded:o,onToggle:s,resolveTargetName:l,onScenarioRunClick:u,expectedJobCount:f,suiteName:p,viewMode:m=`grid`,onCancelRun:h,onCancelAll:g,isCancellingBatch:_=!1,cancellingJobId:v,isHighlighted:y=!1}){let[b,x]=(0,Y.useState)(!1),S=gt(),C=Ce(e.timestamp,S),w=(0,Y.useMemo)(()=>Ve({scenarioRuns:e.scenarioRuns}),[e.scenarioRuns]),T=(0,Y.useMemo)(()=>e.scenarioRuns.filter(e=>d(e.status)).length,[e.scenarioRuns]),E=T>0;return(0,X.jsxs)(r,{"data-batch-id":e.batchRunId,css:y?{"@keyframes yellowFlash":{"0%":{backgroundColor:`rgba(234, 179, 8, 0.3)`},"100%":{backgroundColor:`transparent`}},animation:`yellowFlash 2s ease-out`}:void 0,children:[(0,X.jsx)(r,{padding:2,paddingBottom:0,width:`full`,position:`sticky`,top:0,zIndex:20,children:(0,X.jsxs)(a,{as:`button`,width:`full`,paddingX:4,paddingY:3,gap:3,flexWrap:`nowrap`,cursor:`pointer`,onClick:s,className:`group`,"aria-expanded":o,"aria-label":`Run from ${C??`unknown time`}`,bg:`color-mix(in srgb, var(--chakra-colors-bg-panel) var(--lw-panel-alpha, 70%), transparent)`,backdropFilter:`var(--lw-backdrop-blur, blur(12px) saturate(140%))`,borderWidth:`1px`,borderColor:`border.muted`,transition:`border-color 0.15s ease`,_hover:{borderColor:`border.emphasized`},"data-testid":`run-row-header`,borderRadius:`lg`,boxShadow:`xs`,children:[o?(0,X.jsx)(se,{size:14,style:{flexShrink:0}}):(0,X.jsx)(R,{size:14,style:{flexShrink:0}}),p&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,color:`fg.default`,flexShrink:0,children:p}),(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,children:`·`})]}),(0,X.jsx)(c,{fontSize:`xs`,color:`fg.subtle`,flexShrink:0,children:C}),f!=null&&t.totalCount<f&&(0,X.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,flexShrink:0,children:[t.totalCount,` of `,f]}),g&&E&&(0,X.jsxs)(a,{as:`span`,role:`button`,tabIndex:_?-1:0,gap:1,paddingX:2,paddingY:.5,borderRadius:`md`,border:`1px solid`,borderColor:`border`,fontSize:`xs`,color:`fg`,cursor:_?`default`:`pointer`,flexShrink:0,opacity:_?.6:1,_hover:_?void 0:{bg:`bg.muted`,borderColor:`border.emphasized`},onClick:e=>{e.stopPropagation(),_||x(!0)},onKeyDown:e=>{!_&&(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),x(!0))},"aria-label":`Stop all remaining runs`,"aria-disabled":_,"data-testid":`cancel-all-button`,children:[_?(0,X.jsx)(n,{size:`xs`}):(0,X.jsx)(pe,{size:10}),(0,X.jsx)(c,{fontSize:`xs`,children:`Stop`})]}),(0,X.jsx)(r,{flex:1}),(0,X.jsx)(on,{summary:t})]})}),(0,X.jsx)(r,{padding:2,children:o&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Zt,{scenarioRuns:e.scenarioRuns,viewMode:m,resolveTargetName:l,onScenarioRunClick:u,iterationMap:w,onCancelRun:h,cancellingJobId:v}),e.scenarioRuns.length===0&&(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,paddingX:4,paddingY:3,children:`No scenario runs in this batch.`})]})}),g&&(0,X.jsx)(K.Root,{open:b,onOpenChange:({open:e})=>x(e),children:(0,X.jsxs)(K.Content,{bg:`bg`,maxWidth:`sm`,children:[(0,X.jsx)(K.Header,{children:(0,X.jsx)(K.Title,{children:`Cancel remaining jobs?`})}),(0,X.jsx)(K.Body,{children:(0,X.jsxs)(c,{fontSize:`sm`,color:`fg.muted`,children:[`This will cancel `,T,` remaining`,` `,T===1?`job`:`jobs`,` in this batch run. This action cannot be undone.`]})}),(0,X.jsxs)(K.Footer,{children:[(0,X.jsx)(i,{variant:`outline`,onClick:()=>x(!1),children:`Keep running`}),(0,X.jsxs)(i,{colorPalette:`red`,onClick:()=>{x(!1),g()},"data-testid":`confirm-cancel-all-button`,children:[`Cancel `,T,` `,T===1?`job`:`jobs`]})]})]})})]})}function gn({visible:e}){return e?(0,X.jsx)(v,{showArrow:!0,content:(0,X.jsxs)(r,{maxWidth:`280px`,"data-testid":`scenario-tab-connected-popover`,children:[(0,X.jsx)(c,{fontWeight:`medium`,children:`Connected to your local runs`}),(0,X.jsx)(c,{marginTop:1,children:`Scenario runs started on this machine reuse this tab: when a new run starts, this view moves to it instead of opening another browser tab.`})]}),children:(0,X.jsxs)(a,{"data-testid":`scenario-tab-connected-badge`,gap:1.5,paddingX:2.5,paddingY:1,borderRadius:`full`,borderWidth:`1px`,borderColor:`border.muted`,background:`bg.subtle`,cursor:`default`,children:[(0,X.jsx)(r,{boxSize:2,borderRadius:`full`,background:`green.500`,css:{"@keyframes connected-dot":{"0%, 100%":{boxShadow:`0 0 0 0 var(--chakra-colors-green-300)`},"50%":{boxShadow:`0 0 0 3px transparent`}}},animation:`connected-dot 2.4s ease-in-out infinite`}),(0,X.jsx)(c,{fontSize:`xs`,color:`fg.muted`,whiteSpace:`nowrap`,children:`Connected to local run`})]})}):null}var _n=`langwatch:run-history-expanded`,Z=new Map;try{let e=typeof window<`u`?localStorage.getItem(_n):null;if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t))Array.isArray(n)?Z.set(e,{expanded:new Set(n),seen:new Set(n)}):Z.set(e,{expanded:new Set(n.expanded),seen:new Set(n.seen)})}}catch{}function vn(){try{let e={};for(let[t,n]of Z)e[t]={expanded:[...n.expanded],seen:[...n.seen]};localStorage.setItem(_n,JSON.stringify(e))}catch{}}function yn(e,t){return`${e}::${t}`}function bn({panelKey:e,groupBy:t,batchRuns:n,groups:r}){let i=yn(e,t),[a,o]=(0,Y.useState)(()=>Z.get(i)?.expanded??new Set),s=(0,Y.useRef)(t),c=(0,Y.useRef)(e);return(0,Y.useEffect)(()=>{if(s.current!==t||c.current!==e){let n=yn(e,t);o(Z.get(n)?.expanded??new Set),s.current=t,c.current=e}},[t,e]),(0,Y.useEffect)(()=>{let e=t===`none`?n:r;if(e.length===0)return;let a=e.map(e=>`batchRunId`in e?e.batchRunId:e.groupKey),s=Z.get(i);if(s){let e=a.filter(e=>!s.seen.has(e));if(e.length===0)return;let t=a.findIndex(e=>s.seen.has(e)),n=t===-1?a.slice(0,1):a.slice(0,t);for(let t of e)s.seen.add(t);for(let e of n)s.expanded.add(e);o(new Set(s.expanded)),vn()}else{let e=a[0],t={expanded:new Set(e?[e]:[]),seen:new Set(a)};Z.set(i,t),o(t.expanded),vn()}},[t,n,r,i]),{expandedIds:a,toggleExpanded:(0,Y.useCallback)(e=>{o(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);let r=Z.get(i)??{expanded:new Set,seen:new Set};return r.expanded=n,r.seen.add(e),Z.set(i,r),vn(),n})},[i])}}function xn(e){return typeof e==`string`&&Qe.includes(e)}function Sn(e,t){let n=e[t];return Array.isArray(n)?n[0]??``:typeof n==`string`?n:``}function Cn(){return ce((e,t)=>({groupBy:`none`,viewMode:`grid`,filters:{scenarioId:``,passFailStatus:``},setGroupBy:t=>{e({groupBy:t})},setViewMode:t=>{e({viewMode:t})},setFilter:(t,n)=>{e(e=>({filters:{...e.filters,[t]:n}}))},setFilters:t=>{e({filters:t})},syncToUrl:e=>{let{groupBy:n,filters:r}=t(),i={};for(let[t,n]of Object.entries(e.query))(typeof n==`string`||Array.isArray(n))&&(i[t]=n);n===`none`?delete i.groupBy:i.groupBy=n,r.scenarioId?i.scenarioId=r.scenarioId:delete i.scenarioId,r.passFailStatus?i.passFailStatus=r.passFailStatus:delete i.passFailStatus,e.push({query:i},void 0,{shallow:!0})},hydrateFromUrl:t=>{let n=Sn(t,`groupBy`);e({groupBy:xn(n)?n:`none`,filters:{scenarioId:Sn(t,`scenarioId`),passFailStatus:Sn(t,`passFailStatus`)}})}}))}var Q=Cn(),wn=2e3,Tn=100,En=50;function Dn({highlightBatchId:e}){let[t,n]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{if(!e){n(null);return}let t=0,r=!1,i=null,a=()=>{if(r)return;let o=document.querySelector(`[data-batch-id="${e}"]`);if(!o){t++,t<En&&requestAnimationFrame(a);return}document.querySelectorAll(`[data-batch-id]`)[0]!==o&&o.scrollIntoView({behavior:`smooth`,block:`center`}),n(e),i=setTimeout(()=>{r||n(null)},wn)},o=setTimeout(a,Tn);return()=>{r=!0,clearTimeout(o),i&&clearTimeout(i)}},[e]),{highlightedBatchId:t}}var On=3e3,kn=15e3,An=new Set([m.IN_PROGRESS,m.PENDING,m.QUEUED,m.RUNNING]);function jn({runs:e}){return e.some(e=>An.has(e.status))?On:kn}function Mn({scenarioSetId:e,startDateMs:t,endDateMs:n,runs:r,enabled:i,sseConnected:a}){let{project:o}=q(),s=z.useContext(),{data:c}=z.scenarios.getSuiteRunFreshness.useQuery({projectId:o?.id??``,scenarioSetId:e,startDate:t,endDate:n},{enabled:!!o&&i,refetchInterval:a?!1:jn({runs:r}),trpc:{context:{skipBatch:!0}}}),l=`${o?.id??``}:${e??``}:${t}:${n??``}`,u=(0,Y.useRef)(null),d=(0,Y.useRef)(l);(0,Y.useEffect)(()=>{d.current!==l&&(d.current=l,u.current=null);let e=c?.lastUpdatedAt;if(e!==void 0){if(u.current===null){u.current=e;return}e>u.current&&(u.current=e,s.scenarios.getSuiteRunData.invalidate())}},[l,c?.lastUpdatedAt,s])}var Nn=Ke({viewContext:`external`});function Pn({scenarioSetId:e,period:t,highlightBatchId:n,connectedToLocalRun:o=!1}){let{project:s}=q(),{openDrawer:u}=De(),{highlightedBatchId:d}=Dn({highlightBatchId:n}),f=(0,Y.useRef)(null),p=Q(e=>e.groupBy),h=Q(e=>e.viewMode),g=Q(e=>e.filters),_=Q(e=>e.setGroupBy),v=Q(e=>e.setViewMode),y=Q(e=>e.setFilters),b=Nn.includes(p)?p:`none`,{isConnected:x}=et({projectId:s?.id??``,enabled:!!s?.id,debounceMs:500,filter:{scenarioSetId:e}}),{data:S,isLoading:C,error:w,refetch:T}=z.scenarios.getSuiteRunData.useQuery({projectId:s?.id??``,scenarioSetId:e,limit:100,startDate:t.startDate.getTime(),endDate:t.endDate.getTime()},{enabled:!!s,trpc:{context:{skipBatch:!0}}}),E=S&&`runs`in S?S.runs:void 0;Mn({scenarioSetId:e,startDateMs:t.startDate.getTime(),endDateMs:t.endDate.getTime(),runs:E??[],enabled:!!s,sseConnected:x});let{data:D}=z.scenarios.getAll.useQuery({projectId:s?.id??``},{enabled:!!s}),O=(0,Y.useMemo)(()=>{if(!D||!E)return[];let e=new Set(E.map(e=>e.scenarioId));return D.filter(t=>e.has(t.id)).map(e=>({id:e.id,name:e.name}))},[D,E]);(0,Y.useEffect)(()=>{!g.scenarioId||O.length===0||new Set(O.map(e=>e.id)).has(g.scenarioId)||y({...g,scenarioId:``})},[g,O,y]);let k=(0,Y.useMemo)(()=>{if(!E)return[];let e=E;return g.scenarioId&&(e=e.filter(e=>e.scenarioId===g.scenarioId)),g.passFailStatus===`pass`?e=e.filter(e=>e.status===m.SUCCESS):g.passFailStatus===`fail`?e=e.filter(e=>e.status===m.ERROR||e.status===m.FAILED):g.passFailStatus===`stalled`&&(e=e.filter(e=>e.status===m.STALLED)),e},[E,g.scenarioId,g.passFailStatus]),A=(0,Y.useMemo)(()=>tt({runs:k}),[k]),j=(0,Y.useMemo)(()=>b===`none`?[]:He({runs:k}),[b,k]),{expandedIds:ie,toggleExpanded:P}=bn({panelKey:`external:${e}`,groupBy:b,batchRuns:A,groups:j}),F=(0,Y.useCallback)(e=>{u(`scenarioRunDetail`,{urlParams:{scenarioRunId:e.scenarioRunId}})},[u]),I=(0,Y.useCallback)(()=>null,[]),L=(0,Y.useCallback)(e=>{y(e)},[y]),R=b===`none`?A.length>0:j.length>0,ae=!!(g.scenarioId||g.passFailStatus);return(0,X.jsxs)(l,{align:`stretch`,gap:0,height:`100%`,children:[(0,X.jsxs)(a,{paddingX:6,paddingY:4,justify:`space-between`,children:[(0,X.jsxs)(l,{align:`start`,gap:0,children:[(0,X.jsx)(c,{fontSize:`xs`,fontWeight:`bold`,color:`fg.muted`,letterSpacing:`wider`,children:`EXTERNAL SET`}),(0,X.jsx)(c,{fontSize:`lg`,fontWeight:`semibold`,children:e})]}),(0,X.jsx)(gn,{visible:o})]}),!C&&!w&&E&&E.length>0&&(0,X.jsx)(r,{paddingX:6,paddingY:4,bg:`bg`,flexShrink:0,position:`relative`,_after:{content:`""`,position:`absolute`,bottom:`-5px`,left:0,right:0,height:`5px`,borderTop:`1px solid var(--chakra-colors-border-muted)`,background:`linear-gradient(to bottom, color-mix(in srgb, var(--chakra-colors-border-muted) 40%, transparent), transparent)`,pointerEvents:`none`},children:(0,X.jsx)(ln,{scenarioOptions:O,filters:g,onFiltersChange:L,groupBy:b,onGroupByChange:_,groupByOptions:Nn,viewMode:h,onViewModeChange:v})}),(0,X.jsx)(mt,{scrollRef:f}),(0,X.jsxs)(l,{ref:f,align:`stretch`,gap:0,flex:1,overflow:`auto`,children:[C&&(0,X.jsx)(fn,{}),w&&(0,X.jsx)(M,{paddingY:12,children:(0,X.jsxs)(N,{children:[(0,X.jsx)(r,{maxWidth:`420px`,width:`100%`,children:(0,X.jsx)(re,{error:w,fallbackTitle:`Couldn't load run data`})}),(0,X.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>void T(),children:[(0,X.jsx)(fe,{size:14}),` Try again`]})]})}),!C&&!w&&E&&E.length>0&&(0,X.jsx)(X.Fragment,{children:!R&&ae?(0,X.jsx)(r,{paddingX:6,paddingY:8,textAlign:`center`,children:(0,X.jsx)(c,{color:`fg.muted`,children:`No runs match the selected filters.`})}):(0,X.jsx)(X.Fragment,{children:b===`none`?A.map(e=>(0,X.jsx)(pn,{batchRun:e,summary:Xe({batchRun:e}),isExpanded:ie.has(e.batchRunId),onToggle:()=>P(e.batchRunId),resolveTargetName:I,onScenarioRunClick:F,viewMode:h,isHighlighted:d===e.batchRunId},e.batchRunId)):j.map(e=>(0,X.jsx)(sn,{group:e,summary:$e({group:e}),isExpanded:ie.has(e.groupKey),onToggle:()=>P(e.groupKey),onScenarioRunClick:F,resolveTargetName:I,viewMode:h},e.groupKey))})}),!C&&!w&&(!E||E.length===0)&&(0,X.jsx)(M,{paddingY:12,children:(0,X.jsxs)(N,{children:[(0,X.jsx)(ne,{children:(0,X.jsx)(Ne,{size:28})}),(0,X.jsx)(ee,{children:`No runs yet`}),(0,X.jsx)(te,{children:`No run data found for this set.`})]})})]})]})}function Fn({count:e,label:t,tooltip:n,icon:r,color:i,bg:o}){return(0,X.jsx)(v,{content:n,children:(0,X.jsxs)(a,{gap:`4px`,paddingX:`8px`,paddingY:`2px`,borderRadius:`md`,bg:o,children:[(0,X.jsx)(r,{size:12,style:{color:`var(--chakra-colors-${i})`}}),(0,X.jsxs)(c,{fontSize:`xs`,fontWeight:`semibold`,color:i,whiteSpace:`nowrap`,children:[e,` `,t]})]})})}function In({summary:e}){return(0,X.jsxs)(a,{gap:1,"data-testid":`run-summary-counts`,children:[e.passedCount>0&&(0,X.jsx)(Fn,{count:e.passedCount,label:`passed`,tooltip:`${e.passedCount} scenario${e.passedCount===1?``:`s`} passed all criteria`,icon:S,color:`green.fg`,bg:`green.subtle`}),e.failedCount>0&&(0,X.jsx)(Fn,{count:e.failedCount,label:`failed`,tooltip:`${e.failedCount} scenario${e.failedCount===1?``:`s`} failed one or more criteria`,icon:Ee,color:`red.fg`,bg:`red.subtle`}),e.stalledCount>0&&(0,X.jsx)(Fn,{count:e.stalledCount,label:`stalled`,tooltip:`${e.stalledCount} scenario${e.stalledCount===1?``:`s`} stalled (no response received)`,icon:y,color:`yellow.fg`,bg:`yellow.subtle`}),e.cancelledCount>0&&(0,X.jsx)(Fn,{count:e.cancelledCount,label:`cancelled`,tooltip:`${e.cancelledCount} scenario${e.cancelledCount===1?``:`s`} were cancelled`,icon:de,color:`fg.muted`,bg:`bg.emphasized`}),e.inProgressCount>0&&(0,X.jsx)(Fn,{count:e.inProgressCount,label:`running`,tooltip:`${e.inProgressCount} scenario${e.inProgressCount===1?``:`s`} currently executing`,icon:ft,color:`orange.fg`,bg:`orange.subtle`}),e.queuedCount>0&&(0,X.jsx)(Fn,{count:e.queuedCount,label:`queued`,tooltip:`${e.queuedCount} scenario${e.queuedCount===1?``:`s`} waiting to execute`,icon:h,color:`blue.fg`,bg:`blue.subtle`})]})}function Ln(e){if(e.startsWith(`{`)&&e.endsWith(`}`))throw Error(`Queue name "${e}" is already wrapped in hash tags. Do not call makeQueueName twice.`);return`{${e}}`}Ln(`simulations/scenarios/executions`);var Rn={TIMEOUT_MS:900*1e3}.TIMEOUT_MS*2;function zn({scenarioSetId:e,startDateMs:t,sseConnected:n=!1}){let{project:r}=q(),[i,a]=(0,Y.useState)(void 0),[o,s]=(0,Y.useState)([]),c=(0,Y.useRef)(void 0);(0,Y.useEffect)(()=>{a(void 0),s([])},[t]);let{data:l,isLoading:u,error:d,refetch:f}=z.scenarios.getSuiteRunData.useQuery({projectId:r?.id??``,scenarioSetId:e,limit:20,cursor:i,startDate:t},{enabled:!!r,trpc:{context:{skipBatch:!0}}});(0,Y.useEffect)(()=>{l?.changed&&(i===void 0?s([l]):i!==c.current&&s(e=>[...e,l]),c.current=i)},[l,i]);let p=(0,Y.useMemo)(()=>{let e=Date.now();return o.flatMap(e=>e.runs).map(t=>t.status===m.IN_PROGRESS&&e-t.timestamp>=Rn?{...t,status:m.STALLED}:t)},[o]);return Mn({scenarioSetId:e,startDateMs:t,runs:p,enabled:o.length<=1,sseConnected:n}),{allRuns:p,allScenarioSetIds:(0,Y.useMemo)(()=>{let e={};for(let t of o)Object.assign(e,t.scenarioSetIds);return e},[o]),hasMore:o.length>0?o[o.length-1]?.hasMore??!1:!1,loadMore:(0,Y.useCallback)(()=>{let e=o[o.length-1];e?.nextCursor&&a(e.nextCursor)},[o]),isLoading:u&&o.length===0,error:d,refetch:f}}function Bn({scenarioSetId:e,period:t,onStatsReady:n,expectedJobCount:o,suiteNameMap:u,pendingBatchRunId:d,highlightBatchId:f}){let{project:p}=q(),h=he(),g=Q(e=>e.groupBy),_=Q(e=>e.viewMode),v=Q(e=>e.filters),y=Q(e=>e.setGroupBy),b=Q(e=>e.setViewMode),S=Q(e=>e.setFilters),C=Q(e=>e.syncToUrl),w=Q(e=>e.hydrateFromUrl),T=(0,Y.useRef)(null),E=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{!E.current&&h.isReady&&(w(h.query),E.current=!0)},[h.isReady,h.query,w]);let D=(0,Y.useRef)(g),O=(0,Y.useRef)(v);(0,Y.useEffect)(()=>{E.current&&(D.current!==g||O.current!==v)&&(D.current=g,O.current=v,C(h))},[g,v,C,h]);let{isConnected:k}=et({projectId:p?.id??``,enabled:!!p?.id,debounceMs:500,filter:e?{scenarioSetId:e}:void 0}),{allRuns:A,allScenarioSetIds:j,hasMore:P,loadMore:F,isLoading:I,error:L,refetch:R}=zn({scenarioSetId:e,startDateMs:t.startDate.getTime(),sseConnected:k}),{data:ae}=z.scenarios.getAll.useQuery({projectId:p?.id??``},{enabled:!!p}),oe=nt(),se=(0,Y.useCallback)(e=>{let t=e.metadata?.langwatch?.targetReferenceId;return t?oe.get(t)??t:null},[oe]),ce=(0,Y.useMemo)(()=>ae?ae.map(e=>({id:e.id,name:e.name})):[],[ae]),[B,V]=(0,Y.useState)(null),{cancelJob:le,cancelBatchRun:ue,isCancellingBatch:de}=Nt({onCancelJobSuccess:()=>{V(null),R(),x.create({title:`Cancellation requested`,type:`info`})},onCancelJobError:e=>{V(null),R(),ie({error:e,fallbackTitle:`Couldn't cancel job`})},onCancelBatchSuccess:()=>{R(),x.create({title:`Jobs cancelled`,type:`success`})},onCancelBatchError:e=>ie({error:e,fallbackTitle:`Couldn't cancel jobs`})}),H=(0,Y.useMemo)(()=>{if(A.length===0)return[];let e=A;return v.scenarioId&&(e=e.filter(e=>e.scenarioId===v.scenarioId)),v.passFailStatus===`pass`?e=e.filter(e=>e.status===m.SUCCESS):v.passFailStatus===`fail`?e=e.filter(e=>e.status===m.ERROR||e.status===m.FAILED):v.passFailStatus===`stalled`&&(e=e.filter(e=>e.status===m.STALLED)),e},[A,v]),U=(0,Y.useMemo)(()=>tt({runs:H,scenarioSetIds:j}),[H,j]),W=(0,Y.useMemo)(()=>g===`none`?[]:g===`scenario`?He({runs:H}):Ue({runs:H,targetNameMap:oe}),[g,H,oe]),{expandedIds:pe,toggleExpanded:me}=bn({panelKey:e??`all-runs`,groupBy:g,batchRuns:U,groups:W}),G=(0,Y.useMemo)(()=>qe({runs:H}),[H]),ge=g===`none`?U[0]?.timestamp??null:W[0]?.timestamp??null;(0,Y.useEffect)(()=>{if(!n)return;let e=G.passedCount+G.failedCount,t=e>0?G.passedCount/e*100:0;n({runCount:G.runCount,passRate:t,lastActivityTimestamp:ge})},[G,ge,n]);let{highlightedBatchId:_e}=Dn({highlightBatchId:f}),ve=e=>!!e&&(We(e)||Ge(e)),ye=(0,Y.useCallback)(e=>t=>{p?.id&&(V(t.scenarioRunId),le({projectId:p.id,scenarioSetId:e,batchRunId:t.batchRunId,scenarioRunId:t.scenarioRunId,scenarioId:t.scenarioId}))},[p?.id,le]),be=(0,Y.useCallback)((e,t)=>{p?.id&&ue({projectId:p.id,scenarioSetId:t,batchRunId:e})},[p?.id,ue]),{openDrawer:xe}=De(),Se=(0,Y.useCallback)(e=>{xe(`scenarioRunDetail`,{urlParams:{scenarioRunId:e.scenarioRunId}})},[xe]),Ce=(0,Y.useCallback)(e=>{S(e)},[S]),we=(0,Y.useMemo)(()=>d?!U.some(e=>e.batchRunId===d):!1,[d,U]);if(L)return(0,X.jsx)(M,{paddingY:12,children:(0,X.jsxs)(N,{children:[(0,X.jsx)(r,{maxWidth:`420px`,width:`100%`,children:(0,X.jsx)(re,{error:L,fallbackTitle:`Couldn't load runs`})}),(0,X.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>void R(),children:[(0,X.jsx)(fe,{size:14}),` Try again`]})]})});let Te=!!e,K=g===`none`?U.length:W.length,Ee=!!(v.scenarioId||v.passFailStatus);return(0,X.jsxs)(l,{align:`stretch`,gap:0,height:`100%`,children:[!Te&&(0,X.jsxs)(r,{paddingX:6,paddingY:4,children:[(0,X.jsx)(c,{fontSize:`xl`,fontWeight:`semibold`,children:`All Runs`}),I?(0,X.jsx)(s,{height:`20px`,width:`220px`,marginTop:.5}):(0,X.jsxs)(a,{gap:2,"data-testid":`all-runs-header-totals`,children:[(0,X.jsxs)(c,{fontSize:`sm`,color:`fg.muted`,children:[g===`none`?`${U.length} ${U.length===1?`execution`:`executions`} · `:`${W.length} ${W.length===1?`group`:`groups`} · `,G.runCount,` `,G.runCount===1?`run`:`runs`]}),(0,X.jsx)(In,{summary:{passedCount:G.passedCount,failedCount:G.failedCount,stalledCount:0,cancelledCount:0,completedCount:G.passedCount+G.failedCount,inProgressCount:G.pendingCount,queuedCount:0,passRate:0,totalCount:G.runCount,totalCost:null,averageAgentLatencyMs:null,totalDurationMs:null,agentLatencyStats:null,agentCostStats:null,averageAgentCost:null}})]})]}),(0,X.jsx)(r,{paddingX:6,paddingY:4,bg:`bg`,position:`relative`,_after:{content:`""`,position:`absolute`,bottom:`-5px`,left:0,right:0,height:`5px`,borderTop:`1px solid var(--chakra-colors-border-muted)`,background:`linear-gradient(to bottom, color-mix(in srgb, var(--chakra-colors-border-muted) 40%, transparent), transparent)`,pointerEvents:`none`},children:(0,X.jsx)(ln,{scenarioOptions:ce,filters:v,onFiltersChange:Ce,groupBy:g,onGroupByChange:y,viewMode:_,onViewModeChange:b})}),(0,X.jsx)(mt,{scrollRef:T}),I?(0,X.jsx)(fn,{}):K===0&&!we?(0,X.jsx)(M,{paddingY:12,children:(0,X.jsxs)(N,{children:[(0,X.jsx)(ne,{children:(0,X.jsx)(Ne,{size:28})}),(0,X.jsx)(ee,{children:Ee?`No matching runs`:`No runs yet`}),(0,X.jsx)(te,{children:Ee?`No runs match the selected filters.`:Te?`Run this suite to see results here.`:`Execute a suite to see results here.`}),Ee?null:(0,X.jsx)(st,{surface:`simulationRuns`})]})}):(0,X.jsxs)(l,{ref:T,align:`stretch`,gap:0,flex:1,minH:0,overflow:`auto`,children:[we&&(0,X.jsx)(pn,{loading:!0}),g===`none`?U.map(t=>(0,X.jsx)(pn,{batchRun:t,summary:Xe({batchRun:t}),isExpanded:pe.has(t.batchRunId),onToggle:()=>me(t.batchRunId),resolveTargetName:se,onScenarioRunClick:Se,expectedJobCount:o,suiteName:u?Ze({scenarioSetId:t.scenarioSetId,suiteNameMap:u})??void 0:void 0,viewMode:_,onCancelRun:ve(t.scenarioSetId??e)?ye(t.scenarioSetId??e??``):void 0,onCancelAll:ve(t.scenarioSetId??e)?()=>be(t.batchRunId,t.scenarioSetId??e??``):void 0,isCancellingBatch:de,cancellingJobId:B,isHighlighted:_e===t.batchRunId},t.batchRunId)):W.map(t=>(0,X.jsx)(sn,{group:t,summary:$e({group:t}),isExpanded:pe.has(t.groupKey),onToggle:()=>me(t.groupKey),onScenarioRunClick:Se,resolveTargetName:se,viewMode:_,onCancelRun:ve(e)?ye(e??``):void 0,cancellingJobId:B},t.groupKey)),P&&(0,X.jsx)(r,{paddingX:6,paddingY:6,display:`flex`,justifyContent:`center`,children:(0,X.jsx)(i,{variant:`outline`,onClick:F,children:`Load More...`})})]})]})}function Vn({open:e,onClose:t,onConfirm:r,suiteName:a,isLoading:o=!1}){return(0,X.jsx)(K.Root,{open:e,onOpenChange:t,placement:`center`,children:(0,X.jsxs)(K.Content,{bg:`bg`,maxWidth:`500px`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(K.CloseTrigger,{}),(0,X.jsx)(K.Header,{children:(0,X.jsx)(K.Title,{fontSize:`md`,fontWeight:`500`,children:`Archive run plan?`})}),(0,X.jsx)(K.Body,{children:(0,X.jsxs)(l,{align:`stretch`,gap:4,children:[(0,X.jsx)(c,{children:(0,X.jsx)(c,{as:`span`,fontWeight:`semibold`,children:a})}),(0,X.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`Archived run plans will no longer appear in the sidebar. Test runs are preserved.`})]})}),(0,X.jsxs)(K.Footer,{children:[(0,X.jsx)(i,{variant:`outline`,mr:3,onClick:e=>{e.stopPropagation(),t()},disabled:o,children:`Cancel`}),(0,X.jsx)(i,{colorPalette:`orange`,onClick:e=>{e.stopPropagation(),r()},disabled:o,children:o?(0,X.jsx)(n,{size:`sm`}):`Archive`})]})]})})}function Hn({x:e,y:t,onEdit:n,onDuplicate:i,onArchive:a,onClose:o}){let s=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&o()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),(0,X.jsx)(r,{ref:s,position:`fixed`,left:`${e}px`,top:`${t}px`,bg:`bg.surface`,border:`1px solid`,borderColor:`border`,borderRadius:`md`,shadow:`lg`,zIndex:1e3,py:1,minWidth:`140px`,children:(0,X.jsxs)(l,{align:`stretch`,gap:0,children:[(0,X.jsx)(Un,{label:`Edit`,onClick:()=>{n(),o()}}),(0,X.jsx)(Un,{label:`Duplicate`,onClick:()=>{i(),o()}}),(0,X.jsx)(Un,{label:`Archive`,onClick:()=>{a(),o()},color:`orange.fg`})]})})}function Un({label:e,onClick:t,color:n}){return(0,X.jsx)(r,{as:`button`,width:`full`,textAlign:`left`,paddingX:3,paddingY:1.5,cursor:`pointer`,_hover:{bg:`bg.subtle`},onClick:t,children:(0,X.jsx)(c,{fontSize:`sm`,color:n,children:e})})}function Wn({suite:e,onEdit:t,onRun:n,isRunning:o=!1,pendingBatchRunId:s,period:u,highlightBatchId:d}){let f=gt(),p=(()=>{try{return it(e.targets)}catch{return[]}})(),m=e.scenarioIds.length*p.length*e.repeatCount,[g,_]=(0,Y.useState)(null);return(0,X.jsxs)(l,{align:`stretch`,gap:0,height:`100%`,children:[(0,X.jsx)(r,{paddingX:6,paddingY:4,children:(0,X.jsxs)(a,{justify:`space-between`,align:`start`,children:[(0,X.jsxs)(l,{align:`start`,gap:1,children:[(0,X.jsx)(c,{fontSize:`xl`,fontWeight:`bold`,children:e.name}),e.description&&(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:e.description})]}),(0,X.jsxs)(a,{gap:2,children:[(0,X.jsxs)(i,{size:`sm`,variant:`outline`,onClick:t,children:[(0,X.jsx)(Me,{size:14}),`Edit`]}),(0,X.jsxs)(i,{size:`sm`,colorPalette:`blue`,onClick:n,disabled:o,loading:o,children:[(0,X.jsx)(xe,{size:14}),`Run`]})]})]})}),(0,X.jsx)(r,{paddingX:6,paddingBottom:2,children:(0,X.jsxs)(a,{gap:2,flexWrap:`wrap`,alignItems:`center`,children:[(0,X.jsx)($,{icon:(0,X.jsx)(je,{size:14}),value:e.scenarioIds.length,label:`scenarios`,colorScheme:`gray`}),(0,X.jsx)($,{icon:(0,X.jsx)(me,{size:14}),value:p.length,label:`targets`,colorScheme:`purple`}),(0,X.jsx)($,{icon:(0,X.jsx)(pt,{size:14}),value:`${e.repeatCount}x`,label:`trials`,colorScheme:`gray`}),g&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(w,{orientation:`vertical`,height:`24px`,borderColor:`border`}),(0,X.jsx)($,{icon:(0,X.jsx)(le,{size:14}),value:m,label:`executions`,colorScheme:`gray`}),(0,X.jsx)($,{icon:(0,X.jsx)(B,{size:14}),value:g.runCount,label:`runs`,colorScheme:`gray`}),(0,X.jsx)(Kn,{passRate:g.passRate}),g.lastActivityTimestamp&&(0,X.jsx)($,{icon:(0,X.jsx)(h,{size:14}),value:Ce(g.lastActivityTimestamp,f),label:``,colorScheme:`gray`})]}),!g&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(w,{orientation:`vertical`,height:`24px`,borderColor:`border`}),(0,X.jsx)($,{icon:(0,X.jsx)(le,{size:14}),value:m,label:`executions`,colorScheme:`gray`})]})]})}),(0,X.jsx)(Bn,{scenarioSetId:Je(e.id),onStatsReady:_,period:u,pendingBatchRunId:s,highlightBatchId:d})]})}var Gn={gray:{bg:`bg.muted`,color:`fg.muted`},purple:{bg:`bg.muted`,color:`purple.fg`},blue:{bg:`bg.muted`,color:`blue.fg`},orange:{bg:`bg.muted`,color:`orange.fg`}};function $({icon:e,value:t,label:n,colorScheme:i=`gray`}){let o=Gn[i]??Gn.gray;return(0,X.jsxs)(a,{gap:1.5,paddingX:3,paddingY:1.5,borderRadius:`full`,bg:o.bg,children:[(0,X.jsx)(r,{color:o.color,children:e}),(0,X.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:t}),n&&(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:n})]})}function Kn({passRate:e}){return(0,X.jsxs)(a,{gap:1.5,paddingX:3,paddingY:1.5,borderRadius:`full`,border:`1px solid`,borderColor:`border`,bg:`bg`,children:[(0,X.jsx)(V,{size:14}),(0,X.jsxs)(c,{fontSize:`sm`,fontWeight:`semibold`,children:[Math.round(e),`%`]}),(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`pass`})]})}function qn({onNewSuite:e}){return(0,X.jsx)(we,{flex:1,height:`100%`,children:(0,X.jsx)(M,{children:(0,X.jsxs)(N,{children:[(0,X.jsx)(ne,{children:(0,X.jsx)(ke,{size:32})}),(0,X.jsx)(ee,{children:`No run plan selected`}),(0,X.jsx)(te,{children:`Select a run plan from the sidebar or create a new one`}),(0,X.jsxs)(a,{gap:2,children:[(0,X.jsxs)(i,{colorPalette:`blue`,onClick:e,children:[(0,X.jsx)(Te,{size:16}),` New Run Plan`]}),(0,X.jsx)(st,{surface:`simulations`,size:`md`})]})]})})})}function Jn({open:e,onClose:t,onConfirm:r,suiteName:o,scenarioCount:s,targetCount:u,repeatCount:d=1,isLoading:f=!1}){let p=s*u*d;return(0,X.jsx)(K.Root,{open:e,onOpenChange:()=>{f||t()},placement:`center`,children:(0,X.jsxs)(K.Content,{bg:`bg`,maxWidth:`500px`,onClick:e=>e.stopPropagation(),children:[!f&&(0,X.jsx)(K.CloseTrigger,{}),(0,X.jsx)(K.Header,{children:(0,X.jsx)(K.Title,{children:o})}),(0,X.jsx)(K.Body,{children:(0,X.jsxs)(l,{align:`stretch`,gap:4,children:[(0,X.jsxs)(c,{fontWeight:`semibold`,children:[` `,`Run `,p,` `,p===1?`simulation`:`simulations`,`?`]}),(0,X.jsxs)(a,{gap:6,children:[(0,X.jsxs)(l,{gap:0,align:`start`,children:[(0,X.jsxs)(a,{gap:1.5,align:`center`,children:[(0,X.jsx)(je,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,X.jsx)(c,{fontSize:`lg`,fontWeight:`semibold`,children:s})]}),(0,X.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:s===1?`scenario`:`scenarios`})]}),(0,X.jsxs)(l,{gap:0,align:`start`,children:[(0,X.jsxs)(a,{gap:1.5,align:`center`,children:[(0,X.jsx)(dt,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,X.jsx)(c,{fontSize:`lg`,fontWeight:`semibold`,children:u})]}),(0,X.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:u===1?`target`:`targets`})]}),d>1&&(0,X.jsxs)(l,{gap:0,align:`start`,children:[(0,X.jsxs)(a,{gap:1.5,align:`center`,children:[(0,X.jsx)(W,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,X.jsxs)(c,{fontSize:`lg`,fontWeight:`semibold`,children:[d,`x`]})]}),(0,X.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`repeats`})]})]})]})}),(0,X.jsxs)(K.Footer,{children:[(0,X.jsx)(i,{variant:`outline`,onClick:e=>{e.stopPropagation(),t()},disabled:f,children:`Cancel`}),(0,X.jsx)(i,{colorPalette:`blue`,onClick:e=>{e.stopPropagation(),r()},disabled:f,children:f?(0,X.jsx)(n,{size:`sm`}):`Run ${p} ${p===1?`Job`:`Jobs`}`})]})]})})}var Yn=`all-runs`,Xn=`external:`;function Zn(e){return e.startsWith(Xn)}function Qn(e){return e.slice(9)}function $n(e){return`${Xn}${e}`}function er({projectSlug:e,segments:t,query:n}){let r=`/${e}/simulations`,[i,a,o]=t;if(i===`scenarios`||i===`scenario`)return a?`${r}/scenarios?drawer.open=scenarioEditor&drawer.scenarioId=${encodeURIComponent(a)}`:`${r}/scenarios`;if(i===`suites`){let e=n.suite,t=n.externalSet;return typeof e==`string`&&e?`${r}/run-plans/${e}`:typeof t==`string`&&t?`${r}/${t}`:r}return t.length===3&&i!==`run-plans`?`${r}/${i}/${a}?openRun=${o}`:null}var tr=new Set([`project`,`path`]),nr=e=>!tr.has(e)&&!e.startsWith(`drawer`);function rr(){let e=he(),{selectedSuiteSlug:t,highlightBatchId:n}=ir({isReady:e.isReady,path:e.query.path??ar(e.asPath)}),r=e.query.project;return{selectedSuiteSlug:t,navigateToSuite:(0,Y.useCallback)(t=>{if(!r)return;let n={};for(let[t,r]of Object.entries(e.query))r===void 0||!nr(t)||(n[t]=r);let i;i=t===`all-runs`?[]:Zn(t)?[Qn(t)]:[`run-plans`,t];let a=i.length>0?`/${r}/simulations/${i.join(`/`)}`:`/${r}/simulations`,o=new URLSearchParams;for(let[e,t]of Object.entries(n))if(Array.isArray(t))for(let n of t)o.append(e,n);else o.set(e,t);let s=o.toString(),c=s?`${a}?${s}`:a;e.push({pathname:`/[project]/simulations/[[...path]]`,query:{project:r,...i.length>0?{path:i}:{},...n}},c,{shallow:!0})},[e,r]),highlightBatchId:n}}function ir({isReady:e,path:t}){if(!e)return{selectedSuiteSlug:null,highlightBatchId:null};let n=(Array.isArray(t)?t:t?[t]:[]).filter(e=>e&&!e.startsWith(`?`)&&!e.includes(`=`));return n.length===0?{selectedSuiteSlug:Yn,highlightBatchId:null}:n[0]===`run-plans`&&n.length>=2?{selectedSuiteSlug:n[1],highlightBatchId:n[2]??null}:{selectedSuiteSlug:$n(n[0]),highlightBatchId:n[1]??null}}function ar(e){let t=(e.split(`?`)[0]?.split(`#`)[0]??``).match(/\/simulations\/(.+?)\/?$/);if(t?.[1])return t[1].split(`/`).filter(Boolean)}var or=336*60*60*1e3,sr=`langwatch:simulations-voice-callout-dismissed:v1:`,cr=`https://langwatch.ai/scenario/voice/getting-started`,lr=e=>`${sr}${e}`;function ur(e){if(typeof window>`u`)return!1;try{let t=localStorage.getItem(lr(e));if(!t)return!1;let n=Number(t);return Number.isFinite(n)?n>Date.now():!1}catch{return!1}}function dr(e){if(!(typeof window>`u`))try{localStorage.setItem(lr(e),String(Date.now()+or))}catch{}}function fr(){let{project:e}=q({redirectToOnboarding:!1,redirectToProjectOnboarding:!1}),t=e?.id,[n,i]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{i(!0)},[]),(0,Y.useEffect)(()=>{t&&s(ur(t))},[t]),!n||!t||o?null:(0,X.jsx)(r,{paddingX:3,paddingTop:2,paddingBottom:1,children:(0,X.jsx)(`a`,{href:cr,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>{Se.capture(`voice_agents_callout_click`,{surface:`simulations_sidebar`,projectId:t}),t&&dr(t)},"aria-label":`Open Voice Agents getting started guide in a new tab`,style:{textDecoration:`none`,display:`block`},children:(0,X.jsxs)(r,{colorPalette:`blue`,position:`relative`,borderRadius:`lg`,padding:3,overflow:`hidden`,bg:`colorPalette.subtle`,borderWidth:`1px`,borderColor:`colorPalette.muted`,transition:`transform 0.12s ease, border-color 0.12s ease, background 0.12s ease`,_hover:{transform:`translateY(-1px)`,borderColor:`colorPalette.emphasized`,bg:`colorPalette.muted`},children:[(0,X.jsxs)(a,{align:`start`,gap:2.5,children:[(0,X.jsx)(r,{flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,boxSize:`26px`,borderRadius:`full`,bg:`colorPalette.solid`,children:(0,X.jsx)(E,{as:be,boxSize:3.5,color:`white`})}),(0,X.jsxs)(l,{align:`start`,gap:1,flex:1,minWidth:0,children:[(0,X.jsx)(c,{fontSize:`xs`,fontWeight:`700`,color:`colorPalette.fg`,lineHeight:1.25,letterSpacing:`-0.005em`,children:`Try voice agent simulations`}),(0,X.jsx)(c,{fontSize:`xs`,color:`fg.muted`,lineHeight:1.4,children:`Test your voice agent end-to-end with realtime voices.`}),(0,X.jsxs)(a,{gap:1,marginTop:.5,color:`colorPalette.fg`,fontSize:`xs`,fontWeight:`600`,children:[(0,X.jsx)(c,{children:`Get started`}),(0,X.jsx)(E,{as:ve,boxSize:3})]})]})]}),(0,X.jsx)(j,{"aria-label":`Dismiss`,size:`xs`,variant:`ghost`,color:`fg.muted`,position:`absolute`,top:1,right:1,minWidth:`20px`,height:`20px`,padding:0,_hover:{bg:`colorPalette.emphasized`,color:`colorPalette.fg`},_active:{bg:`colorPalette.emphasized`},onClick:e=>{e.stopPropagation(),e.preventDefault(),t&&dr(t),s(!0)},children:(0,X.jsx)(_e,{size:12})})]})})})}var pr=`suite-sidebar-collapsed`,mr=6;function hr({projectSlug:e,suites:t,selectedSuiteSlug:n,runSummaries:o,externalSets:u=[],onSelectSuite:d,onRunSuite:f,onContextMenu:p,onNewSuite:m,isLoading:h=!1}){let[g,_]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(()=>{try{return localStorage.getItem(pr)===`true`}catch{return!1}}),x=()=>{let e=!y;b(e);try{localStorage.setItem(pr,String(e))}catch{}},S=(0,Y.useMemo)(()=>{if(!g.trim())return t;let e=g.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e))},[t,g]),C=(0,Y.useMemo)(()=>[...g.trim()?u.filter(e=>e.scenarioSetId.toLowerCase().includes(g.toLowerCase())):u].sort((e,t)=>t.lastRunTimestamp-e.lastRunTimestamp),[u,g]),w=S.length===0&&C.length===0;return(0,X.jsxs)(l,{width:y?`auto`:`280px`,minWidth:y?`auto`:`280px`,height:`100%`,align:`stretch`,gap:0,children:[!y&&(0,X.jsx)(r,{paddingX:3,paddingBottom:2,children:(0,X.jsx)(rt,{size:`sm`,borderRadius:`full`,placeholder:`Search...`,value:g,onChange:e=>_(e.target.value)})}),(0,X.jsx)(r,{paddingX:y?6:2,paddingBottom:2,children:y?(0,X.jsx)(v,{content:`All Runs`,positioning:{placement:`right`},children:(0,X.jsx)(j,{"aria-label":`All Runs`,size:`sm`,width:`full`,variant:n===`all-runs`?`solid`:`ghost`,onClick:()=>d(Yn),children:(0,X.jsx)(Ae,{size:16})})}):(0,X.jsx)(gr,{icon:(0,X.jsx)(Ae,{size:14}),label:`All Runs`,href:`/${e}/simulations`,isSelected:n===Yn,onClick:()=>d(Yn)})}),(0,X.jsx)(mt,{}),(0,X.jsxs)(l,{flex:1,overflow:`auto`,paddingX:y?6:2,paddingTop:2,paddingBottom:2,gap:+!y,align:`stretch`,children:[h&&!y&&Array.from({length:mr}).map((e,t)=>(0,X.jsx)(s,{"data-testid":`suite-sidebar-skeleton`,height:`60px`,width:`100%`,borderRadius:`md`,marginBottom:1},t)),!h&&!y&&w&&t.length===0&&u.length===0&&(0,X.jsx)(M,{size:`sm`,paddingY:6,children:(0,X.jsxs)(N,{children:[(0,X.jsx)(ne,{children:(0,X.jsx)(Ne,{size:22})}),(0,X.jsx)(ee,{fontSize:`sm`,children:`No run plans yet`}),(0,X.jsx)(te,{fontSize:`xs`,textAlign:`center`,maxWidth:`180px`,children:`Group scenarios into a plan and run them together against your agent.`}),m&&(0,X.jsxs)(i,{size:`xs`,colorPalette:`blue`,onClick:m,children:[(0,X.jsx)(Te,{size:14}),` New Run Plan`]})]})}),!h&&!y&&w&&(t.length>0||u.length>0)&&(0,X.jsx)(c,{fontSize:`sm`,color:`fg.muted`,paddingX:2,paddingY:4,textAlign:`center`,children:`No matching run plans`}),!h&&S.map(t=>y?(0,X.jsx)(v,{content:t.name,positioning:{placement:`right`},children:(0,X.jsx)(j,{"aria-label":t.name,size:`sm`,width:`full`,variant:t.slug===n?`solid`:`ghost`,onClick:()=>d(t.slug),children:(0,X.jsx)(we,{width:`22px`,height:`22px`,borderRadius:`full`,bg:t.slug===n?`transparent`:`bg.emphasized`,fontSize:`xs`,fontWeight:`bold`,children:t.name.charAt(0).toUpperCase()})})},t.id):(0,X.jsx)(yr,{suite:t,projectSlug:e,isSelected:t.slug===n,runSummary:o?.get(t.id),onSelect:()=>d(t.slug),onRun:()=>f(t.id),onContextMenu:e=>p(e,t.id)},t.id)),!h&&C.length>0&&(0,X.jsxs)(X.Fragment,{children:[!y&&(0,X.jsx)(c,{"data-testid":`external-sets-header`,fontSize:`xs`,fontWeight:`bold`,color:`fg.muted`,letterSpacing:`wider`,paddingX:2,paddingTop:3,paddingBottom:1,children:`EXTERNAL SETS`}),y&&(0,X.jsx)(r,{paddingY:.5,children:(0,X.jsx)(mt,{})}),C.map(t=>y?(0,X.jsx)(v,{content:t.scenarioSetId,positioning:{placement:`right`},children:(0,X.jsx)(j,{"aria-label":t.scenarioSetId,size:`sm`,width:`full`,variant:n===$n(t.scenarioSetId)?`solid`:`ghost`,onClick:()=>d($n(t.scenarioSetId)),children:(0,X.jsx)(we,{width:`22px`,height:`22px`,borderRadius:`full`,bg:n===$n(t.scenarioSetId)?`transparent`:`bg.emphasized`,fontSize:`xs`,fontWeight:`bold`,children:t.scenarioSetId.charAt(0).toUpperCase()})})},t.scenarioSetId):(0,X.jsx)(br,{externalSet:t,projectSlug:e,isSelected:n===$n(t.scenarioSetId),onSelect:()=>d($n(t.scenarioSetId))},t.scenarioSetId))]})]}),!y&&(0,X.jsx)(fr,{}),(0,X.jsx)(mt,{}),(0,X.jsx)(a,{paddingX:y?6:3,paddingY:1.5,justify:`flex-start`,children:(0,X.jsx)(j,{"aria-label":y?`Expand sidebar`:`Collapse sidebar`,size:`sm`,variant:`outline`,width:y?`full`:void 0,onClick:x,children:y?(0,X.jsx)(ue,{size:16}):(0,X.jsx)(U,{size:16})})})]})}function gr({icon:e,label:t,href:n,isSelected:r=!1,onClick:i}){return(0,X.jsx)(a,{asChild:!0,width:`full`,paddingX:2,paddingY:1.5,borderRadius:`md`,cursor:`pointer`,bg:r?`bg.emphasized`:`transparent`,_hover:{bg:r?`bg.emphasized`:`bg.subtle`},onClick:e=>{e.metaKey||e.ctrlKey||e.button===1||(e.preventDefault(),i())},gap:2,textDecoration:`none`,color:`inherit`,children:(0,X.jsxs)(`a`,{href:n??`#`,children:[e,(0,X.jsx)(c,{fontSize:`sm`,children:t})]})})}function _r({passedCount:e,failedCount:t,totalCount:n}){let r=n>0?e/n*100:null;return(0,X.jsxs)(a,{gap:1,color:`fg.muted`,children:[(0,X.jsx)(ut,{passRate:r,size:`8px`}),(0,X.jsx)(c,{fontSize:`xs`,color:ct(r),fontWeight:`medium`,children:r===null?`-`:`${Math.round(r)}%`}),(0,X.jsx)(c,{fontSize:`xs`,color:`gray.400`,children:`·`}),(0,X.jsxs)(c,{fontSize:`xs`,color:`fg.subtle`,children:[e,` passed`]})]})}function vr({isSelected:e,href:t,onClick:n,onContextMenu:r,className:i,"data-testid":o,children:s}){return(0,X.jsx)(a,{asChild:!0,className:i,"data-testid":o,"data-selected":e||void 0,paddingX:3,position:`relative`,paddingY:3,borderRadius:`md`,cursor:`pointer`,bg:e?`bg.subtle`:`transparent`,border:e?`1px solid border.emphasized`:`none`,_hover:{bg:e?`bg.emphasized`:`bg.subtle`},onContextMenu:r,onClick:e=>{e.metaKey||e.ctrlKey||e.button===1||(e.preventDefault(),n())},justify:`space-between`,width:`full`,textDecoration:`none`,color:`inherit`,children:(0,X.jsx)(`a`,{href:t??`#`,children:s})})}function yr({suite:e,projectSlug:t,isSelected:n,runSummary:i,onSelect:o,onRun:s,onContextMenu:d}){let f=gt();return(0,X.jsx)(vr,{className:`group`,"data-testid":`suite-list-item`,href:`/${t}/simulations/run-plans/${e.slug}`,isSelected:n,onClick:o,onContextMenu:d,children:(0,X.jsxs)(l,{align:`start`,gap:0,flex:1,overflow:`hidden`,textAlign:`left`,children:[(0,X.jsxs)(a,{gap:1.5,width:`full`,children:[(0,X.jsx)(c,{fontSize:`13px`,fontWeight:`medium`,lineClamp:1,children:e.name||`<empty>`}),(0,X.jsx)(L,{}),i?.lastRunTimestamp&&(0,X.jsx)(c,{fontSize:`11px`,color:`fg.subtle`,flexShrink:0,whiteSpace:`nowrap`,children:Ce(i.lastRunTimestamp,f)}),(0,X.jsxs)(a,{gap:0,flexShrink:0,children:[(0,X.jsxs)(r,{as:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),s()},paddingX:1,paddingY:.5,borderRadius:`sm`,_hover:{bg:`bg.muted`},cursor:`pointer`,display:`flex`,alignItems:`center`,gap:1,flexShrink:0,children:[(0,X.jsx)(xe,{size:12}),(0,X.jsx)(c,{fontSize:`xs`,children:`Run`})]}),(0,X.jsx)(r,{as:`button`,"aria-label":`Run plan options`,"data-testid":`suite-menu-button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),d(e)},paddingX:1,paddingY:.5,borderRadius:`sm`,_hover:{bg:`bg.muted`},display:`flex`,alignItems:`center`,opacity:0,_groupHover:{opacity:1},transition:`opacity 150ms`,cursor:`pointer`,children:(0,X.jsx)(u,{size:14})})]})]}),i&&(0,X.jsx)(_r,{passedCount:i.passedCount,failedCount:i.failedCount,totalCount:i.totalCount})]})})}function br({externalSet:e,projectSlug:t,isSelected:n,onSelect:r}){let i=gt();return(0,X.jsx)(vr,{"data-testid":`external-set-list-item`,href:`/${t}/simulations/${e.scenarioSetId}`,isSelected:n,onClick:r,children:(0,X.jsxs)(l,{align:`start`,gap:0,flex:1,overflow:`hidden`,textAlign:`left`,children:[(0,X.jsxs)(a,{gap:1.5,width:`full`,children:[(0,X.jsx)(c,{fontSize:`13px`,fontWeight:`medium`,lineClamp:1,children:e.scenarioSetId||`<empty>`}),(0,X.jsx)(L,{}),e.lastRunTimestamp&&(0,X.jsx)(c,{fontSize:`11px`,color:`fg.subtle`,flexShrink:0,whiteSpace:`nowrap`,children:Ce(e.lastRunTimestamp,i)})]}),(0,X.jsx)(_r,{passedCount:e.passedCount,failedCount:e.failedCount,totalCount:e.totalCount})]})})}function xr(e={}){let{project:t}=q(),{openDrawer:n}=De(),r=z.useContext(),i=(0,Y.useRef)(e);i.current=e;let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),l=z.suites.run.useMutation({onSuccess:(e,t)=>{if(r.scenarios.getSuiteRunData.invalidate(),o(null),(e.skippedArchived?.scenarios?.length??0)+(e.skippedArchived?.targets?.length??0)>0){let r=[];e.skippedArchived.scenarios.length>0&&r.push(`${e.skippedArchived.scenarios.length} archived scenario${e.skippedArchived.scenarios.length>1?`s`:``}`),e.skippedArchived.targets.length>0&&r.push(`${e.skippedArchived.targets.length} archived target${e.skippedArchived.targets.length>1?`s`:``}`),x.create({title:`Run plan scheduled (${e.jobCount} jobs)`,description:`${r.join(` and `)} skipped.`,type:`warning`,meta:{closable:!0},action:{label:`Edit Run Plan`,onClick:()=>{n(`suiteEditor`,{urlParams:{suiteId:t.id}})}}})}else x.create({title:`Run plan scheduled (${e.jobCount} jobs)`,type:`success`,meta:{closable:!0},action:i.current.onViewRun?{label:`View run`,onClick:()=>i.current.onViewRun?.(t.id)}:void 0});i.current.onRunScheduled?.(t.id,t.batchRunId??e.batchRunId)},onError:(e,t)=>{o(null),c(null),at({error:e,fallbackTitle:`Couldn't start run plan`,onEditRunPlan:()=>{n(`suiteEditor`,{urlParams:{suiteId:t.id}})}})}}),u=(0,Y.useCallback)(e=>{!t||l.isPending||o(e)},[t,l.isPending]),d=(0,Y.useCallback)(()=>{if(!t||!a||l.isPending)return;let e=Ie(C.SCENARIO_BATCH).toString();c(e),l.mutate({projectId:t.id,id:a.id,idempotencyKey:crypto.randomUUID(),batchRunId:e})},[t,a,l]),f=(0,Y.useCallback)(()=>{l.isPending||o(null)},[l.isPending]),{data:p}=z.scenarios.getAll.useQuery({projectId:t?.id??``},{enabled:!!t&&!!a}),m=(0,Y.useMemo)(()=>{if(!a||!p)return a?.scenarioIds.length??0;let e=new Set(p.map(e=>e.id));return a.scenarioIds.filter(t=>e.has(t)).length},[a,p]),h=(0,Y.useMemo)(()=>a?it(a.targets).length:0,[a]);return{requestRun:u,confirmRun:d,cancelRun:f,isPending:l.isPending,pendingBatchRunId:s,dialogProps:{open:!!a,onClose:f,onConfirm:d,suiteName:a?.name??``,scenarioCount:m,targetCount:h,repeatCount:a?.repeatCount??1,isLoading:l.isPending}}}var Sr=`langwatch:scenario-tab-key`,Cr=`langwatch:scenario-tab-id`;function wr(e){try{return window.sessionStorage.getItem(e)}catch{return null}}function Tr({key:e,value:t}){try{window.sessionStorage.setItem(e,t)}catch{}}function Er(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Dr(){let e=he(),[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{if(typeof window>`u`||!e.isReady)return;let t=e.query[Ye],r=Array.isArray(t)?t[0]:t;if(r){Tr({key:Sr,value:r});let{[Ye]:t,...n}=e.query;e.replace({pathname:e.pathname,query:n},void 0,{shallow:!0})}let a=r??wr(Sr);if(!a)return;let o=wr(Cr);o||(o=Er(),Tr({key:Cr,value:o})),n(a),i(o)},[e.isReady,e.query]),(0,Y.useMemo)(()=>({tabKey:t,tabId:r}),[r,t])}var Or=6e4;function kr({intervalMs:e=Or,children:t}){let[n,r]=(0,Y.useState)(()=>Date.now());return(0,Y.useEffect)(()=>{let t=setInterval(()=>r(Date.now()),e);return()=>clearInterval(t)},[e]),(0,X.jsx)(ht,{value:n,children:t})}function Ar(){let{project:e}=q(),{openDrawer:t,setFlowCallbacks:n}=De(),i=z.useContext(),{selectedSuiteSlug:o,navigateToSuite:s,highlightBatchId:c}=rr(),u=he();(0,Y.useEffect)(()=>{if(!u.isReady)return;let e=u.query.openRun;if(typeof e==`string`&&e){t(`scenarioRunDetail`,{urlParams:{scenarioRunId:e}});let{openRun:n,...r}=u.query;u.replace({pathname:u.pathname,query:r},void 0,{shallow:!0})}},[u.isReady]);let[d,f]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{if(!u.isReady)return;let e=u.query.pendingBatch;if(typeof e==`string`&&e){f(e);let{pendingBatch:t,...n}=u.query;u.replace({pathname:u.pathname,query:n},void 0,{shallow:!0})}},[u.isReady]);let{period:p,mode:m,setPeriod:h,setRelativePeriod:v}=g(30),[y,b]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null),{data:w,isLoading:T,error:E}=z.suites.getAll.useQuery({projectId:e?.id??``},{enabled:!!e}),{data:k,isLoading:A}=z.scenarios.getExternalSetSummaries.useQuery({projectId:e?.id??``,startDate:p.startDate.getTime(),endDate:p.endDate.getTime()},{enabled:!!e,refetchInterval:15e3}),{data:j}=z.suites.getSummaries.useQuery({projectId:e?.id??``,startDate:p.startDate.getTime(),endDate:p.endDate.getTime()},{enabled:!!e,refetchInterval:3e4}),ee=Dr(),M=(0,Y.useRef)(null),te=(0,Y.useCallback)(e=>{let t=new URL(e.url);t.origin===window.location.origin&&t.pathname!==window.location.pathname&&M.current!==e.url&&(M.current=e.url,u.push(t.pathname+t.search))},[u]);et({projectId:e?.id??``,refetch:()=>{i.suites.getSummaries.invalidate(),i.scenarios.getExternalSetSummaries.invalidate()},enabled:!!e?.id,debounceMs:500,tabKey:ee.tabKey,tabId:ee.tabId,onTabNavigate:te});let ne=(0,Y.useMemo)(()=>{if(j)return new Map(Object.entries(j))},[j]),N=(0,Y.useMemo)(()=>{let e=new Map;if(w)for(let t of w)e.set(t.id,t.name);return e},[w]),re=(0,Y.useMemo)(()=>!o||o===`all-runs`||Zn(o)?null:w?.find(e=>e.slug===o)??null,[o,w]),P=(0,Y.useMemo)(()=>!o||!Zn(o)?null:Qn(o),[o]);(0,Y.useEffect)(()=>{if(!o||o===`all-runs`)return;let e=null;if(Zn(o)&&k){let t=Qn(o);e=k.find(e=>e.scenarioSetId===t)?.lastRunTimestamp??null}else re&&ne&&(e=ne.get(re.id)?.lastRunTimestamp??null);if(e&&e<p.startDate.getTime()){let t=Math.ceil((Date.now()-e)/864e5);h(Oe(new Date,t<=30?30:t<=90?90:365),new Date)}},[o]);let F=S?w?.find(e=>e.id===S):null,I=z.suites.archive.useMutation({onSuccess:()=>{i.suites.getAll.invalidate();let e=w?.find(e=>e.id===S);e&&e.slug===o&&s(Yn),C(null),x.create({title:`Run plan archived`,type:`success`,meta:{closable:!0}})},onError:e=>ie({error:e,fallbackTitle:`Couldn't archive run plan`})}),L=z.suites.duplicate.useMutation({onSuccess:e=>{i.suites.getAll.invalidate(),s(e.slug),x.create({title:`Run plan duplicated`,type:`success`,meta:{closable:!0}})},onError:e=>ie({error:e,fallbackTitle:`Couldn't duplicate run plan`})}),{requestRun:R,isPending:ae,pendingBatchRunId:oe,dialogProps:se}=xr({onRunScheduled:()=>{i.suites.getSummaries.invalidate()},onViewRun:e=>{let t=w?.find(t=>t.id===e);t&&s(t.slug)}}),ce=(0,Y.useCallback)(e=>{s(e.slug)},[s]),B=(0,Y.useCallback)(e=>{s(e.slug),R(e)},[s,R]),V=(0,Y.useCallback)(()=>{n(`suiteEditor`,{onSaved:ce,onRunRequested:B}),t(`suiteEditor`)},[t,n,ce,B]),le=(0,Y.useCallback)(e=>{n(`suiteEditor`,{onSaved:ce,onRunRequested:B}),t(`suiteEditor`,{urlParams:{suiteId:e}})},[t,n,ce,B]),ue=(0,Y.useCallback)(e=>{let t=w?.find(t=>t.id===e);t&&R(t)},[w,R]),de=(0,Y.useCallback)(t=>{e&&L.mutate({projectId:e.id,id:t})},[e,L]),H=(0,Y.useCallback)(t=>{e&&C(t)},[e]),U=(0,Y.useCallback)(()=>{!e||!S||I.mutate({projectId:e.id,id:S})},[e,S,I]),fe=(0,Y.useCallback)((e,t)=>{e.preventDefault(),b({x:e.clientX,y:e.clientY,suiteId:t})},[]);return(0,X.jsx)(kr,{children:(0,X.jsxs)(O,{children:[(0,X.jsxs)(l,{width:`full`,height:`full`,gap:0,children:[(0,X.jsx)(D.Header,{withBorder:!1,children:(0,X.jsxs)(a,{justify:`space-between`,align:`center`,w:`full`,children:[(0,X.jsx)(D.Heading,{children:`Simulations`}),(0,X.jsxs)(a,{children:[(0,X.jsx)(_,{period:p,mode:m,setPeriod:h,setRelativePeriod:v}),(0,X.jsxs)(D.HeaderButton,{onClick:V,children:[(0,X.jsx)(Te,{size:16}),` New Run Plan`]})]})]})}),(0,X.jsxs)(a,{flex:1,width:`full`,gap:0,overflow:`hidden`,minHeight:0,children:[(0,X.jsx)(hr,{projectSlug:e?.slug??``,suites:w??[],selectedSuiteSlug:o,runSummaries:ne,externalSets:k??[],onSelectSuite:s,onRunSuite:ue,onContextMenu:fe,onNewSuite:V,isLoading:T||A}),(0,X.jsx)(r,{flex:1,height:`full`,minWidth:0,paddingBottom:3,paddingRight:4,children:(0,X.jsx)(r,{height:`full`,width:`full`,borderRadius:`lg`,boxShadow:`0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1), 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)`,border:`1px solid`,borderColor:`border.muted`,background:`bg.panel`,overflow:`auto`,children:(0,X.jsx)(jr,{error:E??null,selectedSuiteSlug:o,selectedSuite:re,selectedExternalSetId:P,isLoading:T,onNewSuite:V,onEditSuite:le,onRunSuite:ue,isRunning:ae,pendingBatchRunId:oe??d,period:p,suiteNameMap:N,highlightBatchId:c,connectedToLocalRun:!!ee.tabKey})})})]})]}),y&&(0,X.jsx)(Hn,{x:y.x,y:y.y,onEdit:()=>le(y.suiteId),onDuplicate:()=>de(y.suiteId),onArchive:()=>H(y.suiteId),onClose:()=>b(null)}),(0,X.jsx)(Vn,{open:!!S,onClose:()=>C(null),onConfirm:U,suiteName:F?.name??``,isLoading:I.isPending}),(0,X.jsx)(Jn,{...se})]})})}function jr({error:e,selectedSuiteSlug:t,selectedSuite:n,selectedExternalSetId:i,isLoading:a,onNewSuite:o,onEditSuite:s,onRunSuite:c,isRunning:l,pendingBatchRunId:u,period:d,suiteNameMap:f,highlightBatchId:p,connectedToLocalRun:m}){return e?(0,X.jsx)(M,{paddingY:12,children:(0,X.jsx)(N,{children:(0,X.jsx)(r,{maxWidth:`420px`,width:`100%`,children:(0,X.jsx)(re,{error:e,fallbackTitle:`Couldn't load simulations`})})})}):t===null?null:i?(0,X.jsx)(Pn,{scenarioSetId:i,period:d,highlightBatchId:p,connectedToLocalRun:m}):t===`all-runs`?(0,X.jsx)(Bn,{period:d,suiteNameMap:f,pendingBatchRunId:u,highlightBatchId:p}):n?(0,X.jsx)(Wn,{suite:n,onEdit:()=>s(n.id),onRun:()=>c(n.id),isRunning:l,pendingBatchRunId:u,period:d,highlightBatchId:p}):a?null:(0,X.jsx)(qn,{onNewSuite:o})}function Mr(){let e=he(),t=Array.isArray(e.query.path)?e.query.path:[],n=e.query.project,r=e.isReady&&n?er({projectSlug:n,segments:t,query:e.query}):null;return(0,Y.useEffect)(()=>{r&&e.replace(r)},[r]),r?null:(0,X.jsx)(Ar,{})}var Nr=Fe(`scenarios:view`,{layoutComponent:O})(Mr);export{Nr as default};
|
|
22
|
-
//# sourceMappingURL=__...path__-CwRP2Csi.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t,r as n,s as r}from"./fetchSSE-5rVPow_l.js";import{O as i,S as a,_ as o,a as s,f as c,h as l,i as u,l as ee,m as d,n as f,o as p,s as m,t as h,u as g,v as _,w as v,x as y,y as te}from"./_Uint8Array-DZ50H-2q.js";import{t as ne}from"./_arrayEach-D_HpLtqV.js";import{t as b}from"./_baseAssignValue-BqKt0w0a.js";var x=Object.create,S=function(){function e(){}return function(t){if(!n(t))return{};if(x)return x(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function C(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var re=Object.prototype.hasOwnProperty;function w(e,t,n){var r=e[t];(!(re.call(e,t)&&v(r,n))||n===void 0&&!(t in e))&&b(e,t,n)}function T(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?b(n,s,c):w(n,s,c)}return n}function ie(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ae=Object.prototype.hasOwnProperty;function E(e){if(!n(e))return ie(e);var t=y(e),r=[];for(var i in e)i==`constructor`&&(t||!ae.call(e,i))||r.push(i);return r}function D(e){return a(e)?l(e,!0):E(e)}var O=d(Object.getPrototypeOf,Object);function oe(e,t){return e&&T(t,c(t),e)}function se(e,t){return e&&T(t,D(t),e)}var k=typeof exports==`object`&&exports&&!exports.nodeType&&exports,A=k&&typeof module==`object`&&module&&!module.nodeType&&module,j=A&&A.exports===k?r.Buffer:void 0,M=j?j.allocUnsafe:void 0;function N(e,t){if(t)return e.slice();var n=e.length,r=M?M(n):new e.constructor(n);return e.copy(r),r}function ce(e,t){return T(e,p(e),t)}var P=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)g(t,p(e)),e=O(e);return t}:m;function le(e,t){return T(e,P(e),t)}function ue(e){return s(e,D,P)}var F=Object.prototype.hasOwnProperty;function I(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&F.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function L(e){var t=new e.constructor(e.byteLength);return new h(t).set(new h(e)),t}function R(e,t){var n=t?L(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var z=/\w*$/;function B(e){var t=new e.constructor(e.source,z.exec(e));return t.lastIndex=e.lastIndex,t}var V=t?t.prototype:void 0,H=V?V.valueOf:void 0;function U(e){return H?Object(H.call(e)):{}}function W(e,t){var n=t?L(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var de=`[object Boolean]`,fe=`[object Date]`,pe=`[object Map]`,me=`[object Number]`,he=`[object RegExp]`,ge=`[object Set]`,_e=`[object String]`,ve=`[object Symbol]`,ye=`[object ArrayBuffer]`,be=`[object DataView]`,xe=`[object Float32Array]`,Se=`[object Float64Array]`,Ce=`[object Int8Array]`,we=`[object Int16Array]`,Te=`[object Int32Array]`,Ee=`[object Uint8Array]`,De=`[object Uint8ClampedArray]`,Oe=`[object Uint16Array]`,ke=`[object Uint32Array]`;function Ae(e,t,n){var r=e.constructor;switch(t){case ye:return L(e);case de:case fe:return new r(+e);case be:return R(e,n);case xe:case Se:case Ce:case we:case Te:case Ee:case De:case Oe:case ke:return W(e,n);case pe:return new r;case me:case _e:return new r(e);case he:return B(e);case ge:return new r;case ve:return U(e)}}function G(e){return typeof e.constructor==`function`&&!y(e)?S(O(e)):{}}var je=`[object Map]`;function Me(t){return e(t)&&f(t)==je}var K=o&&o.isMap,Ne=K?_(K):Me,Pe=`[object Set]`;function Fe(t){return e(t)&&f(t)==Pe}var q=o&&o.isSet,Ie=q?_(q):Fe,Le=1,Re=2,ze=4,J=`[object Arguments]`,Be=`[object Array]`,Ve=`[object Boolean]`,He=`[object Date]`,Ue=`[object Error]`,Y=`[object Function]`,We=`[object GeneratorFunction]`,Ge=`[object Map]`,Ke=`[object Number]`,X=`[object Object]`,qe=`[object RegExp]`,Je=`[object Set]`,Ye=`[object String]`,Xe=`[object Symbol]`,Z=`[object WeakMap]`,Ze=`[object ArrayBuffer]`,Qe=`[object DataView]`,$e=`[object Float32Array]`,et=`[object Float64Array]`,tt=`[object Int8Array]`,nt=`[object Int16Array]`,rt=`[object Int32Array]`,it=`[object Uint8Array]`,at=`[object Uint8ClampedArray]`,ot=`[object Uint16Array]`,st=`[object Uint32Array]`,Q={};Q[J]=Q[Be]=Q[Ze]=Q[Qe]=Q[Ve]=Q[He]=Q[$e]=Q[et]=Q[tt]=Q[nt]=Q[rt]=Q[Ge]=Q[Ke]=Q[X]=Q[qe]=Q[Je]=Q[Ye]=Q[Xe]=Q[it]=Q[at]=Q[ot]=Q[st]=!0,Q[Ue]=Q[Y]=Q[Z]=!1;function $(e,t,r,a,o,s){var l,d=t&Le,p=t&Re,m=t&ze;if(r&&(l=o?r(e,a,o,s):r(e)),l!==void 0)return l;if(!n(e))return e;var h=i(e);if(h){if(l=I(e),!d)return C(e,l)}else{var g=f(e),_=g==Y||g==We;if(te(e))return N(e,d);if(g==X||g==J||_&&!o){if(l=p||_?{}:G(e),!d)return p?le(e,se(l,e)):ce(e,oe(l,e))}else{if(!Q[g])return o?e:{};l=Ae(e,g,d)}}s||=new ee;var v=s.get(e);if(v)return v;s.set(e,l),Ie(e)?e.forEach(function(n){l.add($(n,t,r,n,e,s))}):Ne(e)&&e.forEach(function(n,i){l.set(i,$(n,t,r,i,e,s))});var y=h?void 0:(m?p?ue:u:p?D:c)(e);return ne(y||e,function(n,i){y&&(i=n,n=e[i]),w(l,i,$(n,t,r,i,e,s))}),l}export{O as a,w as c,N as i,C as l,G as n,D as o,W as r,T as s,$ as t};
|
|
2
|
-
//# sourceMappingURL=_baseClone-DCKy3Vq2.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e,r as t}from"./fetchSSE-5rVPow_l.js";import{t as n}from"./isSymbol-COuSxi_J.js";import{C as r,O as i,S as a,T as o,b as s,d as c,f as l,l as u}from"./_Uint8Array-DZ50H-2q.js";import{n as d,o as f,t as p}from"./_baseFor-BQgMStOx.js";function m(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var h=1/0,g=e?e.prototype:void 0,_=g?g.toString:void 0;function v(e){if(typeof e==`string`)return e;if(i(e))return m(e,v)+``;if(n(e))return _?_.call(e):``;var t=e+``;return t==`0`&&1/e==-h?`-0`:t}var y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/;function x(e,t){if(i(e))return!1;var r=typeof e;return r==`number`||r==`symbol`||r==`boolean`||e==null||n(e)?!0:b.test(e)||!y.test(e)||t!=null&&e in Object(t)}var S=`Expected a function`;function C(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(S);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(C.Cache||c),n}C.Cache=c;var w=500;function T(e){var t=C(e,function(e){return n.size===w&&n.clear(),e}),n=t.cache;return t}var E=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,D=/\\(\\)?/g,O=T(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(E,function(e,n,r,i){t.push(r?i.replace(D,`$1`):n||e)}),t});function k(e){return e==null?``:v(e)}function A(e,t){return i(e)?e:x(e,t)?[e]:O(k(e))}var j=1/0;function M(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-j?`-0`:t}function N(e,t){t=A(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[M(t[n++])];return n&&n==r?e:void 0}function P(e,t,n){var r=e==null?void 0:N(e,t);return r===void 0?n:r}var F=1,I=2;function L(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],f=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var p=new u;if(r)var m=r(l,f,c,e,t,p);if(!(m===void 0?d(f,l,F|I,r,p):m))return!1}}return!0}function R(e){return e===e&&!t(e)}function z(e){for(var t=l(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,R(i)]}return t}function B(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function V(e){var t=z(e);return t.length==1&&t[0][2]?B(t[0][0],t[0][1]):function(n){return n===e||L(n,e,t)}}function H(e,t){return e!=null&&t in Object(e)}function U(e,t,n){t=A(t,e);for(var a=-1,c=t.length,l=!1;++a<c;){var u=M(t[a]);if(!(l=e!=null&&n(e,u)))break;e=e[u]}return l||++a!=c?l:(c=e==null?0:e.length,!!c&&r(c)&&o(u,c)&&(i(e)||s(e)))}function W(e,t){return e!=null&&U(e,t,H)}var G=1,K=2;function q(e,t){return x(e)&&R(t)?B(M(e),t):function(n){var r=P(n,e);return r===void 0&&r===t?W(n,e):d(t,r,G|K)}}function J(e){return function(t){return t?.[e]}}function Y(e){return function(t){return N(t,e)}}function X(e){return x(e)?J(M(e)):Y(e)}function Z(e){return typeof e==`function`?e:e==null?f:typeof e==`object`?i(e)?q(e[0],e[1]):V(e):X(e)}function Q(e,t){return e&&p(e,t,l)}function $(e,t){return function(n,r){if(n==null)return n;if(!a(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var ee=$(Q);export{W as a,M as c,m as d,J as i,A as l,Q as n,U as o,Z as r,N as s,ee as t,k as u};
|
|
2
|
-
//# sourceMappingURL=_baseEach-BGeacxUS.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t}from"./fetchSSE-5rVPow_l.js";import{O as n,d as r,g as i,i as a,l as o,n as s,t as c,w as l,y as u}from"./_Uint8Array-DZ50H-2q.js";function d(e){return e}var f=`__lodash_hash_undefined__`;function p(e){return this.__data__.set(e,f),this}function m(e){return this.__data__.has(e)}function h(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}h.prototype.add=h.prototype.push=p,h.prototype.has=m;function g(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function _(e,t){return e.has(t)}var v=1,y=2;function b(e,t,n,r,i,a){var o=n&v,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&y?new h:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],b=t[d];if(r)var x=o?r(b,m,d,t,e,a):r(m,b,d,e,t,a);if(x!==void 0){if(x)continue;f=!1;break}if(p){if(!g(t,function(e,t){if(!_(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===b||i(m,b,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function x(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function S(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var C=1,w=2,T=`[object Boolean]`,E=`[object Date]`,D=`[object Error]`,O=`[object Map]`,k=`[object Number]`,A=`[object RegExp]`,j=`[object Set]`,M=`[object String]`,N=`[object Symbol]`,P=`[object ArrayBuffer]`,F=`[object DataView]`,I=t?t.prototype:void 0,L=I?I.valueOf:void 0;function R(e,t,n,r,i,a,o){switch(n){case F:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!a(new c(e),new c(t)));case T:case E:case k:return l(+e,+t);case D:return e.name==t.name&&e.message==t.message;case A:case M:return e==t+``;case O:var s=x;case j:var u=r&C;if(s||=S,e.size!=t.size&&!u)return!1;var d=o.get(e);if(d)return d==t;r|=w,o.set(e,t);var f=b(s(e),s(t),r,i,a,o);return o.delete(e),f;case N:if(L)return L.call(e)==L.call(t)}return!1}var z=1,B=Object.prototype.hasOwnProperty;function V(e,t,n,r,i,o){var s=n&z,c=a(e),l=c.length;if(l!=a(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:B.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var h=s;++u<l;){d=c[u];var g=e[d],_=t[d];if(r)var v=s?r(_,g,d,t,e,o):r(g,_,d,e,t,o);if(!(v===void 0?g===_||i(g,_,n,r,o):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y!=b&&`constructor`in e&&`constructor`in t&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return o.delete(e),o.delete(t),m}var H=1,U=`[object Arguments]`,W=`[object Array]`,G=`[object Object]`,K=Object.prototype.hasOwnProperty;function q(e,t,r,a,c,l){var d=n(e),f=n(t),p=d?W:s(e),m=f?W:s(t);p=p==U?G:p,m=m==U?G:m;var h=p==G,g=m==G,_=p==m;if(_&&u(e)){if(!u(t))return!1;d=!0,h=!1}if(_&&!h)return l||=new o,d||i(e)?b(e,t,r,a,c,l):R(e,t,p,r,a,c,l);if(!(r&H)){var v=h&&K.call(e,`__wrapped__`),y=g&&K.call(t,`__wrapped__`);if(v||y){var x=v?e.value():e,S=y?t.value():t;return l||=new o,c(x,S,r,a,l)}}return _?(l||=new o,V(e,t,r,a,c,l)):!1}function J(t,n,r,i,a){return t===n?!0:t==null||n==null||!e(t)&&!e(n)?t!==t&&n!==n:q(t,n,r,i,J,a)}function Y(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var X=Y();export{h as a,_ as i,J as n,d as o,S as r,X as t};
|
|
2
|
-
//# sourceMappingURL=_baseFor-BQgMStOx.js.map
|