decocms 4.430.1 → 4.430.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 (401) hide show
  1. package/dist/client/assets/{AlertCircle-BUkWQfB_.js → AlertCircle-CVYthSXp.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DNVY-5xH.js → AreaChart-qNgHWHyJ.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-C_Aui1-t.js → ArrowLeft-CyFyBJmn.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-dUCC1h4R.js → ArrowUp-CeSPU7QT.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-BJS29ety.js → CartesianChart-B5tlzKMt.js} +1 -1
  6. package/dist/client/assets/{Check-D53o53z1.js → Check-DN3fVKj8.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CiGc92II.js → CheckCircle-BsdvfhEK.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-C0R59WlW.js → ChevronUp-xWbDxNSk.js} +1 -1
  9. package/dist/client/assets/{Copy01-Bc_ajdkn.js → Copy01-Dv7sipLd.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-kOAv1J_D.js → CreditCard01-Dk07lq-0.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-COvSpfVi.js → DotsVertical-DhmK4qgN.js} +1 -1
  12. package/dist/client/assets/{ErrorBarContext-DT3_OZEr.js → ErrorBarContext-gSfovbHF.js} +1 -1
  13. package/dist/client/assets/{Image01-BOx8LVbG.js → Image01-Y9Scw-o_.js} +1 -1
  14. package/dist/client/assets/{Key01-CmosOv0s.js → Key01-CtWEwt_r.js} +1 -1
  15. package/dist/client/assets/{Line-CComtnBD.js → Line-DBvwF3QX.js} +1 -1
  16. package/dist/client/assets/{Link01-B-BcpSea.js → Link01-CsZgPYpl.js} +1 -1
  17. package/dist/client/assets/LinkBroken01-DGoMMKbF.js +1 -0
  18. package/dist/client/assets/{LinkExternal01-BOhmrkdK.js → LinkExternal01-B-WvSbZy.js} +1 -1
  19. package/dist/client/assets/{Monitor01-CqmqvaJt.js → Monitor01-kmeIS50B.js} +1 -1
  20. package/dist/client/assets/{Palette-Dn80uz2_.js → Palette-CmpIZcQI.js} +1 -1
  21. package/dist/client/assets/{Plus-B0T7sCOu.js → Plus-CGgnB9yV.js} +1 -1
  22. package/dist/client/assets/{SearchMd-BjiZq5Ss.js → SearchMd-B7WxOr73.js} +1 -1
  23. package/dist/client/assets/{Sector-WjC96jsi.js → Sector-CEcu8yPs.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-mLNM1PWh.js → ShoppingBag01-BG3AWGBS.js} +1 -1
  25. package/dist/client/assets/{Sun--68QpCgd.js → Sun-Be_v4SgI.js} +1 -1
  26. package/dist/client/assets/{Tool01-UwOdqleo.js → Tool01-U6VAdTvK.js} +1 -1
  27. package/dist/client/assets/{Trash01-CzavZmmt.js → Trash01-d2ldPDpp.js} +1 -1
  28. package/dist/client/assets/{Upload01-BWIuH341.js → Upload01-vuUJE-Un.js} +1 -1
  29. package/dist/client/assets/{User01-CUsG_6c_.js → User01-DrdqUOnb.js} +1 -1
  30. package/dist/client/assets/{UserSquare-BMQF7dC1.js → UserSquare-zqtxIeMd.js} +1 -1
  31. package/dist/client/assets/{Users01-Bbfu9MdC.js → Users01-BSNk1mAx.js} +1 -1
  32. package/dist/client/assets/{X-CtohJRXR.js → X-MCJw_lkE.js} +1 -1
  33. package/dist/client/assets/{XAxis-Depi7ZOt.js → XAxis-CUk_D47K.js} +1 -1
  34. package/dist/client/assets/{XClose-Bg9Zp2j0.js → XClose-DJWS3DCR.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-C_zus5H2.js → ZoomOut-DxgRaJHf.js} +1 -1
  36. package/dist/client/assets/{access-gate-BSw0CcmD.js → access-gate-buHLOhRt.js} +1 -1
  37. package/dist/client/assets/add-connection-dialog-b2gPK4A2.js +1 -0
  38. package/dist/client/assets/agent-analytics-CkHKK2sI.js +2 -0
  39. package/dist/client/assets/agent-app-xUbOx1nA.js +1 -0
  40. package/dist/client/assets/agent-assets-BLWW7tSV.js +1 -0
  41. package/dist/client/assets/{agent-automation-CWPvYNFY.js → agent-automation-C585Dco7.js} +2 -2
  42. package/dist/client/assets/agent-automations-DipmSooi.js +1 -0
  43. package/dist/client/assets/agent-connect-sources-Cg-rDHA_.js +1 -0
  44. package/dist/client/assets/agent-deck-BOFjOn39.js +1 -0
  45. package/dist/client/assets/agent-e2e-BF3tKvyc.js +1 -0
  46. package/dist/client/assets/agent-experiments-fsdGMiOY.js +1 -0
  47. package/dist/client/assets/agent-file-BbcJd6HM.js +1 -0
  48. package/dist/client/assets/{agent-git-C1jtwOs1.js → agent-git-vy54BjiV.js} +2 -2
  49. package/dist/client/assets/agent-hosting-Bnd-xqY4.js +1 -0
  50. package/dist/client/assets/agent-icon-DQhX6pyL.js +1 -0
  51. package/dist/client/assets/agent-library-CoQDyojP.js +1 -0
  52. package/dist/client/assets/agent-library-file-Bp-seD91.js +1 -0
  53. package/dist/client/assets/agent-monitor-DIqqvckJ.js +1 -0
  54. package/dist/client/assets/agent-overview-DIPsKuHn.js +1 -0
  55. package/dist/client/assets/agent-settings-CuSkQv6E.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-DQ9aUQOK.js → agent-site-editor-C_9Sp-ko.js} +2 -2
  57. package/dist/client/assets/agent-site-editor-code-BWwVQZ5b.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-D62zi8Ka.js → agent-site-editor-content-BIULxMT9.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-BFe9L8ZC.js → agent-site-editor-preview-CA1JSDGo.js} +3 -3
  60. package/dist/client/assets/agent-view-bJuK5JMH.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-DvkFRuT1.js → agent-view-guard-CRvRYAMg.js} +1 -1
  62. package/dist/client/assets/agents-list-BguEBZWs.js +1 -0
  63. package/dist/client/assets/{ai-providers-BKaAhkKr.js → ai-providers-DQfBdh-5.js} +1 -1
  64. package/dist/client/assets/{alert-hHCCxPrm.js → alert-BxbrJMD6.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-DPE6kDht.js → alert-dialog-BYJnmaQz.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-BaLMxjIR.js → analytics-sections-BupuHkrr.js} +1 -1
  67. package/dist/client/assets/{api-keys-Cs2lX4sa.js → api-keys-9ma74-9W.js} +1 -1
  68. package/dist/client/assets/api-keys-CgI6_AMK.js +1 -0
  69. package/dist/client/assets/app-editor-Cw0XiLbp.js +1 -0
  70. package/dist/client/assets/{asset-utils-6K_UaEMl.js → asset-utils-Qk5h-wqe.js} +1 -1
  71. package/dist/client/assets/{auth-yZ0dbxiQ.js → auth-BA3Q_TJo.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-C2FsnDrX.js → auth-catchall-knLcWJNd.js} +1 -1
  73. package/dist/client/assets/{auth-entry-BVb_LGQt.js → auth-entry-DJOJ8Rs7.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-DCczOAkV.js → auth-split-layout-Dt6Lr3jy.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-DSfbaJXn.js → authenticate-and-persist-oauth-BTuznNbi.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-BX95wnlk.js → automation-list-row-DGBpkMxN.js} +1 -1
  77. package/dist/client/assets/{automation-runs-rMXYly96.js → automation-runs-CgYsY8Ss.js} +1 -1
  78. package/dist/client/assets/automations-CB7gLMbz.js +1 -0
  79. package/dist/client/assets/{autosend-DaQ0WgM_.js → autosend-D_HIQJhP.js} +1 -1
  80. package/dist/client/assets/{avatar-qgmN1uFW.js → avatar-DnckqjGp.js} +1 -1
  81. package/dist/client/assets/{badge-Bjr6roKX.js → badge-BeT90Jfh.js} +1 -1
  82. package/dist/client/assets/{block-document-CmPQoPil.js → block-document-g-hQygUE.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-Bt2a6bTr.js → blocks-preview-workspace-context-CIl38gkx.js} +1 -1
  84. package/dist/client/assets/{buckets-CUvpxamI.js → buckets-0BdD_fJX.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-DVZptWMu.js → build-improve-prompt-doc-C5i29eyt.js} +1 -1
  86. package/dist/client/assets/{calendar-hWMukXvu.js → calendar-DwEcUKGe.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-BhEiGFSy.js → capability-load-error-BwY99ChM.js} +1 -1
  88. package/dist/client/assets/category-editor-BPnM7ZcX.js +1 -0
  89. package/dist/client/assets/{chart-CpCJ5a7h.js → chart-DzZFGD1z.js} +1 -1
  90. package/dist/client/assets/{chat-context-CG9Mp_L-.js → chat-context-CSREXmZ-.js} +1 -1
  91. package/dist/client/assets/{chat-draft-DApZt_La.js → chat-draft-BYIogZvi.js} +1 -1
  92. package/dist/client/assets/{checkbox-DoT4yq3W.js → checkbox-VSFOqgpI.js} +1 -1
  93. package/dist/client/assets/choose-editor-BhFFcEad.js +1 -0
  94. package/dist/client/assets/{claim-phase-copy-BVJw-2Sg.js → claim-phase-copy-DMl_wfzl.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-B4d0MFu9.js → cli-auth-success-rCzd61IP.js} +1 -1
  96. package/dist/client/assets/{client-icons-B2Ky8xii.js → client-icons-DQokRtPQ.js} +1 -1
  97. package/dist/client/assets/{collapsible-D2a3Inov.js → collapsible-hh2QeFQx.js} +1 -1
  98. package/dist/client/assets/collection-detail-CZHU581t.js +1 -0
  99. package/dist/client/assets/{collection-display-button-YClOnQnk.js → collection-display-button-BHhyBowf.js} +1 -1
  100. package/dist/client/assets/{collection-search-B5LfgGj5.js → collection-search-Be2s73S6.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-1_pTlxny.js → collection-table-wrapper-CZd1WcSO.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-CYKC6woL.js → collection-tabs-B1fc3hEx.js} +1 -1
  103. package/dist/client/assets/{combobox-Bi0f4g0J.js → combobox-DJXjtyos.js} +1 -1
  104. package/dist/client/assets/{command-DcCoSxh3.js → command-i-VcjjfU.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-Dk-qAE2Z.js → companion-mcps-section-BNGcJQ5q.js} +1 -1
  106. package/dist/client/assets/{config-bRaSZ6ZI.js → config-B-PocAul.js} +1 -1
  107. package/dist/client/assets/{connect-CDe5uHFz.js → connect-CJrfrNOc.js} +1 -1
  108. package/dist/client/assets/{connect-layout-6lDDk3bO.js → connect-layout-Ck9_7bFy.js} +1 -1
  109. package/dist/client/assets/{connection-DLRl6H0w.js → connection-DWKQsiJ1.js} +1 -1
  110. package/dist/client/assets/{connection-card-BMfy_L46.js → connection-card-BxTTbMjg.js} +1 -1
  111. package/dist/client/assets/connection-detail-CwaF40yO.js +1 -0
  112. package/dist/client/assets/{connection-form-helpers-DyGM93YP.js → connection-form-helpers-UQvDnJ_o.js} +1 -1
  113. package/dist/client/assets/connections-BLQ5SqNN.js +1 -0
  114. package/dist/client/assets/context-BkyMYnN6.js +1 -0
  115. package/dist/client/assets/{context-menu-BWEhojhE.js → context-menu-D2E2BNSJ.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-D2gREUUr.js → create-organization-dialog-BPnp8P72.js} +1 -1
  117. package/dist/client/assets/daily-pulse-BmnQTDoG.js +1 -0
  118. package/dist/client/assets/{decopilot-Cp1gF-AT.js → decopilot-CaWhcF5x.js} +1 -1
  119. package/dist/client/assets/{dialog-D1MsBTH7.js → dialog-DwOXW4AO.js} +1 -1
  120. package/dist/client/assets/discover-DakQJU5_.js +1 -0
  121. package/dist/client/assets/{domain-settings-CVSAVAoV.js → domain-settings-CrCw_lIY.js} +1 -1
  122. package/dist/client/assets/{download-app-dialog-CI6vYgNV.js → download-app-dialog-CZZmW5dI.js} +1 -1
  123. package/dist/client/assets/{drawer-DQ1B0U-G.js → drawer-DYVK-Yxy.js} +1 -1
  124. package/dist/client/assets/{editor-CXgFNygO.js → editor-fs_-xqtP.js} +1 -1
  125. package/dist/client/assets/{empty-state-CwnTG9Vu.js → empty-state-B8AHzTIo.js} +1 -1
  126. package/dist/client/assets/{empty-state-zFf02K5-.js → empty-state-GPBYJgGv.js} +1 -1
  127. package/dist/client/assets/{extract-connection-data-CD-3Cduz.js → extract-connection-data-DwhEeit2.js} +1 -1
  128. package/dist/client/assets/{feature-gate-DxAWWJZd.js → feature-gate-CitKKOE2.js} +1 -1
  129. package/dist/client/assets/{feature-paywall-C7fyZx2V.js → feature-paywall-DweqAdFr.js} +1 -1
  130. package/dist/client/assets/file-explorer-DCrNzMRJ.js +2 -0
  131. package/dist/client/assets/{file-preview-WwyFKcds.js → file-preview-CUNQwIMu.js} +1 -1
  132. package/dist/client/assets/{file-share-button-0thUGHHJ.js → file-share-button-DVNdVkoS.js} +2 -2
  133. package/dist/client/assets/{file-type-icon-TH99y45i.js → file-type-icon-BKMgh7vP.js} +1 -1
  134. package/dist/client/assets/flat-project-BzPFVO8c.js +1 -0
  135. package/dist/client/assets/{folder-icon-Dmxyn26B.js → folder-icon-DFC1tMoz.js} +1 -1
  136. package/dist/client/assets/{form-CelWRzw5.js → form-CBqY_Qj5.js} +1 -1
  137. package/dist/client/assets/{gateway-client-B5Pd686Y.js → gateway-client-BgWzL4m_.js} +1 -1
  138. package/dist/client/assets/{general-DeFJH4BS.js → general-CpwupPfh.js} +1 -1
  139. package/dist/client/assets/home-DL5QzWnK.js +1 -0
  140. package/dist/client/assets/icon-button-BtLKyT7m.js +1 -0
  141. package/dist/client/assets/{index-CMZSUEgF.js → index-BbS4gDnQ.js} +1 -1
  142. package/dist/client/assets/{index-CtnFCw07.js → index-BeeQz6mt.js} +1 -1
  143. package/dist/client/assets/{index-COzII8Rl.js → index-BzcY0Rd6.js} +1 -1
  144. package/dist/client/assets/{index-CdVv5PyR.js → index-BznQH_sl.js} +1 -1
  145. package/dist/client/assets/{index-BBMMcl5D.js → index-C8jZ4bpw.js} +1 -1
  146. package/dist/client/assets/{index-CyQyr88p.js → index-CWzlOAQX.js} +46 -46
  147. package/dist/client/assets/{index-9e8H03cs.js → index-Cy0Tj9zL.js} +1 -1
  148. package/dist/client/assets/{index-De2ebevC.js → index-DCYp09DY.js} +1 -1
  149. package/dist/client/assets/{index-3gIKLZj9.css → index-DDkAv5gF.css} +1 -1
  150. package/dist/client/assets/{index-xqiApMBX.js → index-DSVDaqXP.js} +1 -1
  151. package/dist/client/assets/{index-DXD6LtMh.js → index-DYrWEQp-.js} +1 -1
  152. package/dist/client/assets/index-Dh5O1uzF.js +1 -0
  153. package/dist/client/assets/{index-Bp8O3HWE.js → index-DrVMQFyO.js} +1 -1
  154. package/dist/client/assets/index-HhorfmmF.js +1 -0
  155. package/dist/client/assets/{index-POiEXzT7.js → index-Qp03HhfC.js} +1 -1
  156. package/dist/client/assets/{index-DbPTqP1k.js → index-h4lVf9qd.js} +4 -4
  157. package/dist/client/assets/{index-redirect-XX1RPnFl.js → index-redirect-BzVBOYpG.js} +1 -1
  158. package/dist/client/assets/{infiniteQueryObserver-Bm7kObFT.js → infiniteQueryObserver-z6KpeaXk.js} +1 -1
  159. package/dist/client/assets/{infra-billing-Wd0aWcPF.js → infra-billing-Dm9O0MpT.js} +1 -1
  160. package/dist/client/assets/{input-CeDoO_Rr.js → input-BT8saI27.js} +1 -1
  161. package/dist/client/assets/{input-D-tRfEUe.js → input-CJK7pC9G.js} +1 -1
  162. package/dist/client/assets/{input-C19kkoiF.js → input-bivLuh-1.js} +3 -3
  163. package/dist/client/assets/integration-icon-B95GPMKQ.js +1 -0
  164. package/dist/client/assets/{label-DO3jRcdx.js → label-0TZ28Umz.js} +1 -1
  165. package/dist/client/assets/{last-preview-page-CI8sVa42.js → last-preview-page-ZNVmf1EU.js} +1 -1
  166. package/dist/client/assets/{layout-C3JP2G-I.js → layout-j1X96Ggx.js} +1 -1
  167. package/dist/client/assets/{legacy-agents-deep-BJqv5541.js → legacy-agents-deep-cacTD8f_.js} +1 -1
  168. package/dist/client/assets/{legacy-main-redirect-CXYH487V.js → legacy-main-redirect--cYJW20n.js} +1 -1
  169. package/dist/client/assets/library-DtGn3FJA.js +1 -0
  170. package/dist/client/assets/{library-tab-vy9WBvuU.js → library-tab-CTkh7nfn.js} +1 -1
  171. package/dist/client/assets/{login-DZytsZWm.js → login-c8HNUl_C.js} +1 -1
  172. package/dist/client/assets/{markdown-CD9qrdS_.js → markdown-Bqzss8Ii.js} +1 -1
  173. package/dist/client/assets/{mcp-app-renderer-C_mTIe3Q.js → mcp-app-renderer-BXwhxgcp.js} +1 -1
  174. package/dist/client/assets/{mcp-oauth-BHkP1C2P.js → mcp-oauth-C0PojFFt.js} +1 -1
  175. package/dist/client/assets/{members-BXW762DS.js → members-CyyrlPEt.js} +1 -1
  176. package/dist/client/assets/{message-templates-Y1dkPYIa.js → message-templates-BDPyGA1f.js} +1 -1
  177. package/dist/client/assets/{mini-report-page-BBWmfTbX.js → mini-report-page-BNC-xTjm.js} +1 -1
  178. package/dist/client/assets/{mock-board-DAh526hI.js → mock-board-DovrLxym.js} +1 -1
  179. package/dist/client/assets/{monaco-editor-1WiLwMoS.js → monaco-editor-DCqxqYSj.js} +1 -1
  180. package/dist/client/assets/{monitoring-stats-row-DvfsN9_z.js → monitoring-stats-row-OA16NnfT.js} +1 -1
  181. package/dist/client/assets/{multi-select-CUTVdKAC.js → multi-select-tRlT3L5z.js} +1 -1
  182. package/dist/client/assets/{mustache-BoM8yvOe.js → mustache-BP7du7Zy.js} +1 -1
  183. package/dist/client/assets/{new-project-dialog-_BSkwB51.js → new-project-dialog-I6QtJuZt.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-DsCdusXE.js → oauth-callback-MJTjt1We.js} +1 -1
  185. package/dist/client/assets/{oauth-callback-ai-provider-C5T-VDKL.js → oauth-callback-ai-provider-B0EhyPGD.js} +1 -1
  186. package/dist/client/assets/{onboarding-DetvWDKL.js → onboarding-X4AYCK_N.js} +1 -1
  187. package/dist/client/assets/openai-conversation-BrI4LVLa.js +3 -0
  188. package/dist/client/assets/{optimistic-project-sidebar-views-DVSvifkv.js → optimistic-project-sidebar-views-B35k6512.js} +1 -1
  189. package/dist/client/assets/{org-file-open-context-vlnvSapQ.js → org-file-open-context-W094eyab.js} +1 -1
  190. package/dist/client/assets/{organization-choice-Bl7AK6HJ.js → organization-choice-BLsuyEtq.js} +1 -1
  191. package/dist/client/assets/{orgs-_O4TUqxu.js → orgs-Y9G8A5Ph.js} +1 -1
  192. package/dist/client/assets/{page-seo-form--aiitwzb.js → page-seo-form-CJW4yq3f.js} +1 -1
  193. package/dist/client/assets/{pair-Bjle9-b6.js → pair-csGGOkx1.js} +7 -7
  194. package/dist/client/assets/{plan-ladder-C9iTCEoq.js → plan-ladder-C4roHlM5.js} +1 -1
  195. package/dist/client/assets/{popover-BlirYmOQ.js → popover-Cd3ISjs_.js} +1 -1
  196. package/dist/client/assets/post-calendar-CAWS2Vmq.js +1 -0
  197. package/dist/client/assets/{post-editor-QaOkF5FX.js → post-editor-D2xBHjct.js} +1 -1
  198. package/dist/client/assets/{preview-content-C4Rard2P.js → preview-content-CzVZuXbr.js} +1 -1
  199. package/dist/client/assets/{preview-dialog-Cz9jaB0z.js → preview-dialog-8lnbKA_n.js} +1 -1
  200. package/dist/client/assets/{profile-C-BPCyIp.js → profile-BgxkafeL.js} +1 -1
  201. package/dist/client/assets/project-app-view-icxI7Rov.js +1 -0
  202. package/dist/client/assets/project-feed-BgMHYF1Z.js +1 -0
  203. package/dist/client/assets/{project-icon-C1d9Z0m5.js → project-icon-BfkDVtEt.js} +1 -1
  204. package/dist/client/assets/project-reports-BFfWvANX.js +1 -0
  205. package/dist/client/assets/project-tasks-C64LpTAA.js +1 -0
  206. package/dist/client/assets/projects-BUTz1MMd.js +1 -0
  207. package/dist/client/assets/{projects-empty-state-Bdo_Rhj-.js → projects-empty-state-D4QNY6yf.js} +1 -1
  208. package/dist/client/assets/{prompts-BsB5FTPC.js → prompts-_wvcaZiq.js} +1 -1
  209. package/dist/client/assets/record-editor-6OpzvMEF.js +1 -0
  210. package/dist/client/assets/redirect-editor-D7uptbDW.js +1 -0
  211. package/dist/client/assets/reports-DLhsthYj.js +1 -0
  212. package/dist/client/assets/{reports-Chj5li8_.js → reports-KcjvDixJ.js} +1 -1
  213. package/dist/client/assets/reports-onboarding-Zp49oKKp.js +1 -0
  214. package/dist/client/assets/reports-tab-BbyRBNRf.js +2 -0
  215. package/dist/client/assets/repositories-EkSR0y55.js +1 -0
  216. package/dist/client/assets/{repository-binding-Dgq5OsMA.js → repository-binding-3gizJnq4.js} +1 -1
  217. package/dist/client/assets/{repository-import-picker-D2pzrWr6.js → repository-import-picker-DG_yM72C.js} +1 -1
  218. package/dist/client/assets/{repository-picker-STEm8zmF.js → repository-picker-BR_sMkOw.js} +1 -1
  219. package/dist/client/assets/{require-capability-BH1WwajD.js → require-capability-C2Nda3jm.js} +1 -1
  220. package/dist/client/assets/{required-auth-layout-Cy0atFVL.js → required-auth-layout-CtzgnDx3.js} +1 -1
  221. package/dist/client/assets/{reset-password-BwPcMGPY.js → reset-password-D2Alw1H7.js} +1 -1
  222. package/dist/client/assets/{resizable-BU4a2PvY.js → resizable-DqYE28tG.js} +1 -1
  223. package/dist/client/assets/{resolve-tab-icon-c84JJRcB.js → resolve-tab-icon-liQGha1g.js} +1 -1
  224. package/dist/client/assets/{review-settings-iEyMCfp2.js → review-settings-B0nVs037.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-DlGKoKEw.js → rich-text-link-control-U94G_E0v.js} +1 -1
  226. package/dist/client/assets/roles-B_4b_QUD.js +1 -0
  227. package/dist/client/assets/route-16Qzmh2H.js +1 -0
  228. package/dist/client/assets/route-B3tjN4Zg.js +1 -0
  229. package/dist/client/assets/route-C_Hs1TIL.js +1 -0
  230. package/dist/client/assets/{runnable-block-editor-R-_6elGy.js → runnable-block-editor-Dx2bIxdz.js} +1 -1
  231. package/dist/client/assets/{sandbox-lifecycle-context-BEIzLgKJ.js → sandbox-lifecycle-context-BxUTEul4.js} +1 -1
  232. package/dist/client/assets/{schema-Gtjoj1mV.js → schema-BKdAxrjN.js} +1 -1
  233. package/dist/client/assets/{scroll-area-BItWkZyD.js → scroll-area-Cay3wJhN.js} +1 -1
  234. package/dist/client/assets/{search-input-2HqPa1gU.js → search-input-B_YmmZHV.js} +1 -1
  235. package/dist/client/assets/{search-toggle-TwxL51Rq.js → search-toggle-B17M6kpS.js} +1 -1
  236. package/dist/client/assets/{secret-picker-LUd97qaj.js → secret-picker-DaCIoDrN.js} +1 -1
  237. package/dist/client/assets/{secrets-C-fl25hO.js → secrets-2PSicqyQ.js} +1 -1
  238. package/dist/client/assets/sections-editor-DBJwN3fQ.js +1 -0
  239. package/dist/client/assets/{select-BqcGTWMZ.js → select-CF6Gp6z2.js} +1 -1
  240. package/dist/client/assets/{select-model-UIikOcTl.js → select-model-BfrFqNKL.js} +1 -1
  241. package/dist/client/assets/seo-editor-DWB8ATJr.js +1 -0
  242. package/dist/client/assets/{separator-Cfi478VR.js → separator-7nNJ8bt3.js} +1 -1
  243. package/dist/client/assets/{settings-tab-32WTJPDU.js → settings-tab-BjVbMHuj.js} +1 -1
  244. package/dist/client/assets/{sheet-jXYhJY1b.js → sheet-BxvcwNse.js} +1 -1
  245. package/dist/client/assets/{shell-layout-CqQIq2hS.js → shell-layout-CzhXAO9S.js} +1 -1
  246. package/dist/client/assets/{skills-DoXVf8Lu.js → skills-DgHWYsVv.js} +1 -1
  247. package/dist/client/assets/{sso-CkmBYFtO.js → sso-Be79miIa.js} +1 -1
  248. package/dist/client/assets/{suggestion-DKXZWHaN.js → suggestion-RCbdRB_3.js} +1 -1
  249. package/dist/client/assets/{switch-Dcx0z8yf.js → switch-CAhfktTZ.js} +1 -1
  250. package/dist/client/assets/{synced-repos-BmYDHZBR.js → synced-repos-Cfc_noHz.js} +1 -1
  251. package/dist/client/assets/{tab-icon-glyph-CJeQz4Ym.js → tab-icon-glyph-C3JncEmv.js} +1 -1
  252. package/dist/client/assets/{table-2Z24Uf7A.js → table-BiIyEc6M.js} +1 -1
  253. package/dist/client/assets/{tabs-Dcs_wljk.js → tabs-MJcU_hz5.js} +1 -1
  254. package/dist/client/assets/{task-board-BZQiH6lk.js → task-board-ZOkVjFfb.js} +1 -1
  255. package/dist/client/assets/{task-route-Y6qsNyYg.js → task-route-2jOSkzR_.js} +1 -1
  256. package/dist/client/assets/{task-status-DJtE9wAV.js → task-status-DnIsBsG3.js} +1 -1
  257. package/dist/client/assets/taskboard-analytics-CagGkIPc.js +1 -0
  258. package/dist/client/assets/{tasks-CMIeA9v4.js → tasks-BYfXzj9g.js} +1 -1
  259. package/dist/client/assets/tasks-C59QR4O_.js +1 -0
  260. package/dist/client/assets/{textarea-Crpj1sFF.js → textarea-DPzgPhO0.js} +1 -1
  261. package/dist/client/assets/thread-analytics-D4ZCwT01.js +1 -0
  262. package/dist/client/assets/thread-button-KYXikVLO.js +1 -0
  263. package/dist/client/assets/{thread-intent-CCZj7A0k.js → thread-intent-uQTUqJNN.js} +1 -1
  264. package/dist/client/assets/thread-route-D1S383-w.js +1 -0
  265. package/dist/client/assets/{thread-route-BnMz_7UO.js → thread-route-D9Gbeij-.js} +1 -1
  266. package/dist/client/assets/thread-sheet-body-CywQ9hos.js +1 -0
  267. package/dist/client/assets/{toggle-group-C6K0IvrN.js → toggle-group-Ddc-8H1o.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-xv3yPHM9.js → toolbar-icon-button-ByY5u7GY.js} +1 -1
  269. package/dist/client/assets/{tooltip-MkmbJW_K.js → tooltip-BqndO78a.js} +1 -1
  270. package/dist/client/assets/{track-DiI841S7.js → track-hlVnSAov.js} +1 -1
  271. package/dist/client/assets/{types-CRa6H_aI.js → types-sBzHo8Ih.js} +1 -1
  272. package/dist/client/assets/{usage-stats-D9M3mjk5.js → usage-stats-yhYX0e5G.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CkGkm3q3.js → use-ai-providers-BYo-eRGm.js} +1 -1
  274. package/dist/client/assets/{use-automations-Ln-ZgedH.js → use-automations-ChYX58CC.js} +1 -1
  275. package/dist/client/assets/{use-autosave-DCbYTwqE.js → use-autosave-Bex7Xrty.js} +1 -1
  276. package/dist/client/assets/{use-chat-layout-state-BPeSMGIC.js → use-chat-layout-state-TqbwuuZk.js} +1 -1
  277. package/dist/client/assets/{use-connect-companion-DB9iKUcO.js → use-connect-companion-BRtgSb9P.js} +1 -1
  278. package/dist/client/assets/{use-connection-DpAJRH1j.js → use-connection-CI6FQy3s.js} +1 -1
  279. package/dist/client/assets/{use-copy-C7mYE0cr.js → use-copy-PnkEhrhy.js} +1 -1
  280. package/dist/client/assets/{use-create-virtual-mcp-YtxQuBqL.js → use-create-virtual-mcp-BziW--Xo.js} +1 -1
  281. package/dist/client/assets/{use-date-fns-locale-b7C9_zv4.js → use-date-fns-locale-DvDfBLBf.js} +1 -1
  282. package/dist/client/assets/{use-debounced-autosave-Dl2BkZfj.js → use-debounced-autosave-BesgsSGy.js} +1 -1
  283. package/dist/client/assets/{use-debounced-value-Csr5jCDV.js → use-debounced-value-DfLnstW7.js} +1 -1
  284. package/dist/client/assets/{use-deco-credits-CjSuIvCj.js → use-deco-credits-vsffD2IB.js} +1 -1
  285. package/dist/client/assets/{use-decopilot-events-1ymO_vHG.js → use-decopilot-events-jyM4oYaJ.js} +1 -1
  286. package/dist/client/assets/{use-delete-connection-DIl-WTwH.js → use-delete-connection-B9XzXBHi.js} +1 -1
  287. package/dist/client/assets/{use-deployment-admin-Bln500bu.js → use-deployment-admin-DnuvCNsE.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-BVH9ntfX.js → use-fast-preview-draft-url-D4k5eZ2W.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-BmM3RnWT.js → use-file-configs-DXe1xU9a.js} +1 -1
  290. package/dist/client/assets/{use-infinite-scroll-DKthVIzG.js → use-infinite-scroll-DViN6YmU.js} +1 -1
  291. package/dist/client/assets/{use-join-requests-CMXs54Gp.js → use-join-requests-BAj95XYz.js} +1 -1
  292. package/dist/client/assets/{use-main-panel-tabs-D9AQTjhM.js → use-main-panel-tabs-CASquBgs.js} +1 -1
  293. package/dist/client/assets/{use-mcp-auth-status-BzOtb6NF.js → use-mcp-auth-status-W5VgXonZ.js} +1 -1
  294. package/dist/client/assets/{use-mcp-client-BuS_j4o-.js → use-mcp-client-Ct2vdUoM.js} +1 -1
  295. package/dist/client/assets/{use-mcp-prompts-BBHmJESk.js → use-mcp-prompts-Dk_d3SlG.js} +1 -1
  296. package/dist/client/assets/{use-mcp-tools-DMDsoga2.js → use-mcp-tools-Bnl7RrzG.js} +1 -1
  297. package/dist/client/assets/{use-members-oDlXNVCE.js → use-members-9XNbNa6j.js} +1 -1
  298. package/dist/client/assets/{use-mobile-BCh8YRo6.js → use-mobile--np6aWAG.js} +1 -1
  299. package/dist/client/assets/{use-navigate-to-agent-4LkoL-j8.js → use-navigate-to-agent-0Fvf2Lpw.js} +1 -1
  300. package/dist/client/assets/use-new-blocks-editor-BXR_sYex.js +1 -0
  301. package/dist/client/assets/{use-open-billing-url-BXuHuuOL.js → use-open-billing-url-BMXuqlhP.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-C-MfZ94G.js → use-org-auth-client-CN0iwzUb.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-CmBvsBMY.js → use-org-fs-k5NldW-7.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-d4JgzgQp.js → use-org-repo-syncs-EkZ_pjWr.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-DUqEoTxr.js → use-org-sso-B__Yf47H.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-C_c0eWOx.js → use-organization-roles-B3rV1LLK.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Cm1vewr9.js → use-organization-settings-B0MM1DlS.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-CiX_5778.js → use-panel-navigate-Dk1Ye1GR.js} +1 -1
  309. package/dist/client/assets/{use-project-scope-BxTK_qgl.js → use-project-scope-C9VWhN8V.js} +1 -1
  310. package/dist/client/assets/{use-releases-BQ508TNB.js → use-releases-DN0A-Kpr.js} +1 -1
  311. package/dist/client/assets/{use-reports-diagnostic-CuugPiuf.js → use-reports-diagnostic-DHXQZUvd.js} +1 -1
  312. package/dist/client/assets/{use-secrets-TLJHLrLj.js → use-secrets-C2MxSlcA.js} +1 -1
  313. package/dist/client/assets/{use-section-preview-base-gSStkCYp.js → use-section-preview-base-BYyvYPZ7.js} +1 -1
  314. package/dist/client/assets/{use-session-runtime-BVWXx-Hx.js → use-session-runtime-DsnbbYN7.js} +1 -1
  315. package/dist/client/assets/{use-tags-CuAeOwml.js → use-tags-CjTVjQFf.js} +1 -1
  316. package/dist/client/assets/{use-task-board-analytics-DpORgpIb.js → use-task-board-analytics-CCzrdEy3.js} +1 -1
  317. package/dist/client/assets/{use-task-board-events-1XpVNJEd.js → use-task-board-events-BHC_8phf.js} +1 -1
  318. package/dist/client/assets/{use-task-metadata-o5vDdJtC.js → use-task-metadata-BzPIvyyo.js} +1 -1
  319. package/dist/client/assets/{use-thread-analytics-CpdUNsgX.js → use-thread-analytics-B0VguZq2.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-qbmnSZLU.js → use-thread-outputs-DCJFafqq.js} +1 -1
  321. package/dist/client/assets/useInfiniteQuery-Dxc2v4r4.js +1 -0
  322. package/dist/client/assets/{useQueries-Cp9cPmFE.js → useQueries-JVjEwDAw.js} +1 -1
  323. package/dist/client/assets/useSuspenseInfiniteQuery-C8qiUH4q.js +1 -0
  324. package/dist/client/assets/{users-BysYiEd8.js → users-CfobUiGt.js} +1 -1
  325. package/dist/client/assets/{utils-BkJACT4F.js → utils-C39wfwww.js} +1 -1
  326. package/dist/client/assets/variant-calendar-Bjori3kc.js +1 -0
  327. package/dist/client/assets/{variant-matcher-override-CDsPfWCr.js → variant-matcher-override-C3oDv2Ac.js} +1 -1
  328. package/dist/client/assets/{view-mode-toggle-DPCA9Xp0.js → view-mode-toggle-7tgTSsST.js} +1 -1
  329. package/dist/client/assets/{virtual-mcp-gaJd4WQ5.js → virtual-mcp-BoM8jJW7.js} +1 -1
  330. package/dist/client/index.html +2 -2
  331. package/dist/server/cli.js +1 -1
  332. package/dist/server/server.js +1 -1
  333. package/package.json +1 -1
  334. package/dist/client/assets/ArrowRight-Q7Kpem3P.js +0 -1
  335. package/dist/client/assets/add-connection-dialog-B13l82-x.js +0 -1
  336. package/dist/client/assets/agent-analytics-Bg7OGjPz.js +0 -2
  337. package/dist/client/assets/agent-app-CYu2vHrt.js +0 -1
  338. package/dist/client/assets/agent-assets-PeHArOTz.js +0 -1
  339. package/dist/client/assets/agent-automations-CG4WPLmg.js +0 -1
  340. package/dist/client/assets/agent-connect-sources-DBVMs9Oh.js +0 -1
  341. package/dist/client/assets/agent-deck-CnP02u1J.js +0 -1
  342. package/dist/client/assets/agent-e2e-CKp4ujG6.js +0 -1
  343. package/dist/client/assets/agent-experiments-B_K8GWFz.js +0 -1
  344. package/dist/client/assets/agent-file-DCWTkVS7.js +0 -1
  345. package/dist/client/assets/agent-hosting-CyJCp9zC.js +0 -1
  346. package/dist/client/assets/agent-icon-DyICUp-0.js +0 -1
  347. package/dist/client/assets/agent-library-C9HW9AGH.js +0 -1
  348. package/dist/client/assets/agent-library-file-BhPllWzW.js +0 -1
  349. package/dist/client/assets/agent-monitor-DE6uc-Yc.js +0 -1
  350. package/dist/client/assets/agent-overview-D2xoxQj1.js +0 -1
  351. package/dist/client/assets/agent-settings-DWsqVjSl.js +0 -1
  352. package/dist/client/assets/agent-site-editor-code-9ugnawPt.js +0 -2
  353. package/dist/client/assets/agent-view-QI30T6v_.js +0 -1
  354. package/dist/client/assets/agents-list-Cve154Hx.js +0 -1
  355. package/dist/client/assets/api-keys-i59HI6Dn.js +0 -1
  356. package/dist/client/assets/app-editor-DRm1-NGV.js +0 -1
  357. package/dist/client/assets/automations-C4ySvzYV.js +0 -1
  358. package/dist/client/assets/category-editor-BZufyouv.js +0 -1
  359. package/dist/client/assets/choose-editor-Bm8A4VvY.js +0 -1
  360. package/dist/client/assets/collection-detail-DvYBq4qN.js +0 -1
  361. package/dist/client/assets/connection-detail-kRlYCz4f.js +0 -1
  362. package/dist/client/assets/connections-5gKP9SMR.js +0 -1
  363. package/dist/client/assets/context-DukDU2Rq.js +0 -1
  364. package/dist/client/assets/daily-pulse-B5jGavJp.js +0 -1
  365. package/dist/client/assets/discover-CUlGD-kG.js +0 -1
  366. package/dist/client/assets/file-explorer-BacigDk4.js +0 -2
  367. package/dist/client/assets/flat-project-TSS3UcZe.js +0 -1
  368. package/dist/client/assets/home-DscOh6R0.js +0 -1
  369. package/dist/client/assets/icon-button-a92J-8vv.js +0 -1
  370. package/dist/client/assets/index-DqGHQkvC.js +0 -1
  371. package/dist/client/assets/index-vBm2nEpb.js +0 -1
  372. package/dist/client/assets/integration-icon--cgW91vt.js +0 -1
  373. package/dist/client/assets/library-CRn84l2y.js +0 -1
  374. package/dist/client/assets/openai-conversation-DB0maE3r.js +0 -3
  375. package/dist/client/assets/post-calendar-BQ6EJh_c.js +0 -1
  376. package/dist/client/assets/project-app-view-DNZzY5H1.js +0 -1
  377. package/dist/client/assets/project-feed-CpIs1E9q.js +0 -1
  378. package/dist/client/assets/project-reports-vXhY3Phe.js +0 -1
  379. package/dist/client/assets/project-tasks-Cq_ycqFh.js +0 -1
  380. package/dist/client/assets/projects-BS00BQBL.js +0 -1
  381. package/dist/client/assets/record-editor-DxsPRjbm.js +0 -1
  382. package/dist/client/assets/redirect-editor-CYq4KwMq.js +0 -1
  383. package/dist/client/assets/reports-BAxcoVP6.js +0 -1
  384. package/dist/client/assets/reports-onboarding-CVv2rrQL.js +0 -1
  385. package/dist/client/assets/reports-tab-B_N3nqkf.js +0 -2
  386. package/dist/client/assets/repositories-Bg9oubuI.js +0 -1
  387. package/dist/client/assets/roles-BMSsHGlS.js +0 -1
  388. package/dist/client/assets/route-B-A-TKed.js +0 -1
  389. package/dist/client/assets/route-BbGr0Fmz.js +0 -1
  390. package/dist/client/assets/route-CKffRuty.js +0 -1
  391. package/dist/client/assets/sections-editor-Ua2U9XX8.js +0 -1
  392. package/dist/client/assets/seo-editor-C3FxnQ4B.js +0 -1
  393. package/dist/client/assets/taskboard-analytics-Cxz6IAs5.js +0 -1
  394. package/dist/client/assets/tasks-zUoRMh__.js +0 -1
  395. package/dist/client/assets/thread-analytics-D8Oxt_vz.js +0 -1
  396. package/dist/client/assets/thread-route-CTg48XGa.js +0 -1
  397. package/dist/client/assets/thread-sheet-body-BQ5QR1zb.js +0 -1
  398. package/dist/client/assets/use-new-blocks-editor-C9Lf0NAr.js +0 -1
  399. package/dist/client/assets/useInfiniteQuery-CucDp1Bl.js +0 -1
  400. package/dist/client/assets/useSuspenseInfiniteQuery-Bv9C99VC.js +0 -1
  401. package/dist/client/assets/variant-calendar-BDehoemX.js +0 -1
