decocms 4.246.3 → 4.246.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/dist/client/assets/{AlertCircle-71cJMdGv.js → AlertCircle-2GPyGIlA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DEqYI_Cq.js → AreaChart-DRm7WoAi.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CL_EGumO.js → ArrowLeft-C-s6GSxn.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BP3eCaj-.js → ArrowUp-CIQr6EEf.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-2TydDRJA.js → ArrowUpRight-UxSRtBhQ.js} +1 -1
  6. package/dist/client/assets/{Check-DBTIeTla.js → Check-BOLJAxoj.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DuzB3NSn.js → CheckCircle-CdyPr9LO.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-DnihfXmU.js → ChevronDown-D-aBpIcX.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-86rUFtax.js → ChevronRight-DbA3WeTf.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-mD4z_LUv.js → ChevronSelectorVertical-Ddmm4xQU.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-0iNFpClW.js → ChevronUp-B5EgXJx1.js} +1 -1
  12. package/dist/client/assets/{Copy01-R1ijVaS4.js → Copy01-Cts1DxIQ.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DUG_tM4A.js → CreditCard01-0hLrbslw.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-BoPLbez6.js → DotsVertical-Ddih9daz.js} +1 -1
  15. package/dist/client/assets/{Download01-DLdqm0fi.js → Download01-8V8uONHK.js} +1 -1
  16. package/dist/client/assets/{Eye-BbrjcuZZ.js → Eye-kz-zqGUl.js} +1 -1
  17. package/dist/client/assets/{FilterLines-vFA4SeDJ.js → FilterLines-DSgZnchM.js} +1 -1
  18. package/dist/client/assets/{Globe01-BeY867Re.js → Globe01-DIHsgEmb.js} +1 -1
  19. package/dist/client/assets/{Globe04-jQsowUe2.js → Globe04-Di6RnUZh.js} +1 -1
  20. package/dist/client/assets/{HardDrive-BuCZmMu0.js → HardDrive-DtPQUBC0.js} +1 -1
  21. package/dist/client/assets/{Key01-BHQHtOWB.js → Key01-BdxhwXjh.js} +1 -1
  22. package/dist/client/assets/{LayoutLeft-C4diXNzA.js → LayoutLeft-crVkTtDg.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-BbDAiGAj.js → LinkExternal01-D389APaV.js} +1 -1
  24. package/dist/client/assets/{LockUnlocked01-C4ucWc7t.js → LockUnlocked01-DAnbImxS.js} +1 -1
  25. package/dist/client/assets/{LogOut01-xw3ySQJ3.js → LogOut01-BsZTV-zX.js} +1 -1
  26. package/dist/client/assets/{Monitor01-RPZTznP0.js → Monitor01-ChDM-STj.js} +1 -1
  27. package/dist/client/assets/{Palette-k6NSGjKp.js → Palette-DXkH3xtS.js} +1 -1
  28. package/dist/client/assets/{Play-CqolRnkg.js → Play-CsIDM2C-.js} +1 -1
  29. package/dist/client/assets/{Plus-BvxgpgQ_.js → Plus-DQzrxV5N.js} +1 -1
  30. package/dist/client/assets/{SearchLg-ChGfq8_U.js → SearchLg-CZ8gwJXq.js} +1 -1
  31. package/dist/client/assets/{SearchMd-CP_XNhKh.js → SearchMd-DBwuG5f1.js} +1 -1
  32. package/dist/client/assets/{Settings02-soO290xc.js → Settings02-B5v95CJZ.js} +1 -1
  33. package/dist/client/assets/{Share07-55KCumiJ.js → Share07-DVEQG-0v.js} +1 -1
  34. package/dist/client/assets/{Shield01-BRCFnsHu.js → Shield01-Cko25VMX.js} +1 -1
  35. package/dist/client/assets/{Stars01-CIssp9Qg.js → Stars01-DUuXYRm4.js} +1 -1
  36. package/dist/client/assets/{Stars02-CEseVpj3.js → Stars02-BR3bpPhq.js} +1 -1
  37. package/dist/client/assets/{Sun-DEWLSCzO.js → Sun-BIA5r9xx.js} +1 -1
  38. package/dist/client/assets/{SwitchHorizontal01-Bi9VQH67.js → SwitchHorizontal01-Bb5le3Sb.js} +1 -1
  39. package/dist/client/assets/{Tool01-D-NYfjad.js → Tool01-BtGIY0YP.js} +1 -1
  40. package/dist/client/assets/{Tool02-CKGjN6_i.js → Tool02-lhlB91Fn.js} +1 -1
  41. package/dist/client/assets/{Trash01-BJLMVMF7.js → Trash01-D6L_eF8C.js} +1 -1
  42. package/dist/client/assets/{TrendUp01-C7YMkzaD.js → TrendUp01-DcoY5K-E.js} +1 -1
  43. package/dist/client/assets/{Upload01-DbblTWC5.js → Upload01-DRVTa1ge.js} +1 -1
  44. package/dist/client/assets/{User01-RJV9ipfN.js → User01-nZEMcHk8.js} +1 -1
  45. package/dist/client/assets/UserSquare-CDZ0hmwC.js +1 -0
  46. package/dist/client/assets/{Users01-DCOzhhz8.js → Users01-CI2bch9C.js} +1 -1
  47. package/dist/client/assets/{Users03-CVLfNUdo.js → Users03-CZUMIhrE.js} +1 -1
  48. package/dist/client/assets/{X-DImctFzL.js → X-qfGIRtV3.js} +1 -1
  49. package/dist/client/assets/{XCircle-C5yRlLff.js → XCircle-CSlEELIF.js} +1 -1
  50. package/dist/client/assets/{XClose-Gpt_9L8z.js → XClose-B29qex-C.js} +1 -1
  51. package/dist/client/assets/{YAxis-DeFLQqP8.js → YAxis-CwLlunS9.js} +1 -1
  52. package/dist/client/assets/{Zap-jkb8FMis.js → Zap-DcfYOTMj.js} +1 -1
  53. package/dist/client/assets/{ZapSquare-1SFH2A6K.js → ZapSquare-DAbQm8xZ.js} +1 -1
  54. package/dist/client/assets/{access-gate-BvgMc0ls.js → access-gate-q2W75qif.js} +1 -1
  55. package/dist/client/assets/agent-icon-DbIRcFKb.js +1 -0
  56. package/dist/client/assets/agents-list-CamOrR1B.js +1 -0
  57. package/dist/client/assets/ai-providers-DspWJwuQ.js +6 -0
  58. package/dist/client/assets/{alert-BfIj4866.js → alert-Cp4c1ZTX.js} +1 -1
  59. package/dist/client/assets/{alert-dialog-C-kxmv8R.js → alert-dialog-D7zncluM.js} +1 -1
  60. package/dist/client/assets/api-keys-49vP-WMG.js +1 -0
  61. package/dist/client/assets/app-editor-BDrrJHck.js +1 -0
  62. package/dist/client/assets/{auth-DAO7Mv65.js → auth-DclLBUby.js} +1 -1
  63. package/dist/client/assets/{auth-catchall-BAyKvL3S.js → auth-catchall-9VRWhE6V.js} +1 -1
  64. package/dist/client/assets/{auth-entry-XRM0_Hlz.js → auth-entry-Cuh-jjSQ.js} +1 -1
  65. package/dist/client/assets/{auth-split-layout-YEMjNAem.js → auth-split-layout-BeFO8okq.js} +1 -1
  66. package/dist/client/assets/{authenticate-and-persist-oauth-DVUyd4o7.js → authenticate-and-persist-oauth-t9NbikAw.js} +1 -1
  67. package/dist/client/assets/{automation-list-row-DaEPCeBl.js → automation-list-row-BdkePyT3.js} +1 -1
  68. package/dist/client/assets/{automation-runs-BWnw4rIO.js → automation-runs-kElp1eKm.js} +16 -16
  69. package/dist/client/assets/automations-xfUDC1b7.js +1 -0
  70. package/dist/client/assets/{avatar-H31gkKqD.js → avatar-BBUpRol8.js} +1 -1
  71. package/dist/client/assets/{badge-xHyVR7tO.js → badge-mkaxTwEA.js} +1 -1
  72. package/dist/client/assets/{block-document-CabDesYE.js → block-document-BAkkxnim.js} +1 -1
  73. package/dist/client/assets/{buckets-ClwLsk2c.js → buckets-ywvji3o5.js} +1 -1
  74. package/dist/client/assets/bulk-category-panel-BysrfhA4.js +1 -0
  75. package/dist/client/assets/{capability-load-error-BvGsPiHW.js → capability-load-error-BHBX0Qld.js} +1 -1
  76. package/dist/client/assets/{card-CY7jzfPh.js → card-Cbpe-6mA.js} +1 -1
  77. package/dist/client/assets/{cards-BltuAj6I.js → cards-aKAkWekq.js} +1 -1
  78. package/dist/client/assets/category-editor-DRLIlvse.js +1 -0
  79. package/dist/client/assets/{chart-BkwaaksK.js → chart-Dk8BJc4D.js} +1 -1
  80. package/dist/client/assets/{chat-context-DZPDpv6m.js → chat-context-BCanwFnm.js} +5 -5
  81. package/dist/client/assets/{checkbox-BS3NVws1.js → checkbox-DCdDV4Tp.js} +1 -1
  82. package/dist/client/assets/choose-editor-CSdq1Xzv.js +1 -0
  83. package/dist/client/assets/{cli-auth-success-DfsLd0bQ.js → cli-auth-success-BkZwiuAh.js} +1 -1
  84. package/dist/client/assets/collection-detail-Q11WI60y.js +1 -0
  85. package/dist/client/assets/{collection-display-button-DYJ92sGO.js → collection-display-button-BmbZ48g-.js} +1 -1
  86. package/dist/client/assets/{collection-search-Dm2jRFZ6.js → collection-search-CQHN5z2w.js} +1 -1
  87. package/dist/client/assets/{collection-table-wrapper-DrvNW4uh.js → collection-table-wrapper-DAjE-z7r.js} +1 -1
  88. package/dist/client/assets/{collection-tabs-DxofT2Xb.js → collection-tabs-BpQJKdR6.js} +1 -1
  89. package/dist/client/assets/{command-B21h-hRb.js → command-D8KJYF4L.js} +1 -1
  90. package/dist/client/assets/commerce-onboarding-uZOFN1Zd.js +1 -0
  91. package/dist/client/assets/{connect-9B4cGObA.js → connect-DdyrjkVl.js} +2 -2
  92. package/dist/client/assets/{connection-CBjhUpxd.js → connection-BRxYxuTC.js} +1 -1
  93. package/dist/client/assets/connection-card-Ci11hXdb.js +1 -0
  94. package/dist/client/assets/connection-detail-kKzevQwe.js +1 -0
  95. package/dist/client/assets/{connection-form-helpers-D17hSbdj.js → connection-form-helpers-i8QSNtp9.js} +1 -1
  96. package/dist/client/assets/connections-Cp_0tyyS.js +1 -0
  97. package/dist/client/assets/constants-BSYv1IkQ.js +1 -0
  98. package/dist/client/assets/{decopilot-sse-pool-DhIa2UGY.js → decopilot-sse-pool-EOQd0pSV.js} +1 -1
  99. package/dist/client/assets/{dialog-CuUsVzDt.js → dialog-CUddXMws.js} +1 -1
  100. package/dist/client/assets/{domain-settings-BhrD4-Ja.js → domain-settings-DSZbN5QB.js} +1 -1
  101. package/dist/client/assets/{drawer-D6wxcILF.js → drawer-BcB0DFAa.js} +1 -1
  102. package/dist/client/assets/{dropdown-menu-D9LmgELp.js → dropdown-menu-Cl_WlUiZ.js} +1 -1
  103. package/dist/client/assets/{empty-state-C7JioFu-.js → empty-state-B0VbRil-.js} +1 -1
  104. package/dist/client/assets/extract-connection-data-BTIZZWlP.js +1 -0
  105. package/dist/client/assets/file-explorer-Dxzk_rzC.js +2 -0
  106. package/dist/client/assets/{file-type-icon-BeAAX0f0.js → file-type-icon-Rf-DryoU.js} +1 -1
  107. package/dist/client/assets/{form-CQdWkhHy.js → form-CtIyVVv8.js} +1 -1
  108. package/dist/client/assets/general-D-HZn8wX.js +1 -0
  109. package/dist/client/assets/github-repo-picker-B5d0kP8l.js +1 -0
  110. package/dist/client/assets/{hooks-CtJi7-Iu.js → hooks-DzWlqng8.js} +4 -4
  111. package/dist/client/assets/{index-C8pbhIQV.js → index-BOk82xjA.js} +47 -47
  112. package/dist/client/assets/{index-DOXD9far.js → index-C078jJt7.js} +1 -1
  113. package/dist/client/assets/{index-Bitc_mRD.js → index-CKlfVZSx.js} +1 -1
  114. package/dist/client/assets/{index-BpUEa-_f.js → index-Caktz4oP.js} +1 -1
  115. package/dist/client/assets/{index-CXYVh_8g.js → index-Co5tGszi.js} +1 -1
  116. package/dist/client/assets/{index-CY7f8Bv8.js → index-DTv7lgCo.js} +2 -2
  117. package/dist/client/assets/{index-DYFCBh-Y.js → index-ddv9i9lI.js} +2 -2
  118. package/dist/client/assets/index-k_kJnkwP.js +1 -0
  119. package/dist/client/assets/index-lC6pjayR.js +1 -0
  120. package/dist/client/assets/{index-redirect-CagmL07b.js → index-redirect-wQy0Hhuv.js} +1 -1
  121. package/dist/client/assets/{index-Dv2HGcxw.js → index-uQCocWZL.js} +36 -36
  122. package/dist/client/assets/{infra-billing-w7CTNedv.js → infra-billing-JVEvwLGM.js} +1 -1
  123. package/dist/client/assets/{input-C-c0WXJW.js → input-DvRVVykP.js} +1 -1
  124. package/dist/client/assets/{integration-icon-BWmzj0fc.js → integration-icon-Cc6SFROH.js} +1 -1
  125. package/dist/client/assets/{invite-member-dialog-BC7o23oS.js → invite-member-dialog-CfBcffWE.js} +1 -1
  126. package/dist/client/assets/{label-BHVzIj_T.js → label-t3jAO6fk.js} +1 -1
  127. package/dist/client/assets/{layout-DjwlwbTT.js → layout-CTiIolbS.js} +1 -1
  128. package/dist/client/assets/{login-BcWilRRB.js → login-B-WgG2Ki.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-B_DNJ2SA.js → mcp-oauth-DMk04CrH.js} +1 -1
  130. package/dist/client/assets/{members-DNtgywtV.js → members-b4K3yz0i.js} +1 -1
  131. package/dist/client/assets/{monaco-editor-1T0s-top.js → monaco-editor-WF0Loj_a.js} +1 -1
  132. package/dist/client/assets/{monitoring-stats-row-DQDRsQ7r.js → monitoring-stats-row-Bb9ANvE6.js} +1 -1
  133. package/dist/client/assets/{multi-select-D5wJGeYW.js → multi-select-D8tTzGQX.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-DrwUNlO_.js → oauth-callback-B3h03kRN.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-0-5AaC-B.js → oauth-callback-ai-provider-CPeYnFJ2.js} +1 -1
  136. package/dist/client/assets/{onboarding-nW2GnWmD.js → onboarding-DWYwLwyp.js} +1 -1
  137. package/dist/client/assets/{org-layout-DpBPecSC.js → org-layout-5mhBAs8d.js} +1 -1
  138. package/dist/client/assets/{organization-choice-C3gRJggl.js → organization-choice-BW1uICxh.js} +1 -1
  139. package/dist/client/assets/{orgs-NfO9T_CP.js → orgs-DWM9OVEG.js} +1 -1
  140. package/dist/client/assets/{page-seo-form-DuVKmS0Z.js → page-seo-form-hWQir_qF.js} +1 -1
  141. package/dist/client/assets/{popover-D2fxQ4aM.js → popover-D9SzEUAI.js} +1 -1
  142. package/dist/client/assets/post-editor-B1jt5piB.js +1 -0
  143. package/dist/client/assets/{primitives-Ba7nY9OD.js → primitives-5Daf1hsL.js} +1 -1
  144. package/dist/client/assets/{profile-diYtZoe-.js → profile-BEw5J4Ed.js} +1 -1
  145. package/dist/client/assets/project-app-view-BgshwzkK.js +1 -0
  146. package/dist/client/assets/record-editor-bfNMBksJ.js +1 -0
  147. package/dist/client/assets/redirect-editor-DAXuBjCt.js +1 -0
  148. package/dist/client/assets/registry-CWEefNbS.js +2 -0
  149. package/dist/client/assets/{registry-layout-BreSpP9U.js → registry-layout-DW_P9Ln9.js} +2 -2
  150. package/dist/client/assets/{reports-CL-nrM8o.js → reports-BX1ZPGQv.js} +1 -1
  151. package/dist/client/assets/{require-capability-C9zXo2RN.js → require-capability-B5WcgPkb.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-CyVspimn.js → required-auth-layout-BY5wwpxM.js} +1 -1
  153. package/dist/client/assets/{reset-password-Ciqvt8bq.js → reset-password-Cu9RkWOx.js} +1 -1
  154. package/dist/client/assets/roles-DdAgNbXt.js +1 -0
  155. package/dist/client/assets/{search-input-Bk76gJwg.js → search-input-2myyBQJH.js} +1 -1
  156. package/dist/client/assets/{secrets-Ctkpphji.js → secrets-yj9KObbQ.js} +1 -1
  157. package/dist/client/assets/{sections-editor-COxBFL4H.js → sections-editor-BKi_uR8x.js} +2 -2
  158. package/dist/client/assets/{select-B5F1anu3.js → select-OJZr6vSG.js} +1 -1
  159. package/dist/client/assets/select-model-ClzjreR2.js +4 -0
  160. package/dist/client/assets/self-tool-result-C8lmUdZz.js +1 -0
  161. package/dist/client/assets/seo-editor-BgaWstEM.js +1 -0
  162. package/dist/client/assets/settings-layout-DKhT-OPL.js +1 -0
  163. package/dist/client/assets/{settings-section-7uUtbgS5.js → settings-section-DpqYSh8s.js} +1 -1
  164. package/dist/client/assets/{settings-subnav-B4HLGfQa.js → settings-subnav-CAGpDsPx.js} +1 -1
  165. package/dist/client/assets/{shell-controls-DFLjw3u1.js → shell-controls-WOyFIQ8J.js} +1 -1
  166. package/dist/client/assets/shell-layout-DMHFUN_c.js +1 -0
  167. package/dist/client/assets/{sidebar-BQOlbGpf.js → sidebar-CXlXuSbt.js} +1 -1
  168. package/dist/client/assets/{skeleton-D8_p_M42.js → skeleton-C68eOfvF.js} +1 -1
  169. package/dist/client/assets/{spinner-CwZIEzOg.js → spinner-B1-xmV_I.js} +1 -1
  170. package/dist/client/assets/{sso-ClhobbqM.js → sso-DmaJ6cqp.js} +1 -1
  171. package/dist/client/assets/store-1siQVear.js +1 -0
  172. package/dist/client/assets/store-registry-BJf_LxSr.js +2 -0
  173. package/dist/client/assets/{studio-tools-BU92X_bQ.js → studio-tools-B3t6s0zR.js} +1 -1
  174. package/dist/client/assets/{switch-DcC_t9CV.js → switch-CrP5QdDx.js} +1 -1
  175. package/dist/client/assets/synced-repos-C8804g9L.js +1 -0
  176. package/dist/client/assets/{tab-id-Bts31N4F.js → tab-id-iAugKsz1.js} +1 -1
  177. package/dist/client/assets/{table-DRxtzc3s.js → table-DCrvS-Zy.js} +1 -1
  178. package/dist/client/assets/{tabs-KjyE2jv_.js → tabs-DSft3sBE.js} +1 -1
  179. package/dist/client/assets/tasks-zyE31tuj.js +1 -0
  180. package/dist/client/assets/{textarea--Ewi1Crs.js → textarea-Q0iKDtgN.js} +1 -1
  181. package/dist/client/assets/{toggle-group-BuXeWc0T.js → toggle-group-BS4Llp8W.js} +1 -1
  182. package/dist/client/assets/{toolbar-BcWr2ddr.js → toolbar-Bb2wBW2e.js} +1 -1
  183. package/dist/client/assets/{tooltip-CJN68N1y.js → tooltip-D-nRolEQ.js} +1 -1
  184. package/dist/client/assets/{track-Bun3UmLP.js → track-Cjakqv5z.js} +1 -1
  185. package/dist/client/assets/{types-B7nxkECW.js → types-DrJIJi5z.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-Bu53xPL2.js → use-ai-providers-HmIPTTa0.js} +1 -1
  187. package/dist/client/assets/use-api-keys-C_zfXBfP.js +1 -0
  188. package/dist/client/assets/use-automations-Cu5sfrAv.js +1 -0
  189. package/dist/client/assets/{use-autosave-C2lJi7va.js → use-autosave-HncAg-jy.js} +1 -1
  190. package/dist/client/assets/{use-capability-FDQURGCo.js → use-capability-DEVOnZYS.js} +1 -1
  191. package/dist/client/assets/{use-clock-tick-MIlDJATL.js → use-clock-tick-DTySxQNj.js} +1 -1
  192. package/dist/client/assets/use-commerce-diagnostic-CEFksBO5.js +1 -0
  193. package/dist/client/assets/use-connection-DlZgI-7a.js +1 -0
  194. package/dist/client/assets/{use-copy-DBVetzom.js → use-copy-DnyBaCfS.js} +1 -1
  195. package/dist/client/assets/{use-create-virtual-mcp-BOJcJ8uy.js → use-create-virtual-mcp-D3NnyWaT.js} +1 -1
  196. package/dist/client/assets/{use-debounced-autosave-r8HvWOvO.js → use-debounced-autosave-xO3JxRox.js} +1 -1
  197. package/dist/client/assets/{use-debounced-value-DkWfrQRX.js → use-debounced-value-BvA07otq.js} +1 -1
  198. package/dist/client/assets/{use-decopilot-events-DVJCI5Zv.js → use-decopilot-events-CD87sgDf.js} +1 -1
  199. package/dist/client/assets/{use-delete-connection-fsM7u7QD.js → use-delete-connection-CHs3u4q4.js} +1 -1
  200. package/dist/client/assets/{use-deployment-admin-B-HQ5c5M.js → use-deployment-admin-DtqEEvgG.js} +1 -1
  201. package/dist/client/assets/{use-file-configs-CfXxj7VL.js → use-file-configs-29jMHdLc.js} +1 -1
  202. package/dist/client/assets/{use-infinite-scroll-Bo2fv5Lo.js → use-infinite-scroll-H6_NvOy-.js} +1 -1
  203. package/dist/client/assets/{use-join-requests-BEvTrllb.js → use-join-requests-CCnaynM4.js} +1 -1
  204. package/dist/client/assets/use-mcp-client-D9Yqqzns.js +10 -0
  205. package/dist/client/assets/{use-mcp-tools-ClqWZ9IS.js → use-mcp-tools-CeRZpjhU.js} +1 -1
  206. package/dist/client/assets/{use-members-BIeTzXcT.js → use-members-SIHeIOrM.js} +1 -1
  207. package/dist/client/assets/{use-mobile-D1Z5Fq_m.js → use-mobile-Br11M3GY.js} +1 -1
  208. package/dist/client/assets/{use-navigate-to-agent-CJufJ1El.js → use-navigate-to-agent-Dw8z3Zn7.js} +1 -1
  209. package/dist/client/assets/{use-org-auth-client-CLqlK2fa.js → use-org-auth-client-5nZlOt-O.js} +1 -1
  210. package/dist/client/assets/{use-org-repo-syncs-BS3BBOX9.js → use-org-repo-syncs-BbDlsKiF.js} +1 -1
  211. package/dist/client/assets/{use-org-sso-BFVqnWVv.js → use-org-sso-CiS2XQGs.js} +1 -1
  212. package/dist/client/assets/{use-organization-roles-DUwgTl0Y.js → use-organization-roles-BUk2rFrK.js} +1 -1
  213. package/dist/client/assets/use-organization-settings-BwZlefEm.js +1 -0
  214. package/dist/client/assets/use-registry-connections-BUzoHyWJ.js +1 -0
  215. package/dist/client/assets/{use-secrets-CAJvSisp.js → use-secrets-CeYNMzAN.js} +1 -1
  216. package/dist/client/assets/{use-section-preview-base-f9LLYg8L.js → use-section-preview-base-tMS-jmYW.js} +1 -1
  217. package/dist/client/assets/use-settings-tabs-C_3ZxNZB.js +1 -0
  218. package/dist/client/assets/{use-status-sounds-C6D-4XkZ.js → use-status-sounds-CM9nmbXO.js} +1 -1
  219. package/dist/client/assets/{use-tags-CL0MTVx7.js → use-tags-DVDRWg9r.js} +1 -1
  220. package/dist/client/assets/{use-view-mode-D_FhC11M.js → use-view-mode-Cv6mqcNW.js} +1 -1
  221. package/dist/client/assets/use-virtual-mcp-DKWMT_yg.js +1 -0
  222. package/dist/client/assets/useInfiniteQuery-Uzpw22ew.js +1 -0
  223. package/dist/client/assets/{useRouterState-CYX6XYwE.js → useRouterState-BMcC8Fm_.js} +1 -1
  224. package/dist/client/assets/useSuspenseInfiniteQuery-CM7HWNDV.js +1 -0
  225. package/dist/client/assets/{users-j5szvyxO.js → users-CK8jHr9c.js} +1 -1
  226. package/dist/client/assets/variant-calendar-CNPwpOcz.js +1 -0
  227. package/dist/client/assets/{view-mode-toggle-COMDMelY.js → view-mode-toggle-B9YLzYuj.js} +1 -1
  228. package/dist/client/index.html +1 -1
  229. package/dist/server/cli.js +1 -1
  230. package/dist/server/server.js +1 -1
  231. package/package.json +1 -1
  232. package/dist/client/assets/agent-icon-COsOwoOJ.js +0 -1
  233. package/dist/client/assets/agents-list-CzmRe-J9.js +0 -1
  234. package/dist/client/assets/ai-providers-CtiFp3K_.js +0 -1
  235. package/dist/client/assets/api-keys-DknCKtBM.js +0 -1
  236. package/dist/client/assets/app-editor-DQ_YL7wb.js +0 -1
  237. package/dist/client/assets/automations-BlHhpH1A.js +0 -1
  238. package/dist/client/assets/billing-CIJw_70J.js +0 -6
  239. package/dist/client/assets/bulk-category-panel-BnOFxFkb.js +0 -1
  240. package/dist/client/assets/category-editor-DZpADMTh.js +0 -1
  241. package/dist/client/assets/choose-editor-B3qTf65p.js +0 -1
  242. package/dist/client/assets/collection-detail-DAIDbsJW.js +0 -1
  243. package/dist/client/assets/commerce-onboarding-DxWzg6K0.js +0 -1
  244. package/dist/client/assets/connection-card-D5dqvI6-.js +0 -1
  245. package/dist/client/assets/connection-detail-ZiF5695B.js +0 -1
  246. package/dist/client/assets/connections-Y0DgFU1S.js +0 -1
  247. package/dist/client/assets/extract-connection-data-CXurXLo6.js +0 -1
  248. package/dist/client/assets/file-explorer-BB8i3DpS.js +0 -2
  249. package/dist/client/assets/general-7WNqkE7h.js +0 -1
  250. package/dist/client/assets/github-repo-picker-CEi3AOGZ.js +0 -1
  251. package/dist/client/assets/index-12FCr6IV.js +0 -1
  252. package/dist/client/assets/index-CdO2TqX7.js +0 -1
  253. package/dist/client/assets/post-editor-wZXruh1E.js +0 -1
  254. package/dist/client/assets/project-app-view-CT7Xo7gO.js +0 -1
  255. package/dist/client/assets/record-editor-Cgg1BQkG.js +0 -1
  256. package/dist/client/assets/redirect-editor-BFv26eBk.js +0 -1
  257. package/dist/client/assets/registry-DLxGpjN0.js +0 -2
  258. package/dist/client/assets/roles-CZCVqaoP.js +0 -1
  259. package/dist/client/assets/select-model-D94buTab.js +0 -4
  260. package/dist/client/assets/self-tool-result-DEN4xy0U.js +0 -1
  261. package/dist/client/assets/seo-editor-DzEDLsXC.js +0 -1
  262. package/dist/client/assets/settings-layout-DAyGVN_Q.js +0 -1
  263. package/dist/client/assets/shell-layout-Bo1uN5qy.js +0 -1
  264. package/dist/client/assets/store-Bjb_Aepg.js +0 -1
  265. package/dist/client/assets/store-registry-CPxYfgQZ.js +0 -2
  266. package/dist/client/assets/synced-repos-CpJj9wxS.js +0 -1
  267. package/dist/client/assets/tasks-C_88rBC3.js +0 -1
  268. package/dist/client/assets/use-api-keys-CxkEL-W4.js +0 -1
  269. package/dist/client/assets/use-automations-BETZ5ofv.js +0 -1
  270. package/dist/client/assets/use-commerce-diagnostic-WoLJcqcL.js +0 -1
  271. package/dist/client/assets/use-connection-B_jbS9d6.js +0 -1
  272. package/dist/client/assets/use-mcp-client-DNpW7GvY.js +0 -10
  273. package/dist/client/assets/use-open-billing-url-x5MwJLNs.js +0 -1
  274. package/dist/client/assets/use-organization-settings-BTMxiQQU.js +0 -1
  275. package/dist/client/assets/use-registry-connections-BatSLLB9.js +0 -1
  276. package/dist/client/assets/use-settings-tabs-BA2LamO_.js +0 -1
  277. package/dist/client/assets/use-virtual-mcp-BxWRr22y.js +0 -1
  278. package/dist/client/assets/useInfiniteQuery-CG0QiE5o.js +0 -1
  279. package/dist/client/assets/useSuspenseInfiniteQuery-Cs0VsmKb.js +0 -1
  280. package/dist/client/assets/variant-calendar-BWLEpQGO.js +0 -1
