decocms 3.73.1 → 3.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/client/assets/{AlertCircle-DMqR3m0L.js → AlertCircle-Ccspj6_x.js} +1 -1
  2. package/dist/client/assets/ArrowRight-DjM-WAe8.js +1 -0
  3. package/dist/client/assets/{ArrowUpRight-DeYzuaJ8.js → ArrowUpRight-tJm1fmd7.js} +1 -1
  4. package/dist/client/assets/Check-D3J8f8u-.js +1 -0
  5. package/dist/client/assets/{CheckCircle-D6b8lFUP.js → CheckCircle-2NPq-6dO.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CYFvWHpZ.js → ChevronDown-Dilz0yBl.js} +1 -1
  7. package/dist/client/assets/{ChevronLeft-DXSAgzPw.js → ChevronLeft-CJ5DBM3M.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-Dj41DV2U.js → ChevronRight-KEtpzT4P.js} +1 -1
  9. package/dist/client/assets/ChevronUp-B5x1falF.js +1 -0
  10. package/dist/client/assets/{DotsVertical-y5lMfVOQ.js → DotsVertical-BM5d8Pc7.js} +1 -1
  11. package/dist/client/assets/{Eye-D3THRXh6.js → Eye-hHNCwVZ1.js} +1 -1
  12. package/dist/client/assets/{FilterLines-BPeCeYIz.js → FilterLines-DfVdVEBp.js} +1 -1
  13. package/dist/client/assets/{Globe01-BquIL2vg.js → Globe01-DD8UM4Hn.js} +1 -1
  14. package/dist/client/assets/{Globe04-BBRZWdJY.js → Globe04-CHjKQaGv.js} +1 -1
  15. package/dist/client/assets/{HardDrive-DmtpWveq.js → HardDrive-ClhqImrT.js} +1 -1
  16. package/dist/client/assets/{Key01-Lcx9qTy7.js → Key01-BYHEvjL0.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-CkiSxkS_.js → LayoutLeft-BNwcfVCc.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-jwO28Eeb.js → LinkExternal01-BqsD3A6i.js} +1 -1
  19. package/dist/client/assets/{Monitor01-L6hrk62b.js → Monitor01-BqllG5YD.js} +1 -1
  20. package/dist/client/assets/{Palette-ClNyQOQA.js → Palette-CdtyN2t7.js} +1 -1
  21. package/dist/client/assets/{Play-C6QgiUls.js → Play-DpX5JUyA.js} +1 -1
  22. package/dist/client/assets/{Plus-_82_8sq8.js → Plus-BaLwS14l.js} +1 -1
  23. package/dist/client/assets/{SearchMd-C3Pmxf99.js → SearchMd-CJ_dFCp5.js} +1 -1
  24. package/dist/client/assets/{Settings02-B7hO-Tma.js → Settings02-Cg6Yp6Ig.js} +1 -1
  25. package/dist/client/assets/{Shield01-RDE62wRx.js → Shield01-DYwaNnY3.js} +1 -1
  26. package/dist/client/assets/{Star01-BfSEPDRT.js → Star01-D42mJCl7.js} +1 -1
  27. package/dist/client/assets/{Stars01-W6Wl0Pse.js → Stars01-CrB442jN.js} +1 -1
  28. package/dist/client/assets/{Stars02-9vF61uFx.js → Stars02-C2akJW-A.js} +1 -1
  29. package/dist/client/assets/{Sun-BxuJFhF6.js → Sun-CgYYfF85.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-yw5VS97V.js → SwitchHorizontal01-y3DhestF.js} +1 -1
  31. package/dist/client/assets/{Tool01-B4SsemMS.js → Tool01-CI_6KMgQ.js} +1 -1
  32. package/dist/client/assets/{Trash01-CG0gTYx7.js → Trash01-Cd_0JhhN.js} +1 -1
  33. package/dist/client/assets/{Upload01-BlvGy5d-.js → Upload01-ijsbLMSK.js} +1 -1
  34. package/dist/client/assets/{User01-CTuKNCEa.js → User01-BI5RuTWy.js} +1 -1
  35. package/dist/client/assets/{Users01-KXiCgru2.js → Users01-LhAUtJ2l.js} +1 -1
  36. package/dist/client/assets/{Users03-BOvyNEV4.js → Users03-CJf6bBEA.js} +1 -1
  37. package/dist/client/assets/{X-CKIhVHQk.js → X-BmA2kYv-.js} +1 -1
  38. package/dist/client/assets/XCircle-CSVmVGl-.js +1 -0
  39. package/dist/client/assets/{XClose-Ig7y9gcI.js → XClose-BGGuhSdx.js} +1 -1
  40. package/dist/client/assets/{Zap-w60sxAoc.js → Zap-C5OGTH44.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-C7yt7KfQ.js → ZapSquare-Bh6-lHaM.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-DVSwpwUz.js → ZoomOut-xDQo2yr7.js} +1 -1
  43. package/dist/client/assets/{access-gate-CEtgmlCt.js → access-gate-C-eMG1Ta.js} +1 -1
  44. package/dist/client/assets/add-section-modal-DNNafM9O.js +1 -0
  45. package/dist/client/assets/agent-icon-Bcqwo2Wq.js +1 -0
  46. package/dist/client/assets/agents-list-obMS8uxZ.js +1 -0
  47. package/dist/client/assets/ai-providers-apfL_rjp.js +1 -0
  48. package/dist/client/assets/{alert-DIqgQstn.js → alert-B1Ln6zZV.js} +1 -1
  49. package/dist/client/assets/{alert-dialog-BuJSufuR.js → alert-dialog-BZRM5ze7.js} +3 -3
  50. package/dist/client/assets/app-editor-C0jI2dDZ.js +1 -0
  51. package/dist/client/assets/{auth-catchall-CHUZWWSw.js → auth-catchall-s-1qzuNO.js} +1 -1
  52. package/dist/client/assets/auth-entry-CW5gsTiA.js +1 -0
  53. package/dist/client/assets/{auth-tkqpBHf1.js → auth-rl3GT7t8.js} +1 -1
  54. package/dist/client/assets/{auth-split-layout-DRR0KEkj.js → auth-split-layout-BC0lphRW.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-40GibzkL.js → automation-list-row-DefMjeyu.js} +1 -1
  56. package/dist/client/assets/{automation-runs-BEntIYkJ.js → automation-runs-C-Da4MEd.js} +1 -1
  57. package/dist/client/assets/automations-CbOSvhEe.js +1 -0
  58. package/dist/client/assets/{avatar-DfTXVgX9.js → avatar-CXZnLPEU.js} +1 -1
  59. package/dist/client/assets/backoff-CrEUbyZT.js +1 -0
  60. package/dist/client/assets/{badge-an9iff2c.js → badge-DSiiJMKS.js} +1 -1
  61. package/dist/client/assets/{block-document-DZEmtfok.js → block-document-DR_-i1iv.js} +1 -1
  62. package/dist/client/assets/{brand-context-BhD6vM0G.js → brand-context-D385RFi4.js} +1 -1
  63. package/dist/client/assets/buckets-CfLzGo42.js +1 -0
  64. package/dist/client/assets/{calendar-tEWC6_XV.js → calendar-CdvLiXTi.js} +1 -1
  65. package/dist/client/assets/{capability-load-error-BXEh1mp-.js → capability-load-error-Cc0Imt5p.js} +1 -1
  66. package/dist/client/assets/{card-Ckx3Kwvj.js → card-DSDTRgoU.js} +1 -1
  67. package/dist/client/assets/category-editor-sMElZzN1.js +1 -0
  68. package/dist/client/assets/chat-context-DnaexSAo.js +21 -0
  69. package/dist/client/assets/checkbox-CL_5fiO_.js +1 -0
  70. package/dist/client/assets/{cli-auth-success-DWLJa27h.js → cli-auth-success-DV-qTae_.js} +1 -1
  71. package/dist/client/assets/collection-detail-CtoW7iVa.js +1 -0
  72. package/dist/client/assets/collection-display-button-Boq8hl8Q.js +1 -0
  73. package/dist/client/assets/{collection-search-CCzYANV5.js → collection-search-2g11_WBH.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-CBstOc4r.js → collection-tabs-CDMyDuFK.js} +1 -1
  75. package/dist/client/assets/{command-pIEd50-L.js → command-Bw_f0kDn.js} +1 -1
  76. package/dist/client/assets/commerce-onboarding-LL_9usA-.js +1 -0
  77. package/dist/client/assets/connect-desktop-dialog-Dybq2Hx1.js +1 -0
  78. package/dist/client/assets/{connection-card-CqvtHNnU.js → connection-card-DA1t_KQo.js} +1 -1
  79. package/dist/client/assets/connection-detail-C3h6Iqqu.js +1 -0
  80. package/dist/client/assets/{connection-form-helpers-ByFrPc9N.js → connection-form-helpers-BqK6S8Yx.js} +1 -1
  81. package/dist/client/assets/connections-BdIG1myf.js +1 -0
  82. package/dist/client/assets/context-menu-KaWlIbj1.js +1 -0
  83. package/dist/client/assets/{decopilot-D6xQ1qh2.js → decopilot-fUgUe2Eh.js} +1 -1
  84. package/dist/client/assets/decopilot-sse-pool-Dl1x5tdf.js +1 -0
  85. package/dist/client/assets/delay-CnY5UFtP.js +1 -0
  86. package/dist/client/assets/dialog-CQ6B0IwC.js +1 -0
  87. package/dist/client/assets/{domain-settings-DIU6G_-3.js → domain-settings-BvzKBAZm.js} +1 -1
  88. package/dist/client/assets/drawer-mbT59SGx.js +1 -0
  89. package/dist/client/assets/dropdown-menu-bs6nmOyP.js +1 -0
  90. package/dist/client/assets/{empty-state-BrSxZrfZ.js → empty-state-crYivviN.js} +1 -1
  91. package/dist/client/assets/{extract-connection-data-CBzjCfJ2.js → extract-connection-data-D-Y4GRfE.js} +1 -1
  92. package/dist/client/assets/file-explorer-iYX8uF4-.js +2 -0
  93. package/dist/client/assets/{file-type-icon-BOPDPlds.js → file-type-icon-D0ASmNXK.js} +1 -1
  94. package/dist/client/assets/{files-cbAPSaRo.js → files-ENTpyfhv.js} +1 -1
  95. package/dist/client/assets/{form-BZY9ZRz4.js → form-O9DEtf_L.js} +1 -1
  96. package/dist/client/assets/general-BJWZpnpu.js +1 -0
  97. package/dist/client/assets/{github-repo-picker-CrW8szfE.js → github-repo-picker-CHTvfJAD.js} +1 -1
  98. package/dist/client/assets/{hooks-DLdyjUhZ.js → hooks-CSfRJCjt.js} +6 -6
  99. package/dist/client/assets/image-field-BdcHkDRx.js +1 -0
  100. package/dist/client/assets/{import-from-deco-dialog-BVpWCCC9.js → import-from-deco-dialog-Bz8FE0_9.js} +2 -2
  101. package/dist/client/assets/{index-CqHy6432.js → index-7a12TwCl.js} +10 -10
  102. package/dist/client/assets/{index-BBz_54sx.js → index-B4I34F6K.js} +1 -1
  103. package/dist/client/assets/{index-CszBxeF9.js → index-BFeGPSf0.js} +1 -1
  104. package/dist/client/assets/{index-BwhwNs2D.js → index-BK1jVztm.js} +4 -4
  105. package/dist/client/assets/{index-CE8AoMpS.js → index-BPuJ390n.js} +1 -1
  106. package/dist/client/assets/{index-DexxTctJ.js → index-BRnQ22g3.js} +1 -1
  107. package/dist/client/assets/index-B_6khNsr.js +1 -0
  108. package/dist/client/assets/{index-xsAZnQ1t.js → index-BsWl8UuV.js} +1 -1
  109. package/dist/client/assets/index-C9uGIJ2-.js +1 -0
  110. package/dist/client/assets/{index-BY2TC4bG.js → index-CGoh8mx2.js} +2 -2
  111. package/dist/client/assets/{index-C3Ab2DJ2.js → index-D0U_smqt.js} +29 -29
  112. package/dist/client/assets/{index-BQXvSs-s.js → index-DHLJyA5u.js} +3 -3
  113. package/dist/client/assets/{index-C4w1u5Cz.js → index-D_UY8Zf9.js} +1 -1
  114. package/dist/client/assets/{index-WHuW26DU.js → index-DvTimAjS.js} +12 -12
  115. package/dist/client/assets/{index-redirect-DHc9uFFV.js → index-redirect-CPy0Z1T_.js} +1 -1
  116. package/dist/client/assets/{input-BmmiCY6T.js → input-Ccm3ShdT.js} +1 -1
  117. package/dist/client/assets/{integration-icon-CFvT6ZpF.js → integration-icon-BjRqMG3n.js} +1 -1
  118. package/dist/client/assets/label-KRKjsQLR.js +1 -0
  119. package/dist/client/assets/login-B5WUG2bv.js +1 -0
  120. package/dist/client/assets/{mcp-oauth-BGmk7Mi5.js → mcp-oauth-Ccqa98JF.js} +1 -1
  121. package/dist/client/assets/{members-DO2LVAyy.js → members-BwXKPt6c.js} +2 -2
  122. package/dist/client/assets/{monaco-editor-yw8USVwR.js → monaco-editor-DztiaMte.js} +1 -1
  123. package/dist/client/assets/{monitoring-stats-row-BuR-EBQ0.js → monitoring-stats-row-DY_Jk7Qu.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-wtZvQiOu.js → oauth-callback-B5Sy5Cax.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-17H-B-SW.js → oauth-callback-ai-provider-DFLSFrMH.js} +1 -1
  126. package/dist/client/assets/onboarding-tnqH6jke.js +1 -0
  127. package/dist/client/assets/{org-install-e7rNwps-.js → org-install-CMfEhUPU.js} +1 -1
  128. package/dist/client/assets/org-layout-DWTGapvu.js +1 -0
  129. package/dist/client/assets/organization-choice-BhcilQzG.js +1 -0
  130. package/dist/client/assets/{page-seo-form-BgMsVAcV.js → page-seo-form-CworrxTj.js} +1 -1
  131. package/dist/client/assets/page-seo-sheet-CU9OHYe8.js +1 -0
  132. package/dist/client/assets/popover-CQIMDVug.js +1 -0
  133. package/dist/client/assets/post-editor-BgM1RATm.js +1 -0
  134. package/dist/client/assets/preview-dialog-CJENsRWm.js +5 -0
  135. package/dist/client/assets/{primitives-BcfJna5s.js → primitives-qIzOEfAk.js} +1 -1
  136. package/dist/client/assets/profile-B0-E7bKd.js +1 -0
  137. package/dist/client/assets/project-app-view-CMI1MfV-.js +1 -0
  138. package/dist/client/assets/record-editor-DGdCVdoZ.js +1 -0
  139. package/dist/client/assets/registry-D-K5v381.js +2 -0
  140. package/dist/client/assets/{registry-layout-t_GwGR-W.js → registry-layout-Cy0i7eVL.js} +4 -4
  141. package/dist/client/assets/require-capability-D9TOSbgf.js +1 -0
  142. package/dist/client/assets/required-auth-layout-D9FVCOQl.js +1 -0
  143. package/dist/client/assets/{reset-password-CPoVJQh2.js → reset-password-m90-iQba.js} +1 -1
  144. package/dist/client/assets/roles-m5faIEUW.js +1 -0
  145. package/dist/client/assets/save-referenced-block-CtS93Zrw.js +1 -0
  146. package/dist/client/assets/save-status-Dr27404A.js +1 -0
  147. package/dist/client/assets/{schema-form-D8_e7uDj.js → schema-form-Bpex2GV2.js} +1 -1
  148. package/dist/client/assets/{scroll-area-DwqNfKe5.js → scroll-area-DbztbmuO.js} +7 -7
  149. package/dist/client/assets/{search-input-DjHO_xeh.js → search-input-C742tJr8.js} +1 -1
  150. package/dist/client/assets/secrets-DbY4hLUu.js +1 -0
  151. package/dist/client/assets/{sections-editor-D8YHUjur.js → sections-editor-DJuNcR6f.js} +2 -2
  152. package/dist/client/assets/select-COSJe-70.js +1 -0
  153. package/dist/client/assets/{select-model-4ZBcZdkE.js → select-model-Cv_gN_vr.js} +1 -1
  154. package/dist/client/assets/seo-editor-ynZ80zTU.js +1 -0
  155. package/dist/client/assets/settings-layout-D5cpx9f5.js +1 -0
  156. package/dist/client/assets/{settings-section-Dxa_AxFP.js → settings-section-C-zTpCRT.js} +1 -1
  157. package/dist/client/assets/{sheet-COdJ-0Qy.js → sheet-CuyenB5M.js} +1 -1
  158. package/dist/client/assets/shell-controls-fwD6Be98.js +1 -0
  159. package/dist/client/assets/shell-layout-BhblvLd4.js +1 -0
  160. package/dist/client/assets/shell-route-loading-ClsKn-Oj.js +1 -0
  161. package/dist/client/assets/{sidebar-DCgpgzJu.js → sidebar-BYFEz6-7.js} +1 -1
  162. package/dist/client/assets/skeleton-DHas8e4O.js +1 -0
  163. package/dist/client/assets/{sortable.esm-LmSoSdxy.js → sortable.esm-CtBH0PGw.js} +1 -1
  164. package/dist/client/assets/sso-BFO9vLZv.js +1 -0
  165. package/dist/client/assets/{store-Dj11zgxF.js → store-C9F0E0yc.js} +1 -1
  166. package/dist/client/assets/store-registry-D8kCyVob.js +2 -0
  167. package/dist/client/assets/studio-tools-DO12gBMa.js +1 -0
  168. package/dist/client/assets/switch-By8vCxNg.js +1 -0
  169. package/dist/client/assets/table-BgkbBxMz.js +1 -0
  170. package/dist/client/assets/{tabs-BcUIMPwc.js → tabs-DPoZSyfS.js} +1 -1
  171. package/dist/client/assets/{task-status-BfQltC__.js → task-status-D9k3BLzM.js} +1 -1
  172. package/dist/client/assets/textarea-DQwh6y_K.js +1 -0
  173. package/dist/client/assets/{toggle-group-Cp4C3_lM.js → toggle-group-CW5GRzAp.js} +1 -1
  174. package/dist/client/assets/{toolbar-DyjTkAru.js → toolbar-1QmqWl6-.js} +1 -1
  175. package/dist/client/assets/tooltip-DO1R3Vmb.js +1 -0
  176. package/dist/client/assets/{types-7ak1Ve40.js → types-pBNKtzBp.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-CC3uGtbf.js → use-ai-providers-qobt2OiH.js} +1 -1
  178. package/dist/client/assets/{use-automations-D2hKtMe8.js → use-automations-BwoNV2me.js} +1 -1
  179. package/dist/client/assets/use-capability-C09ZF9_G.js +1 -0
  180. package/dist/client/assets/{use-clock-tick-SbPzFjh0.js → use-clock-tick-_1lW4UqP.js} +1 -1
  181. package/dist/client/assets/{use-collections-DrlB7sAG.js → use-collections-DRgt6Bb8.js} +1 -1
  182. package/dist/client/assets/use-connection-XfA-QrSw.js +1 -0
  183. package/dist/client/assets/use-copy-DyplBFAe.js +1 -0
  184. package/dist/client/assets/use-create-virtual-mcp-BJFWHgGz.js +1 -0
  185. package/dist/client/assets/{use-debounced-autosave-C4B5942u.js → use-debounced-autosave-DqciCJ__.js} +1 -1
  186. package/dist/client/assets/use-deco-credits-CyoNix9p.js +1 -0
  187. package/dist/client/assets/{use-delete-connection-C_lUSAxo.js → use-delete-connection-CweyK7E_.js} +1 -1
  188. package/dist/client/assets/use-file-configs-OLHA7dwa.js +1 -0
  189. package/dist/client/assets/{use-infinite-scroll-CaTJY2LS.js → use-infinite-scroll-BbUZw7ju.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-Bf6--Yng.js → use-join-requests-CHh2Zrhx.js} +1 -1
  191. package/dist/client/assets/use-mcp-client-DilmxmKU.js +10 -0
  192. package/dist/client/assets/{use-mcp-prompts-5xEBY9_7.js → use-mcp-prompts-D2ueJ3CD.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-CYtQa-6Z.js → use-mcp-tools-uucJgbkt.js} +1 -1
  194. package/dist/client/assets/{use-members-BWyLHt4a.js → use-members-Y5iRty7v.js} +1 -1
  195. package/dist/client/assets/use-navigate-to-agent-HvaD8xDj.js +1 -0
  196. package/dist/client/assets/{use-org-auth-client-Blpkj8FB.js → use-org-auth-client-Dl_7zTlg.js} +1 -1
  197. package/dist/client/assets/{use-org-sso-CEQ82hSZ.js → use-org-sso-9Z0u5sV3.js} +1 -1
  198. package/dist/client/assets/{use-organization-roles-lBgqu0F4.js → use-organization-roles-C8kGFpoE.js} +1 -1
  199. package/dist/client/assets/use-organization-settings-B5vS3xHV.js +1 -0
  200. package/dist/client/assets/{use-registry-connections-CK9xDmAR.js → use-registry-connections-DhFpf503.js} +1 -1
  201. package/dist/client/assets/use-secrets-DtlQfYRK.js +1 -0
  202. package/dist/client/assets/{use-status-sounds-C5Tq4YPI.js → use-status-sounds-BSqGti4P.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-Dz9A7efZ.js → use-view-mode-Cc4A86jX.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-Bc7GdFZa.js → use-virtual-mcp-cixi9WNo.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-C4arjVN1.js +1 -0
  206. package/dist/client/assets/useSuspenseInfiniteQuery-DTlBviqw.js +1 -0
  207. package/dist/client/assets/variant-calendar-BtDF6xbX.js +1 -0
  208. package/dist/client/assets/view-mode-toggle-BNmCyKXO.js +1 -0
  209. package/dist/client/index.html +1 -1
  210. package/dist/server/cli.js +509 -506
  211. package/dist/server/server.js +318 -318
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronUp-CiXMtnii.js +0 -1
  214. package/dist/client/assets/XCircle-DRGwo6Em.js +0 -1
  215. package/dist/client/assets/add-section-modal-CwlL6ayr.js +0 -1
  216. package/dist/client/assets/agent-icon-D5EbntAT.js +0 -1
  217. package/dist/client/assets/agents-list-DOj0Fh6v.js +0 -1
  218. package/dist/client/assets/ai-providers-D2FalLjO.js +0 -1
  219. package/dist/client/assets/app-editor-DH47BAx3.js +0 -1
  220. package/dist/client/assets/automations-C8R4Fvhm.js +0 -1
  221. package/dist/client/assets/buckets-BNXQ-vfY.js +0 -1
  222. package/dist/client/assets/category-editor-511TL03p.js +0 -1
  223. package/dist/client/assets/chat-context-BNtznWGC.js +0 -21
  224. package/dist/client/assets/checkbox-I3IyJWnj.js +0 -1
  225. package/dist/client/assets/collection-detail-CqdkHGGR.js +0 -1
  226. package/dist/client/assets/collection-display-button-C3NMWQ0u.js +0 -1
  227. package/dist/client/assets/connect-desktop-dialog-BgIjMJ8k.js +0 -1
  228. package/dist/client/assets/connection-detail-BljhUTi8.js +0 -1
  229. package/dist/client/assets/connections-BxfE7CNZ.js +0 -1
  230. package/dist/client/assets/context-menu-CUB1yHM7.js +0 -1
  231. package/dist/client/assets/decopilot-sse-pool-BkzSWgw-.js +0 -1
  232. package/dist/client/assets/dialog-CyIn0DRx.js +0 -1
  233. package/dist/client/assets/drawer-DFg9xgM4.js +0 -1
  234. package/dist/client/assets/dropdown-menu-kPcoeCiJ.js +0 -1
  235. package/dist/client/assets/file-explorer-DqjZVlFC.js +0 -2
  236. package/dist/client/assets/general-DiEcrxnP.js +0 -1
  237. package/dist/client/assets/image-field-CodUWKZv.js +0 -1
  238. package/dist/client/assets/index-CE5zniob.js +0 -1
  239. package/dist/client/assets/index-DCOB_mfs.js +0 -1
  240. package/dist/client/assets/label-DitP_QKf.js +0 -1
  241. package/dist/client/assets/login-B5Epw0z9.js +0 -1
  242. package/dist/client/assets/onboarding-BoQhKI2i.js +0 -1
  243. package/dist/client/assets/org-layout-BMfkaVCj.js +0 -1
  244. package/dist/client/assets/page-seo-sheet-DeiY4L_a.js +0 -1
  245. package/dist/client/assets/popover-BcAFMnrn.js +0 -1
  246. package/dist/client/assets/post-editor-B7uc8ZWG.js +0 -1
  247. package/dist/client/assets/preview-dialog-CWq_MXwm.js +0 -5
  248. package/dist/client/assets/profile-D0fa1gEu.js +0 -1
  249. package/dist/client/assets/project-app-view-CXpwRwLv.js +0 -1
  250. package/dist/client/assets/record-editor-Ct33qGpE.js +0 -1
  251. package/dist/client/assets/registry-BIqKm9sP.js +0 -2
  252. package/dist/client/assets/require-capability-CoJVffIR.js +0 -1
  253. package/dist/client/assets/required-auth-layout-B3CS-pLH.js +0 -1
  254. package/dist/client/assets/roles-Kqs8iopc.js +0 -1
  255. package/dist/client/assets/save-referenced-block-rb2uyE9z.js +0 -1
  256. package/dist/client/assets/save-status-C9PbQUEN.js +0 -1
  257. package/dist/client/assets/secrets-Dlj_raMe.js +0 -1
  258. package/dist/client/assets/select-Di6xzzYo.js +0 -1
  259. package/dist/client/assets/seo-editor-C9cdDir2.js +0 -1
  260. package/dist/client/assets/settings-layout-DR15Rbl6.js +0 -1
  261. package/dist/client/assets/shell-controls-Cw8j2a_F.js +0 -1
  262. package/dist/client/assets/shell-layout-DmxTk-Cg.js +0 -1
  263. package/dist/client/assets/shell-route-loading-DW_liPbt.js +0 -1
  264. package/dist/client/assets/skeleton-CZ9pOveV.js +0 -1
  265. package/dist/client/assets/sso-BJQWPrvg.js +0 -1
  266. package/dist/client/assets/store-registry-BXdj_bIJ.js +0 -2
  267. package/dist/client/assets/studio-tools-DRut7Wwk.js +0 -1
  268. package/dist/client/assets/switch-sHkW6RUp.js +0 -1
  269. package/dist/client/assets/table-BUxYcsuG.js +0 -1
  270. package/dist/client/assets/textarea-D8B22gmM.js +0 -1
  271. package/dist/client/assets/tooltip-2IhfImXT.js +0 -1
  272. package/dist/client/assets/use-capability-CU6DCnG3.js +0 -1
  273. package/dist/client/assets/use-connection-Dffadu_t.js +0 -1
  274. package/dist/client/assets/use-copy-Btaqep1K.js +0 -1
  275. package/dist/client/assets/use-create-virtual-mcp-D6wTKoFC.js +0 -1
  276. package/dist/client/assets/use-deco-credits-16Jb7c03.js +0 -1
  277. package/dist/client/assets/use-file-configs-qOKR17qO.js +0 -1
  278. package/dist/client/assets/use-mcp-client-BdKIOTso.js +0 -10
  279. package/dist/client/assets/use-navigate-to-agent-BTMo9com.js +0 -1
  280. package/dist/client/assets/use-organization-settings--a-kmsBC.js +0 -1
  281. package/dist/client/assets/use-secrets-B008jqWi.js +0 -1
  282. package/dist/client/assets/useInfiniteQuery-Ca6dlOLl.js +0 -1
  283. package/dist/client/assets/useRouterState-DgLuS94C.js +0 -1
  284. package/dist/client/assets/useSuspenseInfiniteQuery-CZbIaY66.js +0 -1
  285. package/dist/client/assets/variant-calendar-DgzKgoL6.js +0 -1
  286. package/dist/client/assets/view-mode-toggle-Cc6sYskX.js +0 -1
@@ -1,10 +0,0 @@
1
- import{d3 as de,d4 as he,d5 as fe,cc as pe,d6 as me,bR as m,bS as w,d7 as _e,d8 as ge,d9 as we,da as A,db as Te,dc as j,dd as ye,de as q,df as ke,dg as F,dh as ve,di as Se,dj as Ce,dk as z,bw as be,bz as Re,bd as Ie,c7 as ee,cj as Ee,cp as qe,cn as Pe,cT as $e,dl as Ae,dm as Me,dn as M,dp as Oe,dq as He,co as Ne,ck as xe,cl as De,cm as Ue,bt as je,dr as Fe,ds as Le,dt as Ve,ce as We,du as ze,dv as Qe,dw as Ge,bs as x,e as te,a5 as se,aI as V}from"./index-C3Ab2DJ2.js";import{U as P,a as O,e as Q}from"./auth-tkqpBHf1.js";function N(a){return!!a._zod}function b(a,e){return N(a)?de(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(N(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Je(a){if(N(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 G(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Je(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function J(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Be{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(he,t=>{this._oncancel(t)}),this.setNotificationHandler(fe,t=>{this._onprogress(t)}),this.setRequestHandler(pe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(me,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(_e,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 h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} 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 m(w.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(ge,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 m(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(w.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 m(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(w.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),m.fromError(w.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),A(o)||Te(o)?this._onresponse(o):j(o)?this._onrequest(o,n):ye(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=m.fromError(w.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:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ke(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 h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...f,relatedRequestId:e.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const y=g.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},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 h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).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),A(e))s(e);else{const n=new m(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(A(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),A(e))r(e);else{const n=m.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 m?n:new m(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,F,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(w.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 m(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(w.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 m?n:new m(w.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 h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=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(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ke,k=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(g,{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},ve,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},Se,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ce,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=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=J(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=G(e);this._notificationHandlers.set(s,r=>{const o=J(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"&&j(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(w.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 m(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(w.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 m(w.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=z.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 m(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(w.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=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(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];K(n)&&K(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Re();const Xe=be(Ze);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ie(a),a}class tt{constructor(e){this._ajv=e??et()}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 st{constructor(e){this._client=e}async*callToolStream(e,t=ee,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 m(w.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 m(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(w.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 rt(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 at(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 H(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&&H(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&H(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&H(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 nt=class extends Be{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 tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ee,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",qe,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Pe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(N(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(Le,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:g}=ot(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new m(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Ve,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{H(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(We,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(F,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(w.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?ze:Qe,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid sampling result: ${k}`)}return T.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:$e,capabilities:this._capabilities,clientInfo:this._clientInfo}},Ae,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.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){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},M,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Oe,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},M,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ne,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},De,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ue,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},M,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},M,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(w.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 m(w.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 m(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(w.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},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.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 h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);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 bt={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`},it="self";function ae(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function ct(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null},pinned:!1,connections:[]}}const oe=ae("decopilot_"),Rt=oe.is,lt=oe.get,ne=ae("dev_"),It=ne.get,Et=ne.is;function qt(a){return ct({id:lt(a),organizationId:a,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const Pt={AGENT_MANAGER:a=>`studio-agent-manager_${a}`,AUTOMATION_MANAGER:a=>`studio-automation-manager_${a}`,CONNECTION_MANAGER:a=>`studio-connection-manager_${a}`,STORE_MANAGER:a=>`studio-store-manager_${a}`,BRAND_MANAGER:a=>`studio-brand-manager_${a}`,USAGE_MANAGER:a=>`studio-usage-manager_${a}`};function $t(a){return a?a.startsWith("studio-agent-manager_")||a.startsWith("studio-automation-manager_")||a.startsWith("studio-connection-manager_")||a.startsWith("studio-store-manager_")||a.startsWith("studio-brand-manager_")||a.startsWith("studio-usage-manager_"):!1}const D=a=>[{type:"text",text:a}];function ut(a){const e=a.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl 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(h){const f=h instanceof Error?h.message:"Network error";return{content:D(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:D(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:D(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 L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function dt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B 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,ht=13,I=32;function U(a){}function ft(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=U,onError:t=U,onRetry:s=U,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
2
- `)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
- `,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=_+1,_=d.indexOf(`
4
- `,c);continue}const v=d.charCodeAt(c);if(Z(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(p===0&&d.charCodeAt(_+1)===Y){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
5
- `,c);continue}u=p===0?C:`${u}
6
- ${C}`,p++}else X(d,c,v)?l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0:g(d,c,_);c=_+1,_=d.indexOf(`
7
- `,c)}return d.slice(c)}for(;c<d.length;){const _=d.indexOf("\r",c),v=d.indexOf(`
8
- `,c);let S=-1;if(_!==-1&&v!==-1?S=_<v?_:v:_!==-1?_===d.length-1?S=-1:S=_:v!==-1&&(S=v),S===-1)break;g(d,c,S),c=S+1,d.charCodeAt(c-1)===ht&&d.charCodeAt(c)===Y&&c++}return d.slice(c)}function g(d,c,_){if(c===_){T();return}const v=d.charCodeAt(c);if(Z(d,c,v)){const E=d.charCodeAt(c+5)===I?c+6:c+5,W=d.slice(E,_);u=p===0?W:`${u}
9
- ${W}`,p++;return}if(X(d,c,v)){l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0;return}if(v===105&&d.charCodeAt(c+1)===100&&d.charCodeAt(c+2)===58){const E=d.slice(d.charCodeAt(c+3)===I?c+4:c+3,_);i=E.includes("\0")?void 0:E;return}if(v===58){if(r){const E=d.slice(c,_);r(E.slice(d.charCodeAt(c+1)===I?2:1))}return}const S=d.slice(c,_),C=S.indexOf(":");if(C===-1){y(S,"",S);return}const ce=S.slice(0,C),le=S.charCodeAt(C+1)===I?2:1,ue=S.slice(C+le);y(ce,ue,S)}function y(d,c,_){switch(d){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 B(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:_}));break;default:t(new B(`Unknown field "${d.length>20?`${d.slice(0,20)}…`:d}"`,{type:"unknown-field",field:d,value:c,line:_}));break}}function T(){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0}function k(d={}){if(d.consume&&o.length>0){const c=o.join("");g(c,0,c.length)}n=!0,i=void 0,u="",p=0,l=void 0,o.length=0}return{feed:h,reset:k}}function Z(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 X(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 pt extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(o){r=ft({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 mt={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let _t=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=dt(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??mt}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await O(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=L(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 pt({onRetry:g=>{this._serverRetryMs=g}})).getReader();for(;;){const{value:g,done:y}=await l.read();if(y)break;if(g.id&&(n=g.id,i=!0,r?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{const T=x.parse(JSON.parse(g.data));A(T)&&(u=!0,o!==void 0&&(T.id=o)),this.onmessage?.(T)}catch(T){this.onerror?.(T)}}(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(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}})()}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 O(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:j(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:g,scope:y}=Q(i);if(this._resourceMetadataUrl=g,this._scope=y,await O(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:g,scope:y,error:T}=Q(i);if(T==="insufficient_scope"){const k=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===k)throw new $(403,"Server returned 403 after trying upscoping");if(y&&(this._scope=y),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=k??void 0,await O(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(),Ge(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,h=i.headers.get("content-type");if(l)if(h?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(h?.includes("application/json")){const f=await i.json(),g=Array.isArray(f)?f.map(y=>x.parse(y)):[x.parse(f)];for(const y of g)this.onmessage?.(y)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${h}`);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 gt extends _t{constructor(e,t){super(e,t)}send(e,t){const s=wt(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function wt(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:"mesh-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 Tt={name:"mesh-sdk",version:"1.0.0"};function yt(a,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either meshUrl option or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,o=a?`${r}/mcp/${a}`:`${r}/mcp`;return new URL(o,s).href}async function ie({connectionId:a,orgId:e,orgSlug:t,token:s,meshUrl:r,mcpUrl:o}){const n=V.mcpClient(e,a??"self",s??"",o??r??"");if(!o&&(!a||a===it))return ut({orgSlug:t,token:s,meshUrl:r,toJSONString:`mcp-client:${n.join(":")}`});const i=o??yt(a,t,r),u=new nt(Tt,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),p=new gt(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await u.connect(p),u.toJSON=()=>`mcp-client:${n.join(":")}`,u}function kt(a){const{connectionId:e,token:t,meshUrl:s,mcpUrl:r,orgId:o}=a;return{queryKey:V.mcpClient(o,e??"self",t??"",r??s??""),queryFn:()=>ie(a),staleTime:1/0,gcTime:6e4}}function Mt(a){const e=te.c(2);let t;e[0]!==a?(t=kt(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=se(t);return s}function Ot(a){const e=te.c(16),{connectionId:t,orgId:s,orgSlug:r,token:o,meshUrl:n,mcpUrl:i}=a;let u;e[0]!==t||e[1]!==i||e[2]!==n||e[3]!==s||e[4]!==o?(u=t!==void 0?V.mcpClient(s,t??"self",o??"",i??n??""):["mcp","client","skip",s],e[0]=t,e[1]=i,e[2]=n,e[3]=s,e[4]=o,e[5]=u):u=e[5];const p=u;let l;e[6]!==t||e[7]!==i||e[8]!==n||e[9]!==s||e[10]!==r||e[11]!==o?(l=async()=>t===void 0?null:ie({connectionId:t,orgId:s,orgSlug:r,token:o,meshUrl:n,mcpUrl:i}),e[6]=t,e[7]=i,e[8]=n,e[9]=s,e[10]=r,e[11]=o,e[12]=l):l=e[12];let h;e[13]!==p||e[14]!==l?(h={queryKey:p,queryFn:l,staleTime:1/0,gcTime:6e4},e[13]=p,e[14]=l,e[15]=h):h=e[15];const{data:f}=se(h);return f??null}export{Xe as A,nt as C,Be as P,it as S,bt as W,It as a,Ot as b,Pt as c,ie as d,ft as e,dt as f,qt as g,_t as h,Rt as i,$t as j,lt as k,kt as m,L as n,Et as p,Mt as u};
@@ -1 +0,0 @@
1
- import{a2 as v,r as f,e as C,j,f as D,p as M,b as N}from"./index-C3Ab2DJ2.js";import{u as F}from"./use-virtual-mcp-Bc7GdFZa.js";const h="__tool_call_runs__",R=["requires_action","in_progress","failed","expired","completed"];function tt(t){const e=new Map(R.map(r=>[r,[]]));for(const r of t){const n=r.status??"completed";(e.get(n)??e.get("completed")).push(r)}return R.map(r=>({status:r,threads:e.get(r)}))}function et(t,e){const r=new Map;for(const a of t){if(a.id.startsWith("thrd_welcome_"))continue;const u=a.virtual_mcp_id??h,d=r.get(u);d?(d.threads.push(a),(a.updated_at??"")>d.latestUpdatedAt&&(d.latestUpdatedAt=a.updated_at??"")):r.set(u,{virtualMcpId:u,threads:[a],latestUpdatedAt:a.updated_at??""})}const n=e!==null?r.get(e):void 0;n&&e&&r.delete(e);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((a,u)=>u.latestUpdatedAt.localeCompare(a.latestUpdatedAt)),i=[];return e&&i.push(n??{virtualMcpId:e,threads:[],latestUpdatedAt:""}),i.push(...o),s&&s.threads.length>0&&i.push(s),i}function rt(t,e){if(e.size===0)return t;const r=[],n=new Map;for(const s of t){const o=e.get(s.virtualMcpId);if(o){const a=n.get(o);if(a)a.threads=[...a.threads,...s.threads],s.latestUpdatedAt>a.latestUpdatedAt&&(a.latestUpdatedAt=s.latestUpdatedAt);else{const u={virtualMcpId:o,threads:[...s.threads],latestUpdatedAt:s.latestUpdatedAt};n.set(o,u),r.push(u)}continue}const i=n.get(s.virtualMcpId);if(i)i.threads=[...s.threads,...i.threads],s.latestUpdatedAt>i.latestUpdatedAt&&(i.latestUpdatedAt=s.latestUpdatedAt);else{const a={...s,threads:[...s.threads]};n.set(s.virtualMcpId,a),r.push(a)}}return r}const x=new Map,I=new Map;function P(t){return`${t.orgId}:${t.userId}`}function E(t){return`sidebar.group-order.${t}`}function O(t){try{const e=localStorage.getItem(t),r=e?JSON.parse(e):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function T(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function k(t){const e=P(t),r=x.get(e);if(r)return r;const n=v.sidebarGroupOrder(t.orgId,t.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&t.userId!=="anon"){const i=O(E(t.orgId));i.length>0&&(o=i)}return x.set(e,o),o}function p(t,e){const r=new Set(e);return k(t).filter(n=>!r.has(n))}function g(t,e){x.set(P(t),e),T(v.sidebarGroupOrder(t.orgId,t.userId),e)}function m(t){const e=I.get(t);if(e)return e;const r=O(v.sidebarOrgPinnedOrder(t));return I.set(t,r),r}function S(t,e){I.set(t,e),T(v.sidebarOrgPinnedOrder(t),e)}function nt(t,e){g(t,e)}function st(t,e){S(t,e)}function L(t,e){return t===e||t===h}function w(t,e){return e.includes(t)}function q(t,e){return t.map(r=>r.virtualMcpId).filter(r=>!L(r,e))}function ot(t,e,r,n){const s=new Set(n);return q(t,r).filter(o=>e==="org"?s.has(o):!s.has(o))}function B(t,e){const r=new Set(t),n=e.filter(s=>!r.has(s));return n.length===0?t:[...t,...n]}function at(t,e,r){const n=new Set(r),s=[],o=[];let i,a;for(const u of t){const d=u.virtualMcpId;if(e&&d===e){i=u;continue}if(d===h){a=u;continue}if(n.has(d)){s.push(u);continue}o.push(u)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:a}}function $(t,e,r,n=[],s=[]){const o=r?t.find(c=>c.virtualMcpId===r):void 0,i=t.find(c=>c.virtualMcpId===h),a=new Set(n),u=n.filter(c=>!L(c,r)),d=B(s,u),l=e.filter(c=>!a.has(c)),b=new Map(t.map(c=>[c.virtualMcpId,c])),A=c=>{const G=b.get(c);return G||{virtualMcpId:c,threads:[],latestUpdatedAt:""}},_=d.filter(c=>a.has(c)).map(A),K=l.map(A),U=[];return o&&U.push(o),U.push(..._,...K),i&&U.push(i),{groups:U,userOrder:l,orgOrder:_.map(c=>c.virtualMcpId)}}function J(t,e){const r=new Set(e);m(t.orgId).length===0&&e.length>0&&S(t.orgId,[...e]);const s=v.sidebarGroupOrder(t.orgId,t.userId);if(O(s).length>0)return;const o=O(E(t.orgId));if(o.length===0)return;const i=o.filter(a=>!r.has(a));g(t,i)}function Y(t,e){const r=new Set(e),n=k(t),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(t,s)}function it(t,e,r,n=[]){J(t,n),Y(t,n);const s=p(t,n),o=m(t.orgId),{userOrder:i,orgOrder:a}=$(e,s,r,n,o);(i.length!==s.length||i.some((u,d)=>u!==s[d]))&&g(t,i),(a.length!==o.length||a.some((u,d)=>u!==o[d]))&&S(t.orgId,a)}function ut(t,e,r,n=[]){const s=p(t,n),o=m(t.orgId);return $(e,s,r,n,o).groups}function dt(t,e,r){if(r){const o=p(t,[e]).filter(a=>a!==e);g(t,o);const i=m(t.orgId);i.includes(e)||S(t.orgId,[...i,e]);return}const n=m(t.orgId).filter(o=>o!==e);S(t.orgId,n);const s=p(t,[]);s.includes(e)||g(t,[...s,e])}function z(t,e,r=[]){if(r.includes(e))return;const n=p(t,r);n.includes(e)||g(t,[e,...n])}function ct(t,e,r=[]){const n=p(t,r),s=n.filter(o=>o!==e);s.length!==n.length&&g(t,s)}function lt(t,e,r){const n=t.indexOf(e),s=t.indexOf(r);if(n===-1||s===-1||n===s)return t;const o=[...t],[i]=o.splice(n,1);return i===void 0?t:(o.splice(s,0,i),o)}function ft(t,e,r,n){if(t==="org")return n;const s=p(e,r),o=new Set(n),i=s.filter(a=>!o.has(a));return[...n,...i]}function gt(t,e,r){const n=w(t,r),s=w(e,r);return n===s}const y=f.createContext(null);function pt(t){const e=C.c(7),{children:r}=t,[n,s]=f.useState(!1),[o,i]=f.useState(0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>i(W),e[0]=a):a=e[0];const u=a;let d;e[1]!==n||e[2]!==o?(d={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:u},e[1]=n,e[2]=o,e[3]=d):d=e[3];let l;return e[4]!==r||e[5]!==d?(l=j.jsx(y.Provider,{value:d,children:r}),e[4]=r,e[5]=d,e[6]=l):l=e[6],l}function W(t){return t+1}function ht(){return f.useContext(y)?.empty??!1}function Ot(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function mt(t){const{value:e}=t,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==e&&(r.setEmpty(e),s(e)),null}function X(t){return(t??[]).filter(e=>!!e.pinned).map(e=>e.id)}function St(){const t=C.c(9),e=D(),{org:r}=M(),n=F(),{data:s}=N.useSession(),o=s?.user?.id??"anon";let i;t[0]!==n?(i=X(n),t[0]=n,t[1]=i):i=t[1];const a=i,u=H();let d;return t[2]!==u||t[3]!==e||t[4]!==r.id||t[5]!==r.slug||t[6]!==a||t[7]!==o?(d=(l,b)=>{z({orgId:r.id,userId:o},l,a),u();const A=crypto.randomUUID();e({to:"/$org/$taskId",params:{org:r.slug,taskId:A},search:{...b?.search??{},virtualmcpid:l}})},t[2]=u,t[3]=e,t[4]=r.id,t[5]=r.slug,t[6]=a,t[7]=o,t[8]=d):d=t[8],d}export{mt as S,h as T,H as a,z as b,gt as c,ft as d,st as e,nt as f,X as g,it as h,ut as i,Ot as j,rt as k,et as l,St as m,tt as n,ct as o,at as p,dt as q,lt as r,ot as s,pt as t,ht as u};
@@ -1 +0,0 @@
1
- import{K as d,e as l,p as g,m as E,F as I,a as R,r as b}from"./index-C3Ab2DJ2.js";import{W as G}from"./use-mcp-client-BdKIOTso.js";import{c as M,u as Q}from"./studio-tools-DRut7Wwk.js";const N={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null},O={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function w(t,e){return{queryKey:d.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...N,organizationId:e}}},staleTime:6e4}}function h(t){const e=l.c(6),{org:s}=g();let n;e[0]!==s.id||e[1]!==s.slug?(n=w(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let r;return e[3]!==n||e[4]!==i?(r={...n,select:i},e[3]=n,e[4]=i,e[5]=r):r=e[5],E(r)}function H(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=w(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function S(){const t=l.c(9),{org:e}=g(),s=Q(),n=I();let i;t[0]!==e||t[1]!==s?(i=async u=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let r;t[3]!==e||t[4]!==n?(r=u=>{n.setQueryData(d.organizationSettings(e.id),o=>({...o??N,...u}))},t[3]=e,t[4]=n,t[5]=r):r=t[5];let a;return t[6]!==i||t[7]!==r?(a={mutationFn:i,onSuccess:r},t[6]=i,t[7]=r,t[8]=a):a=t[8],R(a)}function C(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:O}function W(){const{data:t}=h(P);return t??O}function P(t){return C(t.simple_mode)}function Z(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({simple_mode:r},a),n=(r,a)=>e.mutateAsync({simple_mode:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function $(){const{data:t}=h(x);return t??null}function x(t){return t.registry_config}function j(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({registry_config:r},a),n=(r,a)=>e.mutateAsync({registry_config:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function B(){const{data:t}=h(U);return t??null}function U(t){return t.default_home_agents}function k(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({default_home_agents:r},a),n=(r,a)=>e.mutateAsync({default_home_agents:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function L(){const t=l.c(14),{org:e}=g(),s=k(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const r=b.useRef(i);let a;t[1]!==e.id?(a=d.organizationSettings(e.id),t[1]=e.id,t[2]=a):a=t[2];const u=a;let o;t[3]!==u||t[4]!==n?(o=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=o):o=t[5];const _=o;let m;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=z=>{const T=r.current.then(async()=>{const A=n.getQueryData(u),p=z(A?.default_home_agents?.ids??[]);if(p!==null){n.setQueryData(u,c=>c&&{...c,default_home_agents:{ids:p}});try{await s.mutateAsync({ids:p}),await n.refetchQueries({queryKey:d.homeNextActions(e.slug),type:"active"})}catch(c){const D=c;throw n.setQueryData(u,A),D}}});return r.current=T.catch(q),T},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const y=m;let f;return t[11]!==y||t[12]!==_?(f={currentIds:_,apply:y},t[11]=y,t[12]=_,t[13]=f):f=t[13],f}function q(){}function v(){const t=l.c(5),{org:e}=g(),s=$();let n;t[0]!==e.id?(n=G.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let r;return t[2]!==i||t[3]!==s?(r=a=>{if(!s)return a===i;const u=s.registries[a];return u?u.enabled:a===i},t[2]=i,t[3]=s,t[4]=r):r=t[4],r}export{L as a,v as b,H as c,W as d,Z as e,$ as f,j as g,w as o,B as u};
@@ -1 +0,0 @@
1
- import{e as n,p as r,K as c,a5 as y,F as d,a as S}from"./index-C3Ab2DJ2.js";import{u as l}from"./studio-tools-DRut7Wwk.js";function p(){const e=n.c(7),{org:o}=r(),a=l();let i;e[0]!==o.id?(i=c.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:u}=y(s);return u.secrets}function C(){const e=n.c(8),{org:o}=r(),a=l(),i=d();let t;e[0]!==a?(t=async f=>await a.call("SECRET_CREATE",{...f}),e[0]=a,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:c.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let u;return e[5]!==t||e[6]!==s?(u={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=u):u=e[7],S(u)}export{C as a,p as u};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-CaTJY2LS.js";import{cH as i}from"./index-C3Ab2DJ2.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{bc as n,r as s,c1 as a,c2 as i}from"./index-C3Ab2DJ2.js";function f(r){const o=n({warn:r?.router===void 0}),t=r?.router||o,u=s.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const c=i(u.current,r.select(e));return u.current=c,c}return r.select(e)}return e})}export{f as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-CaTJY2LS.js";import{cH as u,az as n}from"./index-C3Ab2DJ2.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +0,0 @@
1
- import{e as R,r as K,j as a,c as W,B as O}from"./index-C3Ab2DJ2.js";import{P as Q,f as it}from"./agent-icon-D5EbntAT.js";import{n as at}from"./ChevronLeft-DXSAgzPw.js";import{i as lt}from"./ChevronRight-Dj41DV2U.js";import{S as X}from"./scroll-area-DwqNfKe5.js";import{T as ct,b as mt,a as pt}from"./tooltip-2IhfImXT.js";import{V as ft}from"./view-mode-toggle-Cc6sYskX.js";import"./AlertCircle-DMqR3m0L.js";import"./Tool01-B4SsemMS.js";import"./SwitchHorizontal01-yw5VS97V.js";import"./Settings02-B7hO-Tma.js";import"./XCircle-DRGwo6Em.js";import"./ArrowUpRight-DeYzuaJ8.js";import"./ZapSquare-C7yt7KfQ.js";import"./Users03-BOvyNEV4.js";import"./CheckCircle-D6b8lFUP.js";import"./ChevronUp-CiXMtnii.js";import"./ChevronDown-CYFvWHpZ.js";import"./DotsVertical-y5lMfVOQ.js";import"./Stars02-9vF61uFx.js";import"./Eye-D3THRXh6.js";import"./ZoomOut-DVSwpwUz.js";import"./Globe01-BquIL2vg.js";import"./FilterLines-BPeCeYIz.js";import"./Star01-BfSEPDRT.js";import"./Globe04-BBRZWdJY.js";import"./HardDrive-DmtpWveq.js";import"./Key01-Lcx9qTy7.js";import"./LayoutLeft-CkiSxkS_.js";import"./LinkExternal01-jwO28Eeb.js";import"./Monitor01-L6hrk62b.js";import"./Sun-BxuJFhF6.js";import"./Palette-ClNyQOQA.js";import"./Play-C6QgiUls.js";import"./Plus-_82_8sq8.js";import"./SearchMd-C3Pmxf99.js";import"./Shield01-RDE62wRx.js";import"./Stars01-W6Wl0Pse.js";import"./Trash01-CG0gTYx7.js";import"./Upload01-BlvGy5d-.js";import"./User01-CTuKNCEa.js";import"./Users01-KXiCgru2.js";import"./XClose-Ig7y9gcI.js";import"./X-CKIhVHQk.js";import"./Zap-w60sxAoc.js";import"./use-clock-tick-SbPzFjh0.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Btaqep1K.js";import"./file-type-icon-BOPDPlds.js";import"./dialog-CyIn0DRx.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-7ak1Ve40.js";import"./use-mcp-client-BdKIOTso.js";import"./auth-tkqpBHf1.js";import"./chat-context-BNtznWGC.js";import"./hooks-DLdyjUhZ.js";import"./decopilot-sse-pool-BkzSWgw-.js";import"./use-virtual-mcp-Bc7GdFZa.js";import"./use-collections-DrlB7sAG.js";import"./use-ai-providers-CC3uGtbf.js";import"./studio-tools-DRut7Wwk.js";import"./use-organization-settings--a-kmsBC.js";import"./shell-layout-DmxTk-Cg.js";import"./avatar-DfTXVgX9.js";import"./required-auth-layout-B3CS-pLH.js";import"./useRouterState-DgLuS94C.js";import"./use-org-sso-CEQ82hSZ.js";import"./sheet-COdJ-0Qy.js";import"./integration-icon-CFvT6ZpF.js";import"./use-navigate-to-agent-BTMo9com.js";import"./use-connection-Dffadu_t.js";import"./use-mcp-prompts-5xEBY9_7.js";import"./form-BZY9ZRz4.js";import"./label-DitP_QKf.js";import"./input-BmmiCY6T.js";import"./select-Di6xzzYo.js";const dt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),ut=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),ht=/\/flags\/multivariate\/[^/]+\.ts$/;function xt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function gt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e;if(typeof t!="string"||typeof r!="string")return null;const n=new Date(t),c=new Date(r);return Number.isNaN(n.getTime())||Number.isNaN(c.getTime())||c.getTime()<=n.getTime()?null:{start:n,end:c}}function Z(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(dt.has(r)){const n=gt(e);n&&t.push(n);return}if(ut.has(r)){const n=e.matchers;if(Array.isArray(n))for(const c of n)Z(c,t)}}}function bt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!ht.test(t))return!1;const r=e.variants;return Array.isArray(r)}function yt(e){if(typeof e=="string"){const i=e.trim();if(i.length===0)return null;try{const m=new URL(i).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return i.length>80?`${i.slice(0,77)}…`:i}if(!e||typeof e!="object")return null;const t=e,r=t.config,c=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,c?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const i of o)if(typeof i=="string"&&i.trim().length>0)return i.trim();const l=t.__resolveType;if(typeof l=="string"){const s=(l.split("/").pop()??l).replace(/\.(tsx?|jsx?)$/i,"");if(s.length>0)return s}return null}function vt(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function H(e,t,r,n,c){if(bt(e)){const o=vt(n),l=e.variants,i=e.__resolveType;l.forEach((s,m)=>{if(!s||typeof s!="object")return;const p=s,d=[];if(Z(p.rule,d),d.length===0)return;const x=yt(p.value)??(o||r);for(const g of d)c.push({blockKey:t,blockLabel:r,innerPath:o,variantIndex:m,start:g.start,end:g.end,label:x,flagResolveType:i})});for(let s=0;s<l.length;s++){const m=l[s];m&&typeof m=="object"&&H(m.value,t,r,[...n,"variants",s,"value"],c)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)H(e[o],t,r,[...n,o],c);return}if(e&&typeof e=="object")for(const[o,l]of Object.entries(e))o!=="__resolveType"&&H(l,t,r,[...n,o],c)}function Tt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))H(n,r,xt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function jt(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,c)=>{const o=c*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),r}const Nt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function tt(e,t){return e.get(t)??Nt}const kt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],et=["January","February","March","April","May","June","July","August","September","October","November","December"],wt=1440*60*1e3;function L(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function rt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function $(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function I(e,t){const r=new Date(e);return r.setDate(r.getDate()+t),r}function G(e,t){return Math.round((L(e).getTime()-L(t).getTime())/wt)}function _t(e){const t=I(e,-e.getDay()),r=[];for(let n=0;n<6;n++){const c=[];for(let o=0;o<7;o++)c.push(I(t,n*7+o));r.push(c)}for(;r.length>0&&r[r.length-1].every(n=>n.getMonth()!==e.getMonth());)r.pop();return r}function Mt(e,t){const r=L(e[0]),n=I(r,7),c=[];for(const i of t){const s=L(i.start),m=L(i.end);if(m.getTime()<r.getTime()||s.getTime()>=n.getTime())continue;const p=s.getTime()<r.getTime()?r:s,d=m.getTime()>=n.getTime()?I(n,-1):m,u=G(p,r),x=G(d,p)+1;x<=0||c.push({variant:i,startCol:u,span:x})}c.sort((i,s)=>i.startCol-s.startCol||s.span-i.span||i.variant.blockKey.localeCompare(s.variant.blockKey));const o=[],l=[];for(const i of c){let s=o.findIndex(m=>m<=i.startCol);s===-1&&(s=o.length,o.push(0)),o[s]=i.startCol+i.span,l.push({...i,lane:s})}return l}const U=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function St(e){return`${U.format(e.start)} → ${U.format(e.end)}`}function At(e){const t=R.c(17),{variant:r}=e;let n;t[0]!==r.blockLabel?(n=a.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=n):n=t[1];let c;t[2]!==r.innerPath?(c=r.innerPath&&a.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=c):c=t[3];let o;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(o=r.label!==r.blockLabel&&r.label!==r.innerPath&&a.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=o):o=t[7];let l;t[8]!==r?(l=St(r),t[8]=r,t[9]=l):l=t[9];let i;t[10]!==l?(i=a.jsx("div",{className:"mt-1",children:l}),t[10]=l,t[11]=i):i=t[11];let s;return t[12]!==n||t[13]!==c||t[14]!==o||t[15]!==i?(s=a.jsx(pt,{children:a.jsxs("div",{className:"text-xs",children:[n,c,o,i]})}),t[12]=n,t[13]=c,t[14]=o,t[15]=i,t[16]=s):s=t[16],s}function nt(e){const t=R.c(14),{variant:r,color:n,style:c,children:o}=e;let l;t[0]!==n.bg||t[1]!==n.text||t[2]!==c?(l={background:n.bg,color:n.text,borderRadius:4,...c},t[0]=n.bg,t[1]=n.text,t[2]=c,t[3]=l):l=t[3];let i;t[4]!==o?(i=a.jsx("span",{className:"truncate",children:o}),t[4]=o,t[5]=i):i=t[5];let s;t[6]!==l||t[7]!==i?(s=a.jsx(ct,{asChild:!0,children:a.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:l,children:i})}),t[6]=l,t[7]=i,t[8]=s):s=t[8];let m;t[9]!==r?(m=a.jsx(At,{variant:r}),t[9]=r,t[10]=m):m=t[10];let p;return t[11]!==s||t[12]!==m?(p=a.jsxs(mt,{children:[s,m]}),t[11]=s,t[12]=m,t[13]=p):p=t[13],p}function mr(e){const t=R.c(39),{decofile:r}=e,[n,c]=K.useState("calendar"),[o,l]=K.useState(Ct);let i,s;t[0]!==r?(s=Tt(r),i=jt(s.map(Et)),t[0]=r,t[1]=i,t[2]=s):(i=t[1],s=t[2]);const m=i;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(rt(new Date)),t[3]=p):p=t[3];const d=p;let u;t[4]!==n?(u=()=>l(k=>n==="calendar"?$(k,-1):$(k,-3)),t[4]=n,t[5]=u):u=t[5];const x=u;let g;t[6]!==n?(g=()=>l(k=>n==="calendar"?$(k,1):$(k,3)),t[6]=n,t[7]=g):g=t[7];const w=g;let N;t[8]===Symbol.for("react.memo_cache_sentinel")?(N=a.jsx(O,{variant:"outline",size:"sm",onClick:d,children:"Today"}),t[8]=N):N=t[8];let E;t[9]===Symbol.for("react.memo_cache_sentinel")?(E=a.jsx(at,{size:16}),t[9]=E):E=t[9];let _;t[10]!==x?(_=a.jsx(O,{variant:"ghost",size:"icon",className:"size-8",onClick:x,"aria-label":"Previous",children:E}),t[10]=x,t[11]=_):_=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(lt,{size:16}),t[12]=f):f=t[12];let b;t[13]!==w?(b=a.jsx(O,{variant:"ghost",size:"icon",className:"size-8",onClick:w,"aria-label":"Next",children:f}),t[13]=w,t[14]=b):b=t[14];const M=et[o.getMonth()];let y;t[15]!==o?(y=o.getFullYear(),t[15]=o,t[16]=y):y=t[16];let v;t[17]!==M||t[18]!==y?(v=a.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[M," ",y]}),t[17]=M,t[18]=y,t[19]=v):v=t[19];let T;t[20]!==v||t[21]!==_||t[22]!==b?(T=a.jsxs("div",{className:"flex items-center gap-2",children:[N,_,b,v]}),t[20]=v,t[21]=_,t[22]=b,t[23]=T):T=t[23];let C;t[24]===Symbol.for("react.memo_cache_sentinel")?(C={value:"calendar",icon:a.jsx(Q,{}),label:"Calendar"},t[24]=C):C=t[24];let j;t[25]===Symbol.for("react.memo_cache_sentinel")?(j=[C,{value:"timeline",icon:a.jsx(it,{}),label:"Timeline"}],t[25]=j):j=t[25];let h;t[26]!==n?(h=a.jsx(ft,{value:n,onValueChange:c,options:j}),t[26]=n,t[27]=h):h=t[27];let S;t[28]!==T||t[29]!==h?(S=a.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[T,h]}),t[28]=T,t[29]=h,t[30]=S):S=t[30];let A;t[31]!==m||t[32]!==o||t[33]!==s||t[34]!==n?(A=s.length===0?a.jsx(Dt,{}):n==="calendar"?a.jsx($t,{monthStart:o,variants:s,colorMap:m}):a.jsx(Vt,{monthStart:o,variants:s,colorMap:m}),t[31]=m,t[32]=o,t[33]=s,t[34]=n,t[35]=A):A=t[35];let D;return t[36]!==S||t[37]!==A?(D=a.jsxs("div",{className:"flex h-full w-full flex-col",children:[S,A]}),t[36]=S,t[37]=A,t[38]=D):D=t[38],D}function Et(e){return e.blockKey}function Ct(){return rt(new Date)}function Dt(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[a.jsx(Q,{size:24,className:"text-muted-foreground/60"}),a.jsx("div",{children:"No scheduled variants."}),a.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]}),e[0]=t):t=e[0],t}const z=20,J=2,q=28;function $t(e){const t=R.c(17),{monthStart:r,variants:n,colorMap:c}=e;let o,l,i,s,m;if(t[0]!==c||t[1]!==r||t[2]!==n){const u=_t(r),x=L(new Date);o=X,m="flex-1 min-h-0",l="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:kt.map(Rt)}),t[8]=i):i=t[8],s=u.map((g,w)=>{const N=Mt(g,n),E=N.reduce(Lt,0),_=q+E*(z+J)+8;return a.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:_},children:[g.map((f,b)=>{const M=f.getMonth()===r.getMonth(),y=f.getTime()===x.getTime();return a.jsx("div",{className:W("border-r last:border-r-0 px-2 pt-1.5 text-xs",M?"bg-background":"bg-muted/30 text-muted-foreground"),children:a.jsx("span",{className:W("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",y&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},b)}),N.map((f,b)=>{const M=tt(c,f.variant.blockKey),y=q+f.lane*(z+J),v=f.startCol/7*100,T=f.span/7*100;return a.jsxs(nt,{variant:f.variant,color:M,style:{top:y,left:`calc(${v}% + 2px)`,width:`calc(${T}% - 4px)`,height:z},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&a.jsxs("span",{className:"opacity-70",children:[" · ",f.variant.label]})]},`${w}-${b}`)})]},w)}),t[0]=c,t[1]=r,t[2]=n,t[3]=o,t[4]=l,t[5]=i,t[6]=s,t[7]=m}else o=t[3],l=t[4],i=t[5],s=t[6],m=t[7];let p;t[9]!==l||t[10]!==i||t[11]!==s?(p=a.jsxs("div",{className:l,children:[i,s]}),t[9]=l,t[10]=i,t[11]=s,t[12]=p):p=t[12];let d;return t[13]!==o||t[14]!==m||t[15]!==p?(d=a.jsx(o,{className:m,children:p}),t[13]=o,t[14]=m,t[15]=p,t[16]=d):d=t[16],d}function Lt(e,t){return Math.max(e,t.lane+1)}function Rt(e){return a.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const V=4,Pt=32,P=240;function Vt(e){const t=R.c(27),{monthStart:r,variants:n,colorMap:c}=e,o=r;let l,i,s,m,p,d;if(t[0]!==c||t[1]!==r||t[2]!==o||t[3]!==n){const g=$(r,V),w=new Date,N=new Map;for(const j of n){const h=N.get(j.blockKey)??[];h.push(j),N.set(j.blockKey,h)}const E=Array.from(N.entries()).sort(Ot),_=g.getTime()-o.getTime(),f=j=>(Math.max(o.getTime(),Math.min(g.getTime(),j.getTime()))-o.getTime())/_*100;let b;t[10]!==o?(b=(j,h)=>$(o,h),t[10]=o,t[11]=b):b=t[11];const M=Array.from({length:V},b),y=w.getTime()>=o.getTime()&&w.getTime()<=g.getTime()?f(w):null;l=X,d="flex-1 min-h-0",i="min-w-[900px] relative";let v;t[12]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:P},children:"Variant / Block"}),t[12]=v):v=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`},t[13]=T):T=t[13];const C=M.map(It);t[14]!==C?(s=a.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[v,a.jsx("div",{className:"flex-1 grid",style:T,children:C})]}),t[14]=C,t[15]=s):s=t[15],t[16]!==y?(m=y!==null&&a.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${P}px + (100% - ${P}px) * ${y} / 100)`},children:a.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:"Today"})}),t[16]=y,t[17]=m):m=t[17],p=E.map(j=>{const[h,S]=j,A=tt(c,h),D=S[0]?.blockLabel??h;return a.jsxs("div",{children:[a.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:a.jsx("div",{className:"px-3 truncate",style:{width:P},children:D})}),S.map((k,st)=>a.jsxs("div",{className:"flex border-b items-center",style:{height:Pt},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:P},children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:A.bg}}),a.jsx("span",{className:"truncate text-foreground/80",children:k.label})]}),a.jsxs("div",{className:"relative flex-1 h-full",children:[a.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`},children:M.map(Ht)}),(()=>{const B=Math.max(k.start.getTime(),o.getTime()),F=Math.min(k.end.getTime(),g.getTime());if(F<=B)return null;const Y=f(new Date(B)),ot=f(new Date(F))-Y;return a.jsx(nt,{variant:k,color:A,style:{top:"50%",transform:"translateY(-50%)",left:`${Y}%`,width:`calc(${ot}% - 2px)`,height:22},children:k.label})})()]})]},st))]},h)}),t[0]=c,t[1]=r,t[2]=o,t[3]=n,t[4]=l,t[5]=i,t[6]=s,t[7]=m,t[8]=p,t[9]=d}else l=t[4],i=t[5],s=t[6],m=t[7],p=t[8],d=t[9];let u;t[18]!==i||t[19]!==s||t[20]!==m||t[21]!==p?(u=a.jsxs("div",{className:i,children:[s,m,p]}),t[18]=i,t[19]=s,t[20]=m,t[21]=p,t[22]=u):u=t[22];let x;return t[23]!==l||t[24]!==d||t[25]!==u?(x=a.jsx(l,{className:d,children:u}),t[23]=l,t[24]=d,t[25]=u,t[26]=x):x=t[26],x}function Ht(e,t){return a.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function It(e,t){return a.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[et[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Ot(e,t){return e[0].localeCompare(t[0])}export{mr as VariantCalendar};
@@ -1 +0,0 @@
1
- import{e as k,r as C,c as x,j as i}from"./index-C3Ab2DJ2.js";import{b as I,T as P,a as L}from"./tooltip-2IhfImXT.js";const M={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function B(S){const e=k.c(27),{value:s,onValueChange:y,options:o,size:R,fullWidth:E,className:z}=S,V=R===void 0?"sm":R,u=E===void 0?!1:E;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],e[0]=b):b=e[0];const _=C.useRef(b);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g={left:0,width:0,opacity:0},e[1]=g):g=e[1];const[f,W]=C.useState(g);let h,p;e[2]!==o||e[3]!==s?(h=()=>{const t=o.findIndex(j=>j.value===s),m=_.current[t];m&&W({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],e[2]=o,e[3]=s,e[4]=h,e[5]=p):(h=e[4],p=e[5]),C.useEffect(h,p);const d=M[V];let n;e[6]!==z?(n=x("relative flex gap-0 bg-muted rounded-lg",z),e[6]=z,e[7]=n):n=e[7];let l;e[8]!==d||e[9]!==u||e[10]!==y||e[11]!==o||e[12]!==s?(l=o.map((t,m)=>{const j=i.jsxs("button",{ref:$=>{_.current[m]=$},type:"button",onClick:()=>y(t.value),className:x("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",u?"flex-1 h-12 px-4":d.button,!u&&t.label?"px-3":""),children:[i.jsx("span",{className:x("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",d.icon,s===t.value?"text-foreground":"text-muted-foreground"),children:t.icon}),t.label&&i.jsx("span",{className:x("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===t.value?"text-foreground":"text-muted-foreground"),children:t.label})]},t.value);return t.tooltip?i.jsxs(I,{children:[i.jsx(P,{asChild:!0,children:j}),i.jsx(L,{side:"bottom",children:t.tooltip})]},t.value):j}),e[8]=d,e[9]=u,e[10]=y,e[11]=o,e[12]=s,e[13]=l):l=e[13];const w=u?"h-12":d.button;let a;e[14]!==w?(a=x("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),e[14]=w,e[15]=a):a=e[15];const N=`${f.left}px`,T=`${f.width}px`;let r;e[16]!==f.opacity||e[17]!==N||e[18]!==T?(r={left:N,width:T,opacity:f.opacity},e[16]=f.opacity,e[17]=N,e[18]=T,e[19]=r):r=e[19];let c;e[20]!==a||e[21]!==r?(c=i.jsx("div",{className:a,style:r}),e[20]=a,e[21]=r,e[22]=c):c=e[22];let v;return e[23]!==c||e[24]!==n||e[25]!==l?(v=i.jsxs("div",{className:n,children:[l,c]}),e[23]=c,e[24]=n,e[25]=l,e[26]=v):v=e[26],v}export{B as V};