decocms 4.343.0 → 4.343.2

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 (255) hide show
  1. package/dist/client/assets/{AlertCircle-Dz5YDdyl.js → AlertCircle-C3lmNvI7.js} +1 -1
  2. package/dist/client/assets/{AreaChart-2D1hWNde.js → AreaChart-B8VpHAtM.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Dh3lZGKH.js → ArrowLeft-DOYuHdqD.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-dG47x-aJ.js → ArrowUp-BKeTY9pc.js} +1 -1
  5. package/dist/client/assets/{Check-BGhe3hYT.js → Check-CyygQKSv.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DiuYpy4a.js → CheckCircle-DKLkyTBp.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BPxUlP8f.js → ChevronRight-ChPYF7kd.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-C_g92I2s.js → ChevronSelectorVertical-CQusSGJq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CxsM0T0T.js → ChevronUp-D2ifLHFF.js} +1 -1
  10. package/dist/client/assets/{Copy01-BkIG_r6r.js → Copy01-CZR0_NBF.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-Dq8JE6GO.js → CreditCard01-ClTJTKsq.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-D9n4fXoA.js → DotsVertical-DseLmdya.js} +1 -1
  13. package/dist/client/assets/{Download01-BqI8itPc.js → Download01-Cd-509sk.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-DAc5BWzO.js → ErrorBarContext-_he2ioEc.js} +1 -1
  15. package/dist/client/assets/{Eye-CkZO3gpe.js → Eye-5jzLFztn.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-D9PfAnAV.js → GitBranch01-BJkQ4HEU.js} +1 -1
  17. package/dist/client/assets/{Globe01-CRK32BZK.js → Globe01-7HjOcBCi.js} +1 -1
  18. package/dist/client/assets/{HardDrive-B11XPMuy.js → HardDrive-D7w5UUrV.js} +1 -1
  19. package/dist/client/assets/{Image01-DVAMN0Uk.js → Image01-BVEo4IkB.js} +1 -1
  20. package/dist/client/assets/{Key01-DdwBCg-B.js → Key01-BHyD2JTp.js} +1 -1
  21. package/dist/client/assets/{Link01-DDZBXo_f.js → Link01-CdB_8eIy.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-CvkbivWb.js → LinkExternal01-q_95dzyG.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DJrGGJqs.js → Monitor01-p6YjIdr_.js} +1 -1
  24. package/dist/client/assets/{Package-Ch8J8kh1.js → Package-B2Yk0DwY.js} +1 -1
  25. package/dist/client/assets/{Palette-Cp5SRN6s.js → Palette-CIOYIlw_.js} +1 -1
  26. package/dist/client/assets/{Play-CJFdWpd1.js → Play-3xnUPRmG.js} +1 -1
  27. package/dist/client/assets/{Plus-CXNBcMSU.js → Plus-Bhpd2Txa.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DA6lyMvt.js → SearchMd-BfDJPT5B.js} +1 -1
  29. package/dist/client/assets/{Sector-CkZ4nyCT.js → Sector-VBvFrMV5.js} +1 -1
  30. package/dist/client/assets/{Settings02-CQL9REvt.js → Settings02-Dloc6Zbq.js} +1 -1
  31. package/dist/client/assets/{Share07-CWYFh7o9.js → Share07-C5i27guI.js} +1 -1
  32. package/dist/client/assets/{Shield01-BTw4ZWMg.js → Shield01-BetC14K_.js} +1 -1
  33. package/dist/client/assets/{Stars01-CJ2-eZ97.js → Stars01-6vqrU6Qv.js} +1 -1
  34. package/dist/client/assets/{Sun-DTCXVQJf.js → Sun-BSgUS--3.js} +1 -1
  35. package/dist/client/assets/{Tool01-MngnueBt.js → Tool01-Beyo10kN.js} +1 -1
  36. package/dist/client/assets/{Tool02-Dg06uM7A.js → Tool02-CdNqx7xi.js} +1 -1
  37. package/dist/client/assets/{Trash01-_c67m6fi.js → Trash01-Bitl31BZ.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-CiRMgYDx.js → TrendUp01-Bu8ZAFV0.js} +1 -1
  39. package/dist/client/assets/{Upload01-B1ZCkfJD.js → Upload01-BLNDYtG9.js} +1 -1
  40. package/dist/client/assets/{User01-BFHgHf13.js → User01-B_vrSU38.js} +1 -1
  41. package/dist/client/assets/{UserSquare-CQGCAR_i.js → UserSquare-BbnbLibY.js} +1 -1
  42. package/dist/client/assets/{Users01-Dq6VPx2f.js → Users01-mZ4qVPvR.js} +1 -1
  43. package/dist/client/assets/{Users03-DP2B4Rpd.js → Users03-BZEiCcJJ.js} +1 -1
  44. package/dist/client/assets/{XCircle-DGu6fpfm.js → XCircle-BCMAxLpw.js} +1 -1
  45. package/dist/client/assets/{XClose-6bDucvNV.js → XClose-DyHYfnpP.js} +1 -1
  46. package/dist/client/assets/{Zap-D9229yFc.js → Zap-CEZhUkrh.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-BiEXXJG8.js → ZoomOut-Bppd28Tt.js} +1 -1
  48. package/dist/client/assets/{access-gate-UtJDXw5z.js → access-gate-DDzY4D_D.js} +1 -1
  49. package/dist/client/assets/{agent-icon-REzZvJWL.js → agent-icon-CTK0W6_p.js} +1 -1
  50. package/dist/client/assets/{agents-list-CnPEoG5r.js → agents-list-mtQ7Aeds.js} +1 -1
  51. package/dist/client/assets/{ai-providers-BxBUOuay.js → ai-providers-YIsIT5v9.js} +1 -1
  52. package/dist/client/assets/{alert-D9xllaZN.js → alert-C4IACu9s.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-Cxa7YnKK.js → alert-dialog-DF9WDM8Z.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-srx1sKqa.js → analytics-tab-CYSZBoA9.js} +1 -1
  55. package/dist/client/assets/api-keys-D4LNFeM7.js +1 -0
  56. package/dist/client/assets/{api-keys-CNeFzIYx.js → api-keys-GHMQ-D0X.js} +1 -1
  57. package/dist/client/assets/app-editor-CTIPuKYi.js +1 -0
  58. package/dist/client/assets/{auth-0iRmXalG.js → auth-CBeYawqd.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-DJo3kNrX.js → auth-catchall-1geFs5pE.js} +1 -1
  60. package/dist/client/assets/{auth-entry-CRp-JhUv.js → auth-entry-vUQy6mPR.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-CGWRmmvN.js → auth-split-layout-CQLW5P-e.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-BEdgKv1_.js → authenticate-and-persist-oauth-CsdrVWMd.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-DkQ08Zfz.js → automation-list-row-DxtWQFt4.js} +1 -1
  64. package/dist/client/assets/{automation-runs-Ce0Q6YbM.js → automation-runs-C9pIaaZh.js} +1 -1
  65. package/dist/client/assets/{automations-v-UhLkMV.js → automations-C649YEsP.js} +1 -1
  66. package/dist/client/assets/{autosend-Dtk63JkA.js → autosend-Tg_wsYDg.js} +1 -1
  67. package/dist/client/assets/{avatar-CrZXt8p7.js → avatar-Bdrmd6QQ.js} +1 -1
  68. package/dist/client/assets/{badge-BCKwaV6Y.js → badge-DESV1uy1.js} +1 -1
  69. package/dist/client/assets/{block-document-DwILR83Z.js → block-document-DRhnGkDh.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-DDKSBdmQ.js → breadcrumb-B3SJ7YE8.js} +1 -1
  71. package/dist/client/assets/{buckets-CQ5MqYiG.js → buckets-D5cgZ7T5.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-CFrE6__R.js → bulk-category-panel-DHd0clij.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-By1aQJwM.js → capability-load-error-BHOIZHcV.js} +1 -1
  74. package/dist/client/assets/{cards-foRHRnDL.js → cards-Ep-cCvxW.js} +1 -1
  75. package/dist/client/assets/{category-editor-CTWbZHVY.js → category-editor-BFgFuhP6.js} +1 -1
  76. package/dist/client/assets/{cdn-tab-iNqJg66r.js → cdn-tab-APz-9q2P.js} +1 -1
  77. package/dist/client/assets/{chart-B6-cmhf7.js → chart-BlHocsRF.js} +1 -1
  78. package/dist/client/assets/{chat-context-DAp19Ao-.js → chat-context-cwPd7Rxr.js} +1 -1
  79. package/dist/client/assets/{checkbox-DfnJkNU5.js → checkbox-COd5uMOG.js} +1 -1
  80. package/dist/client/assets/{choose-editor-CZglgzTM.js → choose-editor-B4DdttbR.js} +1 -1
  81. package/dist/client/assets/{cli-auth-success-C0cj6Izc.js → cli-auth-success-SFz_e-qX.js} +1 -1
  82. package/dist/client/assets/{client-icons-BCicpqG7.js → client-icons-DUS1fDXG.js} +1 -1
  83. package/dist/client/assets/{collection-detail-DUX8HfDm.js → collection-detail-BAB_hE4K.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-DyMBUHP3.js → collection-display-button-BXrhdzET.js} +1 -1
  85. package/dist/client/assets/{collection-search-B8r9oZfZ.js → collection-search-BSZFp4Gz.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-tzJitBDy.js → collection-table-wrapper-CbTmVbz-.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-C0Rkz9C1.js → collection-tabs-4Ag80hDq.js} +1 -1
  88. package/dist/client/assets/{command-BptlAla6.js → command-DW3-YP5I.js} +1 -1
  89. package/dist/client/assets/{commerce-onboarding-B7TC2O2s.js → commerce-onboarding-Diw0R91C.js} +1 -1
  90. package/dist/client/assets/{connect-CQw_gD75.js → connect-DZC2WWBo.js} +1 -1
  91. package/dist/client/assets/{connect-layout-BS9c8brz.js → connect-layout-CeMZ5JID.js} +1 -1
  92. package/dist/client/assets/{connection-card-DSoc19hn.js → connection-card-yuWq0UOv.js} +1 -1
  93. package/dist/client/assets/{connection-detail-Daip_--u.js → connection-detail-iQzMZGRs.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-CgZiyWpM.js → connection-form-helpers-D3tzrA0t.js} +1 -1
  95. package/dist/client/assets/{connection-C0d9m5CI.js → connection-ulzP03bt.js} +1 -1
  96. package/dist/client/assets/{connections-Ds82X632.js → connections-DHT78pWP.js} +1 -1
  97. package/dist/client/assets/{create-organization-dialog-D9pjVf8F.js → create-organization-dialog-BF5357Ts.js} +1 -1
  98. package/dist/client/assets/{decopilot-sse-pool-CRrv4lgM.js → decopilot-sse-pool-CQLxU4sB.js} +1 -1
  99. package/dist/client/assets/{dialog-DKN4faMQ.js → dialog-Cb5sdkZI.js} +1 -1
  100. package/dist/client/assets/{domain-settings-Ddf_jjAp.js → domain-settings-Bky3EaLq.js} +1 -1
  101. package/dist/client/assets/{drawer-65SrpryB.js → drawer-DtvvD5EM.js} +1 -1
  102. package/dist/client/assets/{dropdown-menu-gEXIzCpl.js → dropdown-menu-D89_fC0m.js} +1 -1
  103. package/dist/client/assets/{e2e-tab-DzYBpGX0.js → e2e-tab-BwJlLSUM.js} +1 -1
  104. package/dist/client/assets/{editor-DHJ4ezYa.js → editor-BZc63c8k.js} +1 -1
  105. package/dist/client/assets/{empty-state-D4eQhK2E.js → empty-state-BDJE2rMg.js} +1 -1
  106. package/dist/client/assets/{empty-state-DFZB0NRe.js → empty-state-DEp7OSHt.js} +1 -1
  107. package/dist/client/assets/{extract-connection-data-DXswejBS.js → extract-connection-data-Dz-GowFl.js} +1 -1
  108. package/dist/client/assets/{file-explorer-CvGLPh0T.js → file-explorer-ZeE30ms1.js} +1 -1
  109. package/dist/client/assets/{file-type-icon-CdwseF3a.js → file-type-icon-CJOy-WMd.js} +1 -1
  110. package/dist/client/assets/{folder-icon-DuEFkTCB.js → folder-icon-w7GOSlcM.js} +1 -1
  111. package/dist/client/assets/{form-D_vnmotj.js → form-CCRpoluX.js} +1 -1
  112. package/dist/client/assets/{general-BWZi0dmY.js → general-Dik2u5bE.js} +1 -1
  113. package/dist/client/assets/{github-icon-D1JgXHqC.js → github-icon-DL4zFV_G.js} +1 -1
  114. package/dist/client/assets/{hooks-7tLjmior.js → hooks-DiAtKJFX.js} +1 -1
  115. package/dist/client/assets/{hosting-tab-CyTUvKp9.js → hosting-tab-C8Cw1No7.js} +1 -1
  116. package/dist/client/assets/{index-Dvp7a4Ap.js → index-2HzyhxZc.js} +1 -1
  117. package/dist/client/assets/{index-CnXpMEbp.js → index-B1jTpqnK.js} +1 -1
  118. package/dist/client/assets/{index-dcj7ZHAO.js → index-BSsmM5iI.js} +1 -1
  119. package/dist/client/assets/{index-CX6bRTOG.js → index-BWfsw28s.js} +1 -1
  120. package/dist/client/assets/{index-CVchz9qY.js → index-C-ybnMrE.js} +1 -1
  121. package/dist/client/assets/{index-D1uVO7a5.js → index-CAg73xfh.js} +4 -4
  122. package/dist/client/assets/{index-DxGIDJOo.js → index-CLXmrnFJ.js} +1 -1
  123. package/dist/client/assets/{index-BttSt1fd.js → index-CWhmtu3F.js} +1 -1
  124. package/dist/client/assets/{index-Cuv3j_L9.js → index-DZwdeeSJ.js} +8 -8
  125. package/dist/client/assets/{index-OIM7-vgA.js → index-DnmC12ta.js} +1 -1
  126. package/dist/client/assets/{index-redirect-CB4HUQEO.js → index-redirect-X1CPyCD6.js} +1 -1
  127. package/dist/client/assets/{infiniteQueryObserver-LL-vAD9m.js → infiniteQueryObserver-BZrz9hlL.js} +1 -1
  128. package/dist/client/assets/{infra-billing-B52wWSLi.js → infra-billing-DUmdbEFp.js} +1 -1
  129. package/dist/client/assets/{input-PKwnqbs6.js → input-BzefvvjA.js} +1 -1
  130. package/dist/client/assets/{integration-icon-BkfbMsJT.js → integration-icon-Cq2uWBzS.js} +1 -1
  131. package/dist/client/assets/{invite-member-dialog-D11lr8Ba.js → invite-member-dialog-B0PK--24.js} +1 -1
  132. package/dist/client/assets/{label-Dy0JyFDT.js → label-asT3tl0r.js} +1 -1
  133. package/dist/client/assets/{layout-DN5mG7LL.js → layout-CLt_qVG8.js} +1 -1
  134. package/dist/client/assets/{login-zCwZDu58.js → login-CQshku2v.js} +1 -1
  135. package/dist/client/assets/{markdown-C-na-8cM.js → markdown-DjBmoTSd.js} +1 -1
  136. package/dist/client/assets/{mcp-app-renderer-BZuXMnCl.js → mcp-app-renderer-Bzr0mnLt.js} +1 -1
  137. package/dist/client/assets/{mcp-oauth-BTNoJrNs.js → mcp-oauth-n-1nZlwL.js} +1 -1
  138. package/dist/client/assets/{members-QrH94LzI.js → members-KmE97JJx.js} +1 -1
  139. package/dist/client/assets/{monaco-editor-LcmB6t4O.js → monaco-editor-DcoxqE8j.js} +1 -1
  140. package/dist/client/assets/{monitoring-stats-row-D0dfySB5.js → monitoring-stats-row-BPpT3B-b.js} +1 -1
  141. package/dist/client/assets/{multi-select-GAZFfVqM.js → multi-select-BECuJ97q.js} +1 -1
  142. package/dist/client/assets/{oauth-callback-CDPfzZyn.js → oauth-callback-2xh0oUcN.js} +1 -1
  143. package/dist/client/assets/{oauth-callback-ai-provider-D6AuX3Fl.js → oauth-callback-ai-provider-BIIPGjef.js} +1 -1
  144. package/dist/client/assets/{onboarding-Dgab2xdI.js → onboarding-BZD3sZVb.js} +1 -1
  145. package/dist/client/assets/{org-layout-BY50eRtq.js → org-layout-CjePShpq.js} +1 -1
  146. package/dist/client/assets/{organization-choice-BtFjbYnf.js → organization-choice-CVWJWe2L.js} +1 -1
  147. package/dist/client/assets/{orgs-CLBSfDhd.js → orgs-D-qhmyDD.js} +1 -1
  148. package/dist/client/assets/{page-seo-form-CxCrY61h.js → page-seo-form-CUbhyWM4.js} +1 -1
  149. package/dist/client/assets/{popover-D6u4fcFj.js → popover-B71zIwBN.js} +1 -1
  150. package/dist/client/assets/{post-calendar-DJCAiv9W.js → post-calendar-BYWi5WmJ.js} +1 -1
  151. package/dist/client/assets/{post-editor-D7TzN-v7.js → post-editor-CTsJ1wyb.js} +1 -1
  152. package/dist/client/assets/{primitives-BWGJsmCu.js → primitives-CMHQZN20.js} +1 -1
  153. package/dist/client/assets/{profile-BCCk4bmU.js → profile-BNvvkNXK.js} +1 -1
  154. package/dist/client/assets/{project-app-view-BytKBowm.js → project-app-view-C5gz9YSP.js} +1 -1
  155. package/dist/client/assets/{project-icon-q8mI871m.js → project-icon-CMyactrj.js} +1 -1
  156. package/dist/client/assets/{prompts-BOg9ggP8.js → prompts-DOJQjkJI.js} +1 -1
  157. package/dist/client/assets/record-editor-DlNTpWoF.js +1 -0
  158. package/dist/client/assets/redirect-editor-3F68ZLMG.js +1 -0
  159. package/dist/client/assets/registry-C7LE0Jj4.js +2 -0
  160. package/dist/client/assets/{registry-layout-cibWW4Hy.js → registry-layout-ehg6qLW2.js} +1 -1
  161. package/dist/client/assets/{reports-BB75mUa8.js → reports-Bn34Js_T.js} +1 -1
  162. package/dist/client/assets/{repositories-PQ9q5c1F.js → repositories-Cx8EUJjl.js} +1 -1
  163. package/dist/client/assets/{repository-import-picker-CRWVyNWS.js → repository-import-picker-BExPFxDa.js} +1 -1
  164. package/dist/client/assets/{repository-picker-DD7kZEX_.js → repository-picker-CYEGHZ5W.js} +1 -1
  165. package/dist/client/assets/{require-capability-B94ZPOKT.js → require-capability-C1JzrkeY.js} +1 -1
  166. package/dist/client/assets/{required-auth-layout-Brmg3XV2.js → required-auth-layout-7BC2JQaI.js} +1 -1
  167. package/dist/client/assets/{reset-password-B1-RuRC7.js → reset-password-BwbRunut.js} +1 -1
  168. package/dist/client/assets/{review-settings-DYCFDf8k.js → review-settings-COBuJuSm.js} +1 -1
  169. package/dist/client/assets/{roles-D4HASJi9.js → roles-lZkrYFgT.js} +1 -1
  170. package/dist/client/assets/{schema-D6S3Oui7.js → schema-Ca-k8ddr.js} +1 -1
  171. package/dist/client/assets/{scroll-area-lvZoZX8V.js → scroll-area-Df92aJsj.js} +1 -1
  172. package/dist/client/assets/{search-input-D5662yMv.js → search-input-8135C_IH.js} +1 -1
  173. package/dist/client/assets/{secrets-DkkaO3Jn.js → secrets-0WJks4GB.js} +1 -1
  174. package/dist/client/assets/{sections-editor-BMfbcdCO.js → sections-editor-DdCMVi66.js} +1 -1
  175. package/dist/client/assets/{select-Ojf99y1-.js → select-C5wEyHZ1.js} +1 -1
  176. package/dist/client/assets/{select-model-BnxOFD-Q.js → select-model-BaUFEs_E.js} +1 -1
  177. package/dist/client/assets/{self-tool-result-CsaWvzcu.js → self-tool-result-BJUjFXWH.js} +1 -1
  178. package/dist/client/assets/{seo-editor-CTNY9zjQ.js → seo-editor-De_IKBdZ.js} +1 -1
  179. package/dist/client/assets/settings-layout-3vWYmRDa.js +1 -0
  180. package/dist/client/assets/{settings-sidebar-28IBKoJh.js → settings-sidebar-CqJCb5hK.js} +1 -1
  181. package/dist/client/assets/{shell-controls-DFA3I8Ho.js → shell-controls-CmNlP4iW.js} +1 -1
  182. package/dist/client/assets/{shell-layout-CfVPix_n.js → shell-layout-Bkvtxw5d.js} +1 -1
  183. package/dist/client/assets/{skill-preview-eJ979tkI.js → skill-preview-Cqsl3kIS.js} +1 -1
  184. package/dist/client/assets/{skills-C9bbXtkx.js → skills-CxdKHGt5.js} +1 -1
  185. package/dist/client/assets/{sso-CC1btnaf.js → sso-BHImDtGf.js} +1 -1
  186. package/dist/client/assets/{store-DN1Nrfgi.js → store-CbWER_V0.js} +1 -1
  187. package/dist/client/assets/store-registry-gx58nWL0.js +2 -0
  188. package/dist/client/assets/{switch-notBJGS3.js → switch-CsxeCjy2.js} +1 -1
  189. package/dist/client/assets/{synced-repos-vqRpA8ZV.js → synced-repos-bvmoimbn.js} +1 -1
  190. package/dist/client/assets/{table-0zkxXYgD.js → table-BM0XqjBy.js} +1 -1
  191. package/dist/client/assets/{tabs-C7Uuo9-6.js → tabs-Bg5o3gAR.js} +1 -1
  192. package/dist/client/assets/{task-board-BPv9niwI.js → task-board-DL-UUDM5.js} +1 -1
  193. package/dist/client/assets/{task-route-COdiO90A.js → task-route-BdNXlSyW.js} +1 -1
  194. package/dist/client/assets/{tasks-jTr7w4Cq.js → tasks-CN8xmEra.js} +1 -1
  195. package/dist/client/assets/{textarea-_1fDr_qA.js → textarea-BiekJAZf.js} +1 -1
  196. package/dist/client/assets/{thread-intent-B4Dy_rR-.js → thread-intent-DBFUao-m.js} +1 -1
  197. package/dist/client/assets/{thread-route-eOGDuGcx.js → thread-route-D4-RMlRq.js} +1 -1
  198. package/dist/client/assets/{toggle-group-DGhRTZ1n.js → toggle-group-Ctw0vFoG.js} +1 -1
  199. package/dist/client/assets/{toolbar-C09hHsVE.js → toolbar-CMAAEjea.js} +1 -1
  200. package/dist/client/assets/{toolbar-icon-button-DGnw1-Q8.js → toolbar-icon-button-CsX0-Vy-.js} +1 -1
  201. package/dist/client/assets/{track-D2GvqP3m.js → track-Dl1RxfSD.js} +1 -1
  202. package/dist/client/assets/{types-DFMk8jDU.js → types-CE4z5swN.js} +1 -1
  203. package/dist/client/assets/{use-ai-providers-3jklZ-R6.js → use-ai-providers-Ce_A9FrA.js} +1 -1
  204. package/dist/client/assets/{use-automations-C7v_CWBf.js → use-automations-CH_t2Ky5.js} +1 -1
  205. package/dist/client/assets/{use-autosave-BCfV9-eJ.js → use-autosave-hbtksPwQ.js} +1 -1
  206. package/dist/client/assets/{use-connection-Dtw3OpLU.js → use-connection-CWOGiGh8.js} +1 -1
  207. package/dist/client/assets/{use-copy-BV20_T6j.js → use-copy-BVOi3E3V.js} +1 -1
  208. package/dist/client/assets/{use-create-virtual-mcp-rpY2cbmZ.js → use-create-virtual-mcp-DTwlMo4y.js} +1 -1
  209. package/dist/client/assets/{use-date-fns-locale-D9bCAEHX.js → use-date-fns-locale-BDUZH3x3.js} +1 -1
  210. package/dist/client/assets/{use-debounced-autosave-BmVWIUnI.js → use-debounced-autosave-DQyt5k-X.js} +1 -1
  211. package/dist/client/assets/{use-debounced-value-8NgBj3iZ.js → use-debounced-value-Bzo3YMBK.js} +1 -1
  212. package/dist/client/assets/{use-decopilot-events-CVjAzkvm.js → use-decopilot-events-D84k9wQQ.js} +1 -1
  213. package/dist/client/assets/{use-delete-connection-B4pVYlmQ.js → use-delete-connection-CG_GrXlm.js} +1 -1
  214. package/dist/client/assets/{use-deployment-admin-D9KTaO48.js → use-deployment-admin-CZBT5ye5.js} +1 -1
  215. package/dist/client/assets/{use-destination-route-DcrrHoK-.js → use-destination-route-ClYb6SQ-.js} +1 -1
  216. package/dist/client/assets/{use-file-configs-CR_q-2qA.js → use-file-configs-C6fur-8F.js} +1 -1
  217. package/dist/client/assets/{use-infinite-scroll-hXchkgOC.js → use-infinite-scroll-C23Zc8Rv.js} +1 -1
  218. package/dist/client/assets/{use-join-requests-C-BbdIK9.js → use-join-requests-DDmNO7hj.js} +1 -1
  219. package/dist/client/assets/{use-mcp-auth-status-l2jliEHf.js → use-mcp-auth-status-CWFBI70G.js} +1 -1
  220. package/dist/client/assets/{use-mcp-client-_41rYMEd.js → use-mcp-client-ArFEvvrW.js} +1 -1
  221. package/dist/client/assets/{use-mcp-prompts-DgKC2SBn.js → use-mcp-prompts-CfCCuWm1.js} +1 -1
  222. package/dist/client/assets/{use-mcp-tools-BRBIldeW.js → use-mcp-tools-3gUHBRM0.js} +1 -1
  223. package/dist/client/assets/{use-members-VzopMepP.js → use-members-08FYTEQK.js} +1 -1
  224. package/dist/client/assets/{use-navigate-to-agent-DpWSqc56.js → use-navigate-to-agent-DuTiS_JM.js} +1 -1
  225. package/dist/client/assets/{use-org-auth-client-B2FlZO3f.js → use-org-auth-client-CyXd_KsN.js} +1 -1
  226. package/dist/client/assets/{use-org-notice-Ckgkfegx.js → use-org-notice-B1U5J9yd.js} +1 -1
  227. package/dist/client/assets/{use-org-sso-DExmLsVm.js → use-org-sso-C3zID5Kj.js} +1 -1
  228. package/dist/client/assets/{use-organization-roles-OQJK82X7.js → use-organization-roles-BuCs3Hh0.js} +1 -1
  229. package/dist/client/assets/{use-organization-settings-9P5D6Y0u.js → use-organization-settings-BQJStntT.js} +1 -1
  230. package/dist/client/assets/{use-panel-navigate-B_E3cvGS.js → use-panel-navigate-aShx4PQa.js} +1 -1
  231. package/dist/client/assets/{use-registry-connections-DSPkf_ft.js → use-registry-connections-DGk5Ox5l.js} +1 -1
  232. package/dist/client/assets/{use-secrets-Bnn1Bjrz.js → use-secrets-C2ZGO-61.js} +1 -1
  233. package/dist/client/assets/{use-section-preview-base-CK9EeSbB.js → use-section-preview-base-CBB4sHVI.js} +1 -1
  234. package/dist/client/assets/{use-status-sounds-DJnc5vQU.js → use-status-sounds-DVpzouyS.js} +1 -1
  235. package/dist/client/assets/{use-tags-Bu9JUPK8.js → use-tags-mi44HTOm.js} +1 -1
  236. package/dist/client/assets/{use-view-mode-DWz8xU7t.js → use-view-mode-BvWAV8SB.js} +1 -1
  237. package/dist/client/assets/{use-virtual-mcp-DZgKg8BJ.js → use-virtual-mcp-DMk1Ih6u.js} +1 -1
  238. package/dist/client/assets/useInfiniteQuery-Zv5Uk4cj.js +1 -0
  239. package/dist/client/assets/useSuspenseInfiniteQuery-DxIWi4d2.js +1 -0
  240. package/dist/client/assets/{users-BtH-vx49.js → users-DezlRkoj.js} +1 -1
  241. package/dist/client/assets/{variant-calendar-BK502hqm.js → variant-calendar-DYAaP0dj.js} +1 -1
  242. package/dist/client/assets/{view-mode-toggle-C7f68cLc.js → view-mode-toggle-CozgwZoC.js} +1 -1
  243. package/dist/client/index.html +1 -1
  244. package/dist/server/cli.js +555 -555
  245. package/dist/server/server.js +373 -373
  246. package/package.json +1 -1
  247. package/dist/client/assets/api-keys-DqrhRArD.js +0 -1
  248. package/dist/client/assets/app-editor-D62R8YA3.js +0 -1
  249. package/dist/client/assets/record-editor-vv6FrCr5.js +0 -1
  250. package/dist/client/assets/redirect-editor-Bp561qXc.js +0 -1
  251. package/dist/client/assets/registry-iM_DRr_U.js +0 -2
  252. package/dist/client/assets/settings-layout-D3HOoiWl.js +0 -1
  253. package/dist/client/assets/store-registry-ZJKqQsch.js +0 -2
  254. package/dist/client/assets/useInfiniteQuery-fu6bj03H.js +0 -1
  255. package/dist/client/assets/useSuspenseInfiniteQuery-DEjbVlhY.js +0 -1