@@ -0,0 +1,10 @@
1
+ import{dd as le,de as ue,df as de,cf as he,dg as fe,bU as _,bV as g,dh as pe,di as me,dj as _e,dk as M,dl as we,dm as D,dn as ge,dp as q,dq as Te,dr as L,ds as ye,dt as ve,du as ke,dv as J,by as Se,bA as Ce,bv as be,ca as te,cm as Re,cs as Ie,cq as Ee,cE as qe,dw as Pe,dx as $e,dy as A,dz as Me,dA as Ae,cr as He,cn as Oe,co as Ue,cp as xe,bw as Ne,dB as je,dC as Fe,dD as De,ch as Le,dE as Ve,dF as ze,cA as U,dG as Qe,bu as N,c as se,x as re,K as z}from"./index-uQCocWZL.js";import{S as Je}from"./constants-BSYv1IkQ.js";import{U as P,a as H,e as W}from"./auth-DclLBUby.js";function x(a){return!!a._zod}function b(a,e){return x(a)?le(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function We(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function K(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=We(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(me,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||we(o)?this._onresponse(o):D(o)?this._onrequest(o,n):ge(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Te(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Ke,v=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const k=this._responseHandlers.get(f);k?k(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=K(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=G(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=K(e);this._notificationHandlers.set(s,r=>{const o=G(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=J.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=J.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function B(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Be(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];B(n)&&B(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Ce();const Ye=Se(Ze);function Xe(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class et{constructor(e){this._ajv=e??Xe()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class tt{constructor(e){this._client=e}async*callToolStream(e,t=te,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function ot(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let at=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new et,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new tt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Be(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(Fe,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=ot(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(De,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const v=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&v.action==="accept"&&v.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Le,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${v}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const v=b(L,f);if(!v.success){const h=v.error instanceof Error?v.error.message:String(v.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return v.data}const T=d.tools||d.toolChoice?Ve:ze,y=b(T,f);if(!y.success){const v=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${v}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){st(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&rt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Me,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},He,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Oe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ue,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=te,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=je.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function nt(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function it(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Z extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Y=10,ct=13,I=32;function F(a){}function lt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const k=f(h);k!==""&&o.push(k);return}if(h.indexOf(`
2
+ `)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const w=f(c);w!==""&&o.push(w)}function f(h){let c=0;if(h.indexOf("\r")===-1){let w=h.indexOf(`
3
+ `,c);for(;w!==-1;){if(c===w){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=w+1,w=h.indexOf(`
4
+ `,c);continue}const k=h.charCodeAt(c);if(X(h,c,k)){const S=h.charCodeAt(c+5)===I?c+6:c+5,C=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===Y){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
5
+ `,c);continue}u=p===0?C:`${u}
6
+ ${C}`,p++}else ee(h,c,k)?l=h.slice(h.charCodeAt(c+6)===I?c+7:c+6,w)||void 0:m(h,c,w);c=w+1,w=h.indexOf(`
7
+ `,c)}return h.slice(c)}for(;c<h.length;){const w=h.indexOf("\r",c),k=h.indexOf(`
8
+ `,c);let S=-1;if(w!==-1&&k!==-1?S=w<k?w:k:w!==-1?w===h.length-1?S=-1:S=w:k!==-1&&(S=k),S===-1)break;m(h,c,S),c=S+1,h.charCodeAt(c-1)===ct&&h.charCodeAt(c)===Y&&c++}return h.slice(c)}function m(h,c,w){if(c===w){y();return}const k=h.charCodeAt(c);if(X(h,c,k)){const E=h.charCodeAt(c+5)===I?c+6:c+5,Q=h.slice(E,w);u=p===0?Q:`${u}
9
+ ${Q}`,p++;return}if(ee(h,c,k)){l=h.slice(h.charCodeAt(c+6)===I?c+7:c+6,w)||void 0;return}if(k===105&&h.charCodeAt(c+1)===100&&h.charCodeAt(c+2)===58){const E=h.slice(h.charCodeAt(c+3)===I?c+4:c+3,w);i=E.includes("\0")?void 0:E;return}if(k===58){if(r){const E=h.slice(c,w);r(E.slice(h.charCodeAt(c+1)===I?2:1))}return}const S=h.slice(c,w),C=S.indexOf(":");if(C===-1){T(S,"",S);return}const ne=S.slice(0,C),ie=S.charCodeAt(C+1)===I?2:1,ce=S.slice(C+ie);T(ne,ce,S)}function T(h,c,w){switch(h){case"event":l=c||void 0;break;case"data":u=p===0?c:`${u}
10
+ ${c}`,p++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new Z(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:w}));break;default:t(new Z(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:c,line:w}));break}}function y(){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0}function v(h={}){if(h.consume&&o.length>0){const c=o.join("");m(c,0,c.length)}n=!0,i=void 0,u="",p=0,l=void 0,o.length=0}return{feed:d,reset:v}}function X(a,e,t){return t===100&&a.charCodeAt(e+1)===97&&a.charCodeAt(e+2)===116&&a.charCodeAt(e+3)===97&&a.charCodeAt(e+4)===58}function ee(a,e,t){return t===101&&a.charCodeAt(e+1)===118&&a.charCodeAt(e+2)===101&&a.charCodeAt(e+3)===110&&a.charCodeAt(e+4)===116&&a.charCodeAt(e+5)===58}class ut extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(o){r=lt({onEvent:n=>{o.enqueue(n)},onError(n){e==="terminate"?o.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(o){r.feed(o)}})}}const dt={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let ht=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=it(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??dt}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new P;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=V(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new $(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new ut({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){const{value:m,done:T}=await l.read();if(T)break;if(m.id&&(n=m.id,i=!0,r?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{const y=N.parse(JSON.parse(m.data));M(y)&&(u=!0,o!==void 0&&(y.id=o)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new P("No auth provider");if(await H(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:D(e)?e.id:void 0}).catch(f=>this.onerror?.(f));return}const o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const f=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:m,scope:T}=W(i);if(this._resourceMetadataUrl=m,this._scope=T,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:m,scope:T,error:y}=W(i);if(y==="insufficient_scope"){const v=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===v)throw new $(403,"Server returned 403 after trying upscoping");if(T&&(this._scope=T),m&&(this._resourceMetadataUrl=m),this._lastUpscopingHeader=v??void 0,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new P;return this.send(e)}}throw new $(i.status,`Error POSTing to endpoint: ${f}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),Qe(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(f=>this.onerror?.(f));return}const l=(Array.isArray(e)?e:[e]).filter(f=>"method"in f&&"id"in f&&f.id!==void 0).length>0,d=i.headers.get("content-type");if(l)if(d?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(d?.includes("application/json")){const f=await i.json(),m=Array.isArray(f)?f.map(T=>N.parse(T)):[N.parse(f)];for(const T of m)this.onmessage?.(T)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${d}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new $(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class ft extends ht{constructor(e,t){super(e,t)}send(e,t){const s=pt(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function pt(a){const e=a;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"studio-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const mt={name:"studio-sdk",version:"1.0.0"};function _t(a,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either studioUrl or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,o=a?`${r}/mcp/${a}`:`${r}/mcp`;return new URL(o,s).href}async function ae({connectionId:a,orgId:e,orgSlug:t,token:s,studioUrl:r,meshUrl:o,mcpUrl:n}){const i=U({studioUrl:r,meshUrl:o}),u=z.mcpClient(e,a??"self",s??"",n??i??"");if(!n&&(!a||a===Je))return nt({orgSlug:t,token:s,studioUrl:i,toJSONString:`mcp-client:${u.join(":")}`});const p=n??_t(a,t,i),l=new at(mt,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),d=new ft(new URL(p),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await l.connect(d),l.toJSON=()=>`mcp-client:${u.join(":")}`,l}function wt(a){const{connectionId:e,token:t,studioUrl:s,meshUrl:r,mcpUrl:o,orgId:n}=a,i=U({studioUrl:s,meshUrl:r});return{queryKey:z.mcpClient(n,e??"self",t??"",o??i??""),queryFn:()=>ae(a),staleTime:1/0,gcTime:6e4}}function St(a){const e=se.c(2);let t;e[0]!==a?(t=wt(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=re(t);return s}function Ct(a){const e=se.c(19),{connectionId:t,orgId:s,orgSlug:r,token:o,studioUrl:n,meshUrl:i,mcpUrl:u}=a;let p;e[0]!==i||e[1]!==n?(p=U({studioUrl:n,meshUrl:i}),e[0]=i,e[1]=n,e[2]=p):p=e[2];const l=p;let d;e[3]!==t||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==o?(d=t!==void 0?z.mcpClient(s,t??"self",o??"",u??l??""):["mcp","client","skip",s],e[3]=t,e[4]=u,e[5]=s,e[6]=l,e[7]=o,e[8]=d):d=e[8];const f=d;let m;e[9]!==t||e[10]!==u||e[11]!==s||e[12]!==r||e[13]!==l||e[14]!==o?(m=async()=>t===void 0?null:ae({connectionId:t,orgId:s,orgSlug:r,token:o,studioUrl:l,mcpUrl:u}),e[9]=t,e[10]=u,e[11]=s,e[12]=r,e[13]=l,e[14]=o,e[15]=m):m=e[15];let T;e[16]!==f||e[17]!==m?(T={queryKey:f,queryFn:m,staleTime:1/0,gcTime:6e4},e[16]=f,e[17]=m,e[18]=T):T=e[18];const{data:y}=re(T);return y??null}export{Ye as A,at as C,Ge as P,ht as S,Ct as a,lt as b,ae as c,it as d,wt as m,V as n,St as u};
@@ -1 +1 @@
1
- import{c as m,n as p,x as q,K as T}from"./index-Dv2HGcxw.js";function C(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],q(i)}function K(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],p(i)}function O(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
1
+ import{c as m,n as p,x as q,K as T}from"./index-uQCocWZL.js";function C(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],q(i)}function K(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],p(i)}function O(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
@@ -1 +1 @@
1
- import{c,F as m,x as b,n as M,K as f}from"./index-Dv2HGcxw.js";import{u as y}from"./use-org-auth-client-CLqlK2fa.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
1
+ import{c,F as m,x as b,n as M,K as f}from"./index-uQCocWZL.js";import{u as y}from"./use-org-auth-client-5nZlOt-O.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{c as m,r}from"./index-Dv2HGcxw.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-uQCocWZL.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{G as y,r as c,c as b,j as A,d as C,F as E,a as $}from"./index-Dv2HGcxw.js";import{u as _}from"./use-virtual-mcp-BxWRr22y.js";import{b as G}from"./hooks-CtJi7-Iu.js";import{f as P}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function w(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(w(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=A.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??J}function J(){}const v=[],L=()=>()=>{};function B(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=C(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=B(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=G();let u;e[2]!==n?.threads.get?(u=n?.threads.get??H,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??F,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??L,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const R=P(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function F(){return v}function H(){return v}export{Q as S,D as a,K as b,X as c,B as g,W as u};
1
+ import{G as y,r as c,c as b,j as A,d as C,F as E,a as $}from"./index-uQCocWZL.js";import{u as _}from"./use-virtual-mcp-DKWMT_yg.js";import{b as G}from"./hooks-DzWlqng8.js";import{f as P}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function w(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(w(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=A.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??J}function J(){}const v=[],L=()=>()=>{};function B(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=C(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=B(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=G();let u;e[2]!==n?.threads.get?(u=n?.threads.get??H,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??F,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??L,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const R=P(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function F(){return v}function H(){return v}export{Q as S,D as a,K as b,X as c,B as g,W as u};
@@ -1 +1 @@
1
- import{c as x,F as j,a as i}from"./index-Dv2HGcxw.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,F as j,a as i}from"./index-uQCocWZL.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
@@ -1 +1 @@
1
- import{c as a,F as f,K as y,n as _,o as d,e as R}from"./index-Dv2HGcxw.js";import{u as S}from"./studio-tools-BU92X_bQ.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=a.c(7),{org:n}=f(),t=S();let i;e[0]!==n.id?(i=y.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function q(){const e=a.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function F(){const e=a.c(12),{org:n}=f(),t=S(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:y.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=e[4];let r;e[5]!==o||e[6]!==t?(r=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=r):r=e[7];let l;return e[8]!==o||e[9]!==c||e[10]!==r?(l={mutationFn:c,onSuccess:r,onSettled:o},e[8]=o,e[9]=c,e[10]=r,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=a.c(8),{org:n}=f(),t=S(),i=d();let s;e[0]!==t?(s=r=>t.call("ORG_REPO_SYNC_DELETE",{id:r}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==i?(o=()=>i.invalidateQueries({queryKey:y.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{q as a,F as b,T as c,g as u};
1
+ import{c as a,F as f,K as y,n as _,o as d,e as R}from"./index-uQCocWZL.js";import{u as S}from"./studio-tools-B3t6s0zR.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=a.c(7),{org:n}=f(),t=S();let i;e[0]!==n.id?(i=y.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function q(){const e=a.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function F(){const e=a.c(12),{org:n}=f(),t=S(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:y.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=e[4];let r;e[5]!==o||e[6]!==t?(r=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=r):r=e[7];let l;return e[8]!==o||e[9]!==c||e[10]!==r?(l={mutationFn:c,onSuccess:r,onSettled:o},e[8]=o,e[9]=c,e[10]=r,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=a.c(8),{org:n}=f(),t=S(),i=d();let s;e[0]!==t?(s=r=>t.call("ORG_REPO_SYNC_DELETE",{id:r}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==i?(o=()=>i.invalidateQueries({queryKey:y.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{q as a,F as b,T as c,g as u};
@@ -1 +1 @@
1
- import{c as u,n as S,o as r,e as y,K as c}from"./index-Dv2HGcxw.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
1
+ import{c as u,n as S,o as r,e as y,K as c}from"./index-uQCocWZL.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-CLqlK2fa.js";import{F as b,n as P,K as y}from"./index-Dv2HGcxw.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-5nZlOt-O.js";import{F as b,n as P,K as y}from"./index-uQCocWZL.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -0,0 +1 @@
1
+ import{X as c,Z as r,Y as I,a1 as k,a2 as d,_ as E,b8 as C,c as u,F as A,n as O,K as y,o as x,e as Q,r as $}from"./index-uQCocWZL.js";import{W as q}from"./constants-BSYv1IkQ.js";import{c as G,u as U}from"./studio-tools-B3t6s0zR.js";c({title:r(),url:r(),icon:r()});c({registries:k(r(),c({enabled:d()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:I(r()).describe("List of MCP app_name or app_id values to hide from the store.")});const g=c({keyId:r(),modelId:r(),title:r().optional()}).nullable();E(["fast","smart","thinking","image","web_search","deep_research"]);E(["fast","smart","thinking"]);const ae=c({tiers:c({fast:g,smart:g,thinking:g,image:g,web_search:g,deep_research:g})});c({tiers:c({fast:g.optional(),smart:g.optional(),thinking:g.optional()})});c({ids:I(r()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});c({demo_mode:d().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:d().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),nav_v2:d().optional().describe("First-class navigation: the sidebar lists destinations (Reports, Library, Tasks) instead of chat threads, and the thread list moves into a menu at the top of the chat panel. Always on for reports_only orgs."),qa_agent_enabled:d().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:d().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:d().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),cheap_reviewer_model:d().optional().describe("Run the QA Agent and Code Reviewer on a cheaper model than the Super Agent. A review reads a diff and reaches a verdict; it does not need the model that wrote the code. Off by default — turning it on trades some review depth for cost."),auto_assign_report_tasks_to_super_agent:d().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});const M=new Set(["qa_agent_enabled","code_reviewer_enabled"]);function L(e,t){const n=e?.[t];return M.has(t)?n!==!1:n===!0}c({id:r().describe("Brand context ID"),name:r().describe("Company name"),domain:r().describe("Company domain (e.g. example.com)"),overview:r().describe("Company overview / description"),logo:r().nullable().optional().describe("Logo URL"),favicon:r().nullable().optional().describe("Favicon URL"),ogImage:r().nullable().optional().describe("OG image URL"),fonts:c({heading:r().optional().describe("Font family for headings"),body:r().optional().describe("Font family for body text"),code:r().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:c({primary:r().optional().describe("Primary brand color (hex)"),secondary:r().optional().describe("Secondary brand color (hex)"),accent:r().optional().describe("Accent / highlight color (hex)"),background:r().optional().describe("Background color (hex)"),foreground:r().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:I(k(r(),C())).nullable().optional().describe("Brand images"),metadata:k(r(),C()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:r().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:d().optional().describe("Whether this is the default brand for the organization")});const D={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},F={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(e,t){return{queryKey:y.organizationSettings(t),queryFn:async()=>{try{return await G(e,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...D,organizationId:t}}},staleTime:6e4}}function f(e){const t=u.c(6),{org:n}=A();let a;t[0]!==n.id||t[1]!==n.slug?(a=N(n.slug,n.id),t[0]=n.id,t[1]=n.slug,t[2]=a):a=t[2];const o=e;let s;return t[3]!==a||t[4]!==o?(s={...a,select:o},t[3]=a,t[4]=o,t[5]=s):s=t[5],O(s)}function oe(e,t){const n=u.c(3);let a;n[0]!==e||n[1]!==t?(a=N(t,e),n[0]=e,n[1]=t,n[2]=a):a=n[2];const{data:o}=O(a);return o??null}function p(){const e=u.c(9),{org:t}=A(),n=U(),a=x();let o;e[0]!==t||e[1]!==n?(o=async l=>{const m=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t.id,...l});if(!m)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return m},e[0]=t,e[1]=n,e[2]=o):o=e[2];let s;e[3]!==t||e[4]!==a?(s=l=>{a.setQueryData(y.organizationSettings(t.id),m=>({...m??D,...l}))},e[3]=t,e[4]=a,e[5]=s):s=e[5];let i;return e[6]!==o||e[7]!==s?(i={mutationFn:o,onSuccess:s},e[6]=o,e[7]=s,e[8]=i):i=e[8],Q(i)}function K(e){return e?.tiers?{tiers:{fast:e.tiers.fast??null,smart:e.tiers.smart??null,thinking:e.tiers.thinking??null,image:e.tiers.image??null,web_search:e.tiers.web_search??null,deep_research:e.tiers.deep_research??null}}:F}function se(){const{data:e}=f(W);return e??F}function W(e){return K(e.simple_mode)}function ie(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({simple_mode:s},i),a=(s,i)=>t.mutateAsync({simple_mode:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function re(){return j("reports_only")}function le(){const{data:e}=f(Y);return e??!1}function Y(e){return e.flags?.nav_v2??e.flags?.reports_only??!1}function j(e){const t=u.c(5);let n;t[0]!==e?(n=s=>L(s.flags,e),t[0]=e,t[1]=n):n=t[1];const{data:a}=f(n);let o;return t[2]!==a||t[3]!==e?(o=a??M.has(e),t[2]=a,t[3]=e,t[4]=o):o=t[4],o}function ce(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i,l)=>t.mutate({flags:{[s]:i}},l),a=(s,i,l)=>t.mutateAsync({flags:{[s]:i}},l),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function B(){const{data:e}=f(Z);return e??null}function Z(e){return e.registry_config}function ue(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({registry_config:s},i),a=(s,i)=>t.mutateAsync({registry_config:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function de(){const{data:e}=f(H);return e??null}function H(e){return e.default_home_agents}function V(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({default_home_agents:s},i),a=(s,i)=>t.mutateAsync({default_home_agents:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function me(){const e=u.c(14),{org:t}=A(),n=V(),a=x();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Promise.resolve(),e[0]=o):o=e[0];const s=$.useRef(o);let i;e[1]!==t.id?(i=y.organizationSettings(t.id),e[1]=t.id,e[2]=i):i=e[2];const l=i;let m;e[3]!==l||e[4]!==a?(m=()=>a.getQueryData(l)?.default_home_agents?.ids??[],e[3]=l,e[4]=a,e[5]=m):m=e[5];const v=m;let b;e[6]!==l||e[7]!==t.slug||e[8]!==a||e[9]!==n?(b=P=>{const R=s.current.then(async()=>{const T=a.getQueryData(l),w=P(T?.default_home_agents?.ids??[]);if(w!==null){a.setQueryData(l,h=>h&&{...h,default_home_agents:{ids:w}});try{await n.mutateAsync({ids:w}),await a.refetchQueries({queryKey:y.homeNextActions(t.slug),type:"active"})}catch(h){const z=h;throw a.setQueryData(l,T),z}}});return s.current=R.catch(X),R},e[6]=l,e[7]=t.slug,e[8]=a,e[9]=n,e[10]=b):b=e[10];const S=b;let _;return e[11]!==S||e[12]!==v?(_={currentIds:v,apply:S},e[11]=S,e[12]=v,e[13]=_):_=e[13],_}function X(){}function ge(){const e=u.c(3),{data:t,isPending:n}=f(J),a=t??null;let o;return e[0]!==n||e[1]!==a?(o={mainAgentId:a,isPending:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function J(e){return e.main_agent_id??null}function fe(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({main_agent_id:s},i),a=(s,i)=>t.mutateAsync({main_agent_id:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function he(){const e=u.c(5),{org:t}=A(),n=B();let a;e[0]!==t.id?(a=q.REGISTRY(t.id),e[0]=t.id,e[1]=a):a=e[1];const o=a;let s;return e[2]!==o||e[3]!==n?(s=i=>{if(!n)return i===o;const l=n.registries[i];return l?l.enabled:i===o},e[2]=o,e[3]=n,e[4]=s):s=e[4],s}export{ae as S,re as a,le as b,se as c,de as d,me as e,ge as f,he as g,oe as h,fe as i,ce as j,ie as k,B as l,ue as m,j as u};
@@ -0,0 +1 @@
1
+ import{c as C,F as R}from"./index-uQCocWZL.js";import{u as p}from"./use-connection-DlZgI-7a.js";import{W as a}from"./constants-BSYv1IkQ.js";import{l as y}from"./use-organization-settings-BwZlefEm.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
@@ -1 +1 @@
1
- import{c as r,F as a,K as c,x as y,o as d,e as S}from"./index-Dv2HGcxw.js";import{u as l}from"./studio-tools-BU92X_bQ.js";function C(){const e=r.c(7),{org:i}=a(),u=l();let o;e[0]!==i.id?(o=c.secrets(i.id),e[0]=i.id,e[1]=o):o=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==o||e[5]!==t?(s={queryKey:o,staleTime:6e4,queryFn:t},e[4]=o,e[5]=t,e[6]=s):s=e[6];const{data:n}=y(s);return n.secrets}function p(){const e=r.c(8),{org:i}=a(),u=l(),o=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==o?(s=()=>{o.invalidateQueries({queryKey:c.secrets(i.id)})},e[2]=i,e[3]=o,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{p as a,C as u};
1
+ import{c as r,F as a,K as c,x as y,o as d,e as S}from"./index-uQCocWZL.js";import{u as l}from"./studio-tools-B3t6s0zR.js";function C(){const e=r.c(7),{org:i}=a(),u=l();let o;e[0]!==i.id?(o=c.secrets(i.id),e[0]=i.id,e[1]=o):o=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==o||e[5]!==t?(s={queryKey:o,staleTime:6e4,queryFn:t},e[4]=o,e[5]=t,e[6]=s):s=e[6];const{data:n}=y(s);return n.secrets}function p(){const e=r.c(8),{org:i}=a(),u=l(),o=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==o?(s=()=>{o.invalidateQueries({queryKey:c.secrets(i.id)})},e[2]=i,e[3]=o,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{p as a,C as u};
@@ -1 +1 @@
1
- import{c as D,b as X,r as w,j as s,m as J}from"./index-Dv2HGcxw.js";import{ah as _}from"./agent-icon-COsOwoOJ.js";import{i as Y}from"./SearchMd-CP_XNhKh.js";import{e as Z,d as ee,b as te,a as se}from"./dialog-CuUsVzDt.js";import{I as re}from"./input-C-c0WXJW.js";import{K as le,L as oe,M as ie,N as K,O as ne,P as ce,Q as ae}from"./index-C8pbhIQV.js";const fe=12,z=new Set,q=new Set;function de(){for(const r of q)r()}function ue(r){return z.has(r)?!0:z.size>=fe?!1:(z.add(r),!0)}function Q(r){z.delete(r)&&de()}function me(r){return q.add(r),()=>{q.delete(r)}}function ve(r,e){const t=w.useRef(!1),[c,o]=w.useState(!1),a=w.useRef(null),d=w.useRef(null),n=w.useRef(null),l=w.useRef(r);l.current=r;const[f]=w.useState(()=>{const i=()=>{n.current?.(),n.current=null},u=()=>t.current?!0:ue(e)?(t.current=!0,o(!0),i(),!0):!1;return v=>{if(d.current=v,a.current&&(a.current.disconnect(),a.current=null),i(),!v){t.current&&(Q(e),t.current=!1,o(!1));return}queueMicrotask(()=>{if(d.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!n.current&&(n.current=me(()=>{d.current===v&&u()}));return}i(),t.current&&(Q(e),t.current=!1,o(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),a.current=x})}});return{ref:f,iframeActive:c}}function pe(r){const e=D.c(8),{previewUrl:t,title:c,scrollRootRef:o,slotId:a}=r,{ref:d,iframeActive:n}=ve(o,a),[l,f]=w.useState(!1);let i;e[0]!==n||e[1]!==l||e[2]!==t||e[3]!==c?(i=n?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${c}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>f(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=n,e[1]=l,e[2]=t,e[3]=c,e[4]=i):i=e[4];let u;return e[5]!==d||e[6]!==i?(u=s.jsx("div",{ref:d,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:i}),e[5]=d,e[6]=i,e[7]=u):u=e[7],u}function xe(r){const e=D.c(26),{entry:t,previewUrl:c,scrollRootRef:o,onSelect:a}=r,d=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let n;e[0]!==d?(n=J("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",d),e[0]=d,e[1]=n):n=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==c||e[5]!==o?(l=s.jsx(pe,{previewUrl:c,title:t.title,scrollRootRef:o,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=c,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t.isSavedBlock?(f=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=f):f=e[8];let i;e[9]!==f?(i=s.jsx(_,{className:"h-4 w-4 shrink-0",style:f}),e[9]=f,e[10]=i):i=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==i||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[i,x]}),e[18]=i,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==a||e[22]!==n||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:a,className:n,children:[l,m]}),e[21]=a,e[22]=n,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=D.c(51),{open:t,onOpenChange:c,meta:o,decofile:a,previewBaseUrl:d,onSelect:n}=r,l=X(),[f,i]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&i(""));let m,h,S,b,j,N,y,R,g,P,C;if(e[0]!==a||e[1]!==o||e[2]!==c||e[3]!==n||e[4]!==t||e[5]!==d||e[6]!==f||e[7]!==l){const F=t&&o&&a?le(o,a):[],W=o?oe(o):"",G=a?ie(a):void 0,H=new Map;if(t&&W)for(const p of F)H.set(p.resolveType,K(d,W,p.previewBlock,G));const E=f.trim().toLowerCase(),V=E?F.filter(p=>p.title.toLowerCase().includes(E)||p.resolveType.toLowerCase().includes(E)||p.description?.toLowerCase().includes(E)):F;h=Z,P=t,C=c,m=ee,y="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=k):k=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>i(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let M;e[27]!==f||e[28]!==B?(M=s.jsxs("div",{className:"relative pt-2",children:[k,s.jsx(re,{value:f,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=f,e[28]=B,e[29]=M):M=e[29],e[30]!==A||e[31]!==M?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,M]}),e[30]=A,e[31]=M,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??K(d,W,p.previewBlock,G),onSelect:()=>n(p)},p.resolveType))}),e[0]=a,e[1]=o,e[2]=c,e[3]=n,e[4]=t,e[5]=d,e[6]=f,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=y,e[15]=R,e[16]=g,e[17]=P,e[18]=C}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],y=e[14],R=e[15],g=e[16],P=e[17],C=e[18];let T;e[33]!==S||e[34]!==b?(T=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=T):T=e[35];let I;e[36]!==T||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:T}),e[36]=T,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==y||e[43]!==R||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:y,className:R,children:[g,I]}),e[40]=m,e[41]=I,e[42]=y,e[43]=R,e[44]=g,e[45]=L):L=e[45];let O;return e[46]!==h||e[47]!==L||e[48]!==P||e[49]!==C?(O=s.jsx(h,{open:P,onOpenChange:C,children:L}),e[46]=h,e[47]=L,e[48]=P,e[49]=C,e[50]=O):O=e[50],O}function ye(r){const e=D.c(4),{previewServerUrl:t,active:c}=ce(r.virtualMcpId);let o;return e[0]!==c||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:c}),e[0]=c,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,ye as u};
1
+ import{c as D,b as X,r as w,j as s,m as J}from"./index-uQCocWZL.js";import{ae as _}from"./agent-icon-DbIRcFKb.js";import{i as Y}from"./SearchMd-DBwuG5f1.js";import{e as Z,d as ee,b as te,a as se}from"./dialog-CUddXMws.js";import{I as re}from"./input-DvRVVykP.js";import{K as le,L as oe,M as ie,N as K,O as ne,P as ce,Q as ae}from"./index-BOk82xjA.js";const fe=12,z=new Set,q=new Set;function de(){for(const r of q)r()}function ue(r){return z.has(r)?!0:z.size>=fe?!1:(z.add(r),!0)}function Q(r){z.delete(r)&&de()}function me(r){return q.add(r),()=>{q.delete(r)}}function ve(r,e){const t=w.useRef(!1),[c,o]=w.useState(!1),a=w.useRef(null),d=w.useRef(null),n=w.useRef(null),l=w.useRef(r);l.current=r;const[f]=w.useState(()=>{const i=()=>{n.current?.(),n.current=null},u=()=>t.current?!0:ue(e)?(t.current=!0,o(!0),i(),!0):!1;return v=>{if(d.current=v,a.current&&(a.current.disconnect(),a.current=null),i(),!v){t.current&&(Q(e),t.current=!1,o(!1));return}queueMicrotask(()=>{if(d.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!n.current&&(n.current=me(()=>{d.current===v&&u()}));return}i(),t.current&&(Q(e),t.current=!1,o(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),a.current=x})}});return{ref:f,iframeActive:c}}function pe(r){const e=D.c(8),{previewUrl:t,title:c,scrollRootRef:o,slotId:a}=r,{ref:d,iframeActive:n}=ve(o,a),[l,f]=w.useState(!1);let i;e[0]!==n||e[1]!==l||e[2]!==t||e[3]!==c?(i=n?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${c}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>f(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=n,e[1]=l,e[2]=t,e[3]=c,e[4]=i):i=e[4];let u;return e[5]!==d||e[6]!==i?(u=s.jsx("div",{ref:d,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:i}),e[5]=d,e[6]=i,e[7]=u):u=e[7],u}function xe(r){const e=D.c(26),{entry:t,previewUrl:c,scrollRootRef:o,onSelect:a}=r,d=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let n;e[0]!==d?(n=J("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",d),e[0]=d,e[1]=n):n=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==c||e[5]!==o?(l=s.jsx(pe,{previewUrl:c,title:t.title,scrollRootRef:o,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=c,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t.isSavedBlock?(f=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=f):f=e[8];let i;e[9]!==f?(i=s.jsx(_,{className:"h-4 w-4 shrink-0",style:f}),e[9]=f,e[10]=i):i=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==i||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[i,x]}),e[18]=i,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==a||e[22]!==n||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:a,className:n,children:[l,m]}),e[21]=a,e[22]=n,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=D.c(51),{open:t,onOpenChange:c,meta:o,decofile:a,previewBaseUrl:d,onSelect:n}=r,l=X(),[f,i]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&i(""));let m,h,S,b,j,N,y,R,g,P,C;if(e[0]!==a||e[1]!==o||e[2]!==c||e[3]!==n||e[4]!==t||e[5]!==d||e[6]!==f||e[7]!==l){const F=t&&o&&a?le(o,a):[],W=o?oe(o):"",G=a?ie(a):void 0,H=new Map;if(t&&W)for(const p of F)H.set(p.resolveType,K(d,W,p.previewBlock,G));const E=f.trim().toLowerCase(),V=E?F.filter(p=>p.title.toLowerCase().includes(E)||p.resolveType.toLowerCase().includes(E)||p.description?.toLowerCase().includes(E)):F;h=Z,P=t,C=c,m=ee,y="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=k):k=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>i(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let M;e[27]!==f||e[28]!==B?(M=s.jsxs("div",{className:"relative pt-2",children:[k,s.jsx(re,{value:f,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=f,e[28]=B,e[29]=M):M=e[29],e[30]!==A||e[31]!==M?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,M]}),e[30]=A,e[31]=M,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??K(d,W,p.previewBlock,G),onSelect:()=>n(p)},p.resolveType))}),e[0]=a,e[1]=o,e[2]=c,e[3]=n,e[4]=t,e[5]=d,e[6]=f,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=y,e[15]=R,e[16]=g,e[17]=P,e[18]=C}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],y=e[14],R=e[15],g=e[16],P=e[17],C=e[18];let T;e[33]!==S||e[34]!==b?(T=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=T):T=e[35];let I;e[36]!==T||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:T}),e[36]=T,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==y||e[43]!==R||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:y,className:R,children:[g,I]}),e[40]=m,e[41]=I,e[42]=y,e[43]=R,e[44]=g,e[45]=L):L=e[45];let O;return e[46]!==h||e[47]!==L||e[48]!==P||e[49]!==C?(O=s.jsx(h,{open:P,onOpenChange:C,children:L}),e[46]=h,e[47]=L,e[48]=P,e[49]=C,e[50]=O):O=e[50],O}function ye(r){const e=D.c(4),{previewServerUrl:t,active:c}=ce(r.virtualMcpId);let o;return e[0]!==c||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:c}),e[0]=c,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,ye as u};
@@ -0,0 +1 @@
1
+ import{c as f,F as d,K as p,n as k,b as S,e as q,t as I}from"./index-uQCocWZL.js";import{a as v}from"./use-capability-DEVOnZYS.js";import{u as y}from"./studio-tools-B3t6s0zR.js";const K={connect:{key:"connect",titleKey:"settings.connectClients.pageTitle",tabs:[{key:"clients",labelKey:"settings.subnav.clients",to:"/$org/settings/connect"},{key:"api-keys",labelKey:"settings.nav.apiKeys",to:"/$org/settings/api-keys",requires:"api-keys:manage"}]},members:{key:"members",titleKey:"orgs.members.title",tabs:[{key:"members",labelKey:"orgs.members.title",to:"/$org/settings/members",requires:"members:manage"},{key:"roles",labelKey:"settings.roles.pageTitle",to:"/$org/settings/roles",privilegedOnly:!0}]},billing:{key:"billing",titleKey:"settings.nav.billing",tabs:[{key:"ai-providers",labelKey:"settings.nav.aiProviders",to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"infra",labelKey:"settings.subnav.infrastructure",to:"/$org/settings/infra-billing",requires:"members:manage",requiresOwnedSites:!0}]},storage:{key:"storage",titleKey:"settings.nav.storage",tabs:[{key:"buckets",labelKey:"settings.nav.buckets",to:"/$org/settings/buckets",requires:"file-configs:manage"},{key:"synced-repos",labelKey:"settings.nav.syncedRepos",to:"/$org/settings/synced-repos",requires:"file-configs:manage"}]}};function E(e){return K[e].tabs.map(s=>s.to)}function T(){const e=f.c(13),{org:s}=d(),t=y(),{capabilities:l,isPrivileged:a}=v(),n=a||!!l["members:manage"];let i;e[0]!==s.id?(i=p.infraBillingSites(s.id),e[0]=s.id,e[1]=i):i=e[1];const u=!!s.id&&n;let r;e[2]!==t?(r=()=>t.call("INFRA_BILLING_SITES_LIST",{}),e[2]=t,e[3]=r):r=e[3];let o;e[4]!==i||e[5]!==u||e[6]!==r?(o={queryKey:i,staleTime:3e5,enabled:u,queryFn:r},e[4]=i,e[5]=u,e[6]=r,e[7]=o):o=e[7];const{data:g,isLoading:b}=k(o);let c;e[8]!==g?.sites?(c=g?.sites.map(_)??[],e[8]=g?.sites,e[9]=c):c=e[9];let m;return e[10]!==b||e[11]!==c?(m={sites:c,isLoading:b},e[10]=b,e[11]=c,e[12]=m):m=e[12],m}function _(e){return e.slug}function R(){const e=f.c(7),s=y(),t=S();let l;e[0]!==s?(l=i=>s.call("INFRA_BILLING_PORTAL",{siteSlugs:i}),e[0]=s,e[1]=l):l=e[1];let a;e[2]!==t?(a=i=>I.error(t("settings.infraBilling.portalError",{message:i.message})),e[2]=t,e[3]=a):a=e[3];let n;return e[4]!==l||e[5]!==a?(n={mutationFn:l,onSuccess:$,onError:a},e[4]=l,e[5]=a,e[6]=n):n=e[6],q(n)}function $(e){const{url:s}=e;return window.open(s,"_blank","noopener,noreferrer")}function F(e,s){const t=f.c(14),{org:l}=d(),a=y();let n,i,u;t[0]!==l.id||t[1]!==s||t[2]!==e?(n=[...e].sort(),u=k,i=p.infraBilling(l.id,n.join(","),s),t[0]=l.id,t[1]=s,t[2]=e,t[3]=n,t[4]=i,t[5]=u):(n=t[3],i=t[4],u=t[5]);const r=n.length>0;let o;t[6]!==s||t[7]!==n||t[8]!==a?(o=()=>a.call("INFRA_BILLING_GET",{siteSlugs:n,period:s}),t[6]=s,t[7]=n,t[8]=a,t[9]=o):o=t[9];let g;return t[10]!==i||t[11]!==r||t[12]!==o?(g={queryKey:i,enabled:r,staleTime:6e4,queryFn:o},t[10]=i,t[11]=r,t[12]=o,t[13]=g):g=t[13],u(g)}function N(){const e=f.c(6),{capabilities:s,isPrivileged:t,loading:l,error:a}=v(),n=T().sites.length>0;let i;if(e[0]!==s||e[1]!==a||e[2]!==t||e[3]!==l||e[4]!==n){const u=r=>r.requiresOwnedSites&&!n?!1:l||a?!0:r.privilegedOnly?t:r.requires?t||s[r.requires]:!0;i=Object.fromEntries(Object.values(K).map(r=>[r.key,r.tabs.filter(u)])),e[0]=s,e[1]=a,e[2]=t,e[3]=l,e[4]=n,e[5]=i}else i=e[5];return i}export{K as S,T as a,F as b,R as c,E as g,N as u};
@@ -1 +1 @@
1
- import{c as r,v as u}from"./index-Dv2HGcxw.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-DVJCI5Zv.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
1
+ import{c as r,v as u}from"./index-uQCocWZL.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-CD87sgDf.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +1 @@
1
- import{c as u,F as f,n as E,o as g,e as T,K as l,t as m}from"./index-Dv2HGcxw.js";import{u as y}from"./studio-tools-BU92X_bQ.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],E(a)}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){m.error(e instanceof Error?e.message:"Failed to create tag")}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){m.error(e instanceof Error?e.message:"Failed to delete tag")}function A(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],E(c)}function G(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){m.error(e instanceof Error?e.message:"Failed to update member tags")}export{C as a,M as b,A as c,G as d,K as u};
1
+ import{c as u,F as f,n as E,o as g,e as T,K as l,t as m}from"./index-uQCocWZL.js";import{u as y}from"./studio-tools-B3t6s0zR.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],E(a)}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){m.error(e instanceof Error?e.message:"Failed to create tag")}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){m.error(e instanceof Error?e.message:"Failed to delete tag")}function A(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],E(c)}function G(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){m.error(e instanceof Error?e.message:"Failed to update member tags")}export{C as a,M as b,A as c,G as d,K as u};
@@ -1 +1 @@
1
- import{c as p,r as f}from"./index-Dv2HGcxw.js";import{u as w}from"./use-mobile-D1Z5Fq_m.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
1
+ import{c as p,r as f}from"./index-uQCocWZL.js";import{u as w}from"./use-mobile-Br11M3GY.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
@@ -0,0 +1 @@
1
+ import{c as d,F as a,e3 as P,bd as p,K as L,bc as S,n as V}from"./index-uQCocWZL.js";import{u as g}from"./use-mcp-client-D9Yqqzns.js";import{S as C}from"./constants-BSYv1IkQ.js";function b(s){const t=d.c(5);let e;t[0]!==s?(e=s===void 0?{}:s,t[0]=s,t[1]=e):e=t[1];const n=e,{org:i}=a();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:C,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=g(o);return P(i.id,"VIRTUAL_MCP",l,n)}function y(s){const t=d.c(3),{org:e}=a();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:C,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=g(n);return S(e.id,"VIRTUAL_MCP",s??void 0,i)}function R(s){const t=d.c(15),{org:e}=a();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:C,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=g(n);let o,l,u;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),u=V,l=L.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=u):(o=t[5],l=t[6],u=t[7]);const f=o.length>0;let c;t[8]!==i||t[9]!==o?(c=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},I=new Map;for(const m of M.items)I.set(m.id,m);return I},t[8]=i,t[9]=o,t[10]=c):c=t[10];let r;return t[11]!==l||t[12]!==f||t[13]!==c?(r={queryKey:l,enabled:f,staleTime:3e4,queryFn:c},t[11]=l,t[12]=f,t[13]=c,t[14]=r):r=t[14],u(r)}function E(){const s=d.c(3),{org:t}=a();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:C,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=g(e);return p(t.id,"VIRTUAL_MCP",n)}export{y as a,E as b,R as c,b as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./use-infinite-scroll-H6_NvOy-.js";import{e7 as i}from"./index-uQCocWZL.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{bf as n,r as s,cQ as a,cR as i}from"./index-Dv2HGcxw.js";function f(r){const c=n({warn:r?.router===void 0}),t=r?.router||c,u=s.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
1
+ import{bf as n,r as s,cQ as a,cR as i}from"./index-uQCocWZL.js";function f(r){const c=n({warn:r?.router===void 0}),t=r?.router||c,u=s.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./use-infinite-scroll-H6_NvOy-.js";import{e7 as u,b4 as n}from"./index-uQCocWZL.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
@@ -1 +1 @@
1
- import{c as V,b as q,r as z,a as O,n as Y,e as $,j as t,K as J,t as Q,B as W}from"./index-Dv2HGcxw.js";import{P as I}from"./index-BpUEa-_f.js";import{C as G}from"./collection-table-wrapper-DrvNW4uh.js";import{E as L}from"./empty-state-C7JioFu-.js";import{S as H}from"./search-input-Bk76gJwg.js";import{A as X}from"./avatar-H31gkKqD.js";import{B as D}from"./badge-xHyVR7tO.js";import{u as Z}from"./use-debounced-value-DkWfrQRX.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./sidebar-BQOlbGpf.js";import"./LayoutLeft-C4diXNzA.js";import"./use-mobile-D1Z5Fq_m.js";import"./X-DImctFzL.js";import"./tooltip-CJN68N1y.js";import"./table-DRxtzc3s.js";import"./ArrowUp-BP3eCaj-.js";import"./SearchMd-CP_XNhKh.js";import"./User01-RJV9ipfN.js";import"./differenceInSeconds-NQ4PDo0z.js";function be(){const e=V.c(58),s=q(),[a,M]=z.useState("");let N;e[0]!==a?(N=a.trim(),e[0]=a,e[1]=N):N=e[1];const r=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==r?(n=J.deploymentAdminUsers(r),e[2]=r,e[3]=n):n=e[3];let l;e[4]!==r?(l=()=>{const i=new URLSearchParams({limit:"100"});return r&&i.set("searchValue",r),K(`/api/_admin/users?${i}`)},e[4]=r,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:re,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==a||e[44]!==j?(g=t.jsx(H,{value:a,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=a,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==r||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:r?s("admin.users.noUsersMatchSearch",{search:r}):s("admin.users.noUsersYet")}),e[46]=r,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function re(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{be as default};
1
+ import{c as V,b as q,r as z,a as O,n as Y,e as $,j as t,K as J,t as Q,B as W}from"./index-uQCocWZL.js";import{P as I}from"./index-Caktz4oP.js";import{C as G}from"./collection-table-wrapper-DAjE-z7r.js";import{E as L}from"./empty-state-B0VbRil-.js";import{S as H}from"./search-input-2myyBQJH.js";import{A as X}from"./avatar-BBUpRol8.js";import{B as D}from"./badge-mkaxTwEA.js";import{u as Z}from"./use-debounced-value-BvA07otq.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./sidebar-CXlXuSbt.js";import"./LayoutLeft-crVkTtDg.js";import"./use-mobile-Br11M3GY.js";import"./X-qfGIRtV3.js";import"./tooltip-D-nRolEQ.js";import"./table-DCrvS-Zy.js";import"./ArrowUp-CIQr6EEf.js";import"./SearchMd-DBwuG5f1.js";import"./User01-nZEMcHk8.js";import"./differenceInSeconds-NQ4PDo0z.js";function be(){const e=V.c(58),s=q(),[a,M]=z.useState("");let N;e[0]!==a?(N=a.trim(),e[0]=a,e[1]=N):N=e[1];const r=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==r?(n=J.deploymentAdminUsers(r),e[2]=r,e[3]=n):n=e[3];let l;e[4]!==r?(l=()=>{const i=new URLSearchParams({limit:"100"});return r&&i.set("searchValue",r),K(`/api/_admin/users?${i}`)},e[4]=r,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:re,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==a||e[44]!==j?(g=t.jsx(H,{value:a,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=a,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==r||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:r?s("admin.users.noUsersMatchSearch",{search:r}):s("admin.users.noUsersYet")}),e[46]=r,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function re(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{be as default};
@@ -0,0 +1 @@
1
+ import{c as K,b as tt,r as et,j as s,m as ot,B as nt}from"./index-uQCocWZL.js";import{w as vt,a7 as dt,aJ as yt}from"./agent-icon-DbIRcFKb.js";import{i as Tt}from"./ChevronRight-DbA3WeTf.js";import{L as jt}from"./label-t3jAO6fk.js";import{B as pt}from"./automation-runs-kElp1eKm.js";import{S as wt}from"./switch-CrP5QdDx.js";import{T as Nt,c as kt,a as Mt}from"./tooltip-D-nRolEQ.js";import{V as _t}from"./view-mode-toggle-B9YLzYuj.js";import"./AlertCircle-2GPyGIlA.js";import"./Tool01-BtGIY0YP.js";import"./ArrowUp-CIQr6EEf.js";import"./ArrowLeft-C-s6GSxn.js";import"./Tool02-lhlB91Fn.js";import"./XCircle-CSlEELIF.js";import"./ArrowUpRight-UxSRtBhQ.js";import"./TrendUp01-DcoY5K-E.js";import"./ZapSquare-DAbQm8xZ.js";import"./Users03-CZUMIhrE.js";import"./CheckCircle-CdyPr9LO.js";import"./Check-BOLJAxoj.js";import"./ChevronDown-D-aBpIcX.js";import"./ChevronSelectorVertical-Ddmm4xQU.js";import"./ChevronUp-B5EgXJx1.js";import"./DotsVertical-Ddih9daz.js";import"./Stars02-BR3bpPhq.js";import"./UserSquare-CDZ0hmwC.js";import"./Copy01-Cts1DxIQ.js";import"./CreditCard01-0hLrbslw.js";import"./Download01-8V8uONHK.js";import"./Settings02-B5v95CJZ.js";import"./Eye-kz-zqGUl.js";import"./FilterLines-DSgZnchM.js";import"./Share07-DVEQG-0v.js";import"./Globe01-DIHsgEmb.js";import"./Globe04-Di6RnUZh.js";import"./SwitchHorizontal01-Bb5le3Sb.js";import"./HardDrive-DtPQUBC0.js";import"./Key01-BdxhwXjh.js";import"./LayoutLeft-crVkTtDg.js";import"./LinkExternal01-D389APaV.js";import"./LockUnlocked01-DAnbImxS.js";import"./LogOut01-BsZTV-zX.js";import"./Monitor01-ChDM-STj.js";import"./Sun-BIA5r9xx.js";import"./Palette-DXkH3xtS.js";import"./Play-CsIDM2C-.js";import"./Plus-DQzrxV5N.js";import"./SearchLg-CZ8gwJXq.js";import"./SearchMd-DBwuG5f1.js";import"./Shield01-Cko25VMX.js";import"./Stars01-DUuXYRm4.js";import"./Trash01-D6L_eF8C.js";import"./Upload01-DRVTa1ge.js";import"./User01-nZEMcHk8.js";import"./Users01-CI2bch9C.js";import"./XClose-B29qex-C.js";import"./X-qfGIRtV3.js";import"./Zap-DcfYOTMj.js";import"./select-OJZr6vSG.js";import"./useInfiniteQuery-Uzpw22ew.js";import"./use-infinite-scroll-H6_NvOy-.js";import"./use-connection-DlZgI-7a.js";import"./use-mcp-client-D9Yqqzns.js";import"./constants-BSYv1IkQ.js";import"./auth-DclLBUby.js";import"./use-virtual-mcp-DKWMT_yg.js";import"./card-Cbpe-6mA.js";import"./sidebar-CXlXuSbt.js";import"./use-mobile-Br11M3GY.js";import"./table-DCrvS-Zy.js";import"./empty-state-B0VbRil-.js";import"./use-members-SIHeIOrM.js";import"./use-org-auth-client-5nZlOt-O.js";import"./use-clock-tick-DTySxQNj.js";import"./use-automations-Cu5sfrAv.js";import"./studio-tools-B3t6s0zR.js";import"./useSuspenseInfiniteQuery-CM7HWNDV.js";import"./avatar-BBUpRol8.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DnyBaCfS.js";import"./dialog-CUddXMws.js";import"./tab-id-iAugKsz1.js";import"./hooks-DzWlqng8.js";import"./decopilot-sse-pool-EOQd0pSV.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-BCanwFnm.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-HmIPTTa0.js";import"./use-decopilot-events-CD87sgDf.js";import"./use-organization-settings-BwZlefEm.js";import"./monaco-editor-WF0Loj_a.js";import"./spinner-B1-xmV_I.js";import"./types-DrJIJi5z.js";import"./shell-layout-DMHFUN_c.js";import"./required-auth-layout-BY5wwpxM.js";import"./use-org-sso-CiS2XQGs.js";import"./integration-icon-Cc6SFROH.js";import"./use-navigate-to-agent-Dw8z3Zn7.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-Dk8BJc4D.js";import"./index-CKlfVZSx.js";import"./form-CtIyVVv8.js";import"./input-DvRVVykP.js";import"./file-type-icon-Rf-DryoU.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Dt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",i=typeof n=="string";if(!r&&!i)return null;const o=r?new Date(t):Ct,a=i?new Date(n):Dt;return Number.isNaN(o.getTime())||Number.isNaN(a.getTime())||r&&i&&a.getTime()<=o.getTime()?null:{start:o,end:a,openStart:!r,openEnd:!i}}function ft(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(Et.has(n)){const r=Rt(e);r&&t.push(r);return}if(St.has(n)){const r=e.matchers;if(Array.isArray(r))for(const i of r)ft(i,t)}}}function Ot(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const n=e.variants;return Array.isArray(n)}function It(e){if(typeof e=="string"){const m=e.trim();if(m.length===0)return null;try{const c=new URL(m).pathname.split("/").filter(Boolean),d=c[c.length-1];if(d)return decodeURIComponent(d)}catch{}return m.length>80?`${m.slice(0,77)}…`:m}if(!e||typeof e!="object")return null;const t=e,n=t.config,i=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,i?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const m of o)if(typeof m=="string"&&m.trim().length>0)return m.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function X(e,t,n,r,i){if(Ot(e)){const o=e.variants,a=e.__resolveType,m=$t.test(a)?"":Pt(r);o.forEach((l,c)=>{if(!l||typeof l!="object")return;const d=l,f=[];if(ft(d.rule,f),f.length===0)return;const x=It(d.value)??(m||n);for(const h of f)i.push({blockKey:t,blockLabel:n,innerPath:m,variantIndex:c,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:a})});for(let l=0;l<o.length;l++){const c=o[l];c&&typeof c=="object"&&X(c.value,t,n,[...r,"variants",l,"value"],i)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)X(e[o],t,n,[...r,o],i);return}if(e&&typeof e=="object")for(const[o,a]of Object.entries(e))o!=="__resolveType"&&X(a,t,n,[...r,o],i)}function Ft(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))X(r,n,Lt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,i)=>{const o=i*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),n}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ut(e,t){return e.get(t)??Ht}const Bt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["January","February","March","April","May","June","July","August","September","October","November","December"],gt=1440*60*1e3;function B(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function xt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function G(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function st(e,t){return Math.round((B(e).getTime()-B(t).getTime())/gt)}function Wt(e){const t=(e.getTime()-B(e).getTime())/gt;return Math.min(Math.max(t,0),1)}function it(e,t){return st(e,t)+Wt(e)}function zt(e){const t=Z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const i=[];for(let o=0;o<7;o++)i.push(Z(t,r*7+o));n.push(i)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Ut(e,t){const n=B(e[0]),r=Z(n,7),i=n.getTime(),o=r.getTime(),a=[];for(const c of t){const d=B(c.start),f=B(c.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?Z(r,-1):f,h=st(u,n),g=st(x,u)+1;if(g<=0)continue;const b=Math.max(c.start.getTime(),i),j=Math.min(c.end.getTime(),o),v=it(new Date(b),n),p=Math.max(it(new Date(j),n)-v,0);p<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:p})}a.sort((c,d)=>c.startCol-d.startCol||d.span-c.span||c.variant.blockKey.localeCompare(d.variant.blockKey));const m=[],l=[];for(const c of a){let d=m.findIndex(f=>f<=c.startCol);d===-1&&(d=m.length,m.push(0)),m[d]=c.startCol+c.span,l.push({...c,lane:d})}return l}const at=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Yt(e,t){const n=e.openStart?t("sandbox.variantCalendar.always"):at.format(e.start),r=e.openEnd?t("sandbox.variantCalendar.ongoing"):at.format(e.end);return`${n} → ${r}`}function Gt(e){const t=K.c(18),{variant:n}=e,r=tt();let i;t[0]!==n.blockLabel?(i=s.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=i):i=t[1];let o;t[2]!==n.innerPath?(o=n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=o):o=t[3];let a;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(a=n.label!==n.blockLabel&&n.label!==n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=a):a=t[7];let m;t[8]!==r||t[9]!==n?(m=Yt(n,r),t[8]=r,t[9]=n,t[10]=m):m=t[10];let l;t[11]!==m?(l=s.jsx("div",{className:"mt-1",children:m}),t[11]=m,t[12]=l):l=t[12];let c;return t[13]!==i||t[14]!==o||t[15]!==a||t[16]!==l?(c=s.jsx(Mt,{children:s.jsxs("div",{className:"text-xs",children:[i,o,a,l]})}),t[13]=i,t[14]=o,t[15]=a,t[16]=l,t[17]=c):c=t[17],c}const lt=16;function Kt(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${lt}px, #000 calc(100% - ${lt}px), ${r})`}function bt(e){const t=K.c(26),{variant:n,color:r,style:i,children:o,fadeStart:a,fadeEnd:m}=e,l=a===void 0?!1:a,c=m===void 0?!1:m;let d;t[0]!==c||t[1]!==l?(d=Kt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const f=d;let u;t[3]!==l?(u=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=u):u=t[4];let x;t[5]!==c?(x=c&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=c,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==i||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...i},t[9]=r.bg,t[10]=r.text,t[11]=i,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let j;t[18]!==g||t[19]!==b?(j=s.jsx(Nt,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=j):j=t[20];let v;t[21]!==n?(v=s.jsx(Gt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let p;return t[23]!==v||t[24]!==j?(p=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=p):p=t[25],p}function lr(e){const t=K.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,f,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),f=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=f,t[4]=u}else d=t[2],f=t[3],u=t[4];const x=f;let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>m(xt(new Date)),t[5]=h):h=t[5];const g=h;let b;t[6]!==i?(b=()=>m(P=>i==="calendar"?G(P,-1):G(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?G(P,1):G(P,3)),t[8]=i,t[9]=v):v=t[9];const p=v;let y;t[10]!==r?(y=r("sandbox.variantCalendar.today"),t[10]=r,t[11]=y):y=t[11];let T;t[12]!==y?(T=s.jsx(nt,{variant:"outline",size:"sm",onClick:g,children:y}),t[12]=y,t[13]=T):T=t[13];let N;t[14]!==r?(N=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=N):N=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(vt,{size:16}),t[16]=D):D=t[16];let k;t[17]!==j||t[18]!==N?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":N,children:D}),t[17]=j,t[18]=N,t[19]=k):k=t[19];let M;t[20]!==r?(M=r("sandbox.variantCalendar.next"),t[20]=r,t[21]=M):M=t[21];let S;t[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Tt,{size:16}),t[22]=S):S=t[22];let A;t[23]!==p||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:p,"aria-label":M,children:S}),t[23]=p,t[24]=M,t[25]=A):A=t[25];const $=ht[a.getMonth()];let C;t[26]!==a?(C=a.getFullYear(),t[26]=a,t[27]=C):C=t[27];let _;t[28]!==$||t[29]!==C?(_=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[$," ",C]}),t[28]=$,t[29]=C,t[30]=_):_=t[30];let w;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[T,k,A,_]}),t[31]=A,t[32]=_,t[33]=T,t[34]=k,t[35]=w):w=t[35];let L;t[36]!==d||t[37]!==l||t[38]!==r?(L=d>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{id:"show-ongoing",checked:l,onCheckedChange:c}),s.jsx(jt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:r("sandbox.variantCalendar.showOngoing",{count:d})})]}),t[36]=d,t[37]=l,t[38]=r,t[39]=L):L=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(dt,{}),t[40]=H):H=t[40];let F;t[41]!==r?(F=r("sandbox.variantCalendar.calendarMode"),t[41]=r,t[42]=F):F=t[42];let E;t[43]!==F?(E={value:"calendar",icon:H,label:F},t[43]=F,t[44]=E):E=t[44];let W;t[45]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(yt,{}),t[45]=W):W=t[45];let R;t[46]!==r?(R=r("sandbox.variantCalendar.timelineMode"),t[46]=r,t[47]=R):R=t[47];let O;t[48]!==R?(O={value:"timeline",icon:W,label:R},t[48]=R,t[49]=O):O=t[49];let I;t[50]!==E||t[51]!==O?(I=[E,O],t[50]=E,t[51]=O,t[52]=I):I=t[52];let V;t[53]!==I||t[54]!==i?(V=s.jsx(_t,{value:i,onValueChange:o,options:I}),t[53]=I,t[54]=i,t[55]=V):V=t[55];let z;t[56]!==L||t[57]!==V?(z=s.jsxs("div",{className:"flex items-center gap-4",children:[L,V]}),t[56]=L,t[57]=V,t[58]=z):z=t[58];let U;t[59]!==w||t[60]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[w,z]}),t[59]=w,t[60]=z,t[61]=U):U=t[61];let Y;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(Y=u.length===0?s.jsx(Zt,{hiddenOngoing:l?0:d}):i==="calendar"?s.jsx(ee,{monthStart:a,variants:u,colorMap:x}):s.jsx(oe,{monthStart:a,variants:u,colorMap:x}),t[62]=x,t[63]=a,t[64]=d,t[65]=l,t[66]=u,t[67]=i,t[68]=Y):Y=t[68];let q;return t[69]!==U||t[70]!==Y?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[U,Y]}),t[69]=U,t[70]=Y,t[71]=q):q=t[71],q}function Jt(e){return e.blockKey}function qt(e){return!e.openEnd}function Qt(e){return e.openEnd}function Xt(){return xt(new Date)}function Zt(e){const t=K.c(4),{hiddenOngoing:n}=e,r=n===void 0?0:n,i=tt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:24,className:"text-muted-foreground/60"}),t[0]=o):o=t[0];let a;return t[1]!==r||t[2]!==i?(a=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[o,r>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noDatedVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.hiddenOngoingVariants",{count:r})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noScheduledVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=r,t[2]=i,t[3]=a):a=t[3],a}const rt=20,ct=2,mt=28,te=6;function ee(e){const t=K.c(17),{monthStart:n,variants:r,colorMap:i}=e;let o,a,m,l,c;if(t[0]!==i||t[1]!==n||t[2]!==r){const u=zt(n),x=B(new Date);o=pt,c="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:Bt.map(re)}),t[8]=m):m=t[8],l=u.map((h,g)=>{const b=Ut(h,r),j=b.reduce(ne,0),v=mt+j*(rt+ct)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:v},children:[h.map((p,y)=>{const T=p.getMonth()===n.getMonth(),N=p.getTime()===x.getTime();return s.jsx("div",{className:ot("border-r last:border-r-0 px-2 pt-1.5 text-xs",T?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:ot("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},y)}),b.map((p,y)=>{const T=ut(i,p.variant.blockKey),N=mt+p.lane*(rt+ct),D=p.leftUnits/7*100,k=p.widthUnits/7*100,M=p.variant.openStart&&g===0,S=p.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:p.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:N,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${y}`)})]},g)}),t[0]=i,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=m,t[6]=l,t[7]=c}else o=t[3],a=t[4],m=t[5],l=t[6],c=t[7];let d;t[9]!==a||t[10]!==m||t[11]!==l?(d=s.jsxs("div",{className:a,children:[m,l]}),t[9]=a,t[10]=m,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==o||t[14]!==c||t[15]!==d?(f=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function ne(e,t){return Math.max(e,t.lane+1)}function re(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,se=32,J=240;function oe(e){const t=K.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=G(n,Q),m=new Date,l=new Map;for(const _ of r){const w=l.get(_.blockKey)??[];w.push(_),l.set(_.blockKey,w)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),f=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,w)=>G(o,w),t[0]=o,t[1]=u):u=t[1];const x=Array.from({length:Q},u),h=m.getTime()>=o.getTime()&&m.getTime()<=a.getTime()?f(m):null,g=tt(),b=pt,j="flex-1 min-h-0",v="min-w-[900px] relative";let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={width:J},t[2]=p):p=t[2];let y;t[3]!==g?(y=g("sandbox.variantCalendar.variantBlock"),t[3]=g,t[4]=y):y=t[4];let T;t[5]!==y?(T=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:p,children:y}),t[5]=y,t[6]=T):T=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:N,children:D}),t[8]=D,t[9]=k):k=t[9];let M;t[10]!==T||t[11]!==k?(M=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[T,k]}),t[10]=T,t[11]=k,t[12]=M):M=t[12];let S;t[13]!==g||t[14]!==h?(S=h!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${J}px + (100% - ${J}px) * ${h} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:g("sandbox.variantCalendar.todayLabel")})}),t[13]=g,t[14]=h,t[15]=S):S=t[15];const A=c.map(_=>{const[w,L]=_,H=ut(i,w),F=L[0]?.blockLabel??w;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:J},children:F})}),L.map((E,W)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:se},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:J},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:E.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:x.map(ie)}),(()=>{const R=Math.max(E.start.getTime(),o.getTime()),O=Math.min(E.end.getTime(),a.getTime());if(O<=R)return null;const I=f(new Date(R)),V=f(new Date(O))-I;return s.jsx(bt,{variant:E,color:H,fadeStart:E.openStart,fadeEnd:E.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${I}%`,width:`calc(${V}% - 2px)`,height:22},children:E.label})})()]})]},W))]},w)});let $;t[16]!==M||t[17]!==S||t[18]!==A?($=s.jsxs("div",{className:v,children:[M,S,A]}),t[16]=M,t[17]=S,t[18]=A,t[19]=$):$=t[19];let C;return t[20]!==b||t[21]!==$?(C=s.jsx(b,{className:j,children:$}),t[20]=b,t[21]=$,t[22]=C):C=t[22],C}function ie(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function ae(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ht[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function le(e,t){return e[0].localeCompare(t[0])}export{lr as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as T,m as f,j as i}from"./index-Dv2HGcxw.js";import{c as k,T as I,a as P}from"./tooltip-CJN68N1y.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
1
+ import{c as $,r as T,m as f,j as i}from"./index-uQCocWZL.js";import{c as k,T as I,a as P}from"./tooltip-D-nRolEQ.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
@@ -50,7 +50,7 @@
50
50
  <meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
51
51
  <meta name="twitter:image" content="/og-image.png" />
52
52
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
53
- <script type="module" crossorigin src="/assets/index-Dv2HGcxw.js"></script>
53
+ <script type="module" crossorigin src="/assets/index-uQCocWZL.js"></script>
54
54
  <link rel="stylesheet" crossorigin href="/assets/index-B1fXHVYV.css">
55
55
  </head>
56
56
  <body>