decocms 3.35.1 → 3.35.3
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/dist/client/assets/{AlertCircle-asB0zjf2.js → AlertCircle-DjOU_aot.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DRnt_VKh.js → ArrowUpRight-BXJMGk9i.js} +1 -1
- package/dist/client/assets/{Check-CNRVH6xs.js → Check-D7HZW6oZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-B7v5_MG4.js → CheckCircle-XS4dmEOs.js} +1 -1
- package/dist/client/assets/{ChevronDown-BKkz3Gyp.js → ChevronDown-CxTVikeq.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DkMFugke.js → ChevronLeft-BEmN2X52.js} +1 -1
- package/dist/client/assets/{ChevronRight-DixPnH3V.js → ChevronRight-3jD7TdJZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-BeDEmrn1.js → ChevronUp-Dbc77Gwp.js} +1 -1
- package/dist/client/assets/{Container-C41D-bwR.js → Container-Hfp9SJFa.js} +1 -1
- package/dist/client/assets/{DotsVertical-DimB1qZR.js → DotsVertical-Cz5MZln-.js} +1 -1
- package/dist/client/assets/{Eye-CFpoJQMe.js → Eye-BIZqMr-y.js} +1 -1
- package/dist/client/assets/{FilterLines-htpqKUqo.js → FilterLines-iroXgkwP.js} +1 -1
- package/dist/client/assets/{Globe01-CxF-Z8O2.js → Globe01-CiCGKTg3.js} +1 -1
- package/dist/client/assets/{HardDrive-TXw7C9gB.js → HardDrive-B26C8dI3.js} +1 -1
- package/dist/client/assets/{Key01-CDAkGspz.js → Key01-DZeJDklU.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BG08KNqc.js → LayoutLeft-CY1OP6dH.js} +1 -1
- package/dist/client/assets/{LinkExternal01-AylVRyuU.js → LinkExternal01-DwxMIV-o.js} +1 -1
- package/dist/client/assets/{Monitor01-gdKmZQTW.js → Monitor01-_FIjo4ge.js} +1 -1
- package/dist/client/assets/{Palette-D9_6t0uI.js → Palette-BDd6wxPD.js} +1 -1
- package/dist/client/assets/{Play-aa6uUei5.js → Play-C933mY5z.js} +1 -1
- package/dist/client/assets/{Plus-DcxLSicT.js → Plus-aXWGGcSy.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Dd5D2uNm.js → RefreshCcw01-DS1vtLKW.js} +1 -1
- package/dist/client/assets/{SearchMd-2GibIebB.js → SearchMd-Cr6CluRw.js} +1 -1
- package/dist/client/assets/{Settings02-D0kdZjJD.js → Settings02-DeH66RiM.js} +1 -1
- package/dist/client/assets/{Shield01-CpxvRW7h.js → Shield01-0kTDalL_.js} +1 -1
- package/dist/client/assets/{Star01-BVQUiqS1.js → Star01-pwvCfpNJ.js} +1 -1
- package/dist/client/assets/{Stars01-B2PA7s4d.js → Stars01-Bw7_Rdwp.js} +1 -1
- package/dist/client/assets/{Stars02-BFz8RQ16.js → Stars02-vcxNwhIa.js} +1 -1
- package/dist/client/assets/{Sun-DMcKqqHE.js → Sun-De2vWRC7.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-qUOmQUUG.js → SwitchHorizontal01-Blia-yUi.js} +1 -1
- package/dist/client/assets/{Tool01-DNz0OMpT.js → Tool01-DC4THSlP.js} +1 -1
- package/dist/client/assets/{Trash01-rpak8qu1.js → Trash01-DBSukaq0.js} +1 -1
- package/dist/client/assets/{Upload01-d_Wyw7QT.js → Upload01-DruP7_KV.js} +1 -1
- package/dist/client/assets/{User01-BWllfXHj.js → User01-Bweqikx-.js} +1 -1
- package/dist/client/assets/{Users01-DG6YdAo1.js → Users01-N436STOJ.js} +1 -1
- package/dist/client/assets/{Users03-B9AqN8LK.js → Users03-DiilXFZ6.js} +1 -1
- package/dist/client/assets/{X-DxE022Fo.js → X-B1W1F4mo.js} +1 -1
- package/dist/client/assets/{XCircle-B_UH_gQt.js → XCircle-BtUzMyFW.js} +1 -1
- package/dist/client/assets/{XClose-DOt_DYPz.js → XClose-r0gXvFlp.js} +1 -1
- package/dist/client/assets/{Zap-CyMJw7DY.js → Zap-Dvtyg5Ik.js} +1 -1
- package/dist/client/assets/{ZapSquare-Dz4Qok6x.js → ZapSquare-BQX2HOTP.js} +1 -1
- package/dist/client/assets/{ZoomOut-BkCtUzuC.js → ZoomOut-DC46Ewts.js} +1 -1
- package/dist/client/assets/{access-gate-u6bqRJWi.js → access-gate-CVMVVI4n.js} +1 -1
- package/dist/client/assets/{accordion-B7oL0ZOw.js → accordion-DBJsIIHl.js} +1 -1
- package/dist/client/assets/{add-section-modal-DI1aX1UO.js → add-section-modal-v1Vhtks6.js} +1 -1
- package/dist/client/assets/{agent-capabilities-BxQUOIVO.js → agent-capabilities-n5Q1YbJ5.js} +1 -1
- package/dist/client/assets/{agent-icon-BrUPk7cd.js → agent-icon-CCGqC-bl.js} +1 -1
- package/dist/client/assets/{agent-icons-oFY-K2bC.js → agent-icons-CDVkEkIq.js} +2 -2
- package/dist/client/assets/{agents-list-BOxJitnX.js → agents-list-DDPJUJaX.js} +1 -1
- package/dist/client/assets/{ai-providers-DjvmZlJ5.js → ai-providers-48DFDYIz.js} +1 -1
- package/dist/client/assets/{alert-8WGQf_5q.js → alert-ZcglsRSH.js} +1 -1
- package/dist/client/assets/{alert-dialog-DUUnhBc6.js → alert-dialog-B2k_N3ZX.js} +1 -1
- package/dist/client/assets/app-editor-DmCxU5-w.js +1 -0
- package/dist/client/assets/{auth-DTxUlSLU.js → auth-ClbRbdVv.js} +1 -1
- package/dist/client/assets/{auth-catchall-_asaISim.js → auth-catchall-BQd5LNUx.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DU0bpIBM.js → auth-split-layout-jRGUFWwU.js} +1 -1
- package/dist/client/assets/{automation-list-row-atv_xAlK.js → automation-list-row-CXD-x28t.js} +1 -1
- package/dist/client/assets/{automation-runs-8yvWAbAC.js → automation-runs-BIJek_K_.js} +1 -1
- package/dist/client/assets/{automations-B1IxT7Wc.js → automations-D53YpHbQ.js} +1 -1
- package/dist/client/assets/{avatar-BqYC23h9.js → avatar-BG2RlqaT.js} +1 -1
- package/dist/client/assets/{badge-CGZjMX2o.js → badge-DIN7Nq6a.js} +1 -1
- package/dist/client/assets/{brand-context-Dki54pAn.js → brand-context--o_ht-A-.js} +1 -1
- package/dist/client/assets/{buckets-BgnqByrS.js → buckets-DD6OfmjS.js} +1 -1
- package/dist/client/assets/{calendar-CaIJu6mx.js → calendar-RJSiIOON.js} +1 -1
- package/dist/client/assets/{capability-load-error-DWbE5k9a.js → capability-load-error-BfCjxOlU.js} +1 -1
- package/dist/client/assets/{card-BlzflWCA.js → card-ykuj7mlf.js} +1 -1
- package/dist/client/assets/{chat-context-BUN4BStS.js → chat-context-CEWm5eLB.js} +1 -1
- package/dist/client/assets/{checkbox-C1s8UE6Y.js → checkbox-BKpSRHdU.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DOMHymP7.js → cli-auth-success-qAM068ao.js} +1 -1
- package/dist/client/assets/{collection-detail-Fe7fYzy1.js → collection-detail-BaAVQGsi.js} +1 -1
- package/dist/client/assets/{collection-display-button-CTi0VUGU.js → collection-display-button-ve31YRQs.js} +1 -1
- package/dist/client/assets/{collection-search-CJ5Ov7mh.js → collection-search-C5MSFdhR.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BMZaf4HK.js → collection-table-wrapper-Wi0b7UJz.js} +1 -1
- package/dist/client/assets/{collection-tabs-zuvlZo6K.js → collection-tabs-CAVXo49Z.js} +1 -1
- package/dist/client/assets/{collections-Dg2-DQoz.js → collections-Cs_tB6Xp.js} +1 -1
- package/dist/client/assets/{command-ETJRln9I.js → command-ClPkeFT9.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-DrC4f6Q3.js +1 -0
- package/dist/client/assets/{connection-card-BryVkZk7.js → connection-card-aeOBPbSz.js} +1 -1
- package/dist/client/assets/{connection-detail-KbHJGNLa.js → connection-detail-p5zHxWJQ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C9SsVHwd.js → connection-form-helpers-C2pw-OdH.js} +1 -1
- package/dist/client/assets/{connections-C-B_pHNS.js → connections-DtVPIESl.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-BZ8GwOYU.js +1 -0
- package/dist/client/assets/{dialog-dItkri_7.js → dialog-BwBYyWWk.js} +1 -1
- package/dist/client/assets/{domain-settings-Cwl6OKHc.js → domain-settings-p2x5w3J1.js} +1 -1
- package/dist/client/assets/{drawer-CiKI2xvg.js → drawer-QIeXv6B7.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DA6--pO3.js → dropdown-menu-CL4WEQRf.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DvjE2kdj.js → dynamic-plugin-layout-cQR6S4X8.js} +1 -1
- package/dist/client/assets/{empty-state-Wjey2haZ.js → empty-state-BKLgisam.js} +1 -1
- package/dist/client/assets/{empty-state-ubN3bG68.js → empty-state-C4JeGg4X.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BUZFKLkD.js → extract-connection-data-Dz_jOB39.js} +1 -1
- package/dist/client/assets/{features-wYfaVlaa.js → features-lNOjZ0fU.js} +1 -1
- package/dist/client/assets/{file-explorer-uNvjlPcF.js → file-explorer-MIJepCP_.js} +1 -1
- package/dist/client/assets/{file-type-icon-BC52hPZD.js → file-type-icon-B6AnVMPu.js} +1 -1
- package/dist/client/assets/{files-DCMyG2Qq.js → files-C6_93qT5.js} +1 -1
- package/dist/client/assets/{form-BvrZIBZy.js → form-Z86e6etr.js} +1 -1
- package/dist/client/assets/{general-CVh1dm4M.js → general-CBaQO14X.js} +1 -1
- package/dist/client/assets/{generate-id-BYzu1jEq.js → generate-id-C7CxZwCs.js} +1 -1
- package/dist/client/assets/{github-repo-picker-D-39cmmm.js → github-repo-picker-BlgfXLdP.js} +1 -1
- package/dist/client/assets/{header-tab-button-eoCiDxtu.js → header-tab-button-BOZYRinC.js} +1 -1
- package/dist/client/assets/{hover-card-DuwXdrhz.js → hover-card-DCrCVVSt.js} +1 -1
- package/dist/client/assets/{image-field-BctFTejU.js → image-field-CnaeZ7Cq.js} +1 -1
- package/dist/client/assets/{index-7TDtRiUY.js → index--1Ng2vB4.js} +4 -4
- package/dist/client/assets/{index-Dilf6iGE.js → index-1vLRIaGM.js} +1 -1
- package/dist/client/assets/{index-cSwj9er3.js → index-BdZLvIUs.js} +1 -1
- package/dist/client/assets/{index-DFBJ_PWq.js → index-Cf5_qS_K.js} +1 -1
- package/dist/client/assets/{index-BMYBcbtc.js → index-CiRwseKn.js} +1 -1
- package/dist/client/assets/{index-BOvqwG23.js → index-CmVsJNWn.js} +1 -1
- package/dist/client/assets/{index-CYZk0gv3.js → index-D36v7D1U.js} +1 -1
- package/dist/client/assets/{index-CQVYoK7e.js → index-DvG0T2G3.js} +1 -1
- package/dist/client/assets/{index-CfhwhmtA.js → index-DxJD6aw-.js} +1 -1
- package/dist/client/assets/{index-BN_h4BrS.js → index-F-DdQVig.js} +1 -1
- package/dist/client/assets/{index-B6rgjRY6.js → index-Jt8pUNdF.js} +1 -1
- package/dist/client/assets/{index-DkJOKUiK.js → index-Nc3tqGu_.js} +1 -1
- package/dist/client/assets/{index-DkBXivRM.js → index-YE7XuOF9.js} +1 -1
- package/dist/client/assets/{index-CyhU99S0.js → index-qk7utkhC.js} +1 -1
- package/dist/client/assets/{index-redirect-C0KSMoT0.js → index-redirect-Bga8SUq5.js} +1 -1
- package/dist/client/assets/{index-Dv-yFpKM.js → index-uVHAmIsb.js} +3 -3
- package/dist/client/assets/{input-B16LqKMQ.js → input-BYcDxHNs.js} +1 -1
- package/dist/client/assets/{integration-icon-7cYHs9rV.js → integration-icon-YIddy6rU.js} +1 -1
- package/dist/client/assets/{label-DfTmRnMe.js → label-6YORzGJ9.js} +1 -1
- package/dist/client/assets/{layout-BCfLVStg.js → layout-BqzITPb8.js} +1 -1
- package/dist/client/assets/{login-BQe_0Uvb.js → login-OD0e1zDV.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BoL_9gDY.js → mcp-oauth-Bqzn0Dif.js} +1 -1
- package/dist/client/assets/{members-DjEZG3vo.js → members-DS-tdh70.js} +1 -1
- package/dist/client/assets/{monaco-editor-CEYWUBYY.js → monaco-editor-BUU4dfTp.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bn6k8FMZ.js → monitoring-stats-row-W1kG1QMr.js} +1 -1
- package/dist/client/assets/{oauth-callback-RkcrzPY9.js → oauth-callback-TPVFfDa1.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-5c5f08wA.js → oauth-callback-ai-provider-BSrRnpyk.js} +1 -1
- package/dist/client/assets/{onboarding-DgNS0nCK.js → onboarding-K3muUGna.js} +1 -1
- package/dist/client/assets/{org-install-BAqLW3a2.js → org-install-B_NKJRUX.js} +1 -1
- package/dist/client/assets/{org-layout--7cqwMMu.js → org-layout-DS11FDyh.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-oYg4_27L.js → org-plugin-layout-Ds4SKE20.js} +1 -1
- package/dist/client/assets/{page-seo-form-BPPrLLbX.js → page-seo-form-CUXHyT3k.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DWN_jrpV.js +1 -0
- package/dist/client/assets/{pair-rD44zBRY.js → pair-DguDTLaz.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BrE2fclx.js → plugin-empty-state-BsOWqXT4.js} +1 -1
- package/dist/client/assets/{plugin-header-K2albhDB.js → plugin-header-CVnVRSWb.js} +1 -1
- package/dist/client/assets/{plugin-layout-QWYZgGti.js → plugin-layout-B-eexJrb.js} +1 -1
- package/dist/client/assets/{popover-BneLTlXE.js → popover-OWTo-ttg.js} +1 -1
- package/dist/client/assets/{post-editor-DtVXF5Vi.js → post-editor-9P0wvqVY.js} +1 -1
- package/dist/client/assets/{primitives-CGyfTuZM.js → primitives-BKz7PoD1.js} +1 -1
- package/dist/client/assets/{profile-DyIp4_Sh.js → profile-DKgH58jm.js} +1 -1
- package/dist/client/assets/project-app-view-aiPHbBMn.js +1 -0
- package/dist/client/assets/record-editor-CEd3Nq-X.js +1 -0
- package/dist/client/assets/registry-BJIUp0yq.js +2 -0
- package/dist/client/assets/{registry-layout-D_1w2T32.js → registry-layout-BVyz_YyX.js} +1 -1
- package/dist/client/assets/{require-capability-BYMVx09Z.js → require-capability-BNXWgOaA.js} +1 -1
- package/dist/client/assets/{required-auth-layout-cXbsWfNV.js → required-auth-layout-CgveTWoj.js} +1 -1
- package/dist/client/assets/{reset-password-CUBQj13G.js → reset-password-B5XJrRXo.js} +1 -1
- package/dist/client/assets/{resizable-DTSOtBpc.js → resizable-ZwB_SgdO.js} +1 -1
- package/dist/client/assets/{roles-CNJV2xc7.js → roles-B3qZ9FQm.js} +1 -1
- package/dist/client/assets/save-referenced-block-BWbuYBb2.js +1 -0
- package/dist/client/assets/{save-status-CFFENSy0.js → save-status-BAgQweyK.js} +1 -1
- package/dist/client/assets/{schema-form-EY1QOp8v.js → schema-form-CD60zPdr.js} +1 -1
- package/dist/client/assets/{scroll-area-CGmfUT4q.js → scroll-area-CixG0pJh.js} +1 -1
- package/dist/client/assets/{search-input-nds5g8eq.js → search-input-BfizHALq.js} +1 -1
- package/dist/client/assets/{secrets-D9isT8UG.js → secrets-hkT-vkWO.js} +1 -1
- package/dist/client/assets/{sections-editor-Bdjt3M_c.js → sections-editor-C7wGHkLQ.js} +1 -1
- package/dist/client/assets/{select-CXfOBpVA.js → select-DpIv2m7o.js} +1 -1
- package/dist/client/assets/{select-model-BLS2zNwN.js → select-model-DHqBdvUI.js} +1 -1
- package/dist/client/assets/{seo-editor-COMkxwHv.js → seo-editor-X4tutsUS.js} +1 -1
- package/dist/client/assets/{settings-layout-B65ypXYb.js → settings-layout-BPos4Lfi.js} +1 -1
- package/dist/client/assets/{settings-section-ysm1dXbe.js → settings-section-nvSL8mUn.js} +1 -1
- package/dist/client/assets/{sheet-DwJxE17f.js → sheet-J3PJeFDK.js} +1 -1
- package/dist/client/assets/{shell-controls-CghaJ_r9.js → shell-controls-CV-_zqGg.js} +1 -1
- package/dist/client/assets/{shell-layout-BI3SgcG0.js → shell-layout-tEjGEg5-.js} +1 -1
- package/dist/client/assets/{shell-route-loading-BQp4nxMc.js → shell-route-loading-CZqCIakz.js} +1 -1
- package/dist/client/assets/{sidebar-nhuTSqFS.js → sidebar-DawbXHdj.js} +1 -1
- package/dist/client/assets/{skeleton-DcZkQ-WQ.js → skeleton-BCgq4Xy6.js} +1 -1
- package/dist/client/assets/{sortable.esm-BJmSIQN6.js → sortable.esm-DsSid7Zp.js} +1 -1
- package/dist/client/assets/{spinner-C76OMH7i.js → spinner-BQT6CDh-.js} +1 -1
- package/dist/client/assets/{sso-Biwe8B2Y.js → sso-B1HWtZMn.js} +1 -1
- package/dist/client/assets/{store-DPy_WrJu.js → store-BfFFxnM0.js} +1 -1
- package/dist/client/assets/store-registry-DspBhmXB.js +2 -0
- package/dist/client/assets/{studio-tools-DP4PwlLL.js → studio-tools-Bsqb-6Fx.js} +1 -1
- package/dist/client/assets/{switch-Dlc-euH4.js → switch-Cu-9OUl1.js} +1 -1
- package/dist/client/assets/{tab-id-DrxIMKZC.js → tab-id-DxwgE0jf.js} +1 -1
- package/dist/client/assets/{table-BY5hmAW9.js → table-XS_vYE_1.js} +1 -1
- package/dist/client/assets/{tabs-MktB_dq3.js → tabs-B4F5NKqf.js} +1 -1
- package/dist/client/assets/{task-status-Bkjp3y0Q.js → task-status-OfocbInI.js} +1 -1
- package/dist/client/assets/{textarea-Dc7UpW7V.js → textarea-pwpin7Xo.js} +1 -1
- package/dist/client/assets/{toggle-group-PAs-hpFv.js → toggle-group-BTyEkyOV.js} +1 -1
- package/dist/client/assets/{toolbar-CCipnjie.js → toolbar-ZyghcYDs.js} +1 -1
- package/dist/client/assets/{tools-list-D8vEf5kn.js → tools-list-Dm-oDLPn.js} +1 -1
- package/dist/client/assets/{tooltip-DyNW-AXf.js → tooltip-C_pZvUmA.js} +1 -1
- package/dist/client/assets/{types-DYMMjWos.js → types-CVQ_neIF.js} +1 -1
- package/dist/client/assets/{use-ai-providers-C1UbdVdO.js → use-ai-providers-CGgTldnc.js} +1 -1
- package/dist/client/assets/{use-automations-DFVkTFjl.js → use-automations-C3tUJiXy.js} +1 -1
- package/dist/client/assets/{use-capability-Bw0k887i.js → use-capability-BcwY0Lf1.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DMfzqE_6.js → use-clock-tick-Bsu4JpY1.js} +1 -1
- package/dist/client/assets/{use-collections-DGD5HYrs.js → use-collections-CNY4Rigp.js} +1 -1
- package/dist/client/assets/{use-connection-XtO-eFJi.js → use-connection-Cd3-MJT5.js} +1 -1
- package/dist/client/assets/{use-copy-fHv0q1pV.js → use-copy-C62Opw3r.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DTGwia7F.js → use-create-virtual-mcp-JNvxHXlx.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-nDLl3CCi.js → use-debounced-autosave-CmpKlipe.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CWxG7WKN.js → use-delete-connection-DOqJ3DYp.js} +1 -1
- package/dist/client/assets/{use-file-configs-DhxZBYOT.js → use-file-configs-OSUx89xj.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D4S3aGR5.js → use-infinite-scroll-Ce2zTY3i.js} +1 -1
- package/dist/client/assets/{use-list-state-Cx82QFu_.js → use-list-state-B6GtGz_i.js} +1 -1
- package/dist/client/assets/{use-mcp-client-C8ZwZB20.js → use-mcp-client-Bqv2ciYo.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D2owAcPE.js → use-mcp-prompts-B2fIh5W5.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BW-64A4f.js → use-mcp-tools-DNa7v9SS.js} +1 -1
- package/dist/client/assets/{use-members-DPyxvdDj.js → use-members-BBAnZQ_N.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B9d6Q1VR.js → use-navigate-to-agent-CDxi6d1t.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BTTZUjKk.js → use-org-auth-client-BvIrqhMj.js} +1 -1
- package/dist/client/assets/{use-org-sso-B1KJDg2R.js → use-org-sso-DvInKERU.js} +1 -1
- package/dist/client/assets/{use-organization-roles-zS-vWU34.js → use-organization-roles-CrylSy9-.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CCLHoFg6.js → use-organization-settings-CdYVljPu.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CAyIHNjF.js → use-registry-connections-Bdnyk0np.js} +1 -1
- package/dist/client/assets/{use-secrets-CtwUwXaf.js → use-secrets-5xq_sQR4.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B27SY7cH.js → use-status-sounds-CugYppDe.js} +1 -1
- package/dist/client/assets/{use-view-mode-BRITAZ4S.js → use-view-mode-BmgcQL7Y.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DLQJqd7d.js → use-virtual-mcp-Clsr41cX.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CL1ZPxL1.js +1 -0
- package/dist/client/assets/{useRouterState-Y1aLUix_.js → useRouterState-BCoEdLHo.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B0dXZKGJ.js +1 -0
- package/dist/client/assets/{user-CLXOG3Qm.js → user-DNJpS6qb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D_5X7-ae.js → view-mode-toggle-CnJNM_yP.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-rXavNycp.js → watch-sse-pool-DiiHGFSQ.js} +1 -1
- package/dist/client/assets/{workflow-Bq61DMkg.js → workflow-DTPliqqz.js} +1 -1
- package/dist/client/assets/workflow-detail-DmBVM3K8.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-8bhdvSJz.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-Ccy-ptqT.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-BYcZYovC.js +0 -1
- package/dist/client/assets/page-seo-sheet-B3ue-ZRT.js +0 -1
- package/dist/client/assets/project-app-view-LYHB1B7I.js +0 -1
- package/dist/client/assets/record-editor-CoIz7HmY.js +0 -1
- package/dist/client/assets/registry-DusjF1MY.js +0 -2
- package/dist/client/assets/save-referenced-block-R6f1-KeE.js +0 -1
- package/dist/client/assets/store-registry-D7UNS3l2.js +0 -2
- package/dist/client/assets/useInfiniteQuery-G_6i7LOo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BhcYyKm_.js +0 -1
- package/dist/client/assets/workflow-detail-BJvoV5gO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as V,R as C,aE as ne,aG as le,aH as he,aF as xe,b7 as me,e as z,H as ge,G as be,r as O,j as s,C as Ee,n as Q,z as ye,p as oe,F as re,a as J,K as G,m as ve,c as ue,B as L,t as je,E as Fe}from"./index-Dv-yFpKM.js";import{i as Re}from"./AlertCircle-asB0zjf2.js";import{P as te}from"./index-CfhwhmtA.js";import{S as ae}from"./skeleton-DcZkQ-WQ.js";import{b as _e,a as ce,S as de,c as $e}from"./settings-section-ysm1dXbe.js";import{u as X,b as se,c as Se}from"./use-ai-providers-C1UbdVdO.js";import{i as Oe}from"./CheckCircle-B7v5_MG4.js";import{p as Me}from"./chat-context-BUN4BStS.js";import{e as Te,f as ze}from"./use-organization-settings-CCLHoFg6.js";import{M as Ue}from"./select-model-BLS2zNwN.js";import{u as qe}from"./use-debounced-autosave-nDLl3CCi.js";import{I as ie}from"./input-B16LqKMQ.js";import{a as fe,T as Le}from"./toggle-group-PAs-hpFv.js";import{b as ke,c as Ie,d as Ce,f as Ne,a as Pe,e as we,g as Ae,A as De}from"./alert-dialog-DUUnhBc6.js";import{u as W}from"./studio-tools-DP4PwlLL.js";import{s as Ve}from"./Plus-DcxLSicT.js";import{i as Ge}from"./Tool01-DNz0OMpT.js";import{s as Be}from"./Trash01-rpak8qu1.js";import{A as Qe}from"./avatar-BqYC23h9.js";import{O as Ke,P as Ye,c as pe}from"./agent-icons-oFY-K2bC.js";import{a as We}from"./RefreshCcw01-Dd5D2uNm.js";import{s as He}from"./Eye-CFpoJQMe.js";import{d as Je,b as Xe,c as Ze,a as et,D as tt}from"./dialog-dItkri_7.js";import{S as st}from"./spinner-C76OMH7i.js";import{f as it}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as ot}from"./require-capability-BYMVx09Z.js";import"./sidebar-nhuTSqFS.js";import"./LayoutLeft-BG08KNqc.js";import"./tooltip-DyNW-AXf.js";import"./sheet-DwJxE17f.js";import"./X-DxE022Fo.js";import"./card-BlzflWCA.js";import"./ArrowUpRight-DRnt_VKh.js";import"./use-mcp-client-C8ZwZB20.js";import"./auth-DTxUlSLU.js";import"./tab-id-DrxIMKZC.js";import"./watch-sse-pool-rXavNycp.js";import"./decopilot-sse-pool-BYcZYovC.js";import"./use-virtual-mcp-DLQJqd7d.js";import"./use-collections-DGD5HYrs.js";import"./drawer-CiKI2xvg.js";import"./User01-BWllfXHj.js";import"./checkbox-C1s8UE6Y.js";import"./Check-CNRVH6xs.js";import"./select-CXfOBpVA.js";import"./ChevronDown-BKkz3Gyp.js";import"./ChevronUp-BeDEmrn1.js";import"./Key01-CDAkGspz.js";import"./SearchMd-2GibIebB.js";import"./Settings02-D0kdZjJD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-gdKmZQTW.js";import"./ChevronRight-DixPnH3V.js";import"./connect-desktop-dialog-Ccy-ptqT.js";import"./Stars01-B2PA7s4d.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-Bw0k887i.js";import"./access-gate-u6bqRJWi.js";import"./capability-load-error-DWbE5k9a.js";V({title:C(),url:C(),icon:C()});V({registries:le(C(),V({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ne(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const H=V({keyId:C(),modelId:C(),title:C().optional()}).nullable();xe(["fast","smart","thinking","image","web_research"]);xe(["fast","smart","thinking"]);const rt=V({tiers:V({fast:H,smart:H,thinking:H,image:H,web_research:H})});V({ids:ne(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});V({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:V({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:V({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ne(le(C(),me())).nullable().optional().describe("Brand images"),metadata:le(C(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const lt=e=>e.capabilities?.includes("image")===!0,nt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},at=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:lt},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:nt}];function ct(e){const t=z.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:l}=e,r=X(),[x,_]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&_(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let a;t[2]!==d?(a=[d],t[2]=d,t[3]=a):a=t[3],O.useEffect(b,a);const m=x??l;let c;t[4]!==m||t[5]!==r?(c=m?r.find(y=>y.id===m):null,t[4]=m,t[5]=r,t[6]=c):c=t[6];const u=c,{models:g,isLoading:v}=se(o?m??void 0:void 0),j=o?v||g.some(o):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(o&&!j){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>_(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==n?(h=y=>{const R=y.keyId??m??"";_(R),n({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=n,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==o||t[17]!==k||t[18]!==h?(p=s.jsx(Ue,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:o,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=o,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function dt(e){const t=z.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function mt(){const e=z.c(42),t=X(),i=Te(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ge(rt),e[0]=o):o=e[0];let l;e[1]!==i?(l={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const r=be(l),{mutate:x,isPending:_,isSuccess:b}=ze(),d=r.formState.isDirty;let a;e[3]!==r||e[4]!==i||e[5]!==x?(a={delayMs:250,save:async()=>{const S=r.getValues();x(S,{onSuccess:()=>r.reset(S,{keepValues:!0}),onError:w=>{r.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=r,e[4]=i,e[5]=x,e[6]=a):a=e[6];const{schedule:m}=qe(a),c=t[0],u=t[1],g=t[2],{models:v}=se(c?.id),{models:j}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==r||e[8]!==n?(k=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==v||e[17]!==j||e[18]!==f?(h=()=>{const S=r.getValues(),w=new Set(t.map(ut)),F={};c?.id&&(F[c.id]=v),u?.id&&(F[u.id]=j),g?.id&&(F[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),N={fast:P(S.tiers.fast)?null:S.tiers.fast,smart:P(S.tiers.smart)?null:S.tiers.smart,thinking:P(S.tiers.thinking)?null:S.tiers.thinking,image:P(S.tiers.image)?null:S.tiers.image,web_research:P(S.tiers.web_research)?null:S.tiers.web_research},q=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,U=N.fast===S.tiers.fast&&N.smart===S.tiers.smart&&N.thinking===S.tiers.thinking&&N.image===S.tiers.image&&N.web_research===S.tiers.web_research;if(!q&&U)return;const B=Me(t,F);r.reset({tiers:{fast:N.fast??B.chat.fast,smart:N.smart??B.chat.smart,thinking:N.thinking??B.chat.thinking,image:N.image??B.image,web_research:N.web_research??B.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=c,e[14]=u,e[15]=g,e[16]=v,e[17]=j,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==R?(M=[r,t,v,j,f,p,y,R],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=f,e[25]=p,e[26]=y,e[27]=R,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const $=b&&!d;let A;e[30]!==_||e[31]!==$?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(dt,{isPending:_,showSaved:$})]}),e[30]=_,e[31]=$,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==m?(D=at.map(S=>s.jsx(Ee,{control:r.control,name:`tiers.${S.key}`,render:w=>{const{field:F}=w;return s.jsx(_e,{title:S.label,description:S.description,action:s.jsx(ct,{slot:F.value,defaultKeyId:t[0]?.id??null,filterModels:S.filter,onSlotChange:P=>{F.onChange(P),m()}})})}},S.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=m,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(ce,{children:D}),e[37]=D,e[38]=K):K=e[38];let E;return e[39]!==A||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=E):E=e[41],E}function ut(e){return e.id}const ft={usd:[10,20,100],brl:[50,100,500]};function pt(){const e=z.c(26),t=W(),[i,n]=O.useState(!1),{mutate:o,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:xt,onError:ht}),[r,x]=O.useState(""),[_,b]=O.useState("usd"),d=_,a=parseFloat(r),m=!isNaN(a)&&a>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,v;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),v=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=v):(g=e[2],v=e[3]);let j;e[4]!==d||e[5]!==u?(j=s.jsxs(Le,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,v]}),e[4]=d,e[5]=u,e[6]=j):j=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==o?(f=!i&&s.jsxs(s.Fragment,{children:[ft[d].map(h=>s.jsxs(L,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>o(h*100),children:[c,h]},h)),s.jsx(L,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=o,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==r||e[15]!==a||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==o?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:r,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(L,{className:"h-10",disabled:!m||l,onClick:()=>o(Math.round(a*100)),children:l?"...":"Add"}),s.jsx(L,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=r,e[15]=a,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=o,e[21]=k):k=e[21];let I;return e[22]!==j||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,f,k]})}),e[22]=j,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function ht(e){Q.error(`Top-up failed: ${e.message}`)}function xt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function gt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function bt(){const e=z.c(58),{org:t}=oe(),i=W(),n=re(),o=X();let l;e[0]!==o?(l=o.find(vt),e[0]=o,e[1]=l):l=e[1];const r=l,[x,_]=O.useState(!1);let b;e[2]!==r||e[3]!==i?(b=async()=>{r&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==n?(d=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),_(!1)},e[5]=t.id,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==b||e[9]!==d?(a={mutationFn:b,onSuccess:d,onError:yt},e[8]=b,e[9]=d,e[10]=a):a=e[10];const{mutate:m,isPending:c}=J(a);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!r;let v;e[13]!==i?(v=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=v):v=e[14];let j;e[15]!==u||e[16]!==g||e[17]!==v?(j={queryKey:u,enabled:g,staleTime:6e4,queryFn:v},e[15]=u,e[16]=g,e[17]=v,e[18]=j):j=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(j);if(!r)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const R=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>_(!0),e[22]=T):T=e[22];let $;e[23]!==c?($=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(L,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=$):$=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=A):A=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ne,{children:"Cancel"}),e[26]=D):D=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[A,s.jsxs(we,{children:[D,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(De,{open:x,onOpenChange:_,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let S;e[32]!==p||e[33]!==R||e[34]!==h||e[35]!==k?(S=k||h?s.jsx(ae,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&>(p)),children:R}),e[32]=p,e[33]=R,e[34]=h,e[35]=k,e[36]=S):S=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const F=h&&"animate-spin";let P;e[39]!==F?(P=ue(F),e[39]=F,e[40]=P):P=e[40];let N;e[41]!==P?(N=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=N):N=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==N?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:N}),e[43]=h,e[44]=w,e[45]=N,e[46]=q):q=e[46];let U;e[47]!==S||e[48]!==q?(U=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,q]}),e[47]=S,e[48]=q,e[49]=U):U=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=B):B=e[50];let Y;e[51]!==U?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[U,B]}),e[51]=U,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(pt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==$||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[$,E,Y,Z]})})}),e[54]=$,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function yt(e){Q.error(`Failed to disconnect: ${e.message}`)}function vt(e){return e.providerId==="deco"}function jt(){const e=z.c(8),{org:t}=oe(),i=W(),n=re();let o;e[0]!==i?(o=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t||e[3]!==n?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r={mutationFn:o,onSuccess:l,onError:_t},e[5]=o,e[6]=l,e[7]=r):r=e[7],J(r)}function _t(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function St(){const e=z.c(10),{mutate:t,isPending:i}=jt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const _=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==_?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,r,s.jsx(L,{variant:"outline",disabled:i,onClick:x,children:_})]})]}),e[6]=i,e[7]=x,e[8]=_,e[9]=b):b=e[9],b}const kt=V({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function It({providerKey:e,provider:t,preset:i,maskedKey:n,currentLabel:o,currentBaseUrl:l,onCancel:r,onSuccess:x}){const{org:_}=oe(),b=W(),d=re(),[a,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:v,watch:j,formState:{errors:f}}=be({resolver:ge(kt),defaultValues:{label:o,apiKey:"",baseUrl:l??""}}),k=j("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(_.id)}),d.invalidateQueries({queryKey:G.aiProviders(_.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:v(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:a&&k?"text":"password",placeholder:n,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!a),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?s.jsx(We,{size:14}):s.jsx(He,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Je,{children:[s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:h,children:"Cancel"}),s.jsx(L,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function Ct(e){const t=z.c(28),{providerKey:i,provider:n,open:o,onOpenChange:l}=e,r=W();let x;t[0]!==n.id||t[1]!==i.presetId?(x=n.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=n.id,t[1]=i.presetId,t[2]=x):x=t[2];const _=x,b=_?.name??n.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let a;t[5]!==i.id||t[6]!==r?(a=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=r,t[7]=a):a=t[7];let m;t[8]!==o||t[9]!==d||t[10]!==a?(m={queryKey:d,queryFn:a,enabled:o,staleTime:0},t[8]=o,t[9]=d,t[10]=a,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(Xe,{children:s.jsxs(Ze,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let v;t[14]!==u||t[15]!==l||t[16]!==_||t[17]!==c||t[18]!==n||t[19]!==i?(v=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(st,{})}):s.jsx(It,{providerKey:i,provider:n,preset:_,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=_,t[17]=c,t[18]=n,t[19]=i,t[20]=v):v=t[20];let j;t[21]!==g||t[22]!==v?(j=s.jsxs(et,{className:"sm:max-w-md",children:[g,v]}),t[21]=g,t[22]=v,t[23]=j):j=t[23];let f;return t[24]!==l||t[25]!==o||t[26]!==j?(f=s.jsx(tt,{open:o,onOpenChange:l,children:j}),t[24]=l,t[25]=o,t[26]=j,t[27]=f):f=t[27],f}function Nt(e){const t=z.c(48),{providerKey:i,provider:n}=e,{org:o}=oe(),l=W(),r=re(),[x,_]=O.useState(!1),[b,d]=O.useState(!1),a=n.id==="openai-compatible";let m;t[0]!==a||t[1]!==i.presetId?(m=a&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=a,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:a?"Custom OpenAI-compatible":n.name,g=c?.logo??n.logo;let v;e:{if(a){v=i.label;break e}const q=i.label;let U;t[3]!==i.createdAt?(U=it(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=U):U=t[4],v=`${q} · added ${U} ago`}const j=v;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==o||t[9]!==i.id||t[10]!==r?(k=()=>{r.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),r.invalidateQueries({queryKey:G.aiProviders(o.id)}),r.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),_(!1)},t[8]=o,t[9]=i.id,t[10]=r,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:Pt},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Qe,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ge,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>_(!0),T=s.jsx(Be,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let $;t[21]!==p?($=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=$):$=t[22];let A;t[23]!==j||t[24]!==u||t[25]!==$||t[26]!==y?(A=s.jsx(_e,{icon:y,title:u,description:j,action:$}),t[23]=j,t[24]=u,t[25]=$,t[26]=y,t[27]=A):A=t[27];let D;t[28]!==b||t[29]!==n||t[30]!==i?(D=s.jsx(Ct,{providerKey:i,provider:n,open:b,onOpenChange:d}),t[28]=b,t[29]=n,t[30]=i,t[31]=D):D=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let S;t[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ne,{children:"Cancel"}),t[35]=S):S=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[S,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let F;t[38]!==E||t[39]!==w?(F=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=F):F=t[40];let P;t[41]!==x||t[42]!==F?(P=s.jsx(De,{open:x,onOpenChange:_,children:F}),t[41]=x,t[42]=F,t[43]=P):P=t[43];let N;return t[44]!==A||t[45]!==D||t[46]!==P?(N=s.jsxs(s.Fragment,{children:[A,D,P]}),t[44]=A,t[45]=D,t[46]=P,t[47]=N):N=t[47],N}function Pt(e){return Q.error(`Failed to delete key: ${e.message}`)}function wt(e){const t=z.c(11),{onConnectClick:i}=e,n=X(),o=Se();let l;t[0]!==o?.providers?(l=o?.providers??[],t[0]=o?.providers,t[1]=l):l=t[1];const r=l;let x;if(t[2]!==n||t[3]!==i||t[4]!==r){let _;t[6]!==r?(_=m=>({key:m,provider:r.find(c=>c.id===m.providerId)}),t[6]=r,t[7]=_):_=t[7];const b=n.filter(Kt).map(_).filter(Dt);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ve,{size:14}),t[8]=d):d=t[8];let a;t[9]!==i?(a=s.jsxs(L,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=a):a=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:a,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=x}else x=t[5];return x}function At(e){const{key:t,provider:i}=e;return s.jsx(Nt,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Kt(e){return e.providerId!=="deco"}function Et(e){const t=z.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Ft(){const e=z.c(23),t=X();let i;e[0]!==t?(i=t.some(Rt),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[l,r]=O.useState(!1),[x,_]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const a=d;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let f;e[5]!==a?(f=s.jsx(Ye,{providers:a,onSelect:_,onShowAll:j}),e[5]=a,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(_(null),r(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-16 w-full"}),children:s.jsx(mt,{})}),e[14]=m):m=e[14];let c;e[15]!==n?(c=n?s.jsx(bt,{}):s.jsx(St,{}),e[15]=n,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(wt,{onConnectClick:()=>r(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:r}),e[18]=l,e[19]=g):g=e[19];let v;return e[20]!==c||e[21]!==g?(v=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=v):v=e[22],v}function Rt(e){return e.providerId==="deco"}function $t(){const e=z.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs($e,{children:[t,s.jsx(Fe,{fallback:Ot,children:s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-64 w-full"}),children:s.jsx(Ft,{})})})]})})})}),e[1]=i):i=e[1],i}function Ot(e){const{error:t}=e;return s.jsx(Et,{error:t??new Error("Failed to load AI providers")})}function Ls(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx($t,{})}),e[0]=t):t=e[0],t}export{Ls as default};
|
|
1
|
+
import{P as V,R as C,aE as ne,aG as le,aH as he,aF as xe,b7 as me,e as z,H as ge,G as be,r as O,j as s,C as Ee,n as Q,z as ye,p as oe,F as re,a as J,K as G,m as ve,c as ue,B as L,t as je,E as Fe}from"./index-uVHAmIsb.js";import{i as Re}from"./AlertCircle-DjOU_aot.js";import{P as te}from"./index-DxJD6aw-.js";import{S as ae}from"./skeleton-BCgq4Xy6.js";import{b as _e,a as ce,S as de,c as $e}from"./settings-section-nvSL8mUn.js";import{u as X,b as se,c as Se}from"./use-ai-providers-CGgTldnc.js";import{i as Oe}from"./CheckCircle-XS4dmEOs.js";import{p as Me}from"./chat-context-CEWm5eLB.js";import{e as Te,f as ze}from"./use-organization-settings-CdYVljPu.js";import{M as Ue}from"./select-model-DHqBdvUI.js";import{u as qe}from"./use-debounced-autosave-CmpKlipe.js";import{I as ie}from"./input-BYcDxHNs.js";import{a as fe,T as Le}from"./toggle-group-BTyEkyOV.js";import{b as ke,c as Ie,d as Ce,f as Ne,a as Pe,e as we,g as Ae,A as De}from"./alert-dialog-B2k_N3ZX.js";import{u as W}from"./studio-tools-Bsqb-6Fx.js";import{s as Ve}from"./Plus-aXWGGcSy.js";import{i as Ge}from"./Tool01-DC4THSlP.js";import{s as Be}from"./Trash01-DBSukaq0.js";import{A as Qe}from"./avatar-BG2RlqaT.js";import{O as Ke,P as Ye,c as pe}from"./agent-icons-CDVkEkIq.js";import{a as We}from"./RefreshCcw01-DS1vtLKW.js";import{s as He}from"./Eye-BIZqMr-y.js";import{d as Je,b as Xe,c as Ze,a as et,D as tt}from"./dialog-BwBYyWWk.js";import{S as st}from"./spinner-BQT6CDh-.js";import{f as it}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as ot}from"./require-capability-BNXWgOaA.js";import"./sidebar-DawbXHdj.js";import"./LayoutLeft-CY1OP6dH.js";import"./tooltip-C_pZvUmA.js";import"./sheet-J3PJeFDK.js";import"./X-B1W1F4mo.js";import"./card-ykuj7mlf.js";import"./ArrowUpRight-BXJMGk9i.js";import"./use-mcp-client-Bqv2ciYo.js";import"./auth-ClbRbdVv.js";import"./tab-id-DxwgE0jf.js";import"./watch-sse-pool-DiiHGFSQ.js";import"./decopilot-sse-pool-BZ8GwOYU.js";import"./use-virtual-mcp-Clsr41cX.js";import"./use-collections-CNY4Rigp.js";import"./drawer-QIeXv6B7.js";import"./User01-Bweqikx-.js";import"./checkbox-BKpSRHdU.js";import"./Check-D7HZW6oZ.js";import"./select-DpIv2m7o.js";import"./ChevronDown-CxTVikeq.js";import"./ChevronUp-Dbc77Gwp.js";import"./Key01-DZeJDklU.js";import"./SearchMd-Cr6CluRw.js";import"./Settings02-DeH66RiM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-_FIjo4ge.js";import"./ChevronRight-3jD7TdJZ.js";import"./connect-desktop-dialog-DrC4f6Q3.js";import"./Stars01-Bw7_Rdwp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BcwY0Lf1.js";import"./access-gate-CVMVVI4n.js";import"./capability-load-error-BfCjxOlU.js";V({title:C(),url:C(),icon:C()});V({registries:le(C(),V({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ne(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const H=V({keyId:C(),modelId:C(),title:C().optional()}).nullable();xe(["fast","smart","thinking","image","web_research"]);xe(["fast","smart","thinking"]);const rt=V({tiers:V({fast:H,smart:H,thinking:H,image:H,web_research:H})});V({ids:ne(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});V({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:V({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:V({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ne(le(C(),me())).nullable().optional().describe("Brand images"),metadata:le(C(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const lt=e=>e.capabilities?.includes("image")===!0,nt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},at=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:lt},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:nt}];function ct(e){const t=z.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:l}=e,r=X(),[x,_]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&_(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let a;t[2]!==d?(a=[d],t[2]=d,t[3]=a):a=t[3],O.useEffect(b,a);const m=x??l;let c;t[4]!==m||t[5]!==r?(c=m?r.find(y=>y.id===m):null,t[4]=m,t[5]=r,t[6]=c):c=t[6];const u=c,{models:g,isLoading:v}=se(o?m??void 0:void 0),j=o?v||g.some(o):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(o&&!j){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>_(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==n?(h=y=>{const R=y.keyId??m??"";_(R),n({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=n,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==o||t[17]!==k||t[18]!==h?(p=s.jsx(Ue,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:o,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=o,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function dt(e){const t=z.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function mt(){const e=z.c(42),t=X(),i=Te(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ge(rt),e[0]=o):o=e[0];let l;e[1]!==i?(l={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const r=be(l),{mutate:x,isPending:_,isSuccess:b}=ze(),d=r.formState.isDirty;let a;e[3]!==r||e[4]!==i||e[5]!==x?(a={delayMs:250,save:async()=>{const S=r.getValues();x(S,{onSuccess:()=>r.reset(S,{keepValues:!0}),onError:w=>{r.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=r,e[4]=i,e[5]=x,e[6]=a):a=e[6];const{schedule:m}=qe(a),c=t[0],u=t[1],g=t[2],{models:v}=se(c?.id),{models:j}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==r||e[8]!==n?(k=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==v||e[17]!==j||e[18]!==f?(h=()=>{const S=r.getValues(),w=new Set(t.map(ut)),F={};c?.id&&(F[c.id]=v),u?.id&&(F[u.id]=j),g?.id&&(F[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),N={fast:P(S.tiers.fast)?null:S.tiers.fast,smart:P(S.tiers.smart)?null:S.tiers.smart,thinking:P(S.tiers.thinking)?null:S.tiers.thinking,image:P(S.tiers.image)?null:S.tiers.image,web_research:P(S.tiers.web_research)?null:S.tiers.web_research},q=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,U=N.fast===S.tiers.fast&&N.smart===S.tiers.smart&&N.thinking===S.tiers.thinking&&N.image===S.tiers.image&&N.web_research===S.tiers.web_research;if(!q&&U)return;const B=Me(t,F);r.reset({tiers:{fast:N.fast??B.chat.fast,smart:N.smart??B.chat.smart,thinking:N.thinking??B.chat.thinking,image:N.image??B.image,web_research:N.web_research??B.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=c,e[14]=u,e[15]=g,e[16]=v,e[17]=j,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==R?(M=[r,t,v,j,f,p,y,R],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=f,e[25]=p,e[26]=y,e[27]=R,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const $=b&&!d;let A;e[30]!==_||e[31]!==$?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(dt,{isPending:_,showSaved:$})]}),e[30]=_,e[31]=$,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==m?(D=at.map(S=>s.jsx(Ee,{control:r.control,name:`tiers.${S.key}`,render:w=>{const{field:F}=w;return s.jsx(_e,{title:S.label,description:S.description,action:s.jsx(ct,{slot:F.value,defaultKeyId:t[0]?.id??null,filterModels:S.filter,onSlotChange:P=>{F.onChange(P),m()}})})}},S.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=m,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(ce,{children:D}),e[37]=D,e[38]=K):K=e[38];let E;return e[39]!==A||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=E):E=e[41],E}function ut(e){return e.id}const ft={usd:[10,20,100],brl:[50,100,500]};function pt(){const e=z.c(26),t=W(),[i,n]=O.useState(!1),{mutate:o,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:xt,onError:ht}),[r,x]=O.useState(""),[_,b]=O.useState("usd"),d=_,a=parseFloat(r),m=!isNaN(a)&&a>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,v;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),v=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=v):(g=e[2],v=e[3]);let j;e[4]!==d||e[5]!==u?(j=s.jsxs(Le,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,v]}),e[4]=d,e[5]=u,e[6]=j):j=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==o?(f=!i&&s.jsxs(s.Fragment,{children:[ft[d].map(h=>s.jsxs(L,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>o(h*100),children:[c,h]},h)),s.jsx(L,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=o,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==r||e[15]!==a||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==o?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:r,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(L,{className:"h-10",disabled:!m||l,onClick:()=>o(Math.round(a*100)),children:l?"...":"Add"}),s.jsx(L,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=r,e[15]=a,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=o,e[21]=k):k=e[21];let I;return e[22]!==j||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,f,k]})}),e[22]=j,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function ht(e){Q.error(`Top-up failed: ${e.message}`)}function xt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function gt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function bt(){const e=z.c(58),{org:t}=oe(),i=W(),n=re(),o=X();let l;e[0]!==o?(l=o.find(vt),e[0]=o,e[1]=l):l=e[1];const r=l,[x,_]=O.useState(!1);let b;e[2]!==r||e[3]!==i?(b=async()=>{r&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==n?(d=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),_(!1)},e[5]=t.id,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==b||e[9]!==d?(a={mutationFn:b,onSuccess:d,onError:yt},e[8]=b,e[9]=d,e[10]=a):a=e[10];const{mutate:m,isPending:c}=J(a);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!r;let v;e[13]!==i?(v=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=v):v=e[14];let j;e[15]!==u||e[16]!==g||e[17]!==v?(j={queryKey:u,enabled:g,staleTime:6e4,queryFn:v},e[15]=u,e[16]=g,e[17]=v,e[18]=j):j=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(j);if(!r)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const R=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>_(!0),e[22]=T):T=e[22];let $;e[23]!==c?($=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(L,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=$):$=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=A):A=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ne,{children:"Cancel"}),e[26]=D):D=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[A,s.jsxs(we,{children:[D,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(De,{open:x,onOpenChange:_,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let S;e[32]!==p||e[33]!==R||e[34]!==h||e[35]!==k?(S=k||h?s.jsx(ae,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&>(p)),children:R}),e[32]=p,e[33]=R,e[34]=h,e[35]=k,e[36]=S):S=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const F=h&&"animate-spin";let P;e[39]!==F?(P=ue(F),e[39]=F,e[40]=P):P=e[40];let N;e[41]!==P?(N=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=N):N=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==N?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:N}),e[43]=h,e[44]=w,e[45]=N,e[46]=q):q=e[46];let U;e[47]!==S||e[48]!==q?(U=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,q]}),e[47]=S,e[48]=q,e[49]=U):U=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=B):B=e[50];let Y;e[51]!==U?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[U,B]}),e[51]=U,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(pt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==$||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[$,E,Y,Z]})})}),e[54]=$,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function yt(e){Q.error(`Failed to disconnect: ${e.message}`)}function vt(e){return e.providerId==="deco"}function jt(){const e=z.c(8),{org:t}=oe(),i=W(),n=re();let o;e[0]!==i?(o=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t||e[3]!==n?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r={mutationFn:o,onSuccess:l,onError:_t},e[5]=o,e[6]=l,e[7]=r):r=e[7],J(r)}function _t(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function St(){const e=z.c(10),{mutate:t,isPending:i}=jt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const _=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==_?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,r,s.jsx(L,{variant:"outline",disabled:i,onClick:x,children:_})]})]}),e[6]=i,e[7]=x,e[8]=_,e[9]=b):b=e[9],b}const kt=V({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function It({providerKey:e,provider:t,preset:i,maskedKey:n,currentLabel:o,currentBaseUrl:l,onCancel:r,onSuccess:x}){const{org:_}=oe(),b=W(),d=re(),[a,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:v,watch:j,formState:{errors:f}}=be({resolver:ge(kt),defaultValues:{label:o,apiKey:"",baseUrl:l??""}}),k=j("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(_.id)}),d.invalidateQueries({queryKey:G.aiProviders(_.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:v(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:a&&k?"text":"password",placeholder:n,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!a),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?s.jsx(We,{size:14}):s.jsx(He,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Je,{children:[s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:h,children:"Cancel"}),s.jsx(L,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function Ct(e){const t=z.c(28),{providerKey:i,provider:n,open:o,onOpenChange:l}=e,r=W();let x;t[0]!==n.id||t[1]!==i.presetId?(x=n.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=n.id,t[1]=i.presetId,t[2]=x):x=t[2];const _=x,b=_?.name??n.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let a;t[5]!==i.id||t[6]!==r?(a=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=r,t[7]=a):a=t[7];let m;t[8]!==o||t[9]!==d||t[10]!==a?(m={queryKey:d,queryFn:a,enabled:o,staleTime:0},t[8]=o,t[9]=d,t[10]=a,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(Xe,{children:s.jsxs(Ze,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let v;t[14]!==u||t[15]!==l||t[16]!==_||t[17]!==c||t[18]!==n||t[19]!==i?(v=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(st,{})}):s.jsx(It,{providerKey:i,provider:n,preset:_,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=_,t[17]=c,t[18]=n,t[19]=i,t[20]=v):v=t[20];let j;t[21]!==g||t[22]!==v?(j=s.jsxs(et,{className:"sm:max-w-md",children:[g,v]}),t[21]=g,t[22]=v,t[23]=j):j=t[23];let f;return t[24]!==l||t[25]!==o||t[26]!==j?(f=s.jsx(tt,{open:o,onOpenChange:l,children:j}),t[24]=l,t[25]=o,t[26]=j,t[27]=f):f=t[27],f}function Nt(e){const t=z.c(48),{providerKey:i,provider:n}=e,{org:o}=oe(),l=W(),r=re(),[x,_]=O.useState(!1),[b,d]=O.useState(!1),a=n.id==="openai-compatible";let m;t[0]!==a||t[1]!==i.presetId?(m=a&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=a,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:a?"Custom OpenAI-compatible":n.name,g=c?.logo??n.logo;let v;e:{if(a){v=i.label;break e}const q=i.label;let U;t[3]!==i.createdAt?(U=it(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=U):U=t[4],v=`${q} · added ${U} ago`}const j=v;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==o||t[9]!==i.id||t[10]!==r?(k=()=>{r.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),r.invalidateQueries({queryKey:G.aiProviders(o.id)}),r.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),_(!1)},t[8]=o,t[9]=i.id,t[10]=r,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:Pt},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Qe,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ge,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>_(!0),T=s.jsx(Be,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let $;t[21]!==p?($=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=$):$=t[22];let A;t[23]!==j||t[24]!==u||t[25]!==$||t[26]!==y?(A=s.jsx(_e,{icon:y,title:u,description:j,action:$}),t[23]=j,t[24]=u,t[25]=$,t[26]=y,t[27]=A):A=t[27];let D;t[28]!==b||t[29]!==n||t[30]!==i?(D=s.jsx(Ct,{providerKey:i,provider:n,open:b,onOpenChange:d}),t[28]=b,t[29]=n,t[30]=i,t[31]=D):D=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let S;t[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ne,{children:"Cancel"}),t[35]=S):S=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[S,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let F;t[38]!==E||t[39]!==w?(F=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=F):F=t[40];let P;t[41]!==x||t[42]!==F?(P=s.jsx(De,{open:x,onOpenChange:_,children:F}),t[41]=x,t[42]=F,t[43]=P):P=t[43];let N;return t[44]!==A||t[45]!==D||t[46]!==P?(N=s.jsxs(s.Fragment,{children:[A,D,P]}),t[44]=A,t[45]=D,t[46]=P,t[47]=N):N=t[47],N}function Pt(e){return Q.error(`Failed to delete key: ${e.message}`)}function wt(e){const t=z.c(11),{onConnectClick:i}=e,n=X(),o=Se();let l;t[0]!==o?.providers?(l=o?.providers??[],t[0]=o?.providers,t[1]=l):l=t[1];const r=l;let x;if(t[2]!==n||t[3]!==i||t[4]!==r){let _;t[6]!==r?(_=m=>({key:m,provider:r.find(c=>c.id===m.providerId)}),t[6]=r,t[7]=_):_=t[7];const b=n.filter(Kt).map(_).filter(Dt);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ve,{size:14}),t[8]=d):d=t[8];let a;t[9]!==i?(a=s.jsxs(L,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=a):a=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:a,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=x}else x=t[5];return x}function At(e){const{key:t,provider:i}=e;return s.jsx(Nt,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Kt(e){return e.providerId!=="deco"}function Et(e){const t=z.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Ft(){const e=z.c(23),t=X();let i;e[0]!==t?(i=t.some(Rt),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[l,r]=O.useState(!1),[x,_]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const a=d;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let f;e[5]!==a?(f=s.jsx(Ye,{providers:a,onSelect:_,onShowAll:j}),e[5]=a,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(_(null),r(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-16 w-full"}),children:s.jsx(mt,{})}),e[14]=m):m=e[14];let c;e[15]!==n?(c=n?s.jsx(bt,{}):s.jsx(St,{}),e[15]=n,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(wt,{onConnectClick:()=>r(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:r}),e[18]=l,e[19]=g):g=e[19];let v;return e[20]!==c||e[21]!==g?(v=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=v):v=e[22],v}function Rt(e){return e.providerId==="deco"}function $t(){const e=z.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs($e,{children:[t,s.jsx(Fe,{fallback:Ot,children:s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-64 w-full"}),children:s.jsx(Ft,{})})})]})})})}),e[1]=i):i=e[1],i}function Ot(e){const{error:t}=e;return s.jsx(Et,{error:t??new Error("Failed to load AI providers")})}function Ls(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx($t,{})}),e[0]=t):t=e[0],t}export{Ls as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,c as o,j as c,bq as d}from"./index-
|
|
1
|
+
import{e as n,c as o,j as c,bq as d}from"./index-uVHAmIsb.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,bu as m,j as r,dp as A,dm as w,dn as T,dL as O,bB as M,a5 as I,cw as L,dM as D,cx as z,dA as F,ad as G,dq as k,cy as q,e as n,c as p,dN as v}from"./index-
|
|
1
|
+
import{r as i,bu as m,j as r,dp as A,dm as w,dn as T,dL as O,bB as M,a5 as I,cw as L,dM as D,cx as z,dA as F,ad as G,dq as k,cy as q,e as n,c as p,dN as v}from"./index-uVHAmIsb.js";var x="AlertDialog",[B]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});V.displayName=H;var W="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=W;var Y="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});_.displayName=Y;var f="AlertDialogContent",[J,K]=B(f),Q=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as W,r as B,j as e,c as X,l as Y}from"./index-uVHAmIsb.js";import{i as Z}from"./ChevronRight-3jD7TdJZ.js";import{S as tt}from"./scroll-area-CixG0pJh.js";import{aa as et,ab as rt,f as ot}from"./index--1Ng2vB4.js";import{c as it}from"./save-referenced-block-BWbuYBb2.js";import{S as mt}from"./schema-form-CD60zPdr.js";import{S as pt}from"./save-status-BAgQweyK.js";import"./select-DpIv2m7o.js";import"./tooltip-C_pZvUmA.js";import"./Check-D7HZW6oZ.js";import"./ChevronDown-CxTVikeq.js";import"./ChevronUp-Dbc77Gwp.js";import"./agent-capabilities-n5Q1YbJ5.js";import"./chat-context-CEWm5eLB.js";import"./tab-id-DxwgE0jf.js";import"./use-mcp-client-Bqv2ciYo.js";import"./auth-ClbRbdVv.js";import"./watch-sse-pool-DiiHGFSQ.js";import"./decopilot-sse-pool-BZ8GwOYU.js";import"./studio-tools-Bsqb-6Fx.js";import"./use-virtual-mcp-Clsr41cX.js";import"./use-collections-CNY4Rigp.js";import"./use-ai-providers-CGgTldnc.js";import"./use-organization-settings-CdYVljPu.js";import"./pair-DguDTLaz.js";import"./agent-icon-CCGqC-bl.js";import"./AlertCircle-DjOU_aot.js";import"./Tool01-DC4THSlP.js";import"./SwitchHorizontal01-Blia-yUi.js";import"./RefreshCcw01-DS1vtLKW.js";import"./XCircle-BtUzMyFW.js";import"./ArrowUpRight-BXJMGk9i.js";import"./ZapSquare-BQX2HOTP.js";import"./Users03-DiilXFZ6.js";import"./CheckCircle-XS4dmEOs.js";import"./ChevronLeft-BEmN2X52.js";import"./DotsVertical-Cz5MZln-.js";import"./Container-Hfp9SJFa.js";import"./Eye-BIZqMr-y.js";import"./ZoomOut-DC46Ewts.js";import"./Globe01-CiCGKTg3.js";import"./FilterLines-iroXgkwP.js";import"./Star01-pwvCfpNJ.js";import"./Palette-BDd6wxPD.js";import"./HardDrive-B26C8dI3.js";import"./Stars02-vcxNwhIa.js";import"./Key01-DZeJDklU.js";import"./LayoutLeft-CY1OP6dH.js";import"./LinkExternal01-DwxMIV-o.js";import"./Monitor01-_FIjo4ge.js";import"./Sun-De2vWRC7.js";import"./Play-C933mY5z.js";import"./Plus-aXWGGcSy.js";import"./SearchMd-Cr6CluRw.js";import"./Settings02-DeH66RiM.js";import"./Shield01-0kTDalL_.js";import"./Stars01-Bw7_Rdwp.js";import"./Trash01-DBSukaq0.js";import"./Upload01-DruP7_KV.js";import"./User01-Bweqikx-.js";import"./Users01-N436STOJ.js";import"./XClose-r0gXvFlp.js";import"./X-B1W1F4mo.js";import"./Zap-Dvtyg5Ik.js";import"./use-clock-tick-Bsu4JpY1.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C62Opw3r.js";import"./file-type-icon-B6AnVMPu.js";import"./dialog-BwBYyWWk.js";import"./content-blocks-o63cs2vh.js";import"./types-CVQ_neIF.js";import"./shell-layout-tEjGEg5-.js";import"./avatar-BG2RlqaT.js";import"./required-auth-layout-CgveTWoj.js";import"./useRouterState-BCoEdLHo.js";import"./use-org-sso-DvInKERU.js";import"./integration-icon-YIddy6rU.js";import"./use-navigate-to-agent-CDxi6d1t.js";import"./use-connection-Cd3-MJT5.js";import"./use-mcp-prompts-B2fIh5W5.js";import"./form-Z86e6etr.js";import"./label-6YORzGJ9.js";import"./input-BYcDxHNs.js";import"./spinner-BQT6CDh-.js";import"./drawer-QIeXv6B7.js";import"./collection-search-C5MSFdhR.js";import"./tabs-B4F5NKqf.js";import"./toggle-group-BTyEkyOV.js";import"./sortable.esm-DsSid7Zp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-aeOBPbSz.js";import"./use-registry-connections-Bdnyk0np.js";import"./useInfiniteQuery-CL1ZPxL1.js";import"./use-infinite-scroll-Ce2zTY3i.js";import"./extract-connection-data-Dz_jOB39.js";import"./generate-id-C7CxZwCs.js";import"./collections-Cs_tB6Xp.js";import"./card-ykuj7mlf.js";import"./collection-tabs-CAVXo49Z.js";import"./badge-DIN7Nq6a.js";import"./textarea-pwpin7Xo.js";import"./connection-form-helpers-C2pw-OdH.js";import"./useSuspenseInfiniteQuery-B0dXZKGJ.js";import"./mcp-oauth-Bqzn0Dif.js";import"./connect-desktop-dialog-DrC4f6Q3.js";import"./agent-icons-CDVkEkIq.js";import"./checkbox-BKpSRHdU.js";import"./skeleton-BCgq4Xy6.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-nvSL8mUn.js";import"./popover-OWTo-ttg.js";import"./command-ClPkeFT9.js";import"./index-CiRwseKn.js";import"./index-Nc3tqGu_.js";import"./dropdown-menu-CL4WEQRf.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-CZqCIakz.js";import"./sidebar-DawbXHdj.js";import"./sheet-J3PJeFDK.js";import"./toolbar-ZyghcYDs.js";import"./use-create-virtual-mcp-JNvxHXlx.js";import"./github-repo-picker-BlgfXLdP.js";import"./use-mcp-tools-DNa7v9SS.js";import"./alert-dialog-B2k_N3ZX.js";import"./index-CmVsJNWn.js";import"./use-org-auth-client-BvIrqhMj.js";import"./hover-card-DCrCVVSt.js";import"./task-status-OfocbInI.js";import"./use-status-sounds-CugYppDe.js";import"./empty-state-BKLgisam.js";import"./resizable-ZwB_SgdO.js";import"./use-capability-BcwY0Lf1.js";import"./header-tab-button-BOZYRinC.js";import"./index-1vLRIaGM.js";import"./user-DNJpS6qb.js";import"./tools-list-Dm-oDLPn.js";import"./switch-Cu-9OUl1.js";import"./use-debounced-autosave-CmpKlipe.js";import"./index-DxJD6aw-.js";import"./search-input-BfizHALq.js";import"./use-secrets-5xq_sQR4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-DBJsIIHl.js";import"./view-mode-toggle-CnJNM_yP.js";import"./select-model-DHqBdvUI.js";import"./use-automations-C3tUJiXy.js";import"./monaco-editor-BUU4dfTp.js";import"./automation-runs-BIJek_K_.js";import"./table-XS_vYE_1.js";import"./use-members-BBAnZQ_N.js";import"./automation-list-row-CXD-x28t.js";import"./calendar-RJSiIOON.js";import"./image-field-CnaeZ7Cq.js";import"./use-file-configs-OSUx89xj.js";function eo(E){const t=W.c(51),{orgSlug:R,virtualMcpId:P,branch:$,blockKey:r,block:m,meta:p,decofile:C,title:F,excludeFields:K,schemaPending:M}=E,V=M===void 0?!1:M,a=typeof m?.__resolveType=="string"?m.__resolveType:"";let v;t[0]!==K||t[1]!==p||t[2]!==a?(v=et(a,p,K),t[0]=K,t[1]=p,t[2]=a,t[3]=v):v=t[3];const s=v;let b;t[4]!==s?(b=!!s&&Object.keys(s.properties??{}).length>0,t[4]=s,t[5]=b):b=t[5];const T=b;let g;t[6]!==m||t[7]!==r||t[8]!==p||t[9]!==F?(g=F??(m?rt(r,m,p):r),t[6]=m,t[7]=r,t[8]=p,t[9]=F,t[10]=g):g=t[10];const n=g;let j;t[11]!==$||t[12]!==R||t[13]!==P?(j={orgSlug:R,virtualMcpId:P,branch:$},t[11]=$,t[12]=R,t[13]=P,t[14]=j):j=t[14];const{save:c,isPending:A}=ot(j);let y;t[15]!==c?(y=it((l,i)=>c(l,i)),t[15]=c,t[16]=y):y=t[16];const L=y,[G,H]=B.useState(r),[J,q]=B.useState(null),[z,Q]=B.useState(0);let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=[],t[17]=S):S=t[17];const[o,O]=B.useState(S);G!==r&&(H(r),q(null),Q(st),O([]));let N;t[18]!==m?(N=m??{},t[18]=m,t[19]=N):N=t[19];const D=J??N;let k;t[20]!==r||t[21]!==a||t[22]!==c?(k=l=>{const i=l;q(i),c(r,{...i,__resolveType:a})},t[20]=r,t[21]=a,t[22]=c,t[23]=k):k=t[23];const I=k;let _;t[24]!==o||t[25]!==n?(_=o.length>0?[n,...o]:[],t[24]=o,t[25]=n,t[26]=_):_=t[26];const h=_;let d;t[27]!==o||t[28]!==h||t[29]!==n?(d=h.length>0?e.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:h.map((l,i)=>{const U=i===h.length-1;return e.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&e.jsx(Z,{className:"size-3 shrink-0 text-muted-foreground/60"}),e.jsx("button",{type:"button",onClick:()=>O(i===0?[]:o.slice(0,i)),title:l,className:X("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",U?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:l})]},`${l}-${i}`)})}):e.jsx("span",{className:"text-sm font-medium",children:n}),t[27]=o,t[28]=h,t[29]=n,t[30]=d):d=t[30];let f;t[31]!==A?(f=e.jsx(pt,{isPending:A,isError:!1}),t[31]=A,t[32]=f):f=t[32];let u;t[33]!==d||t[34]!==f?(u=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[d,f]}),t[33]=d,t[34]=f,t[35]=u):u=t[35];let x;t[36]!==r||t[37]!==o||t[38]!==C||t[39]!==D||t[40]!==z||t[41]!==I||t[42]!==T||t[43]!==p||t[44]!==L||t[45]!==s||t[46]!==V?(x=e.jsx(tt,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-6",children:e.jsx("div",{className:"mx-auto max-w-xl",children:T?e.jsx(mt,{schema:s,value:D,onChange:I,basePath:"",breadcrumbPath:o,onBreadcrumbChange:O,decofile:C,meta:p,onSaveReferencedBlock:L},`${r}:${z}`):V?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Y,{size:16,className:"animate-spin"}),"Loading app schema…"]}):e.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[36]=r,t[37]=o,t[38]=C,t[39]=D,t[40]=z,t[41]=I,t[42]=T,t[43]=p,t[44]=L,t[45]=s,t[46]=V,t[47]=x):x=t[47];let w;return t[48]!==u||t[49]!==x?(w=e.jsxs("div",{className:"flex h-full flex-col",children:[u,x]}),t[48]=u,t[49]=x,t[50]=w):w=t[50],w}function st(E){return E+1}export{eo as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cE as v,cF as $,cG as W,cH as L,cI as H,cJ as D,cK as V,cL as x,cM as q,cN as j,cO as y,cP as N,cQ as B,cR as F,cS as Z}from"./index-Dv-yFpKM.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
|
|
1
|
+
import{cE as v,cF as $,cG as W,cH as L,cI as H,cJ as D,cK as V,cL as x,cM as q,cN as j,cO as y,cP as N,cQ as B,cR as F,cS as Z}from"./index-uVHAmIsb.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-
|
|
1
|
+
import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-uVHAmIsb.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,j as i}from"./index-
|
|
1
|
+
import{e as o,j as i}from"./index-uVHAmIsb.js";function f(r){const e=o.c(9),{children:n,visual:c}=r;let l;e[0]!==n?(l=i.jsx("section",{className:"flex flex-1 items-center justify-center bg-sidebar p-6 md:p-10",children:i.jsx("div",{className:"w-full max-w-[440px]",children:n})}),e[0]=n,e[1]=l):l=e[1];let s;e[2]!==c?(s=c??i.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[2]=c,e[3]=s):s=e[3];let t;e[4]!==s?(t=i.jsx("aside",{className:"relative hidden md:flex flex-1 overflow-hidden bg-muted",children:s}),e[4]=s,e[5]=t):t=e[5];let a;return e[6]!==l||e[7]!==t?(a=i.jsxs("main",{className:"flex min-h-screen w-full",children:[l,t]}),e[6]=l,e[7]=t,e[8]=a):a=e[8],a}export{f as A};
|
package/dist/client/assets/{automation-list-row-atv_xAlK.js → automation-list-row-CXD-x28t.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as E,r as F,c as $,j as t,B as K}from"./index-
|
|
1
|
+
import{e as E,r as F,c as $,j as t,B as K}from"./index-uVHAmIsb.js";import{b as O,d as B,e as I,g as L,c as H,f as V,a as q,A as G}from"./alert-dialog-B2k_N3ZX.js";import{a as J,D as Q,b as U,c as W}from"./dropdown-menu-CL4WEQRf.js";import{A as X,R as Y}from"./agent-icon-CCGqC-bl.js";import{i as Z}from"./DotsVertical-Cz5MZln-.js";import{s as ee}from"./Trash01-DBSukaq0.js";import{i as te}from"./Zap-Dvtyg5Ik.js";import{u as se}from"./use-virtual-mcp-Clsr41cX.js";import{u as ne}from"./use-automations-C3tUJiXy.js";function pe(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=se(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const R=A,T=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let c;e[5]!==T?(c=$("inline-block size-2 rounded-full shrink-0",T),e[5]=T,e[6]=c):c=e[6];const M=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==M?(m=t.jsx("span",{className:c,"aria-label":M}),e[7]=c,e[8]=M,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(X,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(J,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Z,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(Q,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(ee,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==R||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:R,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=R,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(V,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(q,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(G,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(te,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{pe as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as ne,r as ce,c as be,j as t,B as fe,K as xe,m as Ve,E as tt,p as st}from"./index-Dv-yFpKM.js";import{u as ze}from"./useInfiniteQuery-G_6i7LOo.js";import{u as lt}from"./use-connection-XtO-eFJi.js";import{i as nt,g as at,a as rt,u as it}from"./use-mcp-client-C8ZwZB20.js";import{a as ot}from"./use-virtual-mcp-DLQJqd7d.js";import{C as ct}from"./card-BlzflWCA.js";import{a as Ke,b as qe,S as dt,d as mt}from"./sheet-DwJxE17f.js";import{c as Ge,d as He,a as Ne,e as se,b as Be,T as le}from"./table-BY5hmAW9.js";import{E as Se}from"./empty-state-Wjey2haZ.js";import{u as ke}from"./use-infinite-scroll-D4S3aGR5.js";import{u as ut}from"./use-members-DPyxvdDj.js";import{S as ue}from"./task-status-Bkjp3y0Q.js";import{e as ft}from"./use-automations-DFVkTFjl.js";import{u as xt}from"./studio-tools-DP4PwlLL.js";import{u as ht}from"./useSuspenseInfiniteQuery-BhcYyKm_.js";import{B as je}from"./badge-CGZjMX2o.js";import{S as gt,a as pt,b as jt,c as ge,d as bt}from"./select-CXfOBpVA.js";import{C as Le}from"./checkbox-C1s8UE6Y.js";import{t as he}from"./ChevronDown-BKkz3Gyp.js";import{c as Nt,C as vt,e as Fe,d as St,a as yt,b as wt}from"./command-ETJRln9I.js";import{a as Je,b as Qe,P as Ze}from"./popover-BneLTlXE.js";import{A as We}from"./avatar-BqYC23h9.js";import{n as ye}from"./ChevronUp-BeDEmrn1.js";import{n as Ie}from"./Container-C41D-bwR.js";import{i as _t}from"./FilterLines-htpqKUqo.js";import{m as Ct,n as Tt}from"./pair-rD44zBRY.js";import{I as Pe}from"./integration-icon-7cYHs9rV.js";function Ue(l){const e=ne.c(74),{options:s,onValueChange:n,defaultValue:r,placeholder:i,variant:a,animation:d,maxCount:c,modalPopover:o,asChild:j,className:N,disabled:v,onSearchChange:m}=l;let b;e[0]!==r?(b=r===void 0?[]:r,e[0]=r,e[1]=b):b=e[1];const x=b,p=i===void 0?"Select items":i,h=a===void 0?"default":a,u=d===void 0?0:d,S=c===void 0?3:c,f=o===void 0?!1:o,C=j===void 0?!1:j,w=v===void 0?!1:v,[g,y]=ce.useState(x),[T,_]=ce.useState(!1);let k,P;e[2]!==x||e[3]!==g?(k=()=>{JSON.stringify(g)!==JSON.stringify(x)&&y(x)},P=[x,g],e[2]=x,e[3]=g,e[4]=k,e[5]=P):(k=e[4],P=e[5]),ce.useEffect(k,P);let I;e[6]!==n||e[7]!==g?(I=$=>{if($.key==="Enter")_(!0);else if($.key==="Backspace"&&!$.currentTarget.value){const B=[...g];B.pop(),y(B),n(B)}},e[6]=n,e[7]=g,e[8]=I):I=e[8];const D=I;let M;e[9]!==n||e[10]!==g?(M=$=>{const B=g.includes($.value)?g.filter(me=>me!==$.value):[...g,$.value];y(B),n(B)},e[9]=n,e[10]=g,e[11]=M):M=e[11];const A=M;let L;e[12]!==n?(L=()=>{y([]),n([])},e[12]=n,e[13]=L):L=e[13];const K=L;let q;e[14]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{_(Mt)},e[14]=q):q=e[14];const Q=q;let J;e[15]!==K||e[16]!==n||e[17]!==s||e[18]!==g.length?(J=()=>{if(g.length===s.length)K();else{const $=s.map(Pt);y($),n($)}},e[15]=K,e[16]=n,e[17]=s,e[18]=g.length,e[19]=J):J=e[19];const E=J;let U;e[20]!==C?(U=C?{}:{variant:"outline"},e[20]=C,e[21]=U):U=e[21];let O;e[22]!==N?(O=be("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",N),e[22]=N,e[23]=O):O=e[23];let V;e[24]!==u||e[25]!==S||e[26]!==s||e[27]!==p||e[28]!==g||e[29]!==h?(V=g.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[g.slice(0,S).map($=>{const B=s.find(ve=>ve.value===$),me=B?.icon;return t.jsxs(je,{variant:h==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${u}s`},children:[me&&t.jsx(me,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:B?.label})]},$)}),g.length>S&&t.jsxs(je,{variant:h==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${u}s`},children:["+",g.length-S]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(he,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:p}),t.jsx(he,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=u,e[25]=S,e[26]=s,e[27]=p,e[28]=g,e[29]=h,e[30]=V):V=e[30];let F;e[31]!==w||e[32]!==U||e[33]!==O||e[34]!==V?(F=t.jsx(Je,{asChild:!0,children:t.jsx(fe,{ref:null,...U,onClick:Q,className:O,disabled:w,children:V})}),e[31]=w,e[32]=U,e[33]=O,e[34]=V,e[35]=F):F=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=()=>_(!1),e[36]=G):G=e[36];const X=!m;let z;e[37]!==D||e[38]!==m?(z=t.jsx(Nt,{placeholder:"Search...",onKeyDown:D,onValueChange:m,className:"rounded-t-xl"}),e[37]=D,e[38]=m,e[39]=z):z=e[39];let ee;e[40]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(vt,{children:"No results found."}),e[40]=ee):ee=e[40];let te;e[41]!==E?(te=()=>{E()},e[41]=E,e[42]=te):te=e[42];let Z;e[43]!==E?(Z=$=>{$.stopPropagation(),E()},e[43]=E,e[44]=Z):Z=e[44];const de=g.length===s.length&&s.length>0;let ae;e[45]!==de||e[46]!==E?(ae=t.jsx(Le,{checked:de,onCheckedChange:E,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:It}),e[45]=de,e[46]=E,e[47]=ae):ae=e[47];let re;e[48]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx("span",{children:"(Select All)"}),e[48]=re):re=e[48];let W;e[49]!==Z||e[50]!==ae?(W=t.jsxs("div",{className:"flex items-center w-full",onClick:Z,children:[ae,re]}),e[49]=Z,e[50]=ae,e[51]=W):W=e[51];let Y;e[52]!==te||e[53]!==W?(Y=t.jsx(Fe,{onSelect:te,className:"cursor-pointer",children:W},"all"),e[52]=te,e[53]=W,e[54]=Y):Y=e[54];let ie;if(e[55]!==s||e[56]!==g||e[57]!==A){let $;e[59]!==g||e[60]!==A?($=B=>{const me=g.includes(B.value);return t.jsx(Fe,{onSelect:()=>{A(B)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ve=>{ve.stopPropagation(),A(B)},children:[t.jsx(Le,{checked:me,onCheckedChange:()=>{A(B)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:kt}),B.icon&&t.jsx(B.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:B.label})]})},B.value)},e[59]=g,e[60]=A,e[61]=$):$=e[61],ie=s.map($),e[55]=s,e[56]=g,e[57]=A,e[58]=ie}else ie=e[58];let R;e[62]!==Y||e[63]!==ie?(R=t.jsxs(St,{className:"rounded-b-xl",children:[ee,t.jsxs(yt,{children:[Y,ie]})]}),e[62]=Y,e[63]=ie,e[64]=R):R=e[64];let H;e[65]!==X||e[66]!==z||e[67]!==R?(H=t.jsx(Qe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:G,children:t.jsxs(wt,{shouldFilter:X,className:"rounded-xl",children:[z,R]})}),e[65]=X,e[66]=z,e[67]=R,e[68]=H):H=e[68];let oe;return e[69]!==T||e[70]!==f||e[71]!==F||e[72]!==H?(oe=t.jsxs(Ze,{open:T,onOpenChange:_,modal:f,children:[F,H]}),e[69]=T,e[70]=f,e[71]=F,e[72]=H,e[73]=oe):oe=e[73],oe}function kt(l){return l.stopPropagation()}function It(l){return l.stopPropagation()}function Pt(l){return l.value}function Mt(l){return!l}const Ye=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],Dt=40;function Ts(l){const s=(l.endDate.getTime()-l.startDate.getTime())/Dt;return Ye.find(r=>r.ms>=s)?.label??"1d"}function Me(l){const e=Ye.find(i=>i.label===l);if(e)return e.ms;const s=/^(\d+)([mhd])$/.exec(l);if(!s)return 6e4;const n=parseInt(s[1],10),r=s[2];return r==="h"?n*36e5:r==="d"?n*864e5:n*6e4}function Rt(l,e){const s=new Date(l);return Me(e)>=864e5?s.toLocaleDateString([],{month:"short",day:"numeric"}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Oe(l,e){const s=Me(e);return new Date(Math.floor(l.getTime()/s)*s)}function At(l){return l>=1e4?`${(l/1e3).toFixed(1)}s`:`${Math.round(l)}ms`}function De(l){return Number.isFinite(l)?l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:Math.round(l).toLocaleString():"0"}function Re(l){return Number.isFinite(l)?`$${l.toFixed(l<1?4:2)}`:"$0.00"}function ks(l,e,s){const n=Me(s),r=Oe(e.startDate,s).getTime(),i=e.endDate.getTime(),a=new Map(l.map(c=>[Oe(new Date(c.timestamp),s).getTime(),c])),d=[];for(let c=r;c<=i;c+=n){const o=a.get(c),j=new Date(c).toISOString();d.push({t:j,ts:c,label:Rt(j,s),calls:o?.calls??0,errors:o?.errors??0,errorRate:o?.errorRate??0,avg:o?.avg??0,p50:o?.p50??0,p95:o?.p95??0,inputTokens:o?.inputTokens??0,outputTokens:o?.outputTokens??0,totalTokens:o?.totalTokens??0,costUsd:o?.costUsd??0})}return d}function Is(l,e){return e==="requests"?l.calls:e==="errors"?l.errorRate:l.avgDurationMs}function Ps(l,e){return e==="requests"?l.calls.toLocaleString():e==="errors"?`${l.errorRate.toFixed(1)}%`:At(l.avgDurationMs)}function Ae(l){return(l.run_config??{}).agent?.id??(l.virtual_mcp_id||null)}function Ee(l,e,s,n){if(!l)return n;const r=e.find(a=>a.id===l)??s?.find(a=>a.id===l);if(r?.title)return r.title;const i=nt(l);return i?at(i).title??n:l}function $e(l,e,s){return l?(e.find(r=>r.id===l)??s?.find(r=>r.id===l))?.icon??null:null}function Xe(l){return l?.data?.members??[]}function we(l){const e=ne.c(33),{thread:s,connections:n,virtualMcps:r,selectedIndex:i,total:a,onPrev:d,onNext:c}=l;let o,j;if(e[0]!==n||e[1]!==s||e[2]!==r){const k=Ae(s);o=Ee(k,r,n,""),j=$e(k,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=j}else o=e[3],j=e[4];const N=j,v=o||s.title;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{}),e[5]=m):m=e[5];let b;e[6]!==N||e[7]!==v?(b=t.jsx(Pe,{icon:N,name:v,size:"sm",fallbackIcon:m,className:"shadow-sm shrink-0 rounded-md"}),e[6]=N,e[7]=v,e[8]=b):b=e[8];let x;e[9]!==s.title?(x=t.jsx(dt,{className:"text-sm leading-snug truncate",children:s.title}),e[9]=s.title,e[10]=x):x=e[10];let p;e[11]!==o?(p=o&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:o}),e[11]=o,e[12]=p):p=e[12];let h;e[13]!==x||e[14]!==p?(h=t.jsxs("div",{className:"min-w-0",children:[x,p]}),e[13]=x,e[14]=p,e[15]=h):h=e[15];let u;e[16]!==b||e[17]!==h?(u=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b,h]}),e[16]=b,e[17]=h,e[18]=u):u=e[18];const S=i===0;let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ye,{size:14}),e[19]=f):f=e[19];let C;e[20]!==d||e[21]!==S?(C=t.jsx(fe,{size:"icon",variant:"ghost",onClick:d,disabled:S,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous thread",children:f}),e[20]=d,e[21]=S,e[22]=C):C=e[22];const w=i===a-1;let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(he,{size:14}),e[23]=g):g=e[23];let y;e[24]!==c||e[25]!==w?(y=t.jsx(fe,{size:"icon",variant:"ghost",onClick:c,disabled:w,className:"h-7 w-7 text-muted-foreground","aria-label":"Next thread",children:g}),e[24]=c,e[25]=w,e[26]=y):y=e[26];let T;e[27]!==C||e[28]!==y?(T=t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[C,y]}),e[27]=C,e[28]=y,e[29]=T):T=e[29];let _;return e[30]!==T||e[31]!==u?(_=t.jsx(mt,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[u,T]})}),e[30]=T,e[31]=u,e[32]=_):_=e[32],_}function Et(l){const e=ne.c(48),{thread:s,connections:n,virtualMcps:r,members:i}=l;let a,d;if(e[0]!==n||e[1]!==s||e[2]!==r){const M=Ae(s);a=Ee(M,r,n,""),d=$e(M,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=d}else a=e[3],d=e[4];const c=d;let o;if(e[5]!==i||e[6]!==s.created_by){const M=Xe(i);let A;e[8]!==s.created_by?(A=L=>L.userId===s.created_by,e[8]=s.created_by,e[9]=A):A=e[9],o=M.find(A),e[5]=i,e[6]=s.created_by,e[7]=o}else o=e[7];const j=o;let N;e[10]!==j?.user.email||e[11]!==j?.user.name||e[12]!==s.created_by?(N=j?.user.name??j?.user.email??s.created_by?.substring(0,8)??"—",e[10]=j?.user.email,e[11]=j?.user.name,e[12]=s.created_by,e[13]=N):N=e[13];const v=N,m=j?.user.image??void 0;let b;e[14]!==s.created_at?(b=new Date(s.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=s.created_at,e[15]=b):b=e[15];const x=b,p=ue[s.status]??ue.completed,h=p.icon;let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=u):u=e[16];let S;e[17]!==h||e[18]!==p.iconClassName?(S=t.jsx(h,{size:13,className:p.iconClassName}),e[17]=h,e[18]=p.iconClassName,e[19]=S):S=e[19];let f;e[20]!==p.labelColor?(f=be("text-sm",p.labelColor),e[20]=p.labelColor,e[21]=f):f=e[21];let C;e[22]!==p.label||e[23]!==f?(C=t.jsx("span",{className:f,children:p.label}),e[22]=p.label,e[23]=f,e[24]=C):C=e[24];let w;e[25]!==S||e[26]!==C?(w=t.jsxs("div",{children:[u,t.jsxs("div",{className:"flex items-center gap-1.5",children:[S,C]})]}),e[25]=S,e[26]=C,e[27]=w):w=e[27];let g;e[28]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=g):g=e[28];let y;e[29]!==x?(y=t.jsxs("div",{children:[g,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[29]=x,e[30]=y):y=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[31]=T):T=e[31];let _;e[32]!==m||e[33]!==v?(_=t.jsx(We,{url:m,fallback:v,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=m,e[33]=v,e[34]=_):_=e[34];let k;e[35]!==v?(k=t.jsx("span",{className:"text-sm text-foreground",children:v}),e[35]=v,e[36]=k):k=e[36];let P;e[37]!==_||e[38]!==k?(P=t.jsxs("div",{children:[T,t.jsxs("div",{className:"flex items-center gap-2",children:[_,k]})]}),e[37]=_,e[38]=k,e[39]=P):P=e[39];let I;e[40]!==c||e[41]!==a?(I=a&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pe,{icon:c,name:a,size:"xs",fallbackIcon:t.jsx(Ie,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"text-sm text-foreground",children:a})]})]}),e[40]=c,e[41]=a,e[42]=I):I=e[42];let D;return e[43]!==y||e[44]!==P||e[45]!==I||e[46]!==w?(D=t.jsxs("div",{className:"px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[w,y,P,I]}),e[43]=y,e[44]=P,e[45]=I,e[46]=w,e[47]=D):D=e[47],D}function $t(l){const e=ne.c(72),{thread:s,usage:n,members:r,connections:i,virtualMcps:a,onClick:d,lastRowRef:c}=l;let o,j;if(e[0]!==i||e[1]!==s||e[2]!==a){const F=Ae(s);o=Ee(F,a,i,"—"),j=$e(F,a,i),e[0]=i,e[1]=s,e[2]=a,e[3]=o,e[4]=j}else o=e[3],j=e[4];const N=j;let v;if(e[5]!==r||e[6]!==s.created_by){const F=Xe(r);let G;e[8]!==s.created_by?(G=X=>X.userId===s.created_by,e[8]=s.created_by,e[9]=G):G=e[9],v=F.find(G),e[5]=r,e[6]=s.created_by,e[7]=v}else v=e[7];const m=v;let b;e[10]!==m?.user.email||e[11]!==m?.user.name||e[12]!==s.created_by?(b=m?.user.name??m?.user.email??s.created_by?.substring(0,8)??"—",e[10]=m?.user.email,e[11]=m?.user.name,e[12]=s.created_by,e[13]=b):b=e[13];const x=b,p=m?.user.image??void 0;let h,u;if(e[14]!==s.created_at){const F=new Date(s.created_at);h=F.toLocaleDateString("en-US",{month:"short",day:"numeric"}),u=F.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=s.created_at,e[15]=h,e[16]=u}else h=e[15],u=e[16];const S=u,f=ue[s.status]??ue.completed,C=f.icon;let w;e[17]!==s.title?(w=t.jsx(le,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[17]=s.title,e[18]=w):w=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{}),e[19]=g):g=e[19];let y;e[20]!==N||e[21]!==o?(y=t.jsx(Pe,{icon:N,name:o,size:"xs",fallbackIcon:g,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=N,e[21]=o,e[22]=y):y=e[22];let T;e[23]!==o?(T=t.jsx("span",{className:"truncate",children:o}),e[23]=o,e[24]=T):T=e[24];let _;e[25]!==y||e[26]!==T?(_=t.jsx(le,{className:"w-36 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,T]})}),e[25]=y,e[26]=T,e[27]=_):_=e[27];let k;e[28]!==p||e[29]!==x?(k=t.jsx(We,{url:p,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=p,e[29]=x,e[30]=k):k=e[30];let P;e[31]!==x?(P=t.jsx("span",{className:"truncate",children:x}),e[31]=x,e[32]=P):P=e[32];let I;e[33]!==k||e[34]!==P?(I=t.jsx(le,{className:"w-28 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,P]})}),e[33]=k,e[34]=P,e[35]=I):I=e[35];let D;e[36]!==C||e[37]!==f.iconClassName?(D=t.jsx(C,{size:14,className:f.iconClassName}),e[36]=C,e[37]=f.iconClassName,e[38]=D):D=e[38];let M;e[39]!==f.labelColor?(M=be("text-sm",f.labelColor),e[39]=f.labelColor,e[40]=M):M=e[40];let A;e[41]!==f.label||e[42]!==M?(A=t.jsx("span",{className:M,children:f.label}),e[41]=f.label,e[42]=M,e[43]=A):A=e[43];let L;e[44]!==D||e[45]!==A?(L=t.jsx(le,{className:"w-24 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[D,A]})}),e[44]=D,e[45]=A,e[46]=L):L=e[46];let K;e[47]!==n?(K=n?De(n.totalTokens):"—",e[47]=n,e[48]=K):K=e[48];let q;e[49]!==K?(q=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:K}),e[49]=K,e[50]=q):q=e[50];let Q;e[51]!==n?(Q=n&&n.costUsd>0?Re(n.costUsd):"—",e[51]=n,e[52]=Q):Q=e[52];let J;e[53]!==Q?(J=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:Q}),e[53]=Q,e[54]=J):J=e[54];let E;e[55]!==h?(E=t.jsx("div",{children:h}),e[55]=h,e[56]=E):E=e[56];let U;e[57]!==S?(U=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:S}),e[57]=S,e[58]=U):U=e[58];let O;e[59]!==E||e[60]!==U?(O=t.jsxs(le,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[E,U]}),e[59]=E,e[60]=U,e[61]=O):O=e[61];let V;return e[62]!==c||e[63]!==d||e[64]!==I||e[65]!==L||e[66]!==q||e[67]!==J||e[68]!==O||e[69]!==w||e[70]!==_?(V=t.jsxs(Ne,{ref:c,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:d,children:[w,_,I,L,q,J,O]}),e[62]=c,e[63]=d,e[64]=I,e[65]=L,e[66]=q,e[67]=J,e[68]=O,e[69]=w,e[70]=_,e[71]=V):V=e[71],V}const _e=100;function Lt(l){const e=ne.c(37),{client:s,locator:n,thread:r,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}=l;let v;e[0]!==n||e[1]!==r.id?(v=xe.threadMessages(n,r.id),e[0]=n,e[1]=r.id,e[2]=v):v=e[2];let m;e[3]!==s||e[4]!==r.id?(m=async P=>{const{pageParam:I}=P,D=I===void 0?0:I;if(!s)throw new Error("MCP client is not available");const M=await s.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:r.id,limit:_e,offset:D}});return M.structuredContent??M},e[3]=s,e[4]=r.id,e[5]=m):m=e[5];let b;e[6]!==v||e[7]!==m?(b={queryKey:v,queryFn:m,initialPageParam:0,getNextPageParam:Ot,staleTime:6e4},e[6]=v,e[7]=m,e[8]=b):b=e[8];const{data:x,fetchNextPage:p,hasNextPage:h,isFetchingNextPage:u}=ht(b);let S;e[9]!==x.pages?(S=x.pages.flatMap(Ut).filter(Ft),e[9]=x.pages,e[10]=S):S=e[10];const f=S,C=Ct(f);let w;e[11]!==p||e[12]!==h||e[13]!==u?(w=()=>{h&&!u&&p()},e[11]=p,e[12]=h,e[13]=u,e[14]=w):w=e[14];const g=ke(w,h??!1,u);let y;e[15]!==i||e[16]!==N||e[17]!==j||e[18]!==c||e[19]!==r||e[20]!==o||e[21]!==a?(y=t.jsx(we,{thread:r,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[15]=i,e[16]=N,e[17]=j,e[18]=c,e[19]=r,e[20]=o,e[21]=a,e[22]=y):y=e[22];let T;e[23]!==i||e[24]!==d||e[25]!==r||e[26]!==a?(T=t.jsx(Et,{thread:r,connections:i,virtualMcps:a,members:d}),e[23]=i,e[24]=d,e[25]=r,e[26]=a,e[27]=T):T=e[27];let _;e[28]!==u||e[29]!==g||e[30]!==C||e[31]!==f.length?(_=f.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No messages in this thread"}):t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:t.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[C.map((P,I)=>t.jsx("div",{ref:I===C.length-1?g:void 0,children:t.jsx(Tt,{pair:P,isLastPair:I===C.length-1,status:"ready"})},`pair-${P.user?.id??P.assistant?.id}`)),u&&t.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=u,e[29]=g,e[30]=C,e[31]=f.length,e[32]=_):_=e[32];let k;return e[33]!==y||e[34]!==T||e[35]!==_?(k=t.jsxs(t.Fragment,{children:[y,T,_]}),e[33]=y,e[34]=T,e[35]=_,e[36]=k):k=e[36],k}function Ft(l){return l.role==="user"||l.role==="assistant"}function Ut(l){return l.items??[]}function Ot(l,e){const s=l,n=e;if(!((s?.items?.length??0)<_e))return n.length*_e}function et(l){const e=ne.c(39),{thread:s,client:n,locator:r,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}=l;let v;e[0]!==i||e[1]!==N||e[2]!==j||e[3]!==c||e[4]!==s||e[5]!==o||e[6]!==a?(v=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[0]=i,e[1]=N,e[2]=j,e[3]=c,e[4]=s,e[5]=o,e[6]=a,e[7]=v):v=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=m):m=e[8];let b;e[9]!==v?(b=t.jsxs(t.Fragment,{children:[v,m]}),e[9]=v,e[10]=b):b=e[10];let x;e[11]!==i||e[12]!==N||e[13]!==j||e[14]!==c||e[15]!==s||e[16]!==o||e[17]!==a?(x=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[11]=i,e[12]=N,e[13]=j,e[14]=c,e[15]=s,e[16]=o,e[17]=a,e[18]=x):x=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Loading conversation\\u2026"}),e[19]=p):p=e[19];let h;e[20]!==x?(h=t.jsxs(t.Fragment,{children:[x,p]}),e[20]=x,e[21]=h):h=e[21];let u;e[22]!==n||e[23]!==i||e[24]!==r||e[25]!==d||e[26]!==N||e[27]!==j||e[28]!==c||e[29]!==s||e[30]!==o||e[31]!==a?(u=t.jsx(Lt,{client:n,locator:r,thread:s,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[22]=n,e[23]=i,e[24]=r,e[25]=d,e[26]=N,e[27]=j,e[28]=c,e[29]=s,e[30]=o,e[31]=a,e[32]=u):u=e[32];let S;e[33]!==h||e[34]!==u?(S=t.jsx(ce.Suspense,{fallback:h,children:u}),e[33]=h,e[34]=u,e[35]=S):S=e[35];let f;return e[36]!==b||e[37]!==S?(f=t.jsx(tt,{fallback:b,children:S}),e[36]=b,e[37]=S,e[38]=f):f=e[38],f}function Ms(l){const e=ne.c(43),{filterAgentIds:s,filterUserIds:n,filterStatus:r,virtualMcpOptions:i,memberOptions:a,activeFiltersCount:d,onUpdateFilters:c}=l,[o,j]=ce.useState(!1);let N,v;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(_t,{size:16}),v=t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),e[0]=N,e[1]=v):(N=e[0],v=e[1]);let m;e[2]!==d?(m=d>0&&t.jsxs(t.Fragment,{children:[t.jsx(je,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:d}),t.jsx(je,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:d})]}),e[2]=d,e[3]=m):m=e[3];let b;e[4]!==m?(b=t.jsx(Je,{asChild:!0,children:t.jsxs(fe,{variant:"outline",className:"relative",children:[N,v,m]})}),e[4]=m,e[5]=b):b=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"font-medium text-sm",children:"Filter Threads"}),e[6]=x):x=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agent"}),e[7]=p):p=e[7];let h;e[8]!==c?(h=M=>c({filterAgentIds:M.slice(0,1)}),e[8]=c,e[9]=h):h=e[9];let u;e[10]!==s||e[11]!==h||e[12]!==i?(u=t.jsxs("div",{children:[p,t.jsx(Ue,{options:i,defaultValue:s,onValueChange:h,placeholder:"All agents",variant:"secondary",className:"w-full",maxCount:1})]}),e[10]=s,e[11]=h,e[12]=i,e[13]=u):u=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"User"}),e[14]=S):S=e[14];let f;e[15]!==c?(f=M=>c({filterUserIds:M.slice(0,1)}),e[15]=c,e[16]=f):f=e[16];let C;e[17]!==n||e[18]!==a||e[19]!==f?(C=t.jsxs("div",{children:[S,t.jsx(Ue,{options:a,defaultValue:n,onValueChange:f,placeholder:"All users",variant:"secondary",className:"w-full",maxCount:1})]}),e[17]=n,e[18]=a,e[19]=f,e[20]=C):C=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),e[21]=w):w=e[21];let g;e[22]!==c?(g=M=>c({filterStatus:M}),e[22]=c,e[23]=g):g=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(gt,{className:"w-full",children:t.jsx(pt,{})}),e[24]=y):y=e[24];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(jt,{children:[t.jsx(ge,{value:"all",children:"All statuses"}),t.jsx(ge,{value:"completed",children:"Completed"}),t.jsx(ge,{value:"active",children:"Active"}),t.jsx(ge,{value:"failed",children:"Failed"})]}),e[25]=T):T=e[25];let _;e[26]!==r||e[27]!==g?(_=t.jsxs("div",{children:[w,t.jsxs(bt,{value:r,onValueChange:g,children:[y,T]})]}),e[26]=r,e[27]=g,e[28]=_):_=e[28];let k;e[29]!==C||e[30]!==_||e[31]!==u?(k=t.jsxs("div",{className:"space-y-3",children:[u,C,_]}),e[29]=C,e[30]=_,e[31]=u,e[32]=k):k=e[32];let P;e[33]!==d||e[34]!==c?(P=d>0&&t.jsx(fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{c({filterAgentIds:[],filterUserIds:[],filterStatus:"all"}),j(!1)},children:"Clear all filters"}),e[33]=d,e[34]=c,e[35]=P):P=e[35];let I;e[36]!==k||e[37]!==P?(I=t.jsx(Qe,{align:"end",className:"w-[280px]",children:t.jsxs("div",{className:"space-y-4",children:[x,k,P]})}),e[36]=k,e[37]=P,e[38]=I):I=e[38];let D;return e[39]!==o||e[40]!==I||e[41]!==b?(D=t.jsxs(Ze,{open:o,onOpenChange:j,children:[b,I]}),e[39]=o,e[40]=I,e[41]=b,e[42]=D):D=e[42],D}const Ce=50;function Ds(l){const e=ne.c(29),{client:s,locator:n,membersData:r,allConnections:i,allVirtualMcps:a,dateRange:d,searchQuery:c,filterAgentIds:o,filterUserIds:j,filterStatus:N}=l,[v,m]=ce.useState(null),b=d.startDate.toISOString(),x=d.endDate.toISOString(),p=JSON.stringify({startDate:b,endDate:x,search:c,agentIds:o,userIds:j,status:N}),{data:h,fetchNextPage:u,hasNextPage:S,isFetchingNextPage:f,isLoading:C}=ze({queryKey:xe.threadsInfinite(n,p),queryFn:async R=>{const{pageParam:H}=R,oe=H===void 0?0:H;if(!s)throw new Error("MCP client is not available");const $=await s.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:Ce,offset:oe,startDate:b,endDate:x,...c?{search:c}:{},...o&&o.length>0?{agentId:o[0]}:{},...j&&j.length>0?{userId:j[0]}:{},...N&&N!=="all"?{status:N}:{}}});return $.structuredContent??$},initialPageParam:0,getNextPageParam:Ht,staleTime:3e4}),w=(h?.pages??[]).flatMap(Gt),g=w.map(qt),{data:y}=Ve({queryKey:xe.monitoringThreadUsage(n,JSON.stringify({ids:g,startDate:b,endDate:x})),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const R=await s.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:g,startDate:b,endDate:x}});return R.structuredContent??R},enabled:!!s&&g.length>0,staleTime:3e4}),T=new Map((y?.items??[]).map(Kt)),[_,k]=ce.useState(null),[P,I]=ce.useState("desc");let D;e[0]!==_?(D=R=>{_===R?I(zt):(k(R),I("desc"))},e[0]=_,e[1]=D):D=e[1];const M=D,A=R=>{const H=T.get(R);return H?_==="cost"?H.costUsd:H.totalTokens:0},L=_?[...w].sort((R,H)=>{const oe=A(R.id),$=A(H.id);return P==="desc"?$-oe:oe-$}):w,K=v!==null?L[v]??null:null;let q;e[2]!==u||e[3]!==S||e[4]!==f?(q=()=>{S&&!f&&u()},e[2]=u,e[3]=S,e[4]=f,e[5]=q):q=e[5];const J=ke(q,S??!1,f),E=!!c||(o?.length??0)>0||(j?.length??0)>0||N&&N!=="all";let U;e[6]===Symbol.for("react.memo_cache_sentinel")?(U=()=>m(Vt),e[6]=U):U=e[6];const O=U,V=()=>m(R=>R!==null&&R<L.length-1?R+1:R),F="flex-1 flex flex-col overflow-auto min-w-0",G="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",X="flex-1 flex flex-col min-w-0",z="flex-1 min-w-0 pt-1",ee="min-w-0",te=C?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})}):w.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx(Se,{title:E?"No matching threads":"No threads in this time range",description:E?"Try adjusting your filters or search query.":"Try expanding the time range to see older threads."})}):t.jsxs(t.Fragment,{children:[t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0 z-20",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(se,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),t.jsx(se,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(se,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("tokens"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Tokens",_==="tokens"&&(P==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("cost"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Cost",_==="cost"&&(P==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(se,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"})]})}),t.jsx(Be,{children:L.map((R,H)=>t.jsx($t,{thread:R,usage:T.get(R.id),members:r,connections:i,virtualMcps:a,onClick:()=>m(H),lastRowRef:H===L.length-1?J:void 0},R.id))})]}),f&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let Z;e[7]!==te?(Z=t.jsx("div",{className:G,children:t.jsx("div",{className:X,children:t.jsx("div",{className:z,children:t.jsx("div",{className:ee,children:te})})})}),e[7]=te,e[8]=Z):Z=e[8];const de=v!==null;let ae;e[9]===Symbol.for("react.memo_cache_sentinel")?(ae=R=>{R||m(null)},e[9]=ae):ae=e[9];let re;e[10]!==i||e[11]!==a||e[12]!==s||e[13]!==L||e[14]!==V||e[15]!==O||e[16]!==n||e[17]!==r||e[18]!==K||e[19]!==v?(re=K&&v!==null&&t.jsx(et,{thread:K,client:s,locator:n,connections:i,virtualMcps:a,members:r,selectedIndex:v,total:L.length,onPrev:O,onNext:V}),e[10]=i,e[11]=a,e[12]=s,e[13]=L,e[14]=V,e[15]=O,e[16]=n,e[17]=r,e[18]=K,e[19]=v,e[20]=re):re=e[20];let W;e[21]!==re?(W=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:re}),e[21]=re,e[22]=W):W=e[22];let Y;e[23]!==de||e[24]!==W?(Y=t.jsx(qe,{open:de,onOpenChange:ae,children:W}),e[23]=de,e[24]=W,e[25]=Y):Y=e[25];let ie;return e[26]!==Z||e[27]!==Y?(ie=t.jsxs("div",{className:F,children:[Z,Y]}),e[26]=Z,e[27]=Y,e[28]=ie):ie=e[28],ie}function Vt(l){return l!==null&&l>0?l-1:l}function zt(l){return l==="desc"?"asc":"desc"}function Kt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function qt(l){return l.id}function Gt(l){return l.items??[]}function Ht(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Ce))return n.length*Ce}const Te=50;function pe(l){const e=ne.c(10),{title:s,value:n,subtitle:r}=l;let i;e[0]!==s?(i=t.jsx("span",{className:"text-sm text-foreground/70",children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=t.jsx("span",{className:"text-3xl font-normal tabular-nums",children:n}),e[2]=n,e[3]=a):a=e[3];let d;e[4]!==r?(d=r&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==a||e[8]!==d?(c=t.jsxs(ct,{className:"pt-4 px-4 pb-5 gap-1",children:[i,a,d]}),e[6]=i,e[7]=a,e[8]=d,e[9]=c):c=e[9],c}function Bt(l){const e=ne.c(27),{automationId:s,range:n}=l,{data:r,isLoading:i}=ft(s,n),a=r?.runs,d=r?.usage;let c;e[0]!==a?(c=a&&a.total>0?`${Math.round(a.completed/a.total*100)}%`:"—",e[0]=a,e[1]=c):c=e[1];const o=c,j=d&&d.truncated?`last ${d.sampledRuns} runs`:void 0;let N;e[2]!==i||e[3]!==a?.total?(N=i?"…":a?.total.toLocaleString()??"0",e[2]=i,e[3]=a?.total,e[4]=N):N=e[4];const v=a?`${a.completed} ok · ${a.failed} failed${a.inProgress>0?` · ${a.inProgress} running`:""}`:void 0;let m;e[5]!==N||e[6]!==v?(m=t.jsx(pe,{title:"Runs",value:N,subtitle:v}),e[5]=N,e[6]=v,e[7]=m):m=e[7];const b=i?"…":o;let x;e[8]!==b?(x=t.jsx(pe,{title:"Success rate",value:b}),e[8]=b,e[9]=x):x=e[9];let p;e[10]!==i||e[11]!==d?.totalTokens?(p=i?"…":De(d?.totalTokens??0),e[10]=i,e[11]=d?.totalTokens,e[12]=p):p=e[12];let h;e[13]!==p||e[14]!==j?(h=t.jsx(pe,{title:"Tokens",value:p,subtitle:j}),e[13]=p,e[14]=j,e[15]=h):h=e[15];let u;e[16]!==i||e[17]!==d?(u=i?"…":d&&d.costUsd>0?Re(d.costUsd):"—",e[16]=i,e[17]=d,e[18]=u):u=e[18];let S;e[19]!==u||e[20]!==j?(S=t.jsx(pe,{title:"Cost",value:u,subtitle:j}),e[19]=u,e[20]=j,e[21]=S):S=e[21];let f;return e[22]!==S||e[23]!==m||e[24]!==x||e[25]!==h?(f=t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[m,x,h,S]}),e[22]=S,e[23]=m,e[24]=x,e[25]=h,e[26]=f):f=e[26],f}function Jt(l){const e=ne.c(39),{run:s,usage:n,onClick:r,lastRowRef:i}=l;let a,d;if(e[0]!==s.created_at){const y=new Date(s.created_at);a=y.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=y.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=s.created_at,e[1]=a,e[2]=d}else a=e[1],d=e[2];const c=d,o=ue[s.status]??ue.completed,j=o.icon;let N;e[3]!==s.title?(N=t.jsx(le,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[3]=s.title,e[4]=N):N=e[4];let v;e[5]!==j||e[6]!==o.iconClassName?(v=t.jsx(j,{size:14,className:o.iconClassName}),e[5]=j,e[6]=o.iconClassName,e[7]=v):v=e[7];let m;e[8]!==o.labelColor?(m=be("text-sm",o.labelColor),e[8]=o.labelColor,e[9]=m):m=e[9];let b;e[10]!==o.label||e[11]!==m?(b=t.jsx("span",{className:m,children:o.label}),e[10]=o.label,e[11]=m,e[12]=b):b=e[12];let x;e[13]!==v||e[14]!==b?(x=t.jsx(le,{className:"w-28 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[v,b]})}),e[13]=v,e[14]=b,e[15]=x):x=e[15];let p;e[16]!==n?(p=n?De(n.totalTokens):"—",e[16]=n,e[17]=p):p=e[17];let h;e[18]!==p?(h=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:p}),e[18]=p,e[19]=h):h=e[19];let u;e[20]!==n?(u=n&&n.costUsd>0?Re(n.costUsd):"—",e[20]=n,e[21]=u):u=e[21];let S;e[22]!==u?(S=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:u}),e[22]=u,e[23]=S):S=e[23];let f;e[24]!==a?(f=t.jsx("div",{children:a}),e[24]=a,e[25]=f):f=e[25];let C;e[26]!==c?(C=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:c}),e[26]=c,e[27]=C):C=e[27];let w;e[28]!==f||e[29]!==C?(w=t.jsxs(le,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[f,C]}),e[28]=f,e[29]=C,e[30]=w):w=e[30];let g;return e[31]!==i||e[32]!==r||e[33]!==S||e[34]!==w||e[35]!==N||e[36]!==x||e[37]!==h?(g=t.jsxs(Ne,{ref:i,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[N,x,h,S,w]}),e[31]=i,e[32]=r,e[33]=S,e[34]=w,e[35]=N,e[36]=x,e[37]=h,e[38]=g):g=e[38],g}function Rs(l){const e=ne.c(48),{automationId:s,triggerIds:n,range:r}=l,{org:i,locator:a}=st();let d;e[0]!==i.id||e[1]!==i.slug?(d={connectionId:rt,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=d):d=e[2];const c=it(d),o=xt(),j=lt(),N=ot(),{data:v}=ut(),[m,b]=ce.useState(null),x=n.length>0;let p;e[3]!==s||e[4]!==i.id||e[5]!==n?(p=xe.automationRuns(i.id,s,n),e[3]=s,e[4]=i.id,e[5]=n,e[6]=p):p=e[6];let h;e[7]!==o||e[8]!==n?(h=async z=>{const{pageParam:ee}=z,te=ee===void 0?0:ee;return await o.call("COLLECTION_THREADS_LIST",{limit:Te,offset:te,where:{trigger_ids:n}})},e[7]=o,e[8]=n,e[9]=h):h=e[9];let u;e[10]!==x||e[11]!==p||e[12]!==h?(u={queryKey:p,queryFn:h,initialPageParam:0,getNextPageParam:Xt,enabled:x,staleTime:3e4},e[10]=x,e[11]=p,e[12]=h,e[13]=u):u=e[13];const{data:S,fetchNextPage:f,hasNextPage:C,isFetchingNextPage:w,isLoading:g}=ze(u),y=(S?.pages??[]).flatMap(Yt),T=y.map(Wt),{data:_}=Ve({queryKey:xe.monitoringThreadUsage(a,JSON.stringify({ids:T,...r})),queryFn:async()=>await o.call("MONITORING_THREAD_USAGE",{threadIds:T,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}),enabled:T.length>0,staleTime:3e4});let k;e[14]!==_?.items?(k=new Map((_?.items??[]).map(Zt)),e[14]=_?.items,e[15]=k):k=e[15];const P=k;let I;e[16]!==f||e[17]!==C||e[18]!==w?(I=()=>{C&&!w&&f()},e[16]=f,e[17]=C,e[18]=w,e[19]=I):I=e[19];const D=ke(I,C??!1,w),M=m!==null?y[m]??null:null;let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=()=>b(Qt),e[20]=A):A=e[20];const L=A,K=()=>b(z=>z!==null&&z<y.length-1?z+1:z),q="flex flex-col gap-5";let Q;e[21]!==s||e[22]!==r?(Q=t.jsx(Bt,{automationId:s,range:r}),e[21]=s,e[22]=r,e[23]=Q):Q=e[23];const J=x?g?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):y.length===0?t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No runs yet",description:"This automation hasn't run yet. Trigger it or wait for a starter to fire."})}):t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(se,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),t.jsx(se,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),t.jsx(se,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Started"})]})}),t.jsx(Be,{children:y.map((z,ee)=>t.jsx(Jt,{run:z,usage:P.get(z.id),onClick:()=>b(ee),lastRowRef:ee===y.length-1?D:void 0},z.id))})]}):t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No starters yet",description:"Add a starter (cron, event, or webhook) to start collecting runs."})});let E;e[24]!==w?(E=w&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=w,e[25]=E):E=e[25];const U=m!==null;let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=z=>{z||b(null)},e[26]=O):O=e[26];let V;e[27]!==j||e[28]!==N||e[29]!==c||e[30]!==K||e[31]!==L||e[32]!==a||e[33]!==v||e[34]!==y||e[35]!==M||e[36]!==m?(V=M&&m!==null&&t.jsx(et,{thread:M,client:c,locator:a,connections:j,virtualMcps:N,members:v,selectedIndex:m,total:y.length,onPrev:L,onNext:K}),e[27]=j,e[28]=N,e[29]=c,e[30]=K,e[31]=L,e[32]=a,e[33]=v,e[34]=y,e[35]=M,e[36]=m,e[37]=V):V=e[37];let F;e[38]!==V?(F=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:V}),e[38]=V,e[39]=F):F=e[39];let G;e[40]!==U||e[41]!==F?(G=t.jsx(qe,{open:U,onOpenChange:O,children:F}),e[40]=U,e[41]=F,e[42]=G):G=e[42];let X;return e[43]!==J||e[44]!==E||e[45]!==G||e[46]!==Q?(X=t.jsxs("div",{className:q,children:[Q,J,E,G]}),e[43]=J,e[44]=E,e[45]=G,e[46]=Q,e[47]=X):X=e[47],X}function Qt(l){return l!==null&&l>0?l-1:l}function Zt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Wt(l){return l.id}function Yt(l){return l.items??[]}function Xt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Te))return n.length*Te}export{Rs as A,Ue as M,Ms as T,Re as a,ks as b,At as c,Ps as d,Is as e,De as f,Ts as g,Xe as h,Ds as i};
|
|
1
|
+
import{e as ne,r as ce,c as be,j as t,B as fe,K as xe,m as Ve,E as tt,p as st}from"./index-uVHAmIsb.js";import{u as ze}from"./useInfiniteQuery-CL1ZPxL1.js";import{u as lt}from"./use-connection-Cd3-MJT5.js";import{i as nt,g as at,a as rt,u as it}from"./use-mcp-client-Bqv2ciYo.js";import{a as ot}from"./use-virtual-mcp-Clsr41cX.js";import{C as ct}from"./card-ykuj7mlf.js";import{a as Ke,b as qe,S as dt,d as mt}from"./sheet-J3PJeFDK.js";import{c as Ge,d as He,a as Ne,e as se,b as Be,T as le}from"./table-XS_vYE_1.js";import{E as Se}from"./empty-state-BKLgisam.js";import{u as ke}from"./use-infinite-scroll-Ce2zTY3i.js";import{u as ut}from"./use-members-BBAnZQ_N.js";import{S as ue}from"./task-status-OfocbInI.js";import{e as ft}from"./use-automations-C3tUJiXy.js";import{u as xt}from"./studio-tools-Bsqb-6Fx.js";import{u as ht}from"./useSuspenseInfiniteQuery-B0dXZKGJ.js";import{B as je}from"./badge-DIN7Nq6a.js";import{S as gt,a as pt,b as jt,c as ge,d as bt}from"./select-DpIv2m7o.js";import{C as Le}from"./checkbox-BKpSRHdU.js";import{t as he}from"./ChevronDown-CxTVikeq.js";import{c as Nt,C as vt,e as Fe,d as St,a as yt,b as wt}from"./command-ClPkeFT9.js";import{a as Je,b as Qe,P as Ze}from"./popover-OWTo-ttg.js";import{A as We}from"./avatar-BG2RlqaT.js";import{n as ye}from"./ChevronUp-Dbc77Gwp.js";import{n as Ie}from"./Container-Hfp9SJFa.js";import{i as _t}from"./FilterLines-iroXgkwP.js";import{m as Ct,n as Tt}from"./pair-DguDTLaz.js";import{I as Pe}from"./integration-icon-YIddy6rU.js";function Ue(l){const e=ne.c(74),{options:s,onValueChange:n,defaultValue:r,placeholder:i,variant:a,animation:d,maxCount:c,modalPopover:o,asChild:j,className:N,disabled:v,onSearchChange:m}=l;let b;e[0]!==r?(b=r===void 0?[]:r,e[0]=r,e[1]=b):b=e[1];const x=b,p=i===void 0?"Select items":i,h=a===void 0?"default":a,u=d===void 0?0:d,S=c===void 0?3:c,f=o===void 0?!1:o,C=j===void 0?!1:j,w=v===void 0?!1:v,[g,y]=ce.useState(x),[T,_]=ce.useState(!1);let k,P;e[2]!==x||e[3]!==g?(k=()=>{JSON.stringify(g)!==JSON.stringify(x)&&y(x)},P=[x,g],e[2]=x,e[3]=g,e[4]=k,e[5]=P):(k=e[4],P=e[5]),ce.useEffect(k,P);let I;e[6]!==n||e[7]!==g?(I=$=>{if($.key==="Enter")_(!0);else if($.key==="Backspace"&&!$.currentTarget.value){const B=[...g];B.pop(),y(B),n(B)}},e[6]=n,e[7]=g,e[8]=I):I=e[8];const D=I;let M;e[9]!==n||e[10]!==g?(M=$=>{const B=g.includes($.value)?g.filter(me=>me!==$.value):[...g,$.value];y(B),n(B)},e[9]=n,e[10]=g,e[11]=M):M=e[11];const A=M;let L;e[12]!==n?(L=()=>{y([]),n([])},e[12]=n,e[13]=L):L=e[13];const K=L;let q;e[14]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{_(Mt)},e[14]=q):q=e[14];const Q=q;let J;e[15]!==K||e[16]!==n||e[17]!==s||e[18]!==g.length?(J=()=>{if(g.length===s.length)K();else{const $=s.map(Pt);y($),n($)}},e[15]=K,e[16]=n,e[17]=s,e[18]=g.length,e[19]=J):J=e[19];const E=J;let U;e[20]!==C?(U=C?{}:{variant:"outline"},e[20]=C,e[21]=U):U=e[21];let O;e[22]!==N?(O=be("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",N),e[22]=N,e[23]=O):O=e[23];let V;e[24]!==u||e[25]!==S||e[26]!==s||e[27]!==p||e[28]!==g||e[29]!==h?(V=g.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[g.slice(0,S).map($=>{const B=s.find(ve=>ve.value===$),me=B?.icon;return t.jsxs(je,{variant:h==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${u}s`},children:[me&&t.jsx(me,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:B?.label})]},$)}),g.length>S&&t.jsxs(je,{variant:h==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${u}s`},children:["+",g.length-S]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(he,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:p}),t.jsx(he,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=u,e[25]=S,e[26]=s,e[27]=p,e[28]=g,e[29]=h,e[30]=V):V=e[30];let F;e[31]!==w||e[32]!==U||e[33]!==O||e[34]!==V?(F=t.jsx(Je,{asChild:!0,children:t.jsx(fe,{ref:null,...U,onClick:Q,className:O,disabled:w,children:V})}),e[31]=w,e[32]=U,e[33]=O,e[34]=V,e[35]=F):F=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=()=>_(!1),e[36]=G):G=e[36];const X=!m;let z;e[37]!==D||e[38]!==m?(z=t.jsx(Nt,{placeholder:"Search...",onKeyDown:D,onValueChange:m,className:"rounded-t-xl"}),e[37]=D,e[38]=m,e[39]=z):z=e[39];let ee;e[40]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(vt,{children:"No results found."}),e[40]=ee):ee=e[40];let te;e[41]!==E?(te=()=>{E()},e[41]=E,e[42]=te):te=e[42];let Z;e[43]!==E?(Z=$=>{$.stopPropagation(),E()},e[43]=E,e[44]=Z):Z=e[44];const de=g.length===s.length&&s.length>0;let ae;e[45]!==de||e[46]!==E?(ae=t.jsx(Le,{checked:de,onCheckedChange:E,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:It}),e[45]=de,e[46]=E,e[47]=ae):ae=e[47];let re;e[48]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx("span",{children:"(Select All)"}),e[48]=re):re=e[48];let W;e[49]!==Z||e[50]!==ae?(W=t.jsxs("div",{className:"flex items-center w-full",onClick:Z,children:[ae,re]}),e[49]=Z,e[50]=ae,e[51]=W):W=e[51];let Y;e[52]!==te||e[53]!==W?(Y=t.jsx(Fe,{onSelect:te,className:"cursor-pointer",children:W},"all"),e[52]=te,e[53]=W,e[54]=Y):Y=e[54];let ie;if(e[55]!==s||e[56]!==g||e[57]!==A){let $;e[59]!==g||e[60]!==A?($=B=>{const me=g.includes(B.value);return t.jsx(Fe,{onSelect:()=>{A(B)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ve=>{ve.stopPropagation(),A(B)},children:[t.jsx(Le,{checked:me,onCheckedChange:()=>{A(B)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:kt}),B.icon&&t.jsx(B.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:B.label})]})},B.value)},e[59]=g,e[60]=A,e[61]=$):$=e[61],ie=s.map($),e[55]=s,e[56]=g,e[57]=A,e[58]=ie}else ie=e[58];let R;e[62]!==Y||e[63]!==ie?(R=t.jsxs(St,{className:"rounded-b-xl",children:[ee,t.jsxs(yt,{children:[Y,ie]})]}),e[62]=Y,e[63]=ie,e[64]=R):R=e[64];let H;e[65]!==X||e[66]!==z||e[67]!==R?(H=t.jsx(Qe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:G,children:t.jsxs(wt,{shouldFilter:X,className:"rounded-xl",children:[z,R]})}),e[65]=X,e[66]=z,e[67]=R,e[68]=H):H=e[68];let oe;return e[69]!==T||e[70]!==f||e[71]!==F||e[72]!==H?(oe=t.jsxs(Ze,{open:T,onOpenChange:_,modal:f,children:[F,H]}),e[69]=T,e[70]=f,e[71]=F,e[72]=H,e[73]=oe):oe=e[73],oe}function kt(l){return l.stopPropagation()}function It(l){return l.stopPropagation()}function Pt(l){return l.value}function Mt(l){return!l}const Ye=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],Dt=40;function Ts(l){const s=(l.endDate.getTime()-l.startDate.getTime())/Dt;return Ye.find(r=>r.ms>=s)?.label??"1d"}function Me(l){const e=Ye.find(i=>i.label===l);if(e)return e.ms;const s=/^(\d+)([mhd])$/.exec(l);if(!s)return 6e4;const n=parseInt(s[1],10),r=s[2];return r==="h"?n*36e5:r==="d"?n*864e5:n*6e4}function Rt(l,e){const s=new Date(l);return Me(e)>=864e5?s.toLocaleDateString([],{month:"short",day:"numeric"}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Oe(l,e){const s=Me(e);return new Date(Math.floor(l.getTime()/s)*s)}function At(l){return l>=1e4?`${(l/1e3).toFixed(1)}s`:`${Math.round(l)}ms`}function De(l){return Number.isFinite(l)?l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:Math.round(l).toLocaleString():"0"}function Re(l){return Number.isFinite(l)?`$${l.toFixed(l<1?4:2)}`:"$0.00"}function ks(l,e,s){const n=Me(s),r=Oe(e.startDate,s).getTime(),i=e.endDate.getTime(),a=new Map(l.map(c=>[Oe(new Date(c.timestamp),s).getTime(),c])),d=[];for(let c=r;c<=i;c+=n){const o=a.get(c),j=new Date(c).toISOString();d.push({t:j,ts:c,label:Rt(j,s),calls:o?.calls??0,errors:o?.errors??0,errorRate:o?.errorRate??0,avg:o?.avg??0,p50:o?.p50??0,p95:o?.p95??0,inputTokens:o?.inputTokens??0,outputTokens:o?.outputTokens??0,totalTokens:o?.totalTokens??0,costUsd:o?.costUsd??0})}return d}function Is(l,e){return e==="requests"?l.calls:e==="errors"?l.errorRate:l.avgDurationMs}function Ps(l,e){return e==="requests"?l.calls.toLocaleString():e==="errors"?`${l.errorRate.toFixed(1)}%`:At(l.avgDurationMs)}function Ae(l){return(l.run_config??{}).agent?.id??(l.virtual_mcp_id||null)}function Ee(l,e,s,n){if(!l)return n;const r=e.find(a=>a.id===l)??s?.find(a=>a.id===l);if(r?.title)return r.title;const i=nt(l);return i?at(i).title??n:l}function $e(l,e,s){return l?(e.find(r=>r.id===l)??s?.find(r=>r.id===l))?.icon??null:null}function Xe(l){return l?.data?.members??[]}function we(l){const e=ne.c(33),{thread:s,connections:n,virtualMcps:r,selectedIndex:i,total:a,onPrev:d,onNext:c}=l;let o,j;if(e[0]!==n||e[1]!==s||e[2]!==r){const k=Ae(s);o=Ee(k,r,n,""),j=$e(k,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=j}else o=e[3],j=e[4];const N=j,v=o||s.title;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{}),e[5]=m):m=e[5];let b;e[6]!==N||e[7]!==v?(b=t.jsx(Pe,{icon:N,name:v,size:"sm",fallbackIcon:m,className:"shadow-sm shrink-0 rounded-md"}),e[6]=N,e[7]=v,e[8]=b):b=e[8];let x;e[9]!==s.title?(x=t.jsx(dt,{className:"text-sm leading-snug truncate",children:s.title}),e[9]=s.title,e[10]=x):x=e[10];let p;e[11]!==o?(p=o&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:o}),e[11]=o,e[12]=p):p=e[12];let h;e[13]!==x||e[14]!==p?(h=t.jsxs("div",{className:"min-w-0",children:[x,p]}),e[13]=x,e[14]=p,e[15]=h):h=e[15];let u;e[16]!==b||e[17]!==h?(u=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b,h]}),e[16]=b,e[17]=h,e[18]=u):u=e[18];const S=i===0;let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ye,{size:14}),e[19]=f):f=e[19];let C;e[20]!==d||e[21]!==S?(C=t.jsx(fe,{size:"icon",variant:"ghost",onClick:d,disabled:S,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous thread",children:f}),e[20]=d,e[21]=S,e[22]=C):C=e[22];const w=i===a-1;let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(he,{size:14}),e[23]=g):g=e[23];let y;e[24]!==c||e[25]!==w?(y=t.jsx(fe,{size:"icon",variant:"ghost",onClick:c,disabled:w,className:"h-7 w-7 text-muted-foreground","aria-label":"Next thread",children:g}),e[24]=c,e[25]=w,e[26]=y):y=e[26];let T;e[27]!==C||e[28]!==y?(T=t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[C,y]}),e[27]=C,e[28]=y,e[29]=T):T=e[29];let _;return e[30]!==T||e[31]!==u?(_=t.jsx(mt,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[u,T]})}),e[30]=T,e[31]=u,e[32]=_):_=e[32],_}function Et(l){const e=ne.c(48),{thread:s,connections:n,virtualMcps:r,members:i}=l;let a,d;if(e[0]!==n||e[1]!==s||e[2]!==r){const M=Ae(s);a=Ee(M,r,n,""),d=$e(M,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=d}else a=e[3],d=e[4];const c=d;let o;if(e[5]!==i||e[6]!==s.created_by){const M=Xe(i);let A;e[8]!==s.created_by?(A=L=>L.userId===s.created_by,e[8]=s.created_by,e[9]=A):A=e[9],o=M.find(A),e[5]=i,e[6]=s.created_by,e[7]=o}else o=e[7];const j=o;let N;e[10]!==j?.user.email||e[11]!==j?.user.name||e[12]!==s.created_by?(N=j?.user.name??j?.user.email??s.created_by?.substring(0,8)??"—",e[10]=j?.user.email,e[11]=j?.user.name,e[12]=s.created_by,e[13]=N):N=e[13];const v=N,m=j?.user.image??void 0;let b;e[14]!==s.created_at?(b=new Date(s.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=s.created_at,e[15]=b):b=e[15];const x=b,p=ue[s.status]??ue.completed,h=p.icon;let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=u):u=e[16];let S;e[17]!==h||e[18]!==p.iconClassName?(S=t.jsx(h,{size:13,className:p.iconClassName}),e[17]=h,e[18]=p.iconClassName,e[19]=S):S=e[19];let f;e[20]!==p.labelColor?(f=be("text-sm",p.labelColor),e[20]=p.labelColor,e[21]=f):f=e[21];let C;e[22]!==p.label||e[23]!==f?(C=t.jsx("span",{className:f,children:p.label}),e[22]=p.label,e[23]=f,e[24]=C):C=e[24];let w;e[25]!==S||e[26]!==C?(w=t.jsxs("div",{children:[u,t.jsxs("div",{className:"flex items-center gap-1.5",children:[S,C]})]}),e[25]=S,e[26]=C,e[27]=w):w=e[27];let g;e[28]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=g):g=e[28];let y;e[29]!==x?(y=t.jsxs("div",{children:[g,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[29]=x,e[30]=y):y=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[31]=T):T=e[31];let _;e[32]!==m||e[33]!==v?(_=t.jsx(We,{url:m,fallback:v,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=m,e[33]=v,e[34]=_):_=e[34];let k;e[35]!==v?(k=t.jsx("span",{className:"text-sm text-foreground",children:v}),e[35]=v,e[36]=k):k=e[36];let P;e[37]!==_||e[38]!==k?(P=t.jsxs("div",{children:[T,t.jsxs("div",{className:"flex items-center gap-2",children:[_,k]})]}),e[37]=_,e[38]=k,e[39]=P):P=e[39];let I;e[40]!==c||e[41]!==a?(I=a&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pe,{icon:c,name:a,size:"xs",fallbackIcon:t.jsx(Ie,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"text-sm text-foreground",children:a})]})]}),e[40]=c,e[41]=a,e[42]=I):I=e[42];let D;return e[43]!==y||e[44]!==P||e[45]!==I||e[46]!==w?(D=t.jsxs("div",{className:"px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[w,y,P,I]}),e[43]=y,e[44]=P,e[45]=I,e[46]=w,e[47]=D):D=e[47],D}function $t(l){const e=ne.c(72),{thread:s,usage:n,members:r,connections:i,virtualMcps:a,onClick:d,lastRowRef:c}=l;let o,j;if(e[0]!==i||e[1]!==s||e[2]!==a){const F=Ae(s);o=Ee(F,a,i,"—"),j=$e(F,a,i),e[0]=i,e[1]=s,e[2]=a,e[3]=o,e[4]=j}else o=e[3],j=e[4];const N=j;let v;if(e[5]!==r||e[6]!==s.created_by){const F=Xe(r);let G;e[8]!==s.created_by?(G=X=>X.userId===s.created_by,e[8]=s.created_by,e[9]=G):G=e[9],v=F.find(G),e[5]=r,e[6]=s.created_by,e[7]=v}else v=e[7];const m=v;let b;e[10]!==m?.user.email||e[11]!==m?.user.name||e[12]!==s.created_by?(b=m?.user.name??m?.user.email??s.created_by?.substring(0,8)??"—",e[10]=m?.user.email,e[11]=m?.user.name,e[12]=s.created_by,e[13]=b):b=e[13];const x=b,p=m?.user.image??void 0;let h,u;if(e[14]!==s.created_at){const F=new Date(s.created_at);h=F.toLocaleDateString("en-US",{month:"short",day:"numeric"}),u=F.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=s.created_at,e[15]=h,e[16]=u}else h=e[15],u=e[16];const S=u,f=ue[s.status]??ue.completed,C=f.icon;let w;e[17]!==s.title?(w=t.jsx(le,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[17]=s.title,e[18]=w):w=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{}),e[19]=g):g=e[19];let y;e[20]!==N||e[21]!==o?(y=t.jsx(Pe,{icon:N,name:o,size:"xs",fallbackIcon:g,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=N,e[21]=o,e[22]=y):y=e[22];let T;e[23]!==o?(T=t.jsx("span",{className:"truncate",children:o}),e[23]=o,e[24]=T):T=e[24];let _;e[25]!==y||e[26]!==T?(_=t.jsx(le,{className:"w-36 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,T]})}),e[25]=y,e[26]=T,e[27]=_):_=e[27];let k;e[28]!==p||e[29]!==x?(k=t.jsx(We,{url:p,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=p,e[29]=x,e[30]=k):k=e[30];let P;e[31]!==x?(P=t.jsx("span",{className:"truncate",children:x}),e[31]=x,e[32]=P):P=e[32];let I;e[33]!==k||e[34]!==P?(I=t.jsx(le,{className:"w-28 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,P]})}),e[33]=k,e[34]=P,e[35]=I):I=e[35];let D;e[36]!==C||e[37]!==f.iconClassName?(D=t.jsx(C,{size:14,className:f.iconClassName}),e[36]=C,e[37]=f.iconClassName,e[38]=D):D=e[38];let M;e[39]!==f.labelColor?(M=be("text-sm",f.labelColor),e[39]=f.labelColor,e[40]=M):M=e[40];let A;e[41]!==f.label||e[42]!==M?(A=t.jsx("span",{className:M,children:f.label}),e[41]=f.label,e[42]=M,e[43]=A):A=e[43];let L;e[44]!==D||e[45]!==A?(L=t.jsx(le,{className:"w-24 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[D,A]})}),e[44]=D,e[45]=A,e[46]=L):L=e[46];let K;e[47]!==n?(K=n?De(n.totalTokens):"—",e[47]=n,e[48]=K):K=e[48];let q;e[49]!==K?(q=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:K}),e[49]=K,e[50]=q):q=e[50];let Q;e[51]!==n?(Q=n&&n.costUsd>0?Re(n.costUsd):"—",e[51]=n,e[52]=Q):Q=e[52];let J;e[53]!==Q?(J=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:Q}),e[53]=Q,e[54]=J):J=e[54];let E;e[55]!==h?(E=t.jsx("div",{children:h}),e[55]=h,e[56]=E):E=e[56];let U;e[57]!==S?(U=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:S}),e[57]=S,e[58]=U):U=e[58];let O;e[59]!==E||e[60]!==U?(O=t.jsxs(le,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[E,U]}),e[59]=E,e[60]=U,e[61]=O):O=e[61];let V;return e[62]!==c||e[63]!==d||e[64]!==I||e[65]!==L||e[66]!==q||e[67]!==J||e[68]!==O||e[69]!==w||e[70]!==_?(V=t.jsxs(Ne,{ref:c,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:d,children:[w,_,I,L,q,J,O]}),e[62]=c,e[63]=d,e[64]=I,e[65]=L,e[66]=q,e[67]=J,e[68]=O,e[69]=w,e[70]=_,e[71]=V):V=e[71],V}const _e=100;function Lt(l){const e=ne.c(37),{client:s,locator:n,thread:r,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}=l;let v;e[0]!==n||e[1]!==r.id?(v=xe.threadMessages(n,r.id),e[0]=n,e[1]=r.id,e[2]=v):v=e[2];let m;e[3]!==s||e[4]!==r.id?(m=async P=>{const{pageParam:I}=P,D=I===void 0?0:I;if(!s)throw new Error("MCP client is not available");const M=await s.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:r.id,limit:_e,offset:D}});return M.structuredContent??M},e[3]=s,e[4]=r.id,e[5]=m):m=e[5];let b;e[6]!==v||e[7]!==m?(b={queryKey:v,queryFn:m,initialPageParam:0,getNextPageParam:Ot,staleTime:6e4},e[6]=v,e[7]=m,e[8]=b):b=e[8];const{data:x,fetchNextPage:p,hasNextPage:h,isFetchingNextPage:u}=ht(b);let S;e[9]!==x.pages?(S=x.pages.flatMap(Ut).filter(Ft),e[9]=x.pages,e[10]=S):S=e[10];const f=S,C=Ct(f);let w;e[11]!==p||e[12]!==h||e[13]!==u?(w=()=>{h&&!u&&p()},e[11]=p,e[12]=h,e[13]=u,e[14]=w):w=e[14];const g=ke(w,h??!1,u);let y;e[15]!==i||e[16]!==N||e[17]!==j||e[18]!==c||e[19]!==r||e[20]!==o||e[21]!==a?(y=t.jsx(we,{thread:r,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[15]=i,e[16]=N,e[17]=j,e[18]=c,e[19]=r,e[20]=o,e[21]=a,e[22]=y):y=e[22];let T;e[23]!==i||e[24]!==d||e[25]!==r||e[26]!==a?(T=t.jsx(Et,{thread:r,connections:i,virtualMcps:a,members:d}),e[23]=i,e[24]=d,e[25]=r,e[26]=a,e[27]=T):T=e[27];let _;e[28]!==u||e[29]!==g||e[30]!==C||e[31]!==f.length?(_=f.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No messages in this thread"}):t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:t.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[C.map((P,I)=>t.jsx("div",{ref:I===C.length-1?g:void 0,children:t.jsx(Tt,{pair:P,isLastPair:I===C.length-1,status:"ready"})},`pair-${P.user?.id??P.assistant?.id}`)),u&&t.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=u,e[29]=g,e[30]=C,e[31]=f.length,e[32]=_):_=e[32];let k;return e[33]!==y||e[34]!==T||e[35]!==_?(k=t.jsxs(t.Fragment,{children:[y,T,_]}),e[33]=y,e[34]=T,e[35]=_,e[36]=k):k=e[36],k}function Ft(l){return l.role==="user"||l.role==="assistant"}function Ut(l){return l.items??[]}function Ot(l,e){const s=l,n=e;if(!((s?.items?.length??0)<_e))return n.length*_e}function et(l){const e=ne.c(39),{thread:s,client:n,locator:r,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}=l;let v;e[0]!==i||e[1]!==N||e[2]!==j||e[3]!==c||e[4]!==s||e[5]!==o||e[6]!==a?(v=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[0]=i,e[1]=N,e[2]=j,e[3]=c,e[4]=s,e[5]=o,e[6]=a,e[7]=v):v=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=m):m=e[8];let b;e[9]!==v?(b=t.jsxs(t.Fragment,{children:[v,m]}),e[9]=v,e[10]=b):b=e[10];let x;e[11]!==i||e[12]!==N||e[13]!==j||e[14]!==c||e[15]!==s||e[16]!==o||e[17]!==a?(x=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[11]=i,e[12]=N,e[13]=j,e[14]=c,e[15]=s,e[16]=o,e[17]=a,e[18]=x):x=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Loading conversation\\u2026"}),e[19]=p):p=e[19];let h;e[20]!==x?(h=t.jsxs(t.Fragment,{children:[x,p]}),e[20]=x,e[21]=h):h=e[21];let u;e[22]!==n||e[23]!==i||e[24]!==r||e[25]!==d||e[26]!==N||e[27]!==j||e[28]!==c||e[29]!==s||e[30]!==o||e[31]!==a?(u=t.jsx(Lt,{client:n,locator:r,thread:s,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[22]=n,e[23]=i,e[24]=r,e[25]=d,e[26]=N,e[27]=j,e[28]=c,e[29]=s,e[30]=o,e[31]=a,e[32]=u):u=e[32];let S;e[33]!==h||e[34]!==u?(S=t.jsx(ce.Suspense,{fallback:h,children:u}),e[33]=h,e[34]=u,e[35]=S):S=e[35];let f;return e[36]!==b||e[37]!==S?(f=t.jsx(tt,{fallback:b,children:S}),e[36]=b,e[37]=S,e[38]=f):f=e[38],f}function Ms(l){const e=ne.c(43),{filterAgentIds:s,filterUserIds:n,filterStatus:r,virtualMcpOptions:i,memberOptions:a,activeFiltersCount:d,onUpdateFilters:c}=l,[o,j]=ce.useState(!1);let N,v;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(_t,{size:16}),v=t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),e[0]=N,e[1]=v):(N=e[0],v=e[1]);let m;e[2]!==d?(m=d>0&&t.jsxs(t.Fragment,{children:[t.jsx(je,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:d}),t.jsx(je,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:d})]}),e[2]=d,e[3]=m):m=e[3];let b;e[4]!==m?(b=t.jsx(Je,{asChild:!0,children:t.jsxs(fe,{variant:"outline",className:"relative",children:[N,v,m]})}),e[4]=m,e[5]=b):b=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"font-medium text-sm",children:"Filter Threads"}),e[6]=x):x=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agent"}),e[7]=p):p=e[7];let h;e[8]!==c?(h=M=>c({filterAgentIds:M.slice(0,1)}),e[8]=c,e[9]=h):h=e[9];let u;e[10]!==s||e[11]!==h||e[12]!==i?(u=t.jsxs("div",{children:[p,t.jsx(Ue,{options:i,defaultValue:s,onValueChange:h,placeholder:"All agents",variant:"secondary",className:"w-full",maxCount:1})]}),e[10]=s,e[11]=h,e[12]=i,e[13]=u):u=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"User"}),e[14]=S):S=e[14];let f;e[15]!==c?(f=M=>c({filterUserIds:M.slice(0,1)}),e[15]=c,e[16]=f):f=e[16];let C;e[17]!==n||e[18]!==a||e[19]!==f?(C=t.jsxs("div",{children:[S,t.jsx(Ue,{options:a,defaultValue:n,onValueChange:f,placeholder:"All users",variant:"secondary",className:"w-full",maxCount:1})]}),e[17]=n,e[18]=a,e[19]=f,e[20]=C):C=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),e[21]=w):w=e[21];let g;e[22]!==c?(g=M=>c({filterStatus:M}),e[22]=c,e[23]=g):g=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(gt,{className:"w-full",children:t.jsx(pt,{})}),e[24]=y):y=e[24];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(jt,{children:[t.jsx(ge,{value:"all",children:"All statuses"}),t.jsx(ge,{value:"completed",children:"Completed"}),t.jsx(ge,{value:"active",children:"Active"}),t.jsx(ge,{value:"failed",children:"Failed"})]}),e[25]=T):T=e[25];let _;e[26]!==r||e[27]!==g?(_=t.jsxs("div",{children:[w,t.jsxs(bt,{value:r,onValueChange:g,children:[y,T]})]}),e[26]=r,e[27]=g,e[28]=_):_=e[28];let k;e[29]!==C||e[30]!==_||e[31]!==u?(k=t.jsxs("div",{className:"space-y-3",children:[u,C,_]}),e[29]=C,e[30]=_,e[31]=u,e[32]=k):k=e[32];let P;e[33]!==d||e[34]!==c?(P=d>0&&t.jsx(fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{c({filterAgentIds:[],filterUserIds:[],filterStatus:"all"}),j(!1)},children:"Clear all filters"}),e[33]=d,e[34]=c,e[35]=P):P=e[35];let I;e[36]!==k||e[37]!==P?(I=t.jsx(Qe,{align:"end",className:"w-[280px]",children:t.jsxs("div",{className:"space-y-4",children:[x,k,P]})}),e[36]=k,e[37]=P,e[38]=I):I=e[38];let D;return e[39]!==o||e[40]!==I||e[41]!==b?(D=t.jsxs(Ze,{open:o,onOpenChange:j,children:[b,I]}),e[39]=o,e[40]=I,e[41]=b,e[42]=D):D=e[42],D}const Ce=50;function Ds(l){const e=ne.c(29),{client:s,locator:n,membersData:r,allConnections:i,allVirtualMcps:a,dateRange:d,searchQuery:c,filterAgentIds:o,filterUserIds:j,filterStatus:N}=l,[v,m]=ce.useState(null),b=d.startDate.toISOString(),x=d.endDate.toISOString(),p=JSON.stringify({startDate:b,endDate:x,search:c,agentIds:o,userIds:j,status:N}),{data:h,fetchNextPage:u,hasNextPage:S,isFetchingNextPage:f,isLoading:C}=ze({queryKey:xe.threadsInfinite(n,p),queryFn:async R=>{const{pageParam:H}=R,oe=H===void 0?0:H;if(!s)throw new Error("MCP client is not available");const $=await s.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:Ce,offset:oe,startDate:b,endDate:x,...c?{search:c}:{},...o&&o.length>0?{agentId:o[0]}:{},...j&&j.length>0?{userId:j[0]}:{},...N&&N!=="all"?{status:N}:{}}});return $.structuredContent??$},initialPageParam:0,getNextPageParam:Ht,staleTime:3e4}),w=(h?.pages??[]).flatMap(Gt),g=w.map(qt),{data:y}=Ve({queryKey:xe.monitoringThreadUsage(n,JSON.stringify({ids:g,startDate:b,endDate:x})),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const R=await s.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:g,startDate:b,endDate:x}});return R.structuredContent??R},enabled:!!s&&g.length>0,staleTime:3e4}),T=new Map((y?.items??[]).map(Kt)),[_,k]=ce.useState(null),[P,I]=ce.useState("desc");let D;e[0]!==_?(D=R=>{_===R?I(zt):(k(R),I("desc"))},e[0]=_,e[1]=D):D=e[1];const M=D,A=R=>{const H=T.get(R);return H?_==="cost"?H.costUsd:H.totalTokens:0},L=_?[...w].sort((R,H)=>{const oe=A(R.id),$=A(H.id);return P==="desc"?$-oe:oe-$}):w,K=v!==null?L[v]??null:null;let q;e[2]!==u||e[3]!==S||e[4]!==f?(q=()=>{S&&!f&&u()},e[2]=u,e[3]=S,e[4]=f,e[5]=q):q=e[5];const J=ke(q,S??!1,f),E=!!c||(o?.length??0)>0||(j?.length??0)>0||N&&N!=="all";let U;e[6]===Symbol.for("react.memo_cache_sentinel")?(U=()=>m(Vt),e[6]=U):U=e[6];const O=U,V=()=>m(R=>R!==null&&R<L.length-1?R+1:R),F="flex-1 flex flex-col overflow-auto min-w-0",G="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",X="flex-1 flex flex-col min-w-0",z="flex-1 min-w-0 pt-1",ee="min-w-0",te=C?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})}):w.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx(Se,{title:E?"No matching threads":"No threads in this time range",description:E?"Try adjusting your filters or search query.":"Try expanding the time range to see older threads."})}):t.jsxs(t.Fragment,{children:[t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0 z-20",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(se,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),t.jsx(se,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(se,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("tokens"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Tokens",_==="tokens"&&(P==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("cost"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Cost",_==="cost"&&(P==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(se,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"})]})}),t.jsx(Be,{children:L.map((R,H)=>t.jsx($t,{thread:R,usage:T.get(R.id),members:r,connections:i,virtualMcps:a,onClick:()=>m(H),lastRowRef:H===L.length-1?J:void 0},R.id))})]}),f&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let Z;e[7]!==te?(Z=t.jsx("div",{className:G,children:t.jsx("div",{className:X,children:t.jsx("div",{className:z,children:t.jsx("div",{className:ee,children:te})})})}),e[7]=te,e[8]=Z):Z=e[8];const de=v!==null;let ae;e[9]===Symbol.for("react.memo_cache_sentinel")?(ae=R=>{R||m(null)},e[9]=ae):ae=e[9];let re;e[10]!==i||e[11]!==a||e[12]!==s||e[13]!==L||e[14]!==V||e[15]!==O||e[16]!==n||e[17]!==r||e[18]!==K||e[19]!==v?(re=K&&v!==null&&t.jsx(et,{thread:K,client:s,locator:n,connections:i,virtualMcps:a,members:r,selectedIndex:v,total:L.length,onPrev:O,onNext:V}),e[10]=i,e[11]=a,e[12]=s,e[13]=L,e[14]=V,e[15]=O,e[16]=n,e[17]=r,e[18]=K,e[19]=v,e[20]=re):re=e[20];let W;e[21]!==re?(W=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:re}),e[21]=re,e[22]=W):W=e[22];let Y;e[23]!==de||e[24]!==W?(Y=t.jsx(qe,{open:de,onOpenChange:ae,children:W}),e[23]=de,e[24]=W,e[25]=Y):Y=e[25];let ie;return e[26]!==Z||e[27]!==Y?(ie=t.jsxs("div",{className:F,children:[Z,Y]}),e[26]=Z,e[27]=Y,e[28]=ie):ie=e[28],ie}function Vt(l){return l!==null&&l>0?l-1:l}function zt(l){return l==="desc"?"asc":"desc"}function Kt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function qt(l){return l.id}function Gt(l){return l.items??[]}function Ht(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Ce))return n.length*Ce}const Te=50;function pe(l){const e=ne.c(10),{title:s,value:n,subtitle:r}=l;let i;e[0]!==s?(i=t.jsx("span",{className:"text-sm text-foreground/70",children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=t.jsx("span",{className:"text-3xl font-normal tabular-nums",children:n}),e[2]=n,e[3]=a):a=e[3];let d;e[4]!==r?(d=r&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==a||e[8]!==d?(c=t.jsxs(ct,{className:"pt-4 px-4 pb-5 gap-1",children:[i,a,d]}),e[6]=i,e[7]=a,e[8]=d,e[9]=c):c=e[9],c}function Bt(l){const e=ne.c(27),{automationId:s,range:n}=l,{data:r,isLoading:i}=ft(s,n),a=r?.runs,d=r?.usage;let c;e[0]!==a?(c=a&&a.total>0?`${Math.round(a.completed/a.total*100)}%`:"—",e[0]=a,e[1]=c):c=e[1];const o=c,j=d&&d.truncated?`last ${d.sampledRuns} runs`:void 0;let N;e[2]!==i||e[3]!==a?.total?(N=i?"…":a?.total.toLocaleString()??"0",e[2]=i,e[3]=a?.total,e[4]=N):N=e[4];const v=a?`${a.completed} ok · ${a.failed} failed${a.inProgress>0?` · ${a.inProgress} running`:""}`:void 0;let m;e[5]!==N||e[6]!==v?(m=t.jsx(pe,{title:"Runs",value:N,subtitle:v}),e[5]=N,e[6]=v,e[7]=m):m=e[7];const b=i?"…":o;let x;e[8]!==b?(x=t.jsx(pe,{title:"Success rate",value:b}),e[8]=b,e[9]=x):x=e[9];let p;e[10]!==i||e[11]!==d?.totalTokens?(p=i?"…":De(d?.totalTokens??0),e[10]=i,e[11]=d?.totalTokens,e[12]=p):p=e[12];let h;e[13]!==p||e[14]!==j?(h=t.jsx(pe,{title:"Tokens",value:p,subtitle:j}),e[13]=p,e[14]=j,e[15]=h):h=e[15];let u;e[16]!==i||e[17]!==d?(u=i?"…":d&&d.costUsd>0?Re(d.costUsd):"—",e[16]=i,e[17]=d,e[18]=u):u=e[18];let S;e[19]!==u||e[20]!==j?(S=t.jsx(pe,{title:"Cost",value:u,subtitle:j}),e[19]=u,e[20]=j,e[21]=S):S=e[21];let f;return e[22]!==S||e[23]!==m||e[24]!==x||e[25]!==h?(f=t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[m,x,h,S]}),e[22]=S,e[23]=m,e[24]=x,e[25]=h,e[26]=f):f=e[26],f}function Jt(l){const e=ne.c(39),{run:s,usage:n,onClick:r,lastRowRef:i}=l;let a,d;if(e[0]!==s.created_at){const y=new Date(s.created_at);a=y.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=y.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=s.created_at,e[1]=a,e[2]=d}else a=e[1],d=e[2];const c=d,o=ue[s.status]??ue.completed,j=o.icon;let N;e[3]!==s.title?(N=t.jsx(le,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[3]=s.title,e[4]=N):N=e[4];let v;e[5]!==j||e[6]!==o.iconClassName?(v=t.jsx(j,{size:14,className:o.iconClassName}),e[5]=j,e[6]=o.iconClassName,e[7]=v):v=e[7];let m;e[8]!==o.labelColor?(m=be("text-sm",o.labelColor),e[8]=o.labelColor,e[9]=m):m=e[9];let b;e[10]!==o.label||e[11]!==m?(b=t.jsx("span",{className:m,children:o.label}),e[10]=o.label,e[11]=m,e[12]=b):b=e[12];let x;e[13]!==v||e[14]!==b?(x=t.jsx(le,{className:"w-28 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[v,b]})}),e[13]=v,e[14]=b,e[15]=x):x=e[15];let p;e[16]!==n?(p=n?De(n.totalTokens):"—",e[16]=n,e[17]=p):p=e[17];let h;e[18]!==p?(h=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:p}),e[18]=p,e[19]=h):h=e[19];let u;e[20]!==n?(u=n&&n.costUsd>0?Re(n.costUsd):"—",e[20]=n,e[21]=u):u=e[21];let S;e[22]!==u?(S=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:u}),e[22]=u,e[23]=S):S=e[23];let f;e[24]!==a?(f=t.jsx("div",{children:a}),e[24]=a,e[25]=f):f=e[25];let C;e[26]!==c?(C=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:c}),e[26]=c,e[27]=C):C=e[27];let w;e[28]!==f||e[29]!==C?(w=t.jsxs(le,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[f,C]}),e[28]=f,e[29]=C,e[30]=w):w=e[30];let g;return e[31]!==i||e[32]!==r||e[33]!==S||e[34]!==w||e[35]!==N||e[36]!==x||e[37]!==h?(g=t.jsxs(Ne,{ref:i,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[N,x,h,S,w]}),e[31]=i,e[32]=r,e[33]=S,e[34]=w,e[35]=N,e[36]=x,e[37]=h,e[38]=g):g=e[38],g}function Rs(l){const e=ne.c(48),{automationId:s,triggerIds:n,range:r}=l,{org:i,locator:a}=st();let d;e[0]!==i.id||e[1]!==i.slug?(d={connectionId:rt,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=d):d=e[2];const c=it(d),o=xt(),j=lt(),N=ot(),{data:v}=ut(),[m,b]=ce.useState(null),x=n.length>0;let p;e[3]!==s||e[4]!==i.id||e[5]!==n?(p=xe.automationRuns(i.id,s,n),e[3]=s,e[4]=i.id,e[5]=n,e[6]=p):p=e[6];let h;e[7]!==o||e[8]!==n?(h=async z=>{const{pageParam:ee}=z,te=ee===void 0?0:ee;return await o.call("COLLECTION_THREADS_LIST",{limit:Te,offset:te,where:{trigger_ids:n}})},e[7]=o,e[8]=n,e[9]=h):h=e[9];let u;e[10]!==x||e[11]!==p||e[12]!==h?(u={queryKey:p,queryFn:h,initialPageParam:0,getNextPageParam:Xt,enabled:x,staleTime:3e4},e[10]=x,e[11]=p,e[12]=h,e[13]=u):u=e[13];const{data:S,fetchNextPage:f,hasNextPage:C,isFetchingNextPage:w,isLoading:g}=ze(u),y=(S?.pages??[]).flatMap(Yt),T=y.map(Wt),{data:_}=Ve({queryKey:xe.monitoringThreadUsage(a,JSON.stringify({ids:T,...r})),queryFn:async()=>await o.call("MONITORING_THREAD_USAGE",{threadIds:T,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}),enabled:T.length>0,staleTime:3e4});let k;e[14]!==_?.items?(k=new Map((_?.items??[]).map(Zt)),e[14]=_?.items,e[15]=k):k=e[15];const P=k;let I;e[16]!==f||e[17]!==C||e[18]!==w?(I=()=>{C&&!w&&f()},e[16]=f,e[17]=C,e[18]=w,e[19]=I):I=e[19];const D=ke(I,C??!1,w),M=m!==null?y[m]??null:null;let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=()=>b(Qt),e[20]=A):A=e[20];const L=A,K=()=>b(z=>z!==null&&z<y.length-1?z+1:z),q="flex flex-col gap-5";let Q;e[21]!==s||e[22]!==r?(Q=t.jsx(Bt,{automationId:s,range:r}),e[21]=s,e[22]=r,e[23]=Q):Q=e[23];const J=x?g?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):y.length===0?t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No runs yet",description:"This automation hasn't run yet. Trigger it or wait for a starter to fire."})}):t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(se,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),t.jsx(se,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),t.jsx(se,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Started"})]})}),t.jsx(Be,{children:y.map((z,ee)=>t.jsx(Jt,{run:z,usage:P.get(z.id),onClick:()=>b(ee),lastRowRef:ee===y.length-1?D:void 0},z.id))})]}):t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No starters yet",description:"Add a starter (cron, event, or webhook) to start collecting runs."})});let E;e[24]!==w?(E=w&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=w,e[25]=E):E=e[25];const U=m!==null;let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=z=>{z||b(null)},e[26]=O):O=e[26];let V;e[27]!==j||e[28]!==N||e[29]!==c||e[30]!==K||e[31]!==L||e[32]!==a||e[33]!==v||e[34]!==y||e[35]!==M||e[36]!==m?(V=M&&m!==null&&t.jsx(et,{thread:M,client:c,locator:a,connections:j,virtualMcps:N,members:v,selectedIndex:m,total:y.length,onPrev:L,onNext:K}),e[27]=j,e[28]=N,e[29]=c,e[30]=K,e[31]=L,e[32]=a,e[33]=v,e[34]=y,e[35]=M,e[36]=m,e[37]=V):V=e[37];let F;e[38]!==V?(F=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:V}),e[38]=V,e[39]=F):F=e[39];let G;e[40]!==U||e[41]!==F?(G=t.jsx(qe,{open:U,onOpenChange:O,children:F}),e[40]=U,e[41]=F,e[42]=G):G=e[42];let X;return e[43]!==J||e[44]!==E||e[45]!==G||e[46]!==Q?(X=t.jsxs("div",{className:q,children:[Q,J,E,G]}),e[43]=J,e[44]=E,e[45]=G,e[46]=Q,e[47]=X):X=e[47],X}function Qt(l){return l!==null&&l>0?l-1:l}function Zt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Wt(l){return l.id}function Yt(l){return l.items??[]}function Xt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Te))return n.length*Te}export{Rs as A,Ue as M,Ms as T,Re as a,ks as b,At as c,Ps as d,Is as e,De as f,Ts as g,Xe as h,Ds as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as k,j as o,p as L,f as T,r as $,B as M,t as N}from"./index-
|
|
1
|
+
import{e as k,j as o,p as L,f as T,r as $,B as M,t as N}from"./index-uVHAmIsb.js";import{s as q}from"./Plus-aXWGGcSy.js";import{i as S}from"./Zap-Dvtyg5Ik.js";import{S as D}from"./search-input-BfizHALq.js";import{P as l}from"./index-DxJD6aw-.js";import{E as b}from"./empty-state-BKLgisam.js";import{c as O}from"./use-automations-C3tUJiXy.js";import{k as V}from"./use-navigate-to-agent-CDxi6d1t.js";import{A as F}from"./automation-list-row-CXD-x28t.js";import{h as G}from"./use-mcp-client-Bqv2ciYo.js";import{a as H}from"./use-virtual-mcp-Clsr41cX.js";import{R as J}from"./require-capability-BNXWgOaA.js";import"./SearchMd-Cr6CluRw.js";import"./sidebar-DawbXHdj.js";import"./LayoutLeft-CY1OP6dH.js";import"./tooltip-C_pZvUmA.js";import"./sheet-J3PJeFDK.js";import"./X-B1W1F4mo.js";import"./alert-dialog-B2k_N3ZX.js";import"./dropdown-menu-CL4WEQRf.js";import"./Check-D7HZW6oZ.js";import"./ChevronRight-3jD7TdJZ.js";import"./DotsVertical-Cz5MZln-.js";import"./agent-icon-CCGqC-bl.js";import"./AlertCircle-DjOU_aot.js";import"./Tool01-DC4THSlP.js";import"./SwitchHorizontal01-Blia-yUi.js";import"./RefreshCcw01-DS1vtLKW.js";import"./XCircle-BtUzMyFW.js";import"./ArrowUpRight-BXJMGk9i.js";import"./ZapSquare-BQX2HOTP.js";import"./Users03-DiilXFZ6.js";import"./CheckCircle-XS4dmEOs.js";import"./ChevronDown-CxTVikeq.js";import"./ChevronLeft-BEmN2X52.js";import"./ChevronUp-Dbc77Gwp.js";import"./Container-Hfp9SJFa.js";import"./Eye-BIZqMr-y.js";import"./ZoomOut-DC46Ewts.js";import"./Globe01-CiCGKTg3.js";import"./FilterLines-iroXgkwP.js";import"./Star01-pwvCfpNJ.js";import"./Palette-BDd6wxPD.js";import"./HardDrive-B26C8dI3.js";import"./Stars02-vcxNwhIa.js";import"./Key01-DZeJDklU.js";import"./LinkExternal01-DwxMIV-o.js";import"./Monitor01-_FIjo4ge.js";import"./Sun-De2vWRC7.js";import"./Play-C933mY5z.js";import"./Settings02-DeH66RiM.js";import"./Shield01-0kTDalL_.js";import"./Stars01-Bw7_Rdwp.js";import"./Trash01-DBSukaq0.js";import"./Upload01-DruP7_KV.js";import"./User01-Bweqikx-.js";import"./Users01-N436STOJ.js";import"./XClose-r0gXvFlp.js";import"./auth-ClbRbdVv.js";import"./use-collections-CNY4Rigp.js";import"./use-capability-BcwY0Lf1.js";import"./access-gate-CVMVVI4n.js";import"./capability-load-error-BfCjxOlU.js";function K(){const t=k.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,B=H(),R=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(B.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const m=y.get(e.virtual_mcp_id);if(m&&m.title.toLowerCase().includes(g))return!0}return!1}),P=(e,m)=>{const A=m&&y.has(m)?m:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),R(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let a;t[10]!==h.Content||t[11]!==s?(a=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=a):a=t[12];let c;return t[13]!==x||t[14]!==a?(c=o.jsx(x,{children:a}),t[13]=x,t[14]=a,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function io(){const t=k.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{io as default};
|