@@ -1 +1 @@
1
- import{c as tt,b as at,u as ot,X as nt,ef as st,eg as it,eh as we,ei as Ce,ac as rt,aa as Ve,ej as ct,ek as lt,r as ce,d_ as dt,C as Me,el as pt,em as mt}from"./index-CyQyr88p.js";import{g as ut,h as ft,u as bt,j as Tt,k as vt,l as It}from"./use-chat-layout-state-BPeSMGIC.js";import{b as gt}from"./agent-icon-DyICUp-0.js";import{i as yt}from"./Monitor01-CqmqvaJt.js";import{u as Pt}from"./use-connection-DpAJRH1j.js";import{b as ht}from"./use-mcp-client-BuS_j4o-.js";import{u as kt}from"./use-mcp-tools-DMDsoga2.js";import{a as wt,g as Ct,c as Vt}from"./repository-binding-Dgq5OsMA.js";import{g as Mt}from"./types-CRa6H_aI.js";import{t as St}from"./utils-CVEq3hMx.js";import{d as Rt,u as At,b as L}from"./use-project-scope-BxTK_qgl.js";import"./index-DqGHQkvC.js";import{d as jt}from"./use-navigate-to-agent-4LkoL-j8.js";import{c as Dt,d as Nt}from"./sandbox-lifecycle-context-BEIzLgKJ.js";import{F as Se}from"./file-type-icon-TH99y45i.js";import{a as xt,u as Ut}from"./use-panel-navigate-CiX_5778.js";import{r as B}from"./resolve-tab-icon-c84JJRcB.js";import{u as Ht}from"./use-task-metadata-o5vDdJtC.js";import{i as Et,r as Ft,s as Ot}from"./shell-layout-CqQIq2hS.js";import{u as Lt}from"./use-session-runtime-BVWXx-Hx.js";import{u as Bt}from"./use-is-desktop-app-BNujXJc_.js";import{u as $t}from"./use-organization-settings-Cm1vewr9.js";import{b as Kt}from"./chat-context-CG9Mp_L-.js";import{r as Qt}from"./virtual-mcp-gaJd4WQ5.js";function Wt(a,e){return!!a&&!!e&&e===`thread:${a}`}function Xt(a){return a.threadHasRepo?"repo":Wt(a.threadId,a.sandboxBranch)?"none":a.agentHasRepo?"repo":"none"}function Pa(a){const e=tt.c(52),l=at(),{openPanel:g,closePanel:$}=xt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={strict:!1},e[0]=y):y=e[0];const Re=ot(y),le=Ut(),de=ut(),s=wt(a.virtualMcpId),P=Ht(a.taskId),{org:n}=nt(),{currentBranch:pe,activeTask:h}=Kt(),me=Bt();let r,d,p,m,k;e[1]!==s||e[2]!==n.id||e[3]!==n.slug?(r=Ct(s),k=jt,d=n.id,p=n.slug,m=Vt(r),e[1]=s,e[2]=n.id,e[3]=n.slug,e[4]=r,e[5]=d,e[6]=p,e[7]=m,e[8]=k):(r=e[4],d=e[5],p=e[6],m=e[7],k=e[8]);const K=r?.owner??"",Q=r?.name??"",W=r?pe:null;let w;e[9]!==d||e[10]!==p||e[11]!==m||e[12]!==K||e[13]!==Q||e[14]!==W?(w={orgId:d,orgSlug:p,target:m,owner:K,repo:Q,branch:W},e[9]=d,e[10]=p,e[11]=m,e[12]=K,e[13]=Q,e[14]=W,e[15]=w):w=e[15];const C=k(w),Ae=C.data?.state==="open",T=s?.metadata.ui?.layout??null,u=T?.tabs??[],v=s?.id?st(s.id):null,V=P?.expanded_tools??[],je=Rt(s),M=$t(),{scopeId:De,project:Ne}=At(),X=ft(De,Ne,s),q=bt(X.project),ue=Tt(X.resolvedScopeId,L(X.project?.metadata),q.presence);let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S={includeVirtual:!0},e[16]=S):S=e[16];const f=Pt(S),xe=Dt(),{vmEntry:fe,previewUrl:be}=Nt(),z=h?.branch??pe;let R;e[17]!==h?.metadata||e[18]!==a.taskId||e[19]!==s?.metadata||e[20]!==P||e[21]!==z?(R=Xt({threadId:a.taskId,sandboxBranch:z,agentHasRepo:L(s?.metadata),threadHasRepo:L(P)||L(h?.metadata)}),e[17]=h?.metadata,e[18]=a.taskId,e[19]=s?.metadata,e[20]=P,e[21]=z,e[22]=R):R=e[22];const Ue=R,Te=xe.lifecycle.phase==="running",{runtime:He,resolved:ve}=Lt(a.virtualMcpId);let A;e[23]!==me||e[24]!==be||e[25]!==fe?(A=void 0,e[23]=me,e[24]=be,e[25]=fe,e[26]=A):A=e[26];const Ee=A,Ie=ht({connectionId:v??void 0,orgId:n.id,orgSlug:n.slug,mcpUrl:Ee}),G=Ie,J=!!Ie&&Te;let j;e[27]!==G||e[28]!==J?(j={client:G,enabled:J},e[27]=G,e[28]=J,e[29]=j):j=e[29];const{data:Fe}=kt(j),ge=v&&Te?(Fe?.tools??[]).filter(Jt).map(t=>({connectionId:v,toolName:t.name,label:St(t.name),icon:null})):[],Y=ge[0],Oe=Y?ge:[],I=Y&&v?{type:"ext-apps",id:v,toolName:Y.toolName}:T?.defaultMainView??null,Le=Qt(T),ye={assets:q.assetsPending,siteAccess:q.siteAccessPending},{activeTab:c,mainOpen:Be}=it({panelTabId:le,mainPanelParam:Re.mainpanel,routeDefaultMain:de,metadata:I||T?{defaultMainView:I,tabs:u.map(Gt)}:null}),Z=je&&(Ae||C.isPending&&c==="git"),$e=I||T?{defaultMainView:I,tabs:u.map(zt)}:null,D=Ft({hasSource:Ue==="repo"||M,runtime:He,cmsMode:Le}),Ke=D.includes("content"),Qe=we($e),We=I?.type,Pe=vt(We,ue,ye,D,ve),N=Pe?we(null):Qe,Xe=It(c,ue,ye),qe=!D.includes("code")&&ve&&Ce(c)!==null,o=!le&&!de&&Pe||c==="git"&&!Z&&!C.isPending||c==="content"&&!Ke||qe||Xe?N:c,b=c==="git"&&!Z&&!C.isPending?!1:Be,_=rt(o);let x;e[30]!==l?(x=t=>l(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[30]=l,e[31]=x):x=e[31];const ze=x,he=[];Z&&he.push({id:"git",title:l("common.mainPanelTabs.reviewChanges")});const ee=new Map;for(const t of V){const i=Ve(t.appId,t.toolName);ee.set(i,{id:i,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Oe){if(t.toolName==="fetch_assets")continue;const i=Ve(t.connectionId,t.toolName);ee.set(i,{id:i,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const te=ct(o),ae=te?te.key.split("/").pop()??te.key:null,Ge=ae?[{id:o,title:ae,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ae,...t})}}]:[],U=lt(o),Je=U?[{id:o,title:(U.path.split("/").pop()??U.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>ce.createElement(U.path.startsWith("pages/")?gt:yt,t)}}]:[],oe=dt(o),ne=oe?oe.path.split("/").pop()??oe.path:null,Ye=ne?[{id:o,title:ne,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ne,...t})}}]:[],Ze=Et(o)?D.map(t=>({id:t==="code"&&Ce(o)?o:t,title:ze(t),kind:"system",icon:B({tabId:t,kind:"system",connections:f})})):[];let H;e[32]!==f?(H=t=>({id:pt(t.id),title:t.title,kind:"agent",icon:B({tabId:t.id,kind:"agent",appId:t.view.appId,connections:f})}),e[32]=f,e[33]=H):H=e[33];const _e=[...Ze,...he.map(t=>({id:t.id,title:t.title,kind:"system",icon:B({tabId:t.id,kind:"system",connections:f})})),...Ge,...Je,...Ye,...u.map(H),...Array.from(ee.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:B({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:f})}))],ke=new Set,se=_e.filter(t=>ke.has(t.id)?!1:(ke.add(t.id),!0)),et=a.virtualMcpId;let E;e[34]!==n.id?(E=Me(n.id),e[34]=n.id,e[35]=E):E=e[35];const ie=et===E;let F;e[36]!==o||e[37]!==$||e[38]!==b||e[39]!==ie||e[40]!==g||e[41]!==n.id||e[42]!==M?(F=t=>{if(Ot({reportsOnly:M,onReportAgent:ie,tabId:t})){g(t,{virtualmcpid:Me(n.id),search:qt});return}const i=mt({clickedId:t,activeTab:o,mainOpen:b});"close"in i?$():g(i.tabId)},e[36]=o,e[37]=$,e[38]=b,e[39]=ie,e[40]=g,e[41]=n.id,e[42]=M,e[43]=F):F=e[43];const re=F;let O;return e[44]!==o||e[45]!==_||e[46]!==V||e[47]!==u||e[48]!==b||e[49]!==re||e[50]!==se?(O={activeTab:o,mainOpen:b,setActiveTab:re,layoutTabs:u,expandedTools:V,automationTabParsed:_,tabs:se},e[44]=o,e[45]=_,e[46]=V,e[47]=u,e[48]=b,e[49]=re,e[50]=se,e[51]=O):O=e[51],O}function qt(a){return{...a,thread:void 0}}function zt(a){return{id:a.id}}function Gt(a){return{id:a.id}}function Jt(a){return!!Mt(a._meta)}export{Xt as r,Pa as u};
1
+ import{c as tt,b as at,u as ot,X as nt,ef as st,eg as it,eh as we,ei as Ce,ac as rt,aa as Ve,ej as ct,ek as lt,r as ce,d_ as dt,C as Me,el as pt,em as mt}from"./index-CWzlOAQX.js";import{g as ut,h as ft,u as bt,j as Tt,k as vt,l as It}from"./use-chat-layout-state-TqbwuuZk.js";import{b as gt}from"./agent-icon-DQhX6pyL.js";import{i as yt}from"./Monitor01-kmeIS50B.js";import{u as Pt}from"./use-connection-CI6FQy3s.js";import{b as ht}from"./use-mcp-client-Ct2vdUoM.js";import{u as kt}from"./use-mcp-tools-Bnl7RrzG.js";import{a as wt,g as Ct,c as Vt}from"./repository-binding-3gizJnq4.js";import{g as Mt}from"./types-sBzHo8Ih.js";import{t as St}from"./utils-CVEq3hMx.js";import{d as Rt,u as At,b as L}from"./use-project-scope-C9VWhN8V.js";import"./index-Dh5O1uzF.js";import{d as jt}from"./use-navigate-to-agent-0Fvf2Lpw.js";import{c as Dt,d as Nt}from"./sandbox-lifecycle-context-BxUTEul4.js";import{F as Se}from"./file-type-icon-BKMgh7vP.js";import{a as xt,u as Ut}from"./use-panel-navigate-Dk1Ye1GR.js";import{r as B}from"./resolve-tab-icon-liQGha1g.js";import{u as Ht}from"./use-task-metadata-BzPIvyyo.js";import{i as Et,r as Ft,s as Ot}from"./shell-layout-CzhXAO9S.js";import{u as Lt}from"./use-session-runtime-DsnbbYN7.js";import{u as Bt}from"./use-is-desktop-app-BNujXJc_.js";import{u as $t}from"./use-organization-settings-B0MM1DlS.js";import{b as Kt}from"./chat-context-CSREXmZ-.js";import{r as Qt}from"./virtual-mcp-BoM8jJW7.js";function Wt(a,e){return!!a&&!!e&&e===`thread:${a}`}function Xt(a){return a.threadHasRepo?"repo":Wt(a.threadId,a.sandboxBranch)?"none":a.agentHasRepo?"repo":"none"}function Pa(a){const e=tt.c(52),l=at(),{openPanel:g,closePanel:$}=xt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={strict:!1},e[0]=y):y=e[0];const Re=ot(y),le=Ut(),de=ut(),s=wt(a.virtualMcpId),P=Ht(a.taskId),{org:n}=nt(),{currentBranch:pe,activeTask:h}=Kt(),me=Bt();let r,d,p,m,k;e[1]!==s||e[2]!==n.id||e[3]!==n.slug?(r=Ct(s),k=jt,d=n.id,p=n.slug,m=Vt(r),e[1]=s,e[2]=n.id,e[3]=n.slug,e[4]=r,e[5]=d,e[6]=p,e[7]=m,e[8]=k):(r=e[4],d=e[5],p=e[6],m=e[7],k=e[8]);const K=r?.owner??"",Q=r?.name??"",W=r?pe:null;let w;e[9]!==d||e[10]!==p||e[11]!==m||e[12]!==K||e[13]!==Q||e[14]!==W?(w={orgId:d,orgSlug:p,target:m,owner:K,repo:Q,branch:W},e[9]=d,e[10]=p,e[11]=m,e[12]=K,e[13]=Q,e[14]=W,e[15]=w):w=e[15];const C=k(w),Ae=C.data?.state==="open",T=s?.metadata.ui?.layout??null,u=T?.tabs??[],v=s?.id?st(s.id):null,V=P?.expanded_tools??[],je=Rt(s),M=$t(),{scopeId:De,project:Ne}=At(),X=ft(De,Ne,s),q=bt(X.project),ue=Tt(X.resolvedScopeId,L(X.project?.metadata),q.presence);let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S={includeVirtual:!0},e[16]=S):S=e[16];const f=Pt(S),xe=Dt(),{vmEntry:fe,previewUrl:be}=Nt(),z=h?.branch??pe;let R;e[17]!==h?.metadata||e[18]!==a.taskId||e[19]!==s?.metadata||e[20]!==P||e[21]!==z?(R=Xt({threadId:a.taskId,sandboxBranch:z,agentHasRepo:L(s?.metadata),threadHasRepo:L(P)||L(h?.metadata)}),e[17]=h?.metadata,e[18]=a.taskId,e[19]=s?.metadata,e[20]=P,e[21]=z,e[22]=R):R=e[22];const Ue=R,Te=xe.lifecycle.phase==="running",{runtime:He,resolved:ve}=Lt(a.virtualMcpId);let A;e[23]!==me||e[24]!==be||e[25]!==fe?(A=void 0,e[23]=me,e[24]=be,e[25]=fe,e[26]=A):A=e[26];const Ee=A,Ie=ht({connectionId:v??void 0,orgId:n.id,orgSlug:n.slug,mcpUrl:Ee}),G=Ie,J=!!Ie&&Te;let j;e[27]!==G||e[28]!==J?(j={client:G,enabled:J},e[27]=G,e[28]=J,e[29]=j):j=e[29];const{data:Fe}=kt(j),ge=v&&Te?(Fe?.tools??[]).filter(Jt).map(t=>({connectionId:v,toolName:t.name,label:St(t.name),icon:null})):[],Y=ge[0],Oe=Y?ge:[],I=Y&&v?{type:"ext-apps",id:v,toolName:Y.toolName}:T?.defaultMainView??null,Le=Qt(T),ye={assets:q.assetsPending,siteAccess:q.siteAccessPending},{activeTab:c,mainOpen:Be}=it({panelTabId:le,mainPanelParam:Re.mainpanel,routeDefaultMain:de,metadata:I||T?{defaultMainView:I,tabs:u.map(Gt)}:null}),Z=je&&(Ae||C.isPending&&c==="git"),$e=I||T?{defaultMainView:I,tabs:u.map(zt)}:null,D=Ft({hasSource:Ue==="repo"||M,runtime:He,cmsMode:Le}),Ke=D.includes("content"),Qe=we($e),We=I?.type,Pe=vt(We,ue,ye,D,ve),N=Pe?we(null):Qe,Xe=It(c,ue,ye),qe=!D.includes("code")&&ve&&Ce(c)!==null,o=!le&&!de&&Pe||c==="git"&&!Z&&!C.isPending||c==="content"&&!Ke||qe||Xe?N:c,b=c==="git"&&!Z&&!C.isPending?!1:Be,_=rt(o);let x;e[30]!==l?(x=t=>l(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[30]=l,e[31]=x):x=e[31];const ze=x,he=[];Z&&he.push({id:"git",title:l("common.mainPanelTabs.reviewChanges")});const ee=new Map;for(const t of V){const i=Ve(t.appId,t.toolName);ee.set(i,{id:i,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Oe){if(t.toolName==="fetch_assets")continue;const i=Ve(t.connectionId,t.toolName);ee.set(i,{id:i,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const te=ct(o),ae=te?te.key.split("/").pop()??te.key:null,Ge=ae?[{id:o,title:ae,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ae,...t})}}]:[],U=lt(o),Je=U?[{id:o,title:(U.path.split("/").pop()??U.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>ce.createElement(U.path.startsWith("pages/")?gt:yt,t)}}]:[],oe=dt(o),ne=oe?oe.path.split("/").pop()??oe.path:null,Ye=ne?[{id:o,title:ne,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ne,...t})}}]:[],Ze=Et(o)?D.map(t=>({id:t==="code"&&Ce(o)?o:t,title:ze(t),kind:"system",icon:B({tabId:t,kind:"system",connections:f})})):[];let H;e[32]!==f?(H=t=>({id:pt(t.id),title:t.title,kind:"agent",icon:B({tabId:t.id,kind:"agent",appId:t.view.appId,connections:f})}),e[32]=f,e[33]=H):H=e[33];const _e=[...Ze,...he.map(t=>({id:t.id,title:t.title,kind:"system",icon:B({tabId:t.id,kind:"system",connections:f})})),...Ge,...Je,...Ye,...u.map(H),...Array.from(ee.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:B({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:f})}))],ke=new Set,se=_e.filter(t=>ke.has(t.id)?!1:(ke.add(t.id),!0)),et=a.virtualMcpId;let E;e[34]!==n.id?(E=Me(n.id),e[34]=n.id,e[35]=E):E=e[35];const ie=et===E;let F;e[36]!==o||e[37]!==$||e[38]!==b||e[39]!==ie||e[40]!==g||e[41]!==n.id||e[42]!==M?(F=t=>{if(Ot({reportsOnly:M,onReportAgent:ie,tabId:t})){g(t,{virtualmcpid:Me(n.id),search:qt});return}const i=mt({clickedId:t,activeTab:o,mainOpen:b});"close"in i?$():g(i.tabId)},e[36]=o,e[37]=$,e[38]=b,e[39]=ie,e[40]=g,e[41]=n.id,e[42]=M,e[43]=F):F=e[43];const re=F;let O;return e[44]!==o||e[45]!==_||e[46]!==V||e[47]!==u||e[48]!==b||e[49]!==re||e[50]!==se?(O={activeTab:o,mainOpen:b,setActiveTab:re,layoutTabs:u,expandedTools:V,automationTabParsed:_,tabs:se},e[44]=o,e[45]=_,e[46]=V,e[47]=u,e[48]=b,e[49]=re,e[50]=se,e[51]=O):O=e[51],O}function qt(a){return{...a,thread:void 0}}function zt(a){return{id:a.id}}function Gt(a){return{id:a.id}}function Jt(a){return!!Mt(a._meta)}export{Xt as r,Pa as u};
@@ -1 +1 @@
1
- import{c as b,b as S,Z as k,aJ as N,j as o,X as $,K as A,D as L}from"./index-CyQyr88p.js";import{B as g}from"./badge-Bjr6roKX.js";import{b as v,T,a as I,c as _}from"./tooltip-MkmbJW_K.js";import{g as H}from"./types-CRa6H_aI.js";import{s as P}from"./Image01-BOx8LVbG.js";import{p as U,aS as w}from"./agent-icon-DyICUp-0.js";import{i as O}from"./mcp-oauth-BHkP1C2P.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=S();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==n||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=p):p=e[18];let m;return e[19]!==s||e[20]!==p?(m=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=m):m=e[21],m}function J(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,J as u};
1
+ import{c as b,b as k,Z as N,aJ as S,j as o,X as $,K as A,D as L}from"./index-CWzlOAQX.js";import{B as g}from"./badge-BeT90Jfh.js";import{b as v,T,a as I,c as _}from"./tooltip-BqndO78a.js";import{g as H}from"./types-sBzHo8Ih.js";import{s as P}from"./Image01-Y9Scw-o_.js";import{p as R,aR as U}from"./agent-icon-DQhX6pyL.js";import{i as w}from"./mcp-oauth-C0PojFFt.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:R,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?O.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(U,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==n||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=p):p=e[18];let m;return e[19]!==s||e[20]!==p?(m=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=m):m=e[21],m}function J(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>w({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,J as u};
@@ -1,4 +1,4 @@
1
- import{c3 as ue,c4 as de,c5 as he,c6 as fe,c7 as pe,c8 as _,c9 as g,ca as me,cb as _e,cc as we,cd as M,ce as ge,cf as D,cg as Te,ch as q,ci as ye,cj as L,ck as ke,cl as ve,cm as Se,cn as W,co as Ce,cp as be,cq as Re,cr as se,cs as Ie,ct as Ee,cu as qe,b3 as Pe,cv as $e,cw as Me,cx as A,cy as Ae,cz as He,cA as Oe,cB as Ue,cC as xe,cD as Ne,cE as je,cF as Fe,cG as De,cH as Le,cI as Ve,cJ as ze,cK as Qe,aW as U,cL as Je,cM as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-CyQyr88p.js";import{U as P,b as H,c as K}from"./auth-yZ0dbxiQ.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function 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(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(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?ze:Qe,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},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,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=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function 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{c3 as ue,c4 as de,c5 as he,c6 as fe,c7 as pe,c8 as _,c9 as g,ca as me,cb as _e,cc as we,cd as M,ce as ge,cf as D,cg as Te,ch as q,ci as ye,cj as L,ck as ke,cl as ve,cm as Se,cn as W,co as Ce,cp as be,cq as Re,cr as se,cs as Ie,ct as Ee,cu as qe,b3 as Pe,cv as $e,cw as Me,cx as A,cy as Ae,cz as He,cA as Oe,cB as Ue,cC as xe,cD as Ne,cE as je,cF as Fe,cG as De,cH as Le,cI as Ve,cJ as ze,cK as Qe,aW as U,cL as Je,cM as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-CWzlOAQX.js";import{U as P,b as H,c as K}from"./auth-BA3Q_TJo.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function 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(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(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?ze:Qe,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},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,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=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function 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,c8 as m,c9 as f,D as y,K as n}from"./index-CyQyr88p.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,c8 as m,c9 as f,D as y,K as n}from"./index-CWzlOAQX.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 f,D as p,m as q,K as m}from"./index-CyQyr88p.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
1
+ import{c as f,D as p,m as q,K as m}from"./index-CWzlOAQX.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
@@ -1 +1 @@
1
- import{c,X as m,D as b,m as M,K as f}from"./index-CyQyr88p.js";import{u as y}from"./use-org-auth-client-C-MfZ94G.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,X as m,D as b,m as M,K as f}from"./index-CWzlOAQX.js";import{u as y}from"./use-org-auth-client-CN0iwzUb.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{r as s}from"./index-CyQyr88p.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
1
+ import{r as s}from"./index-CWzlOAQX.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
@@ -1 +1 @@
1
- import{c as m,m as p,K as E,af as S,X as B,d as G,o as H,a as Q,Y as j,cZ as k,c_ as F}from"./index-CyQyr88p.js";import{r as _,h as C,g as O,c as D,i as I,j as V}from"./repository-binding-Dgq5OsMA.js";import{i as Y,u as x,d as A,w as X}from"./thread-intent-CCZj7A0k.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=Y(t.metadata?.runtime);return n===null||n===e}function U(t,e,n,a,s){let o=null;for(const r of t)r.virtual_mcp_id===e&&r.created_by===n&&(r.hidden||$(r,a)&&(s&&r.branch===s||(!o||r.updated_at>o.updated_at)&&(o=r)));return o}function me(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&&$(s,a))}function Z(t,e,n,a,s,o){return s?U(t,e,n,a,o?.baseBranch)??void 0:U(t,e,n,a)??void 0}const z=6e4,v=3e4;function q(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 J(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 N(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:E.githubPrState(e,_(n),a,s,o),queryFn:()=>S(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&C(n)&&!!a&&!!s,refetchInterval:z,refetchIntervalInBackground:!1,staleTime:v}}function W(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:M},e[2]=n,e[3]=a):a=e[3],p(a)}function M(t){return t.changeRequest?q(t.changeRequest):null}function ge(t){const e=m.c(4);let n;e[0]!==t?(n=N(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],p(a)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(J):[]}function be(t){const e=m.c(4);let n;e[0]!==t?(n=N(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],p(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 pe(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=E.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=()=>S(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:se},e[16]=i,e[17]=u,e[18]=l,e[19]=c):c=e[19],p(c)}function se(t){return t.changeRequest?q(t.changeRequest):null}const re=50;function ye(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=E.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=()=>S(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:re}),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:v,select:oe},e[13]=r,e[14]=i,e[15]=u,e[16]=l):l=e[16],p(l)}function oe(t){return t.changeRequests.map(q)}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=E.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=()=>S(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:v,select:ie},e[10]=i,e[11]=u,e[12]=l,e[13]=c):c=e[13],p(c)}function ie(t){return{title:null,summary:t.report,text:null}}function ue(t,e){const{org:n}=B(),a=O(t);return W({orgId:n.id,orgSlug:n.slug,target:D(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const le=[];function Te(){const t=m.c(14),e=G(),{org:n,locator:a}=B(),s=H(),o=I(),{data:r}=Q.useSession(),i=x(),u=ue(void 0,null),l=j();let c;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==r?.user?.id?(c=(f,d,R)=>{if(l&&!d?.panel){e({to:"/$org/projects",params:{org:n.slug},search:P=>({...P,project:f,virtualmcpid:void 0,view:void 0})});return}const h=d?.panel??"overview";if(k(h).kind==="org-destination"){F(e,{tabId:h,org:n.slug,agentId:f,replace:!1});return}const b=(o??[]).find(P=>P.id===f),K=!!(b&&O(b)),L=!d?.runtime,w=L?void 0:Z(i?.threads.get()??le,f,r?.user?.id,R??(b?A(b.metadata):void 0),K,{baseBranch:u}),T=L?void 0:w?.id??crypto.randomUUID();T&&!w&&d?.runtime&&X(sessionStorage,a,T,{runtime:d.runtime}),F(e,{tabId:h,org:n.slug,agentId:f,search:()=>T?{thread:T}:{},replace:!1})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=r?.user?.id,t[8]=c):c=t[8];const g=c;let y;return t[9]!==o||t[10]!==g||t[11]!==n||t[12]!==s?(y=(f,d)=>{if(k(d?.panel??"overview").kind==="org-destination")return g(f,d,void 0);const R=o.find(h=>h.id===f);if(d?.runtime)return g(f,d,d.runtime);if(R)return g(f,d,A(R.metadata));V(s,n).then(h=>h.find(b=>b.id===f)).catch(ce).then(h=>g(f,d,h?A(h.metadata):void 0))},t[9]=o,t[10]=g,t[11]=n,t[12]=s,t[13]=y):y=t[13],y}function ce(){}export{ue as a,Z as b,ye as c,W as d,pe as e,me as f,ge as g,Re as h,be as i,N as p,Te as u};
1
+ import{c as m,m as p,K as E,af as S,X as B,d as G,o as H,a as Q,Y as j,cZ as k,c_ as F}from"./index-CWzlOAQX.js";import{r as _,h as C,g as O,c as D,i as I,j as V}from"./repository-binding-3gizJnq4.js";import{i as Y,u as x,d as A,w as X}from"./thread-intent-uQTUqJNN.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=Y(t.metadata?.runtime);return n===null||n===e}function U(t,e,n,a,s){let o=null;for(const r of t)r.virtual_mcp_id===e&&r.created_by===n&&(r.hidden||$(r,a)&&(s&&r.branch===s||(!o||r.updated_at>o.updated_at)&&(o=r)));return o}function me(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&&$(s,a))}function Z(t,e,n,a,s,o){return s?U(t,e,n,a,o?.baseBranch)??void 0:U(t,e,n,a)??void 0}const z=6e4,v=3e4;function q(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 J(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 N(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:E.githubPrState(e,_(n),a,s,o),queryFn:()=>S(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&C(n)&&!!a&&!!s,refetchInterval:z,refetchIntervalInBackground:!1,staleTime:v}}function W(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:M},e[2]=n,e[3]=a):a=e[3],p(a)}function M(t){return t.changeRequest?q(t.changeRequest):null}function ge(t){const e=m.c(4);let n;e[0]!==t?(n=N(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],p(a)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(J):[]}function be(t){const e=m.c(4);let n;e[0]!==t?(n=N(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],p(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 pe(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=E.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=()=>S(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:se},e[16]=i,e[17]=u,e[18]=l,e[19]=c):c=e[19],p(c)}function se(t){return t.changeRequest?q(t.changeRequest):null}const re=50;function ye(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=E.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=()=>S(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:re}),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:v,select:oe},e[13]=r,e[14]=i,e[15]=u,e[16]=l):l=e[16],p(l)}function oe(t){return t.changeRequests.map(q)}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=E.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=()=>S(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:v,select:ie},e[10]=i,e[11]=u,e[12]=l,e[13]=c):c=e[13],p(c)}function ie(t){return{title:null,summary:t.report,text:null}}function ue(t,e){const{org:n}=B(),a=O(t);return W({orgId:n.id,orgSlug:n.slug,target:D(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const le=[];function Te(){const t=m.c(14),e=G(),{org:n,locator:a}=B(),s=H(),o=I(),{data:r}=Q.useSession(),i=x(),u=ue(void 0,null),l=j();let c;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==r?.user?.id?(c=(f,d,R)=>{if(l&&!d?.panel){e({to:"/$org/projects",params:{org:n.slug},search:P=>({...P,project:f,virtualmcpid:void 0,view:void 0})});return}const h=d?.panel??"overview";if(k(h).kind==="org-destination"){F(e,{tabId:h,org:n.slug,agentId:f,replace:!1});return}const b=(o??[]).find(P=>P.id===f),K=!!(b&&O(b)),L=!d?.runtime,w=L?void 0:Z(i?.threads.get()??le,f,r?.user?.id,R??(b?A(b.metadata):void 0),K,{baseBranch:u}),T=L?void 0:w?.id??crypto.randomUUID();T&&!w&&d?.runtime&&X(sessionStorage,a,T,{runtime:d.runtime}),F(e,{tabId:h,org:n.slug,agentId:f,search:()=>T?{thread:T}:{},replace:!1})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=r?.user?.id,t[8]=c):c=t[8];const g=c;let y;return t[9]!==o||t[10]!==g||t[11]!==n||t[12]!==s?(y=(f,d)=>{if(k(d?.panel??"overview").kind==="org-destination")return g(f,d,void 0);const R=o.find(h=>h.id===f);if(d?.runtime)return g(f,d,d.runtime);if(R)return g(f,d,A(R.metadata));V(s,n).then(h=>h.find(b=>b.id===f)).catch(ce).then(h=>g(f,d,h?A(h.metadata):void 0))},t[9]=o,t[10]=g,t[11]=n,t[12]=s,t[13]=y):y=t[13],y}function ce(){}export{ue as a,Z as b,ye as c,W as d,pe as e,me as f,ge as g,Re as h,be as i,N as p,Te as u};
@@ -0,0 +1 @@
1
+ import{a as o}from"./use-organization-settings-B0MM1DlS.js";function e(){return o("new_blocks_editor")}export{e as u};
@@ -1 +1 @@
1
- import{c as l,a2 as f,b as p,e as T,t as m}from"./index-CyQyr88p.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
1
+ import{c as l,a2 as f,b as p,e as T,t as m}from"./index-CWzlOAQX.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
@@ -1 +1 @@
1
- import{c as x,X as j,a as i}from"./index-CyQyr88p.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,X as j,a as i}from"./index-CWzlOAQX.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 p,X as S,K as y,m as $,o as T,e as K}from"./index-CyQyr88p.js";function Y(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}function z(n,e,t){const s=p.c(16),{org:i}=S(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let l;s[4]!==i.id||s[5]!==n?(l=(d,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?d:void 0,s[4]=i.id,s[5]=n,s[6]=l):l=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(i.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let o;return s[11]!==r||s[12]!==a||s[13]!==l||s[14]!==c?(o={enabled:r,queryKey:a,placeholderData:l,queryFn:c},s[11]=r,s[12]=a,s[13]=l,s[14]=c,s[15]=o):o=s[15],$(o)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function C(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function B(n,e,t){const s=p.c(15),{org:i}=S();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=s[3];const a=n!==null;let l;s[4]!==t?(l=t?.refetchIntervalWhenAbsent?d=>d.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=l):l=s[5];let c;s[6]!==i.slug||s[7]!==e||s[8]!==n?(c=()=>C(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let o;return s[10]!==r||s[11]!==a||s[12]!==l||s[13]!==c?(o={queryKey:r,enabled:a,refetchInterval:l,queryFn:c},s[10]=r,s[11]=a,s[12]=l,s[13]=c,s[14]=o):o=s[14],$(o)}function J(n){const e=p.c(9),{org:t}=S();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==t.slug||e[4]!==n?(i=async()=>await(await h(F(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,queryFn:i},e[6]=s,e[7]=i,e[8]=r):r=e[8],$(r)}function V(n,e){const t=p.c(9),s=n===void 0?60:n,{org:i}=S();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let l;t[2]!==s||t[3]!==i.slug?(l=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=l):l=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==l?(c={queryKey:r,enabled:a,queryFn:l},t[5]=r,t[6]=a,t[7]=l,t[8]=c):c=t[8],$(c)}const _=50;function G(n,e){const t=p.c(16),{org:s}=S();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=n.length>0;let a;t[5]!==s.id?(a=(o,d)=>d?.queryKey[1]===s.id?o:void 0,t[5]=s.id,t[6]=a):a=t[6];let l;t[7]!==s.slug||t[8]!==n||t[9]!==e?(l=async()=>{const o=new URLSearchParams({q:n,limit:String(_)});return e&&(o.set("volume",e.volume),e.prefix&&o.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${o}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=l):l=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==l?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:l},t[11]=i,t[12]=r,t[13]=a,t[14]=l,t[15]=c):c=t[15],$(c)}function Z(n){const e=p.c(8),{org:t}=S();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const i=n?.enabled;let r;e[2]!==t.slug?(r=async()=>{const l=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await l.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function E(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function v(){const n=p.c(7),{org:e}=S();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>E(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function R(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ee(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const l=await fetch(n,{credentials:"include"});return l.ok?await l.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const U=new Set(["md","mdx","markdown","txt","text"]),Q=25,M=64*1024,A=256*1024,D=4;function N(n){const e=n.lastIndexOf(".");return e===-1?!1:U.has(n.slice(e+1).toLowerCase())}async function te(n,e,t){const s=t?`${t}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],l=[{path:t,depth:0}];for(;l.length>0;){const u=l.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const f of[...g].sort((b,q)=>b.path.localeCompare(q.path))){if(f.kind==="dir"){u.depth<D&&l.push({path:f.path,depth:u.depth+1});continue}N(f.path)&&f.size<=M&&r.length<Q?r.push(f.path):a.push(i(f.path))}}const c=await Promise.all(r.map(u=>R(n,e,u).catch(()=>null))),o=[];let d=0;return r.forEach((u,g)=>{const f=c[g];if(f==null||d+f.length>A){a.push(i(u));return}d+=f.length,o.push({relPath:i(u),content:f})}),o.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:o,omittedPaths:a}}function se(){const n=p.c(7),{org:e}=S();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function ne(n){const e=p.c(3),{org:t}=S();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>F(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ie(){const n=p.c(2),{org:e}=S();let t;return n[0]!==e.slug?(t=(s,i)=>F(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function re(n){const e=p.c(3),{org:t}=S();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(F(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],K(s)}function ae(n){const e=p.c(18),{org:t}=S(),s=T();let i;e[0]!==t||e[1]!==n?(i=async o=>(await(await h(F(t.slug,n,"public",{path:o.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:o.mode,password:o.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=async o=>{const d=y.orgFsStat(t.id,n,o.path);await s.cancelQueries({queryKey:d});const u=s.getQueryData(d),g=o.mode!=="private";return s.setQueryData(d,f=>f&&{...f,readPublic:g,effectivePublic:g,shareMode:o.mode}),{key:d,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=r):r=e[6];let a;e[7]!==s?(a=(o,d,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let l;e[9]!==t||e[10]!==s||e[11]!==n?(l=(o,d,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=l):l=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==l?(c={mutationFn:i,onMutate:r,onError:a,onSettled:l},e[13]=i,e[14]=r,e[15]=a,e[16]=l,e[17]=c):c=e[17],K(c)}function le(n){const e=p.c(33),{org:t}=S(),s=T();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>{s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async w=>{const k=(await Promise.allSettled(w.files.map(L=>{const P=w.dir?`${w.dir}/${L.name}`:L.name;return h(F(t.slug,n,"file",{path:P}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(X);if(k)throw k.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let l;e[7]!==r||e[8]!==a?(l={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=l):l=e[9];const c=K(l);let o;e[10]!==t||e[11]!==n?(o=async w=>{await h(F(t.slug,n,"dir",{path:w}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=o):o=e[12];let d;e[13]!==r||e[14]!==o?(d={mutationFn:o,onSuccess:r},e[13]=r,e[14]=o,e[15]=d):d=e[15];const u=K(d);let g;e[16]!==t||e[17]!==n?(g=async w=>{await h(F(t.slug,n,"file",{path:w}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let f;e[19]!==r||e[20]!==g?(f={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=f):f=e[21];const b=K(f);let q;e[22]!==t||e[23]!==n?(q=async w=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(w)})},e[22]=t,e[23]=n,e[24]=q):q=e[24];let I;e[25]!==r||e[26]!==q?(I={mutationFn:q,onSuccess:r},e[25]=r,e[26]=q,e[27]=I):I=e[27];const O=K(I);let m;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(m={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,e[30]=b,e[31]=c,e[32]=m):m=e[32],m}function X(n){return n.status==="rejected"}export{E as a,ne as b,ee as c,re as d,Y as e,te as f,ae as g,ie as h,le as i,z as j,G as k,se as l,V as m,J as n,Z as o,v as p,C as q,B as u};
1
+ import{c as p,X as S,K as y,m as $,o as T,e as K}from"./index-CWzlOAQX.js";function Y(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}function z(n,e,t){const s=p.c(16),{org:i}=S(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let l;s[4]!==i.id||s[5]!==n?(l=(d,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?d:void 0,s[4]=i.id,s[5]=n,s[6]=l):l=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(i.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let o;return s[11]!==r||s[12]!==a||s[13]!==l||s[14]!==c?(o={enabled:r,queryKey:a,placeholderData:l,queryFn:c},s[11]=r,s[12]=a,s[13]=l,s[14]=c,s[15]=o):o=s[15],$(o)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function C(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function B(n,e,t){const s=p.c(15),{org:i}=S();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=s[3];const a=n!==null;let l;s[4]!==t?(l=t?.refetchIntervalWhenAbsent?d=>d.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=l):l=s[5];let c;s[6]!==i.slug||s[7]!==e||s[8]!==n?(c=()=>C(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let o;return s[10]!==r||s[11]!==a||s[12]!==l||s[13]!==c?(o={queryKey:r,enabled:a,refetchInterval:l,queryFn:c},s[10]=r,s[11]=a,s[12]=l,s[13]=c,s[14]=o):o=s[14],$(o)}function J(n){const e=p.c(9),{org:t}=S();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==t.slug||e[4]!==n?(i=async()=>await(await h(F(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,queryFn:i},e[6]=s,e[7]=i,e[8]=r):r=e[8],$(r)}function V(n,e){const t=p.c(9),s=n===void 0?60:n,{org:i}=S();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let l;t[2]!==s||t[3]!==i.slug?(l=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=l):l=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==l?(c={queryKey:r,enabled:a,queryFn:l},t[5]=r,t[6]=a,t[7]=l,t[8]=c):c=t[8],$(c)}const _=50;function G(n,e){const t=p.c(16),{org:s}=S();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=n.length>0;let a;t[5]!==s.id?(a=(o,d)=>d?.queryKey[1]===s.id?o:void 0,t[5]=s.id,t[6]=a):a=t[6];let l;t[7]!==s.slug||t[8]!==n||t[9]!==e?(l=async()=>{const o=new URLSearchParams({q:n,limit:String(_)});return e&&(o.set("volume",e.volume),e.prefix&&o.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${o}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=l):l=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==l?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:l},t[11]=i,t[12]=r,t[13]=a,t[14]=l,t[15]=c):c=t[15],$(c)}function Z(n){const e=p.c(8),{org:t}=S();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const i=n?.enabled;let r;e[2]!==t.slug?(r=async()=>{const l=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await l.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function E(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function v(){const n=p.c(7),{org:e}=S();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>E(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function R(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ee(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const l=await fetch(n,{credentials:"include"});return l.ok?await l.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const U=new Set(["md","mdx","markdown","txt","text"]),Q=25,M=64*1024,A=256*1024,D=4;function N(n){const e=n.lastIndexOf(".");return e===-1?!1:U.has(n.slice(e+1).toLowerCase())}async function te(n,e,t){const s=t?`${t}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],l=[{path:t,depth:0}];for(;l.length>0;){const u=l.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const f of[...g].sort((b,q)=>b.path.localeCompare(q.path))){if(f.kind==="dir"){u.depth<D&&l.push({path:f.path,depth:u.depth+1});continue}N(f.path)&&f.size<=M&&r.length<Q?r.push(f.path):a.push(i(f.path))}}const c=await Promise.all(r.map(u=>R(n,e,u).catch(()=>null))),o=[];let d=0;return r.forEach((u,g)=>{const f=c[g];if(f==null||d+f.length>A){a.push(i(u));return}d+=f.length,o.push({relPath:i(u),content:f})}),o.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:o,omittedPaths:a}}function se(){const n=p.c(7),{org:e}=S();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function ne(n){const e=p.c(3),{org:t}=S();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>F(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ie(){const n=p.c(2),{org:e}=S();let t;return n[0]!==e.slug?(t=(s,i)=>F(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function re(n){const e=p.c(3),{org:t}=S();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(F(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],K(s)}function ae(n){const e=p.c(18),{org:t}=S(),s=T();let i;e[0]!==t||e[1]!==n?(i=async o=>(await(await h(F(t.slug,n,"public",{path:o.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:o.mode,password:o.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=async o=>{const d=y.orgFsStat(t.id,n,o.path);await s.cancelQueries({queryKey:d});const u=s.getQueryData(d),g=o.mode!=="private";return s.setQueryData(d,f=>f&&{...f,readPublic:g,effectivePublic:g,shareMode:o.mode}),{key:d,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=r):r=e[6];let a;e[7]!==s?(a=(o,d,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let l;e[9]!==t||e[10]!==s||e[11]!==n?(l=(o,d,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=l):l=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==l?(c={mutationFn:i,onMutate:r,onError:a,onSettled:l},e[13]=i,e[14]=r,e[15]=a,e[16]=l,e[17]=c):c=e[17],K(c)}function le(n){const e=p.c(33),{org:t}=S(),s=T();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>{s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async w=>{const k=(await Promise.allSettled(w.files.map(L=>{const P=w.dir?`${w.dir}/${L.name}`:L.name;return h(F(t.slug,n,"file",{path:P}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(X);if(k)throw k.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let l;e[7]!==r||e[8]!==a?(l={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=l):l=e[9];const c=K(l);let o;e[10]!==t||e[11]!==n?(o=async w=>{await h(F(t.slug,n,"dir",{path:w}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=o):o=e[12];let d;e[13]!==r||e[14]!==o?(d={mutationFn:o,onSuccess:r},e[13]=r,e[14]=o,e[15]=d):d=e[15];const u=K(d);let g;e[16]!==t||e[17]!==n?(g=async w=>{await h(F(t.slug,n,"file",{path:w}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let f;e[19]!==r||e[20]!==g?(f={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=f):f=e[21];const b=K(f);let q;e[22]!==t||e[23]!==n?(q=async w=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(w)})},e[22]=t,e[23]=n,e[24]=q):q=e[24];let I;e[25]!==r||e[26]!==q?(I={mutationFn:q,onSuccess:r},e[25]=r,e[26]=q,e[27]=I):I=e[27];const O=K(I);let m;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(m={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,e[30]=b,e[31]=c,e[32]=m):m=e[32],m}function X(n){return n.status==="rejected"}export{E as a,ne as b,ee as c,re as d,Y as e,te as f,ae as g,ie as h,le as i,z as j,G as k,se as l,V as m,J as n,Z as o,v as p,C as q,B as u};
@@ -1 +1 @@
1
- import{c as r,X as f,a2 as y,K as S,m as _,o as d,e as R}from"./index-CyQyr88p.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,T as c,g as u};
1
+ import{c as r,X as f,a2 as y,K as S,m as _,o as d,e as R}from"./index-CWzlOAQX.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,T as c,g as u};
@@ -1 +1 @@
1
- import{c as u,m as S,o as r,e as y,K as c}from"./index-CyQyr88p.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,o as r,e as y,K as c}from"./index-CWzlOAQX.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-C-MfZ94G.js";import{X as b,m as P,K as y}from"./index-CyQyr88p.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-CN0iwzUb.js";import{X as b,m as P,K as y}from"./index-CWzlOAQX.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 b,c as u,aT as M,X as T,m as x,af as $,K as h,a2 as A,o as O,e as I}from"./index-CyQyr88p.js";import{D as z,o as D,a as P}from"./schema-Gtjoj1mV.js";import{r as R}from"./task-board-BZQiH6lk.js";const C={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},G={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function k(t,e){return{queryKey:h.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...C,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(6),{org:n}=T();let s;e[0]!==n.id||e[1]!==n.slug?(s=k(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let a;return e[3]!==s||e[4]!==o?(a={...s,select:o},e[3]=s,e[4]=o,e[5]=a):a=e[5],x(a)}function _(){const t=u.c(9),{org:e}=T(),n=A(),s=O();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(h.organizationSettings(e.id),r=>({...r??C,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],I(i)}function L(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}}:G}function B(){const{data:t}=d(Q);return t??G}function Q(t){return L(t.simple_mode)}function V(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),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 W(){return c("reports_only")}function c(t){const e=u.c(5);let n;e[0]!==t?(n=a=>D(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(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 X(){const t=u.c(8),{org:e}=T(),n=A(),s=O();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(h.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],I(i)}function N(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function H(){const{data:t}=b.useSession();return N(t?.user?.email)}function J(){const t=u.c(9),{data:e}=b.useSession(),n=M();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||N(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=c("hosting_enabled"),r=c("deco_analytics_enabled"),m=c("e2e_enabled"),w=c("monitor_enabled"),F=c("experiments_enabled"),g=o||a||l,p=o||a||r,S=o||a||m,y=o||i||w,E=o||a||F;let f;return t[3]!==g||t[4]!==p||t[5]!==S||t[6]!==y||t[7]!==E?(f={hosting:g,analytics:p,e2e:S,monitor:y,experiments:E},t[3]=g,t[4]=p,t[5]=S,t[6]=y,t[7]=E,t[8]=f):f=t[8],f}function tt(){const{data:t}=d(U);return t??!1}function U(t){return P(t.flags)}function et(){const{data:t}=d(q);return t??!0}function q(t){return R(t.flags)}function nt(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),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 st(){const t=u.c(2),{data:e}=d(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function ot(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function at(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.submodule_credentials}function it(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{c as a,J as b,B as c,et as d,X as e,tt as f,nt as g,st as h,ot as i,V as j,at as k,it as l,H as m,W as u};
1
+ import{a as b,c as u,aT as M,X as T,m as x,af as $,K as h,a2 as A,o as O,e as I}from"./index-CWzlOAQX.js";import{D as z,o as D,a as P}from"./schema-BKdAxrjN.js";import{r as R}from"./task-board-ZOkVjFfb.js";const C={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},G={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function k(t,e){return{queryKey:h.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...C,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(6),{org:n}=T();let s;e[0]!==n.id||e[1]!==n.slug?(s=k(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let a;return e[3]!==s||e[4]!==o?(a={...s,select:o},e[3]=s,e[4]=o,e[5]=a):a=e[5],x(a)}function _(){const t=u.c(9),{org:e}=T(),n=A(),s=O();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(h.organizationSettings(e.id),r=>({...r??C,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],I(i)}function L(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}}:G}function B(){const{data:t}=d(Q);return t??G}function Q(t){return L(t.simple_mode)}function V(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),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 W(){return c("reports_only")}function c(t){const e=u.c(5);let n;e[0]!==t?(n=a=>D(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(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 X(){const t=u.c(8),{org:e}=T(),n=A(),s=O();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(h.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],I(i)}function N(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function H(){const{data:t}=b.useSession();return N(t?.user?.email)}function J(){const t=u.c(9),{data:e}=b.useSession(),n=M();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||N(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=c("hosting_enabled"),r=c("deco_analytics_enabled"),m=c("e2e_enabled"),w=c("monitor_enabled"),F=c("experiments_enabled"),g=o||a||l,p=o||a||r,S=o||a||m,y=o||i||w,E=o||a||F;let f;return t[3]!==g||t[4]!==p||t[5]!==S||t[6]!==y||t[7]!==E?(f={hosting:g,analytics:p,e2e:S,monitor:y,experiments:E},t[3]=g,t[4]=p,t[5]=S,t[6]=y,t[7]=E,t[8]=f):f=t[8],f}function tt(){const{data:t}=d(U);return t??!1}function U(t){return P(t.flags)}function et(){const{data:t}=d(q);return t??!0}function q(t){return R(t.flags)}function nt(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),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 st(){const t=u.c(2),{data:e}=d(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function ot(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function at(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.submodule_credentials}function it(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{c as a,J as b,B as c,et as d,X as e,tt as f,nt as g,st as h,ot as i,V as j,at as k,it as l,H as m,W as u};
@@ -1 +1 @@
1
- import{c as p,f as g,u as S,cY as _,d as k,k as b,cZ as P,c_ as E}from"./index-CyQyr88p.js";import{b as I}from"./thread-route-BnMz_7UO.js";import{a as R}from"./use-project-scope-BxTK_qgl.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],b(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(d,c)=>{const h=P(d),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:d,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=d=>t({to:".",search:z,replace:d?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let u;return e[8]!==f||e[9]!==m?(u={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=u):u=e[10],u}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
1
+ import{c as p,f as g,u as S,cY as _,d as k,k as b,cZ as P,c_ as E}from"./index-CWzlOAQX.js";import{b as I}from"./thread-route-D9Gbeij-.js";import{a as R}from"./use-project-scope-C9VWhN8V.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],b(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(d,c)=>{const h=P(d),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:d,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=d=>t({to:".",search:z,replace:d?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let u;return e[8]!==f||e[9]!==m?(u={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=u):u=e[10],u}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
@@ -1 +1 @@
1
- import{c as A,f as _,u as R,d as T,a9 as k,c$ as C,d0 as N,d1 as j,c_ as E,a5 as S}from"./index-CyQyr88p.js";import{d as b,i as w,f as D,p as H}from"./repository-binding-Dgq5OsMA.js";function F(t){if(typeof t!="object"||t===null)return!1;const s=t.repository?.url;return typeof s=="string"&&s.length>0}function J(t){return b(t).status==="attached"}function K(t){const e=b(t).status;return e==="attached"||e==="detached"}function O(t){const e=new Set;for(const s of t??[]){const n=s.metadata?.liveAgentId;typeof n=="string"&&n&&e.add(s.id)}return e}function L(t,e){if(!t)return null;const s=t.metadata?.liveAgentId;if(typeof s=="string"&&s)return(e??[]).find(a=>a.id===s)?{mode:"dev",targetId:s}:null;const n=(e??[]).find(o=>o.metadata?.liveAgentId===t.id);return n?{mode:"live",targetId:n.id}:null}const M=1;function y(t){const e=t??[],s=O(e);return e.filter(n=>!s.has(n.id)&&!C(n.id)&&!N(n.id)&&!j(n.id))}function V(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=_(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[1]=n):n=t[1];const o=R(n);if(s.agentId)return s.agentId;let a;return t[2]!==o?(a="virtualmcpid"in o&&typeof o.virtualmcpid=="string"?o.virtualmcpid.trim():void 0,t[2]=o,t[3]=a):a=t[3],a||null}function U(){const t=A.c(16),e=T();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=_(s),o=k(),a=w(),c=y(a),i=V(),P=c.find(r=>r.id===i)??null;let l;t[1]!==a||t[2]!==i?(l=i&&a.length>0&&!a.some(r=>r.id===i)?i:null,t[1]=a,t[2]=i,t[3]=l):l=t[3];const h=D(l),d=P??y(h?[h]:[])[0]??null;let u;t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i?(u=r=>{if(r===i&&o!==void 0)return;const v=n.org??"",I=$;if(r){E(e,{org:v,agentId:r,tabId:o==="board"||o==="reports"?o:"overview",search:I,replace:!1});return}if(o==="board"){e({to:S.tasks,params:{org:v,taskKey:void 0},search:I});return}e({to:S.home,params:{org:v},search:I})},t[4]=o,t[5]=e,t[6]=n,t[7]=i,t[8]=u):u=t[8];const m=u,p=H(d),g=c.length>=M;let f;return t[9]!==d||t[10]!==c||t[11]!==i||t[12]!==m||t[13]!==p||t[14]!==g?(f={scopeId:i,project:d,repo:p,projects:c,hasProjects:g,setScope:m},t[9]=d,t[10]=c,t[11]=i,t[12]=m,t[13]=p,t[14]=g,t[15]=f):f=t[15],f}function $(t){return{...t,virtualmcpid:void 0,thread:void 0,mainpanel:void 0}}export{V as a,F as b,K as c,J as d,L as f,O as g,y as s,U as u};
1
+ import{c as A,f as _,u as R,d as T,a9 as k,c$ as C,d0 as N,d1 as j,c_ as E,a5 as S}from"./index-CWzlOAQX.js";import{d as b,i as w,f as D,p as H}from"./repository-binding-3gizJnq4.js";function F(t){if(typeof t!="object"||t===null)return!1;const s=t.repository?.url;return typeof s=="string"&&s.length>0}function J(t){return b(t).status==="attached"}function K(t){const e=b(t).status;return e==="attached"||e==="detached"}function O(t){const e=new Set;for(const s of t??[]){const n=s.metadata?.liveAgentId;typeof n=="string"&&n&&e.add(s.id)}return e}function L(t,e){if(!t)return null;const s=t.metadata?.liveAgentId;if(typeof s=="string"&&s)return(e??[]).find(a=>a.id===s)?{mode:"dev",targetId:s}:null;const n=(e??[]).find(o=>o.metadata?.liveAgentId===t.id);return n?{mode:"live",targetId:n.id}:null}const M=1;function y(t){const e=t??[],s=O(e);return e.filter(n=>!s.has(n.id)&&!C(n.id)&&!N(n.id)&&!j(n.id))}function V(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=_(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[1]=n):n=t[1];const o=R(n);if(s.agentId)return s.agentId;let a;return t[2]!==o?(a="virtualmcpid"in o&&typeof o.virtualmcpid=="string"?o.virtualmcpid.trim():void 0,t[2]=o,t[3]=a):a=t[3],a||null}function U(){const t=A.c(16),e=T();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=_(s),o=k(),a=w(),c=y(a),i=V(),P=c.find(r=>r.id===i)??null;let l;t[1]!==a||t[2]!==i?(l=i&&a.length>0&&!a.some(r=>r.id===i)?i:null,t[1]=a,t[2]=i,t[3]=l):l=t[3];const h=D(l),d=P??y(h?[h]:[])[0]??null;let u;t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i?(u=r=>{if(r===i&&o!==void 0)return;const v=n.org??"",I=$;if(r){E(e,{org:v,agentId:r,tabId:o==="board"||o==="reports"?o:"overview",search:I,replace:!1});return}if(o==="board"){e({to:S.tasks,params:{org:v,taskKey:void 0},search:I});return}e({to:S.home,params:{org:v},search:I})},t[4]=o,t[5]=e,t[6]=n,t[7]=i,t[8]=u):u=t[8];const m=u,p=H(d),g=c.length>=M;let f;return t[9]!==d||t[10]!==c||t[11]!==i||t[12]!==m||t[13]!==p||t[14]!==g?(f={scopeId:i,project:d,repo:p,projects:c,hasProjects:g,setScope:m},t[9]=d,t[10]=c,t[11]=i,t[12]=m,t[13]=p,t[14]=g,t[15]=f):f=t[15],f}function $(t){return{...t,virtualmcpid:void 0,thread:void 0,mainpanel:void 0}}export{V as a,F as b,K as c,J as d,L as f,O as g,y as s,U as u};
@@ -1 +1 @@
1
- import{c as N,X as Q,o as k}from"./index-CyQyr88p.js";import{a as E,e as P}from"./repository-binding-Dgq5OsMA.js";import{r as z}from"./serial-task-queue-CGOeQgpr.js";function O(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function B(t){return t?.name||t?.email?.split("@")[0]||void 0}function F(t){const e=O(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function T(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function V(t,e){return t.filter(s=>s.branch!==e)}function _(t,e,s){return t.map(o=>o.branch===e?{...o,name:s}:o)}const S=["orange","violet","blue","pink","amber","teal"];function K(t){return S[t%S.length]}function W(t,e){const s=`${e} `,o=t.reduce((u,n)=>{if(!n.name.startsWith(s))return u;const l=Number(n.name.slice(s.length));return Number.isInteger(l)&&l>u?l:u},0);return`${e} ${o+1}`}const j={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function X(t){return t&&j[t]||"bg-muted-foreground"}function G(t){const e=N.c(26),s=E(t),o=P(),{org:u}=Q(),n=k();let l;e[0]!==s?.metadata?.releases?(l=s?.metadata?.releases??[],e[0]=s?.metadata?.releases,e[1]=l):l=e[1];const f=l;let b;e[2]!==u||e[3]!==t?(b=a=>a[1]===u.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"&&a[5]===t,e[2]=u,e[3]=t,e[4]=b):b=e[4];const m=b;let d;e[5]!==m||e[6]!==n||e[7]!==f?(d=()=>{for(const[,a]of n.getQueriesData({predicate:r=>m(r.queryKey)}))if(a?.item)return a.item.metadata?.releases??[];return f},e[5]=m,e[6]=n,e[7]=f,e[8]=d):d=e[8];const $=d;let p;e[9]!==o||e[10]!==m||e[11]!==n||e[12]!==$||e[13]!==t?(p=a=>z(`vm-releases:${t}`,async()=>{const r=$(),g=a(r);if(g!==r){n.setQueriesData({predicate:c=>m(c.queryKey)},c=>c?.item?{item:{...c.item,metadata:{...c.item.metadata,releases:g}}}:c);try{await o.update.mutateAsync({id:t,data:{metadata:{releases:g}}})}catch(c){const w=c;throw n.invalidateQueries({predicate:A=>m(A.queryKey)}),w}}}),e[9]=o,e[10]=m,e[11]=n,e[12]=$,e[13]=t,e[14]=p):p=e[14];const i=p;let R;e[15]!==i?(R=a=>i(r=>T(r,a)),e[15]=i,e[16]=R):R=e[16];const y=R;let h;e[17]!==i?(h=(a,r)=>i(g=>_(g,a,r)),e[17]=i,e[18]=h):h=e[18];const D=h;let C;e[19]!==i?(C=a=>i(r=>V(r,a)),e[19]=i,e[20]=C):C=e[20];const L=C;let x;return e[21]!==y||e[22]!==L||e[23]!==f||e[24]!==D?(x={releases:f,createRelease:y,renameRelease:D,deleteRelease:L},e[21]=y,e[22]=L,e[23]=f,e[24]=D,e[25]=x):x=e[25],x}export{W as a,B as b,F as g,K as n,X as r,G as u};
1
+ import{c as N,X as Q,o as k}from"./index-CWzlOAQX.js";import{a as E,e as P}from"./repository-binding-3gizJnq4.js";import{r as z}from"./serial-task-queue-CGOeQgpr.js";function O(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function B(t){return t?.name||t?.email?.split("@")[0]||void 0}function F(t){const e=O(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function T(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function V(t,e){return t.filter(s=>s.branch!==e)}function _(t,e,s){return t.map(o=>o.branch===e?{...o,name:s}:o)}const S=["orange","violet","blue","pink","amber","teal"];function K(t){return S[t%S.length]}function W(t,e){const s=`${e} `,o=t.reduce((u,n)=>{if(!n.name.startsWith(s))return u;const l=Number(n.name.slice(s.length));return Number.isInteger(l)&&l>u?l:u},0);return`${e} ${o+1}`}const j={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function X(t){return t&&j[t]||"bg-muted-foreground"}function G(t){const e=N.c(26),s=E(t),o=P(),{org:u}=Q(),n=k();let l;e[0]!==s?.metadata?.releases?(l=s?.metadata?.releases??[],e[0]=s?.metadata?.releases,e[1]=l):l=e[1];const f=l;let b;e[2]!==u||e[3]!==t?(b=a=>a[1]===u.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"&&a[5]===t,e[2]=u,e[3]=t,e[4]=b):b=e[4];const m=b;let d;e[5]!==m||e[6]!==n||e[7]!==f?(d=()=>{for(const[,a]of n.getQueriesData({predicate:r=>m(r.queryKey)}))if(a?.item)return a.item.metadata?.releases??[];return f},e[5]=m,e[6]=n,e[7]=f,e[8]=d):d=e[8];const $=d;let p;e[9]!==o||e[10]!==m||e[11]!==n||e[12]!==$||e[13]!==t?(p=a=>z(`vm-releases:${t}`,async()=>{const r=$(),g=a(r);if(g!==r){n.setQueriesData({predicate:c=>m(c.queryKey)},c=>c?.item?{item:{...c.item,metadata:{...c.item.metadata,releases:g}}}:c);try{await o.update.mutateAsync({id:t,data:{metadata:{releases:g}}})}catch(c){const w=c;throw n.invalidateQueries({predicate:A=>m(A.queryKey)}),w}}}),e[9]=o,e[10]=m,e[11]=n,e[12]=$,e[13]=t,e[14]=p):p=e[14];const i=p;let R;e[15]!==i?(R=a=>i(r=>T(r,a)),e[15]=i,e[16]=R):R=e[16];const y=R;let h;e[17]!==i?(h=(a,r)=>i(g=>_(g,a,r)),e[17]=i,e[18]=h):h=e[18];const D=h;let C;e[19]!==i?(C=a=>i(r=>V(r,a)),e[19]=i,e[20]=C):C=e[20];const L=C;let x;return e[21]!==y||e[22]!==L||e[23]!==f||e[24]!==D?(x={releases:f,createRelease:y,renameRelease:D,deleteRelease:L},e[21]=y,e[22]=L,e[23]=f,e[24]=D,e[25]=x):x=e[25],x}export{W as a,B as b,F as g,K as n,X as r,G as u};
@@ -1 +1 @@
1
- import{c as N,X as Q,W as F,z as A,m as f,K as T,e1 as L,J as K,C as D}from"./index-CyQyr88p.js";import{m as O}from"./use-mcp-client-BuS_j4o-.js";import{u as h}from"./companions-core-DzyeM-yJ.js";function M(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function U(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:T.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const R=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(R)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=T.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const R=await s.callTool({name:L,arguments:{}});return h(R).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=U({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const _=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==_||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:_},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=_,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&M(n.state.data)==="generating"?b:!1}function z(n,e){return{to:K.app,params:{org:n.slug,agentId:D(n.id),connectionId:e,toolName:L},search:{}}}export{M as d,z as r,j as u};
1
+ import{c as N,X as Q,W as F,z as A,m as f,K as T,e1 as L,J as K,C as D}from"./index-CWzlOAQX.js";import{m as O}from"./use-mcp-client-Ct2vdUoM.js";import{u as h}from"./companions-core-DzyeM-yJ.js";function M(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function U(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:T.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const R=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(R)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=T.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const R=await s.callTool({name:L,arguments:{}});return h(R).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=U({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const _=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==_||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:_},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=_,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&M(n.state.data)==="generating"?b:!1}function z(n,e){return{to:K.app,params:{org:n.slug,agentId:D(n.id),connectionId:e,toolName:L},search:{}}}export{M as d,z as r,j as u};
@@ -1 +1 @@
1
- import{c as u,X as c,a2 as r,K as l,D as d,o as f,e as S}from"./index-CyQyr88p.js";function C(){const e=u.c(7),{org:o}=c(),a=r();let i;e[0]!==o.id?(i=l.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=d(s);return n.secrets}function m(){const e=u.c(8),{org:o}=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]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{m as a,C as u};
1
+ import{c as u,X as c,a2 as r,K as l,D as d,o as f,e as S}from"./index-CWzlOAQX.js";function C(){const e=u.c(7),{org:o}=c(),a=r();let i;e[0]!==o.id?(i=l.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=d(s);return n.secrets}function m(){const e=u.c(8),{org:o}=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]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{m as a,C as u};
@@ -1 +1 @@
1
- import{c as _,b as Y,r as S,j as r,l as Z}from"./index-CyQyr88p.js";import{a as J,d as K}from"./UserSquare-BMQF7dC1.js";import{b as ee}from"./agent-icon-DyICUp-0.js";import{i as te}from"./SearchMd-BjiZq5Ss.js";import{D as re,b as se,d as le,c as oe}from"./dialog-D1MsBTH7.js";import{I as ie}from"./input-CeDoO_Rr.js";import{u as Q}from"./use-new-blocks-editor-C9Lf0NAr.js";import{_ as ne,k as ce,a2 as ae,G as fe,u as de}from"./claim-phase-copy-BVJw-2Sg.js";import{d as V,r as ue}from"./section-preview-url-Csj0_ZDg.js";import{u as me}from"./use-session-runtime-BVWXx-Hx.js";const ve=12,D=new Set,q=new Set;function pe(){for(const s of q)s()}function xe(s){return D.has(s)?!0:D.size>=ve?!1:(D.add(s),!0)}function X(s){D.delete(s)&&pe()}function he(s){return q.add(s),()=>{q.delete(s)}}function we(s,e){const t=S.useRef(!1),[m,i]=S.useState(!1),l=S.useRef(null),c=S.useRef(null),u=S.useRef(null),o=S.useRef(s);o.current=s;const[d]=S.useState(()=>{const a=()=>{u.current?.(),u.current=null},f=()=>t.current?!0:xe(e)?(t.current=!0,i(!0),a(),!0):!1;return n=>{if(c.current=n,l.current&&(l.current.disconnect(),l.current=null),a(),!n){t.current&&(X(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(c.current!==n)return;const w=new IntersectionObserver(v=>{if(v[0]?.isIntersecting??!1){!f()&&!u.current&&(u.current=he(()=>{c.current===n&&f()}));return}a(),t.current&&(X(e),t.current=!1,i(!1))},{root:o.current.current,rootMargin:"160px 0px"});w.observe(n),l.current=w})}});return{ref:d,iframeActive:m}}function ge(s){const e=_.c(9),{previewUrl:t,title:m,scrollRootRef:i,slotId:l}=s,{ref:c,iframeActive:u}=we(i,l),[o,d]=S.useState(!1),a=Q()?K:J;let f;e[0]!==a||e[1]!==u||e[2]!==o||e[3]!==t||e[4]!==m?(f=u?r.jsxs(r.Fragment,{children:[!o&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(a,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${m}`,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:()=>d(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(a,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=a,e[1]=u,e[2]=o,e[3]=t,e[4]=m,e[5]=f):f=e[5];let n;return e[6]!==c||e[7]!==f?(n=r.jsx("div",{ref:c,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:f}),e[6]=c,e[7]=f,e[8]=n):n=e[8],n}function Se(s){const e=_.c(27),{entry:t,previewUrl:m,scrollRootRef:i,onSelect:l}=s,u=Q()?t.isSavedBlock?ee:K:J,o=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let d;e[0]!==o?(d=Z("group flex flex-col overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-lg))] border bg-card text-left transition-colors card-shadow","hover:border-primary/40 hover:bg-accent/30",o),e[0]=o,e[1]=d):d=e[1];let a;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==m||e[5]!==i?(a=r.jsx(ge,{previewUrl:m,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=m,e[5]=i,e[6]=a):a=e[6];let f;e[7]!==t.isSavedBlock?(f=t.isSavedBlock?{color:fe}:void 0,e[7]=t.isSavedBlock,e[8]=f):f=e[8];let n;e[9]!==u||e[10]!==f?(n=r.jsx(u,{className:"h-4 w-4 shrink-0",style:f}),e[9]=u,e[10]=f,e[11]=n):n=e[11];let w;e[12]!==t.title?(w=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[12]=t.title,e[13]=w):w=e[13];let v;e[14]!==t.description?(v=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[14]=t.description,e[15]=v):v=e[15];let p;e[16]!==w||e[17]!==v?(p=r.jsxs("div",{className:"min-w-0 flex-1",children:[w,v]}),e[16]=w,e[17]=v,e[18]=p):p=e[18];let h;e[19]!==n||e[20]!==p?(h=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,p]}),e[19]=n,e[20]=p,e[21]=h):h=e[21];let g;return e[22]!==l||e[23]!==d||e[24]!==a||e[25]!==h?(g=r.jsxs("button",{type:"button",onClick:l,className:d,children:[a,h]}),e[22]=l,e[23]=d,e[24]=a,e[25]=h,e[26]=g):g=e[26],g}function Be(s){const e=_.c(51),{open:t,onOpenChange:m,meta:i,decofile:l,previewBaseUrl:c,onSelect:u}=s,o=Y(),[d,a]=S.useState(""),[f,n]=S.useState(t),w=S.useRef(null);t!==f&&(n(t),t&&a(""));let v,p,h,g,j,N,R,y,b,P,C;if(e[0]!==l||e[1]!==i||e[2]!==m||e[3]!==u||e[4]!==t||e[5]!==c||e[6]!==d||e[7]!==o){const z=t&&i&&l?ne(i,l):[],W=i?ce(i):"",F=l?ae(l):void 0,G=new Map;if(t&&W)for(const x of z)G.set(x.resolveType,V(c,W,x.previewBlock,F));const M=d.trim().toLowerCase(),H=M?z.filter(x=>x.title.toLowerCase().includes(M)||x.resolveType.toLowerCase().includes(M)||x.description?.toLowerCase().includes(M)):z;p=re,P=t,C=m,v=se,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 B;e[19]!==o?(B=o("sectionsEditor.addSectionModal.title"),e[19]=o,e[20]=B):B=e[20];let L;e[21]!==B?(L=r.jsx(le,{children:B}),e[21]=B,e[22]=L):L=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(te,{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")?($=x=>a(x.target.value),e[24]=$):$=e[24];let k;e[25]!==o?(k=o("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=o,e[26]=k):k=e[26];let A;e[27]!==d||e[28]!==k?(A=r.jsxs("div",{className:"relative pt-2",children:[O,r.jsx(ie,{value:d,onChange:$,placeholder:k,className:"h-9 pl-8"})]}),e[27]=d,e[28]=k,e[29]=A):A=e[29],e[30]!==L||e[31]!==A?(b=r.jsxs(oe,{className:"shrink-0 border-b px-4 py-3 text-left",children:[L,A]}),e[30]=L,e[31]=A,e[32]=b):b=e[32],j=w,N="min-h-0 flex-1 overflow-y-auto",h="p-4",g=H.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("sectionsEditor.addSectionModal.noSectionsFound")}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:H.map(x=>r.jsx(Se,{entry:x,scrollRootRef:w,previewUrl:G.get(x.resolveType)??V(c,W,x.previewBlock,F),onSelect:()=>u(x)},x.resolveType))}),e[0]=l,e[1]=i,e[2]=m,e[3]=u,e[4]=t,e[5]=c,e[6]=d,e[7]=o,e[8]=v,e[9]=p,e[10]=h,e[11]=g,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=b,e[17]=P,e[18]=C}else v=e[8],p=e[9],h=e[10],g=e[11],j=e[12],N=e[13],R=e[14],y=e[15],b=e[16],P=e[17],C=e[18];let I;e[33]!==h||e[34]!==g?(I=r.jsx("div",{className:h,children:g}),e[33]=h,e[34]=g,e[35]=I):I=e[35];let T;e[36]!==I||e[37]!==j||e[38]!==N?(T=r.jsx("div",{ref:j,className:N,children:I}),e[36]=I,e[37]=j,e[38]=N,e[39]=T):T=e[39];let U;e[40]!==v||e[41]!==T||e[42]!==R||e[43]!==y||e[44]!==b?(U=r.jsxs(v,{closeButtonClassName:R,className:y,children:[b,T]}),e[40]=v,e[41]=T,e[42]=R,e[43]=y,e[44]=b,e[45]=U):U=e[45];let E;return e[46]!==p||e[47]!==U||e[48]!==P||e[49]!==C?(E=r.jsx(p,{open:P,onOpenChange:C,children:U}),e[46]=p,e[47]=U,e[48]=P,e[49]=C,e[50]=E):E=e[50],E}function Le(s){const e=_.c(4),{previewServerUrl:t,runtime:m}=me(s.virtualMcpId),{url:i}=de(s.virtualMcpId),l=m==="cms";if(i)return i;let c;return e[0]!==l||e[1]!==s.sandboxUrl||e[2]!==t?(c=ue({sandboxUrl:s.sandboxUrl,previewServerUrl:t,fastPreviewActive:l}),e[0]=l,e[1]=s.sandboxUrl,e[2]=t,e[3]=c):c=e[3],c}export{Be as A,Le as u};
1
+ import{c as _,b as Y,r as S,j as r,l as Z}from"./index-CWzlOAQX.js";import{a as J,d as K}from"./UserSquare-zqtxIeMd.js";import{b as ee}from"./agent-icon-DQhX6pyL.js";import{i as te}from"./SearchMd-B7WxOr73.js";import{D as re,b as se,d as le,c as oe}from"./dialog-DwOXW4AO.js";import{I as ie}from"./input-BT8saI27.js";import{u as Q}from"./use-new-blocks-editor-BXR_sYex.js";import{_ as ne,k as ce,a2 as ae,G as fe,u as de}from"./claim-phase-copy-DMl_wfzl.js";import{d as V,r as ue}from"./section-preview-url-Csj0_ZDg.js";import{u as me}from"./use-session-runtime-DsnbbYN7.js";const ve=12,D=new Set,q=new Set;function pe(){for(const s of q)s()}function xe(s){return D.has(s)?!0:D.size>=ve?!1:(D.add(s),!0)}function X(s){D.delete(s)&&pe()}function he(s){return q.add(s),()=>{q.delete(s)}}function we(s,e){const t=S.useRef(!1),[m,i]=S.useState(!1),l=S.useRef(null),c=S.useRef(null),u=S.useRef(null),o=S.useRef(s);o.current=s;const[d]=S.useState(()=>{const a=()=>{u.current?.(),u.current=null},f=()=>t.current?!0:xe(e)?(t.current=!0,i(!0),a(),!0):!1;return n=>{if(c.current=n,l.current&&(l.current.disconnect(),l.current=null),a(),!n){t.current&&(X(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(c.current!==n)return;const w=new IntersectionObserver(v=>{if(v[0]?.isIntersecting??!1){!f()&&!u.current&&(u.current=he(()=>{c.current===n&&f()}));return}a(),t.current&&(X(e),t.current=!1,i(!1))},{root:o.current.current,rootMargin:"160px 0px"});w.observe(n),l.current=w})}});return{ref:d,iframeActive:m}}function ge(s){const e=_.c(9),{previewUrl:t,title:m,scrollRootRef:i,slotId:l}=s,{ref:c,iframeActive:u}=we(i,l),[o,d]=S.useState(!1),a=Q()?K:J;let f;e[0]!==a||e[1]!==u||e[2]!==o||e[3]!==t||e[4]!==m?(f=u?r.jsxs(r.Fragment,{children:[!o&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(a,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${m}`,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:()=>d(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(a,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=a,e[1]=u,e[2]=o,e[3]=t,e[4]=m,e[5]=f):f=e[5];let n;return e[6]!==c||e[7]!==f?(n=r.jsx("div",{ref:c,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:f}),e[6]=c,e[7]=f,e[8]=n):n=e[8],n}function Se(s){const e=_.c(27),{entry:t,previewUrl:m,scrollRootRef:i,onSelect:l}=s,u=Q()?t.isSavedBlock?ee:K:J,o=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let d;e[0]!==o?(d=Z("group flex flex-col overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-lg))] border bg-card text-left transition-colors card-shadow","hover:border-primary/40 hover:bg-accent/30",o),e[0]=o,e[1]=d):d=e[1];let a;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==m||e[5]!==i?(a=r.jsx(ge,{previewUrl:m,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=m,e[5]=i,e[6]=a):a=e[6];let f;e[7]!==t.isSavedBlock?(f=t.isSavedBlock?{color:fe}:void 0,e[7]=t.isSavedBlock,e[8]=f):f=e[8];let n;e[9]!==u||e[10]!==f?(n=r.jsx(u,{className:"h-4 w-4 shrink-0",style:f}),e[9]=u,e[10]=f,e[11]=n):n=e[11];let w;e[12]!==t.title?(w=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[12]=t.title,e[13]=w):w=e[13];let v;e[14]!==t.description?(v=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[14]=t.description,e[15]=v):v=e[15];let p;e[16]!==w||e[17]!==v?(p=r.jsxs("div",{className:"min-w-0 flex-1",children:[w,v]}),e[16]=w,e[17]=v,e[18]=p):p=e[18];let h;e[19]!==n||e[20]!==p?(h=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,p]}),e[19]=n,e[20]=p,e[21]=h):h=e[21];let g;return e[22]!==l||e[23]!==d||e[24]!==a||e[25]!==h?(g=r.jsxs("button",{type:"button",onClick:l,className:d,children:[a,h]}),e[22]=l,e[23]=d,e[24]=a,e[25]=h,e[26]=g):g=e[26],g}function Be(s){const e=_.c(51),{open:t,onOpenChange:m,meta:i,decofile:l,previewBaseUrl:c,onSelect:u}=s,o=Y(),[d,a]=S.useState(""),[f,n]=S.useState(t),w=S.useRef(null);t!==f&&(n(t),t&&a(""));let v,p,h,g,j,N,R,y,b,P,C;if(e[0]!==l||e[1]!==i||e[2]!==m||e[3]!==u||e[4]!==t||e[5]!==c||e[6]!==d||e[7]!==o){const z=t&&i&&l?ne(i,l):[],W=i?ce(i):"",F=l?ae(l):void 0,G=new Map;if(t&&W)for(const x of z)G.set(x.resolveType,V(c,W,x.previewBlock,F));const M=d.trim().toLowerCase(),H=M?z.filter(x=>x.title.toLowerCase().includes(M)||x.resolveType.toLowerCase().includes(M)||x.description?.toLowerCase().includes(M)):z;p=re,P=t,C=m,v=se,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 B;e[19]!==o?(B=o("sectionsEditor.addSectionModal.title"),e[19]=o,e[20]=B):B=e[20];let L;e[21]!==B?(L=r.jsx(le,{children:B}),e[21]=B,e[22]=L):L=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(te,{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")?($=x=>a(x.target.value),e[24]=$):$=e[24];let k;e[25]!==o?(k=o("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=o,e[26]=k):k=e[26];let A;e[27]!==d||e[28]!==k?(A=r.jsxs("div",{className:"relative pt-2",children:[O,r.jsx(ie,{value:d,onChange:$,placeholder:k,className:"h-9 pl-8"})]}),e[27]=d,e[28]=k,e[29]=A):A=e[29],e[30]!==L||e[31]!==A?(b=r.jsxs(oe,{className:"shrink-0 border-b px-4 py-3 text-left",children:[L,A]}),e[30]=L,e[31]=A,e[32]=b):b=e[32],j=w,N="min-h-0 flex-1 overflow-y-auto",h="p-4",g=H.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("sectionsEditor.addSectionModal.noSectionsFound")}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:H.map(x=>r.jsx(Se,{entry:x,scrollRootRef:w,previewUrl:G.get(x.resolveType)??V(c,W,x.previewBlock,F),onSelect:()=>u(x)},x.resolveType))}),e[0]=l,e[1]=i,e[2]=m,e[3]=u,e[4]=t,e[5]=c,e[6]=d,e[7]=o,e[8]=v,e[9]=p,e[10]=h,e[11]=g,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=b,e[17]=P,e[18]=C}else v=e[8],p=e[9],h=e[10],g=e[11],j=e[12],N=e[13],R=e[14],y=e[15],b=e[16],P=e[17],C=e[18];let I;e[33]!==h||e[34]!==g?(I=r.jsx("div",{className:h,children:g}),e[33]=h,e[34]=g,e[35]=I):I=e[35];let T;e[36]!==I||e[37]!==j||e[38]!==N?(T=r.jsx("div",{ref:j,className:N,children:I}),e[36]=I,e[37]=j,e[38]=N,e[39]=T):T=e[39];let U;e[40]!==v||e[41]!==T||e[42]!==R||e[43]!==y||e[44]!==b?(U=r.jsxs(v,{closeButtonClassName:R,className:y,children:[b,T]}),e[40]=v,e[41]=T,e[42]=R,e[43]=y,e[44]=b,e[45]=U):U=e[45];let E;return e[46]!==p||e[47]!==U||e[48]!==P||e[49]!==C?(E=r.jsx(p,{open:P,onOpenChange:C,children:U}),e[46]=p,e[47]=U,e[48]=P,e[49]=C,e[50]=E):E=e[50],E}function Le(s){const e=_.c(4),{previewServerUrl:t,runtime:m}=me(s.virtualMcpId),{url:i}=de(s.virtualMcpId),l=m==="cms";if(i)return i;let c;return e[0]!==l||e[1]!==s.sandboxUrl||e[2]!==t?(c=ue({sandboxUrl:s.sandboxUrl,previewServerUrl:t,fastPreviewActive:l}),e[0]=l,e[1]=s.sandboxUrl,e[2]=t,e[3]=c):c=e[3],c}export{Be as A,Le as u};
@@ -1 +1 @@
1
- import{c as h}from"./index-CyQyr88p.js";import{r as R,d as T,g as k,i as S}from"./thread-intent-CCZj7A0k.js";import{u as j}from"./chat-context-CG9Mp_L-.js";import{a as w}from"./repository-binding-Dgq5OsMA.js";function g(d){const t=h.c(14),u=w(d),p=j(),e=u?.metadata,o=p?.activeTask,m=o?.metadata?.runtime;let i;t[0]!==m?(i=S(m),t[0]=m,t[1]=i):i=t[1];const f=i,v=!!o&&!o.partial,l=o?.metadata;let a;t[2]!==e||t[3]!==l?(a=R(l,e),t[2]=e,t[3]=l,t[4]=a):a=t[4];const c=!!f||v&&!!u;let r;t[5]!==e?(r=T(e),t[5]=e,t[6]=r):r=t[6];let s;t[7]!==e?(s=k(e),t[7]=e,t[8]=s):s=t[8];let n;return t[9]!==a||t[10]!==c||t[11]!==r||t[12]!==s?(n={runtime:a,resolved:c,projectDefault:r,previewServerUrl:s},t[9]=a,t[10]=c,t[11]=r,t[12]=s,t[13]=n):n=t[13],n}export{g as u};
1
+ import{c as h}from"./index-CWzlOAQX.js";import{r as R,d as T,g as k,i as S}from"./thread-intent-uQTUqJNN.js";import{u as j}from"./chat-context-CSREXmZ-.js";import{a as w}from"./repository-binding-3gizJnq4.js";function g(d){const t=h.c(14),u=w(d),p=j(),e=u?.metadata,o=p?.activeTask,m=o?.metadata?.runtime;let i;t[0]!==m?(i=S(m),t[0]=m,t[1]=i):i=t[1];const f=i,v=!!o&&!o.partial,l=o?.metadata;let a;t[2]!==e||t[3]!==l?(a=R(l,e),t[2]=e,t[3]=l,t[4]=a):a=t[4];const c=!!f||v&&!!u;let r;t[5]!==e?(r=T(e),t[5]=e,t[6]=r):r=t[6];let s;t[7]!==e?(s=k(e),t[7]=e,t[8]=s):s=t[8];let n;return t[9]!==a||t[10]!==c||t[11]!==r||t[12]!==s?(n={runtime:a,resolved:c,projectDefault:r,previewServerUrl:s},t[9]=a,t[10]=c,t[11]=r,t[12]=s,t[13]=n):n=t[13],n}export{g as u};
@@ -1 +1 @@
1
- import{c as u,X as f,a2 as y,m,o as g,e as T,K as l,t as E}from"./index-CyQyr88p.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 M(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 A(){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,M as c,A as d,K as u};
1
+ import{c as u,X as f,a2 as y,m,o as g,e as T,K as l,t as E}from"./index-CWzlOAQX.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 M(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 A(){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,M as c,A as d,K as u};
@@ -1 +1 @@
1
- import{c as i,f as T,m as l,X as S,a2 as _,K as u,af as f}from"./index-CyQyr88p.js";const R=["TASK_BOARD_DELIVERY","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_QUALITY","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function K(){const t=i.c(8),s=T({strict:!1}).org??"";let e;t[0]!==s?(e=u.taskBoardAdminOrgs(s),t[0]=s,t[1]=e):e=t[1];const n=!!s;let A;t[2]!==s?(A=()=>f(s,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=s,t[3]=A):A=t[3];let o;return t[4]!==e||t[5]!==n||t[6]!==A?(o={queryKey:e,enabled:n,queryFn:A,staleTime:3e5},t[4]=e,t[5]=n,t[6]=A,t[7]=o):o=t[7],l(o)}function B(t,s){const e=i.c(13),{locator:n}=S(),A=_();let o;e[0]!==n||e[1]!==s.from||e[2]!==s.org||e[3]!==s.to||e[4]!==t?(o=u.taskBoardAnalytics(n,t,s.org,s.from,s.to),e[0]=n,e[1]=s.from,e[2]=s.org,e[3]=s.to,e[4]=t,e[5]=o):o=e[5];let r;e[6]!==s||e[7]!==A||e[8]!==t?(r=()=>A.call(t,s),e[6]=s,e[7]=A,e[8]=t,e[9]=r):r=e[9];let c;return e[10]!==o||e[11]!==r?(c={queryKey:o,queryFn:r},e[10]=o,e[11]=r,e[12]=c):c=e[12],l(c)}export{R as A,B as a,K as u};
1
+ import{c as i,f as T,m as l,X as S,a2 as _,K as u,af as f}from"./index-CWzlOAQX.js";const R=["TASK_BOARD_DELIVERY","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_QUALITY","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function K(){const t=i.c(8),s=T({strict:!1}).org??"";let e;t[0]!==s?(e=u.taskBoardAdminOrgs(s),t[0]=s,t[1]=e):e=t[1];const n=!!s;let A;t[2]!==s?(A=()=>f(s,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=s,t[3]=A):A=t[3];let o;return t[4]!==e||t[5]!==n||t[6]!==A?(o={queryKey:e,enabled:n,queryFn:A,staleTime:3e5},t[4]=e,t[5]=n,t[6]=A,t[7]=o):o=t[7],l(o)}function B(t,s){const e=i.c(13),{locator:n}=S(),A=_();let o;e[0]!==n||e[1]!==s.from||e[2]!==s.org||e[3]!==s.to||e[4]!==t?(o=u.taskBoardAnalytics(n,t,s.org,s.from,s.to),e[0]=n,e[1]=s.from,e[2]=s.org,e[3]=s.to,e[4]=t,e[5]=o):o=e[5];let r;e[6]!==s||e[7]!==A||e[8]!==t?(r=()=>A.call(t,s),e[6]=s,e[7]=A,e[8]=t,e[9]=r):r=e[9];let c;return e[10]!==o||e[11]!==r?(c={queryKey:o,queryFn:r},e[10]=o,e[11]=r,e[12]=c):c=e[12],l(c)}export{R as A,B as a,K as u};