decocms 4.128.2 → 4.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CcJR9lDx.js → AlertCircle-ChrEJ4f_.js} +1 -1
- package/dist/client/assets/{AreaChart-BLod3P_5.js → AreaChart-DOdNfZkl.js} +1 -1
- package/dist/client/assets/{ArrowRight-50m4dBqP.js → ArrowRight-D_5yMP4-.js} +1 -1
- package/dist/client/assets/{ArrowUp-DtlTFcks.js → ArrowUp-CTg3ROLO.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BjrX0FN6.js → ArrowUpRight-Cra4kIiX.js} +1 -1
- package/dist/client/assets/{Check-DPcaxv8W.js → Check-DzxvDpPc.js} +1 -1
- package/dist/client/assets/{CheckCircle-BTv00CDi.js → CheckCircle-B3e5dQPs.js} +1 -1
- package/dist/client/assets/{ChevronDown-CE-dt1_4.js → ChevronDown-DmyUyrkh.js} +1 -1
- package/dist/client/assets/{ChevronRight-CiV6NObT.js → ChevronRight-54oyocSS.js} +1 -1
- package/dist/client/assets/{ChevronUp-CBSw_cVZ.js → ChevronUp-BnASW8pm.js} +1 -1
- package/dist/client/assets/{Copy01-B7muPIS3.js → Copy01-CWffCf9g.js} +1 -1
- package/dist/client/assets/{DotsVertical-DH2Ke3aN.js → DotsVertical-Dgo1CQgH.js} +1 -1
- package/dist/client/assets/{Eye-CV-lQqMZ.js → Eye-BDCv2Ekp.js} +1 -1
- package/dist/client/assets/{FilterLines-BELxcn1B.js → FilterLines-ENv6fdg_.js} +1 -1
- package/dist/client/assets/{HardDrive-C1SmT04m.js → HardDrive-vN01BxHD.js} +1 -1
- package/dist/client/assets/{Key01-qEvDbmY_.js → Key01-B7QzhdZD.js} +1 -1
- package/dist/client/assets/{LayoutLeft-bpjFyzuM.js → LayoutLeft-BNNkRo7t.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BESPGnen.js → LinkExternal01-BZQLhplI.js} +1 -1
- package/dist/client/assets/{LogOut01-UaonUAMF.js → LogOut01-B9OF5r3n.js} +1 -1
- package/dist/client/assets/{Monitor01-BOxkrI7o.js → Monitor01-BoSykLqR.js} +1 -1
- package/dist/client/assets/{Palette-DJ01rRe7.js → Palette-KWWZkydi.js} +1 -1
- package/dist/client/assets/{Play-dvk9NtdY.js → Play-DvIAEuQJ.js} +1 -1
- package/dist/client/assets/{Plus-DIBwNfAj.js → Plus-BGmvry0Y.js} +1 -1
- package/dist/client/assets/{SearchLg-rlbCvjkV.js → SearchLg-CCzNDi_F.js} +1 -1
- package/dist/client/assets/{SearchMd-C7kiBwzR.js → SearchMd-etxAYikv.js} +1 -1
- package/dist/client/assets/{Settings02-CQDvCAHm.js → Settings02-DTCR2X5i.js} +1 -1
- package/dist/client/assets/{Shield01-DfAXWSWL.js → Shield01-gf-kihUG.js} +1 -1
- package/dist/client/assets/{Star01-BUB_KBrQ.js → Star01-CjAxh1dF.js} +1 -1
- package/dist/client/assets/{Stars01-YH1ujS_z.js → Stars01-BVFlUMWf.js} +1 -1
- package/dist/client/assets/{Stars02-BYnTCemT.js → Stars02-hWa_QMUt.js} +1 -1
- package/dist/client/assets/{Sun-CTBCDuzI.js → Sun-D4a3XRjt.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BWpbcVYo.js → SwitchHorizontal01-BwnTbNNZ.js} +1 -1
- package/dist/client/assets/{Tool01-DeBChu_0.js → Tool01-CULZuXdB.js} +1 -1
- package/dist/client/assets/{Tool02-Bi4OIChz.js → Tool02-DVIzQqnV.js} +1 -1
- package/dist/client/assets/{Trash01-BdYkKKtb.js → Trash01-DZ9PxHNu.js} +1 -1
- package/dist/client/assets/{TrendUp01-BFtw_73y.js → TrendUp01-C-OZ2PtA.js} +1 -1
- package/dist/client/assets/{Upload01-N1D_dVMU.js → Upload01-nfcSyWV0.js} +1 -1
- package/dist/client/assets/{User01-Cid-L7qO.js → User01-BxeCCTvC.js} +1 -1
- package/dist/client/assets/{Users01-COHgmcx2.js → Users01-BiKjN2j_.js} +1 -1
- package/dist/client/assets/{Users03-DlAqQlOR.js → Users03-DcXWd1n8.js} +1 -1
- package/dist/client/assets/{X-DbzacWkH.js → X-Cg7cHlDH.js} +1 -1
- package/dist/client/assets/{XCircle-Bmz1RpCf.js → XCircle-DYn683Ar.js} +1 -1
- package/dist/client/assets/{XClose-D1ij43Z1.js → XClose-luJf4o5_.js} +1 -1
- package/dist/client/assets/{Zap-DQDoGJ6A.js → Zap-Bi1zRJLX.js} +1 -1
- package/dist/client/assets/{ZapSquare-3xz-m2ZD.js → ZapSquare-qMeIwOyd.js} +1 -1
- package/dist/client/assets/{access-gate-DhZoCcxM.js → access-gate-o7jCeWJA.js} +1 -1
- package/dist/client/assets/{add-section-modal-CRRJOysW.js → add-section-modal-CYuxtsxr.js} +1 -1
- package/dist/client/assets/{agent-icon-SKARqHNw.js → agent-icon-CukLd0Mp.js} +1 -1
- package/dist/client/assets/{agents-list-MM7zKhCT.js → agents-list-DZFkUanv.js} +1 -1
- package/dist/client/assets/ai-providers-BxK_PfFX.js +1 -0
- package/dist/client/assets/{alert-CdFuGAoH.js → alert-BK3tVKJE.js} +1 -1
- package/dist/client/assets/{alert-dialog-Cxn2nzht.js → alert-dialog-b5UnHVqW.js} +1 -1
- package/dist/client/assets/{app-editor-DL7COsbj.js → app-editor-BfjBsosJ.js} +1 -1
- package/dist/client/assets/{auth-B1cV5tvE.js → auth-DXAKqUpi.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bl6--lop.js → auth-catchall-0vdulQG8.js} +1 -1
- package/dist/client/assets/{auth-entry-D2i8okfW.js → auth-entry-B7Cjrhzb.js} +1 -1
- package/dist/client/assets/{auth-split-layout-4rpNhWuc.js → auth-split-layout-CYmjPP4q.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-m3p0WgFS.js → authenticate-and-persist-oauth-C9zIBw_D.js} +1 -1
- package/dist/client/assets/{automation-list-row-k88mEjTW.js → automation-list-row-BJoLlhyV.js} +1 -1
- package/dist/client/assets/{automation-runs-tQpZkN73.js → automation-runs-C5bc17bG.js} +1 -1
- package/dist/client/assets/{automations-BGiaPCGv.js → automations-BsM2RCK0.js} +1 -1
- package/dist/client/assets/{avatar-D5XlNhqj.js → avatar-CWpICmuX.js} +1 -1
- package/dist/client/assets/{badge-CotImuBJ.js → badge-DjkBW9xL.js} +1 -1
- package/dist/client/assets/{block-document-DGJw0Svc.js → block-document-_F3RgRCP.js} +1 -1
- package/dist/client/assets/{brand-context-DrZEyfz8.js → brand-context-CQ048RS7.js} +1 -1
- package/dist/client/assets/{buckets-0fJRHMb8.js → buckets-Bdd6MLPn.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-ChXI69QX.js → bulk-category-panel-Chx6q-mO.js} +1 -1
- package/dist/client/assets/{calendar-gh9Pk9lG.js → calendar-DUHF2A4o.js} +1 -1
- package/dist/client/assets/{capability-load-error-lsBMtrvZ.js → capability-load-error-EQEQgFRV.js} +1 -1
- package/dist/client/assets/{card-B3p-gzrH.js → card-B3I3Xx2k.js} +1 -1
- package/dist/client/assets/{category-editor-C3hf1gmA.js → category-editor-B4JA2dBl.js} +1 -1
- package/dist/client/assets/chat-context-Bv5IdsBs.js +36 -0
- package/dist/client/assets/{checkbox-CNSvM9Nn.js → checkbox-qkaDBqll.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CVHy6DCG.js → cli-auth-success-UM_t95fx.js} +1 -1
- package/dist/client/assets/{collection-detail-DDn64LqO.js → collection-detail-35L3sS7v.js} +1 -1
- package/dist/client/assets/{collection-display-button-1ZmHRjEK.js → collection-display-button-Dxmwhy59.js} +1 -1
- package/dist/client/assets/{collection-search-BA7TJGXZ.js → collection-search-DFhOZrbv.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D-JGBm81.js → collection-table-wrapper-CbvzJXzy.js} +1 -1
- package/dist/client/assets/{collection-tabs-BE4zphfI.js → collection-tabs-BDUDWJsI.js} +1 -1
- package/dist/client/assets/{command-Dv7DHM3H.js → command-Cv7kKSry.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DzBIwtLM.js → commerce-onboarding-DHiN8gAD.js} +1 -1
- package/dist/client/assets/{companions-core-CzdZtzh3.js → companions-core-Byxe2KNq.js} +1 -1
- package/dist/client/assets/{connect-DyqzbpX6.js → connect-Bjx6W3Jm.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog--07-Hdcg.js → connect-desktop-dialog-B2egGO5_.js} +1 -1
- package/dist/client/assets/{connection-BsTBER9p.js → connection-DNyRj--L.js} +1 -1
- package/dist/client/assets/{connection-card-qe3XmMIN.js → connection-card-B3W-81hH.js} +1 -1
- package/dist/client/assets/{connection-detail-CVXmxvQE.js → connection-detail-BzX5xWrJ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Dr-MZF7h.js → connection-form-helpers-C_NiSdBC.js} +1 -1
- package/dist/client/assets/{connections-CduI9hXp.js → connections-BlXCVkUH.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-cwdCGwmc.js → decopilot-sse-pool-BvhFou9N.js} +1 -1
- package/dist/client/assets/{dialog-aRe0aX2z.js → dialog-DZdfWcfZ.js} +1 -1
- package/dist/client/assets/{domain-settings-DHC8HWwI.js → domain-settings-DzkQPN4m.js} +1 -1
- package/dist/client/assets/{drawer-BNQ_B83F.js → drawer-DMT9F4TK.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Dkzg5xkn.js → dropdown-menu-D2gJNoEy.js} +1 -1
- package/dist/client/assets/{empty-state-CTqfGl2O.js → empty-state-8qu3OlQW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-lFA8Tdg3.js → extract-connection-data-C0mRrkCV.js} +1 -1
- package/dist/client/assets/{file-explorer-DYY22xJO.js → file-explorer-BNljlV9c.js} +1 -1
- package/dist/client/assets/{form-Cab4SqUM.js → form-ZCuHwYRw.js} +1 -1
- package/dist/client/assets/{general-DfpFL8W7.js → general-CjfLtZA-.js} +1 -1
- package/dist/client/assets/{github-repo-picker-tD6iUol-.js → github-repo-picker-C6ikNBMX.js} +1 -1
- package/dist/client/assets/{hooks-Tdn9M7az.js → hooks-Ciq2Ihws.js} +1 -1
- package/dist/client/assets/{index-BLieRT8x.js → index-BB7IlyVl.js} +1 -1
- package/dist/client/assets/{index-C6E2jNN_.js → index-BBYnwJqr.js} +1 -1
- package/dist/client/assets/{index-DszmhdKD.js → index-BUPobRGZ.js} +3 -3
- package/dist/client/assets/{index-BL5TJBMu.js → index-C1YcrFSr.js} +1 -1
- package/dist/client/assets/{index-CnBTGSyL.js → index-C5tzMY2R.js} +1 -1
- package/dist/client/assets/index-CDRYD3ml.css +1 -0
- package/dist/client/assets/{index-DTXT7U39.js → index-CKdJ0w5G.js} +1 -1
- package/dist/client/assets/{index-9Ewt8A9D.js → index-CeV1Z9PE.js} +1 -1
- package/dist/client/assets/{index-CevaBnGa.js → index-DCArhALw.js} +1 -1
- package/dist/client/assets/{index-DMEa-VQv.js → index-DDCLnfif.js} +11 -11
- package/dist/client/assets/{index-CHKU0Vf7.js → index-nvN0Nvz5.js} +1 -1
- package/dist/client/assets/{index-redirect-KUSITufA.js → index-redirect-gwiHkX_7.js} +1 -1
- package/dist/client/assets/index-u10QJlzJ.js +665 -0
- package/dist/client/assets/{input-Dt2Glj0p.js → input-DKvr8w-J.js} +1 -1
- package/dist/client/assets/{integration-icon-D35WuqNg.js → integration-icon-BgYO-8yb.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CX1QWlXl.js → invite-member-dialog-B-Wt0HhS.js} +1 -1
- package/dist/client/assets/{label-DOeMvIAI.js → label-B_MvgzYx.js} +1 -1
- package/dist/client/assets/{layout-Bs6L25D7.js → layout-A2Ysmsee.js} +1 -1
- package/dist/client/assets/{login-CdAroBC5.js → login-DZHAWcHN.js} +1 -1
- package/dist/client/assets/{mcp-oauth-WEmYXRv_.js → mcp-oauth-Bl2Hi1c9.js} +1 -1
- package/dist/client/assets/{members-sePzAhYz.js → members-BHwsHAh4.js} +1 -1
- package/dist/client/assets/{monaco-editor-DGWzo1Pp.js → monaco-editor-CAdbEiWQ.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-5kj3_9Cw.js → monitoring-stats-row-bkZtYVxy.js} +1 -1
- package/dist/client/assets/{multi-select-Dg0ESVMr.js → multi-select-Bi659k09.js} +1 -1
- package/dist/client/assets/{oauth-callback-D29Tf8Rd.js → oauth-callback-CE1CkplR.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BcuhUttc.js → oauth-callback-ai-provider-Bct8015X.js} +1 -1
- package/dist/client/assets/{onboarding-Bj0EZaNN.js → onboarding-BRkU2bEl.js} +1 -1
- package/dist/client/assets/{org-install-ByGpawt8.js → org-install-B1NDfbEu.js} +1 -1
- package/dist/client/assets/{org-layout-CrHCktAe.js → org-layout-B8uhzwFf.js} +1 -1
- package/dist/client/assets/{organization-choice-2AzogLoT.js → organization-choice-i0QO3xAK.js} +1 -1
- package/dist/client/assets/{orgs-BLNLA4fy.js → orgs-Bme84ttT.js} +1 -1
- package/dist/client/assets/{page-seo-form-hNqp7Zan.js → page-seo-form-BAwYZfn2.js} +1 -1
- package/dist/client/assets/{popover-DQSZwaRt.js → popover-DmO2xFc2.js} +1 -1
- package/dist/client/assets/{post-editor-27uDwsdb.js → post-editor-Dg7oK3f9.js} +1 -1
- package/dist/client/assets/{primitives-DFRSVxyA.js → primitives-DbkTteSg.js} +1 -1
- package/dist/client/assets/{profile-CTmjtAdF.js → profile-n5FiudL5.js} +1 -1
- package/dist/client/assets/project-app-view-DTYUkU8A.js +1 -0
- package/dist/client/assets/record-editor-CTfzHGm0.js +1 -0
- package/dist/client/assets/{redirect-editor-CYFNLLf-.js → redirect-editor-CecGPpcc.js} +1 -1
- package/dist/client/assets/registry-HQaQ-eCr.js +2 -0
- package/dist/client/assets/{registry-layout-C0JBUU7u.js → registry-layout-D4WGBT42.js} +1 -1
- package/dist/client/assets/{reports-BqNR0i8o.js → reports-C3coclWf.js} +1 -1
- package/dist/client/assets/{require-capability-wPWt0V0V.js → require-capability-zBfjUNqv.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C1sHnr65.js → required-auth-layout-D5g5nxMv.js} +1 -1
- package/dist/client/assets/{reset-password-CwgICDBi.js → reset-password-B-8W-cTU.js} +1 -1
- package/dist/client/assets/{roles-C-cvvqy9.js → roles-D8JN2pmE.js} +1 -1
- package/dist/client/assets/{search-input-Bb9W1dfI.js → search-input-BwsmHGmB.js} +1 -1
- package/dist/client/assets/{secrets-CBiuVPJr.js → secrets-CbIsEgU1.js} +1 -1
- package/dist/client/assets/{sections-editor-a5DVabmK.js → sections-editor-BJ9Sh42g.js} +1 -1
- package/dist/client/assets/{select-BHfp1pAM.js → select-DpQDZmfR.js} +1 -1
- package/dist/client/assets/select-model-DxDxrudq.js +4 -0
- package/dist/client/assets/{self-tool-result-DsRzBSq6.js → self-tool-result-BuJuKGNb.js} +1 -1
- package/dist/client/assets/{seo-editor-Bi6noK1P.js → seo-editor-D8uEMr7V.js} +1 -1
- package/dist/client/assets/{settings-layout-B7m4yJe2.js → settings-layout-BN2kSe53.js} +1 -1
- package/dist/client/assets/{settings-section-CLk_z53J.js → settings-section-CeoJ-iZI.js} +1 -1
- package/dist/client/assets/{shell-controls-9nc8pmcv.js → shell-controls-D4RwalZK.js} +1 -1
- package/dist/client/assets/{shell-layout-CqPHfiDu.js → shell-layout-FYc8hGny.js} +1 -1
- package/dist/client/assets/{sidebar-evLPszYP.js → sidebar-BtxL2z7q.js} +1 -1
- package/dist/client/assets/{skeleton-yWaX74jB.js → skeleton-CNS0U6RF.js} +1 -1
- package/dist/client/assets/{sso-CvNMgg4I.js → sso-gichjFv8.js} +1 -1
- package/dist/client/assets/{store-D4Xvc4q3.js → store-B3pEXBJc.js} +1 -1
- package/dist/client/assets/store-registry-y_gRspmC.js +2 -0
- package/dist/client/assets/{studio-tools-B5H3Tgpy.js → studio-tools-BLtIqajW.js} +1 -1
- package/dist/client/assets/{switch-CVFYYXDE.js → switch-Bsd0r9Qi.js} +1 -1
- package/dist/client/assets/{tab-id-a6hxX8mK.js → tab-id-GJrp_wLy.js} +1 -1
- package/dist/client/assets/{table-B07TaQi7.js → table-ByXL24-N.js} +1 -1
- package/dist/client/assets/{tabs-D58aHzYu.js → tabs-qSGQLGiW.js} +1 -1
- package/dist/client/assets/{textarea-DeY3PwwV.js → textarea-Ybmt_ltf.js} +1 -1
- package/dist/client/assets/{toggle-group-oISCi_hG.js → toggle-group-CgS7tqCq.js} +1 -1
- package/dist/client/assets/{toolbar-BRp9u3n9.js → toolbar-Db5b3_rN.js} +1 -1
- package/dist/client/assets/{tooltip-DviFlSxQ.js → tooltip-DGdW_V_n.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DKSfFuUl.js → use-ai-providers-BG8qxaij.js} +1 -1
- package/dist/client/assets/{use-api-keys-7upQXaMD.js → use-api-keys-DV2Vjwu1.js} +1 -1
- package/dist/client/assets/{use-automations-B8IHx0wb.js → use-automations-C4ain8jt.js} +1 -1
- package/dist/client/assets/{use-autosave-nlSJsFb6.js → use-autosave-0QAj24N0.js} +1 -1
- package/dist/client/assets/{use-capability-Ycu1oh_S.js → use-capability-DshfmDFx.js} +1 -1
- package/dist/client/assets/{use-clock-tick-ydImcjUT.js → use-clock-tick-CHOR22uQ.js} +1 -1
- package/dist/client/assets/{use-connection-CD22rpi4.js → use-connection-C1K4NZr5.js} +1 -1
- package/dist/client/assets/{use-copy-DxB1VJKf.js → use-copy-BDIbA3Ac.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D94pixEX.js → use-create-virtual-mcp-DNHBH9KY.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DZCuuqyc.js → use-debounced-autosave-CU97sBga.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BDOIC0Vq.js → use-debounced-value-Dgeqwyta.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CUXAHNwy.js → use-deco-credits-BhZS_byw.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CZ6_4k4l.js → use-decopilot-events-C77j7wEF.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Dxtu2l3Y.js → use-delete-connection-BLWHkB-6.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Bh81Jcj7.js → use-deployment-admin-DzHVY2Ii.js} +1 -1
- package/dist/client/assets/{use-file-configs-ZpQNVHLs.js → use-file-configs-MUtM-Xrr.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CN34HPpW.js → use-infinite-scroll-DHfinFVw.js} +1 -1
- package/dist/client/assets/{use-join-requests-A0tYBwz_.js → use-join-requests-DVkcGMTU.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Dma7u0uI.js → use-mcp-auth-status-CXEffk7E.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BWPv_Ura.js → use-mcp-client-CJWJJ8M6.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Ca28jlom.js → use-mcp-tools-CT1sVVDH.js} +1 -1
- package/dist/client/assets/{use-members-DfbkpjOs.js → use-members-DrNhueKE.js} +1 -1
- package/dist/client/assets/{use-mobile-s9EHERLf.js → use-mobile-DfyivUON.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-9-2zOrMG.js → use-navigate-to-agent-B-lkSTWn.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BgZCW1B-.js → use-org-auth-client-SJQlUJoe.js} +1 -1
- package/dist/client/assets/{use-org-sso-B7sg_ADq.js → use-org-sso-8X7ZYzlo.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CxLRwsJv.js → use-organization-roles-fElQj0vk.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CkmgeZK3.js → use-organization-settings-BNWjqbOB.js} +1 -1
- package/dist/client/assets/{use-registry-app-C_6cMYlS.js → use-registry-app-DgO4OI4o.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DsE_iRaY.js → use-registry-connections-9JaQ79xK.js} +1 -1
- package/dist/client/assets/{use-secrets-AzuzgFWR.js → use-secrets-B-yRCIm0.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CMztUVKW.js → use-status-sounds-BMhgkZiA.js} +1 -1
- package/dist/client/assets/{use-view-mode-BfHgdMAp.js → use-view-mode-DsWFSzob.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CUQiLl15.js → use-virtual-mcp-BOBW3cbo.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BQHAHcmZ.js +1 -0
- package/dist/client/assets/{useQueries-BluvzEW-.js → useQueries-BCgaUYwu.js} +1 -1
- package/dist/client/assets/{useRouterState-D6mgoU36.js → useRouterState-DwUUc2VD.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DnVqn117.js +1 -0
- package/dist/client/assets/{users-CUpa0Q6g.js → users-CDXgT5n4.js} +1 -1
- package/dist/client/assets/{variant-calendar-Bz7FlZM5.js → variant-calendar-FD4pfnqd.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-6z0ld8nT.js → view-mode-toggle-Cg0F0vxl.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +525 -524
- package/dist/server/migrate.js +94 -94
- package/dist/server/server.js +338 -338
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-BdbYZu32.js +0 -1
- package/dist/client/assets/chat-context-BJO4Nyj6.js +0 -36
- package/dist/client/assets/index-BHyEVpcy.css +0 -1
- package/dist/client/assets/index-BRx-jvN3.js +0 -665
- package/dist/client/assets/project-app-view-CetJPEDP.js +0 -1
- package/dist/client/assets/record-editor-BV-fOjGi.js +0 -1
- package/dist/client/assets/registry-Cwo52Raw.js +0 -2
- package/dist/client/assets/select-model-Bd2B0dVo.js +0 -4
- package/dist/client/assets/store-registry-GCF001s3.js +0 -2
- package/dist/client/assets/useInfiniteQuery-bAz2qqBC.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BlGRmbRl.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as re,X as I,a1 as Ae,a3 as we,a4 as Ue,a2 as ze,a$ as Fe,c as X,b as ne,Y as He,Z as Be,r as J,j as s,a5 as rt,t as ae,aw as qe,F as Ie,o as Ke,e as Se,K as oe,n as Le,m as Te,B as le,p as Ve,v as ot,E as nt}from"./index-DMEa-VQv.js";import{i as at}from"./AlertCircle-CcJR9lDx.js";import{P as Pe}from"./index-CHKU0Vf7.js";import{S as Me}from"./skeleton-yWaX74jB.js";import{b as Qe,a as Ee,S as Re,c as ct}from"./settings-section-CLk_z53J.js";import{u as Ce,a as Ne,b as Ge}from"./use-ai-providers-DKSfFuUl.js";import{i as dt}from"./CheckCircle-BTv00CDi.js";import{e as mt,f as ft}from"./use-organization-settings-CkmgeZK3.js";import{M as ut,b as Ye,P as pt,C as $e}from"./select-model-Bd2B0dVo.js";import{u as gt}from"./use-debounced-autosave-DZCuuqyc.js";import{z as ht,B as xt,D as vt,S as bt}from"./chat-context-BJO4Nyj6.js";import{I as De}from"./input-Dt2Glj0p.js";import{T as Oe,a as yt}from"./toggle-group-oISCi_hG.js";import{c as We,d as Je,b as Xe,f as Ze,g as et,e as tt,a as st,A as it}from"./alert-dialog-Cxn2nzht.js";import{u as je}from"./studio-tools-B5H3Tgpy.js";import{s as jt}from"./Plus-DIBwNfAj.js";import{p as St,f as Ct}from"./pt-BR-CLy76QW2.js";import{c as _t}from"./Tool01-DeBChu_0.js";import{s as kt}from"./Trash01-BdYkKKtb.js";import{A as Pt}from"./avatar-D5XlNhqj.js";import{i as Nt}from"./Settings02-CQDvCAHm.js";import{s as Dt}from"./Eye-CV-lQqMZ.js";import{b as It,a as Kt,d as wt,e as At,c as Mt}from"./dialog-aRe0aX2z.js";import{R as Et}from"./require-capability-wPWt0V0V.js";import"./sidebar-evLPszYP.js";import"./LayoutLeft-bpjFyzuM.js";import"./use-mobile-s9EHERLf.js";import"./X-DbzacWkH.js";import"./tooltip-DviFlSxQ.js";import"./card-B3p-gzrH.js";import"./ArrowUpRight-BjrX0FN6.js";import"./use-mcp-client-BWPv_Ura.js";import"./auth-B1cV5tvE.js";import"./drawer-BNQ_B83F.js";import"./checkbox-CNSvM9Nn.js";import"./Check-DPcaxv8W.js";import"./select-BHfp1pAM.js";import"./ChevronDown-CE-dt1_4.js";import"./ChevronUp-CBSw_cVZ.js";import"./Key01-qEvDbmY_.js";import"./SearchMd-C7kiBwzR.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BOxkrI7o.js";import"./ChevronRight-CiV6NObT.js";import"./connect-desktop-dialog--07-Hdcg.js";import"./Copy01-B7muPIS3.js";import"./Stars01-YH1ujS_z.js";import"./tab-id-a6hxX8mK.js";import"./hooks-Tdn9M7az.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-cwdCGwmc.js";import"./use-virtual-mcp-CUQiLl15.js";import"./use-decopilot-events-CZ6_4k4l.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-Cid-L7qO.js";import"./use-capability-Ycu1oh_S.js";import"./access-gate-DhZoCcxM.js";import"./capability-load-error-lsBMtrvZ.js";re({title:I(),url:I(),icon:I()});re({registries:we(I(),re({enabled:Ue()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(I()).describe("List of MCP app_name or app_id values to hide from the store.")});const ye=re({keyId:I(),modelId:I(),title:I().optional()}).nullable();ze(["fast","smart","thinking","image","web_search","deep_research"]);ze(["fast","smart","thinking"]);const Rt=re({tiers:re({fast:ye,smart:ye,thinking:ye,image:ye,web_search:ye,deep_research:ye})});re({ids:Ae(I()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});re({id:I().describe("Brand context ID"),name:I().describe("Company name"),domain:I().describe("Company domain (e.g. example.com)"),overview:I().describe("Company overview / description"),logo:I().nullable().optional().describe("Logo URL"),favicon:I().nullable().optional().describe("Favicon URL"),ogImage:I().nullable().optional().describe("OG image URL"),fonts:re({heading:I().optional().describe("Font family for headings"),body:I().optional().describe("Font family for body text"),code:I().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:re({primary:I().optional().describe("Primary brand color (hex)"),secondary:I().optional().describe("Secondary brand color (hex)"),accent:I().optional().describe("Accent / highlight color (hex)"),background:I().optional().describe("Background color (hex)"),foreground:I().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(we(I(),Fe())).nullable().optional().describe("Brand images"),metadata:we(I(),Fe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:I().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ue().optional().describe("Whether this is the default brand for the organization")});const Ft=e=>e.capabilities?.includes("image")===!0,Tt=e=>ht(e),$t=e=>xt(e),Ot=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Ft},{key:"web_search",filter:Tt},{key:"deep_research",filter:$t}];function Ut(e){const t=X.c(26),{slot:i,onSlotChange:l,filterModels:n,defaultKeyId:a}=e,c=Ce(),[o,b]=J.useState(i?.keyId??a);let _;t[0]!==i?(_=()=>{i?.keyId&&b(i.keyId)},t[0]=i,t[1]=_):_=t[1];const y=i?.keyId;let r;t[2]!==y?(r=[y],t[2]=y,t[3]=r):r=t[3],J.useEffect(_,r);const d=o??a;let m;t[4]!==d||t[5]!==c?(m=d?c.find(v=>v.id===d):null,t[4]=d,t[5]=c,t[6]=m):m=t[6];const u=m,{models:h,isLoading:g}=Ne(n?d??void 0:void 0),k=n?g||h.some(n):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=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]=p):p=t[9];const j=p,N=ne();if(n&&!k){let v;t[10]!==N?(v=N("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=N,t[11]=v):v=t[11];let K;return t[12]!==v?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:v}),t[12]=v,t[13]=K):K=t[13],K}let S;t[14]!==N?(S=N("settings.simpleModeSection.pickModel"),t[14]=N,t[15]=S):S=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=v=>b(v),t[16]=C):C=t[16];let f;t[17]!==d||t[18]!==l?(f=v=>{const K=v.keyId??d??"";b(K),l({keyId:K,modelId:v.modelId,title:v.title})},t[17]=d,t[18]=l,t[19]=f):f=t[19];let P;return t[20]!==d||t[21]!==n||t[22]!==j||t[23]!==S||t[24]!==f?(P=s.jsx(ut,{variant:"bordered",placeholder:S,model:j,credentialId:d,filterModels:n,onCredentialChange:C,onModelChange:f}),t[20]=d,t[21]=n,t[22]=j,t[23]=S,t[24]=f,t[25]=P):P=t[25],P}function zt(e){const t=X.c(10),{isPending:i,showSaved:l}=e,n=ne();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qe,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let o;return t[3]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=o):o=t[4],o}if(l){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let o;return t[8]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=o):o=t[9],o}return null}function Ht(){const e=X.c(58),t=ne(),i=Ce(),l=mt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=He(Rt),e[0]=a):a=e[0];let c;e[1]!==l?(c={resolver:a,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const o=Be(c),{mutate:b,isPending:_,isSuccess:y}=ft(),r=o.formState.isDirty;let d;e[3]!==o||e[4]!==l||e[5]!==t||e[6]!==b?(d={delayMs:250,save:async()=>{const x=o.getValues();b(x,{onSuccess:()=>o.reset(x,{keepValues:!0}),onError:A=>{o.reset(l),ae.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=l,e[5]=t,e[6]=b,e[7]=d):d=e[7];const{schedule:m}=gt(d),u=i[0],h=i[1],g=i[2],{models:k}=Ne(u?.id),{models:p}=Ne(h?.id),{models:j}=Ne(g?.id);let N,S;e[8]!==o||e[9]!==n?(N=()=>{n||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},S=[n,o],e[8]=o,e[9]=n,e[10]=N,e[11]=S):(N=e[10],S=e[11]),J.useEffect(N,S);let C;e[12]!==i||e[13]!==o||e[14]!==u||e[15]!==h||e[16]!==g||e[17]!==k||e[18]!==p||e[19]!==j?(C=()=>{const x=o.getValues(),A=new Set(i.map(Bt)),M={};u?.id&&(M[u.id]=k),h?.id&&(M[h.id]=p),g?.id&&(M[g.id]=j);const w=L=>L!=null&&!A.has(L.keyId),D={fast:w(x.tiers.fast)?null:x.tiers.fast,smart:w(x.tiers.smart)?null:x.tiers.smart,thinking:w(x.tiers.thinking)?null:x.tiers.thinking,image:w(x.tiers.image)?null:x.tiers.image,web_search:w(x.tiers.web_search)?null:x.tiers.web_search,deep_research:w(x.tiers.deep_research)?null:x.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,W=D.fast===x.tiers.fast&&D.smart===x.tiers.smart&&D.thinking===x.tiers.thinking&&D.image===x.tiers.image&&D.web_search===x.tiers.web_search&&D.deep_research===x.tiers.deep_research;if(!Y&&W)return;const $=vt(i,M);o.reset({tiers:{fast:D.fast??$.chat.fast,smart:D.smart??$.chat.smart,thinking:D.thinking??$.chat.thinking,image:D.image??$.image,web_search:D.web_search??$.webSearch,deep_research:D.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=u,e[15]=h,e[16]=g,e[17]=k,e[18]=p,e[19]=j,e[20]=C):C=e[20];const f=u?.id,P=h?.id,v=g?.id;let K;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==p||e[25]!==j||e[26]!==f||e[27]!==P||e[28]!==v?(K=[o,i,k,p,j,f,P,v],e[21]=i,e[22]=o,e[23]=k,e[24]=p,e[25]=j,e[26]=f,e[27]=P,e[28]=v,e[29]=K):K=e[29],J.useEffect(C,K);let V;e[30]!==t?(V=x=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[x]||x,e[30]=t,e[31]=V):V=e[31];const q=V;let O;e[32]!==t?(O=x=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[x]||"",e[32]=t,e[33]=O):O=e[33];const Q=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let E;e[36]!==t?(E=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=E):E=e[37];let z;e[38]!==E?(z=s.jsx("p",{className:"text-sm text-muted-foreground",children:E}),e[38]=E,e[39]=z):z=e[39];const G=y&&!r;let H;e[40]!==_||e[41]!==G?(H=s.jsx(zt,{isPending:_,showSaved:G}),e[40]=_,e[41]=G,e[42]=H):H=e[42];let R;e[43]!==z||e[44]!==H?(R=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[z,H]}),e[43]=z,e[44]=H,e[45]=R):R=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==Q||e[49]!==q||e[50]!==m?(F=Ot.map(x=>s.jsx(rt,{control:o.control,name:`tiers.${x.key}`,render:A=>{const{field:M}=A;return s.jsx(Qe,{title:q(x.key),description:Q(x.key),action:s.jsx(Ut,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:x.filter,onSlotChange:w=>{M.onChange(w),m()}})})}},x.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=Q,e[49]=q,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Ee,{children:F}),e[52]=F,e[53]=T):T=e[53];let B;return e[54]!==U||e[55]!==R||e[56]!==T?(B=s.jsxs(Re,{title:U,headerClassName:"pl-0",children:[R,T]}),e[54]=U,e[55]=R,e[56]=T,e[57]=B):B=e[57],B}function Bt(e){return e.id}const qt={usd:[10,20,100],brl:[50,100,500]};function Lt(){const e=X.c(30),t=ne(),i=je(),[l,n]=J.useState(!1);let a;e[0]!==t?(a=f=>{ae.error(t("settings.decoCreditsHero.topUpFailed",{message:f.message}))},e[0]=t,e[1]=a):a=e[1];const{mutate:c,isPending:o}=Se({mutationFn:async f=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:f,currency:d});return P},onSuccess:Vt,onError:a}),[b,_]=J.useState(""),[y,r]=J.useState("usd"),d=y,m=parseFloat(b),u=!isNaN(m)&&m>=1,h=d==="brl"?"R$":"$";let g;e[2]!==r?(g=f=>{f&&r(f)},e[2]=r,e[3]=g):g=e[3];let k,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Oe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),p=s.jsx(Oe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=p):(k=e[4],p=e[5]);let j;e[6]!==d||e[7]!==g?(j=s.jsxs(yt,{type:"single",variant:"outline",size:"default",value:d,onValueChange:g,children:[k,p]}),e[6]=d,e[7]=g,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==h||e[11]!==l||e[12]!==o||e[13]!==t||e[14]!==c?(N=!l&&s.jsxs(s.Fragment,{children:[qt[d].map(f=>s.jsxs(le,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>c(f*100),children:[h,f]},f)),s.jsx(le,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=h,e[11]=l,e[12]=o,e[13]=t,e[14]=c,e[15]=N):N=e[15];let S;e[16]!==h||e[17]!==b||e[18]!==m||e[19]!==l||e[20]!==u||e[21]!==o||e[22]!==_||e[23]!==t||e[24]!==c?(S=l&&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:h}),s.jsx(De,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:b,onChange:f=>_(f.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(le,{className:"h-10",disabled:!u||o,onClick:()=>c(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(le,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),_("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=h,e[17]=b,e[18]=m,e[19]=l,e[20]=u,e[21]=o,e[22]=_,e[23]=t,e[24]=c,e[25]=S):S=e[25];let C;return e[26]!==j||e[27]!==N||e[28]!==S?(C=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,S]})}),e[26]=j,e[27]=N,e[28]=S,e[29]=C):C=e[29],C}function Vt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Qt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Gt(){const e=X.c(121),t=ne(),{org:i}=Ie(),l=je(),n=Ke(),a=Ce();let c;e[0]!==a?(c=a.find(Yt),e[0]=a,e[1]=c):c=e[1];const o=c,[b,_]=J.useState(!1);let y;e[2]!==o||e[3]!==l?(y=async()=>{o&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=l,e[4]=y):y=e[4];let r;e[5]!==i.id||e[6]!==n||e[7]!==t?(r=()=>{n.invalidateQueries({queryKey:oe.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:oe.aiProviders(i.id)}),ae.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=r):r=e[8];let d;e[9]!==t?(d=lt=>{ae.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==y||e[12]!==r||e[13]!==d?(m={mutationFn:y,onSuccess:r,onError:d},e[11]=y,e[12]=r,e[13]=d,e[14]=m):m=e[14];const{mutate:u,isPending:h}=Se(m);let g;e[15]!==i.id?(g=oe.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let p;e[17]!==l?(p=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=p):p=e[18];let j;e[19]!==g||e[20]!==k||e[21]!==p?(j={queryKey:g,enabled:k,staleTime:6e4,queryFn:p},e[19]=g,e[20]=k,e[21]=p,e[22]=j):j=e[22];const{data:N,isLoading:S,refetch:C,isFetching:f}=Le(j);if(!o)return null;const P=N?.balanceCents!=null?N.balanceCents/100:null;let v;e[23]!==P?(v=P!=null?`$${P.toFixed(2)}`:"—",e[23]=P,e[24]=v):v=e[24];const K=v;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let q;e[27]!==t?(q=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=q):q=e[28];let O;e[29]!==q?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:q,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=q,e[30]=O):O=e[30];let Q;e[31]!==t?(Q=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=Q):Q=e[32];let U;e[33]!==Q?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:Q})}),e[33]=Q,e[34]=U):U=e[34];let E;e[35]!==O||e[36]!==U?(E=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=E):E=e[37];let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=()=>_(!0),e[38]=z):z=e[38];let G;e[39]!==t?(G=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=G):G=e[40];let H;e[41]!==h||e[42]!==G?(H=s.jsx(le,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:h,children:G}),e[41]=h,e[42]=G,e[43]=H):H=e[43];let R;e[44]!==E||e[45]!==H?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[E,H]}),e[44]=E,e[45]=H,e[46]=R):R=e[46];let F;e[47]!==t?(F=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=F):F=e[48];let T;e[49]!==F?(T=s.jsx(We,{children:F}),e[49]=F,e[50]=T):T=e[50];let B;e[51]!==t?(B=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=B):B=e[52];let x;e[53]!==B?(x=s.jsx(Je,{children:B}),e[53]=B,e[54]=x):x=e[54];let A;e[55]!==T||e[56]!==x?(A=s.jsxs(Xe,{children:[T,x]}),e[55]=T,e[56]=x,e[57]=A):A=e[57];let M;e[58]!==t?(M=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=M):M=e[59];let w;e[60]!==M?(w=s.jsx(Ze,{children:M}),e[60]=M,e[61]=w):w=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==D||e[67]!==Y?(W=s.jsx(et,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==w||e[70]!==W?($=s.jsxs(tt,{children:[w,W]}),e[69]=w,e[70]=W,e[71]=$):$=e[71];let L;e[72]!==A||e[73]!==$?(L=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=L):L=e[74];let Z;e[75]!==b||e[76]!==L?(Z=s.jsx(it,{open:b,onOpenChange:_,children:L}),e[75]=b,e[76]=L,e[77]=Z):Z=e[77];let ee;e[78]!==P||e[79]!==K||e[80]!==f||e[81]!==S?(ee=S||f?s.jsx(Me,{className:"h-9 w-24"}):s.jsx("span",{className:Te("text-3xl font-semibold tabular-nums tracking-tight",P!=null&&Qt(P)),children:K}),e[78]=P,e[79]=K,e[80]=f,e[81]=S,e[82]=ee):ee=e[82];let te;e[83]!==C?(te=()=>C(),e[83]=C,e[84]=te):te=e[84];let se;e[85]!==t?(se=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=se):se=e[86];const ce=f&&"animate-spin";let ie;e[87]!==ce?(ie=Te(ce),e[87]=ce,e[88]=ie):ie=e[88];let de;e[89]!==ie?(de=s.jsx(qe,{size:14,className:ie}),e[89]=ie,e[90]=de):de=e[90];let me;e[91]!==f||e[92]!==te||e[93]!==se||e[94]!==de?(me=s.jsx("button",{type:"button",onClick:te,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":se,children:de}),e[91]=f,e[92]=te,e[93]=se,e[94]=de,e[95]=me):me=e[95];let fe;e[96]!==ee||e[97]!==me?(fe=s.jsxs("div",{className:"flex items-baseline gap-2",children:[ee,me]}),e[96]=ee,e[97]=me,e[98]=fe):fe=e[98];let ue;e[99]!==t?(ue=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=ue):ue=e[100];let pe;e[101]!==ue?(pe=s.jsx("p",{className:"text-xs text-muted-foreground",children:ue}),e[101]=ue,e[102]=pe):pe=e[102];let ge;e[103]!==fe||e[104]!==pe?(ge=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[fe,pe]}),e[103]=fe,e[104]=pe,e[105]=ge):ge=e[105];let he;e[106]!==t?(he=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=he):he=e[107];let xe;e[108]!==he?(xe=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:he}),e[108]=he,e[109]=xe):xe=e[109];let _e;e[110]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(Lt,{}),e[110]=_e):_e=e[110];let ve;e[111]!==xe?(ve=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[xe,_e]}),e[111]=xe,e[112]=ve):ve=e[112];let be;e[113]!==R||e[114]!==Z||e[115]!==ge||e[116]!==ve?(be=s.jsx(Ee,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,Z,ge,ve]})}),e[113]=R,e[114]=Z,e[115]=ge,e[116]=ve,e[117]=be):be=e[117];let ke;return e[118]!==V||e[119]!==be?(ke=s.jsx(Re,{title:V,children:be}),e[118]=V,e[119]=be,e[120]=ke):ke=e[120],ke}function Yt(e){return e.providerId==="deco"}function Wt(){const e=X.c(8),{org:t}=Ie(),i=je(),l=Ke();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let a;e[2]!==t||e[3]!==l?(a=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:oe.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:oe.aiProviders(t.id)}),ae.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==a?(c={mutationFn:n,onSuccess:a,onError:Jt},e[5]=n,e[6]=a,e[7]=c):c=e[7],Se(c)}function Jt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ae.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Xt(){const e=X.c(37),t=ne(),{mutate:i,isPending:l}=Wt();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 a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let o;e[4]!==c?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=o):o=e[5];let b;e[6]!==t?(b=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=b):b=e[7];let _;e[8]!==b?(_=s.jsx("p",{className:"text-base font-semibold",children:b}),e[8]=b,e[9]=_):_=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let r;e[12]!==y?(r=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:y}),e[12]=y,e[13]=r):r=e[13];let d;e[14]!==_||e[15]!==r?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,r]}),e[14]=_,e[15]=r,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let h;e[21]!==u||e[22]!==d?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[21]=u,e[22]=d,e[23]=h):h=e[23];let g;e[24]!==i?(g=()=>i(),e[24]=i,e[25]=g):g=e[25];let k;e[26]!==l||e[27]!==t?(k=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=k):k=e[28];let p;e[29]!==l||e[30]!==g||e[31]!==k?(p=s.jsx(le,{variant:"outline",disabled:l,onClick:g,children:k}),e[29]=l,e[30]=g,e[31]=k,e[32]=p):p=e[32];let j;return e[33]!==h||e[34]!==p||e[35]!==o?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,h,p]})]}),e[33]=h,e[34]=p,e[35]=o,e[36]=j):j=e[36],j}const Zt=e=>re({label:I().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:I().optional(),baseUrl:I().optional()});function es({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function ts({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:o}){const{org:b}=Ie(),_=je(),y=Ke(),r=ne(),[d,m]=J.useState(!1),u=t.id==="openai-compatible",h=t.supportedMethods.includes("api-key"),g=Zt(r),{register:k,handleSubmit:p,watch:j,setError:N,formState:{errors:S}}=Be({resolver:He(g),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),C=j("apiKey")??"",{mutate:f,isPending:P}=Se({mutationFn:async v=>{let K;v.apiKey&&(u?K=JSON.stringify({baseUrl:v.baseUrl||a||"",apiKey:v.apiKey}):K=v.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:v.label,...K!==void 0?{apiKey:K}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:oe.aiProviderKeys(b.id)}),y.invalidateQueries({queryKey:oe.aiProviders(b.id)}),ae.success(r("settings.editProviderDialog.providerUpdated")),o()},onError:v=>ae.error(r("settings.editProviderDialog.failedToUpdate",{error:v.message}))});return s.jsxs("form",{onSubmit:p(v=>{if(es({isOpenAICompatible:u,baseUrl:v.baseUrl,currentBaseUrl:a,apiKey:v.apiKey})){N("apiKey",{message:r("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}f(v)}),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:r("settings.editProviderDialog.label")}),s.jsx(De,{placeholder:r("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),S.label&&s.jsx("p",{className:"text-xs text-destructive",children:S.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.baseUrl")}),s.jsx(De,{type:"url",placeholder:i?.baseUrlPlaceholder??r("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),h&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[r("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",r("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(De,{type:d&&C?"text":"password",placeholder:l,...k("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),C&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":r(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Nt,{size:14}):s.jsx(Dt,{size:14})})]}),S.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:S.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Mt,{children:[s.jsx(le,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:P,children:r("settings.editProviderDialog.cancel")}),s.jsx(le,{type:"submit",size:"sm",disabled:P,children:r(P?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function ss(e){const t=X.c(31),{providerKey:i,provider:l,open:n,onOpenChange:a}=e,c=ne(),o=je(),b=l.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,_=b?.name??l.name;let y;t[0]!==i.id?(y=oe.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let r;t[2]!==i.id||t[3]!==o?(r=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=r):r=t[4];let d;t[5]!==n||t[6]!==y||t[7]!==r?(d={queryKey:y,queryFn:r,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=r,t[8]=d):d=t[8];const{data:m,isLoading:u}=Le(d),h=At,g=wt,k="sm:max-w-md",p=Kt,j=It,N=c("settings.editProviderDialog.editTitle",{name:_});let S;t[9]!==j||t[10]!==N?(S=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=S):S=t[11];let C;t[12]!==p||t[13]!==S?(C=s.jsx(p,{children:S}),t[12]=p,t[13]=S,t[14]=C):C=t[14];let f;t[15]!==u||t[16]!==a||t[17]!==b||t[18]!==m||t[19]!==l||t[20]!==i?(f=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(bt,{})}):s.jsx(ts,{providerKey:i,provider:l,preset:b,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=u,t[16]=a,t[17]=b,t[18]=m,t[19]=l,t[20]=i,t[21]=f):f=t[21];let P;t[22]!==g||t[23]!==C||t[24]!==f?(P=s.jsxs(g,{className:k,children:[C,f]}),t[22]=g,t[23]=C,t[24]=f,t[25]=P):P=t[25];let v;return t[26]!==h||t[27]!==a||t[28]!==n||t[29]!==P?(v=s.jsx(h,{open:n,onOpenChange:a,children:P}),t[26]=h,t[27]=a,t[28]=n,t[29]=P,t[30]=v):v=t[30],v}function is(e){const t=X.c(86),{providerKey:i,provider:l}=e,{org:n}=Ie(),a=je(),c=Ke(),[o,b]=J.useState(!1),[_,y]=J.useState(!1),r=ne(),[d]=ot(),m=d.language==="pt-BR"?St:void 0,u=l.id==="openai-compatible";let h;t[0]!==u||t[1]!==i.presetId?(h=u&&i.presetId?Ye(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=h):h=t[2];const g=h;let k;t[3]!==u||t[4]!==g||t[5]!==l.name||t[6]!==r?(k=g?g.name:u?r("settings.aiProviders.customOpenAiCompatible"):l.name,t[3]=u,t[4]=g,t[5]=l.name,t[6]=r,t[7]=k):k=t[7];const p=k,j=g?.logo??l.logo;let N;e:{if(u){N=i.label;break e}const ce=i.label;let ie;t[8]!==m||t[9]!==i.createdAt?(ie=Ct(new Date(i.createdAt),{locale:m}),t[8]=m,t[9]=i.createdAt,t[10]=ie):ie=t[10],N=`${ce} · added ${ie} ago`}const S=N;let C;t[11]!==i.id||t[12]!==a?(C=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[11]=i.id,t[12]=a,t[13]=C):C=t[13];let f;t[14]!==n||t[15]!==i.id||t[16]!==c||t[17]!==r?(f=()=>{c.invalidateQueries({queryKey:oe.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:oe.aiProviders(n.id)}),c.invalidateQueries({queryKey:oe.aiProviderModels(n.id,i.id)}),ae.success(r("settings.providerKeyRow.keyDeleted")),b(!1)},t[14]=n,t[15]=i.id,t[16]=c,t[17]=r,t[18]=f):f=t[18];let P;t[19]!==r?(P=ce=>ae.error(r("settings.providerKeyRow.failedToDeleteKey",{error:ce.message})),t[19]=r,t[20]=P):P=t[20];let v;t[21]!==C||t[22]!==f||t[23]!==P?(v={mutationFn:C,onSuccess:f,onError:P},t[21]=C,t[22]=f,t[23]=P,t[24]=v):v=t[24];const{mutate:K,isPending:V}=Se(v);let q;t[25]!==p||t[26]!==j?(q=j?s.jsx("img",{src:j,alt:p,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Pt,{fallback:p.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[25]=p,t[26]=j,t[27]=q):q=t[27];let O;t[28]!==r?(O=r("settings.providerKeyRow.editProviderKey"),t[28]=r,t[29]=O):O=t[29];let Q,U;t[30]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>y(!0),U=s.jsx(_t,{size:14}),t[30]=Q,t[31]=U):(Q=t[30],U=t[31]);let E;t[32]!==O?(E=s.jsx(le,{variant:"ghost",size:"icon","aria-label":O,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:Q,children:U}),t[32]=O,t[33]=E):E=t[33];let z;t[34]!==r?(z=r("settings.providerKeyRow.deleteProviderKey"),t[34]=r,t[35]=z):z=t[35];let G,H;t[36]===Symbol.for("react.memo_cache_sentinel")?(G=()=>b(!0),H=s.jsx(kt,{size:14}),t[36]=G,t[37]=H):(G=t[36],H=t[37]);let R;t[38]!==V||t[39]!==z?(R=s.jsx(le,{variant:"ghost",size:"icon","aria-label":z,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:V,onClick:G,children:H}),t[38]=V,t[39]=z,t[40]=R):R=t[40];let F;t[41]!==E||t[42]!==R?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[E,R]}),t[41]=E,t[42]=R,t[43]=F):F=t[43];let T;t[44]!==S||t[45]!==p||t[46]!==F||t[47]!==q?(T=s.jsx(Qe,{icon:q,title:p,description:S,action:F}),t[44]=S,t[45]=p,t[46]=F,t[47]=q,t[48]=T):T=t[48];let B;t[49]!==_||t[50]!==l||t[51]!==i?(B=s.jsx(ss,{providerKey:i,provider:l,open:_,onOpenChange:y}),t[49]=_,t[50]=l,t[51]=i,t[52]=B):B=t[52];let x;t[53]!==r?(x=r("settings.providerKeyRow.deleteApiKey"),t[53]=r,t[54]=x):x=t[54];let A;t[55]!==x?(A=s.jsx(We,{children:x}),t[55]=x,t[56]=A):A=t[56];let M;t[57]!==i.label?(M=s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=M):M=t[58];let w;t[59]!==A||t[60]!==M?(w=s.jsxs(Xe,{children:[A,M]}),t[59]=A,t[60]=M,t[61]=w):w=t[61];let D;t[62]!==r?(D=r("settings.providerKeyRow.cancel"),t[62]=r,t[63]=D):D=t[63];let Y;t[64]!==D?(Y=s.jsx(Ze,{children:D}),t[64]=D,t[65]=Y):Y=t[65];let W;t[66]!==K?(W=()=>K(),t[66]=K,t[67]=W):W=t[67];let $;t[68]!==r?($=r("settings.providerKeyRow.delete"),t[68]=r,t[69]=$):$=t[69];let L;t[70]!==W||t[71]!==$?(L=s.jsx(et,{onClick:W,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),t[70]=W,t[71]=$,t[72]=L):L=t[72];let Z;t[73]!==Y||t[74]!==L?(Z=s.jsxs(tt,{children:[Y,L]}),t[73]=Y,t[74]=L,t[75]=Z):Z=t[75];let ee;t[76]!==w||t[77]!==Z?(ee=s.jsxs(st,{children:[w,Z]}),t[76]=w,t[77]=Z,t[78]=ee):ee=t[78];let te;t[79]!==o||t[80]!==ee?(te=s.jsx(it,{open:o,onOpenChange:b,children:ee}),t[79]=o,t[80]=ee,t[81]=te):te=t[81];let se;return t[82]!==T||t[83]!==B||t[84]!==te?(se=s.jsxs(s.Fragment,{children:[T,B,te]}),t[82]=T,t[83]=B,t[84]=te,t[85]=se):se=t[85],se}function ls(e){const t=X.c(17),{onConnectClick:i}=e,l=ne(),n=Ce(),a=Ge();let c;t[0]!==a?.providers?(c=a?.providers??[],t[0]=a?.providers,t[1]=c):c=t[1];const o=c;let b;if(t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==l){let _;t[7]!==o?(_=h=>({key:h,provider:o.find(g=>g.id===h.providerId)}),t[7]=o,t[8]=_):_=t[8];const y=n.filter(ns).map(_).filter(os);let r;t[9]!==l?(r=l("settings.connectedProvidersSection.sectionTitle"),t[9]=l,t[10]=r):r=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(jt,{size:14}),t[11]=d):d=t[11];let m;t[12]!==l?(m=l("settings.connectedProvidersSection.connectButton"),t[12]=l,t[13]=m):m=t[13];let u;t[14]!==i||t[15]!==m?(u=s.jsxs(le,{size:"sm",onClick:i,children:[d,m]}),t[14]=i,t[15]=m,t[16]=u):u=t[16],b=s.jsx(Re,{title:r,headerClassName:"px-0",actions:u,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Ee,{children:y.map(rs)})}),t[2]=n,t[3]=i,t[4]=o,t[5]=l,t[6]=b}else b=t[6];return b}function rs(e){const{key:t,provider:i}=e;return s.jsx(is,{providerKey:t,provider:i},t.id)}function os(e){return e.provider!==void 0}function ns(e){return e.providerId!=="deco"}function as(e){const t=X.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(at,{size:16}),t[0]=l):l=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function cs(){const e=X.c(23),t=Ce();let i;e[0]!==t?(i=t.some(ds),e[0]=t,e[1]=i):i=e[1];const l=i,n=t.length>0,[a,c]=J.useState(!1),[o,b]=J.useState(null),_=Ge();let y;e[2]!==_?.providers?(y=_?.providers??[],e[2]=_?.providers,e[3]=y):y=e[3];const r=y;if(!n){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(!0),e[4]=k):k=e[4];let p;e[5]!==r?(p=s.jsx(pt,{providers:r,onSelect:b,onShowAll:k}),e[5]=r,e[6]=p):p=e[6];const j=o!==null||a;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=P=>{P||(b(null),c(!1))},e[7]=N):N=e[7];const S=o??void 0;let C;e[8]!==j||e[9]!==S?(C=s.jsx($e,{open:j,onOpenChange:N,initialProvider:S}),e[8]=j,e[9]=S,e[10]=C):C=e[10];let f;return e[11]!==p||e[12]!==C?(f=s.jsxs(s.Fragment,{children:[p,C]}),e[11]=p,e[12]=C,e[13]=f):f=e[13],f}let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-16 w-full"}),children:s.jsx(Ht,{})}),e[14]=d):d=e[14];let m;e[15]!==l?(m=l?s.jsx(Gt,{}):s.jsx(Xt,{}),e[15]=l,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ls,{onConnectClick:()=>c(!0)}),e[17]=u):u=e[17];let h;e[18]!==a?(h=s.jsx($e,{open:a,onOpenChange:c}),e[18]=a,e[19]=h):h=e[19];let g;return e[20]!==m||e[21]!==h?(g=s.jsxs(s.Fragment,{children:[d,m,u,h]}),e[20]=m,e[21]=h,e[22]=g):g=e[22],g}function ds(e){return e.providerId==="deco"}function ms(){const e=X.c(7),t=ne();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Pe.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(nt,{fallback:fs,children:s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-64 w-full"}),children:s.jsx(cs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==l?(a=s.jsx(Pe,{children:s.jsx(Pe.Content,{children:s.jsx(Pe.Body,{children:s.jsxs(ct,{children:[l,n]})})})}),e[5]=l,e[6]=a):a=e[6],a}function fs(e){const{error:t}=e;return s.jsx(as,{error:t??new Error("Failed to load AI providers")})}function vi(){const e=X.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Et,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(ms,{})}),e[0]=t):t=e[0],t}export{vi as default};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{W as x,a1 as C,X as i,a4 as Ee,a2 as re,a3 as xe,aH as Se,co as kt,ba as Le,a$ as st,c as le,m as wt,bt as Ct,j as z,F as ee,K as be,n as Mt,J as it,u as Ne,o as rt,t as ie,I as me,G as fe,d as lt,f as Tt,r as v,b as De,p as At,a as Pt,v as Rt,a8 as _t}from"./index-DMEa-VQv.js";import{d as Et,q as Dt,A as ct,s as $t,t as Ot,n as Lt,w as Ut}from"./tab-id-a6hxX8mK.js";import{S as Nt,u as Ft,d as jt,b as qt}from"./hooks-Tdn9M7az.js";import{u as Vt}from"./studio-tools-B5H3Tgpy.js";import{a as Kt,u as Ht,S as Bt}from"./use-mcp-client-BWPv_Ura.js";import{u as Qt}from"./use-virtual-mcp-CUQiLl15.js";import{u as Wt,a as ye}from"./use-ai-providers-DKSfFuUl.js";import{u as zt}from"./use-decopilot-events-CZ6_4k4l.js";import{e as Gt}from"./use-organization-settings-CkmgeZK3.js";const ve=x({connection_id:i().describe("Connection ID"),selected_tools:C(i()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:C(i()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:C(i()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),dt=ve.extend({selected_tools:ve.shape.selected_tools.optional(),selected_resources:ve.shape.selected_resources.optional(),selected_prompts:ve.shape.selected_prompts.optional()}),Xt=x({connectionId:i(),toolName:i(),label:i(),icon:i().nullable().optional()}),Zt=x({id:i().describe("Stable id; used as React key and ?tab= value"),title:i().describe("Tab label"),icon:i().optional().describe("Optional lucide icon name"),view:x({type:Le("ext-app"),appId:i(),args:xe(i(),st()).optional()})}),Yt=x({defaultMainView:x({type:i(),id:i().optional(),toolName:i().optional()}).nullable().optional(),chatDefaultOpen:Ee().nullable().optional(),tabs:C(Zt).optional()}),Ze=x({tileId:i().optional(),connectionId:i().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:i().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:i().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:xe(i(),st()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:Se().int().positive().optional(),maxHeight:Se().int().positive().optional()}),Fe=x({banner:i().nullable().optional(),bannerColor:i().nullable().optional(),icon:i().nullable().optional(),themeColor:i().nullable().optional(),pinnedViews:C(Xt).nullable().optional(),layout:Yt.nullable().optional(),homeTile:Ze.nullable().optional(),homeTiles:C(Ze).nullable().optional(),homePrompts:C(i()).nullable().optional()});function ca(t){const e=t?.homeTiles;if(Array.isArray(e)&&e.length>0)return e;const n=t?.homeTile;return n?[n]:[]}const Jt=/^[A-Za-z_][A-Za-z0-9_]*$/,Ye=i().min(1).regex(Jt,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),en=kt("kind",[x({key:Ye,kind:Le("literal"),value:i()}),x({key:Ye,kind:Le("secret"),secretId:i().min(1)})]),tn=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/,nn=x({host:i().min(1).regex(tn).describe("Submodule host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:i().min(1).describe("Vault secret id holding the PAT used to fetch this host.")}),je=x({selected:i().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:i().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:i().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:C(en).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config."),submoduleCredentials:C(nn).nullable().optional().describe("Git submodule credentials injected on every SANDBOX_START. Each entry maps a host to a vault secret (PAT) that Studio resolves before posting /_sandbox/config; the daemon uses it to authenticate `git submodule update` for submodules on that host.")}),qe=x({url:i().describe("GitHub repository URL"),owner:i().describe("Repository owner"),name:i().describe("Repository name"),installationId:Se().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:i().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),an=re(["agent-sandbox","user-desktop"]),on=re(["agent-sandbox","user-desktop","cluster"]);function Ve(t){return t==="cluster"?"agent-sandbox":t}const ut={sandboxHandle:i().describe("Provider-specific handle"),previewUrl:i().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:i().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:an.optional(),createdAt:Se().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:x({packageManager:i().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:i().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:i().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},pt=x(ut),sn=x({...ut,sandboxProviderKind:on.optional()});function rn(t){const e=sn.parse(t);return pt.parse({...e,sandboxProviderKind:e.sandboxProviderKind?Ve(e.sandboxProviderKind):void 0})}function da(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const e=t,n={};for(const[a,o]of Object.entries(e)){if(!o||typeof o!="object"||a!=="cluster"&&a!=="agent-sandbox"&&a!=="user-desktop")continue;const s=Ve(a);try{if(a==="cluster"&&n[s])continue;n[s]=rn(o)}catch{}}return n}const Ke=xe(i().describe("userId"),xe(i().describe("branch"),xe(i().describe("sandboxProviderKind"),pt))),ln=x({id:i().describe("Stable identifier for this knowledge file"),name:i().describe("File name shown in the UI"),kind:re(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:i().describe("Org filesystem (Library) volume the file lives in"),path:i().describe("Path within the volume"),url:i().describe("Same-origin URL to read the file (display/download)"),contentType:i().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:Se().nullable().optional().describe("File size in bytes"),addedAt:i().describe("ISO timestamp when the file was attached")}),He=C(ln).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),cn=re(["smart","code-review","open"]),Be=cn.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),ua=x({id:i().describe("Unique identifier"),title:i().describe("Human-readable name"),description:i().nullable().describe("Description"),icon:i().nullable().describe("Icon URL"),created_at:i().describe("Creation timestamp"),updated_at:i().describe("Last update timestamp"),created_by:i().describe("User ID who created this item"),updated_by:i().optional().describe("User ID who last updated this item"),organization_id:i().describe("Organization ID this item belongs to"),status:re(["active","inactive"]).describe("Current status"),pinned:Ee().describe("Whether this space is pinned to the sidebar"),metadata:x({instructions:i().nullable().describe("Instructions also used as system prompt"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Fe.nullable().optional().describe("UI customization settings"),githubRepo:qe.nullable().optional().describe("Linked GitHub repository"),runtime:je.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ke.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:He,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Be,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().describe("Metadata"),connections:C(ve).describe("Connections with their selected tools, resources, and prompts")}),ht=x({title:i().min(1).max(120).describe("Short label shown on the chip"),description:i().max(280).optional().describe("One-line subtitle shown under the title"),text:i().min(1).describe("The message sent to the agent when the prompt is clicked")});x({title:i().min(1).max(255).describe("Name for the virtual MCP"),description:i().nullable().optional().describe("Optional description"),icon:i().nullish().describe("Optional icon URL"),status:re(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:Ee().optional().default(!1).describe("Pin to sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Fe.nullable().optional().describe("UI customization settings"),githubRepo:qe.nullable().optional().describe("Linked GitHub repository"),runtime:je.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ke.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:He,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Be,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(dt).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:C(ht).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});x({title:i().min(1).max(255).optional().describe("New name"),description:i().nullable().optional().describe("New description (null to clear)"),icon:i().nullish().describe("New icon URL"),status:re(["active","inactive"]).optional().describe("New status"),pinned:Ee().optional().describe("Pin/unpin from sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Fe.nullable().optional().describe("UI customization settings"),githubRepo:qe.nullable().optional().describe("Linked GitHub repository"),runtime:je.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ke.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:He,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Be,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(dt).optional().describe("New connections (replaces existing)"),prompts:C(ht).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});const dn={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},un={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},pn={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},hn={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},mn={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},fn={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function mt(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function bn(t){return mt(t).includes("deepresearch")}const gn=["sonar","searchpreview","online"];function ft(t){const e=mt(t);return e.includes("deepresearch")?!1:gn.some(n=>e.includes(n))}function bt(t){return t.asyncResearch!==!0&&ft(t.modelId)}function gt(t){return t.asyncResearch===!0||bn(t.modelId)||ft(t.modelId)}function pe(t,e,n,a){for(const o of n){const s=t.find(r=>r.modelId===o);if(s)return{keyId:e,modelId:s.modelId,title:s.title}}for(const o of n){const s=t.find(r=>r.modelId.includes(o));if(s)return{keyId:e,modelId:s.modelId,title:s.title}}if(a){const o=t.find(a);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}return null}function yn(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const a of t){const o=e[a.id]??[],s=a.providerId;n.chat.fast||(n.chat.fast=pe(o,a.id,dn[s]??[])),n.chat.smart||(n.chat.smart=pe(o,a.id,un[s]??[])),n.chat.thinking||(n.chat.thinking=pe(o,a.id,pn[s]??[])),n.image||(n.image=pe(o,a.id,hn[s]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=pe(o,a.id,mn[s]??[],bt)),n.deepResearch||(n.deepResearch=pe(o,a.id,fn[s]??[],gt))}return n}const vn=Ct("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function pa(t){const e=le.c(10),{variant:n,size:a}=t;let o;e[0]!==a||e[1]!==n?(o=wt(vn({variant:n,size:a})),e[0]=a,e[1]=n,e[2]=o):o=e[2];let s,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=z.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=z.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=s,e[4]=r):(s=e[3],r=e[4]);let l;e[5]!==o?(l=z.jsxs("svg",{"aria-hidden":"true",className:o,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s,r]}),e[5]=o,e[6]=l):l=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=z.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=p):p=e[7];let u;return e[8]!==l?(u=z.jsxs("div",{role:"status",children:[l,p]}),e[8]=l,e[9]=u):u=e[9],u}const Je={online:!1,capabilities:[],ready:!1};function xn(t){const e=le.c(9),{org:n}=ee(),a=Vt(),o=t?.fast??!1;let s;e[0]!==n.id?(s=be.currentLink(n.id),e[0]=n.id,e[1]=s):s=e[1];let r;e[2]!==a?(r=async()=>{const k=await a.call("LINK_CURRENT_GET",{});return k?{...k,ready:!0}:{...Je,ready:!0}},e[2]=a,e[3]=r):r=e[3];const l=o?1e3:1e4,p=o?2e3:15e3;let u;e[4]!==s||e[5]!==r||e[6]!==l||e[7]!==p?(u={queryKey:s,queryFn:r,staleTime:l,refetchInterval:p,refetchOnWindowFocus:!0},e[4]=s,e[5]=r,e[6]=l,e[7]=p,e[8]=u):u=e[8];const{data:y}=Mt(u);return y??Je}function Sn(t,e=[]){return t==="stop"?e.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
|
|
2
|
-
`).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(a=>a.type==="tool-user_ask"&&a.state==="input-available"||a.state==="approval-requested")?"requires_action":"completed":"failed"}const Re={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function In(t,e){if(!t)return null;const n=e?Ve(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[a,o]of Object.entries(Re))if(o.harness===t&&o.sandbox===n)return a;return null}function ha(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function kn(t,e){return e&&t&&Re[t].sandbox==="user-desktop"?"decopilot":t}function wn(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function Cn(t){const e=t?t.split("/").filter(Boolean):[],n=e[0]==="public",a=n?e[1]??null:null,o=n?a?`public-${a}`:null:e[0]??null,s=(n?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:o,dirPath:s,isPublic:n,publicSet:a,readOnly:n}}function ma(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const et="public-";function yt(t){return t.startsWith(et)?t.slice(et.length):null}function fa(t,e){const n=yt(t);return n?`public/${n}/${e}`:`${t}/${e}`}function Mn(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function Tn(t){const{volume:e,dirPath:n}=Cn(t);if(!e)return null;let a;if(e==="home")a="org/home";else if(e==="outputs")a="org/.outputs";else if(e==="uploads")a="org/.uploads";else{const o=yt(e);a=o?`org/public/${o}`:`org/${e}`}return n?`${a}/${n}`:a}function An(t){const e=le.c(21);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const a=it(n);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const s=Ne(o);let r;e[2]!==s.brand||e[3]!==s.main||e[4]!==s.preview||e[5]!==s.skill?(r=(typeof s.main=="string"?Et(s.main)?.path:void 0)??s.preview??s.skill??s.brand??null,e[2]=s.brand,e[3]=s.main,e[4]=s.preview,e[5]=s.skill,e[6]=r):r=e[6];const l=r;let p;if(e[7]!==a?.params.appSlug||e[8]!==a?.params.collectionName||e[9]!==a?.params.itemId||e[10]!==l||e[11]!==t){if(p=[],t&&p.push(`### Selected Agent
|
|
3
|
-
- ID: ${t}`),l){let y;e[13]!==l?(y=Tn(l),e[13]=l,e[14]=y):y=e[14];const k=y;let R;e[15]!==l?(R=Mn(l),e[15]=l,e[16]=R):R=e[16],p.push(`### Currently Open File
|
|
4
|
-
The user has this file open in the Library and is most likely referring to it:
|
|
5
|
-
- Name: ${R}
|
|
6
|
-
- Library path: ${l}${k?`
|
|
7
|
-
- Read/edit it with your file tools at: \`${k}\``:""}
|
|
8
|
-
|
|
9
|
-
When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let u;e[17]!==a?.params.appSlug||e[18]!==a?.params.collectionName||e[19]!==a?.params.itemId?(u=[],a?.params.appSlug&&u.push(`- Connection ID: ${a?.params.appSlug}`),a?.params.collectionName&&u.push(`- Collection: ${a?.params.collectionName}`),a?.params.itemId&&u.push(`- Item ID: ${a?.params.itemId}`),e[17]=a?.params.appSlug,e[18]=a?.params.collectionName,e[19]=a?.params.itemId,e[20]=u):u=e[20],u.length>0&&p.push(`### Current Resource
|
|
10
|
-
The user is viewing the following resource:
|
|
11
|
-
${u.join(`
|
|
12
|
-
`)}
|
|
13
|
-
|
|
14
|
-
Help the user understand and work with this resource.`),e[7]=a?.params.appSlug,e[8]=a?.params.collectionName,e[9]=a?.params.itemId,e[10]=l,e[11]=t,e[12]=p}else p=e[12];return p.join(`
|
|
15
|
-
|
|
16
|
-
`)}function Pn(){const t=le.c(5),e=rt(),{org:n}=ee();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=a):a=t[0];const o=it(a);let s;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(s=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const u=p[1],y=o?.params.appSlug;if(!y)return;e.invalidateQueries({queryKey:be.collection(n.slug,y,u)});const k=u.toLowerCase().replace(/_/g," ");ie.success(`${k} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=s):s=t[4],s}function Rn(){const t=le.c(4),{org:e,project:n}=ee(),a=`${e.id}/${n.id}`;let o;t[0]!==a?(o=fe.taskLastViewed(a),t[0]=a,t[1]=o):o=t[1];const[,s]=me(o,_n);let r;return t[2]!==s?(r={markTaskRead:p=>{s(u=>({...u,[p]:new Date().toISOString()}))}},t[2]=s,t[3]=r):r=t[3],r}function _n(t){return t??{}}function vt(){const t=lt(),{org:e}=ee(),n=Ne({strict:!1}),a=Tt({strict:!1}),o=n.virtualmcpid??Kt(e.id).id,s=(p,u)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:p},search:y=>{const k={},R=u?.virtualMcpId??y.virtualmcpid;R&&(k.virtualmcpid=R);const g=y.main;return g&&typeof g=="string"&&!Dt(g)&&(k.main=g),(y.sidepanel==="chat"||y.sidepanel===0)&&(k.sidepanel=y.sidepanel),u?.autosend&&(k.autosend=ct),k}})},r=v.useRef(crypto.randomUUID()),l=a.taskId??r.current;return{virtualMcpId:o,taskId:l,navigateToTask:s}}function En(t,e){const{mimeType:n,data:a}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(a),s=>s.charCodeAt(0)));return[{type:"text",text:`${e}
|
|
17
|
-
${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${a}`,filename:e,mediaType:n}]}function tt(t,e){const n=[];for(const a of t)!a||typeof a!="object"||("text"in a&&a.text?n.push({type:"text",text:`[${e}]
|
|
18
|
-
${a.text}`}):"blob"in a&&a.blob&&a.mimeType&&n.push({type:"file",url:`data:${a.mimeType};base64,${a.blob}`,filename:String(a.uri),mediaType:String(a.mimeType)}));return n}function Dn(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),a=t.omittedPaths??[];if(n.length===0&&a.length===0)return[];const o=n.map(r=>`<skill-file path="${r.relPath}">
|
|
19
|
-
${r.content.trim()}
|
|
20
|
-
</skill-file>`).join(`
|
|
21
|
-
|
|
22
|
-
`),s=a.length>0?`
|
|
23
|
-
|
|
24
|
-
Other files in \`${t.sandboxPath}/\`: ${a.join(", ")}`:"";return[{type:"text",text:`[${e}]
|
|
25
|
-
${o}${s}`}]}function $n(t,e){const n=[];for(const a of t){if(a.role!=="user"||!a.content)continue;const o=Array.isArray(a.content)?a.content:[a.content];for(const s of o)switch(s.type){case"text":{const r=s.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
|
|
26
|
-
${r}`});break}case"image":case"audio":{if(!s.data||!s.mimeType)continue;n.push({type:"file",url:`data:${s.mimeType};base64,${s.data}`,mediaType:s.mimeType});break}case"resource":{const r=s.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
|
|
27
|
-
${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function xt(t){if(!t)return[];const e=[];let n="";const a=o=>{if(o){if(o.type==="text"&&"text"in o&&typeof o.text=="string")n+=o.text;else if(o.type==="mention"&&o.attrs){const s=o.attrs.char??"/",r=`${s}${o.attrs.name}`;if(o.attrs.kind==="task"){const l=o.attrs.metadata,p=l?.title??o.attrs.name??"",u=l?.context?.trim()||[p,l?.description?.trim()].filter(Boolean).join(`
|
|
28
|
-
|
|
29
|
-
`);u&&e.push({type:"text",text:u});return}if(n+=r,s==="@"){const l=o.attrs.metadata;l&&typeof l=="object"&&!Array.isArray(l)&&"agentId"in l?e.push({type:"text",text:`[DELEGATE TO AGENT: ${l.title??o.attrs.name} (agent_id: ${l.agentId})]
|
|
30
|
-
Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...tt(l,r))}else if(o.attrs.kind==="skill"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Dn(l,r))}else{const l=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(l)&&l.length>0&&typeof l[0]=="object"&&l[0]!==null&&"role"in l[0]?e.push(...$n(l,r)):Array.isArray(l)&&e.push(...tt(l,r))}}else if(o.type==="file"&&o.attrs){const s=o.attrs,r=`[file:://${encodeURIComponent(s.name)}]`;n+=r,e.push(...En(s,r))}if("content"in o&&Array.isArray(o.content))for(const s of o.content)a(s)}};return a(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function ba(t){const e=xt(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function ga(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function On(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function ya(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function Ln(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Un(t,e){return t.filter(n=>n.messageId!==e)}const nt=new Map,Qe=new Set;function Nn(t){Qe.add(t)}function Fn(t){return Qe.has(t)}function jn(t){Qe.delete(t)}function Ie(t){let e=nt.get(t);return e||(e=new Nt([]),nt.set(t,e)),e}function St(t,e){Ie(t).update(n=>Ln(n,e))}function Ue(t,e){Ie(t).update(n=>Un(n,e))}function qn(t,e){Ie(t).set(e)}const _e=new Map;function Vn(t,e){_e.set(`${t}:${e.id}`,e)}function Kn(t,e){const n=`${t}:${e}`,a=_e.get(n);return _e.delete(n),a}function at(t,e){_e.delete(`${t}:${e}`)}async function J(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const a=await n.json();qn(e,a.items??[])}catch{}}function va(t){const e=le.c(2);let n;e[0]!==t?(n=Ie(t),e[0]=t,e[1]=n):n=e[1];const a=n;return v.useSyncExternalStore(a.subscribe,a.get,a.get)}function Hn(){const{org:t}=ee();return{enqueue:St,refresh:e=>J(t.slug,e),cancel:async(e,n)=>{const a=`thread-run:${e}:${n}`;Ue(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(a)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ie.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await J(t.slug,e)}}}}function oe(t,e,n,a){if(!t)return null;const o=e.find(r=>r.id===t.keyId);if(!o)return null;const s=n.find(r=>r.modelId===t.modelId);return s?{...s,keyId:t.keyId}:{modelId:t.modelId,title:a??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Bn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Qn(t,e,n,a){if(!n||a.length===0)return null;const o=e.find(p=>p.id===n);if(!o)return null;const s=yn([o],{[n]:a}),r=t==="fast"?s.chat.fast:t==="thinking"?s.chat.thinking:s.chat.smart;if(!r)return null;const l=a.find(p=>p.modelId===r.modelId);return l?{...l,keyId:n}:null}const ot=new Set,se=new Set;function he(t){return v.useSyncExternalStore(t.subscribe,t.get,t.get)}function Wn(t){return t.kind==="loading"?"ready":t.kind}const zn=1e4,Gn=10,We=v.createContext(null),ze=v.createContext(null),Ge=v.createContext(null),It=v.createContext(null);function Xn({children:t}){const{locator:e}=ee(),{virtualMcpId:n}=vt(),[a,o]=me(fe.chatSelectedImageModel(e),null),[s,r]=me(fe.chatSelectedWebSearchModel(e),null),[l,p]=me(fe.chatSelectedDeepResearchModel(e),null),[u,y]=v.useState(null),[k,R]=v.useState("default"),g=Gt(),[O,X]=me(fe.chatSimpleModeTier(e),null),K=Bn(O),w=Wt(),M=g.tiers[K],U=u&&w.some(c=>c.id===u)?u:M?.keyId??w[0]?.id??null,{models:N,isLoading:A}=ye(U??void 0),{models:H}=ye(M?.keyId),{models:te}=ye(g.tiers.image?.keyId),{models:ne}=ye(g.tiers.web_search?.keyId),{models:F}=ye(g.tiers.deep_research?.keyId),Z=oe(M,w,H,M?.title)??Qn(K,w,U,N),G=A,B=N.filter(c=>c.capabilities?.includes("image")),j=oe(a,w,B),Y=oe(g.tiers.image,w,te,g.tiers.image?.title)??j??B[0]??null,m=N.filter(bt),L=oe(s,w,m),Q=m.find(c=>c.modelId==="perplexity/sonar")??m[0]??null,W=oe(g.tiers.web_search,w,ne,g.tiers.web_search?.title)??L??Q,q=N.filter(gt),T=oe(l,w,q),V=q.find(c=>c.modelId==="perplexity/deep-research")??q.find(c=>c.asyncResearch===!0)??q[0]??null,E=oe(g.tiers.deep_research,w,F,g.tiers.deep_research?.title)??T??V,$e=Qt(n)??{id:n,title:"",description:null,icon:null},[we,Ce]=v.useState({}),Me=(c,f)=>{const $=[];for(const I of f.content??[])I.type==="text"&&I.text?.trim()&&$.push(I.text.trim());const P=$.join(`
|
|
31
|
-
`);if(!P){ge(c);return}new TextEncoder().encode(P).length>zn||Ce(I=>Object.keys(I).length>=Gn&&!(c in I)?I:{...I,[c]:P})},ge=c=>{Ce(f=>{const{[c]:$,...P}=f;return P})},[Te,ce]=me(fe.chatLastAgentOption(e),c=>c&&c in Re?c:null),ae=Jn(),Oe=ae?.isThreadLocked&&ae.lockedHarness!=null?In(ae.lockedHarness,ae.lockedSandbox):null,Ae=xn(),Xe=kn(Te,Ae.ready&&!Ae.online),de=ae?.isThreadLocked?Oe:Xe,Pe=de?Re[de]:null,d=Pe?.harness??null,h=Pe?.sandbox??null,[_,D]=v.useState(void 0),b=v.useRef(_);b.current=_;const S={selectedModel:Z,setModel:()=>{},credentialId:U,setCredentialId:y,allModelsConnections:w,isModelsLoading:G,selectedVirtualMcp:$e,imageModel:Y,setImageModel:c=>{o(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},webSearchModel:W,setWebSearchModel:c=>{r(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},deepResearchModel:E,setDeepResearchModel:c=>{p(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},chatMode:k,setChatMode:R,appContexts:we,setAppContext:Me,clearAppContext:ge,tiptapDoc:_,setTiptapDoc:D,tiptapDocRef:b,resetInteraction:()=>{},simpleModeTier:K,setSimpleModeTier:c=>X(c),pendingAgentOption:de,setPendingAgentOption:ce,pendingHarnessId:d,pendingSandboxProviderKind:h};return z.jsx(Ge.Provider,{value:S,children:t})}function xa(t){const e=le.c(39),{virtualMcpId:n,task:a,children:o}=t,{locator:s}=ee(),{data:r}=Pt.useSession(),l=r?.user??null,{taskId:p,virtualMcpId:u,navigateToTask:y}=vt(),[k]=Rt(),{markTaskRead:R}=Rn(),g=qt(),O=p,X=u,K=An(X);let w;e[0]!==R||e[1]!==y?(w=(T,V)=>{R(T),y(T,{virtualMcpId:V?.virtualMcpId,autosend:V?.autosend})},e[0]=R,e[1]=y,e[2]=w):w=e[2];const M=w,U=O&&a?.id===O?a:null,N=U?.harness_id??null,A=U?.sandbox_provider_kind??null,H=U?.branch??null,te=N!=null,ne=H;let F;e[3]!==M||e[4]!==g||e[5]!==n?(F=()=>{const T=crypto.randomUUID();return g.create({id:T,virtual_mcp_id:n}).then(()=>M(T)).catch(()=>{M(T)}),T},e[3]=M,e[4]=g,e[5]=n,e[6]=F):F=e[6];const Z=F;let G;e[7]!==s||e[8]!==M||e[9]!==g||e[10]!==n?(G=T=>{const V=crypto.randomUUID(),E=T.virtualMcpId??n;Ut(sessionStorage,s,V,T.message),g.create({id:V,virtual_mcp_id:E}).then(()=>M(V,{virtualMcpId:T.virtualMcpId,autosend:!0})).catch(()=>{M(V,{virtualMcpId:T.virtualMcpId,autosend:!0})})},e[7]=s,e[8]=M,e[9]=g,e[10]=n,e[11]=G):G=e[11];const B=G;let j;e[12]!==O||e[13]!==g?(j=T=>{O&&g.setBranch(O,T)},e[12]=O,e[13]=g,e[14]=j):j=e[14];let Y;e[15]!==U||e[16]!==Z||e[17]!==B||e[18]!==ne||e[19]!==O||e[20]!==X||e[21]!==te||e[22]!==H||e[23]!==N||e[24]!==A||e[25]!==M||e[26]!==j?(Y={virtualMcpId:X,taskId:O,openTask:M,createTask:Z,createTaskWithMessage:B,activeTask:U,isThreadLocked:te,lockedHarness:N,lockedSandbox:A,lockedBranch:H,currentBranch:ne,setCurrentTaskBranch:j},e[15]=U,e[16]=Z,e[17]=B,e[18]=ne,e[19]=O,e[20]=X,e[21]=te,e[22]=H,e[23]=N,e[24]=A,e[25]=M,e[26]=j,e[27]=Y):Y=e[27];const m=Y;let L;e[28]!==K||e[29]!==k||e[30]!==y||e[31]!==l?(L={user:l,contextPrompt:K,preferences:k,rawNavigateToTask:y},e[28]=K,e[29]=k,e[30]=y,e[31]=l,e[32]=L):L=e[32];const Q=L;let W;e[33]!==o||e[34]!==Q?(W=z.jsx(Xn,{children:z.jsx(It.Provider,{value:Q,children:o})}),e[33]=o,e[34]=Q,e[35]=W):W=e[35];let q;return e[36]!==W||e[37]!==m?(q=z.jsx(ze.Provider,{value:m,children:W}),e[36]=W,e[37]=m,e[38]=q):q=e[38],q}function Sa({taskId:t,children:e}){const n=De(),{virtualMcpId:a,activeTask:o,currentBranch:s}=Zn();t&&!ot.has(t)&&(ot.add(t),At("chat_opened",{thread_id:t}));const{imageModel:r,webSearchModel:l,deepResearchModel:p,chatMode:u,setChatMode:y,appContexts:k,setTiptapDoc:R,simpleModeTier:g,pendingSandboxProviderKind:O,pendingHarnessId:X}=Yn(),K=v.useContext(It);if(!K)throw new Error(n("chat.chatContext.activeTaskProviderMissingContext"));const{user:w,contextPrompt:M,preferences:U,rawNavigateToTask:N}=K,{org:A,locator:H}=ee(),te=Hn(),[ne,F]=v.useState(null),Z=Pn(),G=rt(),B=Ft(),j=lt(),Y=Ht({connectionId:Bt,orgId:A.id,orgSlug:A.slug}),m=jt(A.slug,t,{client:Y});v.use(m.ready);const L=he(m.messages),Q=he(m.status),W=he(m.finishReason),q=he(m.runStatusStage),T=he(m.hasMoreOlder),V=he(m.isFetchingOlder),E=v.useRef({onToolCall:Z,queryClient:G,rawNavigateToTask:N,taskId:t,manager:B,navigate:j,orgId:A.id,orgSlug:A.slug});E.current={onToolCall:Z,queryClient:G,rawNavigateToTask:N,taskId:t,manager:B,navigate:j,orgId:A.id,orgSlug:A.slug},zt({orgSlug:A.slug,taskId:t,onTaskStatus:d=>{const h=E.current,_=d.data.message_id;if(d.data.status==="in_progress"&&_){Ue(h.taskId,_);const D=Kn(h.taskId,_);D&&m.applyLocalMessage(D),J(h.orgSlug,h.taskId)}Fn(h.taskId)&&(async()=>(await J(h.orgSlug,h.taskId),await m.reconcileFromServer()&&Ie(h.taskId).get().length===0&&jn(h.taskId)))()}}),v.useEffect(()=>{const d={onData:b=>{if(b.type==="data-thread-title"){const S=b.data;if(!S?.title)return;const c=E.current;if(!c.taskId)return;c.manager.patchThread({id:c.taskId,title:S.title,updated_at:new Date().toISOString()});return}if(b.type==="data-deck-updated"){const S=b.data;if(!S?.path)return;const c=S.path,f=E.current;f.queryClient.invalidateQueries({queryKey:be.orgFsStat(f.orgId,"home",c)}),f.queryClient.invalidateQueries({queryKey:be.orgFsRecent(f.orgId)}),f.navigate({to:".",search:$=>({...$,main:Lt(c)}),replace:!0});return}if(b.type==="data-open-preview"){const S=b.data,c=E.current,f=c.taskId;if(f){const $=c.manager.threads.get().find(P=>P.id===f);c.manager.patchThread({id:f,...S?.branch?{branch:S.branch}:{},...S?.sandboxProviderKind?{sandbox_provider_kind:S.sandboxProviderKind}:{},metadata:{...$?.metadata??{},...S?.githubRepo?{githubRepo:S.githubRepo}:{},...S?.sandboxMap?{sandboxMap:S.sandboxMap}:{}}})}c.navigate({to:".",search:$=>({...$,main:"preview"}),replace:!0});return}},onFinish:(b,S,c)=>{const f=E.current;f.taskId&&J(f.orgSlug,f.taskId),f.taskId&&f.manager.patchThread({id:f.taskId,status:Sn(c,b.parts),updated_at:new Date().toISOString()});const $=b.parts?.some(I=>{const ue=I;return(ue.type==="tool-share_with_user"||ue.type==="tool-bash"||ue.type==="tool-write")&&ue.state==="output-available"});if(f.taskId&&$){const I=be.threadOutputs(f.taskId);for(const ue of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{f.queryClient.invalidateQueries({queryKey:I})},ue)}f.queryClient.invalidateQueries({queryKey:be.homeNextActions(f.orgSlug)});const P=b.metadata?.thread_id;P&&P!==f.taskId&&f.rawNavigateToTask(P)},onError:b=>{F(b),console.error("[chat] Error",b)},onToolCall:b=>E.current.onToolCall(b)};m.observer=d,J(E.current.orgSlug,E.current.taskId);const h=b=>b==="submitted"||b==="streaming";let _=h(m.status.get().kind);const D=m.status.subscribe(()=>{const b=h(m.status.get().kind);if(b===_)return;_=b;const S=E.current;J(S.orgSlug,S.taskId)});return()=>{m.observer===d&&(m.observer=null),D()}},[m]);const ke=Q.kind==="submitted"||Q.kind==="streaming",$e=L.length===0,we=L.at(-1),Ce=!ke&&we?.role==="assistant"&&we.parts.some(d=>"state"in d&&d.state==="approval-requested"),Me=o,ge=(Me?.status==="in_progress"||Me?.status==="expired")&&Q.kind==="ready"&&L.length>0;async function Te(d){const h=t,_=a,D=Object.entries(k),b=D.length>0?D.map(([P,I])=>`### App Context: ${P}
|
|
32
|
-
${I}`).join(`
|
|
33
|
-
|
|
34
|
-
`):"",S=[M,b].filter(Boolean).join(`
|
|
35
|
-
|
|
36
|
-
`);let c=u;c==="gen-image"&&!r&&(c="default"),c==="web-search"&&!l&&(c="default"),c==="deep-research"&&!p&&(c="default"),(c==="web-search"||c==="deep-research")&&y("default");const f=wn({thread:o?{harness_id:o.harness_id??null,sandbox_provider_kind:o.sandbox_provider_kind??null,branch:o.branch??null}:null,globals:{harnessId:X??void 0,sandboxProviderKind:O??void 0,branch:s}});o?.harness_id||B.patchThread({id:h,harness_id:f.harnessId??"decopilot",updated_at:new Date().toISOString()});const $={tier:g,mode:c,toolApprovalLevel:U.toolApprovalLevel??_t(),system:S||void 0,agent:{id:_},thread_id:h,...f};try{if(ke||ge){let P=!0;try{Vn(h,d),await m.enqueue(d,$),St(h,{workflowId:`thread-run:${h}:${d.id}`,messageId:d.id,text:On(d.parts),hasAttachments:d.parts.some(I=>I.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Nn(h)}catch(I){P=!1,at(h,d.id),Ue(h,d.id),F(I instanceof Error?I:new Error(String(I))),ie.error(I instanceof Error?I.message:n("chat.chatContext.failedToQueueMessage"))}return J(A.slug,h),P}return await m.submit({kind:"message",message:d},$),!0}finally{se.delete(h)}}async function ce(d){const h=d.parts??xt(d.tiptapDoc);if(h.length===0||se.has(t))return;se.add(t),F(null),R(void 0);const _={tiptapDoc:d.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:w?.image??void 0,name:w?.name??"you"}},D={id:crypto.randomUUID(),role:"user",parts:h,metadata:_};await Te(D)}async function ae(d,h){if(se.has(t))return ie.info(n("chat.chatContext.stillSendingPreviousMessage")),!1;if(se.add(t),!await te.cancel(t,d))return se.delete(t),ie.error(n("chat.chatContext.couldNotRemoveOriginalMessage")),!1;at(t,d),m.removeLocalMessage(d);const D={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:h}],metadata:{created_at:new Date().toISOString(),user:{avatar:w?.image??void 0,name:w?.name??"you"}}};try{return await Te(D)}catch(b){return ie.error(b instanceof Error?b.message:n("chat.chatContext.failedToSendEditedMessage")),!1}}const Oe=async()=>{m.stop();try{const d=await fetch(`/api/${A.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(d.status===404)return;if(!d.ok){const h=await d.json().catch(()=>({}));throw new Error(h.message??n("chat.chatContext.cancelFailedStatus",{status:d.status}))}}catch(d){const h=d instanceof Error?d.message:n("chat.chatContext.failedToCancel");ie.error(h),console.error("[chat] cancelRun",d)}},Ae=d=>d&&typeof d=="object"&&"type"in d?ce({tiptapDoc:d}):ce(d),de=Ne({strict:!1}).autosend===ct;v.useEffect(()=>{if(!de||L.length>0)return;const d=$t(sessionStorage,H,t);d&&ce(d.message).then(()=>{Ot(sessionStorage,H,t)})},[de,L.length,H,t,ce]);const Pe={messages:L,status:Wn(Q),sendMessage:Ae,editQueuedMessage:ae,stop:()=>{Oe()},submit:(d,h)=>m.submit(d,h),removeLocalMessage:d=>m.removeLocalMessage(d),isSendInFlight:()=>se.has(t),error:ne,clearError:()=>F(null),finishReason:W,runStatusStage:q,clearFinishReason:()=>m.finishReason.set(null),isStreaming:ke,isChatEmpty:$e,isWaitingForApprovals:Ce??!1,isRunInProgress:ge,hasMoreOlder:T,isFetchingOlder:V,fetchOlderMessages:m.fetchOlderMessages.bind(m)};return z.jsx(We.Provider,{value:Pe,children:e})}function Ia(){const t=De(),e=v.useContext(We);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function ka(){return v.useContext(We)}function Zn(){const t=De(),e=v.useContext(ze);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function Yn(){const t=De(),e=v.useContext(Ge);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function wa(){return v.useContext(Ge)}function Jn(){return v.useContext(ze)}export{Sa as A,gt as B,Xn as C,yn as D,Jt as E,pa as S,ua as V,Yn as a,Ia as b,Jn as c,Zn as d,va as e,Hn as f,at as g,ka as h,xa as i,ga as j,da as k,tn as l,ca as m,xt as n,Cn as o,ha as p,Mn as q,ma as r,ya as s,ba as t,xn as u,yt as v,fa as w,vt as x,wa as y,bt as z};
|