@@ -1,4 +1,4 @@
1
- import{ee as ue,ef as de,eg as he,da as fe,eh as pe,cM as _,cN as g,ei as me,ej as _e,ek as we,el as M,em as ge,en as D,eo as Te,ep as q,eq as ye,er as L,es as ke,et as ve,eu as Se,ev as W,cs as Ce,cu as be,cp as Re,d5 as se,dh as Ie,dn as Ee,dl as qe,dH as Pe,ew as $e,ex as Me,ey as A,ez as Ae,eA as He,dm as Oe,di as xe,dj as Ue,dk as Ne,cq as je,eB as Fe,eC as De,eD as Le,dc as Ve,eE as Qe,eF as ze,dD as x,eG as Je,co as N,c as Q,x as re,K as z,m as We}from"./index-D1uVO7a5.js";import{S as Ke}from"./constants-Daqiz8AS.js";import{U as P,a as H,e as K}from"./auth-0iRmXalG.js";function U(a){return!!a._zod}function b(a,e){return U(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(U(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(U(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=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{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(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,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=B(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=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}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 rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(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 it=class extends Ze{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 st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(U(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?Qe:ze,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,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}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ue,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=x(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y 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 X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
1
+ import{ee as ue,ef as de,eg as he,da as fe,eh as pe,cM as _,cN as g,ei as me,ej as _e,ek as we,el as M,em as ge,en as D,eo as Te,ep as q,eq as ye,er as L,es as ke,et as ve,eu as Se,ev as W,cs as Ce,cu as be,cp as Re,d5 as se,dh as Ie,dn as Ee,dl as qe,dH as Pe,ew as $e,ex as Me,ey as A,ez as Ae,eA as He,dm as Oe,di as xe,dj as Ue,dk as Ne,cq as je,eB as Fe,eC as De,eD as Le,dc as Ve,eE as Qe,eF as ze,dD as x,eG as Je,co as N,c as Q,x as re,K as z,m as We}from"./index-CAg73xfh.js";import{S as Ke}from"./constants-Daqiz8AS.js";import{U as P,a as H,e as K}from"./auth-CBeYawqd.js";function U(a){return!!a._zod}function b(a,e){return U(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(U(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(U(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=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{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(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,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=B(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=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}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 rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(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 it=class extends Ze{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 st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(U(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?Qe:ze,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,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}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ue,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=x(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y 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 X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
2
2
  `)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const w=f(c);w!==""&&o.push(w)}function f(h){let c=0;if(h.indexOf("\r")===-1){let w=h.indexOf(`
3
3
  `,c);for(;w!==-1;){if(c===w){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=w+1,w=h.indexOf(`
4
4
  `,c);continue}const v=h.charCodeAt(c);if(ee(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,C=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===X){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
@@ -1 +1 @@
1
- import{c as l,m as u,cM as m,cN as f,x as y,K as n}from"./index-D1uVO7a5.js";async function c(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=()=>c(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=()=>c(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],u(a)}export{q as a,b as g,c as l,g as u};
1
+ import{c as l,m as u,cM as m,cN as f,x as y,K as n}from"./index-CAg73xfh.js";async function c(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=()=>c(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=()=>c(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],u(a)}export{q as a,b as g,c as l,g as u};
@@ -1 +1 @@
1
- import{c as m,m as p,x as q,K as T}from"./index-D1uVO7a5.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,O as b,w as c,K as u};
1
+ import{c as m,m as p,x as q,K as T}from"./index-CAg73xfh.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,O as b,w as c,K as u};
@@ -1 +1 @@
1
- import{c,G as m,x as b,m as M,K as f}from"./index-D1uVO7a5.js";import{u as y}from"./use-org-auth-client-B2FlZO3f.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
1
+ import{c,G as m,x as b,m as M,K as f}from"./index-CAg73xfh.js";import{u as y}from"./use-org-auth-client-CyXd_KsN.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{c as m,m as g,bD as E,K as S,G as U,d as $,n as D,a as K,y as H}from"./index-D1uVO7a5.js";import{D as O}from"./use-destination-route-DcrrHoK-.js";import{d as Q,g as M}from"./use-virtual-mcp-DZgKg8BJ.js";import{a as V}from"./hooks-7tLjmior.js";import{p as j,d as P,w as z}from"./thread-intent-B4Dy_rR-.js";import{h as C,b as _,g as B,r as Y}from"./github-repo-CTPv5ZM2.js";function F(t,e){if(!e)return!0;if(t.partial)return!1;const n=j(t.metadata?.runtime);return n===null||n===e}function y(t,e,n,a,s,o){let r=null;for(const i of t)i.virtual_mcp_id===e&&i.created_by===n&&(i.hidden||F(i,a)&&(s&&(!i.branch||!s.has(i.branch))||o&&i.branch===o||(!r||i.updated_at>r.updated_at)&&(r=i)));return r}function J(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&F(s,a))}function W(t,e,n,a,s,o){if(!s)return y(t,e,n,a)??void 0;if(o?.draftsMode)return y(t,e,n,a,void 0,o?.baseBranch)??void 0;const r=o?.knownBranches;return(r&&r.size>0?y(t,e,n,a,r)??void 0:void 0)??y(t,e,n,a)??J(t,e,n,a)}const X=6e4,q=3e4;function N(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function Z(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function w(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:S.githubPrState(e,_(n),a,s,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&C(n)&&!!a&&!!s,refetchInterval:X,refetchIntervalInBackground:!1,staleTime:q}}function x(t){const e=m.c(4);let n;e[0]!==t?(n=w(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:I},e[2]=n,e[3]=a):a=e[3],g(a)}function I(t){return t.changeRequest?N(t.changeRequest):null}function ye(t){const e=m.c(4);let n;e[0]!==t?(n=w(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],g(a)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(Z):[]}function Ee(t){const e=m.c(4);let n;e[0]!==t?(n=w(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],g(a)}function te(t){return(t.changeRequest?.comments??[]).map(ne)}function ne(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const ae=5*6e4;function Se(t){const e=m.c(20),{orgSlug:n,target:a,owner:s,repo:o,base:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=S.githubLastPublishedPr(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!r&&C(a)&&!!s&&!!o,e[10]=t.enabled,e[11]=r,e[12]=s,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==i||e[17]!==u||e[18]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:ae,select:re},e[16]=i,e[17]=u,e[18]=l,e[19]=c):c=e[19],g(c)}function re(t){return t.changeRequest?N(t.changeRequest):null}const se=50;function _e(t){const e=m.c(17),{orgSlug:n,target:a,owner:s,repo:o}=t;let r;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==a?(r=S.githubOpenPrs(n,_(a),s,o),e[0]=n,e[1]=s,e[2]=o,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==o||e[11]!==a?(u=(t.enabled??!0)&&C(a)&&!!s&&!!o,e[8]=t.enabled,e[9]=s,e[10]=o,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==r||e[14]!==i||e[15]!==u?(l={queryKey:r,queryFn:i,enabled:u,staleTime:q,select:oe},e[13]=r,e[14]=i,e[15]=u,e[16]=l):l=e[16],g(l)}function oe(t){return t.changeRequests.map(N)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:s,repo:o,checkRunId:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=S.githubCheckRun(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>E(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];const l=t.enabled&&!!r;let c;return e[10]!==i||e[11]!==u||e[12]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:q,select:ie},e[10]=i,e[11]=u,e[12]=l,e[13]=c):c=e[13],g(c)}function ie(t){return{title:null,summary:t.report,text:null}}function ue(t,e){const{org:n}=U(),a=B(t);return x({orgId:n.id,orgSlug:n.slug,target:Y(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}function le(t){return t?.metadata?.draftsMode===!0}const ce=[];function Ae(){const t=m.c(13),e=$(),{org:n,locator:a}=U(),s=D(),o=Q(),{data:r}=K.useSession(),i=V(),u=ue(void 0,null);let l;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(h,f,p)=>{const d=(o??[]).find(G=>G.id===h),R=!!(d&&B(d)),v=!f?.runtime,k=v?void 0:W(i?.threads.get()??ce,h,r?.user?.id,p??(d?P(d.metadata):void 0),R,{knownBranches:new Set([u,...(d?.metadata?.releases??[]).map(fe)]),draftsMode:le(d),baseBranch:u}),T=v?void 0:k?.id??crypto.randomUUID();T&&!k&&f?.runtime&&z(sessionStorage,a,T,{runtime:f.runtime});const L=T?{thread:T}:{},A=f?.panel?H(f.panel):null;if(!A?.panel){e({to:O.home,params:{org:n.slug},search:{virtualmcpid:h,...L}});return}e({to:O.agents,params:{org:n.slug,panel:A.panel},search:{...A.payload,virtualmcpid:h,...L}})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const c=l;let b;return t[8]!==o||t[9]!==c||t[10]!==n||t[11]!==s?(b=(h,f)=>{const p=o.find(d=>d.id===h);if(f?.runtime)return c(h,f,f.runtime);if(p)return c(h,f,P(p.metadata));M(s,n).then(d=>d.find(R=>R.id===h)).catch(de).then(d=>c(h,f,d?P(d.metadata):void 0))},t[8]=o,t[9]=c,t[10]=n,t[11]=s,t[12]=b):b=t[12],b}function de(){}function fe(t){return t.branch}export{x as a,ye as b,Re as c,Ee as d,Se as e,le as f,_e as g,ue as h,J as i,W as j,w as p,Ae as u};
1
+ import{c as m,m as g,bD as E,K as S,G as U,d as $,n as D,a as K,y as H}from"./index-CAg73xfh.js";import{D as O}from"./use-destination-route-ClYb6SQ-.js";import{d as Q,g as M}from"./use-virtual-mcp-DMk1Ih6u.js";import{a as V}from"./hooks-DiAtKJFX.js";import{p as j,d as P,w as z}from"./thread-intent-DBFUao-m.js";import{h as C,b as _,g as B,r as Y}from"./github-repo-CTPv5ZM2.js";function F(t,e){if(!e)return!0;if(t.partial)return!1;const n=j(t.metadata?.runtime);return n===null||n===e}function y(t,e,n,a,s,o){let r=null;for(const i of t)i.virtual_mcp_id===e&&i.created_by===n&&(i.hidden||F(i,a)&&(s&&(!i.branch||!s.has(i.branch))||o&&i.branch===o||(!r||i.updated_at>r.updated_at)&&(r=i)));return r}function J(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&F(s,a))}function W(t,e,n,a,s,o){if(!s)return y(t,e,n,a)??void 0;if(o?.draftsMode)return y(t,e,n,a,void 0,o?.baseBranch)??void 0;const r=o?.knownBranches;return(r&&r.size>0?y(t,e,n,a,r)??void 0:void 0)??y(t,e,n,a)??J(t,e,n,a)}const X=6e4,q=3e4;function N(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function Z(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function w(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:S.githubPrState(e,_(n),a,s,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&C(n)&&!!a&&!!s,refetchInterval:X,refetchIntervalInBackground:!1,staleTime:q}}function x(t){const e=m.c(4);let n;e[0]!==t?(n=w(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:I},e[2]=n,e[3]=a):a=e[3],g(a)}function I(t){return t.changeRequest?N(t.changeRequest):null}function ye(t){const e=m.c(4);let n;e[0]!==t?(n=w(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],g(a)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(Z):[]}function Ee(t){const e=m.c(4);let n;e[0]!==t?(n=w(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],g(a)}function te(t){return(t.changeRequest?.comments??[]).map(ne)}function ne(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const ae=5*6e4;function Se(t){const e=m.c(20),{orgSlug:n,target:a,owner:s,repo:o,base:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=S.githubLastPublishedPr(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!r&&C(a)&&!!s&&!!o,e[10]=t.enabled,e[11]=r,e[12]=s,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==i||e[17]!==u||e[18]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:ae,select:re},e[16]=i,e[17]=u,e[18]=l,e[19]=c):c=e[19],g(c)}function re(t){return t.changeRequest?N(t.changeRequest):null}const se=50;function _e(t){const e=m.c(17),{orgSlug:n,target:a,owner:s,repo:o}=t;let r;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==a?(r=S.githubOpenPrs(n,_(a),s,o),e[0]=n,e[1]=s,e[2]=o,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==o||e[11]!==a?(u=(t.enabled??!0)&&C(a)&&!!s&&!!o,e[8]=t.enabled,e[9]=s,e[10]=o,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==r||e[14]!==i||e[15]!==u?(l={queryKey:r,queryFn:i,enabled:u,staleTime:q,select:oe},e[13]=r,e[14]=i,e[15]=u,e[16]=l):l=e[16],g(l)}function oe(t){return t.changeRequests.map(N)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:s,repo:o,checkRunId:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=S.githubCheckRun(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>E(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];const l=t.enabled&&!!r;let c;return e[10]!==i||e[11]!==u||e[12]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:q,select:ie},e[10]=i,e[11]=u,e[12]=l,e[13]=c):c=e[13],g(c)}function ie(t){return{title:null,summary:t.report,text:null}}function ue(t,e){const{org:n}=U(),a=B(t);return x({orgId:n.id,orgSlug:n.slug,target:Y(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}function le(t){return t?.metadata?.draftsMode===!0}const ce=[];function Ae(){const t=m.c(13),e=$(),{org:n,locator:a}=U(),s=D(),o=Q(),{data:r}=K.useSession(),i=V(),u=ue(void 0,null);let l;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(h,f,p)=>{const d=(o??[]).find(G=>G.id===h),R=!!(d&&B(d)),v=!f?.runtime,k=v?void 0:W(i?.threads.get()??ce,h,r?.user?.id,p??(d?P(d.metadata):void 0),R,{knownBranches:new Set([u,...(d?.metadata?.releases??[]).map(fe)]),draftsMode:le(d),baseBranch:u}),T=v?void 0:k?.id??crypto.randomUUID();T&&!k&&f?.runtime&&z(sessionStorage,a,T,{runtime:f.runtime});const L=T?{thread:T}:{},A=f?.panel?H(f.panel):null;if(!A?.panel){e({to:O.home,params:{org:n.slug},search:{virtualmcpid:h,...L}});return}e({to:O.agents,params:{org:n.slug,panel:A.panel},search:{...A.payload,virtualmcpid:h,...L}})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const c=l;let b;return t[8]!==o||t[9]!==c||t[10]!==n||t[11]!==s?(b=(h,f)=>{const p=o.find(d=>d.id===h);if(f?.runtime)return c(h,f,f.runtime);if(p)return c(h,f,P(p.metadata));M(s,n).then(d=>d.find(R=>R.id===h)).catch(de).then(d=>c(h,f,d?P(d.metadata):void 0))},t[8]=o,t[9]=c,t[10]=n,t[11]=s,t[12]=b):b=t[12],b}function de(){}function fe(t){return t.branch}export{x as a,ye as b,Re as c,Ee as d,Se as e,le as f,_e as g,ue as h,J as i,W as j,w as p,Ae as u};
@@ -1 +1 @@
1
- import{c as x,G as j,a as i}from"./index-D1uVO7a5.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,G as j,a as i}from"./index-CAg73xfh.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
@@ -1 +1 @@
1
- import{c as a,m as r,K as l}from"./index-D1uVO7a5.js";function y(t){const e=a.c(8);let n;e[0]!==t?(n=l.orgNotice(t??""),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==t?(s=async()=>{const o=await fetch(`/api/${t}/notice`,{credentials:"include"});return o.ok?(await o.json()).notice??null:null},e[2]=t,e[3]=s):s=e[3];const c=!!t;let i;return e[4]!==n||e[5]!==s||e[6]!==c?(i={queryKey:n,queryFn:s,enabled:c,staleTime:6e4},e[4]=n,e[5]=s,e[6]=c,e[7]=i):i=e[7],r(i)}export{y as u};
1
+ import{c as a,m as r,K as l}from"./index-CAg73xfh.js";function y(t){const e=a.c(8);let n;e[0]!==t?(n=l.orgNotice(t??""),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==t?(s=async()=>{const o=await fetch(`/api/${t}/notice`,{credentials:"include"});return o.ok?(await o.json()).notice??null:null},e[2]=t,e[3]=s):s=e[3];const c=!!t;let i;return e[4]!==n||e[5]!==s||e[6]!==c?(i={queryKey:n,queryFn:s,enabled:c,staleTime:6e4},e[4]=n,e[5]=s,e[6]=c,e[7]=i):i=e[7],r(i)}export{y as u};
@@ -1 +1 @@
1
- import{c as u,m as S,n as r,e as y,K as c}from"./index-D1uVO7a5.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
1
+ import{c as u,m as S,n as r,e as y,K as c}from"./index-CAg73xfh.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-B2FlZO3f.js";import{G as b,m as P,K as y}from"./index-D1uVO7a5.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-CyXd_KsN.js";import{G as b,m as P,K as y}from"./index-CAg73xfh.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{a as h,c as l,G as p,m as E,bD as R,K as T,bu as w,a7 as M,n as N,e as F}from"./index-D1uVO7a5.js";import{W as P}from"./constants-Daqiz8AS.js";import{D as z,o as D,a as $}from"./schema-D6S3Oui7.js";import{r as U}from"./task-board-BPv9niwI.js";const b={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null},A={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function O(t,e){return{queryKey:T.organizationSettings(e),queryFn:async()=>{try{return await R(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...b,organizationId:e}}},staleTime:6e4}}function f(t){const e=l.c(6),{org:n}=p();let s;e[0]!==n.id||e[1]!==n.slug?(s=O(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let i;return e[3]!==s||e[4]!==o?(i={...s,select:o},e[3]=s,e[4]=o,e[5]=i):i=e[5],E(i)}function j(t,e){const n=l.c(3);let s;n[0]!==t||n[1]!==e?(s=O(e,t),n[0]=t,n[1]=e,n[2]=s):s=n[2];const{data:o}=E(s);return o??null}function S(){const t=l.c(9),{org:e}=p(),n=M(),s=N();let o;t[0]!==e||t[1]!==n?(o=async r=>{const u=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!u)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return u},t[0]=e,t[1]=n,t[2]=o):o=t[2];let i;t[3]!==e||t[4]!==s?(i=r=>{s.setQueryData(T.organizationSettings(e.id),u=>({...u??b,...r}))},t[3]=e,t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==o||t[7]!==i?(a={mutationFn:o,onSuccess:i},t[6]=o,t[7]=i,t[8]=a):a=t[8],F(a)}function k(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:A}function B(){const{data:t}=f(L);return t??A}function L(t){return k(t.simple_mode)}function V(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({simple_mode:i},a),s=(i,a)=>e.mutateAsync({simple_mode:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function H(){return c("reports_only")}function c(t){const e=l.c(5);let n;e[0]!==t?(n=i=>D(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=f(n);let o;return e[2]!==s||e[3]!==t?(o=s??z.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function G(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const{data:t}=h.useSession();return G(t?.user?.email)}function X(){const t=l.c(8),{data:e}=h.useSession(),n=w();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||G(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,i=n.hostingControlPlaneGa===!0,a=n.monitorGa===!0,r=c("hosting_enabled"),u=c("deco_analytics_enabled"),C=c("e2e_enabled"),I=c("monitor_enabled"),d=o||i||r,g=o||i||u,_=o||i||C,y=o||a||I;let m;return t[3]!==d||t[4]!==g||t[5]!==_||t[6]!==y?(m={hosting:d,analytics:g,e2e:_,monitor:y},t[3]=d,t[4]=g,t[5]=_,t[6]=y,t[7]=m):m=t[7],m}function tt(){const{data:t}=f(v);return t??!1}function v(t){return $(t.flags)}function et(){const{data:t}=f(x);return t??!0}function x(t){return U(t.flags)}function nt(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a,r)=>e.mutate({flags:{[i]:a}},r),s=(i,a,r)=>e.mutateAsync({flags:{[i]:a}},r),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function K(){const{data:t}=f(Q);return t??null}function Q(t){return t.registry_config}function st(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({registry_config:i},a),s=(i,a)=>e.mutateAsync({registry_config:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function ot(){const t=l.c(5),{org:e}=p(),n=K();let s;t[0]!==e.id?(s=P.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const o=s;let i;return t[2]!==o||t[3]!==n?(i=a=>{if(!n)return a===o;const r=n.registries[a];return r?r.enabled:a===o},t[2]=o,t[3]=n,t[4]=i):i=t[4],i}export{H as a,B as b,et as c,X as d,ot as e,j as f,V as g,K as h,tt as i,nt as j,st as k,J as l,c as u};
1
+ import{a as h,c as l,G as p,m as E,bD as R,K as T,bu as w,a7 as M,n as N,e as F}from"./index-CAg73xfh.js";import{W as P}from"./constants-Daqiz8AS.js";import{D as z,o as D,a as $}from"./schema-Ca-k8ddr.js";import{r as U}from"./task-board-DL-UUDM5.js";const b={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null},A={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function O(t,e){return{queryKey:T.organizationSettings(e),queryFn:async()=>{try{return await R(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...b,organizationId:e}}},staleTime:6e4}}function f(t){const e=l.c(6),{org:n}=p();let s;e[0]!==n.id||e[1]!==n.slug?(s=O(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let i;return e[3]!==s||e[4]!==o?(i={...s,select:o},e[3]=s,e[4]=o,e[5]=i):i=e[5],E(i)}function j(t,e){const n=l.c(3);let s;n[0]!==t||n[1]!==e?(s=O(e,t),n[0]=t,n[1]=e,n[2]=s):s=n[2];const{data:o}=E(s);return o??null}function S(){const t=l.c(9),{org:e}=p(),n=M(),s=N();let o;t[0]!==e||t[1]!==n?(o=async r=>{const u=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!u)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return u},t[0]=e,t[1]=n,t[2]=o):o=t[2];let i;t[3]!==e||t[4]!==s?(i=r=>{s.setQueryData(T.organizationSettings(e.id),u=>({...u??b,...r}))},t[3]=e,t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==o||t[7]!==i?(a={mutationFn:o,onSuccess:i},t[6]=o,t[7]=i,t[8]=a):a=t[8],F(a)}function k(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:A}function B(){const{data:t}=f(L);return t??A}function L(t){return k(t.simple_mode)}function V(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({simple_mode:i},a),s=(i,a)=>e.mutateAsync({simple_mode:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function H(){return c("reports_only")}function c(t){const e=l.c(5);let n;e[0]!==t?(n=i=>D(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=f(n);let o;return e[2]!==s||e[3]!==t?(o=s??z.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function G(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const{data:t}=h.useSession();return G(t?.user?.email)}function X(){const t=l.c(8),{data:e}=h.useSession(),n=w();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||G(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,i=n.hostingControlPlaneGa===!0,a=n.monitorGa===!0,r=c("hosting_enabled"),u=c("deco_analytics_enabled"),C=c("e2e_enabled"),I=c("monitor_enabled"),d=o||i||r,g=o||i||u,_=o||i||C,y=o||a||I;let m;return t[3]!==d||t[4]!==g||t[5]!==_||t[6]!==y?(m={hosting:d,analytics:g,e2e:_,monitor:y},t[3]=d,t[4]=g,t[5]=_,t[6]=y,t[7]=m):m=t[7],m}function tt(){const{data:t}=f(v);return t??!1}function v(t){return $(t.flags)}function et(){const{data:t}=f(x);return t??!0}function x(t){return U(t.flags)}function nt(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a,r)=>e.mutate({flags:{[i]:a}},r),s=(i,a,r)=>e.mutateAsync({flags:{[i]:a}},r),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function K(){const{data:t}=f(Q);return t??null}function Q(t){return t.registry_config}function st(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({registry_config:i},a),s=(i,a)=>e.mutateAsync({registry_config:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function ot(){const t=l.c(5),{org:e}=p(),n=K();let s;t[0]!==e.id?(s=P.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const o=s;let i;return t[2]!==o||t[3]!==n?(i=a=>{if(!n)return a===o;const r=n.registries[a];return r?r.enabled:a===o},t[2]=o,t[3]=n,t[4]=i):i=t[4],i}export{H as a,B as b,et as c,X as d,ot as e,j as f,V as g,K as h,tt as i,nt as j,st as k,J as l,c as u};
@@ -1 +1 @@
1
- import{c as g,k as E,f as R,u as N,eM as k,d as x,y as O,eN as $,aS as M}from"./index-D1uVO7a5.js";import{u as L,D as l}from"./use-destination-route-DcrrHoK-.js";function F(){const e=g.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:U},e[0]=t):t=e[0],E(t)}function U(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData.defaultMain;if(a)return a}return null}const j={board:l.tasks,files:l.library,reports:l.reports,overview:l.home,discover:l.discover};function w(){const e=g.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=R(t);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const s=N(r);let n;return e[2]!==a.panel||e[3]!==s?(n=k(a.panel,s),e[2]=a.panel,e[3]=s,e[4]=n):n=e[4],n}function Y(e){const t=g.c(6),a=w(),r=F();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=N(s);let c;return t[1]!==e||t[2]!==a||t[3]!==r||t[4]!==n.mainpanel?(c=M({panelTabId:a,mainPanelParam:n.mainpanel,routeDefaultMain:r,metadata:e}),t[1]=e,t[2]=a,t[3]=r,t[4]=n.mainpanel,t[5]=c):c=t[5],c.activeTab}function q(){const e=g.c(15),t=x();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const r=R(a);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const n=N(s).virtualmcpid,c=r.org??"",S=L()===l.agents,d=r.taskId;let h;e[2]!==d?(h=(m,u,o)=>f=>{const i=u?{...f}:{thread:f.thread,sidepanel:f.sidepanel};return d&&(i.thread=d),{...o?.search?o.search(i):i,...m,mainpanel:void 0}},e[2]=d,e[3]=h):h=e[3];const T=h;let b;e[4]!==n||e[5]!==t||e[6]!==T||e[7]!==S||e[8]!==c?(b=(m,u)=>{const{panel:o,payload:f}=O(m),i=u?.replace??!0,I=!!o&&$(o),D=T(f,S&&!I,u);if(o&&I){const p=j[o];if(p===l.tasks){t({to:p,params:{org:c,taskKey:void 0},search:D,replace:i});return}t({to:p,params:{org:c},search:D,replace:i});return}const A=u?.virtualmcpid??n;t({to:l.agents,params:{org:c,panel:o},search:p=>({...D(p),virtualmcpid:A}),replace:i})},e[4]=n,e[5]=t,e[6]=T,e[7]=S,e[8]=c,e[9]=b):b=e[9];const P=b;let _;e[10]!==t?(_=m=>t({to:".",search:B,replace:m?.replace??!0}),e[10]=t,e[11]=_):_=e[11];const y=_;let v;return e[12]!==y||e[13]!==P?(v={openPanel:P,closePanel:y},e[12]=y,e[13]=P,e[14]=v):v=e[14],v}function B(e){return{...e,mainpanel:!1}}export{q as a,F as b,Y as c,w as u};
1
+ import{c as g,k as E,f as R,u as N,eM as k,d as x,y as O,eN as $,aS as M}from"./index-CAg73xfh.js";import{u as L,D as l}from"./use-destination-route-ClYb6SQ-.js";function F(){const e=g.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:U},e[0]=t):t=e[0],E(t)}function U(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData.defaultMain;if(a)return a}return null}const j={board:l.tasks,files:l.library,reports:l.reports,overview:l.home,discover:l.discover};function w(){const e=g.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=R(t);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const s=N(r);let n;return e[2]!==a.panel||e[3]!==s?(n=k(a.panel,s),e[2]=a.panel,e[3]=s,e[4]=n):n=e[4],n}function Y(e){const t=g.c(6),a=w(),r=F();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=N(s);let c;return t[1]!==e||t[2]!==a||t[3]!==r||t[4]!==n.mainpanel?(c=M({panelTabId:a,mainPanelParam:n.mainpanel,routeDefaultMain:r,metadata:e}),t[1]=e,t[2]=a,t[3]=r,t[4]=n.mainpanel,t[5]=c):c=t[5],c.activeTab}function q(){const e=g.c(15),t=x();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const r=R(a);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const n=N(s).virtualmcpid,c=r.org??"",S=L()===l.agents,d=r.taskId;let h;e[2]!==d?(h=(m,u,o)=>f=>{const i=u?{...f}:{thread:f.thread,sidepanel:f.sidepanel};return d&&(i.thread=d),{...o?.search?o.search(i):i,...m,mainpanel:void 0}},e[2]=d,e[3]=h):h=e[3];const T=h;let b;e[4]!==n||e[5]!==t||e[6]!==T||e[7]!==S||e[8]!==c?(b=(m,u)=>{const{panel:o,payload:f}=O(m),i=u?.replace??!0,I=!!o&&$(o),D=T(f,S&&!I,u);if(o&&I){const p=j[o];if(p===l.tasks){t({to:p,params:{org:c,taskKey:void 0},search:D,replace:i});return}t({to:p,params:{org:c},search:D,replace:i});return}const A=u?.virtualmcpid??n;t({to:l.agents,params:{org:c,panel:o},search:p=>({...D(p),virtualmcpid:A}),replace:i})},e[4]=n,e[5]=t,e[6]=T,e[7]=S,e[8]=c,e[9]=b):b=e[9];const P=b;let _;e[10]!==t?(_=m=>t({to:".",search:B,replace:m?.replace??!0}),e[10]=t,e[11]=_):_=e[11];const y=_;let v;return e[12]!==y||e[13]!==P?(v={openPanel:P,closePanel:y},e[12]=y,e[13]=P,e[14]=v):v=e[14],v}function B(e){return{...e,mainpanel:!1}}export{q as a,F as b,Y as c,w as u};
@@ -1 +1 @@
1
- import{c as C,G as R}from"./index-D1uVO7a5.js";import{u as p}from"./use-connection-Dtw3OpLU.js";import{W as a}from"./constants-Daqiz8AS.js";import{h as y}from"./use-organization-settings-9P5D6Y0u.js";function G(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{G as u};
1
+ import{c as C,G as R}from"./index-CAg73xfh.js";import{u as p}from"./use-connection-CWOGiGh8.js";import{W as a}from"./constants-Daqiz8AS.js";import{h as y}from"./use-organization-settings-BQJStntT.js";function G(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{G as u};
@@ -1 +1 @@
1
- import{c as u,G as c,a7 as r,K as l,x as d,n as f,e as S}from"./index-D1uVO7a5.js";function C(){const e=u.c(7),{org:n}=c(),a=r();let i;e[0]!==n.id?(i=l.secrets(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:n}=c(),a=r(),i=f();let t;e[0]!==a?(t=async y=>await a.call("SECRET_CREATE",{...y}),e[0]=a,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
1
+ import{c as u,G as c,a7 as r,K as l,x as d,n as f,e as S}from"./index-CAg73xfh.js";function C(){const e=u.c(7),{org:n}=c(),a=r();let i;e[0]!==n.id?(i=l.secrets(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:n}=c(),a=r(),i=f();let t;e[0]!==a?(t=async y=>await a.call("SECRET_CREATE",{...y}),e[0]=a,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
@@ -1 +1 @@
1
- import{c as q,b as K,r as w,j as s,l as Q}from"./index-D1uVO7a5.js";import{ai as _}from"./agent-icon-REzZvJWL.js";import{i as Y}from"./SearchMd-DA6lyMvt.js";import{D as Z,b as ee,d as te,c as se}from"./dialog-DKN4faMQ.js";import{I as re}from"./input-PKwnqbs6.js";import{k as le,l as oe,m as ie,o as X,G as ne,p as ce,q as ae}from"./index-Cuv3j_L9.js";const fe=12,D=new Set,F=new Set;function ue(){for(const r of F)r()}function de(r){return D.has(r)?!0:D.size>=fe?!1:(D.add(r),!0)}function J(r){D.delete(r)&&ue()}function me(r){return F.add(r),()=>{F.delete(r)}}function ve(r,e){const t=w.useRef(!1),[d,i]=w.useState(!1),o=w.useRef(null),f=w.useRef(null),c=w.useRef(null),l=w.useRef(r);l.current=r;const[a]=w.useState(()=>{const n=()=>{c.current?.(),c.current=null},u=()=>t.current?!0:de(e)?(t.current=!0,i(!0),n(),!0):!1;return v=>{if(f.current=v,o.current&&(o.current.disconnect(),o.current=null),n(),!v){t.current&&(J(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(f.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!c.current&&(c.current=me(()=>{f.current===v&&u()}));return}n(),t.current&&(J(e),t.current=!1,i(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),o.current=x})}});return{ref:a,iframeActive:d}}function pe(r){const e=q.c(8),{previewUrl:t,title:d,scrollRootRef:i,slotId:o}=r,{ref:f,iframeActive:c}=ve(i,o),[l,a]=w.useState(!1);let n;e[0]!==c||e[1]!==l||e[2]!==t||e[3]!==d?(n=c?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${d}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>a(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=c,e[1]=l,e[2]=t,e[3]=d,e[4]=n):n=e[4];let u;return e[5]!==f||e[6]!==n?(u=s.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:n}),e[5]=f,e[6]=n,e[7]=u):u=e[7],u}function xe(r){const e=q.c(26),{entry:t,previewUrl:d,scrollRootRef:i,onSelect:o}=r,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let c;e[0]!==f?(c=Q("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=c):c=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==d||e[5]!==i?(l=s.jsx(pe,{previewUrl:d,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=d,e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t.isSavedBlock?(a=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=a):a=e[8];let n;e[9]!==a?(n=s.jsx(_,{className:"h-4 w-4 shrink-0",style:a}),e[9]=a,e[10]=n):n=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==n||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,x]}),e[18]=n,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==o||e[22]!==c||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:o,className:c,children:[l,m]}),e[21]=o,e[22]=c,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=q.c(51),{open:t,onOpenChange:d,meta:i,decofile:o,previewBaseUrl:f,onSelect:c}=r,l=K(),[a,n]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&n(""));let m,h,S,b,j,N,R,y,g,C,T;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==c||e[4]!==t||e[5]!==f||e[6]!==a||e[7]!==l){const z=t&&i&&o?le(i,o):[],W=i?oe(i):"",G=o?ie(o):void 0,H=new Map;if(t&&W)for(const p of z)H.set(p.resolveType,X(f,W,p.previewBlock,G));const M=a.trim().toLowerCase(),V=M?z.filter(p=>p.title.toLowerCase().includes(M)||p.resolveType.toLowerCase().includes(M)||p.description?.toLowerCase().includes(M)):z;h=Z,C=t,T=d,m=ee,R="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=O):O=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>n(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let k;e[27]!==a||e[28]!==B?(k=s.jsxs("div",{className:"relative pt-2",children:[O,s.jsx(re,{value:a,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=a,e[28]=B,e[29]=k):k=e[29],e[30]!==A||e[31]!==k?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,k]}),e[30]=A,e[31]=k,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??X(f,W,p.previewBlock,G),onSelect:()=>c(p)},p.resolveType))}),e[0]=o,e[1]=i,e[2]=d,e[3]=c,e[4]=t,e[5]=f,e[6]=a,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=g,e[17]=C,e[18]=T}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],R=e[14],y=e[15],g=e[16],C=e[17],T=e[18];let P;e[33]!==S||e[34]!==b?(P=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=P):P=e[35];let I;e[36]!==P||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:P}),e[36]=P,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==R||e[43]!==y||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:R,className:y,children:[g,I]}),e[40]=m,e[41]=I,e[42]=R,e[43]=y,e[44]=g,e[45]=L):L=e[45];let E;return e[46]!==h||e[47]!==L||e[48]!==C||e[49]!==T?(E=s.jsx(h,{open:C,onOpenChange:T,children:L}),e[46]=h,e[47]=L,e[48]=C,e[49]=T,e[50]=E):E=e[50],E}function Re(r){const e=q.c(4),{previewServerUrl:t,runtime:d}=ce(r.virtualMcpId),i=d==="cms";let o;return e[0]!==i||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:i}),e[0]=i,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,Re as u};
1
+ import{c as q,b as K,r as w,j as s,l as Q}from"./index-CAg73xfh.js";import{ai as _}from"./agent-icon-CTK0W6_p.js";import{i as Y}from"./SearchMd-BfDJPT5B.js";import{D as Z,b as ee,d as te,c as se}from"./dialog-Cb5sdkZI.js";import{I as re}from"./input-BzefvvjA.js";import{k as le,l as oe,m as ie,o as X,G as ne,p as ce,q as ae}from"./index-DZwdeeSJ.js";const fe=12,D=new Set,F=new Set;function ue(){for(const r of F)r()}function de(r){return D.has(r)?!0:D.size>=fe?!1:(D.add(r),!0)}function J(r){D.delete(r)&&ue()}function me(r){return F.add(r),()=>{F.delete(r)}}function ve(r,e){const t=w.useRef(!1),[d,i]=w.useState(!1),o=w.useRef(null),f=w.useRef(null),c=w.useRef(null),l=w.useRef(r);l.current=r;const[a]=w.useState(()=>{const n=()=>{c.current?.(),c.current=null},u=()=>t.current?!0:de(e)?(t.current=!0,i(!0),n(),!0):!1;return v=>{if(f.current=v,o.current&&(o.current.disconnect(),o.current=null),n(),!v){t.current&&(J(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(f.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!c.current&&(c.current=me(()=>{f.current===v&&u()}));return}n(),t.current&&(J(e),t.current=!1,i(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),o.current=x})}});return{ref:a,iframeActive:d}}function pe(r){const e=q.c(8),{previewUrl:t,title:d,scrollRootRef:i,slotId:o}=r,{ref:f,iframeActive:c}=ve(i,o),[l,a]=w.useState(!1);let n;e[0]!==c||e[1]!==l||e[2]!==t||e[3]!==d?(n=c?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${d}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>a(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=c,e[1]=l,e[2]=t,e[3]=d,e[4]=n):n=e[4];let u;return e[5]!==f||e[6]!==n?(u=s.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:n}),e[5]=f,e[6]=n,e[7]=u):u=e[7],u}function xe(r){const e=q.c(26),{entry:t,previewUrl:d,scrollRootRef:i,onSelect:o}=r,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let c;e[0]!==f?(c=Q("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=c):c=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==d||e[5]!==i?(l=s.jsx(pe,{previewUrl:d,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=d,e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t.isSavedBlock?(a=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=a):a=e[8];let n;e[9]!==a?(n=s.jsx(_,{className:"h-4 w-4 shrink-0",style:a}),e[9]=a,e[10]=n):n=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==n||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,x]}),e[18]=n,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==o||e[22]!==c||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:o,className:c,children:[l,m]}),e[21]=o,e[22]=c,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=q.c(51),{open:t,onOpenChange:d,meta:i,decofile:o,previewBaseUrl:f,onSelect:c}=r,l=K(),[a,n]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&n(""));let m,h,S,b,j,N,R,y,g,C,T;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==c||e[4]!==t||e[5]!==f||e[6]!==a||e[7]!==l){const z=t&&i&&o?le(i,o):[],W=i?oe(i):"",G=o?ie(o):void 0,H=new Map;if(t&&W)for(const p of z)H.set(p.resolveType,X(f,W,p.previewBlock,G));const M=a.trim().toLowerCase(),V=M?z.filter(p=>p.title.toLowerCase().includes(M)||p.resolveType.toLowerCase().includes(M)||p.description?.toLowerCase().includes(M)):z;h=Z,C=t,T=d,m=ee,R="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=O):O=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>n(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let k;e[27]!==a||e[28]!==B?(k=s.jsxs("div",{className:"relative pt-2",children:[O,s.jsx(re,{value:a,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=a,e[28]=B,e[29]=k):k=e[29],e[30]!==A||e[31]!==k?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,k]}),e[30]=A,e[31]=k,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??X(f,W,p.previewBlock,G),onSelect:()=>c(p)},p.resolveType))}),e[0]=o,e[1]=i,e[2]=d,e[3]=c,e[4]=t,e[5]=f,e[6]=a,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=g,e[17]=C,e[18]=T}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],R=e[14],y=e[15],g=e[16],C=e[17],T=e[18];let P;e[33]!==S||e[34]!==b?(P=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=P):P=e[35];let I;e[36]!==P||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:P}),e[36]=P,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==R||e[43]!==y||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:R,className:y,children:[g,I]}),e[40]=m,e[41]=I,e[42]=R,e[43]=y,e[44]=g,e[45]=L):L=e[45];let E;return e[46]!==h||e[47]!==L||e[48]!==C||e[49]!==T?(E=s.jsx(h,{open:C,onOpenChange:T,children:L}),e[46]=h,e[47]=L,e[48]=C,e[49]=T,e[50]=E):E=e[50],E}function Re(r){const e=q.c(4),{previewServerUrl:t,runtime:d}=ce(r.virtualMcpId),i=d==="cms";let o;return e[0]!==i||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:i}),e[0]=i,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,Re as u};
@@ -1 +1 @@
1
- import{c as r,v as u}from"./index-D1uVO7a5.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-CVjAzkvm.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
1
+ import{c as r,v as u}from"./index-CAg73xfh.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-D84k9wQQ.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +1 @@
1
- import{c as u,G as f,a7 as y,m,n as g,e as T,K as l,t as E}from"./index-D1uVO7a5.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function G(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,G as c,M as d,K as u};
1
+ import{c as u,G as f,a7 as y,m,n as g,e as T,K as l,t as E}from"./index-CAg73xfh.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function G(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,G as c,M as d,K as u};
@@ -1 +1 @@
1
- import{c as p,J as w,r as f}from"./index-D1uVO7a5.js";function I(M,b){const e=p.c(12),d=b===void 0?"cards":b,o=w(),g=f.useRef(o),s=M?`deco-view-mode-${M}`:"deco-view-mode";let i;e[0]!==d||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:d},e[0]=d,e[1]=s,e[2]=i):i=e[2];const[t,m]=f.useState(i);let l;e[3]!==s?(l=r=>{m(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const u=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!g.current&&o&&t==="table"&&m("cards"),g.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]!==u||e[10]!==t?(n=[t,u],e[9]=u,e[10]=t,e[11]=n):n=e[11],n}export{I as u};
1
+ import{c as p,J as w,r as f}from"./index-CAg73xfh.js";function I(M,b){const e=p.c(12),d=b===void 0?"cards":b,o=w(),g=f.useRef(o),s=M?`deco-view-mode-${M}`:"deco-view-mode";let i;e[0]!==d||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:d},e[0]=d,e[1]=s,e[2]=i):i=e[2];const[t,m]=f.useState(i);let l;e[3]!==s?(l=r=>{m(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const u=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!g.current&&o&&t==="table"&&m("cards"),g.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]!==u||e[10]!==t?(n=[t,u],e[9]=u,e[10]=t,e[11]=n):n=e[11],n}export{I as u};
@@ -1 +1 @@
1
- import{c as C,G as I,eO as S,c8 as _,K as A,eP as y,m as M,eQ as L,c7 as T,eR as U}from"./index-D1uVO7a5.js";import{u as p,e as V,m as R}from"./use-mcp-client-_41rYMEd.js";import{S as g}from"./constants-Daqiz8AS.js";function h(o){const t=C.c(5);let e;t[0]!==o?(e=o===void 0?{}:o,t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);return S(s.id,"VIRTUAL_MCP",l,n)}function O(o){const t=C.c(14);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=L(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;return t[12]!==d?(a=d??[],t[12]=d,t[13]=a):a=t[13],a}function w(o){const t=C.c(10),{org:e}=I();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 s=V(n),i=o??void 0;let l;t[3]!==s||t[4]!==e.id||t[5]!==i?(l=y(e.id,"VIRTUAL_MCP",i,s),t[3]=s,t[4]=e.id,t[5]=i,t[6]=l):l=t[6];const c=!!s&&!!o;let r;t[7]!==l||t[8]!==c?(r={...l,enabled:c},t[7]=l,t[8]=c,t[9]=r):r=t[9];const{data:u}=M(r);return u?.item??null}async function E(o,t,e={}){const n=await o.fetchQuery(R({connectionId:g,orgId:t.id,orgSlug:t.slug})),s=L(t.id,"VIRTUAL_MCP",n,e);return s.select(await o.fetchQuery(s))}function k(o){const t=C.c(18);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=U(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;t[12]!==d?.items?(a=d?.items??[],t[12]=d?.items,t[13]=a):a=t[13];const P=d?.totalCount,m=d?.hasMore;let f;return t[14]!==a||t[15]!==P||t[16]!==m?(f={items:a,totalCount:P,hasMore:m},t[14]=a,t[15]=P,t[16]=m,t[17]=f):f=t[17],f}function v(o){const t=C.c(3),{org:e}=I();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 s=p(n);return T(e.id,"VIRTUAL_MCP",o??void 0,s)}function x(o){const t=C.c(15),{org:e}=I();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 s=p(n);let i,l,c;t[3]!==o||t[4]!==e.id?(i=[...o].sort(),c=M,l=A.virtualMcpLastUsed(e.id,i),t[3]=o,t[4]=e.id,t[5]=i,t[6]=l,t[7]=c):(i=t[5],l=t[6],c=t[7]);const r=i.length>0;let u;t[8]!==s||t[9]!==i?(u=async()=>{const P=(await s.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:i}})).structuredContent??{items:[]},m=new Map;for(const f of P.items)m.set(f.id,f);return m},t[8]=s,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==r||t[13]!==u?(d={queryKey:l,enabled:r,staleTime:3e4,queryFn:u},t[11]=l,t[12]=r,t[13]=u,t[14]=d):d=t[14],c(d)}function B(){const o=C.c(3),{org:t}=I();let e;o[0]!==t.id||o[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},o[0]=t.id,o[1]=t.slug,o[2]=e):e=o[2];const n=p(e);return _(t.id,"VIRTUAL_MCP",n)}export{h as a,B as b,x as c,O as d,k as e,w as f,E as g,v as u};
1
+ import{c as C,G as I,eO as S,c8 as _,K as A,eP as y,m as M,eQ as L,c7 as T,eR as U}from"./index-CAg73xfh.js";import{u as p,e as V,m as R}from"./use-mcp-client-ArFEvvrW.js";import{S as g}from"./constants-Daqiz8AS.js";function h(o){const t=C.c(5);let e;t[0]!==o?(e=o===void 0?{}:o,t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);return S(s.id,"VIRTUAL_MCP",l,n)}function O(o){const t=C.c(14);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=L(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;return t[12]!==d?(a=d??[],t[12]=d,t[13]=a):a=t[13],a}function w(o){const t=C.c(10),{org:e}=I();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 s=V(n),i=o??void 0;let l;t[3]!==s||t[4]!==e.id||t[5]!==i?(l=y(e.id,"VIRTUAL_MCP",i,s),t[3]=s,t[4]=e.id,t[5]=i,t[6]=l):l=t[6];const c=!!s&&!!o;let r;t[7]!==l||t[8]!==c?(r={...l,enabled:c},t[7]=l,t[8]=c,t[9]=r):r=t[9];const{data:u}=M(r);return u?.item??null}async function E(o,t,e={}){const n=await o.fetchQuery(R({connectionId:g,orgId:t.id,orgSlug:t.slug})),s=L(t.id,"VIRTUAL_MCP",n,e);return s.select(await o.fetchQuery(s))}function k(o){const t=C.c(18);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=U(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;t[12]!==d?.items?(a=d?.items??[],t[12]=d?.items,t[13]=a):a=t[13];const P=d?.totalCount,m=d?.hasMore;let f;return t[14]!==a||t[15]!==P||t[16]!==m?(f={items:a,totalCount:P,hasMore:m},t[14]=a,t[15]=P,t[16]=m,t[17]=f):f=t[17],f}function v(o){const t=C.c(3),{org:e}=I();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 s=p(n);return T(e.id,"VIRTUAL_MCP",o??void 0,s)}function x(o){const t=C.c(15),{org:e}=I();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 s=p(n);let i,l,c;t[3]!==o||t[4]!==e.id?(i=[...o].sort(),c=M,l=A.virtualMcpLastUsed(e.id,i),t[3]=o,t[4]=e.id,t[5]=i,t[6]=l,t[7]=c):(i=t[5],l=t[6],c=t[7]);const r=i.length>0;let u;t[8]!==s||t[9]!==i?(u=async()=>{const P=(await s.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:i}})).structuredContent??{items:[]},m=new Map;for(const f of P.items)m.set(f.id,f);return m},t[8]=s,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==r||t[13]!==u?(d={queryKey:l,enabled:r,staleTime:3e4,queryFn:u},t[11]=l,t[12]=r,t[13]=u,t[14]=d):d=t[14],c(d)}function B(){const o=C.c(3),{org:t}=I();let e;o[0]!==t.id||o[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},o[0]=t.id,o[1]=t.slug,o[2]=e):e=o[2];const n=p(e);return _(t.id,"VIRTUAL_MCP",n)}export{h as a,B as b,x as c,O as d,k as e,w as f,E as g,v as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./infiniteQueryObserver-BZrz9hlL.js";import{fc as i}from"./index-CAg73xfh.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./infiniteQueryObserver-BZrz9hlL.js";import{fc as u,bT as n}from"./index-CAg73xfh.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +1 @@
1
- import{c as V,b as q,r as z,a as O,m as Y,e as $,j as t,P as I,K as J,t as Q,B as W}from"./index-D1uVO7a5.js";import{C as G}from"./collection-table-wrapper-tzJitBDy.js";import{E as L}from"./empty-state-DFZB0NRe.js";import{S as H}from"./search-input-D5662yMv.js";import{A as X}from"./avatar-CrZXt8p7.js";import{B as D}from"./badge-BCKwaV6Y.js";import{u as Z}from"./use-debounced-value-8NgBj3iZ.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BtXRrtv4.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./table-0zkxXYgD.js";import"./ArrowUp-dG47x-aJ.js";import"./SearchMd-DA6lyMvt.js";import"./User01-BFHgHf13.js";import"./differenceInSeconds-C3x8sHUj.js";function ve(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const a=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==a?(n=J.deploymentAdminUsers(a),e[2]=a,e[3]=n):n=e[3];let l;e[4]!==a?(l=()=>{const i=new URLSearchParams({limit:"100"});return a&&i.set("searchValue",a),K(`/api/_admin/users?${i}`)},e[4]=a,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:ae,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(H,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==a||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:a?s("admin.users.noUsersMatchSearch",{search:a}):s("admin.users.noUsersYet")}),e[46]=a,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{ve as default};
1
+ import{c as V,b as q,r as z,a as O,m as Y,e as $,j as t,P as I,K as J,t as Q,B as W}from"./index-CAg73xfh.js";import{C as G}from"./collection-table-wrapper-CbTmVbz-.js";import{E as L}from"./empty-state-DEp7OSHt.js";import{S as H}from"./search-input-8135C_IH.js";import{A as X}from"./avatar-Bdrmd6QQ.js";import{B as D}from"./badge-DESV1uy1.js";import{u as Z}from"./use-debounced-value-Bzo3YMBK.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BtXRrtv4.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./table-BM0XqjBy.js";import"./ArrowUp-BKeTY9pc.js";import"./SearchMd-BfDJPT5B.js";import"./User01-B_vrSU38.js";import"./differenceInSeconds-C3x8sHUj.js";function ve(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const a=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==a?(n=J.deploymentAdminUsers(a),e[2]=a,e[3]=n):n=e[3];let l;e[4]!==a?(l=()=>{const i=new URLSearchParams({limit:"100"});return a&&i.set("searchValue",a),K(`/api/_admin/users?${i}`)},e[4]=a,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:ae,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(H,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==a||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:a?s("admin.users.noUsersMatchSearch",{search:a}):s("admin.users.noUsersYet")}),e[46]=a,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{ve as default};