@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,n as r}from"./portal-Sdfvrza9.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{t as a}from"./skeleton-0JSrjbwm.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{s as c}from"./shikiAdapter-Ctbe7cQu.js";import{An as l}from"./ProjectAvatar-B0tbfKzY.js";import{a as u,n as d,o as f}from"./toaster-BsYkODqs.js";import{I as p}from"./Markdown-Cip8Rj5C.js";import{t as m}from"./grid-MxZhegzw.js";import{L as h,t as g}from"./DashboardLayout-Cn5-9Ye2.js";import{r as _,t as v}from"./card-By_Mbslh.js";import{a as y,i as b,n as x,r as S,t as C}from"./empty-state-T8EYr5NF.js";import{t as w}from"./errors-mlatPkMI.js";import{t as T}from"./spacer-C38e7o6r.js";import{k as E}from"./immer-DImI3Uq2.js";import{n as D}from"./api-l6Cnm0vQ.js";import{f as O}from"./trpcError-CFsR-0nB.js";import{t as k}from"./arrow-up-BNJSVMQt.js";import{t as A}from"./code-MiD0yvEx.js";import{t as j}from"./globe-Bc_PfXMH.js";import{t as M}from"./refresh-cw-CjWtrqB1.js";import{r as N}from"./next-router-CWLrMXvP.js";import{qt as P,xn as F,z as I}from"./lu-BSZWBZXU.js";import{D as ee,Hn as L,Pr as R,Qn as z,Vt as B,W as te,yr as V}from"./index-8SbDirJv.js";import{t as H}from"./WithPermissionGuard-Da_hdEdq.js";import{t as U}from"./CascadeArchiveDialog-BPqLe1Ai.js";import{n as W,t as G}from"./useProjectsForCopy-C63wLMNr.js";import{t as K}from"./PushToCopiesDialog-Ry_M3FuH.js";import{t as q}from"./LangyContextTarget-Dxr919ue.js";var J=e(t()),Y=i(),X={signature:c,code:A,http:j,workflow:L},Z={signature:`Prompt`,code:`Code`,http:`HTTP`,workflow:`Workflow`};function ne({agent:e,onClick:t,onEdit:i,onDelete:a,onOpenWorkflow:c,onReplicate:d,onPushToCopies:m,onSyncFromSource:h,onViewHistory:g}){let y=X[e.type]??V,b=Z[e.type]??e.type,x=!!e.copiedFromAgentId,S=(e._count?.copiedAgents??0)>0;return(0,Y.jsx)(q,{target:E({agentId:e.id,name:e.name}),children:(0,Y.jsx)(_,{variant:`elevated`,onClick:e=>{e.target.closest(`.js-inner-menu`)||t?.()},cursor:`pointer`,height:`142px`,transition:`all 0.2s ease-in-out`,"data-testid":`agent-card-${e.id}`,children:(0,Y.jsx)(v,{padding:4,children:(0,Y.jsxs)(s,{align:`start`,gap:2,height:`full`,children:[(0,Y.jsxs)(r,{width:`full`,children:[(0,Y.jsx)(n,{bg:`blue.subtle`,padding:1,borderRadius:`md`,children:(0,Y.jsx)(y,{size:18,color:`var(--chakra-colors-blue-fg)`})}),(0,Y.jsx)(T,{}),(i||a)&&(0,Y.jsxs)(p.Root,{children:[(0,Y.jsx)(p.Trigger,{className:`js-inner-menu`,onClick:e=>e.stopPropagation(),children:(0,Y.jsx)(l,{size:16})}),(0,Y.jsxs)(p.Content,{className:`js-inner-menu`,portalled:!1,children:[i&&(0,Y.jsxs)(p.Item,{value:`edit`,onClick:e=>{e.stopPropagation(),i()},children:[(0,Y.jsx)(P,{size:14}),`Edit`]}),e.type===`workflow`&&c&&(0,Y.jsxs)(p.Item,{value:`open-workflow`,onClick:e=>{e.stopPropagation(),c()},"data-testid":`agent-open-workflow-${e.id}`,children:[(0,Y.jsx)(u,{size:14}),`Open Workflow`]}),x&&h&&(0,Y.jsxs)(p.Item,{value:`sync`,onClick:e=>{e.stopPropagation(),h()},children:[(0,Y.jsx)(M,{size:14}),` Update from source`]}),S&&m&&(0,Y.jsxs)(p.Item,{value:`push`,onClick:e=>{e.stopPropagation(),m()},children:[(0,Y.jsx)(k,{size:14}),` Push to replicas`]}),d&&(0,Y.jsxs)(p.Item,{value:`replicate`,onClick:e=>{e.stopPropagation(),d()},children:[(0,Y.jsx)(f,{size:14}),` Replicate to another project`]}),g&&(0,Y.jsxs)(p.Item,{value:`view-history`,onClick:e=>{e.stopPropagation(),g()},children:[(0,Y.jsx)(I,{size:14}),`View history`]}),a&&(0,Y.jsxs)(p.Item,{value:`delete`,color:`red.500`,onClick:e=>{e.stopPropagation(),a()},children:[(0,Y.jsx)(F,{size:14}),`Delete`]})]})]})]}),(0,Y.jsx)(T,{}),(0,Y.jsx)(o,{color:`fg.muted`,fontSize:`sm`,fontWeight:500,children:e.name}),(0,Y.jsxs)(o,{color:`fg.subtle`,fontSize:`12px`,children:[b,` • `,ee(new Date(e.updatedAt).getTime())]})]})})})})}var Q=O(`CopyAgentDialog`),re=({open:e,onClose:t,onSuccess:n,agentId:r,agentName:i})=>{let{project:a}=B(),o=D.agents.copy.useMutation(),s=G(`evaluations:manage`);return a?(0,Y.jsx)(W,{open:e,onClose:t,onSuccess:n,title:`Replicate Agent`,entityLabel:`Agent`,sourceName:i,sourceId:r,sourceProjectId:a.id,projects:s,onCopy:async({projectId:e,sourceProjectId:t})=>{await o.mutateAsync({agentId:r,projectId:e,sourceProjectId:t})},isLoading:o.isLoading,logError:Q.error.bind(Q)}):null};function $(e){switch(e){case`code`:return`agentCodeEditor`;case`http`:return`agentHttpEditor`;case`workflow`:return`agentWorkflowEditor`;case`signature`:throw Error(`Unhandled agent type: ${e} — signature agents have no editor drawer`);default:throw Error(`Unhandled agent type: ${e}`)}}function ie(){let e=D.useContext();return D.agents.pushToCopies.useMutation({onSuccess:(t,n)=>{e.agents.getAll.invalidate({projectId:n.projectId})}})}var ae=({open:e,onClose:t,agentId:n,agentName:r})=>{let{project:i}=B(),a=ie(),[o,s]=(0,J.useState)(new Set),{data:c,isLoading:l,error:u}=D.agents.getCopies.useQuery({projectId:i?.id??``,agentId:n},{enabled:e&&!!i?.id&&!!n}),[d,f]=(0,J.useState)([]);return(0,J.useEffect)(()=>{c&&(f(c),s(new Set(c.map(e=>e.id))))},[c]),(0,Y.jsx)(K,{open:e,onClose:t,entityLabel:`Agent`,sourceName:r,copies:d,isLoading:l,error:u,selectedCopyIds:o,onToggleCopy:e=>{let t=new Set(o);t.has(e)?t.delete(e):t.add(e),s(t)},onPush:async()=>a.mutateAsync({agentId:n,projectId:i.id,copyIds:Array.from(o)}),pushLoading:a.isLoading,onSuccess:()=>s(new Set)})};function oe(){let{project:e}=B(),{openDrawer:t}=te(),n=D.useContext(),r=N(),[i,o]=(0,J.useState)(null),[c,l]=(0,J.useState)(null),[u,f]=(0,J.useState)(null),p=D.agents.syncFromSource.useMutation({onSuccess:(e,t)=>{n.agents.getAll.invalidate({projectId:t.projectId}),d.create({title:`Agent updated`,description:`Agent has been updated from source.`,type:`success`,meta:{closable:!0}})},onError:e=>w({error:e,fallbackTitle:`Couldn't update agent from source`})}),_=(0,J.useCallback)(t=>{e?.id&&p.mutate({projectId:e.id,agentId:t})},[e?.id,p]),v=D.agents.getAll.useQuery({projectId:e?.id??``},{enabled:!!e}),E=D.agents.getRelatedEntities.useQuery({id:i?.id??``,projectId:e?.id??``},{enabled:!!i&&!!e?.id}),O=D.agents.delete.useMutation({onSuccess:()=>{n.agents.getAll.invalidate({projectId:e?.id??``}),n.licenseEnforcement.checkLimit.invalidate()}}),k=D.agents.cascadeArchive.useMutation({onSuccess:t=>{o(null),n.agents.getAll.invalidate({projectId:e?.id??``}),n.licenseEnforcement.checkLimit.invalidate(),d.create({title:`Agent deleted`,description:t.archivedWorkflow?`Also deleted: 1 workflow`:void 0,type:`success`,meta:{closable:!0}})},onError:e=>w({error:e,fallbackTitle:`Couldn't delete agent`})}),A=e=>{t($(e.type),{urlParams:{agentId:e.id}})},j=e=>{o(e)},M=()=>{!i||!e||(E.data?.workflow?k.mutate({id:i.id,projectId:e.id}):O.mutate({id:i.id,projectId:e.id},{onSuccess:()=>{o(null),d.create({title:`Agent deleted`,type:`success`,meta:{closable:!0}})},onError:e=>w({error:e,fallbackTitle:`Couldn't delete agent`})}))},P=t=>{t.workflowId&&e?.slug&&r.push(`/${e.slug}/studio/${t.workflowId}`)},F=v.data&&v.data.length>0,I=!v.isLoading&&!F;return(0,Y.jsxs)(g,{children:[(0,Y.jsxs)(h.Header,{children:[(0,Y.jsx)(h.Heading,{children:`Agents`}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(h.HeaderButton,{onClick:()=>t(`agentTypeSelector`),children:[(0,Y.jsx)(z,{size:16}),` New Agent`]})]}),I?(0,Y.jsx)(R,{flex:1,padding:6,children:(0,Y.jsx)(b,{children:(0,Y.jsxs)(C,{children:[(0,Y.jsx)(S,{children:(0,Y.jsx)(V,{size:32})}),(0,Y.jsx)(y,{children:`No agents yet`}),(0,Y.jsx)(x,{children:`Create reusable agents for your evaluations.`}),(0,Y.jsxs)(h.HeaderButton,{onClick:()=>t(`agentTypeSelector`),children:[(0,Y.jsx)(z,{size:16}),` Create your first agent`]})]})})}):(0,Y.jsx)(s,{gap:6,width:`full`,align:`start`,padding:6,children:(0,Y.jsxs)(m,{templateColumns:`repeat(auto-fill, minmax(300px, 1fr))`,gap:4,width:`full`,children:[v.isLoading&&Array.from({length:3}).map((e,t)=>(0,Y.jsx)(a,{height:`100px`,borderRadius:`md`},t)),v.data?.map(e=>(0,Y.jsx)(ne,{agent:e,onClick:()=>A(e),onEdit:()=>A(e),onDelete:()=>j(e),onOpenWorkflow:e.type===`workflow`?()=>P(e):void 0,onReplicate:()=>l({id:e.id,name:e.name}),onPushToCopies:()=>f({id:e.id,name:e.name}),onSyncFromSource:()=>_(e.id),onViewHistory:()=>t(`agentHistory`,{urlParams:{agentId:e.id,agentName:e.name}})},e.id))]})}),(0,Y.jsx)(U,{open:!!i,onClose:()=>o(null),onConfirm:M,isLoading:k.isPending||O.isPending,isLoadingRelated:E.isLoading,entityType:`agent`,entityName:i?.name??``,relatedEntities:{workflows:E.data?.workflow?[E.data.workflow]:[]}}),(0,Y.jsx)(re,{open:!!c,onClose:()=>l(null),onSuccess:()=>void n.agents.getAll.invalidate({projectId:e?.id??``}),agentId:c?.id??``,agentName:c?.name??``}),(0,Y.jsx)(ae,{open:!!u,onClose:()=>f(null),agentId:u?.id??``,agentName:u?.name??``})]})}var se=H(`evaluations:view`,{layoutComponent:g})(oe);export{se as default};
|
|
2
|
+
//# sourceMappingURL=agents-CZnWSlhu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./automations-BhzNESFp.js";export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{i as t,n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{t as i}from"./heading-C0sACr0w.js";import{a,c as o,nn as s,s as c}from"./ProjectAvatar-B0tbfKzY.js";import{t as l}from"./container-Cxi_AjD-.js";import{t as u}from"./spacer-C38e7o6r.js";import{n as d}from"./api-l6Cnm0vQ.js";import{r as f}from"./next-router-CWLrMXvP.js";import{Vt as p}from"./index-8SbDirJv.js";import{t as m}from"./download-CuvC-TAo.js";import{n as h}from"./useAnnotationQueues-BMo2kZ_n.js";import{t as g}from"./papaparse.min-cQwnxGCG.js";import{t as _}from"./AnnotationsTable-C9n949u_.js";import{t as v}from"./getSingleQueryParam-DMm5MD-J.js";var y=e(g()),b=r();function x(){let{project:e}=p(),r=f(),{filterParams:g,queryOpts:x,nonEmptyFilters:S}=a(),C=Object.keys(S).length>0,w=d.traces.getAllForProject.useQuery({...g,query:v(r.query.query),groupBy:`none`,pageOffset:0,pageSize:1e4,sortBy:v(r.query.sortBy),sortDirection:v(r.query.orderBy)},x),{period:{startDate:T,endDate:E},mode:D,setPeriod:O,setRelativePeriod:k}=o(),A=w.data?.groups.flatMap(e=>e.map(e=>e.trace_id))??[],j=s({projectId:e?.id??``,traceIds:A,enabled:C&&e?.id!==void 0}),M=d.annotation.getAll.useQuery({projectId:e?.id??``,startDate:T,endDate:E},{enabled:!C&&!!e}),N=C?j:M,P=C?w.isLoading||j.isLoading:M.isLoading,F=N.data?.map(e=>e.traceId),I=d.traces.getTracesWithSpans.useQuery({projectId:e?.id??``,traceIds:F??[]},{enabled:!!e?.id,refetchOnWindowFocus:!1}),L=(e=>{let t=e.reduce((e,t)=>{e[t.traceId]||(e[t.traceId]={traceId:t.traceId,annotations:[],trace:I.data?.find(e=>e.trace_id===t.traceId)});let n={...t,user:t.user},r=e[t.traceId];return r&&r.annotations.push(n),e},{});return Object.values(t)})(N.data??[]),R=()=>{let e=[`User`,`Input`,`Output`,`Expected Output`,`Comment`,`Trace ID`,`Rating`,`Scoring`,`Created At`],t=N?.data?.map(e=>{let t=I.data?.find(t=>t.trace_id===e.traceId);return[e.user?.name??``,t?.input?.value??``,t?.output?.value??``,e.expectedOutput??``,e.comment??``,e.traceId??``,e.isThumbsUp?`Thumbs Up`:`Thumbs Down`,JSON.stringify(e.scoreOptions??{}),e.createdAt?.toLocaleString()??``]})??[],n=y.default.unparse({fields:e,data:t}),r=window.URL.createObjectURL(new Blob([n])),i=document.createElement(`a`);i.href=r;let a=`Traces - ${new Date().toISOString().split(`T`)[0]}.csv`;i.setAttribute(`download`,a),document.body.appendChild(i),i.click(),i.remove()},z=(0,b.jsxs)(n,{width:`full`,align:`top`,children:[(0,b.jsx)(i,{as:`h1`,size:`lg`,paddingTop:1,children:`All Annotations`}),(0,b.jsx)(u,{}),(0,b.jsxs)(t,{minWidth:`fit-content`,variant:`ghost`,onClick:()=>R(),children:[`Export all `,(0,b.jsx)(m,{style:{marginLeft:`8px`}})]}),(0,b.jsx)(c,{period:{startDate:T,endDate:E},mode:D,setPeriod:O,setRelativePeriod:k})]});return(0,b.jsx)(h,{children:(0,b.jsx)(l,{maxW:`calc(100vw - 330px)`,padding:0,margin:0,children:(0,b.jsx)(_,{groupedAnnotations:L,allAnnotationsLoading:P||I.isLoading,heading:`Annotations`,isDone:!0,tableHeader:z,noDataTitle:`No recent annotations yet, change the date range to see more or annotate your messages`,noDataDescription:`Annotate your messages to add more context and improve your analysis.`})})})}export{x as default};
|
|
2
|
+
//# sourceMappingURL=all-in7z_yGY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{dn as e,i as t,n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{t as i}from"./heading-C0sACr0w.js";import{n as a,t as o}from"./v-stack-hkuSkmCA.js";import{a as s}from"./ProjectAvatar-B0tbfKzY.js";import{t as c}from"./tooltip-CM-lMDNU.js";import{$ as l,J as u,Q as d,X as f,Y as p,Z as ee,q as m}from"./Markdown-Cip8Rj5C.js";import{t as h}from"./grid-MxZhegzw.js";import{t as g}from"./DashboardLayout-Cn5-9Ye2.js";import{a as _,i as v,n as y,r as te,t as b}from"./alert-CPsXih3K.js";import{n as x,r as S,t as C}from"./card-By_Mbslh.js";import{t as w}from"./icon-button-Wlb_dGXL.js";import{a as T,i as E,n as D,t as O}from"./empty-state-T8EYr5NF.js";import{T as k}from"./fetchSSE-CnJPAkno.js";import{t as A}from"./grid-item-CKAuKzga.js";import{i as j,n as M,o as N,r as P,t as F}from"./tabs-B6CQXTUQ.js";import{M as I}from"./immer-DImI3Uq2.js";import{n as L}from"./api-l6Cnm0vQ.js";import{Qn as R,Vt as z,t as B}from"./index-8SbDirJv.js";import{t as V}from"./bar-chart-2-CoC_jxW-.js";import{t as H}from"./WithPermissionGuard-Da_hdEdq.js";import{a as U,r as W,t as G}from"./CustomGraph-C6j6slUs.js";import{t as K}from"./LangyContextTarget-Dxr919ue.js";import{n as q,t as J}from"./FilterSidebar-Cgxbpfi7.js";import{t as Y}from"./GraphsLayout-RNsRoPhs.js";var X=r(),Z=()=>{let{filterParams:t,queryOpts:n}=s(),r=L.analytics.topUsedDocuments.useQuery(t,n);return r.isLoading?(0,X.jsx)(e,{children:`Loading...`}):r.error?(0,X.jsx)(e,{children:`An error occurred`}):(0,X.jsxs)(o,{align:`start`,gap:4,children:[(0,X.jsx)(a,{fontSize:``,paddingTop:4,fontWeight:600,children:`Top 10 most used documents`}),(0,X.jsxs)(d,{variant:`line`,padding:0,margin:0,children:[(0,X.jsx)(ee,{children:(0,X.jsxs)(l,{children:[(0,X.jsx)(f,{paddingLeft:0,children:`Document ID`}),(0,X.jsx)(f,{children:`Snippet`}),(0,X.jsx)(f,{children:`Usage Count`})]})}),(0,X.jsxs)(u,{children:[r.data?.topDocuments.length===0&&(0,X.jsx)(l,{children:(0,X.jsx)(p,{colSpan:2,children:`No documents found`})}),r.data?.topDocuments.map(e=>(0,X.jsxs)(l,{children:[(0,X.jsx)(p,{paddingLeft:0,children:(0,X.jsx)(c,{content:e.documentId,children:(0,X.jsx)(a,{lineClamp:1,wordBreak:`break-all`,display:`block`,children:e.documentId})})}),(0,X.jsx)(p,{children:(0,X.jsx)(c,{content:e.content,children:(0,X.jsx)(a,{lineClamp:1,wordBreak:`break-all`,display:`block`,children:e.content?e.content.substring(0,255)+(e.content.length>255?`...`:``):``})})}),(0,X.jsx)(p,{children:e.count})]},e.documentId))]})]})]})},ne=()=>{let{filterParams:e,queryOpts:t}=s(),n=L.analytics.topUsedDocuments.useQuery(e,t).data?.totalUniqueDocuments;return(0,X.jsx)(W,{current:n})},Q=1440,re={graphId:`threadMetrics`,graphType:`summary`,series:[{name:`Threads count`,colorSet:`greenTones`,metric:`metadata.thread_id`,aggregation:`cardinality`},{name:`Avg messages per thread`,colorSet:`orangeTones`,metric:`metadata.trace_id`,aggregation:`cardinality`,pipeline:{field:`thread_id`,aggregation:`avg`}},{name:`Avg thread duration`,colorSet:`purpleTones`,metric:`threads.average_duration_per_thread`,aggregation:`avg`}],includePrevious:!1,timeScale:Q,height:300},ie=(0,X.jsx)(E,{size:`sm`,paddingY:10,children:(0,X.jsx)(O,{children:(0,X.jsxs)(o,{textAlign:`center`,children:[(0,X.jsx)(T,{textStyle:`sm`,children:`No user data yet`}),(0,X.jsxs)(D,{textStyle:`xs`,children:[`Start tracking users to see metrics here.`,` `,(0,X.jsx)(`a`,{href:`https://langwatch.ai/docs/integration/metadata-and-labels`,target:`_blank`,rel:`noopener noreferrer`,style:{textDecoration:`underline`},children:`Learn how to set up`})]})]})})});function ae(){let e={graphId:`messagesCountGraph`,graphType:`line`,series:[{name:`Traces`,metric:`metadata.trace_id`,aggregation:`cardinality`,colorSet:U.metadata.trace_id.colorSet}],groupBy:void 0,includePrevious:!0,timeScale:Q},t={graphId:`threadsCountGraph`,graphType:`line`,series:[{name:`Threads`,metric:`metadata.thread_id`,aggregation:`cardinality`,colorSet:U.metadata.thread_id.colorSet}],groupBy:void 0,includePrevious:!0,timeScale:Q},n={graphId:`usersCountGraph`,graphType:`line`,series:[{name:`Users`,metric:`metadata.user_id`,aggregation:`cardinality`,colorSet:U.metadata.user_id.colorSet,noDataUrl:`https://langwatch.ai/docs/integration/metadata-and-labels`}],groupBy:void 0,includePrevious:!0,timeScale:Q};return(0,X.jsxs)(h,{width:`full`,templateColumns:[`minmax(350px, 1fr)`,`minmax(350px, 1fr)`,`minmax(350px, 1fr)`,`minmax(350px, 2fr) minmax(250px, 1fr)`],gap:6,children:[(0,X.jsx)(A,{children:(0,X.jsx)(S,{border:`1px solid`,borderColor:`border.emphasized`,children:(0,X.jsx)(C,{paddingTop:2,children:(0,X.jsxs)(j,{variant:`plain`,defaultValue:`messages`,lazyMount:!0,unmountOnExit:!0,children:[(0,X.jsxs)(P,{gap:8,children:[(0,X.jsx)(N,{value:`messages`,paddingX:0,paddingBottom:0,height:`fit-content`,children:(0,X.jsx)(G,{input:{...e,graphType:`summary`},titleProps:{textStyle:`sm`,color:`fg`}})}),(0,X.jsx)(N,{value:`threads`,paddingX:0,paddingBottom:0,height:`fit-content`,children:(0,X.jsx)(G,{input:{...t,graphType:`summary`},titleProps:{textStyle:`sm`,color:`fg`}})}),(0,X.jsx)(N,{value:`users`,paddingX:0,paddingBottom:0,height:`fit-content`,children:(0,X.jsx)(G,{input:{...n,graphType:`summary`},titleProps:{textStyle:`sm`,color:`fg`}})}),(0,X.jsx)(M,{mt:`-1.5px`,height:`4px`,bg:`orange.400`,borderRadius:`1px`,bottom:0})]}),(0,X.jsx)(F,{value:`messages`,children:(0,X.jsx)(G,{input:e})}),(0,X.jsx)(F,{value:`threads`,children:(0,X.jsx)(G,{input:t})}),(0,X.jsx)(F,{value:`users`,children:(0,X.jsx)(G,{input:n,emptyState:ie})})]})})})}),(0,X.jsx)(A,{rowSpan:2,children:(0,X.jsxs)(S,{width:`100%`,height:`100%`,children:[(0,X.jsx)(x,{paddingBottom:4,children:(0,X.jsx)(i,{size:`sm`,children:`Top Topics`})}),(0,X.jsx)(C,{overflowY:`auto`,children:(0,X.jsx)(q,{showTitle:!1})})]})}),(0,X.jsx)(A,{children:(0,X.jsxs)(S,{overflow:`auto`,children:[(0,X.jsx)(x,{children:(0,X.jsx)(i,{size:`sm`,children:`Thread Metrics`})}),(0,X.jsx)(C,{children:(0,X.jsx)(G,{input:re})})]})})]})}var oe=()=>{let{hasPermission:e,project:t}=z(),r={graphId:`llmSummary`,graphType:`summary`,series:[{name:`Mean Tokens per Message`,metric:`performance.total_tokens`,aggregation:`avg`,colorSet:U.performance.total_tokens.colorSet},...e(`cost:view`)?[{name:`Mean Cost per Message`,metric:`performance.total_cost`,aggregation:`avg`,colorSet:U.performance.total_cost.colorSet}]:[],{name:`90th Percentile Time to First Token`,metric:`performance.first_token`,aggregation:`p90`,colorSet:U.performance.first_token.colorSet},{name:`90th Percentile Completion Time`,metric:`performance.completion_time`,aggregation:`p90`,colorSet:U.performance.completion_time.colorSet}],groupBy:void 0,includePrevious:!1,timeScale:`full`};return(0,X.jsxs)(S,{children:[(0,X.jsx)(x,{children:(0,X.jsxs)(n,{gap:1,children:[(0,X.jsx)(i,{size:`sm`,children:`Summary`}),t?.slug&&(0,X.jsx)(c,{content:`View LLM Metrics`,children:(0,X.jsx)(B,{href:`/${t.slug}/analytics/metrics`,children:(0,X.jsx)(w,{"aria-label":`View LLM Metrics`,variant:`ghost`,size:`2xs`,color:`fg.subtle`,children:(0,X.jsx)(m,{size:14})})})})]})}),(0,X.jsx)(C,{children:(0,X.jsx)(G,{input:r})})]})},$=1440;function se(){let{hasPermission:e,project:t}=z(),r={graphId:`llmCallsGraph`,graphType:`area`,series:[{name:`LLM Calls`,metric:`metadata.trace_id`,aggregation:`cardinality`,colorSet:`colors`}],groupBy:`metadata.model`,includePrevious:!1,timeScale:$},a={graphId:`totalCostGraph`,graphType:`line`,series:[{name:U.performance.total_cost.label,metric:`performance.total_cost`,aggregation:`sum`,colorSet:U.performance.total_cost.colorSet}],groupBy:void 0,includePrevious:!0,timeScale:$},o={graphId:`totalTokensSummary`,graphType:`summary`,series:[{name:`Tokens`,metric:`performance.total_tokens`,aggregation:`sum`,colorSet:U.performance.total_tokens.colorSet}],groupBy:void 0,includePrevious:!1,timeScale:`full`},s={graphId:`tokensGraph`,graphType:`stacked_bar`,series:[{name:U.performance.prompt_tokens.label,metric:`performance.prompt_tokens`,aggregation:`sum`,colorSet:U.performance.prompt_tokens.colorSet},{name:U.performance.completion_tokens.label,metric:`performance.completion_tokens`,aggregation:`sum`,colorSet:U.performance.completion_tokens.colorSet}],groupBy:void 0,includePrevious:!1,timeScale:$},l={graphId:`evaluationsSummary`,graphType:`summary`,series:[{name:`Evaluation execution count`,metric:`evaluations.evaluation_runs`,aggregation:`cardinality`,key:``,colorSet:`colors`}],groupBy:`evaluations.evaluation_passed`,includePrevious:!1,timeScale:`full`},u={graphId:`overviewErrorTrend`,graphType:`stacked_bar`,series:[{name:`Traces`,metric:`metadata.trace_id`,aggregation:`cardinality`,colorSet:`positiveNegativeNeutral`}],groupBy:`error.has_error`,includePrevious:!1,timeScale:$},d={graphId:`overviewLatencyTrend`,graphType:`line`,series:[{name:U.performance.completion_time.label,metric:`performance.completion_time`,aggregation:`median`,colorSet:U.performance.completion_time.colorSet},{name:U.performance.first_token.label,metric:`performance.first_token`,aggregation:`median`,colorSet:U.performance.first_token.colorSet}],groupBy:void 0,includePrevious:!1,timeScale:$};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(n,{paddingTop:6,paddingBottom:2,children:[(0,X.jsx)(i,{as:`h2`,size:`md`,children:`LLM Metrics`}),(0,X.jsx)(c,{content:`View LLM Metrics dashboard`,children:(0,X.jsx)(B,{href:`/${t?.slug}/analytics/metrics`,children:(0,X.jsx)(w,{"aria-label":`View LLM Metrics`,variant:`ghost`,size:`xs`,color:`fg.subtle`,children:(0,X.jsx)(m,{size:14})})})})]}),(0,X.jsxs)(h,{width:`100%`,templateColumns:`1fr 0.5fr`,gap:6,children:[(0,X.jsx)(A,{colSpan:2,children:(0,X.jsx)(S,{children:(0,X.jsx)(C,{children:(0,X.jsxs)(j,{variant:`plain`,defaultValue:`llmCallsGraph`,lazyMount:!0,unmountOnExit:!0,children:[(0,X.jsxs)(P,{gap:12,children:[(0,X.jsx)(N,{value:`llmCallsGraph`,paddingX:0,paddingBottom:4,children:(0,X.jsx)(G,{input:{...r,graphType:`summary`,groupBy:void 0},titleProps:{textStyle:`sm`,color:`fg`}})}),e(`cost:view`)&&(0,X.jsx)(N,{value:`totalCostGraph`,paddingX:0,paddingBottom:4,children:(0,X.jsx)(G,{input:{...a,graphType:`summary`},titleProps:{textStyle:`sm`,color:`fg`}})}),(0,X.jsx)(N,{value:`tokensGraph`,paddingX:0,paddingBottom:4,children:(0,X.jsx)(G,{input:o,titleProps:{textStyle:`sm`,color:`fg`}})}),(0,X.jsx)(M,{mt:`-1.5px`,height:`4px`,bg:`orange.400`,borderRadius:`1px`,bottom:0})]}),(0,X.jsx)(F,{value:`llmCallsGraph`,children:(0,X.jsx)(G,{input:r})}),e(`cost:view`)&&(0,X.jsx)(F,{value:`totalCostGraph`,children:(0,X.jsx)(G,{input:a})}),(0,X.jsx)(F,{value:`tokensGraph`,children:(0,X.jsx)(G,{input:s})})]})})})}),(0,X.jsx)(A,{children:(0,X.jsx)(oe,{})}),(0,X.jsx)(A,{children:(0,X.jsxs)(S,{height:`full`,children:[(0,X.jsx)(x,{children:(0,X.jsxs)(n,{gap:1,children:[(0,X.jsx)(i,{size:`sm`,children:`Evaluations Summary`}),(0,X.jsx)(c,{content:`View Online Evaluations`,children:(0,X.jsx)(B,{href:`/${t?.slug}/analytics/evaluations`,children:(0,X.jsx)(w,{"aria-label":`View Evaluations`,variant:`ghost`,size:`2xs`,color:`fg.subtle`,children:(0,X.jsx)(m,{size:14})})})})]})}),(0,X.jsx)(C,{children:(0,X.jsx)(G,{input:{...l,graphType:`summary`}})})]})}),(0,X.jsx)(A,{children:(0,X.jsxs)(S,{height:`full`,children:[(0,X.jsx)(x,{children:(0,X.jsx)(i,{size:`sm`,children:`Error Trend`})}),(0,X.jsx)(C,{children:(0,X.jsx)(G,{input:u})})]})}),(0,X.jsx)(A,{children:(0,X.jsxs)(S,{height:`full`,children:[(0,X.jsx)(x,{children:(0,X.jsx)(i,{size:`sm`,children:`Latency Trend`})}),(0,X.jsx)(C,{children:(0,X.jsx)(G,{input:d})})]})})]})]})}function ce(){let{project:e}=z();return(0,X.jsxs)(Y,{title:`Analytics`,children:[e&&!e.firstMessage&&(0,X.jsxs)(v,{status:`warning`,marginBottom:6,children:[(0,X.jsx)(te,{}),(0,X.jsxs)(b,{children:[(0,X.jsx)(_,{children:`No traces received yet`}),(0,X.jsxs)(y,{children:[(0,X.jsx)(a,{as:`span`,children:`Tracing is not integrated yet, so there's no data to display. Go to the `}),(0,X.jsx)(B,{textDecoration:`underline`,href:`/${e.slug}/traces`,children:`setup`}),(0,X.jsx)(a,{as:`span`,children:` page to get started.`})]})]})]}),(0,X.jsxs)(n,{align:`start`,width:`full`,gap:8,children:[(0,X.jsxs)(o,{align:`start`,width:`full`,children:[(0,X.jsx)(ae,{}),(0,X.jsx)(se,{}),(0,X.jsx)(le,{}),e&&(0,X.jsx)(ue,{slug:e.slug})]}),(0,X.jsx)(J,{hideTopics:!0})]})]})}function le(){let{filterParams:t,queryOpts:r}=s(),c=L.analytics.topUsedDocuments.useQuery(t,r).data?.totalUniqueDocuments;return!c||c===0?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(n,{width:`full`,align:`top`,children:(0,X.jsx)(i,{as:`h2`,size:`md`,paddingTop:6,paddingBottom:2,children:`Documents`})}),(0,X.jsx)(S,{width:`full`,children:(0,X.jsx)(C,{children:(0,X.jsxs)(j,{variant:`plain`,defaultValue:`total-documents`,children:[(0,X.jsxs)(P,{gap:12,children:[(0,X.jsx)(N,{value:`total-documents`,paddingX:0,paddingBottom:4,children:(0,X.jsxs)(o,{align:`start`,children:[(0,X.jsx)(a,{color:`fg`,children:`Total documents`}),(0,X.jsx)(e,{textStyle:`2xl`,color:`fg`,fontWeight:`bold`,children:(0,X.jsx)(ne,{})})]})}),(0,X.jsx)(M,{mt:`-1.5px`,height:`4px`,bg:`orange.400`,borderRadius:`1px`,bottom:0})]}),(0,X.jsx)(F,{value:`total-documents`,children:(0,X.jsx)(Z,{})})]})})})]})}function ue({slug:r}){let{project:s}=z(),c=L.dashboards.getAll.useQuery({projectId:s?.id??``},{enabled:!!s?.id}),l=c.data??[];return l.length===0&&!c.isLoading?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(i,{as:`h2`,size:`md`,paddingTop:6,paddingBottom:2,children:`Custom Dashboards`}),(0,X.jsx)(S,{borderStyle:`dashed`,children:(0,X.jsx)(C,{padding:5,children:(0,X.jsxs)(n,{gap:4,children:[(0,X.jsx)(e,{color:`fg.subtle`,children:(0,X.jsx)(V,{size:20})}),(0,X.jsxs)(o,{align:`start`,gap:1,flex:1,children:[(0,X.jsx)(a,{textStyle:`sm`,fontWeight:`500`,children:`Build your own dashboard`}),(0,X.jsx)(a,{textStyle:`xs`,color:`fg.muted`,children:`Drag and drop charts to track the metrics that matter most to your team.`})]}),(0,X.jsx)(B,{href:`/${r}/analytics/reports`,_hover:{textDecoration:`none`},children:(0,X.jsxs)(t,{size:`sm`,variant:`outline`,children:[(0,X.jsx)(R,{size:14}),` Create`]})})]})})})]}):l.length===0?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(i,{as:`h2`,size:`md`,paddingTop:6,paddingBottom:2,children:`Custom Dashboards`}),(0,X.jsx)(h,{width:`full`,gap:3,gridTemplateColumns:`repeat(auto-fill, minmax(250px, 1fr))`,children:l.map(t=>(0,X.jsx)(K,{target:I({dashboardId:t.id,name:t.name}),children:(0,X.jsx)(B,{href:`/${r}/analytics/reports?dashboard=${t.id}`,_hover:{textDecoration:`none`},children:(0,X.jsx)(S,{width:`full`,cursor:`pointer`,borderColor:`border`,_hover:{borderColor:`orange.400`,shadow:`sm`},transition:`all 0.15s ease`,children:(0,X.jsx)(C,{paddingX:4,paddingY:3,children:(0,X.jsxs)(k,{gap:3,alignItems:`center`,children:[(0,X.jsx)(e,{padding:2,borderRadius:`md`,bg:`orange.subtle`,color:`orange.fg`,children:(0,X.jsx)(V,{size:16})}),(0,X.jsxs)(o,{align:`start`,gap:0,flex:1,children:[(0,X.jsx)(a,{fontWeight:`500`,textStyle:`sm`,children:t.name}),(0,X.jsx)(a,{textStyle:`xs`,color:`fg.muted`,children:`Custom Dashboard`})]}),(0,X.jsx)(e,{color:`fg.subtle`,marginLeft:`auto`,children:(0,X.jsx)(m,{size:14})})]})})})})},t.id))})]})}var de=H(`analytics:view`,{layoutComponent:g})(ce);export{de as default};
|
|
2
|
+
//# sourceMappingURL=analytics-C8m2qboV.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./skeleton-0JSrjbwm.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{u}from"./ProjectAvatar-B0tbfKzY.js";import{t as d}from"./badge-Cpc3eA-C.js";import{n as f}from"./toaster-BsYkODqs.js";import{$ as p,I as m,J as h,Q as g,X as _,Y as v,Z as y}from"./Markdown-Cip8Rj5C.js";import{L as b}from"./DashboardLayout-Cn5-9Ye2.js";import{t as x}from"./spacer-C38e7o6r.js";import{n as S}from"./api-l6Cnm0vQ.js";import{o as C}from"./trpcError-CFsR-0nB.js";import{Vt as w,W as T,t as E,zn as D}from"./index-8SbDirJv.js";import{t as O}from"./edit-3WDhqC-Q.js";import{t as k}from"./more-vertical-CnKfgTmQ.js";import{t as A}from"./plus-10dP8Fmk.js";import{t as j}from"./thumbs-up-TCqW37wn.js";import{t as M}from"./trash-BMMK2ibG.js";import{t as N}from"./WithPermissionGuard-Da_hdEdq.js";import{t as P}from"./switch-BZp2DIfW.js";import{t as F}from"./DeleteConfirmationDialog-Br5m12kp.js";import{t as I}from"./SettingsLayout-ZI47ZjuT.js";import{t as L}from"./NoDataInfoBlock-Busjhz63.js";var R=D(),z=e(t()),B=a();function V(){let{project:e}=w(),{isLiteMember:t}=u(),a=!t,{openDrawer:d,drawerOpen:D,closeDrawer:N}=T(),V=S.annotationScore.getAll.useQuery({projectId:e?.id??``},{enabled:!!e}),H=S.annotationScore.toggle.useMutation(),W=D(`addOrEditAnnotationScore`),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)(null),Y=S.annotationScore.delete.useMutation();(0,z.useEffect)(()=>{V.refetch()},[W]);let X=(t,n)=>{H.mutate({scoreId:t,active:n,projectId:e?.id??``},{onSuccess:()=>{V.refetch()},onError:e=>{C(e)||f.create({title:`Update score`,type:`error`,description:`Failed to update score`,duration:6e3,meta:{closable:!0}})}})},Z=e=>{J(e),K(!0)};return(0,B.jsxs)(I,{children:[(0,B.jsxs)(l,{gap:6,width:`full`,align:`start`,children:[(0,B.jsxs)(i,{width:`full`,marginTop:2,children:[(0,B.jsx)(s,{as:`h2`,children:`Annotation Scoring`}),(0,B.jsx)(x,{}),a&&(0,B.jsxs)(b.HeaderButton,{onClick:()=>d(`addOrEditAnnotationScore`),children:[(0,B.jsx)(A,{}),` Add new score metric`]})]}),V.data&&V.data.length==0?(0,B.jsx)(L,{title:`No scoring setup yet`,description:`Add new scoring metrics for your annotations.`,docsInfo:(0,B.jsxs)(c,{children:[`To learn more about scores and how to use them, please visit our`,` `,(0,B.jsx)(E,{color:`orange.400`,href:`https://docs.langwatch.ai/features/annotations#annotation-scoring`,isExternal:!0,children:`documentation`}),`.`]}),icon:(0,B.jsx)(j,{})}):(0,B.jsx)(n,{width:`full`,overflowX:`auto`,children:(0,B.jsxs)(g,{variant:`line`,width:`full`,children:[(0,B.jsx)(y,{children:(0,B.jsxs)(p,{children:[(0,B.jsx)(_,{children:`Name`}),(0,B.jsx)(_,{children:`Description`}),(0,B.jsx)(_,{children:`Score Type`}),(0,B.jsx)(_,{children:`Score Options`}),(0,B.jsx)(_,{children:`Enabled`}),a&&(0,B.jsx)(_,{children:`Actions`})]})}),(0,B.jsx)(h,{children:V.isLoading?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(p,{children:(0,B.jsx)(v,{colSpan:a?6:5,children:(0,B.jsx)(o,{height:`20px`})})}),(0,B.jsx)(p,{children:(0,B.jsx)(v,{colSpan:a?6:5,children:(0,B.jsx)(o,{height:`20px`})})}),(0,B.jsx)(p,{children:(0,B.jsx)(v,{colSpan:a?6:5,children:(0,B.jsx)(o,{height:`20px`})})})]}):V.data?.map(e=>(0,B.jsxs)(p,{children:[(0,B.jsx)(v,{children:e.name}),(0,B.jsx)(v,{children:e.description}),(0,B.jsx)(v,{width:`20%`,children:(0,B.jsx)(c,{lineClamp:1,children:e.dataType===R.AnnotationScoreDataType.CHECKBOX?`Checkbox`:`Multiple choice`})}),(0,B.jsx)(v,{children:(0,B.jsx)(U,{options:Array.isArray(e.options)?e.options:[],dataType:e.dataType??``})}),(0,B.jsx)(v,{textAlign:`center`,children:(0,B.jsx)(P,{checked:e.active,disabled:!a,onCheckedChange:()=>{X(e.id,!e.active)}})}),a&&(0,B.jsx)(v,{children:(0,B.jsxs)(m.Root,{children:[(0,B.jsx)(m.Trigger,{asChild:!0,children:(0,B.jsx)(r,{variant:`ghost`,children:(0,B.jsx)(k,{})})}),(0,B.jsxs)(m.Content,{children:[(0,B.jsx)(m.Item,{value:`edit`,onClick:t=>{t.stopPropagation(),d(`addOrEditAnnotationScore`,{annotationScoreId:e.id,onClose:()=>N()})},children:(0,B.jsxs)(n,{display:`flex`,alignItems:`center`,gap:2,children:[(0,B.jsx)(O,{size:14}),`Edit`]})}),(0,B.jsx)(m.Item,{value:`delete`,onClick:t=>{t.stopPropagation(),Z(e.id)},children:(0,B.jsxs)(n,{display:`flex`,alignItems:`center`,gap:2,color:`red.600`,children:[(0,B.jsx)(M,{size:14}),`Delete`]})})]})]})})]},e.id))})]})})]}),(0,B.jsx)(F,{open:G,onClose:()=>K(!1),onConfirm:()=>{q&&Y.mutate({scoreId:q,projectId:e?.id??``},{onSuccess:()=>{V.refetch(),f.create({title:`Delete score`,type:`success`,description:`Score deleted successfully`,duration:6e3,meta:{closable:!0}})},onError:e=>{C(e)||f.create({title:`Delete score`,type:`error`,description:`Failed to delete score`,duration:6e3,meta:{closable:!0}})}}),K(!1)}})]})}var H=N(`annotations:view`,{layoutComponent:I})(V),U=({options:e,dataType:t})=>(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(i,{children:(0,B.jsx)(i,{flexWrap:`wrap`,gap:4,children:e.map(e=>(0,B.jsx)(d,{children:e.label},e.value))})})});export{H as default};
|
|
2
|
+
//# sourceMappingURL=annotation-scores-hmT53w46.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{dn as e}from"./portal-Sdfvrza9.js";import{t}from"./jsx-runtime-CFwixLRt.js";import{t as n}from"./DashboardLayout-Cn5-9Ye2.js";import{n as r}from"./useAnnotationQueues-BMo2kZ_n.js";import{t as i}from"./WithPermissionGuard-Da_hdEdq.js";import{t as a}from"./AnnotationsTable-C9n949u_.js";var o=t();function s(){return(0,o.jsx)(r,{children:(0,o.jsx)(e,{width:`full`,overflowX:`auto`,children:(0,o.jsx)(a,{showQueueAndUser:!0,heading:`Inbox`,noDataTitle:`Your inbox is empty`,noDataDescription:`Send messages to your annotation queue to get started.`})})})}var c=i(`annotations:view`,{layoutComponent:n})(s);export{c as default};
|
|
2
|
+
//# sourceMappingURL=annotations-DwouO48Z.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{t as u}from"./badge-Cpc3eA-C.js";import{i as d,n as f}from"./toaster-BsYkODqs.js";import{G as p}from"./Markdown-Cip8Rj5C.js";import{n as m}from"./personalProject-C9vU_vdl.js";import{p as h,r as g,t as _}from"./errors-mlatPkMI.js";import{t as v}from"./spacer-C38e7o6r.js";import{tt as y}from"./immer-DImI3Uq2.js";import{n as b}from"./api-l6Cnm0vQ.js";import{t as x}from"./GovernanceLayout-Baar1Fc8.js";import{Mr as S,Qn as C,Vt as w,Zn as T,nr as E,t as D}from"./index-8SbDirJv.js";import{t as O}from"./EnterpriseLockedSurface-CGy3NpuC.js";import{t as k}from"./WithFeatureFlagGuard-CgkIIt3_.js";import{t as A}from"./WithPermissionGuard-Da_hdEdq.js";var j=e(t()),M=o(),N=[{value:`critical`,label:`Critical`,tone:`red`},{value:`warning`,label:`Warning`,tone:`orange`},{value:`info`,label:`Info`,tone:`blue`}],P=[{value:`organization`,label:`Organization`},{value:`source_type`,label:`Ingestion source type`},{value:`source`,label:`Specific ingestion source`}],F=[`spend_spike`],I=JSON.stringify({windowSec:86400,ratioVsBaseline:2,minBaselineUsd:1,baselineOffsetSec:604800},null,2);function L(e,t){if(e!==`spend_spike`){if(t.trim()!==``&&t.trim()!==`{}`)try{JSON.parse(t)}catch(e){return{kind:`error`,message:`Invalid JSON: ${e instanceof Error?e.message:`parse failed`}`}}return{kind:`unsupported`,english:`\`${e}\` is in preview — the rule will save but no detector runs against it yet. \`spend_spike\` is the only type evaluated today; the others (\`rate_limit\`, \`after_hours\`, \`model_drift\`, \`error_rate\`) ship as detectors land.`}}if(t.trim()===``||t.trim()===`{}`)return{kind:`error`,message:`Empty config — fill in the rule-type-specific fields below or click the rule type to load the template.`};let n;try{n=JSON.parse(t)}catch(e){return{kind:`error`,message:`Invalid JSON: ${e instanceof Error?e.message:`parse failed`}`}}let r=n.windowSec,i=n.ratioVsBaseline,a=n.minBaselineUsd,o=n.baselineOffsetSec;if(typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||typeof o!=`number`)return{kind:`error`,message:"spend_spike requires numeric `windowSec`, `ratioVsBaseline`, `minBaselineUsd`, and `baselineOffsetSec`."};let s=e=>e>=86400?`${Math.round(e/86400*10)/10} day${e===86400?``:`s`}`:e>=3600?`${Math.round(e/3600*10)/10} hour${e===3600?``:`s`}`:e>=60?`${Math.round(e/60*10)/10} minute${e===60?``:`s`}`:`${e} second${e===1?``:`s`}`;return{kind:`ok`,english:`Fires when spend in the last ${s(r)} is at least ${i}× the spend in the equivalent ${s(r)} window from ${s(o)} ago, AND that baseline is at least $${a}. Otherwise the baseline is too noisy and the rule stays quiet.`}}var R=()=>({name:``,description:``,severity:`warning`,ruleType:`spend_spike`,scope:`organization`,scopeId:``,thresholdConfig:I,destinationConfig:`{}`});function z(){let{organization:e}=w({redirectToOnboarding:!1}),t=e?.id??``,o=b.anomalyRules.list.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),d=b.useUtils(),p=()=>d.anomalyRules.list.invalidate({organizationId:t}),[m,h]=(0,j.useState)(null),y=b.anomalyRules.create.useMutation({onSuccess:()=>{p(),h(null),f.create({title:`Rule created`,type:`success`})},onError:e=>_({error:e,fallbackTitle:`Couldn't create the rule`})}),S=b.anomalyRules.update.useMutation({onSuccess:()=>{p(),h(null),f.create({title:`Rule updated`,type:`success`})},onError:e=>_({error:e,fallbackTitle:`Couldn't update the rule`})}),E=b.anomalyRules.archive.useMutation({onSuccess:()=>{p(),f.create({title:`Rule archived`,type:`success`})},onError:e=>_({error:e,fallbackTitle:`Couldn't archive the rule`})}),k=(0,j.useMemo)(()=>{let e={critical:[],warning:[],info:[]};for(let t of o.data??[])e[t.severity]?.push(t);return e},[o.data]),A=e=>h({id:e.id,name:e.name,description:e.description??``,severity:e.severity,ruleType:e.ruleType,scope:e.scope,scopeId:e.scopeId,thresholdConfig:JSON.stringify(e.thresholdConfig??{},null,2),destinationConfig:JSON.stringify(e.destinationConfig??{},null,2)}),P=()=>{if(!m||!m.name.trim()||!m.scopeId.trim()&&m.scope!==`organization`)return;let e,n;try{e=JSON.parse(m.thresholdConfig||`{}`),n=JSON.parse(m.destinationConfig||`{}`)}catch(e){f.create({title:`Invalid JSON in config field`,description:e instanceof SyntaxError?e.message:``,type:`error`});return}let r=m.scope===`organization`?t:m.scopeId.trim();m.id?S.mutate({id:m.id,organizationId:t,name:m.name.trim(),description:m.description.trim()||null,severity:m.severity,ruleType:m.ruleType,scope:m.scope,scopeId:r,thresholdConfig:e,destinationConfig:n}):y.mutate({organizationId:t,name:m.name.trim(),description:m.description.trim()||null,severity:m.severity,ruleType:m.ruleType,scope:m.scope,scopeId:r,thresholdConfig:e,destinationConfig:n})},F=y.isPending||S.isPending;return(0,M.jsx)(x,{pageTitle:`Anomaly Rules · Governance · LangWatch`,children:(0,M.jsx)(O,{featureName:`Anomaly Rules`,description:`Anomaly Rules let your governance team define thresholds that page on-call when ingestion drifts. Available on Enterprise plans.`,children:(0,M.jsxs)(l,{align:`stretch`,gap:6,width:`full`,maxW:`container.xl`,children:[(0,M.jsxs)(a,{alignItems:`end`,children:[(0,M.jsxs)(l,{align:`start`,gap:1,children:[(0,M.jsxs)(a,{gap:2,children:[(0,M.jsx)(s,{size:`md`,children:`Anomaly Rules`}),(0,M.jsx)(u,{colorPalette:`purple`,size:`sm`,variant:`surface`,children:`Preview`})]}),(0,M.jsxs)(c,{color:`fg.muted`,fontSize:`sm`,maxW:`3xl`,children:[`Define thresholds that page on-call when activity drifts. Rules surface on the`,` `,(0,M.jsx)(D,{href:`/governance`,color:`blue.600`,children:`governance overview`}),` `,`once they fire.`]})]}),(0,M.jsx)(v,{})]}),m&&(0,M.jsx)(H,{composer:m,setComposer:h,onSubmit:P,onCancel:()=>h(null),isPending:F,orgId:t}),o.isLoading&&(0,M.jsx)(n,{size:`sm`}),o.error&&(0,M.jsxs)(l,{align:`start`,gap:2,children:[(0,M.jsx)(g,{error:o.error,fallbackTitle:`Couldn't load anomaly rules`}),(0,M.jsxs)(i,{size:`xs`,variant:`outline`,onClick:()=>void o.refetch(),loading:o.isFetching,children:[(0,M.jsx)(T,{size:12}),` Try again`]})]}),[`critical`,`warning`,`info`].map(e=>{let n=N.find(t=>t.value===e);return(0,M.jsxs)(r,{as:`section`,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:4,children:[(0,M.jsxs)(a,{alignItems:`start`,marginBottom:3,children:[(0,M.jsx)(l,{align:`start`,gap:0,children:(0,M.jsxs)(a,{gap:2,children:[(0,M.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,children:n.label}),!o.error&&(0,M.jsx)(u,{size:`sm`,variant:`surface`,children:k[e].length})]})}),(0,M.jsx)(v,{}),(0,M.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>{let t=R();t.severity=e,h(t)},disabled:!!m,children:[(0,M.jsx)(C,{size:14}),` New rule`]})]}),(0,M.jsxs)(l,{align:`stretch`,gap:2,children:[k[e].length===0&&!o.error&&(0,M.jsxs)(c,{fontSize:`sm`,color:`fg.muted`,children:[`No `,n.label.toLowerCase(),` rules.`]}),k[e].map(e=>(0,M.jsx)(B,{rule:e,onEdit:()=>A(e),onArchive:()=>E.mutate({id:e.id,organizationId:t}),isArchiving:E.isPending&&E.variables?.id===e.id},e.id))]})]},e)})]})})})}function B({rule:e,onEdit:t,onArchive:n,isArchiving:r}){return(0,M.jsxs)(a,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`sm`,padding:3,gap:3,opacity:e.status===`disabled`?.55:1,children:[(0,M.jsxs)(l,{align:`start`,gap:0,flex:1,minWidth:0,children:[(0,M.jsxs)(a,{gap:2,wrap:`wrap`,children:[(0,M.jsx)(c,{fontSize:`sm`,fontWeight:`medium`,children:e.name}),(0,M.jsx)(u,{size:`sm`,variant:`surface`,children:e.ruleType}),e.status===`disabled`&&(0,M.jsx)(u,{size:`sm`,variant:`surface`,colorPalette:`gray`,children:`Disabled`})]}),e.description&&(0,M.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:e.description}),(0,M.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`scope: `,e.scope,e.scope!==`organization`&&e.scopeId?` · ${e.scopeId}`:``]})]}),(0,M.jsxs)(i,{size:`sm`,variant:`ghost`,onClick:t,children:[(0,M.jsx)(E,{size:14}),` Edit`]}),(0,M.jsx)(i,{size:`sm`,variant:`ghost`,colorPalette:`red`,onClick:n,loading:r,title:`Archive rule`,children:(0,M.jsx)(p,{size:14})})]})}var V=[{value:`otel_generic`,label:`Generic OTel (otel_generic)`},{value:`claude_cowork`,label:`Claude Cowork (claude_cowork)`},{value:`workato`,label:`Workato (workato)`},{value:`copilot_studio`,label:`Copilot Studio (copilot_studio)`},{value:`openai_compliance`,label:`OpenAI Compliance (openai_compliance)`},{value:`claude_compliance`,label:`Claude Compliance (claude_compliance)`},{value:`s3_custom`,label:`S3 Custom (s3_custom)`}];function H({composer:e,setComposer:t,onSubmit:n,onCancel:o,isPending:u,orgId:f}){let[p,g]=(0,j.useState)(`picker`),_=b.ingestionSources.list.useQuery({organizationId:f},{enabled:e.scope===`source`&&!!f,refetchOnWindowFocus:!1}),x=!!e.id;return(0,M.jsx)(m.Root,{open:!0,placement:`end`,size:`lg`,onOpenChange:({open:e})=>{e||o()},children:(0,M.jsxs)(m.Content,{children:[(0,M.jsxs)(m.Header,{children:[(0,M.jsx)(m.CloseTrigger,{}),(0,M.jsx)(s,{as:`h2`,size:`md`,children:x?`Edit anomaly rule`:`New anomaly rule`})]}),(0,M.jsx)(m.Body,{children:(0,M.jsxs)(l,{align:`stretch`,gap:3,children:[(0,M.jsxs)(a,{gap:3,children:[(0,M.jsxs)(l,{align:`stretch`,gap:1,flex:2,children:[(0,M.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Name`}),(0,M.jsx)(S,{size:`sm`,backgroundColor:`white`,value:e.name,onChange:n=>t({...e,name:n.target.value}),placeholder:`Display name for this rule`})]}),(0,M.jsxs)(l,{align:`stretch`,gap:1,flex:1,children:[(0,M.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Severity`}),(0,M.jsx)(`select`,{value:e.severity,onChange:n=>t({...e,severity:n.target.value}),style:U,children:N.map(e=>(0,M.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})]}),(0,M.jsxs)(l,{align:`stretch`,gap:1,children:[(0,M.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Description (optional)`}),(0,M.jsx)(y,{size:`sm`,backgroundColor:`white`,rows:2,value:e.description,onChange:n=>t({...e,description:n.target.value}),placeholder:`What this rule guards against and who owns it`})]}),(0,M.jsxs)(a,{gap:3,children:[(0,M.jsxs)(l,{align:`stretch`,gap:1,flex:1,children:[(0,M.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Rule type`}),(0,M.jsx)(S,{size:`sm`,backgroundColor:`white`,list:`rule-type-suggestions`,value:e.ruleType,onChange:n=>{let r=n.target.value;t({...e,ruleType:r,thresholdConfig:r===`spend_spike`&&(e.thresholdConfig.trim()===``||e.thresholdConfig.trim()===`{}`)?I:e.thresholdConfig})},placeholder:`spend_spike`}),(0,M.jsx)(`datalist`,{id:`rule-type-suggestions`,children:F.map(e=>(0,M.jsx)(`option`,{value:e},e))}),(0,M.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`Only `,(0,M.jsx)(`code`,{children:`spend_spike`}),` is evaluated by the anomaly reactor today. Other rule types (`,(0,M.jsx)(`code`,{children:`rate_limit`}),`,`,(0,M.jsx)(`code`,{children:`after_hours`}),`, …) are`,` `,(0,M.jsx)(D,{href:`/ai-gateway/governance/anomaly-rules`,color:`blue.600`,children:`preview`}),` `,`— persisted as active but not yet detected.`]})]}),(0,M.jsxs)(l,{align:`stretch`,gap:1,flex:1,children:[(0,M.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Scope`}),(0,M.jsx)(`select`,{value:e.scope,onChange:n=>t({...e,scope:n.target.value}),style:U,children:P.map(e=>(0,M.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),e.scope!==`organization`&&(0,M.jsxs)(l,{align:`stretch`,gap:1,flex:1,children:[(0,M.jsxs)(a,{gap:2,alignItems:`center`,children:[(0,M.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:e.scope===`source`?`Ingestion source`:e.scope===`source_type`?`Source type`:`Scope ID`}),(0,M.jsx)(v,{}),(0,M.jsx)(i,{size:`xs`,variant:`ghost`,fontSize:`xs`,color:`blue.600`,onClick:()=>g(e=>e===`picker`?`custom`:`picker`),children:p===`picker`?`type a custom ID`:`use picker`})]}),p===`picker`&&e.scope===`source`?(0,M.jsxs)(`select`,{value:e.scopeId,onChange:n=>t({...e,scopeId:n.target.value}),style:U,disabled:_.isLoading,children:[(0,M.jsx)(`option`,{value:``,children:_.isLoading?`Loading sources…`:`— select an ingestion source —`}),(_.data??[]).map(e=>(0,M.jsxs)(`option`,{value:e.id,children:[e.name,` (`,e.sourceType,`)`]},e.id))]}):p===`picker`&&e.scope===`source_type`?(0,M.jsxs)(`select`,{value:e.scopeId,onChange:n=>t({...e,scopeId:n.target.value}),style:U,children:[(0,M.jsx)(`option`,{value:``,children:`— select a source type —`}),V.map(e=>(0,M.jsx)(`option`,{value:e.value,children:e.label},e.value))]}):(0,M.jsx)(S,{size:`sm`,backgroundColor:`white`,value:e.scopeId,onChange:n=>t({...e,scopeId:n.target.value}),placeholder:e.scope===`source_type`?`otel_generic, workato, ...`:e.scope===`source`?`ingestion source ID`:`${e.scope} ID`})]})]}),(0,M.jsxs)(l,{align:`stretch`,gap:1,children:[(0,M.jsxs)(a,{gap:2,alignItems:`center`,children:[(0,M.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Threshold config (rule-type-specific JSON)`}),(0,M.jsx)(v,{}),(0,M.jsx)(D,{href:h(`/ai-governance/anomaly-rules#threshold-config`),isExternal:!0,color:`blue.600`,fontSize:`xs`,fontWeight:`medium`,children:(0,M.jsxs)(a,{gap:1,alignItems:`center`,children:[(0,M.jsx)(d,{size:12}),(0,M.jsx)(c,{as:`span`,children:`Schema reference`})]})})]}),(0,M.jsx)(y,{size:`sm`,backgroundColor:`white`,rows:4,fontFamily:`mono`,value:e.thresholdConfig,onChange:n=>t({...e,thresholdConfig:n.target.value}),placeholder:`{}`}),(0,M.jsx)(W,{ruleType:e.ruleType,raw:e.thresholdConfig})]}),(0,M.jsx)(r,{borderWidth:`1px`,borderColor:`purple.300`,backgroundColor:`purple.50`,padding:3,borderRadius:`sm`,children:(0,M.jsxs)(c,{fontSize:`xs`,color:`purple.900`,children:[(0,M.jsx)(`strong`,{children:`Alert destinations:`}),` alerts surface on the`,` `,(0,M.jsx)(D,{href:`/governance`,color:`blue.600`,children:`governance dashboard`}),` `,`today. Slack, PagerDuty, webhook, and email destinations ship in a follow-up release — the composer will gain structured destination fields then. (See`,` `,(0,M.jsx)(D,{href:`/ai-gateway/governance/anomaly-rules`,color:`blue.600`,children:`anomaly rules docs`}),` `,`for the dispatch coverage table.)`]})})]})}),(0,M.jsx)(m.Footer,{children:(0,M.jsxs)(a,{gap:3,width:`full`,children:[(0,M.jsx)(v,{}),(0,M.jsx)(i,{size:`sm`,variant:`ghost`,onClick:o,children:`Cancel`}),(0,M.jsx)(i,{size:`sm`,colorPalette:`blue`,onClick:n,loading:u,disabled:!e.name.trim()||e.scope!==`organization`&&!e.scopeId.trim(),children:x?`Save changes`:`Create rule`})]})})]})})}var U={padding:`8px`,border:`1px solid var(--chakra-colors-border-muted)`,borderRadius:`var(--chakra-radii-sm)`,background:`white`,fontSize:`14px`};function W({ruleType:e,raw:t}){let n=L(e,t),i=n.kind===`ok`?{bg:`blue.50`,border:`blue.300`,fg:`blue.900`,label:`Preview`}:n.kind===`unsupported`?{bg:`orange.50`,border:`orange.300`,fg:`orange.900`,label:`Won't fire`}:{bg:`red.50`,border:`red.300`,fg:`red.900`,label:`Invalid`};return(0,M.jsx)(r,{borderWidth:`1px`,borderColor:i.border,backgroundColor:i.bg,padding:2,borderRadius:`sm`,marginTop:1,children:(0,M.jsxs)(a,{alignItems:`start`,gap:2,children:[(0,M.jsx)(u,{colorPalette:i.label===`Won't fire`?`orange`:i.label===`Invalid`?`red`:`blue`,size:`xs`,variant:`subtle`,children:i.label}),(0,M.jsx)(c,{fontSize:`xs`,color:i.fg,flex:1,children:n.kind===`error`?n.message:n.english})]})})}var G=k(`release_ui_ai_governance_enabled`,{bypassOnboardingRedirect:!0})(A(`organization:manage`,{bypassOnboardingRedirect:!0})(z));export{G as default};
|
|
2
|
+
//# sourceMappingURL=anomaly-rules-DoJdIoCt.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShikiCommandBox-u0WEsz_9.js","assets/rolldown-runtime-DAXXjFlN.js","assets/react-BUD3sqOU.js","assets/portal-Sdfvrza9.js","assets/jsx-runtime-CFwixLRt.js","assets/shikiAdapter-Ctbe7cQu.js","assets/shiki-CS25xJLQ.js","assets/badge-Cpc3eA-C.js","assets/icon-D6xQEiPb.js","assets/resize-observer-CeVrDdU8.js","assets/toaster-BsYkODqs.js","assets/dismissable-layer-DBn7OJNY.js","assets/visually-hidden-0SZJZ5dQ.js","assets/IsolatedErrorBoundary-QK1gsCee.js","assets/v-stack-hkuSkmCA.js","assets/initial-focus-Bd40-gsw.js","assets/dialog.anatomy-DGW-Ydq0.js","assets/split-presence-props-CBmNxzZm.js","assets/icon-button-Wlb_dGXL.js","assets/errors-mlatPkMI.js","assets/heading-C0sACr0w.js","assets/alert-CPsXih3K.js","assets/trpcError-CFsR-0nB.js","assets/index.esm-Cpy5fWo1.js","assets/lu-BSZWBZXU.js","assets/index-8SbDirJv.js","assets/components-CxJbXUhe.js","assets/lib-C55MVODY.js","assets/skeleton-0JSrjbwm.js","assets/field-uFetMRUQ.js","assets/api-l6Cnm0vQ.js","assets/usePublicEnv-ue4-Igop.js","assets/auth-client-MjRW2PVA.js","assets/next-router-CWLrMXvP.js","assets/defaultOptions-DTVx3qsT.js","assets/index-BmwDapuG.css","assets/Markdown-Cip8Rj5C.js","assets/tooltip-CM-lMDNU.js","assets/field-BadoNaN5.js","assets/grid-MxZhegzw.js","assets/spacer-C38e7o6r.js","assets/loadModelCatalog-DyXUQbVY.js","assets/clsx-CjueKrWZ.js","assets/clipboard-QEY7dbAQ.js","assets/eye-off-C1m7ZwkW.js","assets/TabButton-8Oc9UYh8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{S as a}from"./shiki-CS25xJLQ.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{En as u,tr as d,wn as f}from"./ProjectAvatar-B0tbfKzY.js";import{p,t as m}from"./select-BvA110t-.js";import{t as h}from"./badge-Cpc3eA-C.js";import{t as g}from"./tooltip-CM-lMDNU.js";import{d as _,n as v}from"./toaster-BsYkODqs.js";import{$ as y,G as b,I as x,J as S,Q as C,X as w,Y as T,Z as E}from"./Markdown-Cip8Rj5C.js";import{G as D,L as O}from"./DashboardLayout-Cn5-9Ye2.js";import{a as k,i as A,n as j,r as M,t as N}from"./segment-group-BktqF-NE.js";import{a as P,i as F,n as I,r as L,t as R}from"./alert-CPsXih3K.js";import{r as ee,t as z}from"./card-By_Mbslh.js";import{n as B}from"./personalProject-C9vU_vdl.js";import{t as V}from"./errors-mlatPkMI.js";import{t as te}from"./spacer-C38e7o6r.js";import{tt as ne}from"./immer-DImI3Uq2.js";import{n as H}from"./api-l6Cnm0vQ.js";import{t as re}from"./ScopeChipPicker-pQ061i-c.js";import{t as U}from"./clipboard-QEY7dbAQ.js";import{t as ie}from"./usePublicEnv-ue4-Igop.js";import{c as ae}from"./auth-client-MjRW2PVA.js";import{D as oe,Kt as W,Mr as se,Qn as G,St as K,Vt as ce,Zn as q,cr as le,nr as ue,qt as de,zn as fe}from"./index-8SbDirJv.js";import{t as pe}from"./next-dynamic-DcKsrHUa.js";import{t as me}from"./ProviderScopeChips-DN3rtvAE.js";import{a as J,c as he,n as ge,o as Y,r as _e,s as ve,t as X}from"./TabButton-8Oc9UYh8.js";import{t as ye}from"./SettingsLayout-ZI47ZjuT.js";import{n as be,t as xe}from"./useUrlScopeFilter-BmRsU3rU.js";import{i as Se,t as Ce}from"./filterProvidersByScope-loQHtcFs.js";var we=_(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Z=e(t()),Q=o();function Te({open:e,onClose:t,onConfirm:n,isLoading:i=!1}){return(0,Q.jsx)(K.Root,{open:e,onOpenChange:({open:e})=>!e&&t(),placement:`center`,children:e&&(0,Q.jsxs)(K.Content,{bg:`bg`,children:[(0,Q.jsx)(K.CloseTrigger,{}),(0,Q.jsx)(K.Header,{children:(0,Q.jsx)(K.Title,{children:`Regenerate API Key?`})}),(0,Q.jsx)(K.Body,{children:(0,Q.jsxs)(l,{align:`start`,gap:4,children:[(0,Q.jsx)(c,{children:`This will invalidate your current API key immediately. Any applications or services using the old key will stop working.`}),(0,Q.jsxs)(F,{status:`error`,borderRadius:`md`,children:[(0,Q.jsx)(L,{}),(0,Q.jsxs)(R,{children:[(0,Q.jsx)(P,{children:`This action cannot be undone`}),(0,Q.jsx)(I,{children:`You'll need to update all applications using this API key.`})]})]})]})}),(0,Q.jsxs)(K.Footer,{children:[(0,Q.jsx)(r,{variant:`outline`,onClick:t,children:`Cancel`}),(0,Q.jsx)(r,{colorPalette:`red`,onClick:n,loading:i,children:`Regenerate Key`})]})]})})}var $=[{key:`traces`,label:`Traces`,accessLevels:[`read`,`write`],readPermissions:[`traces:view`],writePermissions:[`traces:view`,`traces:create`,`traces:update`,`traces:share`]},{key:`cost`,label:`Cost`,accessLevels:[`read`],readPermissions:[`cost:view`],writePermissions:[]},{key:`scenarios`,label:`Scenarios`,accessLevels:[`read`,`write`],readPermissions:[`scenarios:view`],writePermissions:[`scenarios:view`,`scenarios:manage`]},{key:`annotations`,label:`Annotations`,accessLevels:[`read`,`write`],readPermissions:[`annotations:view`],writePermissions:[`annotations:view`,`annotations:manage`]},{key:`analytics`,label:`Analytics`,accessLevels:[`read`,`write`],readPermissions:[`analytics:view`],writePermissions:[`analytics:view`,`analytics:manage`]},{key:`evaluations`,label:`Evaluations`,accessLevels:[`read`,`write`],readPermissions:[`evaluations:view`],writePermissions:[`evaluations:view`,`evaluations:manage`]},{key:`langy`,label:`Langy`,accessLevels:[`read`,`write`],readPermissions:[`langy:view`],writePermissions:[`langy:view`,`langy:create`,`langy:update`,`langy:delete`]},{key:`datasets`,label:`Datasets`,accessLevels:[`read`,`write`],readPermissions:[`datasets:view`],writePermissions:[`datasets:view`,`datasets:manage`]},{key:`triggers`,label:`Triggers`,accessLevels:[`read`,`write`],readPermissions:[`triggers:view`],writePermissions:[`triggers:view`,`triggers:manage`]},{key:`workflows`,label:`Workflows`,accessLevels:[`read`,`write`],readPermissions:[`workflows:view`],writePermissions:[`workflows:view`,`workflows:manage`]},{key:`experiments`,label:`Experiments`,accessLevels:[`read`,`write`],readPermissions:[`experiments:view`],writePermissions:[`experiments:view`,`experiments:manage`]},{key:`prompts`,label:`Prompts`,accessLevels:[`read`,`write`],readPermissions:[`prompts:view`],writePermissions:[`prompts:view`,`prompts:manage`]},{key:`secrets`,label:`Secrets`,accessLevels:[`read`,`write`],readPermissions:[`secrets:view`],writePermissions:[`secrets:view`,`secrets:manage`]},{key:`auditLog`,label:`Audit Log`,accessLevels:[`read`],readPermissions:[`auditLog:view`],writePermissions:[]},{key:`team`,label:`Team`,accessLevels:[`read`,`write`],readPermissions:[`team:view`],writePermissions:[`team:view`,`team:manage`]},{key:`project`,label:`Project`,accessLevels:[`read`,`write`],readPermissions:[`project:view`],writePermissions:[`project:view`,`project:create`,`project:update`,`project:delete`,`project:manage`]}];function Ee({key:e,level:t}){let n=$.find(t=>t.key===e);return n?t===`write`?n.writePermissions:n.readPermissions:[]}function De(e){let t=new Set;for(let[n,r]of Object.entries(e))if(r!==`none`)for(let e of Ee({key:n,level:r}))t.add(e);return[...t].sort()}function Oe(e){let t={};for(let n of $){let r=n.writePermissions.length>0&&n.writePermissions.every(t=>e.includes(t)),i=n.readPermissions.every(t=>e.includes(t));r?t[n.key]=`write`:i&&(t[n.key]=`read`)}return t}function ke({count:e}){return(0,Q.jsxs)(i,{gap:1.5,children:[(0,Q.jsx)(f,{size:13,color:`var(--chakra-colors-fg-muted)`}),(0,Q.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[e,` selected permission`,e===1?``:`s`]})]})}var Ae={none:`None`,read:`Read`,write:`Write`};function je({category:e,value:t,userPermissions:r,onChange:a}){let o=e.readPermissions.every(e=>de(r,e)),s=e.writePermissions.length>0&&e.writePermissions.every(e=>de(r,e)),l=!o,d=t!==`none`,p=[];o&&p.push({value:`read`,label:`Read`}),s&&e.accessLevels.includes(`write`)&&p.push({value:`write`,label:`Write`}),p.push({value:`none`,label:`None`});let m=(0,Q.jsxs)(i,{gap:.5,cursor:l?`not-allowed`:`pointer`,opacity:l?.4:1,_hover:l?void 0:{opacity:.7},children:[(0,Q.jsx)(c,{fontSize:`sm`,color:d?`fg`:`fg.muted`,fontWeight:d?`500`:`400`,children:Ae[t]}),(0,Q.jsx)(u,{size:12,color:`var(--chakra-colors-fg-subtle)`})]});return l?(0,Q.jsxs)(i,{justify:`space-between`,paddingY:3,children:[(0,Q.jsxs)(i,{gap:1.5,children:[(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:e.label}),(0,Q.jsx)(g,{content:`Your role does not include access to ${e.label.toLowerCase()}`,children:(0,Q.jsx)(n,{color:`fg.subtle`,cursor:`help`,children:(0,Q.jsx)(f,{size:12})})})]}),m]}):(0,Q.jsxs)(i,{justify:`space-between`,paddingY:3,children:[(0,Q.jsx)(c,{fontSize:`sm`,children:e.label}),(0,Q.jsxs)(x.Root,{children:[(0,Q.jsx)(x.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{children:m})}),(0,Q.jsx)(x.Content,{minWidth:`120px`,children:p.map(e=>(0,Q.jsx)(x.Item,{value:e.value,onClick:()=>a(e.value),children:e.label},e.value))})]})]})}function Me({selections:e,userPermissions:t,onChange:r}){return(0,Q.jsx)(n,{width:`full`,borderWidth:`1px`,borderColor:`border`,borderRadius:`lg`,paddingX:4,children:$.map((i,a)=>(0,Q.jsx)(n,{borderBottomWidth:a<$.length-1?`1px`:0,borderColor:`border.muted`,children:(0,Q.jsx)(je,{category:i,value:e[i.key]??`none`,userPermissions:t,onChange:t=>{r({...e,[i.key]:t})}})},i.key))})}var Ne=[{label:`No expiration`,value:``},{label:`7 days`,value:`7`},{label:`30 days`,value:`30`},{label:`60 days`,value:`60`},{label:`90 days`,value:`90`},{label:`Custom...`,value:`custom`}],Pe=p({items:Ne});function Fe(e){return e.length<=8?`********`:`${e.slice(0,4)}${`*`.repeat(Math.min(e.length-8,32))}${e.slice(-4)}`}function Ie(e){return e.map(({key:e,value:t,mask:n})=>`${e}="${n?Fe(t):t}"`).join(`
|
|
3
|
+
`)}function Le({bindings:e,scopeType:t,scopeId:n,organizationId:r,orgProjects:i}){if(!e)return;let a=(t,n)=>e.find(e=>e.scopeType===t&&e.scopeId===n);return a(t,n)??(t===`PROJECT`?a(`TEAM`,i.find(e=>e.id===n)?.teamId??``):void 0)??(t===`ORGANIZATION`?void 0:a(`ORGANIZATION`,r))}function Re({permissionMode:e,scopeType:t,scopeId:n,myBindings:r,organizationId:i,orgProjects:a,isServiceKey:o}){return e===`all`?o?`ADMIN`:r?Le({bindings:r,scopeType:t,scopeId:n,organizationId:i,orgProjects:a})?.role??`VIEWER`:`VIEWER`:`CUSTOM`}function ze(e){return e.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId}))}function Be(e){let t=e.permissionMode;return t===`readonly`||t===`restricted`||e.roleBindings.length===1&&e.roleBindings[0].role===`CUSTOM`?`restricted`:`all`}function Ve(e,t){if(e.permissionMode===`readonly`){let e={};for(let n of t.permissionCategories)e[n.key]=`read`;return e}let n=e.roleBindings[0];if(!n)return{};if(n.role===`CUSTOM`&&n.customRoleId){let e=n.customRolePermissions;if(Array.isArray(e))return t.selectionsFromPermissions(e)}if(n.role===`VIEWER`){let e={};for(let n of t.permissionCategories)e[n.key]=`read`;return e}if(n.role===`MEMBER`)return t.selectionsFromPermissions(t.getTeamRolePermissions(`MEMBER`));let r={};for(let e of t.permissionCategories)r[e.key]=e.accessLevels.includes(`write`)?`write`:`read`;return r}function He({myBindings:e,scopeType:t,scopeId:n,organizationId:r,orgProjects:i,isServiceKey:a,getTeamRolePermissions:o}){if(a)return o(`ADMIN`);let s=Le({bindings:e,scopeType:t,scopeId:n,organizationId:r,orgProjects:i});return s?o(s.role):[]}function Ue({isOpen:e,isCreating:t,myBindings:n,orgProjects:a,orgTeams:o,organizationId:u,organizationName:d,currentTeamId:f,currentProjectId:h,onClose:g,onCreate:_}){let v=ae().data?.user?.id??``,[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(``),[C,w]=(0,Z.useState)(``),[T,E]=(0,Z.useState)(``),[D,O]=(0,Z.useState)([]),[P,F]=(0,Z.useState)(`all`),[I,L]=(0,Z.useState)({}),[R,ee]=(0,Z.useState)(`personal`),[z,V]=(0,Z.useState)(``),te=H.apiKey.orgMembers.useQuery({organizationId:u},{enabled:e}),U=(te.data?.length??0)>0,ie=(0,Z.useMemo)(()=>{let e=new Date;return e.setDate(e.getDate()+1),`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`},[]),oe=(0,Z.useMemo)(()=>p({items:(te.data??[]).map(e=>({label:e.name??e.email??e.id,value:e.id}))}),[te.data]),G=D[0]??{scopeType:`PROJECT`,scopeId:h??``},K=(0,Z.useMemo)(()=>He({myBindings:n.data,scopeType:G.scopeType,scopeId:G.scopeId,organizationId:u,orgProjects:a,isServiceKey:R===`service`,getTeamRolePermissions:e=>W(e)}),[n.data,G.scopeType,G.scopeId,u,a,R]),ce=()=>{b(``),S(``),w(``),E(``),O(h?[{scopeType:`PROJECT`,scopeId:h}]:[]),F(`all`),L({}),ee(`personal`),V(v)};(0,Z.useEffect)(()=>{e&&ce()},[e,v]);let q=()=>{let e;if(C===`custom`&&T)e=new Date(T);else if(C&&C!==`custom`){let t=parseInt(C,10);e=new Date(Date.now()+t*24*60*60*1e3)}let t=P===`restricted`?De(I):void 0,r=R===`service`,i=D.map(e=>({role:Re({permissionMode:P,scopeType:e.scopeType,scopeId:e.scopeId,myBindings:n.data,organizationId:u,orgProjects:a,isServiceKey:r}),scopeType:e.scopeType,scopeId:e.scopeId}));_({name:y,description:x,expiresAt:e,permissionMode:P,keyType:R,assignedToUserId:U&&z&&z!==v?z:void 0,scopeType:G.scopeType,scopeId:G.scopeId,permissions:t,bindings:i})},le=P===`all`||Object.values(I).some(e=>e!==`none`),ue=y.trim()&&!t&&!n.isLoading&&le&&(D.length>0||!!h);return(0,Q.jsx)(B.Root,{placement:`end`,size:`lg`,open:e,onOpenChange:({open:e})=>{e||(g(),ce())},children:(0,Q.jsxs)(B.Content,{bg:`bg`,children:[(0,Q.jsxs)(B.Header,{children:[(0,Q.jsx)(s,{size:`md`,children:`Create new secret key`}),(0,Q.jsx)(B.CloseTrigger,{})]}),(0,Q.jsx)(B.Body,{children:(0,Q.jsxs)(l,{gap:5,align:`start`,children:[U&&(0,Q.jsxs)(l,{gap:2,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Key type`}),(0,Q.jsxs)(k,{size:`sm`,value:R,onValueChange:e=>ee(e.value),children:[(0,Q.jsx)(N,{}),(0,Q.jsxs)(j,{value:`personal`,children:[(0,Q.jsx)(A,{children:`Personal`}),(0,Q.jsx)(M,{})]}),(0,Q.jsxs)(j,{value:`service`,children:[(0,Q.jsx)(A,{children:`Service`}),(0,Q.jsx)(M,{})]})]}),R===`personal`&&(0,Q.jsxs)(l,{gap:2,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`Tied to a user. If the user is removed from the organization, this key will be disabled.`}),(0,Q.jsxs)(m.Root,{collection:oe,value:z?[z]:[],onValueChange:e=>{V(e.value[0]??``)},children:[(0,Q.jsx)(m.Trigger,{width:`full`,background:`bg`,children:(0,Q.jsx)(m.ValueText,{placeholder:`Select user`})}),(0,Q.jsx)(m.Content,{children:oe.items.map(e=>(0,Q.jsx)(m.Item,{item:e,children:e.label},e.value))})]})]}),R===`service`&&(0,Q.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`Not tied to any user. Cannot be revoked when a user leaves. Set permissions below.`})]}),(0,Q.jsxs)(l,{gap:1,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Name`}),(0,Q.jsx)(se,{placeholder:`e.g., CI Pipeline, Local Dev`,value:y,onChange:e=>b(e.target.value)})]}),(0,Q.jsxs)(l,{gap:1,align:`start`,width:`full`,children:[(0,Q.jsxs)(c,{fontWeight:`600`,fontSize:`sm`,children:[`Description`,` `,(0,Q.jsx)(c,{as:`span`,color:`fg.muted`,fontWeight:`400`,children:`(optional)`})]}),(0,Q.jsx)(ne,{placeholder:`What is this key used for?`,value:x,onChange:e=>S(e.target.value),maxLength:500,rows:3,resize:`vertical`})]}),(0,Q.jsxs)(l,{gap:1.5,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Scope`}),(0,Q.jsx)(re,{value:D,onChange:e=>{O(e),L({})},organizationId:u,organizationName:d,availableTeams:o,availableProjects:a,label:``,showQuickPicks:!0,currentOrganizationId:u,currentTeamId:f,currentProjectId:h})]}),(0,Q.jsxs)(l,{gap:2,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Permissions`}),(0,Q.jsxs)(i,{justify:`space-between`,width:`full`,children:[(0,Q.jsxs)(k,{size:`sm`,value:P,onValueChange:e=>{let t=e.value;F(t),t===`all`&&L({})},children:[(0,Q.jsx)(N,{}),(0,Q.jsxs)(j,{value:`all`,children:[(0,Q.jsx)(A,{children:`All`}),(0,Q.jsx)(M,{})]}),(0,Q.jsxs)(j,{value:`restricted`,children:[(0,Q.jsx)(A,{children:`Restricted`}),(0,Q.jsx)(M,{})]})]}),P===`restricted`&&(0,Q.jsx)(ke,{count:Object.values(I).filter(e=>e&&e!==`none`).length})]}),P===`all`&&(0,Q.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:`Full access within the selected scope, bounded by your role.`}),P===`restricted`&&(0,Q.jsx)(Me,{selections:I,userPermissions:K,onChange:L})]}),(0,Q.jsxs)(l,{gap:1,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Expiration`}),(0,Q.jsxs)(m.Root,{collection:Pe,value:[C],onValueChange:e=>{let t=e.value[0]??``;w(t),t!==`custom`&&E(``)},children:[(0,Q.jsx)(m.Trigger,{width:`full`,background:`bg`,children:(0,Q.jsx)(m.ValueText,{placeholder:`No expiration`})}),(0,Q.jsx)(m.Content,{width:`300px`,paddingY:2,children:Ne.map(e=>(0,Q.jsx)(m.Item,{item:e,children:e.label},e.value))})]}),C===`custom`&&(0,Q.jsx)(se,{type:`date`,value:T,min:ie,onChange:e=>E(e.target.value)})]})]})}),(0,Q.jsx)(B.Footer,{children:(0,Q.jsxs)(i,{width:`full`,justify:`end`,gap:2,children:[(0,Q.jsx)(r,{variant:`outline`,onClick:g,children:`Cancel`}),(0,Q.jsx)(r,{colorPalette:`blue`,onClick:q,disabled:!ue,children:`Create secret key`})]})})]})})}var We=fe();function Ge({apiKey:e,isUpdating:t,myBindings:n,orgProjects:a,orgTeams:o,organizationId:u,organizationName:d,currentTeamId:f,currentProjectId:p,onClose:m,onSave:h}){let[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(``),[b,x]=(0,Z.useState)([]),[S,C]=(0,Z.useState)(`all`),[w,T]=(0,Z.useState)({}),E=e?!e.userId:!1,D=b[0]??{scopeType:`PROJECT`,scopeId:p??``},O=(0,Z.useMemo)(()=>{if(E)return W(We.TeamUserRole.ADMIN);if(!n.data)return[];let e=Le({bindings:n.data,scopeType:D.scopeType,scopeId:D.scopeId,organizationId:u,orgProjects:a});return e?W(e.role):[]},[n.data,D.scopeType,D.scopeId,u,a,E]);(0,Z.useEffect)(()=>{if(e){_(e.name),y(e.description??``);let t=Be(e);C(t),x(ze(e.roleBindings)),T(t===`restricted`?Ve(e,{permissionCategories:$,selectionsFromPermissions:Oe,getTeamRolePermissions:e=>W(e)}):{})}},[e,u,f,p]);let P=e=>{if(C(e),e===`restricted`&&Object.values(w).every(e=>!e||e===`none`)){let e={};for(let t of $){let n=t.readPermissions.every(e=>de(O,e)),r=t.accessLevels.includes(`write`)&&t.writePermissions.every(e=>de(O,e));e[t.key]=r?`write`:n?`read`:`none`}T(e)}},F=()=>{if(!e)return;let t=S===`restricted`?De(w):void 0,r=b.map(e=>({role:Re({permissionMode:S,scopeType:e.scopeType,scopeId:e.scopeId,myBindings:n.data,organizationId:u,orgProjects:a,isServiceKey:E}),scopeType:e.scopeType,scopeId:e.scopeId}));h({apiKeyId:e.id,name:g===e.name?void 0:g,description:v===(e.description??``)?void 0:v||null,permissionMode:S,scopeType:D.scopeType,scopeId:D.scopeId,permissions:t,bindings:r})},I=S===`all`||Object.values(w).some(e=>e!==`none`),L=g.trim()&&!t&&I;return(0,Q.jsx)(B.Root,{placement:`end`,size:`lg`,open:!!e,onOpenChange:({open:e})=>{e||m()},children:(0,Q.jsxs)(B.Content,{bg:`bg`,children:[(0,Q.jsxs)(B.Header,{children:[(0,Q.jsx)(s,{size:`md`,children:`Edit API key`}),(0,Q.jsx)(B.CloseTrigger,{})]}),(0,Q.jsx)(B.Body,{children:(0,Q.jsxs)(l,{gap:5,align:`start`,children:[(0,Q.jsxs)(l,{gap:1,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Name`}),(0,Q.jsx)(se,{value:g,onChange:e=>_(e.target.value)})]}),(0,Q.jsxs)(l,{gap:1,align:`start`,width:`full`,children:[(0,Q.jsxs)(c,{fontWeight:`600`,fontSize:`sm`,children:[`Description`,` `,(0,Q.jsx)(c,{as:`span`,color:`fg.muted`,fontWeight:`400`,children:`(optional)`})]}),(0,Q.jsx)(ne,{value:v,onChange:e=>y(e.target.value),maxLength:500,rows:3,resize:`vertical`})]}),(0,Q.jsxs)(l,{gap:1.5,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Scope`}),(0,Q.jsx)(re,{value:b,onChange:e=>{x(e),T({})},organizationId:u,organizationName:d,availableTeams:o,availableProjects:a,label:``,showQuickPicks:!0,currentOrganizationId:u,currentTeamId:f,currentProjectId:p})]}),(0,Q.jsxs)(l,{gap:2,align:`start`,width:`full`,children:[(0,Q.jsx)(c,{fontWeight:`600`,fontSize:`sm`,children:`Permissions`}),(0,Q.jsxs)(i,{justify:`space-between`,width:`full`,children:[(0,Q.jsxs)(k,{size:`sm`,value:S,onValueChange:e=>P(e.value),children:[(0,Q.jsx)(N,{}),(0,Q.jsxs)(j,{value:`all`,children:[(0,Q.jsx)(A,{children:`All`}),(0,Q.jsx)(M,{})]}),(0,Q.jsxs)(j,{value:`restricted`,children:[(0,Q.jsx)(A,{children:`Restricted`}),(0,Q.jsx)(M,{})]})]}),S===`restricted`&&(0,Q.jsx)(ke,{count:Object.values(w).filter(e=>e&&e!==`none`).length})]}),S===`restricted`&&(0,Q.jsx)(Me,{selections:w,userPermissions:O,onChange:T})]})]})}),(0,Q.jsx)(B.Footer,{children:(0,Q.jsxs)(i,{width:`full`,justify:`end`,gap:2,children:[(0,Q.jsx)(r,{variant:`outline`,onClick:m,children:`Cancel`}),(0,Q.jsx)(r,{colorPalette:`blue`,onClick:F,disabled:!L,children:`Save`})]})})]})})}function Ke(e){return!!(e.expiresAt&&new Date(e.expiresAt)<new Date)}function qe({keys:e,isAdmin:t,onRevoke:a}){return e.length===0?null:(0,Q.jsxs)(l,{gap:4,width:`full`,align:`start`,children:[(0,Q.jsxs)(l,{gap:1,align:`start`,children:[(0,Q.jsx)(s,{size:`md`,children:`Ingestion keys`}),(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Write-only keys scoped to one project that only ingest traces. The langwatch CLI mints these when you connect a tool.`})]}),(0,Q.jsx)(ee,{width:`full`,overflow:`hidden`,children:(0,Q.jsx)(z,{paddingY:0,paddingX:0,overflowX:`auto`,children:(0,Q.jsxs)(C,{variant:`line`,size:`md`,width:`full`,children:[(0,Q.jsx)(E,{children:(0,Q.jsxs)(y,{children:[(0,Q.jsx)(w,{children:`Name`}),(0,Q.jsx)(w,{children:`Status`}),(0,Q.jsx)(w,{children:`Secret Key`}),(0,Q.jsx)(w,{children:`Created`}),(0,Q.jsx)(w,{children:`Last Used`}),(0,Q.jsx)(w,{children:`Source`}),(0,Q.jsx)(w,{children:`Created from`}),(0,Q.jsx)(w,{width:`100px`})]})}),(0,Q.jsx)(S,{children:e.map(e=>(0,Q.jsxs)(y,{id:D(e.id),children:[(0,Q.jsx)(T,{children:(0,Q.jsxs)(i,{align:`start`,children:[(0,Q.jsx)(n,{paddingTop:1,children:(0,Q.jsx)(we,{size:14})}),(0,Q.jsxs)(l,{align:`start`,gap:0,children:[(0,Q.jsx)(c,{children:e.name}),e.description&&(0,Q.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:e.description})]})]})}),(0,Q.jsx)(T,{children:Ke(e)?(0,Q.jsx)(h,{size:`sm`,colorPalette:`red`,children:`Expired`}):(0,Q.jsx)(h,{size:`sm`,colorPalette:`green`,children:`Active`})}),(0,Q.jsx)(T,{children:(0,Q.jsxs)(c,{fontSize:`xs`,fontFamily:`monospace`,color:`fg.muted`,children:[`ik-lw-`,e.lookupIdPrefix,`…`]})}),(0,Q.jsx)(T,{children:new Date(e.createdAt).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}),(0,Q.jsx)(T,{children:e.lastUsedAt?(0,Q.jsx)(g,{content:new Date(e.lastUsedAt).toISOString(),children:(0,Q.jsx)(c,{cursor:`help`,tabIndex:0,"aria-label":`Last used at ${new Date(e.lastUsedAt).toISOString()}`,children:oe(new Date(e.lastUsedAt).getTime())})}):(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Never`})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(h,{size:`sm`,colorPalette:`blue`,children:e.ingestSourceType})}),(0,Q.jsx)(T,{children:e.createdByDeviceLabel?(0,Q.jsx)(c,{fontSize:`sm`,children:e.createdByDeviceLabel}):(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Unknown device`})}),(0,Q.jsx)(T,{children:t&&(0,Q.jsx)(r,{size:`xs`,variant:`ghost`,colorPalette:`red`,"aria-label":`Revoke ingestion key ${e.name}`,onClick:()=>a(e.id),children:(0,Q.jsx)(b,{size:14,"aria-hidden":`true`})})})]},e.id))})]})})})]})}function Je({apiKeyId:e,isRevoking:t,onCancel:n,onConfirm:a}){return(0,Q.jsx)(K.Root,{size:`lg`,open:!!e,onOpenChange:({open:e})=>{e||n()},children:(0,Q.jsxs)(K.Content,{bg:`bg`,children:[(0,Q.jsx)(K.Header,{children:(0,Q.jsx)(K.Title,{children:`Revoke API Key`})}),(0,Q.jsx)(K.CloseTrigger,{}),(0,Q.jsx)(K.Body,{paddingBottom:6,children:(0,Q.jsxs)(l,{gap:4,align:`start`,children:[(0,Q.jsx)(c,{children:`Are you sure you want to revoke this API key? Any integration using it will stop working immediately.`}),(0,Q.jsxs)(i,{width:`full`,justify:`end`,gap:2,children:[(0,Q.jsx)(r,{variant:`outline`,onClick:n,children:`Cancel`}),(0,Q.jsx)(r,{colorPalette:`red`,onClick:()=>e&&a(e),disabled:t,children:`Revoke`})]})]})})]})})}var Ye=pe(()=>a(()=>import(`./ShikiCommandBox-u0WEsz_9.js`).then(e=>e.ShikiCommandBox),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),{ssr:!1}),Xe=[{editor:`Claude Code`,path:`.claude/settings.json`},{editor:`Cursor`,path:`.cursor/mcp.json`},{editor:`Copilot`,path:`.vscode/mcp.json`},{editor:`Windsurf`,path:`~/.codeium/windsurf/mcp_config.json`},{editor:`Claude Desktop`,path:`~/Library/Application Support/Claude/claude_desktop_config.json`}];function Ze({newToken:e,projectId:t,endpoint:r,orgProjects:a,onClose:o}){let[s,u]=(0,Z.useState)(`claude-code`),[d,f]=(0,Z.useState)(`env`),[h,g]=(0,Z.useState)(t??``),_=h||t,v=ve(e??``),y=(0,Z.useMemo)(()=>p({items:a.map(e=>({label:e.name,value:e.id}))}),[a]),b=r&&r!==`https://app.langwatch.ai`,x=b?` --endpoint ${r}`:``,S=_?` --env LANGWATCH_PROJECT_ID=${_}`:``,C=_?` --env LANGWATCH_PROJECT_ID=${_}`:``,w=(0,Z.useMemo)(()=>J({apiKey:e??``,endpoint:r,projectId:_}),[e,r,_]),T=(0,Z.useMemo)(()=>J({apiKey:v,endpoint:r,projectId:_}),[v,r,_]),E=(0,Z.useMemo)(()=>Ie([{key:`LANGWATCH_API_KEY`,value:e??``,mask:!0},{key:`LANGWATCH_PROJECT_ID`,value:_??`<your-project-id>`},{key:`LANGWATCH_ENDPOINT`,value:r}]),[e,_,r]),D=(0,Z.useMemo)(()=>Ie([{key:`LANGWATCH_API_KEY`,value:e??``},{key:`LANGWATCH_PROJECT_ID`,value:_??`<your-project-id>`},{key:`LANGWATCH_ENDPOINT`,value:r}]),[e,_,r]),O=e?`Authorization: Bearer ${Fe(e)}\nX-Project-Id: ${_??`<your-project-id>`}`:``,k=`Authorization: Bearer ${e??``}\nX-Project-Id: ${_??`<your-project-id>`}`,A=e&&_?`Authorization: Basic ${btoa(`${_}:${e}`)}`:``,j=`Authorization: Basic base64(${_??`<your-project-id>`}:pat-lw-...)`,M=`claude mcp add langwatch${S} -- npx -y @langwatch/mcp-server --api-key ${e??``}${x}`,N=`claude mcp add langwatch${S} -- npx -y @langwatch/mcp-server --api-key ${v}${x}`,I=`codex mcp add langwatch --env LANGWATCH_API_KEY=${e??``}${C}${b?` --env LANGWATCH_ENDPOINT=${r}`:``} -- npx -y @langwatch/mcp-server`,R=`codex mcp add langwatch --env LANGWATCH_API_KEY=${v}${C}${b?` --env LANGWATCH_ENDPOINT=${r}`:``} -- npx -y @langwatch/mcp-server`;return(0,Q.jsx)(K.Root,{size:`xl`,open:!!e,onOpenChange:({open:e})=>{e||o()},children:(0,Q.jsxs)(K.Content,{bg:`bg`,children:[(0,Q.jsx)(K.Header,{children:(0,Q.jsx)(K.Title,{children:`Token Created`})}),(0,Q.jsx)(K.CloseTrigger,{}),(0,Q.jsx)(K.Body,{paddingBottom:6,children:(0,Q.jsxs)(l,{gap:6,align:`stretch`,children:[(0,Q.jsxs)(l,{gap:3,align:`stretch`,children:[(0,Q.jsxs)(i,{gap:4,align:`start`,children:[(0,Q.jsxs)(l,{gap:2,align:`start`,flex:1,children:[(0,Q.jsx)(c,{fontWeight:`700`,fontSize:`sm`,children:`Use in Code`}),(0,Q.jsxs)(i,{gap:1,px:1.5,py:1.5,borderRadius:`xl`,border:`1px solid`,borderColor:`border.subtle`,bg:`bg.panel/70`,boxShadow:`sm`,width:`fit-content`,children:[(0,Q.jsx)(X,{label:`.env`,active:d===`env`,onClick:()=>f(`env`)}),(0,Q.jsx)(X,{label:`Bearer`,active:d===`bearer`,onClick:()=>f(`bearer`)}),(0,Q.jsx)(X,{label:`Basic Auth`,active:d===`basic`,onClick:()=>f(`basic`)})]})]}),a.length>1&&(0,Q.jsxs)(l,{gap:2,align:`start`,width:`200px`,flexShrink:0,children:[(0,Q.jsx)(c,{fontWeight:`700`,fontSize:`sm`,children:`Project`}),(0,Q.jsxs)(m.Root,{collection:y,value:_?[_]:[],onValueChange:e=>{g(e.value[0]??``)},size:`sm`,width:`full`,children:[(0,Q.jsx)(m.Trigger,{background:`bg`,borderRadius:`lg`,children:(0,Q.jsx)(m.ValueText,{placeholder:`Select project`})}),(0,Q.jsx)(m.Content,{children:y.items.map(e=>(0,Q.jsx)(m.Item,{item:e,children:e.label},e.value))})]})]})]}),d===`env`&&e&&(0,Q.jsx)(Ye,{command:D,maskedCommand:E,lang:`ini`,copyLabel:`.env`}),d===`bearer`&&(0,Q.jsxs)(l,{gap:1,align:`stretch`,children:[(0,Q.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`Use the `,(0,Q.jsx)(`code`,{children:`Authorization`}),` header plus`,` `,(0,Q.jsx)(`code`,{children:`X-Project-Id`}),`:`]}),(0,Q.jsx)(Ye,{command:k,maskedCommand:O,lang:`shellscript`,copyLabel:`Bearer headers`})]}),d===`basic`&&(0,Q.jsxs)(l,{gap:1,align:`stretch`,children:[(0,Q.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`Encode the project ID and token as`,` `,(0,Q.jsx)(`code`,{children:`base64(projectId:token)`}),`:`]}),(0,Q.jsx)(Ye,{command:A,maskedCommand:j,lang:`shellscript`,copyLabel:`Basic Auth header`})]})]}),(0,Q.jsxs)(F,{status:`warning`,variant:`subtle`,opacity:.8,children:[(0,Q.jsx)(L,{}),(0,Q.jsx)(P,{fontSize:`xs`,children:`Copy this token now. You won't be able to see it again.`})]}),(0,Q.jsxs)(l,{gap:3,align:`stretch`,children:[(0,Q.jsx)(c,{fontWeight:`700`,fontSize:`sm`,children:`Use with Code Assistants`}),(0,Q.jsxs)(i,{gap:1,px:1.5,py:1.5,borderRadius:`xl`,border:`1px solid`,borderColor:`border.subtle`,bg:`bg.panel/70`,boxShadow:`sm`,width:`fit-content`,children:[(0,Q.jsx)(X,{label:`Claude Code`,active:s===`claude-code`,onClick:()=>u(`claude-code`)}),(0,Q.jsx)(X,{label:`Codex`,active:s===`codex`,onClick:()=>u(`codex`)})]}),s===`claude-code`&&e&&(0,Q.jsxs)(l,{align:`stretch`,gap:3,children:[(0,Q.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Run in your terminal`}),(0,Q.jsx)(Ye,{command:M,maskedCommand:N,lang:`bash`,showPrompt:!0,copyLabel:`Claude Code command`})]}),s===`codex`&&e&&(0,Q.jsxs)(l,{align:`stretch`,gap:3,children:[(0,Q.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Run in your terminal`}),(0,Q.jsx)(Ye,{command:I,maskedCommand:R,lang:`bash`,showPrompt:!0,copyLabel:`Codex command`})]}),e&&(0,Q.jsxs)(l,{align:`stretch`,gap:2,children:[(0,Q.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Or paste into your config file`}),(0,Q.jsxs)(n,{position:`relative`,borderRadius:`xl`,overflow:`hidden`,border:`1px solid`,borderColor:`border.subtle`,bg:`bg.panel/70`,boxShadow:`xs`,transition:`all 0.17s ease`,_hover:{borderColor:`orange.emphasized`,boxShadow:`md`},children:[(0,Q.jsx)(ge,{code:T,highlightLines:Y(T)}),(0,Q.jsx)(n,{position:`absolute`,top:2.5,right:2.5,children:(0,Q.jsx)(_e,{text:w,label:`Config`})})]}),(0,Q.jsxs)(i,{gap:2,flexWrap:`wrap`,align:`center`,children:[(0,Q.jsx)(c,{fontSize:`xs`,color:`fg.muted`,flexShrink:0,children:`Config path:`}),Xe.map(e=>(0,Q.jsx)(i,{asChild:!0,gap:1,px:2,py:.5,borderRadius:`md`,bg:`bg.panel/60`,border:`1px solid`,borderColor:`border.subtle`,cursor:`pointer`,transition:`all 0.15s ease`,_hover:{borderColor:`orange.emphasized`,bg:`bg.panel`},onClick:()=>{he({text:e.path,successMessage:`${e.editor} config path copied`})},children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Copy ${e.editor} config path`,children:(0,Q.jsx)(c,{fontSize:`2xs`,fontWeight:`medium`,color:`fg`,children:e.editor})})},e.editor))]})]})]})]})})]})})}function Qe({apiKey:e,canManage:t,onRotate:n}){return(0,Q.jsxs)(i,{gap:1,children:[(0,Q.jsx)(r,{size:`xs`,variant:`ghost`,"aria-label":`Copy secret key`,onClick:()=>{navigator.clipboard.writeText(e),v.create({title:`API key copied to clipboard`,type:`success`,duration:2e3,meta:{closable:!0}})},children:(0,Q.jsx)(U,{size:14})}),t&&(0,Q.jsx)(g,{content:`Rotate this key`,children:(0,Q.jsx)(r,{size:`xs`,variant:`ghost`,"aria-label":`Rotate Project API Key`,onClick:n,children:(0,Q.jsx)(q,{size:14,"aria-hidden":`true`})})})]})}function $e({organizationId:e,projectId:t}){let a=ae().data?.user?.id??``,o=ie(),{project:s,team:u,organization:f,hasPermission:p}=ce(),m=o.data?.BASE_HOST??`https://app.langwatch.ai`,_=p(`project:manage`),x=H.apiKey.list.useQuery({organizationId:e}),k=H.apiKey.myBindings.useQuery({organizationId:e}),A=H.apiKey.orgProjects.useQuery({organizationId:e}),j=H.apiKey.orgTeams.useQuery({organizationId:e}),M=(H.apiKey.orgMembers.useQuery({organizationId:e}).data?.length??0)>0,N=H.apiKey.create.useMutation(),P=H.apiKey.update.useMutation(),F=H.apiKey.revoke.useMutation(),I=H.project.regenerateApiKey.useMutation(),L=H.useContext(),{open:R,onOpen:B,onClose:ne}=d(),[re,U]=(0,Z.useState)(null),[W,se]=(0,Z.useState)(null),[K,q]=(0,Z.useState)(null),[de,fe]=(0,Z.useState)(null),[pe,J]=(0,Z.useState)(!1),he=Se(f),{hierarchy:ge}=he,[Y,_e]=xe({filterAvailable:he,teamId:u?.id,projectId:s?.id}),ve=x.data??[],X=(0,Z.useMemo)(()=>ve.filter(e=>e.ingestSourceType!=null),[ve]),ye=(0,Z.useMemo)(()=>ve.filter(e=>e.ingestSourceType==null),[ve]),we=(0,Z.useMemo)(()=>Ce(ye.map(e=>({...e,scopes:e.roleBindings.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId}))})),Y,{hierarchy:ge,currentTeamId:u?.id,currentProjectId:s?.id}),[ye,Y,ge,u?.id,s?.id]),$=x.isLoading;(0,Z.useEffect)(()=>{if($||typeof window>`u`)return;let e=window.location.hash.slice(1);e&&document.getElementById(e)?.scrollIntoView({block:`center`})},[$]);let Ee=t=>{if(t.permissionMode===`restricted`&&t.bindings.length===0){v.create({title:`No scopes selected`,description:`Select at least one scope for a restricted key.`,type:`error`,duration:5e3,meta:{closable:!0}});return}if(t.keyType===`personal`&&t.permissionMode!==`restricted`&&t.bindings.length===0){v.create({title:`No permissions to grant`,description:`You have no role bindings in this organization, so there is nothing to grant to a key.`,type:`error`,duration:5e3,meta:{closable:!0}});return}N.mutate({organizationId:e,name:t.name,description:t.description.trim()?t.description.trim():void 0,expiresAt:t.expiresAt,permissionMode:t.permissionMode,keyType:t.keyType,assignedToUserId:t.assignedToUserId,permissions:t.permissions,bindings:t.bindings},{onSuccess:e=>{U(e.token),se(t),L.apiKey.list.invalidate()},onError:e=>V({error:e,fallbackTitle:`Couldn't create API key`})})},De=t=>{P.mutate({organizationId:e,apiKeyId:t.apiKeyId,name:t.name,description:t.description,permissionMode:t.permissionMode,permissions:t.permissions,bindings:t.bindings},{onSuccess:()=>{fe(null),v.create({title:`API key updated`,type:`success`,duration:3e3,meta:{closable:!0}}),L.apiKey.list.invalidate()},onError:e=>V({error:e,fallbackTitle:`Couldn't update API key`})})},Oe=t=>{F.mutate({organizationId:e,apiKeyId:t},{onSuccess:()=>{q(null),v.create({title:`API key revoked`,type:`success`,duration:3e3,meta:{closable:!0}}),L.apiKey.list.invalidate()},onError:e=>V({error:e,fallbackTitle:`Couldn't revoke API key`})})},ke=()=>{s?.id&&I.mutate({projectId:s.id},{onSuccess:e=>{J(!1),U(e.apiKey),L.organization.getAll.invalidate(),v.create({title:`Project API key rotated`,description:`The previous key no longer works. Update your integrations.`,type:`warning`,duration:6e3,meta:{closable:!0}})},onError:e=>{J(!1),V({error:e,fallbackTitle:`Couldn't rotate the project API key`})}})},Ae=s?.apiKey,je=(0,Z.useMemo)(()=>!Ae||!s?.id?!1:Ce([{scopes:[{scopeType:`PROJECT`,scopeId:s.id}]}],Y,{hierarchy:ge,currentTeamId:u?.id,currentProjectId:s?.id}).length>0,[Ae,s?.id,Y,ge,u?.id]),Me=e=>e.expiresAt&&new Date(e.expiresAt)<new Date?`Expired`:`Active`,Ne=e=>e.permissionMode===`all`?(0,Q.jsx)(h,{size:`sm`,colorPalette:`green`,children:`All`}):(0,Q.jsx)(h,{size:`sm`,colorPalette:`orange`,children:`Restricted`}),Pe=e=>(0,Q.jsx)(me,{size:`xs`,scopes:e.roleBindings.map(e=>({scopeType:e.scopeType,scopeId:e.scopeId,name:e.scopeName??void 0}))});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(l,{gap:8,width:`full`,align:`stretch`,children:[(0,Q.jsxs)(l,{gap:4,width:`full`,align:`start`,children:[(0,Q.jsxs)(i,{width:`full`,flexWrap:`wrap`,gap:2,children:[(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Do not share your API keys or expose them in the browser or other client-side code.`}),(0,Q.jsx)(te,{}),(0,Q.jsx)(be,{value:Y,onChange:_e,available:he,currentTeamId:u?.id,currentProjectId:s?.id}),(0,Q.jsxs)(O.HeaderButton,{onClick:B,children:[(0,Q.jsx)(G,{size:16}),`Create new secret key`]})]}),(0,Q.jsx)(ee,{width:`full`,overflow:`hidden`,children:(0,Q.jsx)(z,{paddingY:0,paddingX:0,overflowX:`auto`,children:(0,Q.jsxs)(C,{variant:`line`,size:`md`,width:`full`,children:[(0,Q.jsx)(E,{children:(0,Q.jsxs)(y,{children:[(0,Q.jsx)(w,{children:`Name`}),(0,Q.jsx)(w,{children:`Status`}),(0,Q.jsx)(w,{children:`Secret Key`}),(0,Q.jsx)(w,{children:`Created`}),(0,Q.jsx)(w,{children:`Last Used`}),(0,Q.jsx)(w,{children:`Type`}),(0,Q.jsx)(w,{children:`Scope`}),(0,Q.jsx)(w,{children:`Permissions`}),(0,Q.jsx)(w,{width:`100px`})]})}),(0,Q.jsxs)(S,{children:[je&&Ae&&(0,Q.jsxs)(y,{children:[(0,Q.jsx)(T,{children:(0,Q.jsxs)(i,{align:`center`,children:[(0,Q.jsx)(le,{size:14}),(0,Q.jsx)(c,{children:`Project API Key`})]})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(h,{size:`sm`,colorPalette:`green`,children:`Active`})}),(0,Q.jsx)(T,{children:(0,Q.jsxs)(c,{fontSize:`xs`,fontFamily:`monospace`,color:`fg.muted`,children:[`sk-…`,Ae.slice(-4)]})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`—`})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`—`})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(h,{size:`sm`,colorPalette:`purple`,children:`Service`})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(me,{size:`xs`,scopes:[{scopeType:`PROJECT`,scopeId:s?.id??``,name:s?.name}]})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(h,{size:`sm`,colorPalette:`green`,children:`All`})}),(0,Q.jsx)(T,{children:(0,Q.jsx)(Qe,{apiKey:Ae,canManage:_,onRotate:()=>J(!0)})})]}),we.map(e=>(0,Q.jsxs)(y,{id:D(e.id),children:[(0,Q.jsx)(T,{children:(0,Q.jsxs)(i,{align:`start`,children:[(0,Q.jsx)(n,{paddingTop:1,children:(0,Q.jsx)(le,{size:14})}),(0,Q.jsxs)(l,{align:`start`,gap:0,children:[(0,Q.jsx)(c,{children:e.name}),e.description&&(0,Q.jsx)(c,{fontSize:`xs`,color:`fg.muted`,children:e.description})]})]})}),(0,Q.jsx)(T,{children:Me(e)===`Expired`?(0,Q.jsx)(h,{size:`sm`,colorPalette:`red`,children:`Expired`}):(0,Q.jsx)(h,{size:`sm`,colorPalette:`green`,children:`Active`})}),(0,Q.jsx)(T,{children:(0,Q.jsxs)(c,{fontSize:`xs`,fontFamily:`monospace`,color:`fg.muted`,children:[`sk-lw-`,e.lookupIdPrefix,`…`]})}),(0,Q.jsx)(T,{children:new Date(e.createdAt).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}),(0,Q.jsx)(T,{children:e.lastUsedAt?(0,Q.jsx)(g,{content:new Date(e.lastUsedAt).toISOString(),children:(0,Q.jsx)(c,{cursor:`help`,tabIndex:0,"aria-label":`Last used at ${new Date(e.lastUsedAt).toISOString()}`,children:oe(new Date(e.lastUsedAt).getTime())})}):(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Never`})}),(0,Q.jsx)(T,{children:e.userId?(0,Q.jsx)(h,{size:`sm`,variant:`outline`,children:e.userEmail??e.userName??`—`}):(0,Q.jsx)(h,{size:`sm`,colorPalette:`purple`,children:`Service`})}),(0,Q.jsx)(T,{children:Pe(e)}),(0,Q.jsx)(T,{children:Ne(e)}),(0,Q.jsx)(T,{children:(M||e.userId===a)&&(0,Q.jsxs)(i,{gap:1,children:[(0,Q.jsx)(r,{size:`xs`,variant:`ghost`,"aria-label":`Edit API key ${e.name}`,onClick:()=>fe(e),children:(0,Q.jsx)(ue,{size:14})}),(0,Q.jsx)(r,{size:`xs`,variant:`ghost`,colorPalette:`red`,"aria-label":`Revoke API key ${e.name}`,onClick:()=>q(e.id),children:(0,Q.jsx)(b,{size:14,"aria-hidden":`true`})})]})})]},e.id)),we.length===0&&!je&&Y.kind===`all`&&(0,Q.jsx)(y,{children:(0,Q.jsx)(T,{colSpan:9,children:(0,Q.jsx)(c,{color:`fg.muted`,textAlign:`center`,paddingY:4,children:`No API keys. Create one to get started.`})})}),we.length===0&&!je&&Y.kind!==`all`&&(0,Q.jsx)(y,{children:(0,Q.jsx)(T,{colSpan:9,children:(0,Q.jsx)(c,{color:`fg.muted`,textAlign:`center`,paddingY:4,children:`No keys match the current scope. Change the filter above to see other keys.`})})})]})]})})})]}),(0,Q.jsx)(qe,{keys:X,isAdmin:M,onRevoke:q})]}),(0,Q.jsx)(Ue,{isOpen:R&&!re,isCreating:N.isLoading,myBindings:k,orgProjects:A.data??[],orgTeams:j.data??[],organizationId:e,organizationName:f?.name,currentTeamId:u?.id,currentProjectId:s?.id,onClose:ne,onCreate:Ee}),(0,Q.jsx)(Ge,{apiKey:de,isUpdating:P.isLoading,myBindings:k,orgProjects:A.data??[],orgTeams:j.data??[],organizationId:e,organizationName:f?.name,currentTeamId:u?.id,currentProjectId:s?.id,onClose:()=>fe(null),onSave:De}),(0,Q.jsx)(Ze,{newToken:re,projectId:t,endpoint:m,orgProjects:(A.data??[]).filter(e=>!W||W.keyType===`service`||W.permissionMode!==`restricted`?!0:W.bindings.some(t=>t.scopeId===e.id)),onClose:()=>{U(null),se(null),ne()}}),(0,Q.jsx)(Je,{apiKeyId:K,isRevoking:F.isLoading,onCancel:()=>q(null),onConfirm:Oe}),(0,Q.jsx)(Te,{open:pe,isLoading:I.isLoading,onClose:()=>J(!1),onConfirm:ke})]})}function et(){let{organization:e,project:t}=ce();return e?(0,Q.jsx)(ye,{children:(0,Q.jsxs)(l,{gap:4,width:`full`,maxWidth:`1200px`,align:`stretch`,children:[(0,Q.jsxs)(l,{gap:1,align:`start`,children:[(0,Q.jsx)(s,{size:`lg`,children:`API Keys`}),(0,Q.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:`Manage credentials used to authenticate with the LangWatch API.`})]}),(0,Q.jsx)($e,{organizationId:e.id,projectId:t?.id})]})}):(0,Q.jsx)(ye,{})}export{et as default};
|
|
4
|
+
//# sourceMappingURL=api-keys-CykxAxvG.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{En as e,dn as t,n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i,t as a}from"./v-stack-hkuSkmCA.js";import{xt as o}from"./index-8SbDirJv.js";import{t as s}from"./react-B5vhk-dA.js";var c=`var(--langy-font-serif, "Sentient", "Charter", "Source Serif Pro", Georgia, serif)`,l={radius:`14px`,padding:{base:4,md:5},borderWidth:`1px`,border:`border.muted`,accentBorder:`color-mix(in srgb, var(--chakra-colors-orange-solid) 16%, var(--chakra-colors-border-muted))`,bg:`bg.surface`,accentWash:`radial-gradient(130% 120% at 96% 0%, color-mix(in srgb, var(--chakra-colors-orange-solid) 6%, transparent), transparent 54%)`},u={good:`green.solid`,bad:`red.solid`,attention:`#c98a2f`},d={good:`green.fg`,bad:`red.fg`,attention:`#c98a2f`,neutral:`fg`,muted:`fg.muted`,subtle:`fg.subtle`},f=`orange.fg`,p={eyebrow:{fontFamily:`mono`,fontSize:`11px`,letterSpacing:`0.1em`,textTransform:`uppercase`},sectionLabel:{fontFamily:`mono`,fontSize:`10.5px`,letterSpacing:`0.1em`,textTransform:`uppercase`,color:d.subtle},headline:{fontFamily:c,fontWeight:`400`,fontSize:{base:`16px`,md:`18px`},lineHeight:`1.3`,letterSpacing:`-0.01em`},cardTitle:{fontFamily:c,fontWeight:`500`,fontSize:`18px`,letterSpacing:`-0.01em`},label:{fontFamily:`mono`,fontSize:`11.5px`,letterSpacing:`0.02em`},body:{fontSize:`12.5px`,lineHeight:`1.4`},mono:{fontFamily:`mono`,fontSize:`12px`},value:{fontFamily:`mono`,fontVariantNumeric:`tabular-nums`,letterSpacing:`-0.02em`,lineHeight:`1`}},m={activity:{weight:1,inline:!0,padding:{x:`0`,y:`0`},surface:`transparent`,border:`transparent`,radius:`0`,accent:!1,panelMaterial:!1,dot:d.muted,titleWeight:`500`,serifTitle:!1},progress:{weight:2,inline:!1,padding:{x:`13px`,y:`10px`},surface:`bg.subtle`,border:l.border,radius:`langyCard`,accent:!1,panelMaterial:!1,dot:u.attention,titleWeight:`600`,serifTitle:!1},change:{weight:3,inline:!1,padding:{x:`15px`,y:`12px`},surface:`bg.subtle`,border:l.border,radius:`langyCard`,accent:!1,panelMaterial:!1,dot:u.good,titleWeight:`640`,serifTitle:!1},ask:{weight:4,inline:!1,padding:{x:`15px`,y:`14px`},surface:`bg.subtle`,border:l.accentBorder,radius:`langyCard`,accent:!0,panelMaterial:!1,dot:u.attention,titleWeight:`640`,serifTitle:!1},spotlight:{weight:5,inline:!1,padding:{x:`18px`,y:`16px`},surface:`bg.surface`,border:l.accentBorder,radius:`langyCard`,accent:!0,panelMaterial:!0,dot:u.attention,titleWeight:`500`,serifTitle:!0}},h=r(),g=s.create(t);function _({children:e,accent:n=!1,fill:r=!1,...i}){let a=o(),s=r?{flex:`1`,minHeight:0,display:`flex`,flexDirection:`column`}:{};return(0,h.jsx)(t,{className:`langy-root`,width:`full`,...s,children:(0,h.jsxs)(t,{position:`relative`,overflow:`hidden`,borderRadius:l.radius,borderWidth:l.borderWidth,borderColor:l.border,background:l.bg,...s,...i,children:[(0,h.jsx)(t,{className:`langy-signal-grid`,"aria-hidden":!0}),(0,h.jsx)(t,{className:`langy-panel-glow`,"aria-hidden":!0}),n?(0,h.jsx)(g,{className:`langy-accent-wash langy-panel-accent-ring`,"aria-hidden":!0,position:`absolute`,inset:`0`,pointerEvents:`none`,borderRadius:`inherit`,initial:!1,animate:a?{opacity:.55}:{opacity:[.4,.72,.4]},transition:a?{duration:0}:{duration:7,repeat:1/0,ease:`easeInOut`}}):null,(0,h.jsx)(t,{position:`relative`,zIndex:1,...s,children:e})]})})}var v=e`
|
|
2
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
3
|
+
50% { opacity: 0.4; transform: scale(0.72); }
|
|
4
|
+
`;function y({intent:e,overline:r,title:s,dot:l,showDot:u,pulseDot:d=!1,actions:f,children:g,role:y,"aria-label":x}){let S=o(),C=m[e],w=l??C.dot,T=u??(!C.inline&&e!==`spotlight`&&!!r)?(0,h.jsx)(t,{width:`6px`,height:`6px`,borderRadius:`full`,flexShrink:0,background:w,css:d&&!S?{animation:`${v} 1.4s ease-in-out infinite`}:void 0}):null;if(C.inline)return(0,h.jsxs)(n,{gap:2,align:`center`,alignSelf:`flex-start`,role:y??`status`,"aria-label":x,color:`fg.muted`,children:[u??!0?b(w,d,S):null,r?(0,h.jsx)(i,{as:`span`,...p.sectionLabel,color:`fg.subtle`,children:r}):null,typeof s==`string`?(0,h.jsx)(i,{as:`span`,textStyle:`xs`,color:`fg.muted`,children:s}):s,g]});let E=e===`progress`||e===`change`?w:`fg.subtle`,D=(0,h.jsxs)(a,{align:`stretch`,gap:2,children:[r?(0,h.jsxs)(n,{gap:1.5,align:`center`,...p.sectionLabel,color:E,children:[T,(0,h.jsx)(t,{as:`span`,children:r})]}):null,s==null?null:typeof s==`string`?(0,h.jsx)(i,{color:`fg`,lineHeight:`1.3`,fontWeight:C.titleWeight,fontFamily:C.serifTitle?c:void 0,fontSize:C.serifTitle?`18px`:`13px`,letterSpacing:C.serifTitle?`-0.01em`:void 0,children:s}):s,g,f?(0,h.jsx)(t,{children:f}):null]});return C.panelMaterial?(0,h.jsx)(_,{accent:!0,paddingX:C.padding.x,paddingY:C.padding.y,role:y??`group`,"aria-label":x,children:D}):(0,h.jsxs)(t,{className:C.accent?`langy-accent-ring`:void 0,position:`relative`,overflow:`hidden`,borderWidth:`1px`,borderStyle:`solid`,borderColor:C.border,borderRadius:C.radius,background:C.surface,boxShadow:`langyCard`,paddingX:C.padding.x,paddingY:C.padding.y,role:y??`group`,"aria-label":x,children:[C.accent?(0,h.jsx)(t,{className:`langy-accent-wash`,"aria-hidden":!0,position:`absolute`,inset:`0`,borderRadius:`inherit`,pointerEvents:`none`}):null,(0,h.jsx)(t,{position:`relative`,zIndex:1,children:D})]})}function b(e,n,r){return(0,h.jsx)(t,{width:`5px`,height:`5px`,borderRadius:`full`,flexShrink:0,background:e,css:n&&!r?{animation:`${v} 1.4s ease-in-out infinite`}:void 0})}export{c as a,l as i,_ as n,f as r,y as t};
|
|
5
|
+
//# sourceMappingURL=asaplangy-D3J00Q-Z.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,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{c as l,s as u}from"./ProjectAvatar-B0tbfKzY.js";import{t as d}from"./badge-Cpc3eA-C.js";import{$ as f,J as ee,Q as te,X as p,Y as m,Z as ne}from"./Markdown-Cip8Rj5C.js";import{L as re,n as ie}from"./DashboardLayout-Cn5-9Ye2.js";import{a as h,i as g,n as _,r as v,t as y}from"./alert-CPsXih3K.js";import{n as b,r as x,t as ae}from"./native-select-DL2k8x0o.js";import{t as oe}from"./spacer-C38e7o6r.js";import{n as S}from"./api-l6Cnm0vQ.js";import{n as se}from"./log-out-CUZz1cYc.js";import{t as ce}from"./download-pwM6M3AV.js";import{r as le}from"./next-router-CWLrMXvP.js";import{Mr as C,Vt as ue,Yn as de,lt as fe,t as pe}from"./index-8SbDirJv.js";import{t as me}from"./useActivePlan-Dsa3BYxd.js";import{t as w}from"./WithPermissionGuard-Da_hdEdq.js";import{t as he}from"./input-group-D7qfFB6C.js";import{t as T}from"./papaparse.min-cQwnxGCG.js";import{t as E}from"./SettingsLayout-ZI47ZjuT.js";import{t as ge}from"./ContactSalesBlock-B3w2lKdE.js";import{t as _e}from"./NavigationFooter-GfOzirbT.js";var D=e(t()),O=e(T());function k(e,t){let n={};for(let t of e)n[t.label]=(n[t.label]??0)+1;return e.map(e=>({...e,displayLabel:(n[e.label]??0)>1?`${e.label} · ${t(e)}`:e.label}))}var A=a(),j=4096;function M(e){if(e==null)return``;let t=JSON.stringify(e);return t.length<=j?t:`${t.slice(0,j)}…[truncated ${t.length-j} chars]`}function N(){let{organization:e,project:t,organizations:a}=ue(),{isEnterprise:w,isLoading:T}=me(),j=le(),{period:{startDate:N,endDate:P},mode:F}=l(30),I=(e,t)=>{if(!e)return t;let n=Number(e);return isNaN(n)?t:n},L=I(j.query.pageOffset,0),R=I(j.query.pageSize,25),[z,ve]=(0,D.useState)(j.query.userSearch??``),[B,ye]=(0,D.useState)(j.query.actionFilter??``),V=typeof j.query.targetKind==`string`?j.query.targetKind:``,H=typeof j.query.targetId==`string`?j.query.targetId:``,[U,be]=(0,D.useState)(t?.id??null),[xe,W]=(0,D.useState)(!1),G=e?.id??``,K=S.useContext(),{data:Se}=S.organization.getOrganizationWithMembersAndTheirTeams.useQuery({organizationId:G},{enabled:!!e}),q=z?Se?.members.find(e=>{let t=z.toLowerCase(),n=e.user.name?.toLowerCase().includes(t)??!1,r=e.user.email?.toLowerCase().includes(t)??!1;return n||r})?.userId:void 0,{data:J,isLoading:Ce}=S.organization.getAuditLogs.useQuery({organizationId:G,projectId:U??void 0,userId:q,pageOffset:L,pageSize:R,action:B||void 0,startDate:N.getTime(),endDate:P.getTime(),targetKind:V||void 0,targetId:H||void 0},{enabled:!!e&&w});if(!e||T)return(0,A.jsx)(E,{children:(0,A.jsx)(c,{align:`center`,justify:`center`,width:`full`,height:`200px`,children:(0,A.jsx)(n,{})})});if(!w)return(0,A.jsx)(E,{children:(0,A.jsxs)(c,{gap:6,width:`full`,align:`start`,children:[(0,A.jsxs)(g,{status:`info`,children:[(0,A.jsx)(v,{}),(0,A.jsxs)(y,{children:[(0,A.jsx)(h,{children:`Enterprise Feature`}),(0,A.jsx)(_,{children:`Organisation-wide audit logs — including AI Gateway events (virtual-key / budget / provider / cache-rule mutations) alongside logins, member changes, settings, RBAC, and billing — are available on Enterprise plans. Contact sales to upgrade.`})]})]}),(0,A.jsx)(r,{width:`full`,children:(0,A.jsx)(ge,{})})]})});let Y=e=>{j.push({pathname:j.pathname,query:{...j.query,...e,pageOffset:0}})},we=e=>{ve(e),Y({userSearch:e})},Te=e=>{ye(e),Y({actionFilter:e})},Ee=e=>{be(e),Y({projectId:e??``})},X=()=>{let e=L+R;j.push({pathname:j.pathname,query:{...j.query,pageOffset:e.toString()}})},De=()=>{if(L>0){let e=L-R;j.push({pathname:j.pathname,query:{...j.query,pageOffset:e.toString()}})}},Oe=e=>{j.push({pathname:j.pathname,query:{...j.query,pageSize:e.toString(),pageOffset:`0`}})},Z=J?.totalCount??0,Q=J?.auditLogs??[],ke=async()=>{if(e){W(!0);try{let t=[],n=0,r=5e3,i=0,a={organizationId:e.id,projectId:U??void 0,userId:q,action:B||void 0,startDate:N.getTime(),endDate:P.getTime(),targetKind:V||void 0,targetId:H||void 0},o=await K.organization.getAuditLogs.fetch({...a,pageOffset:0,pageSize:r});for(t.push(...o.auditLogs??[]),i=o.totalCount,n=r;n<i;){let e=await K.organization.getAuditLogs.fetch({...a,pageOffset:n,pageSize:r});if(!e.auditLogs||e.auditLogs.length===0)break;t.push(...e.auditLogs),n+=r}let s=[`Timestamp`,`Source`,`User Name`,`User Email`,`Action`,`Target Kind`,`Target Id`,`Project`,`IP Address`,`User Agent`,`Error`,`Args`,`Before`,`After`],c=t.map(e=>[new Date(e.createdAt).toISOString(),e.source??`platform`,e.user?.name??``,e.user?.email??``,e.action,e.targetKind??``,e.targetId??``,e.project?.name??e.projectId??``,e.ipAddress??``,e.userAgent??``,e.error??``,M(e.args),M(e.before),M(e.after)]),l=O.default.unparse({fields:s,data:c}),u=window.URL.createObjectURL(new Blob([l])),d=document.createElement(`a`);d.href=u;let f=`audit_logs_${new Date().toISOString().split(`T`)[0]}.csv`;d.setAttribute(`download`,f),document.body.appendChild(d),d.click(),d.remove(),window.URL.revokeObjectURL(u)}catch(e){console.error(`Failed to export audit logs:`,e)}finally{W(!1)}}},Ae=()=>{let{targetKind:e,targetId:t,...n}=j.query;j.replace({pathname:j.pathname,query:n})},$=(()=>{if(!V||!H||!t?.slug)return null;let e={virtual_key:{path:`gateway/virtual-keys`,label:`Virtual key`},budget:{path:`gateway/budgets`,label:`Budget`}}[V];return e?{href:`/${t.slug}/${e.path}/${H}`,label:e.label}:null})();return(0,A.jsx)(E,{children:(0,A.jsxs)(c,{gap:6,width:`full`,align:`start`,children:[(0,A.jsxs)(i,{width:`full`,marginTop:2,children:[(0,A.jsxs)(c,{align:`start`,gap:1,children:[$&&(0,A.jsx)(pe,{href:$.href,color:`fg.muted`,fontSize:`sm`,children:(0,A.jsxs)(i,{gap:1,children:[(0,A.jsx)(se,{size:14}),` `,$.label]})}),(0,A.jsx)(o,{as:`h2`,children:`Audit Log`}),(0,A.jsx)(s,{color:`fg.muted`,children:`View all audit logs for your organization. Filter by project, user, action type, or date range.`}),V&&H&&(0,A.jsxs)(d,{colorPalette:`orange`,variant:`surface`,gap:1,cursor:`pointer`,onClick:Ae,title:`Clear target filter`,children:[V,` = `,H.slice(0,24),`… ×`]})]}),(0,A.jsx)(oe,{}),a&&t&&(0,A.jsx)(ie,{organizations:a,project:t})]}),(0,A.jsxs)(i,{gap:4,width:`full`,flexWrap:`wrap`,align:`end`,children:[(0,A.jsxs)(c,{align:`start`,gap:1,flex:`1`,minWidth:`200px`,maxWidth:`300px`,children:[(0,A.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,color:`fg.muted`,children:`Search by User`}),(0,A.jsx)(he,{startElement:(0,A.jsx)(de,{size:16}),width:`full`,children:(0,A.jsx)(C,{placeholder:`Search by name or email...`,value:z,onChange:e=>we(e.target.value),width:`full`})})]}),(0,A.jsxs)(c,{align:`start`,gap:1,flex:`1`,minWidth:`200px`,maxWidth:`300px`,children:[(0,A.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,color:`fg.muted`,children:`Filter by Action`}),(0,A.jsx)(C,{placeholder:`Filter by action type...`,value:B,onChange:e=>Te(e.target.value),width:`full`})]}),(0,A.jsxs)(c,{align:`start`,gap:1,flex:`1`,minWidth:`150px`,maxWidth:`200px`,children:[(0,A.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,color:`fg.muted`,children:`Project`}),(0,A.jsxs)(x,{size:`sm`,width:`full`,children:[(0,A.jsxs)(ae,{value:U??`all`,onChange:e=>Ee(e.target.value===`all`?null:e.target.value),children:[(0,A.jsx)(`option`,{value:`all`,children:`All Projects`}),k(e.teams.flatMap(e=>e.projects.map(t=>({id:t.id,label:t.name,teamName:e.name}))),e=>e.teamName).map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.displayLabel},e.id))]}),(0,A.jsx)(b,{})]})]}),(0,A.jsxs)(c,{align:`start`,gap:1,flex:`1`,minWidth:`200px`,maxWidth:`300px`,children:[(0,A.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,color:`fg.muted`,children:`Select Date`}),(0,A.jsx)(u,{period:{startDate:N,endDate:P},mode:F,setPeriod:(e,t)=>{let{period:n,...r}=j.query;j.push({pathname:j.pathname,query:{...r,startDate:e.toISOString(),endDate:t.toISOString(),pageOffset:0}})},setRelativePeriod:e=>{let{startDate:t,endDate:n,...r}=j.query;j.push({pathname:j.pathname,query:{...r,period:e,pageOffset:0}})}})]}),(0,A.jsxs)(re.HeaderButton,{onClick:()=>void ke(),disabled:xe,children:[(0,A.jsx)(ce,{}),`Export CSV`]})]}),Ce?(0,A.jsxs)(c,{padding:8,children:[(0,A.jsx)(n,{}),(0,A.jsx)(s,{children:`Loading audit logs...`})]}):Q.length===0?(0,A.jsx)(c,{padding:8,children:(0,A.jsx)(s,{color:`fg.muted`,children:`No audit logs found`})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(r,{width:`full`,overflowX:`auto`,children:(0,A.jsxs)(te,{variant:`line`,width:`full`,children:[(0,A.jsx)(ne,{children:(0,A.jsxs)(f,{children:[(0,A.jsx)(p,{children:`Timestamp`}),(0,A.jsx)(p,{children:`Source`}),(0,A.jsx)(p,{children:`User`}),(0,A.jsx)(p,{children:`Action`}),(0,A.jsx)(p,{children:`Target`}),(0,A.jsx)(p,{children:`Project`}),(0,A.jsx)(p,{children:`IP Address`}),(0,A.jsx)(p,{children:`Error`})]})}),(0,A.jsx)(ee,{children:Q.map(t=>(0,A.jsxs)(f,{children:[(0,A.jsx)(m,{children:(0,A.jsxs)(c,{align:`start`,gap:0,children:[(0,A.jsx)(s,{fontSize:`sm`,children:new Date(t.createdAt).toLocaleString()}),(0,A.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:fe(new Date(t.createdAt),{addSuffix:!0})})]})}),(0,A.jsx)(m,{children:(0,A.jsx)(d,{size:`sm`,variant:`subtle`,colorPalette:t.source===`gateway`?`purple`:`gray`,children:t.source===`gateway`?`Gateway`:`Platform`})}),(0,A.jsx)(m,{children:t.user?(0,A.jsxs)(c,{align:`start`,gap:0,children:[(0,A.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:t.user.name??`Unknown`}),(0,A.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:t.user.email})]}):(0,A.jsx)(s,{fontSize:`sm`,color:`fg.subtle`,children:`User not found`})}),(0,A.jsx)(m,{children:(0,A.jsx)(s,{fontSize:`sm`,fontFamily:`mono`,children:t.action})}),(0,A.jsx)(m,{children:t.targetKind&&t.targetId?(0,A.jsxs)(c,{align:`start`,gap:0,children:[(0,A.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:t.targetKind}),(0,A.jsxs)(s,{fontSize:`xs`,fontFamily:`mono`,children:[t.targetId.slice(0,16),`…`]})]}):(0,A.jsx)(s,{fontSize:`sm`,color:`fg.subtle`,children:`—`})}),(0,A.jsx)(m,{children:t.projectId?(0,A.jsx)(s,{fontSize:`sm`,children:e.teams.flatMap(e=>e.projects).find(e=>e.id===t.projectId)?.name??t.projectId}):(0,A.jsx)(s,{fontSize:`sm`,color:`fg.subtle`,children:`—`})}),(0,A.jsx)(m,{children:t.ipAddress?(0,A.jsx)(s,{fontSize:`sm`,fontFamily:`mono`,children:t.ipAddress}):(0,A.jsx)(s,{fontSize:`sm`,color:`fg.subtle`,children:`—`})}),(0,A.jsx)(m,{children:t.error?(0,A.jsx)(s,{fontSize:`sm`,color:`red.600`,children:t.error}):(0,A.jsx)(s,{fontSize:`sm`,color:`fg.subtle`,children:`—`})})]},t.id))})]})}),Z>0&&(0,A.jsx)(_e,{totalHits:Z,pageOffset:L,pageSize:R,nextPage:X,prevPage:De,changePageSize:Oe})]})]})})}var P=w(`organization:manage`,{layoutComponent:E})(N);export{P as default};
|
|
2
|
+
//# sourceMappingURL=audit-log-Dy4vcEeJ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a,r as o}from"./portal-Sdfvrza9.js";import{t as s}from"./jsx-runtime-CFwixLRt.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{c as u,i as d,l as f,u as p}from"./toaster-BsYkODqs.js";import{t as m}from"./icon-D6xQEiPb.js";import{t as h}from"./personalProject-C9vU_vdl.js";import{n as g}from"./api-l6Cnm0vQ.js";import{t as _}from"./ScopeChipPicker-pQ061i-c.js";import{t as v}from"./clock-3-DGCPNUUL.js";import{c as y}from"./auth-client-MjRW2PVA.js";import{r as b}from"./next-router-CWLrMXvP.js";import{Qn as x,Vt as S,d as C}from"./index-8SbDirJv.js";import{t as ee}from"./next-head-B6Im7q_p.js";import{CreateProjectDrawer as w}from"./CreateProjectDrawer-Dg_yrbka.js";import{t as T}from"./OnboardingContainer-BGhio01s.js";var E=e(t()),D=`Personal`;function O(e,t){for(let n of e){let e=(n.projects??[]).find(e=>e.isPersonal&&e.ownerUserId===t&&e.kind!==`internal_governance`);if(e)return{id:e.id,name:e.name,slug:e.slug,teamId:n.id,teamName:D}}return null}function k(e){let t=e.lastProjectSlug?e.projects.find(t=>t.slug===e.lastProjectSlug):void 0;return t?t.id:e.projects.length===1?e.projects[0].id:e.projects.length===0?e.personalProject?.id??null:null}function A(e){let t=(e.teams??[]).flatMap(e=>(e.projects??[]).filter(e=>!e.isPersonal&&e.kind!==`internal_governance`).map(t=>({id:t.id,name:t.name,slug:t.slug,teamId:e.id,teamName:e.name}))),n=e.currentUserId?O(e.teams??[],e.currentUserId):null,r=new Set(t.map(e=>e.teamId)),i=(e.teams??[]).filter(e=>r.has(e.id)).map(e=>({id:e.id,name:e.name}));return n&&i.push({id:n.teamId,name:D}),{projects:t,teams:i,personalProject:n,defaultProjectId:k({projects:t,lastProjectSlug:e.lastProjectSlug,personalProject:n})}}var j=s(),M=3e3,N=10*6e4,P=1200;function F({hasProject:e,hasResult:t,isRedirecting:n,isTimedOut:r,hasPriorTraces:i,hasSeenNeverSynced:a}){let o=e&&!n&&!r&&!i;return{enabled:o,refetchInterval:o&&(a||!t)?M:!1}}function I({firstMessage:e,hasSeenNeverSynced:t,isTimedOut:n}){return e===void 0?`none`:e?t?n?`none`:`redirect`:`mark-prior-traces`:t?`none`:`confirm-never-synced`}function L(){let e=b(),{data:t}=y(),{organizations:n}=S({redirectToOnboarding:!1}),r=(0,E.useMemo)(()=>h({organizations:n,userId:t?.user?.id}),[n,t?.user?.id]),[i,a]=(0,E.useState)(!1),[o,s]=(0,E.useState)(!1),[c,l]=(0,E.useState)(!1),[u,d]=(0,E.useState)(!1),[f,p]=(0,E.useState)(!1);(0,E.useEffect)(()=>{let e=setTimeout(()=>s(!0),N);return()=>clearTimeout(e)},[]);let m=F({hasProject:!!r?.id,hasResult:i,isRedirecting:f,isTimedOut:o,hasPriorTraces:u,hasSeenNeverSynced:c}),_=g.project.getHasFirstMessage.useQuery({projectId:r?.id??``},{enabled:m.enabled,refetchInterval:m.refetchInterval,refetchOnWindowFocus:!1});return(0,E.useEffect)(()=>{let e=_.data?.firstMessage;e!==void 0&&!i&&a(!0);let t=I({firstMessage:e,hasSeenNeverSynced:c,isTimedOut:o});t===`confirm-never-synced`&&l(!0),t===`mark-prior-traces`&&d(!0),t===`redirect`&&!f&&p(!0)},[_.data,i,c,f,o]),(0,E.useEffect)(()=>{if(!f||!r?.slug)return;let t=r.slug,n=setTimeout(()=>{e.push(`/${t}/traces`)},P);return()=>clearTimeout(n)},[f,r?.slug,e]),!r||u||o?`hidden`:f?`redirecting`:c?`waiting`:`hidden`}function R(){let e=L();return e===`redirecting`?(0,j.jsxs)(a,{gap:2,role:`status`,"aria-live":`polite`,children:[(0,j.jsx)(m,{as:f,boxSize:4,color:`green.fg`}),(0,j.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`First trace received. Taking you there now.`})]}):e===`waiting`?(0,j.jsxs)(a,{gap:2,role:`status`,"aria-live":`polite`,children:[(0,j.jsx)(n,{size:`sm`,color:`orange.400`}),(0,j.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`Waiting for your first trace. We will take you there when it arrives.`})]}):null}function z({palette:e,icon:t,title:n,children:i}){return(0,j.jsx)(r,{role:e===`red`||e===`orange`?`alert`:`status`,borderWidth:`1px`,borderColor:`${e}.muted`,borderRadius:`lg`,bg:`${e}.subtle`,paddingX:5,paddingY:4,children:(0,j.jsxs)(a,{align:`flex-start`,gap:3,children:[(0,j.jsx)(m,{as:t,boxSize:5,color:`${e}.fg`,flexShrink:0,marginTop:.5}),(0,j.jsxs)(l,{align:`stretch`,gap:1,flex:1,children:[(0,j.jsx)(c,{textStyle:`sm`,fontWeight:`semibold`,color:`fg`,lineHeight:`snug`,children:n}),(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,lineHeight:`tall`,children:i})]})]})})}function B(){let e=b(),{data:t,status:s}=y(),{organizations:h,project:g}=S({redirectToOnboarding:!1}),D=e.query.user_code,O=typeof D==`string`?D:Array.isArray(D)?D[0]??``:``,[k,M]=(0,E.useState)({kind:`loading`}),[N,P]=(0,E.useState)({kind:`idle`}),[F,I]=(0,E.useState)(null),[L,B]=(0,E.useState)(null);(0,E.useEffect)(()=>{h&&h.length>0&&!F&&I(h[0].id)},[h,F]),(0,E.useEffect)(()=>{C(`leadSource`,`cli`)},[]),(0,E.useEffect)(()=>{if(!(!t||!h)&&h.length===0&&O){let t=encodeURIComponent(`/cli/auth?user_code=${encodeURIComponent(O)}`);e.replace(`/onboarding/welcome?return_to=${t}`)}},[t,h,O,e]);let H=g?.slug??null,U=t?.user?.id??null,{projects:W,teams:te,personalProject:G,defaultProjectId:K}=(0,E.useMemo)(()=>{let e=h?.find(e=>e.id===F);return A({teams:e?.teams,lastProjectSlug:H,currentUserId:U})},[h,F,H,U]),q=(0,E.useMemo)(()=>[...W,...G?[G]:[]],[W,G]);(0,E.useEffect)(()=>{B(null)},[F]),(0,E.useEffect)(()=>{K&&!L&&B(K)},[K,L]);let[ne,J]=(0,E.useState)(!1),[Y,X]=(0,E.useState)(null);(0,E.useEffect)(()=>{if(!Y)return;let e=W.find(e=>e.slug===Y);e&&(B(e.id),X(null))},[Y,W]),(0,E.useEffect)(()=>{if(s!==`loading`&&!t&&O){let t=`/cli/auth?user_code=${encodeURIComponent(O)}`;e.replace(`/auth/signin?callbackUrl=${encodeURIComponent(t)}`)}},[t,s,O,e]),(0,E.useEffect)(()=>{if(!t||!O)return;let e=!1;return(async()=>{try{let t=await fetch(`/api/auth/cli/lookup?user_code=${encodeURIComponent(O)}`);if(e)return;if(t.status===410){M({kind:`expired`});return}if(t.status===404){M({kind:`error`,message:`Code "${O}" was not recognised. It may have expired or already been used.`});return}if(!t.ok){M({kind:`error`,message:(await t.json().catch(()=>({}))).error_description??`Lookup failed (${t.status})`});return}let n=await t.json(),r=n.credential_type===`project_api_key`||n.credential_type===`device_session`?n.credential_type:`device_session`;M({kind:`ready`,userCode:n.user_code,status:n.status,expiresAt:n.expires_at,credentialType:r})}catch(t){if(e)return;M({kind:`error`,message:t instanceof Error?t.message:`Network error`})}})(),()=>{e=!0}},[t,O]);let Z=k.kind===`ready`?k.credentialType:`device_session`,Q=Z===`project_api_key`,re=async()=>{if(!(!F||!O)&&!(Q&&!L)){P({kind:`submitting`});try{let e=await fetch(`/api/auth/cli/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({user_code:O,organization_id:F,...Q&&L?{project_id:L}:{}})}),t=await e.json().catch(()=>({}));if(!e.ok){P({kind:`error`,message:t.message??t.error_description??`Approval failed (${e.status})`});return}let n=h?.find(e=>e.id===F)?.name??`your organization`,r=Q?q.find(e=>e.id===L)?.name:void 0;P({kind:`success`,vkLabel:t.personal_vk_label??`default`,organizationName:n,credentialType:Z,projectName:r})}catch(e){P({kind:`error`,message:e instanceof Error?e.message:`Network error`})}}},ie=async()=>{if(O){P({kind:`submitting`});try{await fetch(`/api/auth/cli/deny`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({user_code:O})}),P({kind:`denied`})}catch{P({kind:`denied`})}}},$=(0,E.useMemo)(()=>{if(k.kind!==`ready`)return null;let e=Math.max(0,Math.round((k.expiresAt-Date.now())/1e3)),t=Math.floor(e/60);return t>0?`Expires in ~${t} min`:`Expires in ${e}s`},[k]);return s===`loading`||!t&&O?(0,j.jsx)(V,{}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ee,{children:(0,j.jsx)(`title`,{children:`Authorize CLI · LangWatch`})}),(0,j.jsxs)(T,{title:Q?`Generate an SDK key`:`Authorize the LangWatch CLI`,subTitle:Q?`The CLI is requesting a project SDK API key`:`Signs in this device for AI-tool wrappers and governance commands`,showBackButton:!1,isLogoInside:!0,children:[(0,j.jsxs)(l,{align:`stretch`,gap:6,children:[!O&&(0,j.jsxs)(z,{palette:`orange`,icon:p,title:`No code provided`,children:[`Run `,(0,j.jsx)(`code`,{children:`langwatch login`}),` in your terminal, it will print a link with your code embedded.`]}),O&&k.kind===`loading`&&(0,j.jsxs)(a,{children:[(0,j.jsx)(n,{size:`sm`}),(0,j.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`Looking up code…`})]}),k.kind===`expired`&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)(z,{palette:`orange`,icon:v,title:`Code expired`,children:[`Restart `,(0,j.jsx)(`code`,{children:`langwatch login`}),` in your terminal to get a new code.`]})}),k.kind===`error`&&(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(z,{palette:`red`,icon:u,title:`Something went wrong`,children:k.message})}),k.kind===`ready`&&N.kind!==`success`&&N.kind!==`denied`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c,{textStyle:`sm`,color:`fg.muted`,lineHeight:`tall`,children:Q?`Pick the project to mint a key for; the key will flow back to your terminal automatically, with no copy-paste.`:`Approving signs in this device for AI-tool wrappers (Claude, Codex, etc.) and governance commands.`}),(0,j.jsx)(r,{bg:`bg.subtle`,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`lg`,p:4,fontFamily:`mono`,fontSize:`2xl`,fontWeight:`bold`,textAlign:`center`,letterSpacing:`0.2em`,color:`fg`,children:k.userCode}),(0,j.jsxs)(c,{textStyle:`xs`,color:`fg.muted`,textAlign:`center`,children:[`Confirm this matches the code shown in your terminal.`,$?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`br`,{}),$,`.`]}):null]}),h&&h.length>1&&(0,j.jsxs)(r,{children:[(0,j.jsx)(c,{textStyle:`sm`,fontWeight:`semibold`,color:`fg`,mb:2,children:`Organization`}),(0,j.jsx)(l,{align:`stretch`,gap:2,children:h.map(e=>(0,j.jsx)(i,{size:`sm`,colorPalette:F===e.id?`orange`:`gray`,variant:F===e.id?`surface`:`outline`,onClick:()=>I(e.id),justifyContent:`flex-start`,children:e.name},e.id))})]}),Q&&(0,j.jsxs)(r,{children:[(0,j.jsxs)(a,{mb:2,justify:`space-between`,align:`center`,children:[(0,j.jsx)(c,{textStyle:`sm`,fontWeight:`semibold`,color:`fg`,children:`Project`}),(0,j.jsxs)(i,{size:`xs`,variant:`ghost`,color:`fg.muted`,onClick:()=>J(!0),children:[(0,j.jsx)(m,{as:x,boxSize:3.5}),`Create project`]})]}),q.length===0?(0,j.jsx)(z,{palette:`orange`,icon:p,title:`No projects yet`,children:`Create a project in this organization first, then pick it here; the key flows back to your terminal automatically.`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{variant:`single-select`,label:``,placeholder:`None selected`,allowedScopeTypes:[`PROJECT`],organizationId:F??void 0,availableProjects:q,availableTeams:te,value:L?[{scopeType:`PROJECT`,scopeId:L}]:[],onChange:e=>B(e[0]?.scopeId??null),showSummary:!1}),W.length===0&&G&&L===G.id&&(0,j.jsx)(c,{textStyle:`xs`,color:`fg.muted`,mt:1.5,children:`No shared projects in this organization yet, so your personal project is preselected. Only you can read what lands there.`})]})]}),N.kind===`error`&&(0,j.jsx)(z,{palette:`red`,icon:u,title:`Approval failed`,children:N.message}),(0,j.jsxs)(o,{direction:{base:`column`,sm:`row`},gap:3,children:[(0,j.jsx)(i,{colorPalette:`orange`,flex:1,onClick:re,loading:N.kind===`submitting`,disabled:!F||Q&&!L,children:Q?`Generate API key`:`Approve`}),(0,j.jsx)(i,{variant:`outline`,color:`fg.muted`,borderColor:`border.emphasized`,onClick:ie,loading:N.kind===`submitting`,children:`Deny`})]})]}),N.kind===`success`&&(0,j.jsx)(j.Fragment,{children:N.credentialType===`project_api_key`?(0,j.jsxs)(z,{palette:`green`,icon:f,title:`API key generated!`,children:[`A fresh project API key has been minted for`,` `,(0,j.jsx)(`strong`,{children:N.projectName??`your project`}),` (`,N.organizationName,`). The key flowed back to your terminal automatically, and your `,(0,j.jsx)(`code`,{children:`.env`}),` is updated. You can close this tab.`]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(z,{palette:`green`,icon:f,title:`You're signed in!`,children:[`LangWatch CLI is now authorized for`,` `,(0,j.jsx)(`strong`,{children:N.organizationName}),` using the`,` `,(0,j.jsx)(`code`,{children:N.vkLabel}),` personal key. You can close this tab and return to your terminal.`]}),(0,j.jsx)(R,{})]})}),N.kind===`denied`&&(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(z,{palette:`blue`,icon:d,title:`Authorization denied`,children:`The CLI session has been rejected. You can close this tab.`})})]}),ne&&(0,j.jsx)(w,{open:!0,onClose:()=>J(!1),organizationId:F??void 0,onCreated:e=>{X(e.projectSlug),J(!1)}})]})]})}function V(){return(0,j.jsx)(T,{title:`Authorize the LangWatch CLI`,loading:!0,isLogoInside:!0,children:null})}export{B as default};
|
|
2
|
+
//# sourceMappingURL=auth-IqMSC5k1.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a,r as o}from"./portal-Sdfvrza9.js";import{t as s}from"./jsx-runtime-CFwixLRt.js";import{t as c}from"./heading-C0sACr0w.js";import{n as l,t as u}from"./v-stack-hkuSkmCA.js";import{t as d}from"./badge-Cpc3eA-C.js";import{a as f,c as p,f as m,n as h}from"./toaster-BsYkODqs.js";import{tt as g}from"./Markdown-Cip8Rj5C.js";import{a as _,r as v,t as y}from"./field-BadoNaN5.js";import{t as b}from"./icon-button-Wlb_dGXL.js";import{l as x,t as S,u as C}from"./errors-mlatPkMI.js";import{t as w}from"./spacer-C38e7o6r.js";import{Y as T}from"./immer-DImI3Uq2.js";import{n as E}from"./api-l6Cnm0vQ.js";import{t as D}from"./file-clock-BzjyK-8R.js";import{t as O}from"./usePublicEnv-ue4-Igop.js";import{c as k,i as A}from"./auth-client-MjRW2PVA.js";import{Mn as j,ht as M}from"./lu-BSZWBZXU.js";import{s as N}from"./index.esm-Cpy5fWo1.js";import{An as P,En as F,Mr as I,St as L,Un as R,Vt as z}from"./index-8SbDirJv.js";import{t as B}from"./useActivePlan-Dsa3BYxd.js";import{t as V}from"./zod-BDLLToBM.js";import{i as H}from"./stringCasing-Cx6SsTTf.js";import{t as U}from"./SettingsLayout-ZI47ZjuT.js";var W=e(t()),G=s(),K=F({currentPassword:P().min(1,`Current password is required`),newPassword:P().min(8,`Password must be at least 8 characters`),confirmPassword:P().min(8,`Password must be at least 8 characters`)}).refine(e=>e.newPassword===e.confirmPassword,{message:`Passwords don't match`,path:[`confirmPassword`]});function q({open:e,onClose:t}){let n=E.user.changePassword.useMutation(),r=N({resolver:V(K),defaultValues:{currentPassword:``,newPassword:``,confirmPassword:``}});return(0,W.useEffect)(()=>{e&&r.reset({currentPassword:``,newPassword:``,confirmPassword:``})},[e,r]),(0,G.jsx)(L.Root,{open:e,onOpenChange:e=>{e.open||t()},placement:`center`,children:(0,G.jsxs)(L.Content,{bg:`bg`,children:[(0,G.jsx)(L.CloseTrigger,{}),(0,G.jsx)(L.Header,{children:(0,G.jsx)(L.Title,{fontSize:`md`,fontWeight:`500`,children:`Change Password`})}),(0,G.jsxs)(`form`,{onSubmit:r.handleSubmit(async e=>{try{await n.mutateAsync({currentPassword:e.currentPassword,newPassword:e.newPassword}),h.create({title:`Password changed successfully`,type:`success`,meta:{closable:!0}}),t()}catch(e){if(C({error:e,form:r,hasFormErrorSlot:!0}))return;S({error:e,fallbackTitle:`Couldn't change your password`})}}),children:[(0,G.jsx)(L.Body,{children:(0,G.jsxs)(o,{gap:4,children:[(0,G.jsx)(x,{form:r}),(0,G.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:`Password must be at least 8 characters long.`}),(0,G.jsxs)(_,{invalid:!!r.formState.errors.currentPassword,children:[(0,G.jsx)(v,{children:`Current Password`}),(0,G.jsx)(I,{type:`password`,autoComplete:`current-password`,...r.register(`currentPassword`)}),r.formState.errors.currentPassword&&(0,G.jsx)(y,{children:r.formState.errors.currentPassword.message})]}),(0,G.jsxs)(_,{invalid:!!r.formState.errors.newPassword,children:[(0,G.jsx)(v,{children:`New Password`}),(0,G.jsx)(I,{type:`password`,autoComplete:`new-password`,...r.register(`newPassword`)}),r.formState.errors.newPassword&&(0,G.jsx)(y,{children:r.formState.errors.newPassword.message})]}),(0,G.jsxs)(_,{invalid:!!r.formState.errors.confirmPassword,children:[(0,G.jsx)(v,{children:`Confirm New Password`}),(0,G.jsx)(I,{type:`password`,autoComplete:`new-password`,...r.register(`confirmPassword`)}),r.formState.errors.confirmPassword&&(0,G.jsx)(y,{children:r.formState.errors.confirmPassword.message})]})]})}),(0,G.jsx)(L.Footer,{children:(0,G.jsxs)(a,{gap:3,justify:`end`,width:`full`,children:[(0,G.jsx)(i,{variant:`outline`,onClick:t,disabled:n.isPending,children:`Cancel`}),(0,G.jsx)(i,{type:`submit`,colorPalette:`orange`,disabled:n.isPending,loading:n.isPending,children:`Change Password`})]})})]})]})})}var J=(e,t)=>{if(e===`auth0`){let[e]=t.split(`|`);return{auth0:`Email/Password`,"google-oauth2":`Google`,windowslive:`Microsoft`,github:`GitHub`}[e??``]??H(e??`unknown`)}return H(e)},Y=e=>{if(e.provider===`credential`)return!0;if(e.provider===`auth0`){let[t]=e.providerAccountId.split(`|`);return t===`auth0`}return!1};function X(){let{data:e,isLoading:t}=E.user.getLinkedAccounts.useQuery({}),o=E.user.unlinkAccount.useMutation(),{organization:s}=z(),c=O().data?.NEXTAUTH_PROVIDER,d=E.useContext(),[f,p]=(0,W.useState)(!1),m=!!s?.ssoProvider;if(!c)return(0,G.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:`Sign-in management is unavailable in this environment.`});let g=c===`email`||c===`auth0`,_=c===`email`,v=()=>{c&&(async()=>{let e=await A(c,{callbackUrl:window.location.href});e.error&&h.create({title:`Failed to link sign-in method`,description:e.error,type:`error`,meta:{closable:!0}})})()},y=async e=>{try{await o.mutateAsync({accountId:e}),await d.user.getLinkedAccounts.invalidate(),h.create({title:`Sign-in method removed`,type:`success`,meta:{closable:!0}})}catch(e){S({error:e,fallbackTitle:`Couldn't remove the sign-in method`})}};if(_)return(0,G.jsxs)(a,{width:`full`,children:[(0,G.jsxs)(u,{align:`start`,gap:0,children:[(0,G.jsx)(l,{fontSize:`sm`,children:`Email + password`}),(0,G.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:`Update the password used to sign in to LangWatch.`})]}),(0,G.jsx)(w,{}),(0,G.jsx)(i,{size:`sm`,colorPalette:`orange`,onClick:()=>p(!0),children:`Change Password`}),(0,G.jsx)(q,{open:f,onClose:()=>p(!1)})]});if(t)return(0,G.jsx)(n,{size:`sm`});let x=!m;return(0,G.jsxs)(u,{align:`stretch`,gap:3,children:[m&&(0,G.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:`You sign in via your company's SSO provider. Additional sign-in methods can't be linked.`}),(0,G.jsx)(u,{align:`stretch`,gap:1,children:e?.map(t=>{let n=Y(t),r=!m&&(e?.length??0)>1;return(0,G.jsxs)(a,{width:`full`,gap:2,children:[(0,G.jsx)(M,{}),(0,G.jsx)(l,{fontSize:`sm`,children:J(t.provider,t.providerAccountId)}),(0,G.jsx)(w,{}),n&&g&&(0,G.jsx)(i,{size:`xs`,variant:`ghost`,colorPalette:`orange`,onClick:()=>p(!0),children:`Change Password`}),r&&(0,G.jsx)(b,{"aria-label":`Remove sign-in method`,variant:`ghost`,size:`xs`,onClick:()=>void y(t.id),disabled:o.isLoading,children:(0,G.jsx)(j,{})})]},t.id)})}),x&&(0,G.jsx)(r,{children:(0,G.jsx)(i,{size:`sm`,variant:`outline`,onClick:v,children:`Link another sign-in method`})}),g&&(0,G.jsx)(q,{open:f,onClose:()=>p(!1)})]})}var Z=`https://docs.langwatch.ai`,Q=[{key:`sso`,name:`Single sign-on`,icon:T,description:`Let your team sign in with Okta, Auth0, Azure AD, Google, or another identity provider instead of a password.`,docsPath:`/self-hosting/configuration/sso`},{key:`scim`,name:`SCIM provisioning`,icon:R,description:`Create, update, and deactivate members automatically from your directory, so leavers lose access without a manual step.`,docsPath:`/platform/scim`},{key:`audit-logs`,name:`Audit logs`,icon:D,description:`A record of who changed what, exportable to your SIEM for compliance reviews.`,docsPath:`/ai-governance/audit-log`}];function $({capability:e,isLicensed:t}){let n=e.icon;return(0,G.jsxs)(a,{align:`start`,gap:4,padding:4,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`lg`,width:`full`,children:[(0,G.jsx)(r,{color:`fg.muted`,paddingTop:1,children:(0,G.jsx)(n,{size:20})}),(0,G.jsxs)(u,{align:`start`,gap:1,flex:1,children:[(0,G.jsxs)(a,{gap:2,children:[(0,G.jsx)(l,{fontWeight:`medium`,children:e.name}),t?(0,G.jsx)(d,{colorPalette:`green`,size:`sm`,variant:`surface`,children:`Available`}):(0,G.jsx)(d,{colorPalette:`orange`,size:`sm`,variant:`surface`,children:`Enterprise license`})]}),(0,G.jsx)(l,{color:`fg.muted`,fontSize:`sm`,children:e.description}),(0,G.jsx)(m,{href:`${Z}${e.docsPath}`,target:`_blank`,rel:`noopener noreferrer`,fontSize:`sm`,color:`blue.600`,children:(0,G.jsxs)(a,{gap:1,children:[(0,G.jsx)(l,{children:`Setup guide`}),(0,G.jsx)(f,{size:12})]})})]})]})}function ee(){let e=E.license.getSsoGateStatus.useQuery({},{refetchOnWindowFocus:!1});return!e.data?.configuredProvider||e.data.licensed?null:(0,G.jsx)(r,{borderWidth:`1px`,borderColor:`orange.300`,backgroundColor:`orange.50`,borderRadius:`lg`,padding:4,width:`full`,"data-testid":`sso-unlicensed-notice`,_dark:{backgroundColor:`orange.950`,borderColor:`orange.700`},children:(0,G.jsxs)(a,{align:`start`,gap:3,children:[(0,G.jsx)(r,{color:`orange.600`,paddingTop:.5,children:(0,G.jsx)(p,{size:18})}),(0,G.jsxs)(u,{align:`start`,gap:1,children:[(0,G.jsx)(l,{fontWeight:`medium`,children:`Single sign-on is configured but not licensed on this deployment`}),(0,G.jsxs)(l,{color:`fg.muted`,fontSize:`sm`,children:[`This deployment is set up for`,` `,(0,G.jsx)(`b`,{children:e.data.configuredProvider}),`, so everyone is signing in by email until a license is activated. Activate one and restart the server to switch single sign-on on.`]})]})]})})}function te(){let e=O(),{isEnterprise:t}=B();return e.data?.IS_SAAS===!1?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{}),(0,G.jsxs)(u,{align:`start`,gap:4,width:`full`,"data-testid":`enterprise-capabilities`,children:[(0,G.jsx)(ee,{}),(0,G.jsxs)(u,{align:`start`,gap:1,children:[(0,G.jsx)(c,{as:`h2`,size:`md`,children:`Organization sign-in and governance`}),(0,G.jsx)(l,{color:`fg.muted`,fontSize:`sm`,children:t?`Your license includes these capabilities. Each guide covers how to configure it on your deployment.`:`These run on the deployment you already have, unlocked by an Enterprise license. Everything else in LangWatch, including unlimited members, teams, and projects, stays uncapped without one.`})]}),(0,G.jsx)(u,{align:`start`,gap:3,width:`full`,children:Q.map(e=>(0,G.jsx)($,{capability:e,isLicensed:t},e.key))}),!t&&(0,G.jsxs)(a,{gap:3,children:[(0,G.jsx)(i,{asChild:!0,size:`sm`,colorPalette:`orange`,children:(0,G.jsx)(`a`,{href:`/settings/license`,children:`Activate a license`})}),(0,G.jsx)(i,{asChild:!0,size:`sm`,variant:`outline`,children:(0,G.jsx)(`a`,{href:`${Z}/self-hosting/licensing`,target:`_blank`,rel:`noopener noreferrer`,children:`How licensing works`})})]})]})]}):null}function ne(){let{data:e}=k();return(0,G.jsx)(U,{children:(0,G.jsxs)(u,{gap:6,width:`full`,align:`start`,children:[(0,G.jsxs)(u,{align:`start`,gap:1,children:[(0,G.jsx)(c,{as:`h2`,children:`Sign-in Methods`}),e?.user?.email&&(0,G.jsxs)(l,{color:`fg.muted`,children:[`(`,e.user.email,`)`]})]}),(0,G.jsx)(X,{}),(0,G.jsx)(te,{})]})})}export{ne as default};
|
|
2
|
+
//# sourceMappingURL=authentication-BqVl7Fh-.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{i as n,n as r}from"./portal-Sdfvrza9.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{t as a}from"./heading-C0sACr0w.js";import{n as o,t as s}from"./v-stack-hkuSkmCA.js";import{n as c}from"./toaster-BsYkODqs.js";import{n as l,t as u}from"./DashboardLayout-Cn5-9Ye2.js";import{n as d,r as f,t as p}from"./card-By_Mbslh.js";import{t as m}from"./container-Cxi_AjD-.js";import{t as h}from"./spacer-C38e7o6r.js";import{c as g}from"./auth-client-MjRW2PVA.js";import{r as _}from"./next-router-CWLrMXvP.js";import{Vt as v}from"./index-8SbDirJv.js";var y=e(t()),b=i();function x(){let e=_(),{data:t,status:i}=g(),x={response_type:e.query.response_type??``,client_id:e.query.client_id??``,redirect_uri:e.query.redirect_uri??``,state:e.query.state??``,code_challenge:e.query.code_challenge??``,code_challenge_method:e.query.code_challenge_method??``,scope:e.query.scope??``},{organizations:S,project:C}=v(),[w,T]=(0,y.useState)(!1);if((0,y.useEffect)(()=>{if(i!==`loading`&&!t){let t=new URLSearchParams;for(let[e,n]of Object.entries(x))n&&t.set(e,n);let n=`/mcp/authorize?${t.toString()}`;e.replace(`/auth/signin?callbackUrl=${encodeURIComponent(n)}`)}},[t,i]),i===`loading`||!t)return null;let E=e=>{c.create({title:`Authorization failed`,description:e,type:`error`,meta:{closable:!0}}),T(!1)},D=async()=>{if(C){T(!0);try{let e=await fetch(`/api/mcp/authorize`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectId:C.id,redirect_uri:x.redirect_uri,state:x.state,code_challenge:x.code_challenge,code_challenge_method:x.code_challenge_method,client_id:x.client_id})}),t=await e.json();if(!e.ok){E(t.error??`Unknown error`);return}t.redirect?window.location.href=t.redirect:E(`No redirect URL received from server`)}catch(e){E(e instanceof Error?e.message:`Network error`)}}},O=()=>{if(x.redirect_uri){let t=new URL(x.redirect_uri);if(t.protocol===`javascript:`||t.protocol===`data:`||t.protocol===`vbscript:`){e.push(`/`);return}t.searchParams.set(`error`,`access_denied`),x.state&&t.searchParams.set(`state`,x.state),window.location.href=t.toString()}else e.push(`/`)},k=x.scope||`mcp:tools`;return(0,b.jsx)(u,{children:(0,b.jsx)(m,{maxWidth:`600px`,paddingTop:`200px`,children:(0,b.jsxs)(f,{children:[(0,b.jsx)(d,{children:(0,b.jsxs)(r,{width:`full`,align:`center`,children:[(0,b.jsx)(a,{as:`h1`,size:`md`,children:`Authorize MCP Connection`}),(0,b.jsx)(h,{}),S&&C&&(0,b.jsx)(l,{organizations:S,project:C})]})}),(0,b.jsx)(p,{children:(0,b.jsxs)(s,{align:`start`,gap:6,children:[(0,b.jsx)(o,{children:`Allow this application to access your LangWatch project tools and data?`}),(0,b.jsxs)(o,{fontSize:`sm`,color:`fg.muted`,children:[`Scopes: `,k]}),(0,b.jsxs)(r,{width:`full`,gap:2,children:[(0,b.jsx)(n,{colorScheme:`blue`,onClick:D,disabled:!C||w,loading:w,children:`Allow`}),(0,b.jsx)(n,{variant:`outline`,onClick:O,children:`Deny`})]})]})})]})})})}export{x as default};
|
|
2
|
+
//# sourceMappingURL=authorize-BGMc1Gzv.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./portal-Sdfvrza9.js";import{t}from"./jsx-runtime-CFwixLRt.js";import{t as n}from"./heading-C0sACr0w.js";import{n as r,t as i}from"./v-stack-hkuSkmCA.js";import{n as a,t as o}from"./DashboardLayout-Cn5-9Ye2.js";import{n as s,r as c,t as l}from"./card-By_Mbslh.js";import{t as u}from"./container-Cxi_AjD-.js";import{t as d}from"./spacer-C38e7o6r.js";import{Vt as f}from"./index-8SbDirJv.js";import{t as p}from"./tracking-in5OR8uP.js";import{t as m}from"./CopyInput-Qeb_2bgP.js";var h=t();function g(){let{organizations:t,project:p}=f();return(0,h.jsx)(o,{children:(0,h.jsx)(u,{maxWidth:`600px`,paddingTop:`200px`,children:(0,h.jsxs)(c,{children:[(0,h.jsx)(s,{children:(0,h.jsxs)(e,{width:`full`,align:`center`,children:[(0,h.jsx)(n,{as:`h1`,size:`md`,children:`Authorize`}),(0,h.jsx)(d,{}),t&&p&&(0,h.jsx)(a,{organizations:t,project:p})]})}),(0,h.jsx)(l,{children:(0,h.jsxs)(i,{align:`start`,gap:6,children:[(0,h.jsx)(r,{children:`Copy your LangWatch API key below and paste it into your command line or notebook to authorize it.`}),(0,h.jsx)(_,{})]})})]})})})}function _(){let{project:e}=f();return(0,h.jsx)(m,{value:e?.apiKey??``,label:`API key`,onClick:()=>p(`api_key_copy`,{project_id:e?.id})})}export{_ as APIKeyCopyInput,g as default};
|
|
2
|
+
//# sourceMappingURL=authorize-DhHzBVUd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./automations-BhzNESFp.js";export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{Nn as u,Yn as ee,pn as d}from"./ProjectAvatar-B0tbfKzY.js";import{t as f}from"./badge-Cpc3eA-C.js";import{t as p}from"./tooltip-CM-lMDNU.js";import{c as m,n as h}from"./toaster-BsYkODqs.js";import{$ as g,I as _,J as v,Q as y,X as b,Y as x,Z as S}from"./Markdown-Cip8Rj5C.js";import{L as te,t as C}from"./DashboardLayout-Cn5-9Ye2.js";import{J as w,L as ne,a as re,i as T,n as E,q as D}from"./seriesOptions-B04NlY20.js";import{j as O}from"./immer-DImI3Uq2.js";import{n as k}from"./api-l6Cnm0vQ.js";import{t as A}from"./circle-check-big-D-K-PM08.js";import{r as ie}from"./next-router-CWLrMXvP.js";import{Bn as ae,D as j,Vt as oe,W as se,gr as ce,t as le}from"./index-8SbDirJv.js";import{t as ue}from"./prop-types-DeUPn3oD.js";import{t as M}from"./alert-triangle-svMxxY53.js";import{t as de}from"./calendar-1UGS14fV.js";import{t as fe}from"./database-BBiIYDDI.js";import{t as pe}from"./edit-2-B0IA_tY5.js";import{n as me,t as he}from"./FilterDisplay-BKjP30tt.js";import{t as ge}from"./flag-x5s6thWb.js";import{t as N}from"./help-circle-DKxNhAgT.js";import{t as _e}from"./more-vertical-CnKfgTmQ.js";import{t as ve}from"./plus-10dP8Fmk.js";import{t as ye}from"./trash-BMMK2ibG.js";import{t as be}from"./trending-up-CTX3qy-C.js";import{t as xe}from"./SectionNavigationLayout-DwPBnqYj.js";import{t as Se}from"./WithPermissionGuard-Da_hdEdq.js";import{t as Ce}from"./switch-BZp2DIfW.js";import{n as we}from"./HoverableBigText-BMBnTTnr.js";import{t as P}from"./LangyContextTarget-Dxr919ue.js";var F=e(t()),I=e(ue());function L(){return L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L.apply(this,arguments)}function Te(e,t){if(e==null)return{};var n=R(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function R(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var z=(0,F.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=Te(e,[`color`,`size`]);return F.createElement(`svg`,L({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),F.createElement(`line`,{x1:`12`,y1:`1`,x2:`12`,y2:`23`}),F.createElement(`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`}))});z.propTypes={color:I.default.string,size:I.default.oneOfType([I.default.string,I.default.number])},z.displayName=`DollarSign`;function B(){return B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}function Ee(e,t){if(e==null)return{};var n=De(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function De(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var V=(0,F.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=Ee(e,[`color`,`size`]);return F.createElement(`svg`,B({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),F.createElement(`path`,{d:`M12 20h9`}),F.createElement(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`}))});V.propTypes={color:I.default.string,size:I.default.oneOfType([I.default.string,I.default.number])},V.displayName=`Edit3`;function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H.apply(this,arguments)}function U(e,t){if(e==null)return{};var n=Oe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Oe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var W=(0,F.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=U(e,[`color`,`size`]);return F.createElement(`svg`,H({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),F.createElement(`polyline`,{points:`23 18 13.5 8.5 8.5 13.5 1 6`}),F.createElement(`polyline`,{points:`17 18 23 18 23 12`}))});W.propTypes={color:I.default.string,size:I.default.oneOfType([I.default.string,I.default.number])},W.displayName=`TrendingDown`;function G(){return G=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(this,arguments)}function ke(e,t){if(e==null)return{};var n=Ae(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ae(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var K=(0,F.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=ke(e,[`color`,`size`]);return F.createElement(`svg`,G({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),F.createElement(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`}))});K.propTypes={color:I.default.string,size:I.default.oneOfType([I.default.string,I.default.number])},K.displayName=`Zap`;var q=o(),je=JSON.stringify({"traces.error":[`true`]}),Me={alert:[{title:`Error spike`,description:`Notify Slack when errors exceed a threshold.`,icon:M,prefill:{initialSource:`customGraph`,initialName:`Error spike alert`,initialAction:`SEND_SLACK_MESSAGE`}},{title:`Traffic drop`,description:`Know when traces stop arriving.`,icon:W,prefill:{initialSource:`customGraph`,initialName:`Traffic drop alert`,initialAction:`SEND_EMAIL`}},{title:`Cost spike`,description:`Watch spend on a cost graph.`,icon:z,prefill:{initialSource:`customGraph`,initialName:`Cost spike alert`,initialAction:`SEND_EMAIL`}}],automation:[{title:`Flag failing evaluations`,description:`Get a Slack message for every failure.`,icon:ge,prefill:{initialName:`Failing evaluations`,initialAction:`SEND_SLACK_MESSAGE`}},{title:`Build a dataset from errors`,description:`Collect errored traces into a dataset.`,icon:fe,prefill:{initialName:`Error dataset`,initialAction:`ADD_TO_DATASET`,initialFilters:je}},{title:`Queue for review`,description:`Send errored traces to your annotators.`,icon:V,prefill:{initialName:`Review queue`,initialAction:`ADD_TO_ANNOTATION_QUEUE`,initialFilters:je}}]};function Ne({useCase:e,onOpen:t}){let n=e.icon;return(0,q.jsxs)(l,{as:`button`,align:`start`,gap:1,padding:3,borderWidth:`1px`,borderColor:`border`,borderRadius:`lg`,bg:`bg.panel`,cursor:`pointer`,textAlign:`left`,_hover:{bg:`bg.muted`,borderColor:`border.emphasized`},onClick:()=>t(e.prefill),children:[(0,q.jsxs)(c,{textStyle:`sm`,fontWeight:`semibold`,display:`inline-flex`,alignItems:`center`,gap:2,children:[(0,q.jsx)(n,{size:14}),e.title]}),(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:e.description})]})}function J({kind:e,onOpen:t,showLabel:n=!0}){return(0,q.jsxs)(l,{align:`stretch`,gap:2,children:[n&&(0,q.jsx)(c,{textStyle:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Popular uses`}),(0,q.jsx)(u,{columns:{base:1,md:3},gap:3,children:Me[e].map(e=>(0,q.jsx)(Ne,{useCase:e,onOpen:t},e.title))})]})}var Pe={fired:{label:`Matched`,icon:ae,palette:`blue`},alertOpened:{label:`Started firing`,icon:m,palette:`red`},alertRecovered:{label:`Recovered`,icon:A,palette:`green`},reportSent:{label:`Sent`,icon:ce,palette:`purple`}};function Y(e){return e.toLocaleDateString(void 0,{year:`numeric`,month:`2-digit`,day:`2-digit`})}function Fe(e){let t=new Date,n=new Date(t.getTime()-1440*60*1e3);return Y(e)===Y(t)?`Today`:Y(e)===Y(n)?`Yesterday`:e.toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}function Ie({fires:e,triggersById:t}){let n=[];for(let r of e){let e=t.get(r.triggerId),i=e?.name??`Deleted automation`,a=r.customGraphId!==null,o=e?.triggerKind===`REPORT`;n.push({id:r.id,triggerId:r.triggerId,name:i,kind:a?`alertOpened`:o?`reportSent`:`fired`,at:new Date(r.createdAt)}),a&&r.resolvedAt&&n.push({id:`${r.id}:resolved`,triggerId:r.triggerId,name:i,kind:`alertRecovered`,at:new Date(r.resolvedAt)})}return n.sort((e,t)=>t.at.getTime()-e.at.getTime())}function Le({fires:e,triggers:t,isLoading:i,onOpenAutomation:o}){let s=(0,F.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),u=(0,F.useMemo)(()=>{let t=Ie({fires:e,triggersById:s}),n=new Map;for(let e of t){let t=Y(e.at),r=n.get(t);r?r.push(e):n.set(t,[e])}return[...n.values()]},[e,s]);return i?(0,q.jsxs)(a,{gap:2,color:`fg.muted`,padding:4,children:[(0,q.jsx)(n,{size:`xs`}),(0,q.jsx)(c,{textStyle:`sm`,children:`Loading activity…`})]}):u.length===0?(0,q.jsx)(r,{borderWidth:`1px`,borderStyle:`dashed`,borderColor:`border`,borderRadius:`lg`,padding:8,textAlign:`center`,children:(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`Nothing has fired yet. When your automations, alerts, and reports run, you'll see what they did here.`})}):(0,q.jsx)(l,{align:`stretch`,gap:6,children:u.map(e=>(0,q.jsxs)(l,{align:`stretch`,gap:0,children:[(0,q.jsx)(c,{textStyle:`xs`,fontWeight:`semibold`,color:`fg.muted`,paddingBottom:2,children:Fe(e[0].at)}),(0,q.jsx)(l,{align:`stretch`,gap:0,borderWidth:`1px`,borderColor:`border.emphasized`,borderRadius:`md`,overflow:`hidden`,separator:(0,q.jsx)(r,{height:`1px`,bg:`border.muted`}),children:e.map(e=>(0,q.jsx)(Re,{entry:e,onOpen:()=>o(e.triggerId)},e.id))})]},Y(e[0].at)))})}function Re({entry:e,onOpen:t}){let n=Pe[e.kind],i=n.icon;return(0,q.jsxs)(a,{gap:3,paddingX:4,paddingY:2.5,cursor:`pointer`,_hover:{bg:`bg.muted`},onClick:t,children:[(0,q.jsx)(r,{color:`${n.palette}.fg`,display:`inline-flex`,flexShrink:0,children:(0,q.jsx)(i,{size:14})}),(0,q.jsx)(c,{textStyle:`sm`,fontWeight:`medium`,flexShrink:0,children:e.name}),(0,q.jsx)(f,{size:`sm`,colorPalette:n.palette,variant:`subtle`,children:n.label}),(0,q.jsx)(r,{flex:`1`}),(0,q.jsx)(c,{textStyle:`xs`,color:`fg.muted`,flexShrink:0,title:e.at.toLocaleString(),children:j(e.at.getTime())})]})}function X({label:e,help:t}){return(0,q.jsxs)(a,{gap:1,children:[(0,q.jsx)(c,{as:`span`,children:e}),(0,q.jsx)(p,{content:t,children:(0,q.jsx)(r,{color:`fg.muted`,display:`inline-flex`,cursor:`help`,children:(0,q.jsx)(N,{size:12})})})]})}function ze({active:e,cadence:t,lastFiredAt:n}){let r=w[t]??0;if(!e||r<=0)return null;let i=n?new Date(n).getTime()+r:null,a=Date.now();return(0,q.jsx)(p,{content:`New matches are bundled into one message on this schedule.`,children:(0,q.jsx)(c,{textStyle:`xs`,color:`fg.muted`,cursor:`help`,children:i&&i>a?`Next digest due in ~${Math.max(1,Math.ceil((i-a)/6e4))}m`:`Digest: ${D[t]?.toLowerCase()??t}`})})}function Be({trigger:e,stats:t}){return(0,q.jsxs)(l,{align:`start`,gap:.5,children:[t?.lastFiredAt?(0,q.jsx)(c,{as:`span`,children:j(new Date(t.lastFiredAt).getTime())}):(0,q.jsx)(c,{as:`span`,color:`fg.muted`,children:`—`}),(0,q.jsx)(ze,{active:e.active,cadence:e.notificationCadence,lastFiredAt:t?.lastFiredAt??null})]})}function Ve({firing:e}){return e?(0,q.jsxs)(a,{gap:1.5,children:[(0,q.jsx)(r,{width:`8px`,height:`8px`,borderRadius:`full`,bg:`red.solid`}),(0,q.jsx)(c,{as:`span`,textStyle:`sm`,color:`red.fg`,children:`Firing`})]}):(0,q.jsx)(c,{as:`span`,textStyle:`sm`,color:`fg.muted`,children:`OK`})}function Z({icon:e,accent:t,title:n,count:o,summary:u,details:ee,addLabel:d,onAdd:m}){return(0,q.jsxs)(a,{width:`full`,align:`center`,gap:3,children:[(0,q.jsx)(r,{colorPalette:t,bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderRadius:`lg`,padding:2,display:`flex`,flexShrink:0,children:e}),(0,q.jsxs)(l,{align:`start`,gap:.5,flex:1,minWidth:0,children:[(0,q.jsxs)(a,{gap:2,align:`center`,children:[(0,q.jsx)(s,{size:`md`,children:n}),(0,q.jsx)(f,{colorPalette:t,variant:`subtle`,borderRadius:`full`,children:o}),(0,q.jsx)(p,{content:ee,children:(0,q.jsx)(r,{color:`fg.muted`,display:`inline-flex`,cursor:`help`,children:(0,q.jsx)(N,{size:13})})})]}),(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:u})]}),(0,q.jsxs)(i,{size:`sm`,variant:`outline`,colorPalette:t,onClick:m,flexShrink:0,children:[(0,q.jsx)(ve,{size:14}),` `,d]})]})}function He({schedule:e,loading:t}){return t?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(x,{children:(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`…`})}),(0,q.jsx)(x,{children:(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`…`})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(x,{whiteSpace:`nowrap`,children:e?.nextRunAt?(0,q.jsx)(p,{content:new Date(e.nextRunAt).toLocaleString(),children:(0,q.jsx)(c,{textStyle:`sm`,cursor:`help`,children:j(new Date(e.nextRunAt).getTime())})}):(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:e?`Paused`:`Not scheduled`})}),(0,q.jsx)(x,{whiteSpace:`nowrap`,children:e?.lastRunAt?(0,q.jsx)(p,{content:new Date(e.lastRunAt).toLocaleString(),children:(0,q.jsx)(c,{textStyle:`sm`,cursor:`help`,children:j(new Date(e.lastRunAt).getTime())})}):(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`Not yet`})})]})}function Q({children:e}){return(0,q.jsx)(r,{border:`1px solid`,borderColor:`border`,borderRadius:`lg`,overflow:`hidden`,bg:`bg.panel`,children:(0,q.jsx)(r,{overflowX:`auto`,css:{"& thead th":{backgroundColor:`var(--chakra-colors-bg-subtle)`,fontSize:`11px`,fontWeight:600,textTransform:`uppercase`,letterSpacing:`0.04em`,color:`var(--chakra-colors-fg-muted)`,whiteSpace:`nowrap`,paddingTop:`0.6rem`,paddingBottom:`0.6rem`,borderBottomColor:`var(--chakra-colors-border)`},"& tbody td":{paddingTop:`0.85rem`,paddingBottom:`0.85rem`,verticalAlign:`middle`,borderColor:`var(--chakra-colors-border-muted)`},"& tbody tr:last-of-type td":{borderBottom:`none`}},children:e})})}function Ue({children:e}){return(0,q.jsx)(r,{border:`1px dashed`,borderColor:`border`,borderRadius:`lg`,padding:6,textAlign:`center`,children:(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:e})})}function We({graphName:e,graph:t,seriesName:n}){let r=n?E(t,n)??n:null;return(0,q.jsxs)(l,{align:`start`,gap:0,children:[e?(0,q.jsx)(c,{textStyle:`sm`,fontWeight:`medium`,lineClamp:1,children:e}):(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`Graph deleted`}),r?(0,q.jsx)(c,{textStyle:`xs`,color:`fg.muted`,lineClamp:1,children:r}):null]})}function Ge({actionParams:e}){let t=e.operator?T[e.operator]:null,n=e.timePeriod?re[e.timePeriod]:null;return!t&&e.threshold===void 0?(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`—`}):(0,q.jsxs)(c,{textStyle:`sm`,children:[t?`${t} `:``,e.threshold===void 0?``:e.threshold,n?` · over ${n}`:``]})}function Ke({actionParams:e,graphNameById:t}){let n=e.source;if(n?.kind===`customGraph`){let e=n.customGraphId?t.get(n.customGraphId):void 0;return(0,q.jsxs)(l,{align:`start`,gap:0,children:[(0,q.jsx)(c,{textStyle:`sm`,fontWeight:`medium`,children:`Custom graph`}),(0,q.jsx)(c,{textStyle:`xs`,color:`fg.muted`,lineClamp:1,children:e??`graph`})]})}return n?.kind===`dashboard`?(0,q.jsx)(c,{textStyle:`sm`,fontWeight:`medium`,children:`Analytics dashboard`}):(0,q.jsxs)(l,{align:`start`,gap:0,children:[(0,q.jsxs)(c,{textStyle:`sm`,fontWeight:`medium`,children:[`Top `,n?.topN??5,` traces`]}),(0,q.jsx)(c,{textStyle:`xs`,color:`fg.muted`,children:`matching your filters`})]})}var qe=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Je(e,t){let n=e.trim().split(/\s+/);if(n.length!==5)return`${e} (${t})`;let[r,i,a,,o]=n,s=`${String(i).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`;return a===`*`&&o!==`*`?`Weekly · ${qe[Number(o)%7]??`day ${o}`} ${s} ${t}`:a===`*`&&o===`*`?`Daily · ${s} ${t}`:a!==`*`&&o===`*`?`Monthly · day ${a} ${s} ${t}`:`${e} (${t})`}var Ye={overview:{title:`Overview`,description:`See what is firing, what is scheduled next, and recent automation activity.`},automations:{title:`Automations`,description:`Act on every incoming trace that matches your filters.`},alerts:{title:`Alerts`,description:`Get told when a metric crosses a threshold and when it recovers.`},schedules:{title:`Schedules`,description:`Send a dashboard, graph, or trace table on a recurring cadence.`}},Xe=e=>e.includes(`/automations/automations`)?`automations`:e.includes(`/automations/alerts`)?`alerts`:e.includes(`/automations/schedules`)?`schedules`:`overview`;function Ze(){let{project:e}=oe(),{openDrawer:t}=se(),n=Xe(ie().pathname),o=Ye[n],s=e?`/${e.slug}/automations`:`/auth/signin`,f=k.automation.getTriggers.useQuery({projectId:e?.id??``},{enabled:!!e?.id}),m=k.automation.getTriggerStats.useQuery({projectId:e?.id??``},{enabled:!!e?.id}),C=(0,F.useMemo)(()=>new Map((m.data??[]).map(e=>[e.triggerId,e])),[m.data]),w=k.automation.getReportSchedules.useQuery({projectId:e?.id??``},{enabled:!!e?.id}),re=(0,F.useMemo)(()=>new Map((w.data??[]).map(e=>[e.triggerId,e])),[w.data]),T=k.automation.getRecentActivity.useQuery({projectId:e?.id??``},{enabled:!!e?.id}),E=(0,F.useMemo)(()=>(f.data??[]).filter(e=>!!e.customGraphId),[f.data]),D=(0,F.useMemo)(()=>(f.data??[]).filter(e=>e.triggerKind===`REPORT`),[f.data]),A=(0,F.useMemo)(()=>(f.data??[]).filter(e=>!e.customGraphId&&e.triggerKind!==`REPORT`),[f.data]),ae=(f.data??[]).some(e=>e.action===`ADD_TO_DATASET`),ce=k.dataset.getAll.useQuery({projectId:e?.id??``},{enabled:!!e?.id&&ae}),ue=(0,F.useMemo)(()=>D.some(e=>e.actionParams?.source?.kind===`customGraph`),[D]),M=k.graphs.getAll.useQuery({projectId:e?.id??``},{enabled:!!e?.id&&(E.length>0||ue),retry:!1}),fe=(0,F.useMemo)(()=>new Map((M.data??[]).map(e=>[e.id,e.graph])),[M.data]),ge=(0,F.useMemo)(()=>new Map((M.data??[]).map(e=>[e.id,e.name??`graph`])),[M.data]),N=k.automation.toggleTrigger.useMutation(),ve=k.automation.deleteById.useMutation(),Se=(t,n)=>{N.mutate({triggerId:t,active:n,projectId:e?.id??``},{onSuccess:()=>{f.refetch()},onError:()=>{h.create({title:`Update automation`,type:`error`,description:`Failed to update automation`,meta:{closable:!0}})}})},I=t=>t.datasetId?(0,q.jsx)(le,{href:`/${e?.slug}/datasets/${t.datasetId}`,children:ce.data?.find(e=>e.id===t.datasetId)?.name}):``,L=t=>{ve.mutate({triggerId:t,projectId:e?.id??``},{onSuccess:()=>{h.create({title:`Delete automation`,type:`success`,description:`Automation deleted`,meta:{closable:!0}}),f.refetch()},onError:()=>{h.create({title:`Delete automation`,type:`error`,description:`Failed to delete automation`,meta:{closable:!0}})}})},Te=e=>ne[e]?.shared.label??e,R=(e,t)=>{switch(e){case`SEND_SLACK_MESSAGE`:return(0,q.jsx)(p,{content:t.slackWebhook,children:(0,q.jsx)(c,{lineClamp:1,display:`block`,children:`Webhook`})});case`SEND_EMAIL`:return t.members?.join(`, `);case`ADD_TO_DATASET`:return I(t)??``}},z=({children:e,fontSize:t=`sm`})=>(0,q.jsxs)(a,{border:`1px solid`,borderColor:`border`,borderRadius:`4px`,fontSize:t,width:`100%`,gap:2,paddingX:2,paddingY:1,children:[(0,q.jsx)(r,{color:`fg.muted`,children:(0,q.jsx)(me,{width:16,style:{minWidth:16}})}),e]}),B=({children:e})=>(0,q.jsx)(r,{padding:1,fontWeight:`500`,textTransform:`capitalize`,color:`fg.muted`,children:String(e).split(`.`).filter((e,t)=>t!==0||e.toLowerCase()===`evaluations`).join(` `).replace(`_`,` `)}),Ee=({children:e})=>(0,q.jsx)(r,{padding:1,borderRightRadius:`md`,children:(0,q.jsx)(we,{lineClamp:1,expandable:!1,children:e})}),De=e=>!e||e.length===0?null:(0,q.jsxs)(z,{fontSize:`sm`,children:[(0,q.jsx)(B,{children:`Evaluations`}),(0,q.jsx)(Ee,{children:e.map(e=>e?.name).join(`, `)})]}),V=e=>(0,q.jsxs)(_.Root,{children:[(0,q.jsx)(_.Trigger,{asChild:!0,children:(0,q.jsx)(i,{variant:`ghost`,"aria-label":`Actions for ${e.name}`,onClick:e=>{e.stopPropagation()},children:(0,q.jsx)(_e,{})})}),(0,q.jsxs)(_.Content,{children:[(0,q.jsx)(_.Item,{value:`view`,onClick:n=>{n.stopPropagation(),t(`viewAutomation`,{automationId:e.id})},children:(0,q.jsxs)(r,{display:`flex`,alignItems:`center`,gap:2,children:[(0,q.jsx)(d,{size:14}),`View`]})}),(0,q.jsx)(_.Item,{value:`edit`,onClick:n=>{n.stopPropagation(),t(`automation`,{automationId:e.id})},children:(0,q.jsxs)(r,{display:`flex`,alignItems:`center`,gap:2,children:[(0,q.jsx)(pe,{size:14}),`Edit`]})}),(0,q.jsx)(_.Item,{value:`delete`,onClick:t=>{t.stopPropagation(),L(e.id)},children:(0,q.jsxs)(r,{display:`flex`,alignItems:`center`,gap:2,color:`red.fg`,children:[(0,q.jsx)(ye,{size:14}),`Delete`]})})]})]}),H=e=>({"data-trigger-id":e.id,cursor:`pointer`,_hover:{bg:`bg.muted`},onClick:()=>t(`viewAutomation`,{automationId:e.id})}),U=e=>(0,q.jsx)(x,{textAlign:`center`,onClick:e=>{e.stopPropagation()},children:(0,q.jsx)(Ce,{checked:e.active,onCheckedChange:({checked:t})=>{Se(e.id,t)}})}),Oe=f.isLoading,W=(0,F.useMemo)(()=>{let e=[...C.values()],t=e.filter(e=>e.currentlyFiring).length,n=e.reduce((e,t)=>e+(t.recentFireCount??0),0),r=(w.data??[]).filter(e=>e.nextRunAt).map(e=>({at:new Date(e.nextRunAt).getTime(),triggerId:e.triggerId})).sort((e,t)=>e.at-t.at)[0];return{firingNow:t,fired30d:n,next:r,nextName:r?(f.data??[]).find(e=>e.id===r.triggerId)?.name??null:null}},[w.data,C,f.data]);return(0,q.jsxs)(xe,{sectionLabel:`Automations`,navigationItems:[{label:`Overview`,href:s,icon:(0,q.jsx)(d,{size:14})},{label:`Automations`,href:`${s}/automations`,icon:(0,q.jsx)(K,{size:14})},{label:`Alerts`,href:`${s}/alerts`,icon:(0,q.jsx)(be,{size:14})},{label:`Schedules`,href:`${s}/schedules`,icon:(0,q.jsx)(de,{size:14})}],children:[(0,q.jsx)(te.Header,{children:(0,q.jsx)(te.Heading,{children:o.title})}),(0,q.jsx)(r,{padding:6,width:`full`,children:(0,q.jsxs)(l,{align:`stretch`,gap:6,width:`full`,children:[(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:o.description}),Oe?(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:`Loading...`}):(0,q.jsxs)(q.Fragment,{children:[n===`alerts`&&(0,q.jsxs)(l,{align:`stretch`,gap:4,children:[(0,q.jsx)(Z,{icon:(0,q.jsx)(be,{size:18}),accent:`orange`,title:`Alerts`,count:E.length,summary:`Get told when a metric crosses a threshold, and again when it recovers.`,details:`An alert watches one series on an analytics graph. When the value crosses your threshold it notifies your channel; when it returns to normal it sends a recovery notice.`,addLabel:`New alert`,onAdd:()=>t(`automation`,{initialSource:`customGraph`})}),E.length===0?(0,q.jsx)(J,{kind:`alert`,onOpen:e=>t(`automation`,e)}):(0,q.jsx)(Q,{children:(0,q.jsxs)(y,{variant:`line`,width:`full`,children:[(0,q.jsx)(S,{children:(0,q.jsxs)(g,{children:[(0,q.jsx)(b,{children:`Name`}),(0,q.jsx)(b,{children:`Watches`}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:`Fires when`}),(0,q.jsx)(b,{children:`Notifies`}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:(0,q.jsx)(X,{label:`Last fired`,help:`When this alert last crossed its threshold and notified you.`})}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:(0,q.jsx)(X,{label:`Status`,help:`Firing while the metric is past its threshold, back to OK when it recovers.`})}),(0,q.jsx)(b,{children:`Active`}),(0,q.jsx)(b,{})]})}),(0,q.jsx)(v,{children:E.map(e=>{let t=e.actionParams,n=C.get(e.id);return(0,q.jsx)(P,{target:O({automationId:e.id,name:e.name}),children:(0,q.jsxs)(g,{...H(e),children:[(0,q.jsx)(x,{fontWeight:`medium`,children:e.name}),(0,q.jsx)(x,{maxWidth:`260px`,children:(0,q.jsx)(We,{graphName:e.customGraph?.name??null,graph:fe.get(e.customGraphId??``),seriesName:t.seriesName})}),(0,q.jsx)(x,{whiteSpace:`nowrap`,children:(0,q.jsx)(Ge,{actionParams:t})}),(0,q.jsx)(x,{children:R(e.action,t)}),(0,q.jsx)(x,{whiteSpace:`nowrap`,children:(0,q.jsx)(Be,{trigger:e,stats:n})}),(0,q.jsx)(x,{whiteSpace:`nowrap`,children:(0,q.jsx)(Ve,{firing:!!n?.currentlyFiring})}),U(e),(0,q.jsx)(x,{children:V(e)})]})},e.id)})})]})})]}),n===`overview`&&(0,q.jsxs)(l,{align:`stretch`,gap:8,width:`full`,children:[(0,q.jsxs)(u,{columns:{base:1,md:3},gap:4,children:[(0,q.jsx)($,{label:`Firing now`,value:W.firingNow,sub:W.firingNow>0?`alerts over their threshold`:`all clear`,alert:W.firingNow>0}),(0,q.jsx)($,{label:`Fired (30 days)`,value:W.fired30d.toLocaleString(),sub:`across every automation`}),(0,q.jsx)($,{label:`Next scheduled`,value:W.next?j(W.next.at)??`—`:`—`,sub:W.nextName??`no schedules queued`})]}),(0,q.jsxs)(l,{align:`stretch`,gap:3,width:`full`,children:[(0,q.jsx)(Qe,{title:`Recent activity`,summary:`See what alerts, schedules, and automations have done recently.`}),(0,q.jsx)(Le,{fires:T.data??[],triggers:f.data??[],isLoading:T.isLoading,onOpenAutomation:e=>t(`viewAutomation`,{automationId:e})})]}),(0,q.jsxs)(l,{align:`stretch`,gap:4,width:`full`,children:[(0,q.jsx)(Qe,{title:`Popular uses`,summary:`Start from a common workflow and tailor it to your project.`}),(0,q.jsxs)(l,{align:`stretch`,gap:2,children:[(0,q.jsx)(c,{textStyle:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Alerts`}),(0,q.jsx)(J,{kind:`alert`,showLabel:!1,onOpen:e=>t(`automation`,e)})]}),(0,q.jsxs)(l,{align:`stretch`,gap:2,children:[(0,q.jsx)(c,{textStyle:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:`Automations`}),(0,q.jsx)(J,{kind:`automation`,showLabel:!1,onOpen:e=>t(`automation`,e)})]})]})]}),n===`schedules`&&(0,q.jsxs)(l,{align:`stretch`,gap:4,children:[(0,q.jsx)(Z,{icon:(0,q.jsx)(de,{size:18}),accent:`purple`,title:`Schedules`,count:D.length,summary:`Send a dashboard, a graph, or a table of traces on a recurring schedule.`,details:`A schedule bundles a dashboard, a single graph, or a top-N trace table into a Slack or email digest on the schedule you set.`,addLabel:`New schedule`,onAdd:()=>t(`automation`,{initialSource:`report`})}),D.length===0?(0,q.jsx)(Ue,{children:`No schedules yet. Create one for a recurring Slack or email digest.`}):(0,q.jsx)(Q,{children:(0,q.jsxs)(y,{variant:`line`,width:`full`,children:[(0,q.jsx)(S,{children:(0,q.jsxs)(g,{children:[(0,q.jsx)(b,{children:`Name`}),(0,q.jsx)(b,{children:`Sends`}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:`Schedule`}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:(0,q.jsx)(X,{label:`Next run`,help:`When this next goes out, straight from the scheduler. A paused schedule has no next run.`})}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:(0,q.jsx)(X,{label:`Last run`,help:`The last time this was sent.`})}),(0,q.jsx)(b,{children:`Delivery`}),(0,q.jsx)(b,{children:`Active`}),(0,q.jsx)(b,{})]})}),(0,q.jsx)(v,{children:D.map(e=>{let n=e.actionParams,r=n.schedule;return(0,q.jsx)(P,{target:O({automationId:e.id,name:e.name}),children:(0,q.jsxs)(g,{"data-trigger-id":e.id,cursor:`pointer`,_hover:{bg:`bg.muted`},onClick:()=>t(`automation`,{automationId:e.id}),children:[(0,q.jsx)(x,{fontWeight:`medium`,children:e.name}),(0,q.jsx)(x,{children:(0,q.jsx)(Ke,{actionParams:n,graphNameById:ge})}),(0,q.jsx)(x,{whiteSpace:`nowrap`,children:(0,q.jsx)(c,{textStyle:`sm`,children:r?.cron?Je(r.cron,r.timezone??`UTC`):`Not set`})}),(0,q.jsx)(He,{schedule:re.get(e.id),loading:w.isLoading}),(0,q.jsx)(x,{children:e.action===`SEND_SLACK_MESSAGE`?`Slack`:`Email`}),U(e),(0,q.jsx)(x,{children:V(e)})]})},e.id)})})]})})]}),n===`automations`&&(0,q.jsxs)(l,{align:`stretch`,gap:4,children:[(0,q.jsx)(Z,{icon:(0,q.jsx)(K,{size:18}),accent:`blue`,title:`Automations`,count:A.length,summary:`Act on every incoming trace that matches your filters.`,details:`An automation runs on each trace matching your filters: post to Slack or email, add rows to a dataset, or queue traces for annotation.`,addLabel:`New automation`,onAdd:()=>t(`automation`,{})}),A.length===0?(0,q.jsx)(J,{kind:`automation`,onOpen:e=>t(`automation`,e)}):(0,q.jsx)(Q,{children:(0,q.jsxs)(y,{variant:`line`,width:`full`,children:[(0,q.jsx)(S,{children:(0,q.jsxs)(g,{children:[(0,q.jsx)(b,{children:`Name`}),(0,q.jsx)(b,{children:`Acts on`}),(0,q.jsx)(b,{children:`Then`}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:(0,q.jsx)(X,{label:`Last fired`,help:`When this automation last matched a trace and ran its action. Automations on a digest schedule also show when the next bundled send is due.`})}),(0,q.jsx)(b,{whiteSpace:`nowrap`,children:(0,q.jsx)(X,{label:`Fires (30d)`,help:`Times this automation fired in the last 30 days.`})}),(0,q.jsx)(b,{children:`Active`}),(0,q.jsx)(b,{})]})}),(0,q.jsx)(v,{children:A.map(e=>{let t=e.actionParams,n=C.get(e.id);return(0,q.jsx)(P,{target:O({automationId:e.id,name:e.name}),children:(0,q.jsxs)(g,{...H(e),children:[(0,q.jsx)(x,{fontWeight:`medium`,children:e.name}),(0,q.jsx)(x,{maxWidth:`360px`,children:(0,q.jsxs)(l,{gap:2,align:`stretch`,children:[De(e.checks?.filter(e=>!!e)??[]),e.filterQuery?(0,q.jsx)(ee,{size:`sm`,variant:`surface`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:e.filterQuery}):e.filters&&typeof e.filters==`string`&&e.filters!==`{}`?(0,q.jsx)(he,{filters:e.filters,hasBorder:!0}):null]})}),(0,q.jsx)(x,{children:(0,q.jsxs)(l,{align:`start`,gap:0,children:[(0,q.jsx)(c,{textStyle:`sm`,fontWeight:`medium`,children:Te(e.action)}),(0,q.jsx)(r,{textStyle:`xs`,color:`fg.muted`,children:R(e.action,t)})]})}),(0,q.jsx)(x,{whiteSpace:`nowrap`,children:(0,q.jsx)(Be,{trigger:e,stats:n})}),(0,q.jsx)(x,{children:(0,q.jsx)(c,{as:`span`,color:`fg.muted`,children:n?.recentFireCount??0})}),U(e),(0,q.jsx)(x,{children:V(e)})]})},e.id)})})]})})]})]})]})})]})}function Qe({title:e,summary:t}){return(0,q.jsxs)(l,{align:`start`,gap:.5,children:[(0,q.jsx)(c,{fontSize:`lg`,fontWeight:`semibold`,children:e}),(0,q.jsx)(c,{textStyle:`sm`,color:`fg.muted`,children:t})]})}function $({label:e,value:t,sub:n,alert:i=!1}){return(0,q.jsxs)(r,{borderWidth:`1px`,borderColor:i?`red.solid`:`border`,borderRadius:`lg`,padding:4,bg:`bg.panel`,children:[(0,q.jsx)(c,{textStyle:`2xs`,textTransform:`uppercase`,letterSpacing:`0.04em`,fontWeight:`600`,color:i?`red.fg`:`fg.muted`,children:e}),(0,q.jsx)(c,{fontSize:`2xl`,fontWeight:`semibold`,lineHeight:`1.2`,marginTop:1,color:i?`red.fg`:`fg`,children:t}),(0,q.jsx)(c,{textStyle:`xs`,color:`fg.muted`,marginTop:.5,lineClamp:1,children:n})]})}var $e=Se(`triggers:view`,{layoutComponent:C})(Ze);export{$e as default};
|
|
2
|
+
//# sourceMappingURL=automations-BhzNESFp.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{Sn as t}from"./ProjectAvatar-B0tbfKzY.js";import{D as n,E as r}from"./DashboardLayout-Cn5-9Ye2.js";import{zn as i}from"./index-8SbDirJv.js";var a=i(),o=e(t());function s(e,t=`0,0`){return(0,o.default)(e).format(t)}function c(e){let t=r[e],i=n.prices[t];if(!i?.unitAmount)throw Error(`No unitAmount for ${e}`);return i.unitAmount}function l(){return{[a.Currency.EUR]:{monthly:c(`GROWTH_SEAT_EUR_MONTHLY`),annual:c(`GROWTH_SEAT_EUR_ANNUAL`)},[a.Currency.USD]:{monthly:c(`GROWTH_SEAT_USD_MONTHLY`),annual:c(`GROWTH_SEAT_USD_ANNUAL`)}}}function u(e){let t=l();return Math.round((1-t[e].annual/(t[e].monthly*12))*100)}function d({cents:e,currency:t}){let n=e/100;return new Intl.NumberFormat(t===a.Currency.EUR?`en-IE`:`en-US`,{style:`currency`,currency:t,minimumFractionDigits:Number.isInteger(n)?0:2,maximumFractionDigits:2}).format(n)}var f={[a.Currency.EUR]:`€`,[a.Currency.USD]:`$`},p=e=>e===a.Currency.EUR?`€5 per additional 100,000 events`:`$6 per additional 100,000 events`,m=e=>[`Up to 20 core users`,`200,000 events included`,p(e),`Unlimited lite users`,`30 days retention`,`Unlimited evals`,`Private Slack support`],h=[`All platform features`,`50,000 events included`,`14 days data retention`,`2 users`,`Unlimited scenarios, simulations & evals`,`Community support`],g=e=>[`Everything in Free`,`200,000 events included`,p(e),`30 days retention (+ custom at $3/GB)`,`Up to 20 core users (volume discount available)`,`Unlimited lite users`,`Unlimited evals, simulations and prompts`,`Slack support`],_=[`Alternative hosting options`,`Custom data retention`,`Custom SSO / RBAC`,`Audit logs`,`Gateway webhooks for metering and rebilling`,`Uptime & Support SLA`,`Compliance and legal reviews`,`Custom terms and DPA`,`Dedicated Solution Engineer`,`Slack / Teams support`,`AWS/Azure/GCP Marketplace`,`ISO27001 / SOC2 reports`];function v({maxMembers:e,maxMessagesPerMonth:t,maxMembersLite:n}){return[e>0?`Up to ${s(e)} core users`:`Custom core user limits`,t>=999999999?`Unlimited events`:t>0?`${s(t)} events included`:`Custom event limits`,n>=9999?`Unlimited lite users`:n>0?`Up to ${s(n)} lite users`:`Custom lite user limits`]}export{m as a,u as c,f as i,l,h as n,g as o,v as r,d as s,_ as t};
|
|
2
|
+
//# sourceMappingURL=billing-plans-D_IT1cHz.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./fetchSSE-CnJPAkno.js";var e={spec_version:`1.5`,name:`Blank Template`,icon:`🧩`,description:`Start a new workflow from scratch`,version:`1.0`,template_adapter:`default`,workflow_type:`workflow`,enable_tracing:!0,nodes:[{id:`entry`,type:`entry`,position:{x:0,y:0},deletable:!1,data:{name:`Entry point`,outputs:[{identifier:`input`,type:`str`}],entry_selection:`random`,train_size:.8,test_size:.2,seed:42,dataset:{name:`Draft Dataset`,inline:{records:{input:[`Hello world`]},columnTypes:[{name:`input`,type:`string`}]}}}},{id:`llm_call`,type:`signature`,position:{x:300,y:0},data:{name:`LLM Call`,parameters:[{identifier:`llm`,type:`llm`,value:void 0},{identifier:`prompting_technique`,type:`prompting_technique`,value:void 0},{identifier:`instructions`,type:`str`,value:`You are a helpful assistant.`},{identifier:`messages`,type:`chat_messages`,value:[{role:`user`,content:`{{input}}`}]},{identifier:`demonstrations`,type:`dataset`,value:void 0}],inputs:[{identifier:`input`,type:`str`}],outputs:[{identifier:`output`,type:`str`}]}},{id:`end`,type:`end`,position:{x:600,y:30},deletable:!1,data:{name:`End`,inputs:[{identifier:`output`,type:`str`}]}}],edges:[{id:`e0-1`,source:`entry`,sourceHandle:`outputs.input`,target:`llm_call`,targetHandle:`inputs.input`,type:`default`},{id:`e1-2`,source:`llm_call`,sourceHandle:`outputs.output`,target:`end`,targetHandle:`inputs.output`,type:`default`}],state:{}};export{e as t};
|
|
2
|
+
//# sourceMappingURL=blank-Ct2wtHyX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{n as s}from"./v-stack-hkuSkmCA.js";import{An as c}from"./ProjectAvatar-B0tbfKzY.js";import{t as l}from"./badge-Cpc3eA-C.js";import{n as u}from"./toaster-BsYkODqs.js";import{$ as d,I as f,J as p,Q as m,X as h,Y as g,Z as _}from"./Markdown-Cip8Rj5C.js";import{L as v,t as ee}from"./DashboardLayout-Cn5-9Ye2.js";import{a as y,i as b,n as x,r as S,t as C}from"./empty-state-T8EYr5NF.js";import{T as w}from"./fetchSSE-CnJPAkno.js";import{t as T}from"./errors-mlatPkMI.js";import{n as E,r as D,t as O}from"./native-select-DL2k8x0o.js";import{t as k}from"./spacer-C38e7o6r.js";import{Q as te}from"./immer-DImI3Uq2.js";import{n as A}from"./api-l6Cnm0vQ.js";import{Mr as j,Pr as M,S as N}from"./index-8SbDirJv.js";import{o as P,t as F}from"./formatters-BDO3Inyr.js";import{t as I}from"./ConfirmDialog-CWzCY4sN.js";import{t as L}from"./OpsPageShell-GqOT9Ezv.js";var R=e(t()),z={leased:{label:`In use`,palette:`green`},repaired:{label:`Will shorten`,palette:`orange`},reclaimed:{label:`Will delete`,palette:`red`},bookkeeping:{label:`Leftover keys`,palette:`gray`},pending:{label:`Expiring`,palette:`yellow`}},B={label:`Unknown`,palette:`gray`};function V(e){return z[e]??B}function H(e){return e===null?`No expiry`:e<60?`${e}s`:e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`}function U(e){return e===null?`None`:e>=Date.now()?`Live`:P(e)}var W=o();function G({blob:e,canManage:t,onDelete:n}){let r=V(e.sweepOutcome);return(0,W.jsxs)(d,{children:[(0,W.jsx)(g,{children:(0,W.jsx)(s,{textStyle:`xs`,fontFamily:`mono`,children:e.projectId})}),(0,W.jsx)(g,{children:(0,W.jsx)(s,{textStyle:`xs`,fontFamily:`mono`,children:e.hash})}),(0,W.jsx)(g,{children:F(e.sizeBytes)}),(0,W.jsx)(g,{children:H(e.ttlSeconds)}),(0,W.jsx)(g,{children:e.liveLeases>0?(0,W.jsxs)(l,{colorPalette:`green`,variant:`subtle`,children:[e.liveLeases,` job`,e.liveLeases===1?``:`s`]}):(0,W.jsx)(l,{colorPalette:`gray`,variant:`subtle`,children:`Nothing`})}),(0,W.jsx)(g,{children:(0,W.jsx)(s,{textStyle:`xs`,color:`fg.muted`,children:U(e.earliestLeaseDeadlineMs)})}),(0,W.jsx)(g,{children:(0,W.jsx)(l,{colorPalette:r.palette,variant:`subtle`,children:r.label})}),(0,W.jsx)(g,{children:t&&(0,W.jsxs)(f.Root,{children:[(0,W.jsx)(f.Trigger,{asChild:!0,children:(0,W.jsx)(i,{variant:`ghost`,size:`2xs`,"aria-label":`Actions for payload ${e.hash}`,children:(0,W.jsx)(c,{size:14})})}),(0,W.jsx)(f.Content,{children:(0,W.jsx)(f.Item,{value:`delete`,color:`red.500`,onClick:()=>n(e),children:`Delete payload`})})]})})]})}function K({blobs:e,canManage:t,onDelete:n}){return(0,W.jsx)(r,{overflowX:`auto`,children:(0,W.jsxs)(m,{variant:`line`,size:`sm`,children:[(0,W.jsx)(_,{children:(0,W.jsxs)(d,{children:[(0,W.jsx)(h,{children:`Project`}),(0,W.jsx)(h,{children:`Payload`}),(0,W.jsx)(h,{children:`Size`}),(0,W.jsx)(h,{children:`Expires in`}),(0,W.jsx)(h,{children:`Referenced by`}),(0,W.jsx)(h,{children:`Holder stopped`}),(0,W.jsx)(h,{children:`Next cleanup`}),(0,W.jsx)(h,{})]})}),(0,W.jsx)(p,{children:e.map(e=>(0,W.jsx)(G,{blob:e,canManage:t,onDelete:n},`${e.projectId}/${e.hash}`))})]})})}function q({isLoading:e,blobs:t,canManage:r,onDelete:a,hasMore:o,onLoadMore:s,isLoadingMore:c}){return e?(0,W.jsx)(M,{paddingY:20,children:(0,W.jsx)(b,{children:(0,W.jsxs)(C,{children:[(0,W.jsx)(S,{children:(0,W.jsx)(n,{size:`lg`})}),(0,W.jsx)(y,{children:`Loading payloads`})]})})}):t.length===0?(0,W.jsx)(M,{paddingY:20,children:(0,W.jsx)(b,{children:(0,W.jsxs)(C,{children:[(0,W.jsx)(S,{children:(0,W.jsx)(te,{})}),(0,W.jsx)(y,{children:`No stored payloads`}),(0,W.jsx)(x,{children:`Nothing is being held for this queue.`})]})})}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(K,{blobs:t,canManage:r,onDelete:a}),o&&(0,W.jsx)(w,{justify:`center`,paddingY:4,children:(0,W.jsx)(i,{size:`sm`,variant:`outline`,loading:c,onClick:s,children:`Load more`})})]})}var J={largest:`Largest first`,unreferenced:`Nothing referencing them`,stalest:`Longest untouched`,oldest_lapsed_lease:`Longest since a holder stopped`,scan:`Storage order`},Y=[`largest`,`unreferenced`,`stalest`,`oldest_lapsed_lease`,`scan`];function X(e){return e in J}function Z({queueNames:e,selectedQueue:t,onQueueChange:n,sort:r,onSortChange:i}){return(0,W.jsxs)(a,{gap:3,children:[(0,W.jsxs)(D,{size:`sm`,width:`260px`,children:[(0,W.jsx)(O,{"aria-label":`Queue`,value:t??``,onChange:e=>n(e.currentTarget.value),children:e.map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))}),(0,W.jsx)(E,{})]}),(0,W.jsxs)(D,{size:`sm`,width:`280px`,children:[(0,W.jsx)(O,{"aria-label":`Order`,value:r,onChange:e=>{let t=e.currentTarget.value;X(t)&&i(t)},children:Y.map(e=>(0,W.jsx)(`option`,{value:e,children:J[e]},e))}),(0,W.jsx)(E,{})]})]})}function ne({queueNames:e,selectedQueue:t,onQueueChange:n,sort:r,onSortChange:o,canManage:s,onPreviewCleanup:c,onRunCleanup:l,previewLoading:u}){return(0,W.jsxs)(a,{marginBottom:4,gap:3,children:[(0,W.jsx)(Z,{queueNames:e,selectedQueue:t,onQueueChange:n,sort:r,onSortChange:o}),(0,W.jsx)(k,{}),s&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(i,{size:`2xs`,variant:`outline`,loading:u,onClick:c,children:`Preview cleanup`}),(0,W.jsx)(i,{size:`2xs`,variant:`outline`,colorPalette:`red`,onClick:l,children:`Run cleanup`})]})]})}function Q({target:e,onClose:t,onConfirm:n,isLoading:r}){return(0,W.jsx)(I,{open:!!e,onClose:t,onConfirm:()=>{e&&n(e)},title:`Delete this payload`,description:`The job that referenced it will finish without running. This cannot be undone, and it will be refused if anything still references it.`,isLoading:r})}var $=`RECLAIM`;function re({value:e,onChange:t,onClose:n,onConfirm:r,isLoading:i}){let a=e===$;return(0,W.jsx)(I,{open:e!==null,onClose:n,onConfirm:()=>{a&&r()},title:`Run cleanup`,description:`Payloads nothing references will be deleted. Type ${$} to confirm.`,isLoading:i,confirmDisabled:!a,children:(0,W.jsx)(j,{size:`sm`,"aria-label":`Type ${$} to confirm`,placeholder:$,value:e??``,onChange:e=>t(e.currentTarget.value)})})}var ie=100;function ae(){let[e,t]=(0,R.useState)(null),[n,r]=(0,R.useState)(`largest`),i=A.ops.listBlobQueues.useQuery(void 0,{refetchInterval:6e4}),a=e??i.data?.[0]??null,o=A.ops.listBlobs.useInfiniteQuery({queueName:a??``,sort:n,limit:ie},{enabled:!!a,refetchInterval:3e4,keepPreviousData:!0,getNextPageParam:e=>e.nextCursor??void 0}),s=o.data?.pages[0];return{queueNames:i.data??[],selectedQueue:a,setQueueName:t,sort:n,setSort:r,blobs:o.data?.pages.flatMap(e=>e.blobs)??[],rankedFromSample:s?.rankedFromSample??!1,sampled:s?.sampled??0,isLoading:o.isInitialLoading||i.isLoading,hasMore:o.hasNextPage??!1,loadMore:()=>void o.fetchNextPage(),isLoadingMore:o.isFetchingNextPage}}function oe({onCleanupSuccess:e,onDeleteSuccess:t}){let n=A.useContext();return{cleanup:A.ops.runBlobCleanup.useMutation({onSuccess:(t,r)=>{u.create({title:t.dryRun?`Preview: ${t.totals.reclaimed} would be deleted`:`Reclaimed ${t.totals.reclaimed}, shortened ${t.totals.repaired}`,type:`success`}),e(r),n.ops.invalidate()},onError:e=>{T({error:e,fallbackTitle:`Couldn't run the cleanup`})}}),deleteBlob:A.ops.deleteBlob.useMutation({onSuccess:(e,r)=>{u.create({title:e.deleted?`Payload deleted`:`Not deleted, something still references it`,type:e.deleted?`success`:`warning`}),t(r),n.ops.invalidate()},onError:e=>{T({error:e,fallbackTitle:`Couldn't delete this payload`})}})}}function se(){let{hasAccess:e}=N(),t=ae(),[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(null),{cleanup:o,deleteBlob:c}=oe({onCleanupSuccess:e=>{e.dryRun===!1&&a(null)},onDeleteSuccess:e=>{r(t=>t?.queueName===e.queueName&&t?.projectId===e.projectId&&t?.hash===e.hash?null:t)}});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(s,{textStyle:`sm`,color:`fg.muted`,marginBottom:4,children:`Stored job payloads, what still references them, and what the next cleanup would do with each. Payload contents are never shown.`}),(0,W.jsx)(ne,{queueNames:t.queueNames,selectedQueue:t.selectedQueue,onQueueChange:t.setQueueName,sort:t.sort,onSortChange:t.setSort,canManage:e,onPreviewCleanup:()=>o.mutate({dryRun:!0}),onRunCleanup:()=>a(``),previewLoading:o.isPending&&o.variables?.dryRun===!0}),t.rankedFromSample&&(0,W.jsxs)(s,{textStyle:`xs`,color:`fg.muted`,marginBottom:3,children:[`Ordered from a sample of `,t.sampled,` payloads, not the whole store. Use storage order to walk everything.`]}),(0,W.jsx)(q,{isLoading:t.isLoading,blobs:t.blobs,canManage:e,onDelete:r,hasMore:t.hasMore,onLoadMore:t.loadMore,isLoadingMore:t.isLoadingMore}),(0,W.jsx)(Q,{target:n,onClose:()=>r(null),onConfirm:e=>c.mutate({queueName:e.queueName,projectId:e.projectId,hash:e.hash,confirm:`DELETE`}),isLoading:c.isPending}),(0,W.jsx)(re,{value:i,onChange:a,onClose:()=>a(null),onConfirm:()=>o.mutate({dryRun:!1,confirm:`RECLAIM`}),isLoading:o.isPending})]})}function ce(){return(0,W.jsx)(L,{children:(0,W.jsxs)(ee,{children:[(0,W.jsx)(v.Header,{children:(0,W.jsx)(v.Heading,{children:`Payload store`})}),(0,W.jsx)(v.Container,{children:(0,W.jsx)(se,{})})]})})}export{ce as default};
|
|
2
|
+
//# sourceMappingURL=blobs-Dwi1OImQ.js.map
|