decocms 3.30.0 → 3.31.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 (246) hide show
  1. package/dist/client/assets/{AlertCircle-C2JPSNIc.js → AlertCircle-A2M1Yk61.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-Dtm-fMoi.js → ArrowUpRight-CjvxrowT.js} +1 -1
  3. package/dist/client/assets/{Check-CJuLJZRg.js → Check-Cl07asRj.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-B1gk6AbW.js → CheckCircle-Ck9u9W7w.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BbO00aHm.js → ChevronDown-Ce3UdjOo.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-CyC6kPhn.js → ChevronLeft-SeayBU0G.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-D4rmSZYg.js → ChevronRight-C8KzXj8H.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DC9Fz2he.js → ChevronUp-zA2iz0JQ.js} +1 -1
  9. package/dist/client/assets/{Container-Ck07PAMh.js → Container-B3y5dlGc.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DVI2JfBT.js → DotsVertical-_g_anHKb.js} +1 -1
  11. package/dist/client/assets/{Eye-8SpX7ax1.js → Eye-lcuSJE4l.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DXoB5fi6.js → FilterLines-EpjZnXUA.js} +1 -1
  13. package/dist/client/assets/{Globe01-_Gozs0-K.js → Globe01-CfZP4vCY.js} +1 -1
  14. package/dist/client/assets/{HardDrive-D6YFkngp.js → HardDrive-75MAycL-.js} +1 -1
  15. package/dist/client/assets/{Key01-DtPyr_d4.js → Key01-DyeMqFvi.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-zPlWqXYO.js → LayoutLeft-DwKLO_V_.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-CMKC3Ppc.js → LinkExternal01-r7kaLetr.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Dg9LYm9U.js → Monitor01-C_pzVd4h.js} +1 -1
  19. package/dist/client/assets/{Palette-DvOu8iad.js → Palette-DdA_ILd6.js} +1 -1
  20. package/dist/client/assets/{Play-BGgNLf1z.js → Play-CnkDDouZ.js} +1 -1
  21. package/dist/client/assets/{Plus-D3Yt_klI.js → Plus-Dx1SIiMT.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-De11YcWY.js → RefreshCcw01-C3I3Y9Tu.js} +1 -1
  23. package/dist/client/assets/{SearchMd-CkwYmYFX.js → SearchMd-DFhUmylG.js} +1 -1
  24. package/dist/client/assets/{Settings02-RkWi-oHt.js → Settings02-CWkfxXGQ.js} +1 -1
  25. package/dist/client/assets/{Shield01-BkzImfUK.js → Shield01-CbvWDrmE.js} +1 -1
  26. package/dist/client/assets/{Star01-CROTt7h-.js → Star01-DkpG4lGE.js} +1 -1
  27. package/dist/client/assets/{Stars01-BZ01dqEy.js → Stars01-CJ8FecuG.js} +1 -1
  28. package/dist/client/assets/{Stars02-Bb_Lb3Iw.js → Stars02-bH2-rrrk.js} +1 -1
  29. package/dist/client/assets/{Sun--jg0YyzU.js → Sun-CLmK6D64.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-uOesGvrj.js → SwitchHorizontal01-CDVzg25U.js} +1 -1
  31. package/dist/client/assets/{Tool01-CHRhaVsB.js → Tool01-Cm1sVqXs.js} +1 -1
  32. package/dist/client/assets/{Trash01-D9jT6VSX.js → Trash01-CA4jg9ww.js} +1 -1
  33. package/dist/client/assets/{Upload01-B6COGlQo.js → Upload01-BbVOBYlS.js} +1 -1
  34. package/dist/client/assets/{User01-CWJ4O2R8.js → User01-CMz2xYx2.js} +1 -1
  35. package/dist/client/assets/{Users01-Bsb338aB.js → Users01-DBOuOgB6.js} +1 -1
  36. package/dist/client/assets/{Users03-BZnIYCM1.js → Users03-DIxLvYmx.js} +1 -1
  37. package/dist/client/assets/{X-CH7nrxK3.js → X-8-D5pATw.js} +1 -1
  38. package/dist/client/assets/{XCircle-DSNLgcsz.js → XCircle-D0Uf6feY.js} +1 -1
  39. package/dist/client/assets/{XClose-B2Xxw9ZV.js → XClose-Cnj8fI9u.js} +1 -1
  40. package/dist/client/assets/{Zap-CtPT7vkQ.js → Zap-mYMK3ZBL.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-B7LKxpnQ.js → ZapSquare-qMfSZ8L9.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-BhGMK1ir.js → ZoomOut-aYAC7hBe.js} +1 -1
  43. package/dist/client/assets/{access-gate-CBfdxByI.js → access-gate-daLhvTar.js} +1 -1
  44. package/dist/client/assets/{accordion-CMUFrLXB.js → accordion-Cm248afD.js} +1 -1
  45. package/dist/client/assets/add-section-modal-BEtlbcy-.js +1 -0
  46. package/dist/client/assets/{agent-capabilities-v4Rwjpb1.js → agent-capabilities-CFuGvMed.js} +1 -1
  47. package/dist/client/assets/{agent-icon-BL0Zyuef.js → agent-icon-cetEWq0Z.js} +1 -1
  48. package/dist/client/assets/{agent-icons-AMlXFz_9.js → agent-icons-CK-xDflz.js} +1 -1
  49. package/dist/client/assets/{agents-list-D6JCtAI6.js → agents-list-Da1iRt5l.js} +1 -1
  50. package/dist/client/assets/ai-providers-BJhgs18P.js +1 -0
  51. package/dist/client/assets/{alert-Br2JNJoK.js → alert-BBTJrkK5.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-DzLqwXYd.js → alert-dialog-DokKbPq-.js} +1 -1
  53. package/dist/client/assets/app-editor-DqK_iwlT.js +1 -0
  54. package/dist/client/assets/{auth-catchall-Bh2wbrjs.js → auth-catchall-CVFro2W9.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CKbPPfx6.js → auth-split-layout-Bsctr1_-.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-6z14sJQm.js → automation-list-row-D23Bvwkx.js} +1 -1
  57. package/dist/client/assets/{automation-runs-DAMwdbwt.js → automation-runs-BMMJyRtq.js} +1 -1
  58. package/dist/client/assets/{automations-oTAQWsS7.js → automations-DoosX3yK.js} +1 -1
  59. package/dist/client/assets/{avatar-BL6j7EM4.js → avatar-Bg8Fajzf.js} +1 -1
  60. package/dist/client/assets/{badge-Cc4XouWa.js → badge-CWyTrVve.js} +1 -1
  61. package/dist/client/assets/{brand-context-BCHQoNph.js → brand-context-D5dCbA6y.js} +1 -1
  62. package/dist/client/assets/{buckets-CLBLkzZh.js → buckets-C3jVEHjb.js} +1 -1
  63. package/dist/client/assets/{calendar-DXmim9-f.js → calendar-D2buY6we.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-S5ghjE3y.js → capability-load-error-Co02--jW.js} +1 -1
  65. package/dist/client/assets/{card-OOIE0uKL.js → card-BVDRUeiB.js} +1 -1
  66. package/dist/client/assets/{chat-context-C10uFg_9.js → chat-context-CpxV-LEc.js} +1 -1
  67. package/dist/client/assets/{checkbox-EJ-FS6-O.js → checkbox-C0OD5DTK.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BYusj1Yo.js → cli-auth-success-pLKti1nS.js} +1 -1
  69. package/dist/client/assets/collection-detail-Bx5cx6Tv.js +1 -0
  70. package/dist/client/assets/{collection-display-button-B9EwJigp.js → collection-display-button-Dpa_fFcT.js} +1 -1
  71. package/dist/client/assets/{collection-search-CVFFSy0S.js → collection-search-DHln9QoJ.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-C1Fi6DAM.js → collection-table-wrapper-CTiIT2dF.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CArtFM6T.js → collection-tabs-BaiyS1az.js} +1 -1
  74. package/dist/client/assets/{collections-BMUil3in.js → collections-Deko--Yp.js} +1 -1
  75. package/dist/client/assets/{command-BeSVNuhP.js → command-3qLn4P52.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-nMepiraO.js → connect-desktop-dialog-BoRQM4OA.js} +1 -1
  77. package/dist/client/assets/{connection-card-BAVVkgt5.js → connection-card-ZCt-smg_.js} +1 -1
  78. package/dist/client/assets/{connection-detail-BTh_x2Hu.js → connection-detail-DipDTh4H.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-C7w-EHHd.js → connection-form-helpers-B6JNJh-A.js} +1 -1
  80. package/dist/client/assets/{connections-CrTg-ish.js → connections-DzNM9iR8.js} +1 -1
  81. package/dist/client/assets/decopilot-sse-pool-8baykh62.js +1 -0
  82. package/dist/client/assets/{dialog-DlK91HiY.js → dialog-BnOLdErK.js} +1 -1
  83. package/dist/client/assets/{domain-settings-B7UAGOxI.js → domain-settings-CwC_r-qt.js} +1 -1
  84. package/dist/client/assets/{drawer-We__DvM1.js → drawer-Be_zu0QX.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-9oUOEimm.js → dropdown-menu-mHDT-XH7.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-D7rRlhnh.js → dynamic-plugin-layout-BGkekAkH.js} +1 -1
  87. package/dist/client/assets/{empty-state-CwB2rEHC.js → empty-state-CeDRg4Pp.js} +1 -1
  88. package/dist/client/assets/{empty-state-DWre-pls.js → empty-state-CpfaS4oL.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-Deygnaxj.js → extract-connection-data-bN8kltS6.js} +1 -1
  90. package/dist/client/assets/{features-C1SyNqJm.js → features-4Hsf4UEQ.js} +1 -1
  91. package/dist/client/assets/file-explorer-Bm3G3AJO.js +2 -0
  92. package/dist/client/assets/{file-type-icon-g69R8oLw.js → file-type-icon-DHQvk0za.js} +1 -1
  93. package/dist/client/assets/{files-C6FoCY_v.js → files-Bp_B54JG.js} +1 -1
  94. package/dist/client/assets/{form-8fnZRdSd.js → form-C_FOfVah.js} +1 -1
  95. package/dist/client/assets/{general-XtW1kUDP.js → general-Dwpcwhzc.js} +1 -1
  96. package/dist/client/assets/{generate-id-DHU56BsF.js → generate-id-CQZwmjfI.js} +1 -1
  97. package/dist/client/assets/github-repo-picker-Cd_kXw_v.js +4 -0
  98. package/dist/client/assets/{header-tab-button-B8CWwAih.js → header-tab-button-yQ_OLTia.js} +1 -1
  99. package/dist/client/assets/{hover-card-DwcwURxp.js → hover-card-CHj7OURi.js} +1 -1
  100. package/dist/client/assets/{image-field-DmhpoXrw.js → image-field-D7PJzfsZ.js} +1 -1
  101. package/dist/client/assets/{index-PvfjkUpw.js → index-Bq-oI4jf.js} +1 -1
  102. package/dist/client/assets/{index-oexgDee9.js → index-C93oJ98C.js} +1 -1
  103. package/dist/client/assets/{index-BZ_pIRwf.js → index-CR5thpY0.js} +1 -1
  104. package/dist/client/assets/{index-Daxt8Oww.js → index-CVroQ5fV.js} +1 -1
  105. package/dist/client/assets/{index-DBE0AwRo.js → index-CXrzfY3D.js} +1 -1
  106. package/dist/client/assets/{index-Cxw5N6xu.js → index-Cvm5sLsh.js} +1 -1
  107. package/dist/client/assets/{index-C5kgHpFv.js → index-D0AW3RJr.js} +1 -1
  108. package/dist/client/assets/{index-DxEUOQQs.js → index-DHxOddsj.js} +3 -3
  109. package/dist/client/assets/{index-C2l1dIiW.js → index-DdL0ZJ74.js} +1 -1
  110. package/dist/client/assets/index-DeWy5Ckp.js +1 -0
  111. package/dist/client/assets/{index-BATH3mQn.js → index-DhrBeRkU.js} +1 -1
  112. package/dist/client/assets/{index-CFHtQMhz.js → index-Dw2PpfWw.js} +2 -2
  113. package/dist/client/assets/{index-ZOhZPSgS.js → index-bcXz_XDV.js} +1 -1
  114. package/dist/client/assets/{index-DnaxJsHb.js → index-fYs9lCK5.js} +4 -4
  115. package/dist/client/assets/index-jA2TneF4.js +1 -0
  116. package/dist/client/assets/{index-redirect-HOxoe50M.js → index-redirect-CNjnlL2S.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-_wx8vha2.js → infiniteQueryObserver-Da-l1Mrb.js} +1 -1
  118. package/dist/client/assets/{input-CzgGcI3V.js → input-C3YblD3D.js} +1 -1
  119. package/dist/client/assets/{integration-icon-TXgAkIpf.js → integration-icon-DNnbE81S.js} +1 -1
  120. package/dist/client/assets/{label-Bz4-Isgq.js → label-g7a72jJD.js} +1 -1
  121. package/dist/client/assets/{layout-CJmh1JYB.js → layout-Bac2NmXP.js} +1 -1
  122. package/dist/client/assets/{login-CqLFGKun.js → login-Dy8BMo_0.js} +1 -1
  123. package/dist/client/assets/{members-CkjIPrxM.js → members-DnAomETO.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-H7pARgsv.js → monaco-editor-CVjkFUXK.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-DS1hvbdH.js → monitoring-stats-row-BXLdNMMZ.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-HUP2iLBH.js → oauth-callback-1VcaC9dS.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-Dd9lClDY.js → oauth-callback-ai-provider-MiK5yD8w.js} +1 -1
  128. package/dist/client/assets/{onboarding-CkoQ7XPG.js → onboarding-BGq8QKH-.js} +1 -1
  129. package/dist/client/assets/{org-install-BXFenQeY.js → org-install-DZd3jGKm.js} +1 -1
  130. package/dist/client/assets/{org-layout-CWtH4lkJ.js → org-layout-BsR_SirN.js} +1 -1
  131. package/dist/client/assets/{org-plugin-layout-3y1WMApX.js → org-plugin-layout-DiqJAM1g.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-S_9vd5c_.js → page-seo-form-D30yiy8Q.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-DHjVYqZY.js +1 -0
  134. package/dist/client/assets/{pair-Dqpt4Jli.js → pair-CV7DGW5V.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-LQMx4SEB.js → plugin-empty-state-rraryswS.js} +1 -1
  136. package/dist/client/assets/{plugin-header-BZ1oWLb9.js → plugin-header-B1uUxTrr.js} +1 -1
  137. package/dist/client/assets/{plugin-layout-BY7Ar40U.js → plugin-layout-DmiyMdB_.js} +1 -1
  138. package/dist/client/assets/{popover-7ZV_x738.js → popover-8cVh6gq0.js} +1 -1
  139. package/dist/client/assets/{post-editor-CbtQkJeo.js → post-editor-C7P1dXNH.js} +1 -1
  140. package/dist/client/assets/{primitives-B1fkoae3.js → primitives-BsgolKyl.js} +1 -1
  141. package/dist/client/assets/{profile-BIgGVZDN.js → profile-D4w-Z3ol.js} +1 -1
  142. package/dist/client/assets/project-app-view-MmHyDgpb.js +1 -0
  143. package/dist/client/assets/record-editor-LCb43Ehs.js +1 -0
  144. package/dist/client/assets/registry-DRQ1oW7y.js +2 -0
  145. package/dist/client/assets/{registry-layout-Bp8ThmJv.js → registry-layout-C-3QWp3D.js} +1 -1
  146. package/dist/client/assets/{require-capability-Cu6FsDEP.js → require-capability-skg99hPH.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-s-nnIbb3.js → required-auth-layout-Cidb--Hk.js} +1 -1
  148. package/dist/client/assets/{reset-password-BfEM853p.js → reset-password-CNhRvj5g.js} +1 -1
  149. package/dist/client/assets/{resizable-D2JXsfXz.js → resizable-BT48Uzms.js} +1 -1
  150. package/dist/client/assets/{roles-cALq3Qwx.js → roles-9lGr_fMG.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-Uk3HPmEZ.js +1 -0
  152. package/dist/client/assets/{save-status-BcFNfyWL.js → save-status-DsIS1sld.js} +1 -1
  153. package/dist/client/assets/{schema-form-B407z7tS.js → schema-form-oJE4kcAX.js} +1 -1
  154. package/dist/client/assets/{scroll-area-ChPJ-NEF.js → scroll-area-D2NfEZKG.js} +1 -1
  155. package/dist/client/assets/{search-input-Cray-A1q.js → search-input-wg0ktmKr.js} +1 -1
  156. package/dist/client/assets/{secrets-CSi3922A.js → secrets-YPZEWZE9.js} +1 -1
  157. package/dist/client/assets/{sections-editor-Dn33QM0Q.js → sections-editor-CDk8QiTt.js} +1 -1
  158. package/dist/client/assets/{select-BhUuCBjD.js → select-LvZkQCcv.js} +1 -1
  159. package/dist/client/assets/{select-model-C941S1nf.js → select-model-Bvdn_l3a.js} +1 -1
  160. package/dist/client/assets/seo-editor-CZ4NCpV7.js +1 -0
  161. package/dist/client/assets/settings-layout-Cn8PAm-f.js +1 -0
  162. package/dist/client/assets/{settings-section-BmqyawBS.js → settings-section-BiebCtcC.js} +1 -1
  163. package/dist/client/assets/{sheet-Devtg9cX.js → sheet-4GES45T2.js} +1 -1
  164. package/dist/client/assets/{shell-controls-3zx-sXr7.js → shell-controls-pFVNS2Vn.js} +1 -1
  165. package/dist/client/assets/{shell-layout-DRNHZhhH.js → shell-layout-DtkuyxW9.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-CDKyU1Jg.js → shell-route-loading-B6fsTD_h.js} +1 -1
  167. package/dist/client/assets/{sidebar-D_Yb-5nE.js → sidebar-BY-0S2nV.js} +1 -1
  168. package/dist/client/assets/{skeleton-DU4Yk3QQ.js → skeleton-B2rX4p4v.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-DLnTPF68.js → sortable.esm-C0tZpwHI.js} +1 -1
  170. package/dist/client/assets/{spinner-DJudGYoz.js → spinner-WtoCvpNX.js} +1 -1
  171. package/dist/client/assets/{sso-Bc1ESWi6.js → sso-4MYeJHQK.js} +1 -1
  172. package/dist/client/assets/{store-Ble4KI2L.js → store-BTeo8TpT.js} +1 -1
  173. package/dist/client/assets/store-registry-B8aDVYEg.js +2 -0
  174. package/dist/client/assets/{studio-tools-CdiIGNug.js → studio-tools-CH7dZ7HT.js} +1 -1
  175. package/dist/client/assets/{switch-CbDNpyYj.js → switch-BOtiDaPh.js} +1 -1
  176. package/dist/client/assets/{tab-id-CixUfikt.js → tab-id-DaQY5Du1.js} +3 -3
  177. package/dist/client/assets/{table-C7al_g9w.js → table-kq85oeWE.js} +1 -1
  178. package/dist/client/assets/{tabs-DpPbTcOX.js → tabs-D_XRbq3N.js} +1 -1
  179. package/dist/client/assets/{task-status-B4xhXa10.js → task-status-BlpPmTT-.js} +1 -1
  180. package/dist/client/assets/{textarea-CHCvnh_8.js → textarea-CxRmk2pV.js} +1 -1
  181. package/dist/client/assets/{toggle-group-DUH3UCsh.js → toggle-group-B_ZhC8rH.js} +1 -1
  182. package/dist/client/assets/{toolbar-Dje6lkWt.js → toolbar-BptUton3.js} +1 -1
  183. package/dist/client/assets/{tools-list-BYNSxX2E.js → tools-list-BXxC0BJ6.js} +1 -1
  184. package/dist/client/assets/{tooltip-BIymZbyc.js → tooltip-6OktDyzD.js} +1 -1
  185. package/dist/client/assets/{types-CmWRxh2O.js → types-k3mlT_jb.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-i1tqdzqX.js → use-ai-providers-Czs3LwMV.js} +1 -1
  187. package/dist/client/assets/{use-automations-DGwM8rjk.js → use-automations-6FHnA6mT.js} +1 -1
  188. package/dist/client/assets/{use-capability-C6m2-0Ci.js → use-capability-B2GMKCxl.js} +1 -1
  189. package/dist/client/assets/{use-clock-tick-B8zeuW9S.js → use-clock-tick-DRfafiJJ.js} +1 -1
  190. package/dist/client/assets/{use-collections-CPla-8Z_.js → use-collections-3gcbdMo5.js} +1 -1
  191. package/dist/client/assets/{use-connection-7yE-FpPg.js → use-connection-Cygt3JAU.js} +1 -1
  192. package/dist/client/assets/{use-copy-CMgaIgR7.js → use-copy-BzO5OLbn.js} +1 -1
  193. package/dist/client/assets/{use-create-virtual-mcp-BWWSVfRV.js → use-create-virtual-mcp-BJIgmNjf.js} +1 -1
  194. package/dist/client/assets/{use-debounced-autosave-DtXHyjU0.js → use-debounced-autosave-rTdfYQSA.js} +1 -1
  195. package/dist/client/assets/{use-delete-connection-v7_IOcbu.js → use-delete-connection-BwHDAibo.js} +1 -1
  196. package/dist/client/assets/{use-file-configs-BmBPsN9j.js → use-file-configs-C_uUU82K.js} +1 -1
  197. package/dist/client/assets/{use-infinite-scroll-COS9eomA.js → use-infinite-scroll-D7Lz32GP.js} +1 -1
  198. package/dist/client/assets/{use-list-state-Cl12C-eO.js → use-list-state-CAT0PD89.js} +1 -1
  199. package/dist/client/assets/{use-mcp-client-BW6MR0tW.js → use-mcp-client-Bbkq-Btq.js} +1 -1
  200. package/dist/client/assets/{use-mcp-prompts-DauhYIMV.js → use-mcp-prompts-C2IR7B-B.js} +1 -1
  201. package/dist/client/assets/{use-mcp-tools-BdvRRDeD.js → use-mcp-tools-BiO0x3bS.js} +1 -1
  202. package/dist/client/assets/{use-members-UnrPTEyo.js → use-members-Ct7TKvLy.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-7tEptzcr.js → use-navigate-to-agent-7jnPTeCV.js} +1 -1
  204. package/dist/client/assets/{use-org-auth-client-D_nAk9Nf.js → use-org-auth-client-DwSMx4xq.js} +1 -1
  205. package/dist/client/assets/{use-org-sso-BZSKGD_q.js → use-org-sso-HULZXLZY.js} +1 -1
  206. package/dist/client/assets/{use-organization-roles-DDLxus16.js → use-organization-roles-C24SP1RJ.js} +1 -1
  207. package/dist/client/assets/{use-organization-settings-Ds8za6ZV.js → use-organization-settings-6ykeD7wG.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-Bo5wHKtk.js → use-registry-connections-Cw0Uu9HN.js} +1 -1
  209. package/dist/client/assets/{use-secrets-3j7bfIX7.js → use-secrets-Dn7Z2olr.js} +1 -1
  210. package/dist/client/assets/use-status-sounds-BMl-h7wF.js +1 -0
  211. package/dist/client/assets/{use-view-mode-CdHjt_dk.js → use-view-mode-DS8kaEq4.js} +1 -1
  212. package/dist/client/assets/{use-virtual-mcp-C5aNldwS.js → use-virtual-mcp-C6pMpGrR.js} +1 -1
  213. package/dist/client/assets/useInfiniteQuery-DnxNK7B2.js +1 -0
  214. package/dist/client/assets/{useRouterState-CKqJqhNS.js → useRouterState-Dnb9kW5z.js} +1 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-Bdpr4GcQ.js +1 -0
  216. package/dist/client/assets/{user-D4kiCnS_.js → user-TO91q8is.js} +1 -1
  217. package/dist/client/assets/{view-mode-toggle-D6mTnqbc.js → view-mode-toggle-X2TTOWIg.js} +1 -1
  218. package/dist/client/assets/watch-sse-pool-CuN8_Ws2.js +1 -0
  219. package/dist/client/assets/{workflow-YStE-9Wj.js → workflow-Bof_Hi_L.js} +1 -1
  220. package/dist/client/assets/workflow-detail-xblJkXWm.js +1 -0
  221. package/dist/client/index.html +1 -1
  222. package/dist/server/cli.js +421 -421
  223. package/dist/server/server.js +282 -282
  224. package/package.json +1 -1
  225. package/dist/client/assets/add-section-modal-BCNLSlG_.js +0 -1
  226. package/dist/client/assets/ai-providers-DwCvc_zL.js +0 -1
  227. package/dist/client/assets/app-editor-DUutwvll.js +0 -1
  228. package/dist/client/assets/collection-detail-jnv2JHtL.js +0 -1
  229. package/dist/client/assets/create-sse-subscription-BS5983N4.js +0 -1
  230. package/dist/client/assets/decopilot-sse-pool-C9YWBszR.js +0 -1
  231. package/dist/client/assets/file-explorer-B31Paeha.js +0 -2
  232. package/dist/client/assets/github-repo-picker-CA1Lsyag.js +0 -4
  233. package/dist/client/assets/index-Beg4zk5F.js +0 -1
  234. package/dist/client/assets/index-Dlen5TT1.js +0 -1
  235. package/dist/client/assets/page-seo-sheet-A616YBcI.js +0 -1
  236. package/dist/client/assets/project-app-view-C7vmMA1u.js +0 -1
  237. package/dist/client/assets/record-editor-Sic5IUJ0.js +0 -1
  238. package/dist/client/assets/registry-CNVAuq_t.js +0 -2
  239. package/dist/client/assets/save-referenced-block-CL_4PMgI.js +0 -1
  240. package/dist/client/assets/seo-editor-CSQJAMXP.js +0 -1
  241. package/dist/client/assets/settings-layout-mUcXrMvm.js +0 -1
  242. package/dist/client/assets/store-registry-Csepzf8q.js +0 -2
  243. package/dist/client/assets/use-status-sounds-TuoDiwSP.js +0 -1
  244. package/dist/client/assets/useInfiniteQuery-CMP19UQ8.js +0 -1
  245. package/dist/client/assets/useSuspenseInfiniteQuery-Dsr82JBj.js +0 -1
  246. package/dist/client/assets/workflow-detail-Vo_71HSM.js +0 -1
@@ -1 +1 @@
1
- import{e as g}from"./index-DxEUOQQs.js";import{b as f}from"./use-virtual-mcp-C5aNldwS.js";import{k as p}from"./use-navigate-to-agent-7tEptzcr.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,r=u===void 0?!1:u,t=f(),c=p();let s;e[2]!==t.create||e[3]!==r||e[4]!==c?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return r&&c(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=r,e[4]=c,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
1
+ import{e as g}from"./index-DHxOddsj.js";import{b as f}from"./use-virtual-mcp-C6pMpGrR.js";import{k as p}from"./use-navigate-to-agent-7jnPTeCV.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,r=u===void 0?!1:u,t=f(),c=p();let s;e[2]!==t.create||e[3]!==r||e[4]!==c?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return r&&c(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=r,e[4]=c,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
@@ -1 +1 @@
1
- import{r as u}from"./index-DxEUOQQs.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
1
+ import{r as u}from"./index-DHxOddsj.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
@@ -1 +1 @@
1
- import{e as H,j as t,q as Q,G,r as J,o as F,bl as M,bm as P}from"./index-DxEUOQQs.js";import{c as I,b as L,d as q,f as R,e as U,g as k,a as K,A as $}from"./alert-dialog-DzLqwXYd.js";import{u as Y}from"./studio-tools-CdiIGNug.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:i,confirmDelete:c,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==i?(r=w=>{w||i()},e[0]=i,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(I,{children:"Delete Connection?"}),e[2]=f):f=e[2];const S=s.mode==="deleting"&&s.connection.title;let u;e[3]!==S?(u=t.jsxs(L,{children:[f,t.jsxs(q,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:S}),"."]})]}),e[3]=S,e[4]=u):u=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(R,{children:"Cancel"}),e[5]=E):E=e[5];let h;e[6]!==c?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=c,e[7]=h):h=e[7];let n;e[8]!==u||e[9]!==h?(n=t.jsxs(K,{children:[u,h]}),e[8]=u,e[9]=h,e[10]=n):n=e[10];let o;e[11]!==N||e[12]!==r||e[13]!==n?(o=t.jsx($,{open:N,onOpenChange:r,children:n}),e[11]=N,e[12]=r,e[13]=n,e[14]=o):o=e[14];const a=s.mode==="force-deleting";let d;e[15]!==i?(d=w=>{w||i()},e[15]=i,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(I,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const _=s.mode==="force-deleting"&&s.connection.title;let g;e[18]!==_?(g=t.jsx("span",{className:"font-medium text-foreground",children:_}),e[18]=_,e[19]=g):g=e[19];const A=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==A?(x=t.jsx("span",{className:"font-medium text-foreground",children:A}),e[20]=A,e[21]=x):x=e[21];let C;e[22]!==g||e[23]!==x?(C=t.jsxs("p",{children:["The connection"," ",g," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=g,e[23]=x,e[24]=C):C=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."}),e[25]=O):O=e[25];let D;e[26]!==C?(D=t.jsxs(L,{children:[m,t.jsx(q,{asChild:!0,children:t.jsxs("div",{children:[C,O]})})]}),e[26]=C,e[27]=D):D=e[27];let b;e[28]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(R,{children:"Cancel"}),e[28]=b):b=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[b,t.jsx(k,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=l,e[30]=j):j=e[30];let p;e[31]!==D||e[32]!==j?(p=t.jsxs(K,{children:[D,j]}),e[31]=D,e[32]=j,e[33]=p):p=e[33];let y;e[34]!==a||e[35]!==d||e[36]!==p?(y=t.jsx($,{open:a,onOpenChange:d,children:p}),e[34]=a,e[35]=d,e[36]=p,e[37]=y):y=e[37];let v;return e[38]!==y||e[39]!==o?(v=t.jsxs(t.Fragment,{children:[o,y]}),e[38]=y,e[39]=o,e[40]=v):v=e[40],v}function X({onSuccess:T}={}){const{org:e}=Q(),s=G(),i=Y(),[c,l]=J.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===e.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},r=n=>{M(n),s.invalidateQueries({predicate:o=>o.queryKey[1]===P&&o.queryKey[3]===n})},f=n=>{N(),r(n),F.success("Connection deleted successfully"),l({mode:"idle"}),T?.()};return{deleteState:c,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(c.mode!=="deleting")return;const n=c.connection;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n.id}),f(n.id)}catch(o){const a=o instanceof Error?o.message:String(o),d=a.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){l({mode:"force-deleting",connection:n,agentNames:m.agentNames.map(_=>`"${_}"`).join(", ")});return}}catch{}F.error(`Failed to delete connection: ${a}`)}},confirmForceDelete:async()=>{if(c.mode!=="force-deleting")return;const n=c.connection.id;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n,force:!0}),f(n)}catch(o){const a=o instanceof Error?o.message:String(o);F.error(`Failed to delete connection: ${a}`)}}}}export{W as D,X as u};
1
+ import{e as H,j as t,q as Q,G,r as J,o as F,bl as M,bm as P}from"./index-DHxOddsj.js";import{c as I,b as L,d as q,f as R,e as U,g as k,a as K,A as $}from"./alert-dialog-DokKbPq-.js";import{u as Y}from"./studio-tools-CH7dZ7HT.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:i,confirmDelete:c,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==i?(r=w=>{w||i()},e[0]=i,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(I,{children:"Delete Connection?"}),e[2]=f):f=e[2];const S=s.mode==="deleting"&&s.connection.title;let u;e[3]!==S?(u=t.jsxs(L,{children:[f,t.jsxs(q,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:S}),"."]})]}),e[3]=S,e[4]=u):u=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(R,{children:"Cancel"}),e[5]=E):E=e[5];let h;e[6]!==c?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=c,e[7]=h):h=e[7];let n;e[8]!==u||e[9]!==h?(n=t.jsxs(K,{children:[u,h]}),e[8]=u,e[9]=h,e[10]=n):n=e[10];let o;e[11]!==N||e[12]!==r||e[13]!==n?(o=t.jsx($,{open:N,onOpenChange:r,children:n}),e[11]=N,e[12]=r,e[13]=n,e[14]=o):o=e[14];const a=s.mode==="force-deleting";let d;e[15]!==i?(d=w=>{w||i()},e[15]=i,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(I,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const _=s.mode==="force-deleting"&&s.connection.title;let g;e[18]!==_?(g=t.jsx("span",{className:"font-medium text-foreground",children:_}),e[18]=_,e[19]=g):g=e[19];const A=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==A?(x=t.jsx("span",{className:"font-medium text-foreground",children:A}),e[20]=A,e[21]=x):x=e[21];let C;e[22]!==g||e[23]!==x?(C=t.jsxs("p",{children:["The connection"," ",g," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=g,e[23]=x,e[24]=C):C=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."}),e[25]=O):O=e[25];let D;e[26]!==C?(D=t.jsxs(L,{children:[m,t.jsx(q,{asChild:!0,children:t.jsxs("div",{children:[C,O]})})]}),e[26]=C,e[27]=D):D=e[27];let b;e[28]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(R,{children:"Cancel"}),e[28]=b):b=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[b,t.jsx(k,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=l,e[30]=j):j=e[30];let p;e[31]!==D||e[32]!==j?(p=t.jsxs(K,{children:[D,j]}),e[31]=D,e[32]=j,e[33]=p):p=e[33];let y;e[34]!==a||e[35]!==d||e[36]!==p?(y=t.jsx($,{open:a,onOpenChange:d,children:p}),e[34]=a,e[35]=d,e[36]=p,e[37]=y):y=e[37];let v;return e[38]!==y||e[39]!==o?(v=t.jsxs(t.Fragment,{children:[o,y]}),e[38]=y,e[39]=o,e[40]=v):v=e[40],v}function X({onSuccess:T}={}){const{org:e}=Q(),s=G(),i=Y(),[c,l]=J.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===e.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},r=n=>{M(n),s.invalidateQueries({predicate:o=>o.queryKey[1]===P&&o.queryKey[3]===n})},f=n=>{N(),r(n),F.success("Connection deleted successfully"),l({mode:"idle"}),T?.()};return{deleteState:c,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(c.mode!=="deleting")return;const n=c.connection;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n.id}),f(n.id)}catch(o){const a=o instanceof Error?o.message:String(o),d=a.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){l({mode:"force-deleting",connection:n,agentNames:m.agentNames.map(_=>`"${_}"`).join(", ")});return}}catch{}F.error(`Failed to delete connection: ${a}`)}},confirmForceDelete:async()=>{if(c.mode!=="force-deleting")return;const n=c.connection.id;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n,force:!0}),f(n)}catch(o){const a=o instanceof Error?o.message:String(o);F.error(`Failed to delete connection: ${a}`)}}}}export{W as D,X as u};
@@ -1 +1 @@
1
- import{e as u,q as c,K as r,s as y,n as F,G as C,a as d}from"./index-DxEUOQQs.js";import{u as f}from"./studio-tools-CdiIGNug.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,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:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return 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],F(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{q as a,_ as b,I as c,m as u};
1
+ import{e as u,q as c,K as r,s as y,n as F,G as C,a as d}from"./index-DHxOddsj.js";import{u as f}from"./studio-tools-CH7dZ7HT.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,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:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return 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],F(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{q as a,_ as b,I as c,m as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-DxEUOQQs.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
1
+ import{r as e}from"./index-DHxOddsj.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{r as u,e as w}from"./index-DxEUOQQs.js";import{u as E}from"./use-view-mode-CdHjt_dk.js";function J(a){const e=`deco-filters-${a}`,[s,i]=u.useState(()=>{try{const t=globalThis.localStorage?.getItem(e);if(t)return JSON.parse(t)}catch(t){console.error("Failed to parse stored filters:",t)}return[]});return[s,t=>{i(t);try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch(l){console.error("Failed to save filters:",l)}}]}function N(a){const e=w.c(7),[s,i]=u.useState(a),[r,t]=u.useState(a?"desc":null);let l;e[0]!==r||e[1]!==s?(l=S=>{s!==S?(i(S),t("asc")):r==="asc"?t("desc"):r==="desc"&&(i(void 0),t(null))},e[0]=r,e[1]=s,e[2]=l):l=e[2];const d=l;let o;return e[3]!==d||e[4]!==r||e[5]!==s?(o={sortKey:s,sortDirection:r,handleSort:d},e[3]=d,e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function W(a){const e=w.c(20),{namespace:s,resource:i,defaultSortKey:r,defaultViewMode:t}=a,l=r===void 0?"title":r,d=t===void 0?"table":t,[o,S]=u.useState(""),b=u.useDeferredValue(o),D=`${s}-${i}`,[p,F]=J(D),c=`mesh-${i}-filter-visible-${s}`;let g;e[0]!==c?(g=()=>globalThis.localStorage?.getItem(c)==="true",e[0]=c,e[1]=g):g=e[1];const[n,x]=u.useState(g);let h;e[2]!==c?(h=T=>{x(T),globalThis.localStorage?.setItem(c,String(T))},e[2]=c,e[3]=h):h=e[3];const f=h;let m;e[4]!==n||e[5]!==f?(m=()=>{f(!n)},e[4]=n,e[5]=f,e[6]=m):m=e[6];const V=m,[$,K]=E(`mesh-${i}-${s}`,d),{sortKey:I,sortDirection:v,handleSort:B}=N(l),M=I;let y;return e[7]!==n||e[8]!==p||e[9]!==B||e[10]!==o||e[11]!==b||e[12]!==f||e[13]!==F||e[14]!==K||e[15]!==v||e[16]!==M||e[17]!==V||e[18]!==$?(y={search:o,searchTerm:b,setSearch:S,filters:p,setFilters:F,filterBarVisible:n,setFilterBarVisible:f,toggleFilterBar:V,viewMode:$,setViewMode:K,sortKey:M,sortDirection:v,handleSort:B},e[7]=n,e[8]=p,e[9]=B,e[10]=o,e[11]=b,e[12]=f,e[13]=F,e[14]=K,e[15]=v,e[16]=M,e[17]=V,e[18]=$,e[19]=y):y=e[19],y}export{W as u};
1
+ import{r as u,e as w}from"./index-DHxOddsj.js";import{u as E}from"./use-view-mode-DS8kaEq4.js";function J(a){const e=`deco-filters-${a}`,[s,i]=u.useState(()=>{try{const t=globalThis.localStorage?.getItem(e);if(t)return JSON.parse(t)}catch(t){console.error("Failed to parse stored filters:",t)}return[]});return[s,t=>{i(t);try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch(l){console.error("Failed to save filters:",l)}}]}function N(a){const e=w.c(7),[s,i]=u.useState(a),[r,t]=u.useState(a?"desc":null);let l;e[0]!==r||e[1]!==s?(l=S=>{s!==S?(i(S),t("asc")):r==="asc"?t("desc"):r==="desc"&&(i(void 0),t(null))},e[0]=r,e[1]=s,e[2]=l):l=e[2];const d=l;let o;return e[3]!==d||e[4]!==r||e[5]!==s?(o={sortKey:s,sortDirection:r,handleSort:d},e[3]=d,e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function W(a){const e=w.c(20),{namespace:s,resource:i,defaultSortKey:r,defaultViewMode:t}=a,l=r===void 0?"title":r,d=t===void 0?"table":t,[o,S]=u.useState(""),b=u.useDeferredValue(o),D=`${s}-${i}`,[p,F]=J(D),c=`mesh-${i}-filter-visible-${s}`;let g;e[0]!==c?(g=()=>globalThis.localStorage?.getItem(c)==="true",e[0]=c,e[1]=g):g=e[1];const[n,x]=u.useState(g);let h;e[2]!==c?(h=T=>{x(T),globalThis.localStorage?.setItem(c,String(T))},e[2]=c,e[3]=h):h=e[3];const f=h;let m;e[4]!==n||e[5]!==f?(m=()=>{f(!n)},e[4]=n,e[5]=f,e[6]=m):m=e[6];const V=m,[$,K]=E(`mesh-${i}-${s}`,d),{sortKey:I,sortDirection:v,handleSort:B}=N(l),M=I;let y;return e[7]!==n||e[8]!==p||e[9]!==B||e[10]!==o||e[11]!==b||e[12]!==f||e[13]!==F||e[14]!==K||e[15]!==v||e[16]!==M||e[17]!==V||e[18]!==$?(y={search:o,searchTerm:b,setSearch:S,filters:p,setFilters:F,filterBarVisible:n,setFilterBarVisible:f,toggleFilterBar:V,viewMode:$,setViewMode:K,sortKey:M,sortDirection:v,handleSort:B},e[7]=n,e[8]=p,e[9]=B,e[10]=o,e[11]=b,e[12]=f,e[13]=F,e[14]=K,e[15]=v,e[16]=M,e[17]=V,e[18]=$,e[19]=y):y=e[19],y}export{W as u};
@@ -1,4 +1,4 @@
1
- import{cH as le,cI as ue,cJ as de,c4 as he,cK as fe,bH as m,bI as w,cL as pe,cM as me,cN as _e,cO as A,cP as ge,cQ as j,cR as we,cS as q,cT as Te,cU as F,cV as ye,cW as ke,cX as ve,cY as z,bC as Se,cZ as Ce,c_ as be,b$ as ee,cc as Re,ci as Ie,cg as Ee,c$ as qe,d0 as Pe,d1 as $e,d2 as M,d3 as Ae,d4 as Me,ch as Oe,cd as He,ce as Ne,cf as xe,cb as De,d5 as Ue,d6 as je,d7 as Fe,c6 as Le,d8 as Ve,d9 as We,da as P,db as O,dc as Q,dd as ze,cj as x,e as te,s as se,aO as V}from"./index-DxEUOQQs.js";function N(a){return!!a._zod}function b(a,e){return N(a)?le(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 Qe(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=Qe(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 Ge=6e4;class Je{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,p=new m(h.error.code,h.error.message,h.error.data);l(p)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}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(me,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new 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)||ge(o)?this._onresponse(o):j(o)?this._onrequest(o,n):we(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=Te(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={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,p)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...p,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,f)).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(f=>setTimeout(f,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((f,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 p=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:p};s?.onprogress&&(this._progressHandlers.set(p,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,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(p,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(p,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(p);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(p),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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 f=z.parse({method:"notifications/tasks/status",params:u});await this.notification(f),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 Ke(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 Be=Ce();const Ye=Se(Be);function Ze(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class Xe{constructor(e){this._ajv=e??Ze()}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 et{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 f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.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 tt(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 st(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 rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let at=class extends Je{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 Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(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,f)=>{const l=b(je,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:p,supportsUrlMode:g}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!p)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,f));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(Fe,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,f)=>{const l=b(Le,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,p=await Promise.resolve(t(u,f));if(h.task){const k=b(F,p);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?Ve:We,T=b(y,p);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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(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},Ae,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},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ne,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},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},De,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.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,f=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const p=h instanceof Error?h:new Error(String(h));u(p,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const p=setTimeout(f,i);this._listChangedDebounceTimers.set(e,p)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const St={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}`},ot="self";function nt(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function it(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 ae=nt("decopilot_"),Ct=ae.is,ct=ae.get;function bt(a){return it({id:ct(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 Rt={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 It(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 lt(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 f;try{f=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const p=h instanceof Error?h.message:"Network error";return{content:D(p),isError:!0}}if(!f.ok){let h=`${u.name} failed (${f.status})`;try{const p=await f.json();p?.error&&(h=p.error)}catch{}return{content:D(h),isError:!0}}const l=await f.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 ut(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,dt=13,I=32;function U(a){}function ht(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="",f=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=p(d);v!==""&&o.push(v);return}if(d.indexOf(`
1
+ import{cH as le,cI as ue,cJ as de,c4 as he,cK as fe,bH as m,bI as w,cL as pe,cM as me,cN as _e,cO as A,cP as ge,cQ as j,cR as we,cS as q,cT as Te,cU as F,cV as ye,cW as ke,cX as ve,cY as z,bC as Se,cZ as Ce,c_ as be,b$ as ee,cc as Re,ci as Ie,cg as Ee,c$ as qe,d0 as Pe,d1 as $e,d2 as M,d3 as Ae,d4 as Me,ch as Oe,cd as He,ce as Ne,cf as xe,cb as De,d5 as Ue,d6 as je,d7 as Fe,c6 as Le,d8 as Ve,d9 as We,da as P,db as O,dc as Q,dd as ze,cj as x,e as te,s as se,aO as V}from"./index-DHxOddsj.js";function N(a){return!!a._zod}function b(a,e){return N(a)?le(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 Qe(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=Qe(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 Ge=6e4;class Je{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,p=new m(h.error.code,h.error.message,h.error.data);l(p)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}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(me,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new 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)||ge(o)?this._onresponse(o):j(o)?this._onrequest(o,n):we(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=Te(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={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,p)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...p,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,f)).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(f=>setTimeout(f,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((f,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 p=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:p};s?.onprogress&&(this._progressHandlers.set(p,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,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(p,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(p,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(p);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(p),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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 f=z.parse({method:"notifications/tasks/status",params:u});await this.notification(f),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 Ke(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 Be=Ce();const Ye=Se(Be);function Ze(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class Xe{constructor(e){this._ajv=e??Ze()}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 et{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 f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.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 tt(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 st(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 rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let at=class extends Je{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 Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(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,f)=>{const l=b(je,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:p,supportsUrlMode:g}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!p)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,f));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(Fe,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,f)=>{const l=b(Le,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,p=await Promise.resolve(t(u,f));if(h.task){const k=b(F,p);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?Ve:We,T=b(y,p);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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(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},Ae,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},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ne,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},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},De,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.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,f=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const p=h instanceof Error?h:new Error(String(h));u(p,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const p=setTimeout(f,i);this._listChangedDebounceTimers.set(e,p)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const St={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}`},ot="self";function nt(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function it(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 ae=nt("decopilot_"),Ct=ae.is,ct=ae.get;function bt(a){return it({id:ct(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 Rt={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 It(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 lt(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 f;try{f=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const p=h instanceof Error?h.message:"Network error";return{content:D(p),isError:!0}}if(!f.ok){let h=`${u.name} failed (${f.status})`;try{const p=await f.json();p?.error&&(h=p.error)}catch{}return{content:D(h),isError:!0}}const l=await f.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 ut(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,dt=13,I=32;function U(a){}function ht(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="",f=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=p(d);v!==""&&o.push(v);return}if(d.indexOf(`
2
2
  `)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=p(c);_!==""&&o.push(_)}function p(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0,c=_+1,_=d.indexOf(`
4
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(f===0&&d.charCodeAt(_+1)===Y){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
@@ -1 +1 @@
1
- import{e as l,n as c,bH as m,bI as f,s as y,aO as n}from"./index-DxEUOQQs.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{q as a,b as g,u as l,g as u};
1
+ import{e as l,n as c,bH as m,bI as f,s as y,aO as n}from"./index-DHxOddsj.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{q as a,b as g,u as l,g as u};
@@ -1 +1 @@
1
- import{e as m,n as p,s as q,aO as T,a as C}from"./index-DxEUOQQs.js";function O(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],q(i)}function K(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],p(i)}function M(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=q,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function w(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=p,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function F(a){const e=m.c(8);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async n=>await t.callTool(n),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{O as a,K as b,M as c,F as d,w as u};
1
+ import{e as m,n as p,s as q,aO as T,a as C}from"./index-DHxOddsj.js";function O(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],q(i)}function K(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],p(i)}function M(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=q,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function w(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=p,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function F(a){const e=m.c(8);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async n=>await t.callTool(n),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{O as a,K as b,M as c,F as d,w as u};
@@ -1 +1 @@
1
- import{e as n,q as i,s as l,K as m}from"./index-DxEUOQQs.js";import{u as a}from"./use-org-auth-client-D_nAk9Nf.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
1
+ import{e as n,q as i,s as l,K as m}from"./index-DHxOddsj.js";import{u as a}from"./use-org-auth-client-DwSMx4xq.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
@@ -1 +1 @@
1
- import{L as v,r as f,e as C,j,f as N,q as D,b as F}from"./index-DxEUOQQs.js";import{a as q}from"./use-virtual-mcp-C5aNldwS.js";const h="__tool_call_runs__",w=["requires_action","in_progress","failed","expired","completed"];function te(e){const t=new Map(w.map(r=>[r,[]]));for(const r of e){const n=r.status??"completed";(t.get(n)??t.get("completed")).push(r)}return w.map(r=>({status:r,threads:t.get(r)}))}function re(e,t){const r=new Map;for(const u of e){if(u.id.startsWith("thrd_welcome_"))continue;const c=u.virtual_mcp_id??h,a=r.get(c);a?(a.threads.push(u),(u.updated_at??"")>a.latestUpdatedAt&&(a.latestUpdatedAt=u.updated_at??"")):r.set(c,{virtualMcpId:c,threads:[u],latestUpdatedAt:u.updated_at??""})}const n=t!==null?r.get(t):void 0;n&&t&&r.delete(t);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((u,c)=>c.latestUpdatedAt.localeCompare(u.latestUpdatedAt)),i=[];return n&&n.threads.length>0&&i.push(n),i.push(...o),s&&s.threads.length>0&&i.push(s),i}const R=new Map,A=new Map;function P(e){return`${e.orgId}:${e.userId}`}function E(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function T(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function $(e){const t=P(e),r=R.get(t);if(r)return r;const n=v.sidebarGroupOrder(e.orgId,e.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&e.userId!=="anon"){const i=O(E(e.orgId));i.length>0&&(o=i)}return R.set(t,o),o}function p(e,t){const r=new Set(t);return $(e).filter(n=>!r.has(n))}function g(e,t){R.set(P(e),t),T(v.sidebarGroupOrder(e.orgId,e.userId),t)}function m(e){const t=A.get(e);if(t)return t;const r=O(v.sidebarOrgPinnedOrder(e));return A.set(e,r),r}function S(e,t){A.set(e,t),T(v.sidebarOrgPinnedOrder(e),t)}function ne(e,t){g(e,t)}function se(e,t){S(e,t)}function k(e,t){return e===t||e===h}function I(e,t){return t.includes(e)}function B(e,t){return e.map(r=>r.virtualMcpId).filter(r=>!k(r,t))}function oe(e,t,r,n){const s=new Set(n);return B(e,r).filter(o=>t==="org"?s.has(o):!s.has(o))}function J(e,t){const r=new Set(e),n=t.filter(s=>!r.has(s));return n.length===0?e:[...e,...n]}function ie(e,t,r){const n=new Set(r),s=[],o=[];let i,u;for(const c of e){const a=c.virtualMcpId;if(t&&a===t){i=c;continue}if(a===h){u=c;continue}if(n.has(a)){s.push(c);continue}o.push(c)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:u}}function L(e,t,r,n=[],s=[]){const o=r?e.find(d=>d.virtualMcpId===r):void 0,i=e.find(d=>d.virtualMcpId===h),u=new Set(n),c=n.filter(d=>!k(d,r)),a=J(s,c),l=t.filter(d=>!u.has(d)),x=new Map(e.map(d=>[d.virtualMcpId,d])),_=d=>{const U=x.get(d);return U||{virtualMcpId:d,threads:[],latestUpdatedAt:""}},G=a.filter(d=>u.has(d)).map(_),K=l.map(_),b=[];return o&&b.push(o),b.push(...G,...K),i&&b.push(i),{groups:b,userOrder:l,orgOrder:G.map(d=>d.virtualMcpId)}}function Y(e,t){const r=new Set(t);m(e.orgId).length===0&&t.length>0&&S(e.orgId,[...t]);const s=v.sidebarGroupOrder(e.orgId,e.userId);if(O(s).length>0)return;const o=O(E(e.orgId));if(o.length===0)return;const i=o.filter(u=>!r.has(u));g(e,i)}function M(e,t){const r=new Set(t),n=$(e),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(e,s)}function ue(e,t,r,n=[]){Y(e,n),M(e,n);const s=p(e,n),o=m(e.orgId),{userOrder:i,orgOrder:u}=L(t,s,r,n,o);(i.length!==s.length||i.some((c,a)=>c!==s[a]))&&g(e,i),(u.length!==o.length||u.some((c,a)=>c!==o[a]))&&S(e.orgId,u)}function ae(e,t,r,n=[]){const s=p(e,n),o=m(e.orgId);return L(t,s,r,n,o).groups}function ce(e,t,r){if(r){const o=p(e,[t]).filter(u=>u!==t);g(e,o);const i=m(e.orgId);i.includes(t)||S(e.orgId,[...i,t]);return}const n=m(e.orgId).filter(o=>o!==t);S(e.orgId,n);const s=p(e,[]);s.includes(t)||g(e,[...s,t])}function W(e,t,r=[]){if(r.includes(t))return;const n=p(e,r);n.includes(t)||g(e,[t,...n])}function de(e,t,r=[]){const n=p(e,r),s=n.filter(o=>o!==t);s.length!==n.length&&g(e,s)}function le(e,t,r){const n=e.indexOf(t),s=e.indexOf(r);if(n===-1||s===-1||n===s)return e;const o=[...e],[i]=o.splice(n,1);return i===void 0?e:(o.splice(s,0,i),o)}function fe(e,t,r,n){if(e==="org")return n;const s=p(t,r),o=new Set(n),i=s.filter(u=>!o.has(u));return[...n,...i]}function ge(e,t,r){const n=I(e,r),s=I(t,r);return n===s}const y=f.createContext(null);function pe(e){const t=C.c(7),{children:r}=e,[n,s]=f.useState(!1),[o,i]=f.useState(0);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i(z),t[0]=u):u=t[0];const c=u;let a;t[1]!==n||t[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:c},t[1]=n,t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==r||t[5]!==a?(l=j.jsx(y.Provider,{value:a,children:r}),t[4]=r,t[5]=a,t[6]=l):l=t[6],l}function z(e){return e+1}function he(){return f.useContext(y)?.empty??!1}function Oe(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function me(e){const{value:t}=e,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==t&&(r.setEmpty(t),s(t)),null}function Se(){const e=C.c(9),t=N(),{org:r}=D(),n=q(),{data:s}=F.useSession(),o=s?.user?.id??"anon";let i;e[0]!==n?(i=n.filter(Z).map(X),e[0]=n,e[1]=i):i=e[1];const u=i,c=H();let a;return e[2]!==c||e[3]!==t||e[4]!==r.id||e[5]!==r.slug||e[6]!==u||e[7]!==o?(a=(l,x)=>{W({orgId:r.id,userId:o},l,u),c();const _=crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:_},search:{...x?.search??{},virtualmcpid:l}})},e[2]=c,e[3]=t,e[4]=r.id,e[5]=r.slug,e[6]=u,e[7]=o,e[8]=a):a=e[8],a}function X(e){return e.id}function Z(e){return!!e.pinned}export{me as S,h as T,H as a,W as b,ge as c,fe as d,se as e,ne as f,ue as g,ae as h,Oe as i,re as j,Se as k,te as l,de as m,ce as n,pe as o,ie as p,le as r,oe as s,he as u};
1
+ import{L as v,r as f,e as C,j,f as N,q as D,b as F}from"./index-DHxOddsj.js";import{a as q}from"./use-virtual-mcp-C6pMpGrR.js";const h="__tool_call_runs__",w=["requires_action","in_progress","failed","expired","completed"];function te(e){const t=new Map(w.map(r=>[r,[]]));for(const r of e){const n=r.status??"completed";(t.get(n)??t.get("completed")).push(r)}return w.map(r=>({status:r,threads:t.get(r)}))}function re(e,t){const r=new Map;for(const u of e){if(u.id.startsWith("thrd_welcome_"))continue;const c=u.virtual_mcp_id??h,a=r.get(c);a?(a.threads.push(u),(u.updated_at??"")>a.latestUpdatedAt&&(a.latestUpdatedAt=u.updated_at??"")):r.set(c,{virtualMcpId:c,threads:[u],latestUpdatedAt:u.updated_at??""})}const n=t!==null?r.get(t):void 0;n&&t&&r.delete(t);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((u,c)=>c.latestUpdatedAt.localeCompare(u.latestUpdatedAt)),i=[];return n&&n.threads.length>0&&i.push(n),i.push(...o),s&&s.threads.length>0&&i.push(s),i}const R=new Map,A=new Map;function P(e){return`${e.orgId}:${e.userId}`}function E(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function T(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function $(e){const t=P(e),r=R.get(t);if(r)return r;const n=v.sidebarGroupOrder(e.orgId,e.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&e.userId!=="anon"){const i=O(E(e.orgId));i.length>0&&(o=i)}return R.set(t,o),o}function p(e,t){const r=new Set(t);return $(e).filter(n=>!r.has(n))}function g(e,t){R.set(P(e),t),T(v.sidebarGroupOrder(e.orgId,e.userId),t)}function m(e){const t=A.get(e);if(t)return t;const r=O(v.sidebarOrgPinnedOrder(e));return A.set(e,r),r}function S(e,t){A.set(e,t),T(v.sidebarOrgPinnedOrder(e),t)}function ne(e,t){g(e,t)}function se(e,t){S(e,t)}function k(e,t){return e===t||e===h}function I(e,t){return t.includes(e)}function B(e,t){return e.map(r=>r.virtualMcpId).filter(r=>!k(r,t))}function oe(e,t,r,n){const s=new Set(n);return B(e,r).filter(o=>t==="org"?s.has(o):!s.has(o))}function J(e,t){const r=new Set(e),n=t.filter(s=>!r.has(s));return n.length===0?e:[...e,...n]}function ie(e,t,r){const n=new Set(r),s=[],o=[];let i,u;for(const c of e){const a=c.virtualMcpId;if(t&&a===t){i=c;continue}if(a===h){u=c;continue}if(n.has(a)){s.push(c);continue}o.push(c)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:u}}function L(e,t,r,n=[],s=[]){const o=r?e.find(d=>d.virtualMcpId===r):void 0,i=e.find(d=>d.virtualMcpId===h),u=new Set(n),c=n.filter(d=>!k(d,r)),a=J(s,c),l=t.filter(d=>!u.has(d)),x=new Map(e.map(d=>[d.virtualMcpId,d])),_=d=>{const U=x.get(d);return U||{virtualMcpId:d,threads:[],latestUpdatedAt:""}},G=a.filter(d=>u.has(d)).map(_),K=l.map(_),b=[];return o&&b.push(o),b.push(...G,...K),i&&b.push(i),{groups:b,userOrder:l,orgOrder:G.map(d=>d.virtualMcpId)}}function Y(e,t){const r=new Set(t);m(e.orgId).length===0&&t.length>0&&S(e.orgId,[...t]);const s=v.sidebarGroupOrder(e.orgId,e.userId);if(O(s).length>0)return;const o=O(E(e.orgId));if(o.length===0)return;const i=o.filter(u=>!r.has(u));g(e,i)}function M(e,t){const r=new Set(t),n=$(e),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(e,s)}function ue(e,t,r,n=[]){Y(e,n),M(e,n);const s=p(e,n),o=m(e.orgId),{userOrder:i,orgOrder:u}=L(t,s,r,n,o);(i.length!==s.length||i.some((c,a)=>c!==s[a]))&&g(e,i),(u.length!==o.length||u.some((c,a)=>c!==o[a]))&&S(e.orgId,u)}function ae(e,t,r,n=[]){const s=p(e,n),o=m(e.orgId);return L(t,s,r,n,o).groups}function ce(e,t,r){if(r){const o=p(e,[t]).filter(u=>u!==t);g(e,o);const i=m(e.orgId);i.includes(t)||S(e.orgId,[...i,t]);return}const n=m(e.orgId).filter(o=>o!==t);S(e.orgId,n);const s=p(e,[]);s.includes(t)||g(e,[...s,t])}function W(e,t,r=[]){if(r.includes(t))return;const n=p(e,r);n.includes(t)||g(e,[t,...n])}function de(e,t,r=[]){const n=p(e,r),s=n.filter(o=>o!==t);s.length!==n.length&&g(e,s)}function le(e,t,r){const n=e.indexOf(t),s=e.indexOf(r);if(n===-1||s===-1||n===s)return e;const o=[...e],[i]=o.splice(n,1);return i===void 0?e:(o.splice(s,0,i),o)}function fe(e,t,r,n){if(e==="org")return n;const s=p(t,r),o=new Set(n),i=s.filter(u=>!o.has(u));return[...n,...i]}function ge(e,t,r){const n=I(e,r),s=I(t,r);return n===s}const y=f.createContext(null);function pe(e){const t=C.c(7),{children:r}=e,[n,s]=f.useState(!1),[o,i]=f.useState(0);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i(z),t[0]=u):u=t[0];const c=u;let a;t[1]!==n||t[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:c},t[1]=n,t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==r||t[5]!==a?(l=j.jsx(y.Provider,{value:a,children:r}),t[4]=r,t[5]=a,t[6]=l):l=t[6],l}function z(e){return e+1}function he(){return f.useContext(y)?.empty??!1}function Oe(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function me(e){const{value:t}=e,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==t&&(r.setEmpty(t),s(t)),null}function Se(){const e=C.c(9),t=N(),{org:r}=D(),n=q(),{data:s}=F.useSession(),o=s?.user?.id??"anon";let i;e[0]!==n?(i=n.filter(Z).map(X),e[0]=n,e[1]=i):i=e[1];const u=i,c=H();let a;return e[2]!==c||e[3]!==t||e[4]!==r.id||e[5]!==r.slug||e[6]!==u||e[7]!==o?(a=(l,x)=>{W({orgId:r.id,userId:o},l,u),c();const _=crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:_},search:{...x?.search??{},virtualmcpid:l}})},e[2]=c,e[3]=t,e[4]=r.id,e[5]=r.slug,e[6]=u,e[7]=o,e[8]=a):a=e[8],a}function X(e){return e.id}function Z(e){return!!e.pinned}export{me as S,h as T,H as a,W as b,ge as c,fe as d,se as e,ne as f,ue as g,ae as h,Oe as i,re as j,Se as k,te as l,de as m,ce as n,pe as o,ie as p,le as r,oe as s,he as u};
@@ -1 +1 @@
1
- import{e as q,q as x,b as i}from"./index-DxEUOQQs.js";function A(){const e=q.c(32),{org:O}=x(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{e as q,q as x,b as i}from"./index-DHxOddsj.js";function A(){const e=q.c(32),{org:O}=x(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
@@ -1 +1 @@
1
- import{e as u,n as S,G as l,a as y,K as c}from"./index-DxEUOQQs.js";function w(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoStatus(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/status`);if(!r.ok)throw new Error("Failed to check SSO status");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function q(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoConfig(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`);if(!r.ok)throw new Error("Failed to fetch SSO config");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function C(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to save SSO config")}return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function O(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`,{method:"DELETE"});if(!r.ok)throw new Error("Failed to delete SSO config");return r.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function m(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:r})});if(!f.ok)throw new Error("Failed to toggle SSO enforcement");return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}export{q as a,C as b,O as c,m as d,w as u};
1
+ import{e as u,n as S,G as l,a as y,K as c}from"./index-DHxOddsj.js";function w(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoStatus(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/status`);if(!r.ok)throw new Error("Failed to check SSO status");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function q(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoConfig(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`);if(!r.ok)throw new Error("Failed to fetch SSO config");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function C(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to save SSO config")}return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function O(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`,{method:"DELETE"});if(!r.ok)throw new Error("Failed to delete SSO config");return r.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function m(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:r})});if(!f.ok)throw new Error("Failed to toggle SSO enforcement");return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}export{q as a,C as b,O as c,m as d,w as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-D_nAk9Nf.js";import{q as b,n as P,K as y}from"./index-DxEUOQQs.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-DwSMx4xq.js";import{q as b,n as P,K as y}from"./index-DHxOddsj.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -1 +1 @@
1
- import{K as g,e as c,q as _,n as z,G as C,a as G,r as P}from"./index-DxEUOQQs.js";import{a as h,u as A,W as R}from"./use-mcp-client-BW6MR0tW.js";const S={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}};function O(t,e){return{queryKey:g.organizationSettings(e),queryFn:async()=>{const n=await t.callTool({name:"ORGANIZATION_SETTINGS_GET",arguments:{}});return n?.isError?{...S,organizationId:e}:n.structuredContent??{...S,organizationId:e}},staleTime:6e4}}function E(t){const e=c.c(9),{org:n}=_();let s;e[0]!==n.id||e[1]!==n.slug?(s={connectionId:h,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const r=A(s);let i;e[3]!==r||e[4]!==n.id?(i=O(r,n.id),e[3]=r,e[4]=n.id,e[5]=i):i=e[5];const o=t;let a;return e[6]!==i||e[7]!==o?(a={...i,select:o},e[6]=i,e[7]=o,e[8]=a):a=e[8],z(a)}function Y(t,e){const n=c.c(6);let s;n[0]!==t||n[1]!==e?(s={connectionId:h,orgId:t,orgSlug:e},n[0]=t,n[1]=e,n[2]=s):s=n[2];const r=A(s);let i;n[3]!==r||n[4]!==t?(i=O(r,t),n[3]=r,n[4]=t,n[5]=i):i=n[5];const{data:o}=z(i);return o??null}function T(){const t=c.c(12),{org:e}=_();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:h,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=A(n),r=C();let i;t[3]!==s||t[4]!==e.id?(i=async l=>{const u=await s.callTool({name:"ORGANIZATION_SETTINGS_UPDATE",arguments:{organizationId:e.id,...l}});if(u?.isError)throw new Error(u.content?.[0]?.text??"Failed to update organization settings");const f=u.structuredContent;if(!f)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return f},t[3]=s,t[4]=e.id,t[5]=i):i=t[5];let o;t[6]!==e.id||t[7]!==r?(o=l=>{r.setQueryData(g.organizationSettings(e.id),u=>({...u??S,...l}))},t[6]=e.id,t[7]=r,t[8]=o):o=t[8];let a;return t[9]!==i||t[10]!==o?(a={mutationFn:i,onSuccess:o},t[9]=i,t[10]=o,t[11]=a):a=t[11],G(a)}function b(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_research:t.tiers.web_research??null}}:N}function H(){const{data:t}=E(Q);return t??N}function Q(t){return b(t.simple_mode)}function L(){const t=c.c(7),e=T();let n,s;t[0]!==e?(n=(i,o)=>e.mutate({simple_mode:i},o),s=(i,o)=>e.mutateAsync({simple_mode:i},o),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let r;return t[3]!==e||t[4]!==n||t[5]!==s?(r={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=r):r=t[6],r}function $(){const{data:t}=E(x);return t??null}function x(t){return t.registry_config}function W(){const t=c.c(7),e=T();let n,s;t[0]!==e?(n=(i,o)=>e.mutate({registry_config:i},o),s=(i,o)=>e.mutateAsync({registry_config:i},o),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let r;return t[3]!==e||t[4]!==n||t[5]!==s?(r={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=r):r=t[6],r}function Z(){const{data:t}=E(q);return t??null}function q(t){return t.default_home_agents}function U(){const t=c.c(7),e=T();let n,s;t[0]!==e?(n=(i,o)=>e.mutate({default_home_agents:i},o),s=(i,o)=>e.mutateAsync({default_home_agents:i},o),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let r;return t[3]!==e||t[4]!==n||t[5]!==s?(r={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=r):r=t[6],r}function j(){const t=c.c(14),{org:e}=_(),n=U(),s=C();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Promise.resolve(),t[0]=r):r=t[0];const i=P.useRef(r);let o;t[1]!==e.id?(o=g.organizationSettings(e.id),t[1]=e.id,t[2]=o):o=t[2];const a=o;let l;t[3]!==a||t[4]!==s?(l=()=>s.getQueryData(a)?.default_home_agents?.ids??[],t[3]=a,t[4]=s,t[5]=l):l=t[5];const u=l;let f;t[6]!==a||t[7]!==e.slug||t[8]!==s||t[9]!==n?(f=D=>{const I=i.current.then(async()=>{const w=s.getQueryData(a),p=D(w?.default_home_agents?.ids??[]);if(p!==null){s.setQueryData(a,m=>m&&{...m,default_home_agents:{ids:p}});try{await n.mutateAsync({ids:p}),await s.refetchQueries({queryKey:g.homeNextActions(e.slug),type:"active"})}catch(m){const M=m;throw s.setQueryData(a,w),M}}});return i.current=I.catch(k),I},t[6]=a,t[7]=e.slug,t[8]=s,t[9]=n,t[10]=f):f=t[10];const y=f;let d;return t[11]!==y||t[12]!==u?(d={currentIds:u,apply:y},t[11]=y,t[12]=u,t[13]=d):d=t[13],d}function k(){}function B(){const t=c.c(5),{org:e}=_(),n=$();let s;t[0]!==e.id?(s=R.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const r=s;let i;return t[2]!==r||t[3]!==n?(i=o=>{if(!n)return o===r;const a=n.registries[o];return a?a.enabled:o===r},t[2]=r,t[3]=n,t[4]=i):i=t[4],i}export{j as a,B as b,Y as c,T as d,H as e,L as f,$ as g,W as h,O as o,Z as u};
1
+ import{K as g,e as c,q as _,n as z,G as C,a as G,r as P}from"./index-DHxOddsj.js";import{a as h,u as A,W as R}from"./use-mcp-client-Bbkq-Btq.js";const S={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}};function O(t,e){return{queryKey:g.organizationSettings(e),queryFn:async()=>{const n=await t.callTool({name:"ORGANIZATION_SETTINGS_GET",arguments:{}});return n?.isError?{...S,organizationId:e}:n.structuredContent??{...S,organizationId:e}},staleTime:6e4}}function E(t){const e=c.c(9),{org:n}=_();let s;e[0]!==n.id||e[1]!==n.slug?(s={connectionId:h,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const r=A(s);let i;e[3]!==r||e[4]!==n.id?(i=O(r,n.id),e[3]=r,e[4]=n.id,e[5]=i):i=e[5];const o=t;let a;return e[6]!==i||e[7]!==o?(a={...i,select:o},e[6]=i,e[7]=o,e[8]=a):a=e[8],z(a)}function Y(t,e){const n=c.c(6);let s;n[0]!==t||n[1]!==e?(s={connectionId:h,orgId:t,orgSlug:e},n[0]=t,n[1]=e,n[2]=s):s=n[2];const r=A(s);let i;n[3]!==r||n[4]!==t?(i=O(r,t),n[3]=r,n[4]=t,n[5]=i):i=n[5];const{data:o}=z(i);return o??null}function T(){const t=c.c(12),{org:e}=_();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:h,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=A(n),r=C();let i;t[3]!==s||t[4]!==e.id?(i=async l=>{const u=await s.callTool({name:"ORGANIZATION_SETTINGS_UPDATE",arguments:{organizationId:e.id,...l}});if(u?.isError)throw new Error(u.content?.[0]?.text??"Failed to update organization settings");const f=u.structuredContent;if(!f)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return f},t[3]=s,t[4]=e.id,t[5]=i):i=t[5];let o;t[6]!==e.id||t[7]!==r?(o=l=>{r.setQueryData(g.organizationSettings(e.id),u=>({...u??S,...l}))},t[6]=e.id,t[7]=r,t[8]=o):o=t[8];let a;return t[9]!==i||t[10]!==o?(a={mutationFn:i,onSuccess:o},t[9]=i,t[10]=o,t[11]=a):a=t[11],G(a)}function b(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_research:t.tiers.web_research??null}}:N}function H(){const{data:t}=E(Q);return t??N}function Q(t){return b(t.simple_mode)}function L(){const t=c.c(7),e=T();let n,s;t[0]!==e?(n=(i,o)=>e.mutate({simple_mode:i},o),s=(i,o)=>e.mutateAsync({simple_mode:i},o),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let r;return t[3]!==e||t[4]!==n||t[5]!==s?(r={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=r):r=t[6],r}function $(){const{data:t}=E(x);return t??null}function x(t){return t.registry_config}function W(){const t=c.c(7),e=T();let n,s;t[0]!==e?(n=(i,o)=>e.mutate({registry_config:i},o),s=(i,o)=>e.mutateAsync({registry_config:i},o),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let r;return t[3]!==e||t[4]!==n||t[5]!==s?(r={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=r):r=t[6],r}function Z(){const{data:t}=E(q);return t??null}function q(t){return t.default_home_agents}function U(){const t=c.c(7),e=T();let n,s;t[0]!==e?(n=(i,o)=>e.mutate({default_home_agents:i},o),s=(i,o)=>e.mutateAsync({default_home_agents:i},o),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let r;return t[3]!==e||t[4]!==n||t[5]!==s?(r={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=r):r=t[6],r}function j(){const t=c.c(14),{org:e}=_(),n=U(),s=C();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Promise.resolve(),t[0]=r):r=t[0];const i=P.useRef(r);let o;t[1]!==e.id?(o=g.organizationSettings(e.id),t[1]=e.id,t[2]=o):o=t[2];const a=o;let l;t[3]!==a||t[4]!==s?(l=()=>s.getQueryData(a)?.default_home_agents?.ids??[],t[3]=a,t[4]=s,t[5]=l):l=t[5];const u=l;let f;t[6]!==a||t[7]!==e.slug||t[8]!==s||t[9]!==n?(f=D=>{const I=i.current.then(async()=>{const w=s.getQueryData(a),p=D(w?.default_home_agents?.ids??[]);if(p!==null){s.setQueryData(a,m=>m&&{...m,default_home_agents:{ids:p}});try{await n.mutateAsync({ids:p}),await s.refetchQueries({queryKey:g.homeNextActions(e.slug),type:"active"})}catch(m){const M=m;throw s.setQueryData(a,w),M}}});return i.current=I.catch(k),I},t[6]=a,t[7]=e.slug,t[8]=s,t[9]=n,t[10]=f):f=t[10];const y=f;let d;return t[11]!==y||t[12]!==u?(d={currentIds:u,apply:y},t[11]=y,t[12]=u,t[13]=d):d=t[13],d}function k(){}function B(){const t=c.c(5),{org:e}=_(),n=$();let s;t[0]!==e.id?(s=R.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const r=s;let i;return t[2]!==r||t[3]!==n?(i=o=>{if(!n)return o===r;const a=n.registries[o];return a?a.enabled:o===r},t[2]=r,t[3]=n,t[4]=i):i=t[4],i}export{j as a,B as b,Y as c,T as d,H as e,L as f,$ as g,W as h,O as o,Z as u};
@@ -1 +1 @@
1
- import{e as a,q as C}from"./index-DxEUOQQs.js";import{u as R}from"./use-connection-7yE-FpPg.js";import{W as u}from"./use-mcp-client-BW6MR0tW.js";import{g as p}from"./use-organization-settings-Ds8za6ZV.js";function E(){const e=a.c(17),{org:i}=C(),o=p();let n;e[0]!==i.id?(n=u.REGISTRY(i.id),e[0]=i.id,e[1]=n):n=e[1];const c=n;let l;e[2]!==i.id?(l=u.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=l):l=e[3];const d=l;let r;e[4]!==d||e[5]!==c?(r=[c,d],e[4]=d,e[5]=c,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const m of s)t.add(m)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const g=R();let f;if(e[12]!==g||e[13]!==t){let s;e[15]!==t?(s=m=>t.has(m.id),e[15]=t,e[16]=s):s=e[16],f=g.filter(s),e[12]=g,e[13]=t,e[14]=f}else f=e[14];return f}export{E as u};
1
+ import{e as a,q as C}from"./index-DHxOddsj.js";import{u as R}from"./use-connection-Cygt3JAU.js";import{W as u}from"./use-mcp-client-Bbkq-Btq.js";import{g as p}from"./use-organization-settings-6ykeD7wG.js";function E(){const e=a.c(17),{org:i}=C(),o=p();let n;e[0]!==i.id?(n=u.REGISTRY(i.id),e[0]=i.id,e[1]=n):n=e[1];const c=n;let l;e[2]!==i.id?(l=u.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=l):l=e[3];const d=l;let r;e[4]!==d||e[5]!==c?(r=[c,d],e[4]=d,e[5]=c,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const m of s)t.add(m)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const g=R();let f;if(e[12]!==g||e[13]!==t){let s;e[15]!==t?(s=m=>t.has(m.id),e[15]=t,e[16]=s):s=e[16],f=g.filter(s),e[12]=g,e[13]=t,e[14]=f}else f=e[14];return f}export{E as u};
@@ -1 +1 @@
1
- import{e as n,q as r,K as c,s as y,G as d,a as S}from"./index-DxEUOQQs.js";import{u as l}from"./studio-tools-CdiIGNug.js";function C(){const e=n.c(7),{org:o}=r(),u=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]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,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:a}=y(s);return a.secrets}function p(){const e=n.c(8),{org:o}=r(),u=l(),i=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==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 a;return e[5]!==t||e[6]!==s?(a={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=a):a=e[7],S(a)}export{p as a,C as u};
1
+ import{e as n,q as r,K as c,s as y,G as d,a as S}from"./index-DHxOddsj.js";import{u as l}from"./studio-tools-CH7dZ7HT.js";function C(){const e=n.c(7),{org:o}=r(),u=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]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,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:a}=y(s);return a.secrets}function p(){const e=n.c(8),{org:o}=r(),u=l(),i=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==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 a;return e[5]!==t||e[6]!==s?(a={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=a):a=e[7],S(a)}export{p as a,C as u};
@@ -0,0 +1 @@
1
+ import{r as o,e as T,a0 as h}from"./index-DHxOddsj.js";import{p as R,q as I}from"./question-004-sINsf4GQ.js";import{D as S}from"./watch-sse-pool-CuN8_Ws2.js";import{d as y}from"./decopilot-sse-pool-8baykh62.js";const b=()=>0;function D(s){const{orgSlug:e,taskId:n,enabled:t=!0,onStep:r,onFinish:u,onTaskStatus:f}=s,l=o.useRef({taskId:n,onStep:r,onFinish:u,onTaskStatus:f});l.current={taskId:n,onStep:r,onFinish:u,onTaskStatus:f};const i=o.useRef(null),p=o.useRef(t),d=o.useRef(e);(!i.current||p.current!==t||d.current!==e)&&(p.current=t,d.current=e,i.current=m=>{if(!t||!e)return()=>{};const E=k=>{let a;try{a=JSON.parse(k.data)}catch{return}const c=l.current;if(!(c.taskId&&a.subject!==c.taskId)){switch(a.type){case S.STEP:c.onStep?.(a);break;case S.FINISH:c.onFinish?.(a);break;case S.THREAD_STATUS:c.onTaskStatus?.(a);break}m()}};return y.subscribe(e,E)}),o.useSyncExternalStore(i.current,b,b)}const O=new Set(["completed","failed","requires_action"]);function q(s){const e=T.c(5),[n]=h();let t;e[0]!==n?(t=u=>{n.enableSounds&&O.has(u.data.status)&&R(I.dataUri).catch(_)},e[0]=n,e[1]=t):t=e[1];let r;e[2]!==s||e[3]!==t?(r={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=r):r=e[4],D(r)}function _(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +1 @@
1
- import{e as p,r as f}from"./index-DxEUOQQs.js";import{u as w}from"./tooltip-BIymZbyc.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
1
+ import{e as p,r as f}from"./index-DHxOddsj.js";import{u as w}from"./tooltip-6OktDyzD.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
@@ -1 +1 @@
1
- import{e as a,q as d,aO as p,n as P}from"./index-DxEUOQQs.js";import{b as L,a as V,u as _,c as A}from"./use-collections-CPla-8Z_.js";import{a as g,u as I}from"./use-mcp-client-BW6MR0tW.js";function v(s){const t=a.c(5);let e;t[0]!==s?(e=s===void 0?{}:s,t[0]=s,t[1]=e):e=t[1];const n=e,{org:i}=d();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=I(o);return L(i.id,"VIRTUAL_MCP",l,n)}function R(s,t,e){return A(s,"VIRTUAL_MCP",t??void 0,e)}function b(s){const t=a.c(3),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);return _(e.id,"VIRTUAL_MCP",s??void 0,i)}function E(s){const t=a.c(15),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);let o,l,c;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),c=P,l=p.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=c):(o=t[5],l=t[6],c=t[7]);const C=o.length>0;let u;t[8]!==i||t[9]!==o?(u=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==C||t[13]!==u?(r={queryKey:l,enabled:C,staleTime:3e4,queryFn:u},t[11]=l,t[12]=C,t[13]=u,t[14]=r):r=t[14],c(r)}function $(){const s=a.c(3),{org:t}=d();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=I(e);return V(t.id,"VIRTUAL_MCP",n)}export{v as a,$ as b,E as c,b as u,R as v};
1
+ import{e as a,q as d,aO as p,n as P}from"./index-DHxOddsj.js";import{b as L,a as V,u as _,c as A}from"./use-collections-3gcbdMo5.js";import{a as g,u as I}from"./use-mcp-client-Bbkq-Btq.js";function v(s){const t=a.c(5);let e;t[0]!==s?(e=s===void 0?{}:s,t[0]=s,t[1]=e):e=t[1];const n=e,{org:i}=d();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=I(o);return L(i.id,"VIRTUAL_MCP",l,n)}function R(s,t,e){return A(s,"VIRTUAL_MCP",t??void 0,e)}function b(s){const t=a.c(3),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);return _(e.id,"VIRTUAL_MCP",s??void 0,i)}function E(s){const t=a.c(15),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);let o,l,c;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),c=P,l=p.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=c):(o=t[5],l=t[6],c=t[7]);const C=o.length>0;let u;t[8]!==i||t[9]!==o?(u=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==C||t[13]!==u?(r={queryKey:l,enabled:C,staleTime:3e4,queryFn:u},t[11]=l,t[12]=C,t[13]=u,t[14]=r):r=t[14],c(r)}function $(){const s=a.c(3),{org:t}=d();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=I(e);return V(t.id,"VIRTUAL_MCP",n)}export{v as a,$ as b,E as c,b as u,R as v};
@@ -0,0 +1 @@
1
+ import{I as u}from"./infiniteQueryObserver-Da-l1Mrb.js";import{cG as i}from"./index-DHxOddsj.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{bo as s,r as c,bT as a,bU as i}from"./index-DxEUOQQs.js";function f(r){const n=s({warn:r?.router===void 0}),t=r?.router||n,u=c.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
1
+ import{bo as s,r as c,bT as a,bU as i}from"./index-DHxOddsj.js";function f(r){const n=s({warn:r?.router===void 0}),t=r?.router||n,u=c.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./infiniteQueryObserver-Da-l1Mrb.js";import{cG as u,aF as n}from"./index-DHxOddsj.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +1 @@
1
- import{e as w,n as k,K as S,c as y,j as t}from"./index-DxEUOQQs.js";import{A as E}from"./avatar-BL6j7EM4.js";import{u as K}from"./studio-tools-CdiIGNug.js";function R(r){const e=w.c(9),p=K();let m;e[0]!==r?(m=S.user(r),e[0]=r,e[1]=m):m=e[1];let o;e[2]!==p||e[3]!==r?(o=async()=>{const{user:n}=await p.call("USER_GET",{id:r});return n},e[2]=p,e[3]=r,e[4]=o):o=e[4];const x=!!r;let s;return e[5]!==m||e[6]!==o||e[7]!==x?(s={queryKey:m,queryFn:o,staleTime:3e5,retry:1,enabled:x},e[5]=m,e[6]=o,e[7]=x,e[8]=s):s=e[8],k(s)}function A(r){const e=w.c(36),{id:p,size:m,showEmail:o,avatarOnly:x,className:s}=r,n=m===void 0?"xs":m,u=o===void 0?!1:o,d=x===void 0?!1:x,{data:c,isLoading:U,isError:b}=R(p);if(U){let l;e[0]!==s?(l=y("flex items-center gap-2",s),e[0]=s,e[1]=l):l=e[1];let a;e[2]!==n?(a=t.jsx(E.Skeleton,{shape:"circle",size:n}),e[2]=n,e[3]=a):a=e[3];let i;e[4]!==d||e[5]!==u?(i=!d&&t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),u&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"})]}),e[4]=d,e[5]=u,e[6]=i):i=e[6];let f;return e[7]!==l||e[8]!==a||e[9]!==i?(f=t.jsxs("div",{className:l,children:[a,i]}),e[7]=l,e[8]=a,e[9]=i,e[10]=f):f=e[10],f}if(b||!c){let l;e[11]!==s?(l=y("flex items-center gap-2",s),e[11]=s,e[12]=l):l=e[12];let a;e[13]!==n?(a=t.jsx(E,{shape:"circle",size:n,fallback:"?",muted:!0}),e[13]=n,e[14]=a):a=e[14];let i;e[15]!==d?(i=!d&&t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[15]=d,e[16]=i):i=e[16];let f;return e[17]!==l||e[18]!==a||e[19]!==i?(f=t.jsxs("div",{className:l,children:[a,i]}),e[17]=l,e[18]=a,e[19]=i,e[20]=f):f=e[20],f}let v;e[21]!==s?(v=y("flex items-center gap-2",s),e[21]=s,e[22]=v):v=e[22];const g=c.image??void 0;let h;e[23]!==n||e[24]!==g||e[25]!==c.name?(h=t.jsx(E,{shape:"circle",size:n,url:g,fallback:c.name}),e[23]=n,e[24]=g,e[25]=c.name,e[26]=h):h=e[26];let j;e[27]!==d||e[28]!==u||e[29]!==c.email||e[30]!==c.name?(j=!d&&t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-sm font-medium",children:c.name}),u&&t.jsx("div",{className:"text-xs text-muted-foreground",children:c.email})]}),e[27]=d,e[28]=u,e[29]=c.email,e[30]=c.name,e[31]=j):j=e[31];let N;return e[32]!==v||e[33]!==h||e[34]!==j?(N=t.jsxs("div",{className:v,children:[h,j]}),e[32]=v,e[33]=h,e[34]=j,e[35]=N):N=e[35],N}export{A as U};
1
+ import{e as w,n as k,K as S,c as y,j as t}from"./index-DHxOddsj.js";import{A as E}from"./avatar-Bg8Fajzf.js";import{u as K}from"./studio-tools-CH7dZ7HT.js";function R(r){const e=w.c(9),p=K();let m;e[0]!==r?(m=S.user(r),e[0]=r,e[1]=m):m=e[1];let o;e[2]!==p||e[3]!==r?(o=async()=>{const{user:n}=await p.call("USER_GET",{id:r});return n},e[2]=p,e[3]=r,e[4]=o):o=e[4];const x=!!r;let s;return e[5]!==m||e[6]!==o||e[7]!==x?(s={queryKey:m,queryFn:o,staleTime:3e5,retry:1,enabled:x},e[5]=m,e[6]=o,e[7]=x,e[8]=s):s=e[8],k(s)}function A(r){const e=w.c(36),{id:p,size:m,showEmail:o,avatarOnly:x,className:s}=r,n=m===void 0?"xs":m,u=o===void 0?!1:o,d=x===void 0?!1:x,{data:c,isLoading:U,isError:b}=R(p);if(U){let l;e[0]!==s?(l=y("flex items-center gap-2",s),e[0]=s,e[1]=l):l=e[1];let a;e[2]!==n?(a=t.jsx(E.Skeleton,{shape:"circle",size:n}),e[2]=n,e[3]=a):a=e[3];let i;e[4]!==d||e[5]!==u?(i=!d&&t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),u&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"})]}),e[4]=d,e[5]=u,e[6]=i):i=e[6];let f;return e[7]!==l||e[8]!==a||e[9]!==i?(f=t.jsxs("div",{className:l,children:[a,i]}),e[7]=l,e[8]=a,e[9]=i,e[10]=f):f=e[10],f}if(b||!c){let l;e[11]!==s?(l=y("flex items-center gap-2",s),e[11]=s,e[12]=l):l=e[12];let a;e[13]!==n?(a=t.jsx(E,{shape:"circle",size:n,fallback:"?",muted:!0}),e[13]=n,e[14]=a):a=e[14];let i;e[15]!==d?(i=!d&&t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[15]=d,e[16]=i):i=e[16];let f;return e[17]!==l||e[18]!==a||e[19]!==i?(f=t.jsxs("div",{className:l,children:[a,i]}),e[17]=l,e[18]=a,e[19]=i,e[20]=f):f=e[20],f}let v;e[21]!==s?(v=y("flex items-center gap-2",s),e[21]=s,e[22]=v):v=e[22];const g=c.image??void 0;let h;e[23]!==n||e[24]!==g||e[25]!==c.name?(h=t.jsx(E,{shape:"circle",size:n,url:g,fallback:c.name}),e[23]=n,e[24]=g,e[25]=c.name,e[26]=h):h=e[26];let j;e[27]!==d||e[28]!==u||e[29]!==c.email||e[30]!==c.name?(j=!d&&t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-sm font-medium",children:c.name}),u&&t.jsx("div",{className:"text-xs text-muted-foreground",children:c.email})]}),e[27]=d,e[28]=u,e[29]=c.email,e[30]=c.name,e[31]=j):j=e[31];let N;return e[32]!==v||e[33]!==h||e[34]!==j?(N=t.jsxs("div",{className:v,children:[h,j]}),e[32]=v,e[33]=h,e[34]=j,e[35]=N):N=e[35],N}export{A as U};
@@ -1 +1 @@
1
- import{e as k,r as C,c as x,j as i}from"./index-DxEUOQQs.js";import{b as I,T as P,a as L}from"./tooltip-BIymZbyc.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};
1
+ import{e as k,r as C,c as x,j as i}from"./index-DHxOddsj.js";import{b as I,T as P,a as L}from"./tooltip-6OktDyzD.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};
@@ -0,0 +1 @@
1
+ import"./index-DHxOddsj.js";const y={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(y);function _(n,l,i,o,c){const a=Math.min(n,l*o**i);return(1-c*Math.random())*a}const v=3e4,D=1e3;function O(n){const{buildUrl:l,eventTypes:i,name:o,crossTab:c=!1}=n,a=new Map,u=c&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(u&&!o)throw new Error("createSSESubscription: `name` is required when crossTab");function d(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(l(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&C(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),d(e,r)};for(const r of i)t.addEventListener(r,s)}function C(e){if(e.refCount<=0||e.reconnectTimer)return;const t=_(v,D,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function m(e){if(!u){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${o}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function L(e,t){t.kind==="event"?d(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function A(e){const t=a.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(a.set(e,s),u){const r=new BroadcastChannel(`sse:${o}:${e}`);r.onmessage=f=>L(s,f.data),s.channel=r}return m(s),s}function k(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,a.delete(e.key)}return{subscribe(e,t,s){const r=A(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let f=!1;return()=>{f||(f=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&k(r))}}}}function w(n,l){const i=new Set(l);return{subscribe(o,c,a){const u=d=>{i.has(d.type)&&c(d)};return n.subscribe(o,u,a)}}}const b=["workflow.execution.created","workflow.execution.resumed","workflow.step.execute","workflow.step.completed"],g=[...p,"workflow.*"],M=[...p,...b],S=O({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${g.join(",")}`,eventTypes:M,crossTab:!0}),H=w(S,[...p]),P=w(S,b);export{y as D,H as d,_ as e,P as w};