decocms 4.597.0 → 4.598.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (482) hide show
  1. package/dist/client/assets/{AlertCircle-BLw7QvfG.js → AlertCircle-jxvwS2PA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Cg0oUTGM.js → AreaChart-zoolaKB0.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DH7F9HYx.js → ArrowLeft-Dlf39oKA.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DZeVAIN7.js → ArrowRight-DCL3gp96.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C_Mw0uky.js → ArrowUp-BbUoh0-h.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-9fv3inuR.js → BookOpen01-C85UtDum.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-B1PjlPEb.js → CartesianChart-Bl1HZv9F.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CcMGdgiC.js → CategoricalChart-jjkJNbxp.js} +1 -1
  9. package/dist/client/assets/{CheckCircle--1SXoxG_.js → CheckCircle-KztuMvd5.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-DwO0ALfW.js → ChevronDown-c_BdXEOA.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-Bj17dUxw.js → ChevronSelectorVertical-DmpvIgAy.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BaiO1bgX.js → ChevronUp-BSWVeXQq.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-D6jLDMwS.js → CreditCard01-C4dCRCdu.js} +1 -1
  14. package/dist/client/assets/{Eye-DvcGz393.js → Eye-BSRrcDT9.js} +1 -1
  15. package/dist/client/assets/{File02-Bes4ATvL.js → File02-KoBPCXEf.js} +1 -1
  16. package/dist/client/assets/{Fingerprint04-BpB7HSc7.js → Fingerprint04-B2N20uu4.js} +1 -1
  17. package/dist/client/assets/{Globe04-BBsqVmHb.js → Globe04-UMTQ82HG.js} +1 -1
  18. package/dist/client/assets/{Image01-D2QOi7x6.js → Image01-BGM1ArTz.js} +1 -1
  19. package/dist/client/assets/{Key01-CDcaZkCg.js → Key01-BMkzySkS.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-19qu82-A.js → LayoutLeft-DrOR8tOg.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-Z9hP4zTf.js → LinkBroken01-hoBFLv94.js} +1 -1
  22. package/dist/client/assets/{MessageCircle01-DjShhQqZ.js → MessageCircle01-CDpj4jpt.js} +1 -1
  23. package/dist/client/assets/{Minus-ChoEICrx.js → Minus-DdEPrbsD.js} +1 -1
  24. package/dist/client/assets/{Monitor01-DtssQiym.js → Monitor01-B4iHbF93.js} +1 -1
  25. package/dist/client/assets/{Play-DatgPxza.js → Play-Clz2e0s4.js} +1 -1
  26. package/dist/client/assets/{Plus-GSWEwEm-.js → Plus-CO40HUhB.js} +1 -1
  27. package/dist/client/assets/{ReferenceLine-Cl-8dOcW.js → ReferenceLine-CeSeSzH6.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DhrJsmFj.js → SearchMd-FI2fcykP.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DQR5ci-Q.js → ShoppingBag01-BBDr_WSy.js} +1 -1
  30. package/dist/client/assets/{Sun-Dpzqhodu.js → Sun-D531tFmZ.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-NAHL2C3Y.js → SwitchHorizontal01-B8iZqdiB.js} +1 -1
  32. package/dist/client/assets/{Tool01-DJqLAFcI.js → Tool01-CldemTEe.js} +1 -1
  33. package/dist/client/assets/{Tooltip-fSWtSvYM.js → Tooltip-B1dYEjVO.js} +1 -1
  34. package/dist/client/assets/{Trash01-Br_8Dd8k.js → Trash01-W_zwe5xo.js} +1 -1
  35. package/dist/client/assets/{Upload01-B1gnueEL.js → Upload01-DDGkOE5t.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-CpLKejEQ.js → UserCheck01-VgBUlrC3.js} +1 -1
  37. package/dist/client/assets/{UserSquare-D1HQ9ju8.js → UserSquare-YQkID8bv.js} +1 -1
  38. package/dist/client/assets/{Users01-qnd_BT_N.js → Users01-CJ_YMgJe.js} +1 -1
  39. package/dist/client/assets/{XClose-BbVr5nc7.js → XClose-Dv4YALPV.js} +1 -1
  40. package/dist/client/assets/{Zap-B1JA6VL5.js → Zap-DFubAl8b.js} +1 -1
  41. package/dist/client/assets/{access-gate-m6QmHtAD.js → access-gate-C-gJXueM.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-BIOFD97r.js → add-connection-dialog-DyPd4ss_.js} +1 -1
  43. package/dist/client/assets/agent-app-BxXBXF3L.js +1 -0
  44. package/dist/client/assets/agent-assets-CFkP_Dfu.js +1 -0
  45. package/dist/client/assets/{agent-automation-to9UMVoQ.js → agent-automation-BaYqgCX1.js} +2 -2
  46. package/dist/client/assets/agent-automations-DBsSsUGW.js +1 -0
  47. package/dist/client/assets/agent-blog-lx6Ts7x1.js +2 -0
  48. package/dist/client/assets/agent-blog-post-BeOLBeeI.js +2 -0
  49. package/dist/client/assets/agent-calendar-BnmK4XQ1.js +1 -0
  50. package/dist/client/assets/{agent-capabilities-B8dQ_ZB8.js → agent-capabilities-CTj-iH2e.js} +1 -1
  51. package/dist/client/assets/agent-connect-sources-CH4TSb8y.js +1 -0
  52. package/dist/client/assets/agent-deck-DCB6fHd3.js +1 -0
  53. package/dist/client/assets/agent-e2e-BTYjDJlF.js +1 -0
  54. package/dist/client/assets/agent-experiments-Cw9pv6Dn.js +1 -0
  55. package/dist/client/assets/agent-file-CTx06rQr.js +1 -0
  56. package/dist/client/assets/agent-hosting-B5D0b6SX.js +1 -0
  57. package/dist/client/assets/agent-icon-CF35JltL.js +1 -0
  58. package/dist/client/assets/agent-library-BwDYP2WG.js +1 -0
  59. package/dist/client/assets/agent-library-file-C81bvh62.js +1 -0
  60. package/dist/client/assets/agent-overview-K-iHxR1q.js +1 -0
  61. package/dist/client/assets/{agent-releases-DxZH4Aop.js → agent-releases-BwmxxOKG.js} +1 -1
  62. package/dist/client/assets/agent-settings-DSkSbN3M.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BVDN7iAe.js → agent-site-editor-AlBg5D2V.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-DKlbc-rv.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-D8oVt80T.js +1 -0
  66. package/dist/client/assets/agent-site-editor-preview-C7REepxK.js +1 -0
  67. package/dist/client/assets/agent-view-B_4cQTkH.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-DgSIx4Rz.js → agent-view-guard-ZsSVHdZf.js} +1 -1
  69. package/dist/client/assets/{ai-providers-BLNPddjm.js → ai-providers-hSqz3WwB.js} +1 -1
  70. package/dist/client/assets/{alert-B3inZFUT.js → alert-DvKjRxar.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-CTzZQv_A.js → analytics-sections-VB2fGveD.js} +1 -1
  72. package/dist/client/assets/api-keys-1OldN0tT.js +1 -0
  73. package/dist/client/assets/{api-keys-D5yeJ96D.js → api-keys-5hVWR6f4.js} +1 -1
  74. package/dist/client/assets/app-editor-CKOA7wEE.js +1 -0
  75. package/dist/client/assets/{asset-utils-FQrgs53r.js → asset-utils-DRModSGS.js} +1 -1
  76. package/dist/client/assets/{auth-DlYbrS5R.js → auth-Ry9WrZV8.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-DovAKkgg.js → auth-catchall-DJ81nN52.js} +1 -1
  78. package/dist/client/assets/{auth-entry-BeARMnxr.js → auth-entry-N3iwaDe6.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-CnJuCNmk.js → auth-split-layout-DRc17L6c.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-Da9zgsaC.js → authenticate-and-persist-oauth-ZYDIddXa.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-Cfemy10y.js → automation-list-row-DW-hLflG.js} +1 -1
  82. package/dist/client/assets/{automation-runs-DhXlimIG.js → automation-runs-Cn3-xcc-.js} +1 -1
  83. package/dist/client/assets/automations-CVx7XBRT.js +1 -0
  84. package/dist/client/assets/{badge-CaU7DsCB.js → badge-CWKaTosK.js} +1 -1
  85. package/dist/client/assets/{block-document-D8KopzHb.js → block-document-DnIO3ig2.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-Rebn6SsT.js → blocks-preview-workspace-context-05h1qBm4.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-CrihrdT0.js → blocks-tab-states-DDvkpFWf.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-DM-lGGhF.js → blog-preview-url-BeobaMnK.js} +1 -1
  89. package/dist/client/assets/{blog-schema-0H53CE3k.js → blog-schema-BMIjJkjY.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-B_GOyP5p.js → blog-source-gate-CTlfDEgd.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-JzJtOYCL.js → blog-view-gate-BUKolpTm.js} +1 -1
  92. package/dist/client/assets/{buckets-CVXQhalH.js → buckets-Cojjk4Rx.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-DgQdPFxI.js → build-improve-prompt-doc-cVHB56V7.js} +1 -1
  94. package/dist/client/assets/{calendar-DZVkXGhA.js → calendar-D3_Is4BX.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-p87qKYlk.js → capability-load-error-l7VKbDu4.js} +1 -1
  96. package/dist/client/assets/category-editor-3t0p_Aia.js +1 -0
  97. package/dist/client/assets/{category-tree-DUNY9TG8.js → category-tree-rhKblFsZ.js} +1 -1
  98. package/dist/client/assets/{chart-D6tXreNC.js → chart-D0JID1mb.js} +1 -1
  99. package/dist/client/assets/{chat-context-DsLpz7ew.js → chat-context-D5EEwp_m.js} +1 -1
  100. package/dist/client/assets/{chat-draft-ODW7kZWh.js → chat-draft-CL1clhIN.js} +1 -1
  101. package/dist/client/assets/{checkbox-Bo6uhaqm.js → checkbox-DHBAzm3e.js} +1 -1
  102. package/dist/client/assets/choose-editor-CluRV_6I.js +1 -0
  103. package/dist/client/assets/{cli-auth-success-1ibs6VjG.js → cli-auth-success-D9loznd0.js} +1 -1
  104. package/dist/client/assets/cms-settings-editor-DY7QQNQD.js +1 -0
  105. package/dist/client/assets/{cms-store-drafts-Da9bgH02.js → cms-store-drafts-BocSU3zl.js} +1 -1
  106. package/dist/client/assets/{collapsible-Cug6Pp5N.js → collapsible-JCTHx5_U.js} +1 -1
  107. package/dist/client/assets/collection-detail-l7ntNzFm.js +1 -0
  108. package/dist/client/assets/{collection-display-button-BeCmwRLy.js → collection-display-button-C6AAIEpT.js} +1 -1
  109. package/dist/client/assets/{collection-search-EKEj7NYh.js → collection-search-Cez2fKoW.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-QVfey_uk.js → collection-table-wrapper-DkyJJZPl.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-THb2ZDUR.js → collection-tabs-D0yQpVJM.js} +1 -1
  112. package/dist/client/assets/{combobox-CkvX9Of3.js → combobox-Dm0ZumLc.js} +1 -1
  113. package/dist/client/assets/{command-BA_BVypg.js → command-CALEDfdi.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-mGMTO-21.js → companion-mcps-section-DyyItakB.js} +1 -1
  115. package/dist/client/assets/{config-DeP83Mjq.js → config-DpuCRGPS.js} +1 -1
  116. package/dist/client/assets/{connect-C-ernj3S.js → connect-DhDiKdM5.js} +3 -3
  117. package/dist/client/assets/{connect-key-B_1YtIEI.js → connect-key-BnZjV7h5.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DhcQffyl.js → connect-layout-DPjmEUCP.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-DXcG_Psx.js → connect-source-dialog-CPF3zqCW.js} +1 -1
  120. package/dist/client/assets/{connection-DUUZ34Ff.js → connection-ByE21sI5.js} +1 -1
  121. package/dist/client/assets/{connection-card-BbAx38kp.js → connection-card-v-6X4qws.js} +1 -1
  122. package/dist/client/assets/connection-detail-DOB5tzOq.js +1 -0
  123. package/dist/client/assets/{connection-form-helpers-DEnW0ORZ.js → connection-form-helpers-BZq0bQw7.js} +1 -1
  124. package/dist/client/assets/{connection-slug-Wiu7W5Ro.js → connection-slug-Cu8poN2f.js} +1 -1
  125. package/dist/client/assets/connections-BshSiFUh.js +1 -0
  126. package/dist/client/assets/content-changes-Yn1NpHw-.js +1 -0
  127. package/dist/client/assets/{content-tab-CJmgvKjP.js → content-tab-BOS9R4w0.js} +3 -3
  128. package/dist/client/assets/context-CSNMIE52.js +1 -0
  129. package/dist/client/assets/{context-menu-BvoelKnM.js → context-menu-DjuEbDwW.js} +1 -1
  130. package/dist/client/assets/{context-shell-BHDXVCRL.js → context-shell-BtuEIN_r.js} +4 -4
  131. package/dist/client/assets/{create-organization-dialog-dpA6uSHX.js → create-organization-dialog-BFbwswlq.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-83GnvMF_.js → daily-pulse-Bg2uZfJ3.js} +1 -1
  133. package/dist/client/assets/{delete-copy-C8ERxzK8.js → delete-copy-CyOQI_UN.js} +1 -1
  134. package/dist/client/assets/{device-hint-5lkWUASQ.js → device-hint-1SWvGp3v.js} +1 -1
  135. package/dist/client/assets/{discover-C9WBot8k.js → discover-DRvYEfga.js} +1 -1
  136. package/dist/client/assets/{domain-settings-C7L5I-Ps.js → domain-settings-kxDrXeNT.js} +1 -1
  137. package/dist/client/assets/{drawer-Daptw1OQ.js → drawer-CLdqPUpZ.js} +1 -1
  138. package/dist/client/assets/{editor-classes-eVnt4vp_.js → editor-classes-C7cnK7Wp.js} +1 -1
  139. package/dist/client/assets/{editor-CGkWZSA7.js → editor-fCTeAQ3h.js} +1 -1
  140. package/dist/client/assets/{empty-state-Dfjwzagg.js → empty-state-BM_yXYSI.js} +1 -1
  141. package/dist/client/assets/{empty-state--1H9mx7y.js → empty-state-CHF2Jno9.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-BVYrDQR_.js → experiments-tab-choice-Bo36uaUs.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-Csm2LLbI.js → extract-connection-data-jy3JaUYJ.js} +1 -1
  144. package/dist/client/assets/{feature-gate-DP0JLkRq.js → feature-gate-CDxHWMHG.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-CuECkoDT.js → feature-paywall-Cc43JNfz.js} +1 -1
  146. package/dist/client/assets/file-explorer-BmZFNSEt.js +2 -0
  147. package/dist/client/assets/{file-preview-J0KlNfCN.js → file-preview-DSlXa64u.js} +1 -1
  148. package/dist/client/assets/{file-share-button-1KUHqOgB.js → file-share-button-mLtJT0f8.js} +2 -2
  149. package/dist/client/assets/{file-type-icon-sxJ1fqoc.js → file-type-icon-CNUBpmBv.js} +1 -1
  150. package/dist/client/assets/{folder-icon-DfGo2fIA.js → folder-icon-Db1WLgp9.js} +1 -1
  151. package/dist/client/assets/{form-msT-Nxjd.js → form-CCzLKFB7.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-COhxs0rP.js → frame-navigation-B4-_qfJ3.js} +1 -1
  153. package/dist/client/assets/{gateway-client-mrWD5tSx.js → gateway-client-Dsg5xVl5.js} +1 -1
  154. package/dist/client/assets/general-DRn37bfZ.js +1 -0
  155. package/dist/client/assets/{github-icon-DGEVXZ8I.js → github-icon-CizbgzyS.js} +1 -1
  156. package/dist/client/assets/{held-block-view-DUdsae86.js → held-block-view-CYXKzDkA.js} +1 -1
  157. package/dist/client/assets/home-BDEWRpho.js +1 -0
  158. package/dist/client/assets/{home-overview-CC9gx7Fg.js → home-overview-Cc5zUwKU.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-DH-KyBYi.js → hosted-reconcile-BT71cbCZ.js} +1 -1
  160. package/dist/client/assets/{icon-button-am6dsn69.js → icon-button-BY-Dtplw.js} +1 -1
  161. package/dist/client/assets/{index-CDpTFqpR.js → index-BKZ2GYzY.js} +1 -1
  162. package/dist/client/assets/{index-DjWhIee5.js → index-Bf_p4D_6.js} +1 -1
  163. package/dist/client/assets/index-C3JbUkAn.js +1 -0
  164. package/dist/client/assets/{index-DgVQUrlP.js → index-C6V-s7Mj.js} +1 -1
  165. package/dist/client/assets/index-C9ybKZad.css +1 -0
  166. package/dist/client/assets/{index-B26uWbt_.js → index-D146A7MA.js} +1 -1
  167. package/dist/client/assets/{index-B2vvUsuK.js → index-D19iAD4s.js} +51 -39
  168. package/dist/client/assets/{index-DeLM7Rkt.js → index-D6VuEonE.js} +1 -1
  169. package/dist/client/assets/{index-4q-RLwEk.js → index-DAZyLaeQ.js} +1 -1
  170. package/dist/client/assets/{index-BYSU1KyF.js → index-DHiZoBJ3.js} +1 -1
  171. package/dist/client/assets/index-DP6ex8je.js +4 -0
  172. package/dist/client/assets/{index-C0WKaVxy.js → index-DS6kB3db.js} +1 -1
  173. package/dist/client/assets/{index-D0GEyG42.js → index-DWF5ASE_.js} +8 -8
  174. package/dist/client/assets/{index-CsQM0oHc.js → index-DX45d0VZ.js} +1 -1
  175. package/dist/client/assets/{index-0yoxovPZ.js → index-DeWoNfZE.js} +1 -1
  176. package/dist/client/assets/{index-D9zWR22g.js → index-DqGbUVIr.js} +2 -2
  177. package/dist/client/assets/{index-D8TuIm4d.js → index-i1TGxsLb.js} +1 -1
  178. package/dist/client/assets/{index-redirect-uY3IN3rF.js → index-redirect-1X0s58OF.js} +1 -1
  179. package/dist/client/assets/{index-C9UqnrNB.js → index-tfWzV95z.js} +1 -1
  180. package/dist/client/assets/{infiniteQueryObserver-B6MEVTvt.js → infiniteQueryObserver-B1MZYli5.js} +1 -1
  181. package/dist/client/assets/{infra-billing-4CjwqMVB.js → infra-billing-CEbGoBzj.js} +1 -1
  182. package/dist/client/assets/{input-Bzo1OCNz.js → input-DER1ofMN.js} +1 -1
  183. package/dist/client/assets/{input-DFHiqhmH.js → input-DUmEmIMD.js} +3 -3
  184. package/dist/client/assets/{integration-icon-DazsuPNm.js → integration-icon-LqaI_LSB.js} +1 -1
  185. package/dist/client/assets/{item-actions-Yc8vcOg0.js → item-actions-BQdANZXs.js} +1 -1
  186. package/dist/client/assets/{jira-icon-CsaUkukk.js → jira-icon-DNsDxAZ7.js} +1 -1
  187. package/dist/client/assets/{label-BLEP0nH0.js → label-B0UwCsXA.js} +1 -1
  188. package/dist/client/assets/{layout-c8-5uC_O.js → layout-CSIaEqJd.js} +1 -1
  189. package/dist/client/assets/{legacy-admin-welcome-dialog-DwTePCPF.js → legacy-admin-welcome-dialog-DgOZFBtI.js} +1 -1
  190. package/dist/client/assets/{legacy-agents-deep-DL8ddlj5.js → legacy-agents-deep-Cx1B7fLu.js} +1 -1
  191. package/dist/client/assets/{legacy-main-redirect-DjX7qNM7.js → legacy-main-redirect-CuOUB_B1.js} +1 -1
  192. package/dist/client/assets/library-B8otmHwX.js +1 -0
  193. package/dist/client/assets/{library-tab-DOE8AqM2.js → library-tab-BwU2UnDE.js} +1 -1
  194. package/dist/client/assets/{login--MYPwAKH.js → login-D7cd9YYg.js} +1 -1
  195. package/dist/client/assets/{markdown-COcXeIyG.js → markdown-BNFJrVwN.js} +1 -1
  196. package/dist/client/assets/{mcp-app-renderer-CDjvP8t9.js → mcp-app-renderer-ChxjPYfG.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-ciX7wK5f.js → mcp-oauth-BHqzrP9l.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-DESKCBIm.js → mcp-oauth-CIbadsEV.js} +1 -1
  199. package/dist/client/assets/{members-DKu_OhY9.js → members-CRNf5jdg.js} +1 -1
  200. package/dist/client/assets/{memory-BL_L-Q3R.js → memory-BtUUGfBH.js} +2 -2
  201. package/dist/client/assets/{mock-board--Ssgy-f6.js → mock-board-CX-WNxEi.js} +3 -3
  202. package/dist/client/assets/{monaco-editor-C0bUrX9K.js → monaco-editor-oNRDmlFg.js} +1 -1
  203. package/dist/client/assets/{monitoring-D8_3FcCV.js → monitoring-DnzPiQ3F.js} +1 -1
  204. package/dist/client/assets/{monitoring-stats-row-L0MR9OOK.js → monitoring-stats-row-eut48zN3.js} +1 -1
  205. package/dist/client/assets/{multi-select-VurXcITl.js → multi-select-CADtUZ9A.js} +1 -1
  206. package/dist/client/assets/{mustache-CSfql4oE.js → mustache-BM5hcjQo.js} +1 -1
  207. package/dist/client/assets/{named-rule-step-BfgtyNIr.js → named-rule-step-jeqaAuBi.js} +1 -1
  208. package/dist/client/assets/named-rule-view-0M7nk7ZR.js +1 -0
  209. package/dist/client/assets/{new-project-dialog-CsFe_Ifg.js → new-project-dialog-TULM28H3.js} +1 -1
  210. package/dist/client/assets/{new-project-store-D3tRl8ms.js → new-project-store-Dkp4wOSi.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-hp7uk30l.js → oauth-callback-D2m0oHFc.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-ai-provider-DYAZYkh4.js → oauth-callback-ai-provider-Cg2K-hUv.js} +1 -1
  213. package/dist/client/assets/{oauth-consent-Buw7iq_C.js → oauth-consent-Cey84Qly.js} +1 -1
  214. package/dist/client/assets/{onboarding-CPK6bWVC.js → onboarding-C5tGxSm3.js} +1 -1
  215. package/dist/client/assets/openai-conversation-Cin6CRLj.js +3 -0
  216. package/dist/client/assets/{optimistic-project-sidebar-views-DWktyZnu.js → optimistic-project-sidebar-views-BwI_h134.js} +1 -1
  217. package/dist/client/assets/{order-monitor-day-lcmZ_W6T.js → order-monitor-day-qB9QL9rR.js} +1 -1
  218. package/dist/client/assets/{organization-choice-5J7_8tx5.js → organization-choice-UcNwkZgV.js} +1 -1
  219. package/dist/client/assets/{orgs-CTAlA2gh.js → orgs-BNCJkrfd.js} +1 -1
  220. package/dist/client/assets/{own-accounts-section-CL-lWHC3.js → own-accounts-section-B_G3r2Ak.js} +1 -1
  221. package/dist/client/assets/{pair-IZ41S3dI.js → pair-DaLtpCvg.js} +8 -8
  222. package/dist/client/assets/{parse-sections-bc3ugIU6.js → parse-sections-BRYcF5X4.js} +3 -3
  223. package/dist/client/assets/plan-BkTiTYLU.js +1 -0
  224. package/dist/client/assets/{plan-ladder-CpzLELQm.js → plan-ladder-DZZeDiD-.js} +1 -1
  225. package/dist/client/assets/{plan-usage-card-Djn1n4Si.js → plan-usage-card-CUEZgkUc.js} +1 -1
  226. package/dist/client/assets/{popover-BN8yB-gL.js → popover-Bm-_ILu8.js} +1 -1
  227. package/dist/client/assets/post-calendar-Dx1uahJO.js +1 -0
  228. package/dist/client/assets/{post-editor-k1GseIfg.js → post-editor-DWqV-Y-J.js} +2 -2
  229. package/dist/client/assets/{preview-content-DrUsIXaL.js → preview-content-DiSiTI85.js} +1 -1
  230. package/dist/client/assets/{preview-dialog-Bl4nn6SJ.js → preview-dialog-BP-VZ8b7.js} +1 -1
  231. package/dist/client/assets/{preview-panel-CPnrD7jy.js → preview-panel-DO2qxYoE.js} +1 -1
  232. package/dist/client/assets/{preview-tab-DJCbL8xU.js → preview-tab-lvMZ2nQh.js} +3 -3
  233. package/dist/client/assets/{primitives-7GEzJciO.js → primitives-DlHl12Ki.js} +1 -1
  234. package/dist/client/assets/{product-picker-dialog-BsLtWfxx.js → product-picker-dialog-2Sh66sGp.js} +1 -1
  235. package/dist/client/assets/{profile-LVIi9kQl.js → profile-C-34uFVs.js} +1 -1
  236. package/dist/client/assets/project-app-view-B1Na7Y2f.js +1 -0
  237. package/dist/client/assets/project-apps-4x8kh2Th.js +1 -0
  238. package/dist/client/assets/{project-icon-NAtCd-2E.js → project-icon-BpBMspxb.js} +1 -1
  239. package/dist/client/assets/{project-index-BDBvdHSq.js → project-index-Dn8Lu82V.js} +1 -1
  240. package/dist/client/assets/project-reports-BKA5CwLs.js +1 -0
  241. package/dist/client/assets/project-tasks-DII3t9E-.js +1 -0
  242. package/dist/client/assets/projects-COEtC32s.js +1 -0
  243. package/dist/client/assets/{projects-empty-state-Bhe-Ul5b.js → projects-empty-state-BaKUbZwF.js} +1 -1
  244. package/dist/client/assets/{prompts-fURd1E3_.js → prompts-BEx4mqMN.js} +1 -1
  245. package/dist/client/assets/record-editor-B5MUcK8d.js +1 -0
  246. package/dist/client/assets/redirect-editor-v_D7tsUa.js +1 -0
  247. package/dist/client/assets/{reports-K6JrO8c3.js → reports-CY9b4q7t.js} +1 -1
  248. package/dist/client/assets/reports-Dc_GbY37.js +1 -0
  249. package/dist/client/assets/reports-onboarding-B78MfFt5.js +1 -0
  250. package/dist/client/assets/reports-tab-DgzPfqIC.js +2 -0
  251. package/dist/client/assets/{repositories-noe5N_6-.js → repositories-BFzOuUP8.js} +1 -1
  252. package/dist/client/assets/repositories-DfE1c4ns.js +1 -0
  253. package/dist/client/assets/{repository-binding-DC98qYdg.js → repository-binding-CP_PNLcQ.js} +1 -1
  254. package/dist/client/assets/{repository-picker-BLhEIBPT.js → repository-picker-DCip0P__.js} +1 -1
  255. package/dist/client/assets/{require-capability-r0eDYoNg.js → require-capability-uCkyxJfa.js} +1 -1
  256. package/dist/client/assets/{required-auth-layout-Dq6PcaGv.js → required-auth-layout-B7e3rkXx.js} +1 -1
  257. package/dist/client/assets/{reset-password-CeDXY3wu.js → reset-password-Bqbu7xzH.js} +1 -1
  258. package/dist/client/assets/{resizable-CDUVHUkS.js → resizable-D75nggzL.js} +1 -1
  259. package/dist/client/assets/resolve-tab-icon-BqdaZDC9.js +1 -0
  260. package/dist/client/assets/review-settings-BU42FIg-.js +1 -0
  261. package/dist/client/assets/{role-color-j5ZAxcKG.js → role-color-CUZgXceG.js} +1 -1
  262. package/dist/client/assets/roles-BhkeI1Tk.js +1 -0
  263. package/dist/client/assets/route-BdFxUFy-.js +1 -0
  264. package/dist/client/assets/route-C_hx8Usp.js +1 -0
  265. package/dist/client/assets/route-CvQ9iNjI.js +1 -0
  266. package/dist/client/assets/{route-page-header-B-0s5BiJ.js → route-page-header-B8C1ZRVD.js} +1 -1
  267. package/dist/client/assets/{sandbox-git-api-CJ3-CkeV.js → sandbox-git-api-B73fIbEU.js} +1 -1
  268. package/dist/client/assets/{sandbox-lifecycle-context-DJVkUHOC.js → sandbox-lifecycle-context-3zZM02yQ.js} +1 -1
  269. package/dist/client/assets/{save-status-5VC4rIi2.js → save-status-5VKYddaB.js} +1 -1
  270. package/dist/client/assets/{schema-B5pk7azZ.js → schema-Bbiw44C-.js} +1 -1
  271. package/dist/client/assets/schema-BmYiAOGn.js +1 -0
  272. package/dist/client/assets/{scroll-area-CXINzzvW.js → scroll-area-ZYmkOMr8.js} +1 -1
  273. package/dist/client/assets/{search-input-Dmx6N7Z7.js → search-input-Dfgi3Bm0.js} +1 -1
  274. package/dist/client/assets/{search-toggle-uhoeAt8V.js → search-toggle-Bt9uO9z1.js} +1 -1
  275. package/dist/client/assets/{secret-picker-CdBDBcEP.js → secret-picker-35tY3ayS.js} +1 -1
  276. package/dist/client/assets/{secrets-DdH9QnxK.js → secrets-CTezjK3j.js} +1 -1
  277. package/dist/client/assets/{section-array-field-RxYDyVUT.js → section-array-field-D3J7UHmj.js} +1 -1
  278. package/dist/client/assets/{sections-CvVT6jo9.js → sections-CsKHN4VK.js} +1 -1
  279. package/dist/client/assets/sections-editor-bf1W6507.js +1 -0
  280. package/dist/client/assets/{select-PhQ1dHUc.js → select-CKa1YoCw.js} +1 -1
  281. package/dist/client/assets/{select-model-DsYbAwnw.js → select-model-BzdKMpAz.js} +1 -1
  282. package/dist/client/assets/{seo-editor-DTf59Uvx.js → seo-editor-RhNyCqwO.js} +1 -1
  283. package/dist/client/assets/{separator-BspBySaE.js → separator-CmEbryS6.js} +1 -1
  284. package/dist/client/assets/{session-runtime-CWUXrNEM.js → session-runtime-DZiu3uM2.js} +1 -1
  285. package/dist/client/assets/settings-tab-DgRCBiDm.js +1 -0
  286. package/dist/client/assets/{sheet-DsBIaG5c.js → sheet-BDbcvRnu.js} +1 -1
  287. package/dist/client/assets/shell-layout-Lgn8VLZ9.js +1 -0
  288. package/dist/client/assets/{site-draft-actions-bEXIW2Ci.js → site-draft-actions-LxERm8rz.js} +5 -5
  289. package/dist/client/assets/{site-draft-view-DL1xS2bS.js → site-draft-view-Dzyq1aKZ.js} +1 -1
  290. package/dist/client/assets/site-editor-DVvyNYht.js +1 -0
  291. package/dist/client/assets/site-editor-toast-QCYxwt4C.js +1 -0
  292. package/dist/client/assets/skills-D2pt05Zp.js +1 -0
  293. package/dist/client/assets/{slider-DiJZup4s.js → slider-B257IOM8.js} +1 -1
  294. package/dist/client/assets/{sortable.esm-AH9TOEe6.js → sortable.esm-6QfVcWZZ.js} +1 -1
  295. package/dist/client/assets/{sso-DJUFzVd6.js → sso-QEHyu29Q.js} +1 -1
  296. package/dist/client/assets/{suggestion-BKU1aw0O.js → suggestion-DXAVxjkm.js} +1 -1
  297. package/dist/client/assets/{super-agent-icon-KeQzZLhO.js → super-agent-icon-Be9GDxp7.js} +1 -1
  298. package/dist/client/assets/{switch-CavZ0Td_.js → switch-DgvZdTyU.js} +1 -1
  299. package/dist/client/assets/{synced-repos-CpobCKuE.js → synced-repos-CsgMx0Ny.js} +1 -1
  300. package/dist/client/assets/{tab-icon-glyph-BQpSs905.js → tab-icon-glyph-UH4S7mUc.js} +1 -1
  301. package/dist/client/assets/{table-_0cphCuz.js → table-ChqekQnS.js} +1 -1
  302. package/dist/client/assets/{tabs-CB9wyI2L.js → tabs-DV8AQUwT.js} +1 -1
  303. package/dist/client/assets/{task-board-DAlkVSdn.js → task-board-DQX_apb8.js} +1 -1
  304. package/dist/client/assets/{task-key-D_de_YB4.js → task-key-rSXWMPFP.js} +1 -1
  305. package/dist/client/assets/{task-route-gaZIOP1Q.js → task-route-KYQNiD-8.js} +1 -1
  306. package/dist/client/assets/{task-status-Dm8lN6h7.js → task-status-CadzUBkc.js} +1 -1
  307. package/dist/client/assets/{taskboard-analytics-BRO72FRF.js → taskboard-analytics-B1Tn3vRG.js} +1 -1
  308. package/dist/client/assets/tasks-BBJAHV_M.js +1 -0
  309. package/dist/client/assets/{tasks-LD7DAdjg.js → tasks-D0Ct-0ZT.js} +1 -1
  310. package/dist/client/assets/{textarea-C5yT2rai.js → textarea-DCWhTUrR.js} +1 -1
  311. package/dist/client/assets/thread-analytics-BXz4d40L.js +1 -0
  312. package/dist/client/assets/{thread-button-jA6lXOHW.js → thread-button-CkP3AL0P.js} +1 -1
  313. package/dist/client/assets/{thread-intent-DC5UuPI5.js → thread-intent-BsMPgCKi.js} +1 -1
  314. package/dist/client/assets/{thread-route-NC2TJMv2.js → thread-route-El3oNOnD.js} +1 -1
  315. package/dist/client/assets/thread-route-wZnmBpi8.js +1 -0
  316. package/dist/client/assets/{thread-sheet-body-BATHVA9a.js → thread-sheet-body-By8H92hw.js} +1 -1
  317. package/dist/client/assets/{time-range-picker-BdF4LahQ.js → time-range-picker-svLFcXAw.js} +1 -1
  318. package/dist/client/assets/{toggle-group-B2L0Fh-A.js → toggle-group-fJYx0W9h.js} +1 -1
  319. package/dist/client/assets/{tool-set-selector-sYj6JiLu.js → tool-set-selector-7nHtwp8O.js} +1 -1
  320. package/dist/client/assets/{toolbar-icon-button-BleYd0k2.js → toolbar-icon-button-DIm3azB_.js} +1 -1
  321. package/dist/client/assets/{tooltip-C0XDZQqg.js → tooltip-B3-v7v0W.js} +1 -1
  322. package/dist/client/assets/{tooltipContext-B5tdv-rH.js → tooltipContext-oNzr-fXK.js} +1 -1
  323. package/dist/client/assets/{track-DkQvKF_r.js → track-C9EcyFLh.js} +1 -1
  324. package/dist/client/assets/{types-BmRTIjW9.js → types-6-Ps6AGR.js} +1 -1
  325. package/dist/client/assets/{url-slug-HTy1TIRr.js → url-slug-3v4BmBw0.js} +1 -1
  326. package/dist/client/assets/{usage-stats-BbuSELy1.js → usage-stats-njGMuDih.js} +1 -1
  327. package/dist/client/assets/{use-ai-providers-CGeOv9zD.js → use-ai-providers-DFv4_P6Z.js} +1 -1
  328. package/dist/client/assets/{use-api-keys-BBDeQmvb.js → use-api-keys-PZMcZPlt.js} +1 -1
  329. package/dist/client/assets/use-apply-named-rule-B8KW11JW.js +1 -0
  330. package/dist/client/assets/use-ask-in-chat-Dxj79lpz.js +1 -0
  331. package/dist/client/assets/{use-automations-UppgD9x4.js → use-automations-DD1lNWAq.js} +1 -1
  332. package/dist/client/assets/{use-autosave-DP-Xo78G.js → use-autosave-DBAueSyZ.js} +1 -1
  333. package/dist/client/assets/use-blocks-v8-project-DjyJGATt.js +1 -0
  334. package/dist/client/assets/use-blog-view-B9cmKJN3.js +1 -0
  335. package/dist/client/assets/{use-chat-layout-state-CYDJQho2.js → use-chat-layout-state-CAIrZGnL.js} +1 -1
  336. package/dist/client/assets/{use-cms-publish-actions-sZFllHA3.js → use-cms-publish-actions-Dq9NhEOB.js} +1 -1
  337. package/dist/client/assets/{use-connect-companion-DM6nloeD.js → use-connect-companion-CLP35iDK.js} +1 -1
  338. package/dist/client/assets/{use-connection-BlQSFvXZ.js → use-connection-CYsyXyy7.js} +1 -1
  339. package/dist/client/assets/{use-content-sync-CmcdSf-W.js → use-content-sync-DWcjd7N0.js} +1 -1
  340. package/dist/client/assets/{use-copy-_EjHpFlu.js → use-copy-BStTcLWM.js} +1 -1
  341. package/dist/client/assets/{use-current-view-DJmYWR9r.js → use-current-view-Cn9H-KAc.js} +1 -1
  342. package/dist/client/assets/{use-date-fns-locale-8kgkXGzy.js → use-date-fns-locale-CSKjWaLe.js} +1 -1
  343. package/dist/client/assets/{use-debounced-autosave-43RSVqCJ.js → use-debounced-autosave-BudnGn2r.js} +1 -1
  344. package/dist/client/assets/{use-debounced-value-CtUf9JOP.js → use-debounced-value-Dcq0NTAp.js} +1 -1
  345. package/dist/client/assets/{use-deco-credits-CrAjq5eE.js → use-deco-credits-D9t5Q-Ms.js} +1 -1
  346. package/dist/client/assets/{use-decopilot-events-CwyVZVbh.js → use-decopilot-events-DsEAOvda.js} +1 -1
  347. package/dist/client/assets/{use-delete-block-CziQYeFw.js → use-delete-block-BZCQAK3P.js} +1 -1
  348. package/dist/client/assets/{use-delete-connection-5KBJh_4H.js → use-delete-connection-CBkpbZja.js} +1 -1
  349. package/dist/client/assets/{use-deployment-admin-vod10AYl.js → use-deployment-admin-HoxFQgZ9.js} +1 -1
  350. package/dist/client/assets/{use-entitlements-D-BsJsBn.js → use-entitlements-BzKQLk_u.js} +1 -1
  351. package/dist/client/assets/{use-fast-preview-draft-url-CTybhvJ7.js → use-fast-preview-draft-url-tiq51pbg.js} +1 -1
  352. package/dist/client/assets/{use-file-configs-zM1_UDsD.js → use-file-configs-Caaj88sr.js} +1 -1
  353. package/dist/client/assets/{use-id-selection-B-V9WQKU.js → use-id-selection-D0jc_Dy0.js} +1 -1
  354. package/dist/client/assets/{use-in-settings-CKmb_d-Z.js → use-in-settings-D-n4dJvM.js} +1 -1
  355. package/dist/client/assets/{use-inbox-feed-BIRoBmxG.js → use-inbox-feed-7Rm2Mjtr.js} +1 -1
  356. package/dist/client/assets/{use-infinite-scroll-D0fDDIyn.js → use-infinite-scroll-f5g_Vpk-.js} +1 -1
  357. package/dist/client/assets/{use-join-requests-C7XAF7yu.js → use-join-requests-Cu6LZvjE.js} +1 -1
  358. package/dist/client/assets/{use-main-panel-tabs-CFBnVDX4.js → use-main-panel-tabs-Ch-_m9wA.js} +1 -1
  359. package/dist/client/assets/{use-mcp-auth-status-Cvpzf8bf.js → use-mcp-auth-status-CrggBiFo.js} +1 -1
  360. package/dist/client/assets/{use-mcp-client-C25DU1dz.js → use-mcp-client-CCT6q-zj.js} +1 -1
  361. package/dist/client/assets/{use-mcp-prompts-DFURxOZn.js → use-mcp-prompts-Bxssn6xT.js} +1 -1
  362. package/dist/client/assets/{use-mcp-tools-DU4EJz2s.js → use-mcp-tools-CdypNtPV.js} +1 -1
  363. package/dist/client/assets/{use-mobile-DFpIEPum.js → use-mobile-Dyvncftm.js} +1 -1
  364. package/dist/client/assets/{use-move-blocks-HLsANXZk.js → use-move-blocks-pw3TQRyc.js} +1 -1
  365. package/dist/client/assets/{use-navigate-to-agent-BGA3nmOF.js → use-navigate-to-agent-0M4hsJnf.js} +1 -1
  366. package/dist/client/assets/{use-never-published-BnWhN5r2.js → use-never-published-BsVhVpS1.js} +1 -1
  367. package/dist/client/assets/{use-org-fs-BrF60Lzy.js → use-org-fs-CyfRrBTl.js} +1 -1
  368. package/dist/client/assets/{use-org-notice-BmwTtllY.js → use-org-notice-BeUR_ZGA.js} +1 -1
  369. package/dist/client/assets/{use-org-repo-syncs-Bi8Ut_qX.js → use-org-repo-syncs-DvcdTgrS.js} +1 -1
  370. package/dist/client/assets/{use-org-sso-CpaEO6G5.js → use-org-sso-BOOKyOjL.js} +1 -1
  371. package/dist/client/assets/use-organization-settings-BEn5xJKT.js +1 -0
  372. package/dist/client/assets/{use-panel-navigate-BvdMbLN8.js → use-panel-navigate-DzpMtCDM.js} +1 -1
  373. package/dist/client/assets/{use-project-native-view-presence-Cj3jJM1f.js → use-project-native-view-presence-D4Mhq-72.js} +1 -1
  374. package/dist/client/assets/{use-project-scope-TiMALD5Y.js → use-project-scope-DdM0t1xa.js} +1 -1
  375. package/dist/client/assets/{use-recent-apps-CAx2Sj77.js → use-recent-apps-BclKHbIs.js} +1 -1
  376. package/dist/client/assets/{use-reports-diagnostic-BWUL8kSa.js → use-reports-diagnostic-BAbQPKnw.js} +1 -1
  377. package/dist/client/assets/use-sandbox-events-CdcsfdkO.js +2 -0
  378. package/dist/client/assets/{use-secrets-DYs_2mJJ.js → use-secrets-LrCR8jto.js} +1 -1
  379. package/dist/client/assets/{use-section-preview-base-bQf9hU5_.js → use-section-preview-base-CiQHlYOM.js} +1 -1
  380. package/dist/client/assets/{use-sidebar-collapsed-Cynyx51j.js → use-sidebar-collapsed-CiqzdmQp.js} +1 -1
  381. package/dist/client/assets/{use-tags-Ds4Jpuu1.js → use-tags-B6rjUKRX.js} +1 -1
  382. package/dist/client/assets/{use-task-board-analytics-5UJcKLaD.js → use-task-board-analytics-B5zThTLs.js} +1 -1
  383. package/dist/client/assets/{use-task-board-item-prs-C0gHPfb5.js → use-task-board-item-prs-QwsxzHpc.js} +1 -1
  384. package/dist/client/assets/{use-task-board-items-osFWr4F_.js → use-task-board-items-B0KeELtH.js} +1 -1
  385. package/dist/client/assets/{use-task-board-prompts-eYQIzP7F.js → use-task-board-prompts-DjkyWndN.js} +1 -1
  386. package/dist/client/assets/{use-task-metadata-DqYio8UA.js → use-task-metadata-DRyTcJBf.js} +1 -1
  387. package/dist/client/assets/{use-thread-outputs-DJQKtV2q.js → use-thread-outputs-U5yvy3ti.js} +1 -1
  388. package/dist/client/assets/{use-view-draft-kind-BYPtD8MA.js → use-view-draft-kind-C2cwPb-d.js} +1 -1
  389. package/dist/client/assets/{use-voice-input-wPU7RMRz.js → use-voice-input-D_lO17n9.js} +1 -1
  390. package/dist/client/assets/useInfiniteQuery-BIIkqC2p.js +1 -0
  391. package/dist/client/assets/{useQueries-DKbjoyEp.js → useQueries-C-94_zeU.js} +1 -1
  392. package/dist/client/assets/useSuspenseInfiniteQuery-B5PirUR6.js +1 -0
  393. package/dist/client/assets/{users-BaX74SiF.js → users-D4cUiO-M.js} +1 -1
  394. package/dist/client/assets/{utils-C8EWsG3o.js → utils-CWN91Q0R.js} +1 -1
  395. package/dist/client/assets/variant-calendar-DHFpb0p3.js +1 -0
  396. package/dist/client/assets/{variant-matcher-override-BsSZ5yFL.js → variant-matcher-override-GbUOkJxx.js} +1 -1
  397. package/dist/client/assets/{view-header-B-qrTWpm.js → view-header-BZNgPIdK.js} +1 -1
  398. package/dist/client/assets/{virtual-mcp-DeWQ4GR6.js → virtual-mcp-jT57t8xN.js} +1 -1
  399. package/dist/client/assets/{watch-sse-pool-DSisQksD.js → watch-sse-pool-CrHa0Ln_.js} +1 -1
  400. package/dist/client/index.html +2 -2
  401. package/dist/server/migrate.js +210 -210
  402. package/dist/server/server.js +693 -693
  403. package/package.json +1 -1
  404. package/dist/client/assets/TrendUp01-Dnr3ECEr.js +0 -1
  405. package/dist/client/assets/agent-app-gA5AyVqP.js +0 -1
  406. package/dist/client/assets/agent-assets-CHRKOS2u.js +0 -1
  407. package/dist/client/assets/agent-automations-VyCqK5Re.js +0 -1
  408. package/dist/client/assets/agent-blog-CZmmsFZV.js +0 -2
  409. package/dist/client/assets/agent-blog-post-CB4b_awk.js +0 -2
  410. package/dist/client/assets/agent-calendar-Cp5T7Qbr.js +0 -1
  411. package/dist/client/assets/agent-connect-sources-BoFtzsla.js +0 -1
  412. package/dist/client/assets/agent-deck-ClKs4ShI.js +0 -1
  413. package/dist/client/assets/agent-e2e-DYM6mhlb.js +0 -1
  414. package/dist/client/assets/agent-experiments-w6nqO2q9.js +0 -1
  415. package/dist/client/assets/agent-file-DrrOEB-e.js +0 -1
  416. package/dist/client/assets/agent-hosting-BSxiIsrn.js +0 -1
  417. package/dist/client/assets/agent-icon-ButaHLCM.js +0 -1
  418. package/dist/client/assets/agent-library-UPbdmbqv.js +0 -1
  419. package/dist/client/assets/agent-library-file-D6WFOASp.js +0 -1
  420. package/dist/client/assets/agent-overview-BYbm2jhI.js +0 -1
  421. package/dist/client/assets/agent-settings-BlXhuK2P.js +0 -1
  422. package/dist/client/assets/agent-site-editor-code-BzxDSxJp.js +0 -2
  423. package/dist/client/assets/agent-site-editor-content-r61QYhf7.js +0 -1
  424. package/dist/client/assets/agent-site-editor-preview-BwuXgbhX.js +0 -1
  425. package/dist/client/assets/agent-view-Ba6W0Fqn.js +0 -1
  426. package/dist/client/assets/api-keys-BxUV6FZ8.js +0 -1
  427. package/dist/client/assets/app-editor-2zianuY6.js +0 -1
  428. package/dist/client/assets/automations-BgwFiPYA.js +0 -1
  429. package/dist/client/assets/category-editor-BEomaUlT.js +0 -1
  430. package/dist/client/assets/choose-editor-CptxA-2o.js +0 -1
  431. package/dist/client/assets/cms-settings-editor-q2PD6d-f.js +0 -1
  432. package/dist/client/assets/collection-detail-BFFv8EBD.js +0 -1
  433. package/dist/client/assets/connection-detail-NnYjF1KC.js +0 -1
  434. package/dist/client/assets/connections-Bs7MQX46.js +0 -1
  435. package/dist/client/assets/context-NTAokEvz.js +0 -1
  436. package/dist/client/assets/file-explorer-_xEpPcaK.js +0 -2
  437. package/dist/client/assets/general-C0agZL75.js +0 -1
  438. package/dist/client/assets/home-b8Q92l_T.js +0 -1
  439. package/dist/client/assets/index-C4wvi2v7.css +0 -1
  440. package/dist/client/assets/index-DETAJcho.js +0 -4
  441. package/dist/client/assets/index-DOrEGYb6.js +0 -1
  442. package/dist/client/assets/library-BD-JkXMr.js +0 -1
  443. package/dist/client/assets/named-rule-view-D1pVQoPd.js +0 -1
  444. package/dist/client/assets/openai-conversation-naly2gFj.js +0 -3
  445. package/dist/client/assets/plan-C-tbQnGr.js +0 -1
  446. package/dist/client/assets/post-calendar-B4Ra6fFT.js +0 -1
  447. package/dist/client/assets/project-app-view-CfT_gJz2.js +0 -1
  448. package/dist/client/assets/project-apps-B5076YmV.js +0 -1
  449. package/dist/client/assets/project-reports-Cc5D1Wqe.js +0 -1
  450. package/dist/client/assets/project-tasks-BzeYrrtq.js +0 -1
  451. package/dist/client/assets/projects-0NQRxQMi.js +0 -1
  452. package/dist/client/assets/record-editor-BiyfqDBa.js +0 -1
  453. package/dist/client/assets/redirect-editor-CysPkosR.js +0 -1
  454. package/dist/client/assets/reports-CuT-F3LQ.js +0 -1
  455. package/dist/client/assets/reports-onboarding-COfLbzIl.js +0 -1
  456. package/dist/client/assets/reports-tab-BNdKCtPv.js +0 -2
  457. package/dist/client/assets/repositories-BcVuKWWr.js +0 -1
  458. package/dist/client/assets/resolve-tab-icon-CCnYS1It.js +0 -1
  459. package/dist/client/assets/review-settings-Cfg9u4wr.js +0 -1
  460. package/dist/client/assets/roles-DNr0gwrs.js +0 -1
  461. package/dist/client/assets/route-Bny9Lc4o.js +0 -1
  462. package/dist/client/assets/route-CpGHqQae.js +0 -1
  463. package/dist/client/assets/route-zFj6XsMD.js +0 -1
  464. package/dist/client/assets/schema-CAZOGJTH.js +0 -1
  465. package/dist/client/assets/sections-editor-FJjN0xqY.js +0 -1
  466. package/dist/client/assets/settings-tab-CoHHJ63I.js +0 -1
  467. package/dist/client/assets/shell-layout-DfpoOTvP.js +0 -1
  468. package/dist/client/assets/site-editor-OTjpPpEJ.js +0 -1
  469. package/dist/client/assets/site-editor-toast-DI5QMuI-.js +0 -1
  470. package/dist/client/assets/skills-sOnNG6z3.js +0 -1
  471. package/dist/client/assets/tasks-BjMbQPZT.js +0 -1
  472. package/dist/client/assets/thread-analytics-TKt2gIA9.js +0 -1
  473. package/dist/client/assets/thread-route-BmXDes0-.js +0 -1
  474. package/dist/client/assets/use-apply-named-rule-c0_gPvLu.js +0 -1
  475. package/dist/client/assets/use-ask-in-chat-DQt8TEjL.js +0 -1
  476. package/dist/client/assets/use-blocks-v8-project-BzyehgAq.js +0 -1
  477. package/dist/client/assets/use-blog-view-BPx89KE1.js +0 -1
  478. package/dist/client/assets/use-organization-settings-CeyizmcT.js +0 -1
  479. package/dist/client/assets/use-sandbox-events-CrjWSBYb.js +0 -2
  480. package/dist/client/assets/useInfiniteQuery-EaWUgCtN.js +0 -1
  481. package/dist/client/assets/useSuspenseInfiniteQuery-D-KEcWQs.js +0 -1
  482. package/dist/client/assets/variant-calendar-56I1fIKh.js +0 -1
@@ -1 +1 @@
1
- import{a6 as C,am as I,i as g,K,r as S,E as b}from"./index-B2vvUsuK.js";import{u as m}from"./use-ai-providers-CGeOv9zD.js";const a=new Map;function R(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{R as u};
1
+ import{a6 as C,am as I,i as g,K,r as S,E as b}from"./index-D19iAD4s.js";import{u as m}from"./use-ai-providers-DFv4_P6Z.js";const a=new Map;function R(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{R as u};
@@ -1 +1 @@
1
- import{r as n}from"./index-B2vvUsuK.js";import{k as h}from"./thread-intent-DC5UuPI5.js";import{D as u}from"./watch-sse-pool-DSisQksD.js";const k=()=>0;function v(E){const{orgSlug:t,taskId:a,enabled:s=!0,onStep:S,onFinish:i,onTaskStatus:p,onReconnect:f}=E,c=n.useRef({taskId:a,onStep:S,onFinish:i,onTaskStatus:p,onReconnect:f});c.current={taskId:a,onStep:S,onFinish:i,onTaskStatus:p,onReconnect:f};const o=n.useRef(null),l=n.useRef(s),b=n.useRef(t);(!o.current||l.current!==s||b.current!==t)&&(l.current=s,b.current=t,o.current=R=>{if(!s||!t)return()=>{};const d=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=c.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}R()}};return h.subscribe(t,d,()=>c.current.onReconnect?.())}),n.useSyncExternalStore(o.current,k,k)}export{v as u};
1
+ import{r as n}from"./index-D19iAD4s.js";import{k as h}from"./thread-intent-BsMPgCKi.js";import{D as u}from"./watch-sse-pool-CrHa0Ln_.js";const k=()=>0;function v(E){const{orgSlug:t,taskId:a,enabled:s=!0,onStep:S,onFinish:i,onTaskStatus:p,onReconnect:f}=E,c=n.useRef({taskId:a,onStep:S,onFinish:i,onTaskStatus:p,onReconnect:f});c.current={taskId:a,onStep:S,onFinish:i,onTaskStatus:p,onReconnect:f};const o=n.useRef(null),l=n.useRef(s),b=n.useRef(t);(!o.current||l.current!==s||b.current!==t)&&(l.current=s,b.current=t,o.current=R=>{if(!s||!t)return()=>{};const d=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=c.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}R()}};return h.subscribe(t,d,()=>c.current.onReconnect?.())}),n.useSyncExternalStore(o.current,k,k)}export{v as u};
@@ -1 +1 @@
1
- import{q as Q,b as q,e as v,K as l}from"./index-B2vvUsuK.js";import{u as E}from"./use-voice-input-wPU7RMRz.js";import{x as T,c as x,u as B,v as H,aq as U,as as j,au as A,aF as F,aj as O,ax as R,Z as V,X as W,Y as L,aE as Y,aD as G,y as J,$ as N}from"./site-editor-toast-DI5QMuI-.js";import{s as X}from"./sandbox-git-api-CJ3-CkeV.js";import{u as Z}from"./chat-context-DsLpz7ew.js";import{i as $,H as z}from"./hosted-reconcile-DH-KyBYi.js";import{k as S}from"./use-never-published-BnWhN5r2.js";import{b}from"./sandbox-url-D3mC8qhT.js";import{d as g}from"./utils-C8EWsG3o.js";function re({orgSlug:i,virtualMcpId:s,branch:o}){const n=Q(),p=Z()?.taskId??null,w=T(s),K=E(s).runtime==="cms",{url:P}=x(s),u=B(s,o),c=u.kind==="protocol"?u:null,f=H({orgSlug:i,virtualMcpId:s,branch:o}),C=async e=>{if(P)return{ok:!0,existed:!0};if(K){const r=await Y({orgSlug:i,virtualMcpId:s,branch:o},{delete:[e]});return G(n,{orgSlug:i,virtualMcpId:s,branch:o},r),await n.invalidateQueries({queryKey:X({orgSlug:i,virtualMcpId:s,branch:o,threadId:p})}),{ok:!0,existed:!0}}const t=J(w,g(e)),a=await fetch(b({orgSlug:i,virtualMcpId:s,branch:o,threadId:p},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t})});return a.ok?a.json():N(a,"Delete")},h=q(),y=v({mutationKey:L(i,s,o),scope:W(i,s,o),mutationFn:async({blockKey:e,base:t,shown:a})=>{if(u.kind==="pending"||u.kind==="unavailable")throw O("CMS storage");if(c?.source==="github"){const r=a?.();try{await $({queryClient:n,backend:c,params:{orgSlug:i,virtualMcpId:s,branch:o},cacheKey:f},{writes:{},deletes:[e]},t&&t.value!==void 0?{[e]:t.value}:void 0,r&&r.value!==void 0?{[e]:r}:void 0)}catch(d){if(d instanceof z)return{keptTheirs:!0,deleted:!1};throw d}return{ok:!0,existed:!0}}return c?(await R(n,c,{orgSlug:i,virtualMcpId:s,branch:o},f,{delete:[e]}),{ok:!0,existed:!0}):V({queryClient:n,orgSlug:i,virtualMcpId:s,branch:o,backend:u,cacheKey:f},{kind:"edit",write:()=>C(e)})},onMutate:async({blockKey:e})=>{const t=l.decofile(f);await n.cancelQueries({queryKey:t});const a=n.getQueryData(t),r=!!a&&e in a,d=a?.[e];return n.setQueryData(t,m=>{if(!m)return m;const{[e]:_,...D}=m;return D}),{queryKey:t,blockKey:e,hadKey:r,previousValue:d}},onError:(e,t,a)=>{j(h,e),a&&(c?.source==="github"&&(A(e)||e instanceof F)||n.setQueryData(a.queryKey,r=>a.hadKey?{...r??{},[a.blockKey]:a.previousValue}:r))},onSuccess:e=>{if(S(e)){U(h,!1);return}n.invalidateQueries({queryKey:l.liveMeta(i,s,o)})}}),k=e=>{if(e.base)return e;const t=n.getQueryData(l.decofile(f));return t?{...e,base:{value:t[e.blockKey]}}:e};return{...y,mutate:(e,t)=>y.mutate(k(e),t),mutateAsync:(e,t)=>y.mutateAsync(k(e),t)}}export{re as u};
1
+ import{q as Q,b as q,e as v,K as l}from"./index-D19iAD4s.js";import{u as E}from"./use-voice-input-D_lO17n9.js";import{x as T,c as x,u as B,v as H,aq as U,as as j,au as A,aF as F,aj as O,ax as R,Z as V,X as W,Y as L,aE as Y,aD as G,y as J,$ as N}from"./site-editor-toast-QCYxwt4C.js";import{s as X}from"./sandbox-git-api-B73fIbEU.js";import{u as Z}from"./chat-context-D5EEwp_m.js";import{i as $,H as z}from"./hosted-reconcile-BT71cbCZ.js";import{k as S}from"./use-never-published-BsVhVpS1.js";import{b}from"./sandbox-url-D3mC8qhT.js";import{d as g}from"./utils-CWN91Q0R.js";function re({orgSlug:i,virtualMcpId:s,branch:o}){const n=Q(),p=Z()?.taskId??null,w=T(s),K=E(s).runtime==="cms",{url:P}=x(s),u=B(s,o),c=u.kind==="protocol"?u:null,f=H({orgSlug:i,virtualMcpId:s,branch:o}),C=async e=>{if(P)return{ok:!0,existed:!0};if(K){const r=await Y({orgSlug:i,virtualMcpId:s,branch:o},{delete:[e]});return G(n,{orgSlug:i,virtualMcpId:s,branch:o},r),await n.invalidateQueries({queryKey:X({orgSlug:i,virtualMcpId:s,branch:o,threadId:p})}),{ok:!0,existed:!0}}const t=J(w,g(e)),a=await fetch(b({orgSlug:i,virtualMcpId:s,branch:o,threadId:p},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t})});return a.ok?a.json():N(a,"Delete")},h=q(),y=v({mutationKey:L(i,s,o),scope:W(i,s,o),mutationFn:async({blockKey:e,base:t,shown:a})=>{if(u.kind==="pending"||u.kind==="unavailable")throw O("CMS storage");if(c?.source==="github"){const r=a?.();try{await $({queryClient:n,backend:c,params:{orgSlug:i,virtualMcpId:s,branch:o},cacheKey:f},{writes:{},deletes:[e]},t&&t.value!==void 0?{[e]:t.value}:void 0,r&&r.value!==void 0?{[e]:r}:void 0)}catch(d){if(d instanceof z)return{keptTheirs:!0,deleted:!1};throw d}return{ok:!0,existed:!0}}return c?(await R(n,c,{orgSlug:i,virtualMcpId:s,branch:o},f,{delete:[e]}),{ok:!0,existed:!0}):V({queryClient:n,orgSlug:i,virtualMcpId:s,branch:o,backend:u,cacheKey:f},{kind:"edit",write:()=>C(e)})},onMutate:async({blockKey:e})=>{const t=l.decofile(f);await n.cancelQueries({queryKey:t});const a=n.getQueryData(t),r=!!a&&e in a,d=a?.[e];return n.setQueryData(t,m=>{if(!m)return m;const{[e]:_,...D}=m;return D}),{queryKey:t,blockKey:e,hadKey:r,previousValue:d}},onError:(e,t,a)=>{j(h,e),a&&(c?.source==="github"&&(A(e)||e instanceof F)||n.setQueryData(a.queryKey,r=>a.hadKey?{...r??{},[a.blockKey]:a.previousValue}:r))},onSuccess:e=>{if(S(e)){U(h,!1);return}n.invalidateQueries({queryKey:l.liveMeta(i,s,o)})}}),k=e=>{if(e.base)return e;const t=n.getQueryData(l.decofile(f));return t?{...e,base:{value:t[e.blockKey]}}:e};return{...y,mutate:(e,t)=>y.mutate(k(e),t),mutateAsync:(e,t)=>y.mutateAsync(k(e),t)}}export{re as u};
@@ -1 +1 @@
1
- import{c as le,b as oe,j as n,aJ as z,aK as G,aL as V,aM as X,b9 as Z,aN as ee,aO as te,aP as ne,a6 as se,q as ie,am as ce,r as re,t as Y,go as ae,i2 as de,i3 as me}from"./index-B2vvUsuK.js";function ge(P){const e=le.c(86),{deleteState:s,cancelDelete:r,confirmDelete:D,confirmForceDelete:a}=P,t=oe(),k=s.mode==="deleting";let m;e[0]!==r?(m=W=>{W||r()},e[0]=r,e[1]=m):m=e[1];let d;e[2]!==t?(d=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=d):d=e[3];let C;e[4]!==d?(C=n.jsx(z,{children:d}),e[4]=d,e[5]=C):C=e[5];let u;e[6]!==t?(u=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=u):u=e[7];const J=s.mode==="deleting"&&s.connection.title;let x;e[8]!==J?(x=n.jsx("span",{className:"font-medium text-foreground",children:J}),e[8]=J,e[9]=x):x=e[9];let o;e[10]!==u||e[11]!==x?(o=n.jsxs(G,{children:[u," ",x,"."]}),e[10]=u,e[11]=x,e[12]=o):o=e[12];let l;e[13]!==C||e[14]!==o?(l=n.jsxs(V,{children:[C,o]}),e[13]=C,e[14]=o,e[15]=l):l=e[15];let i;e[16]!==t?(i=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=i):i=e[17];let f;e[18]!==i?(f=n.jsx(X,{children:i}),e[18]=i,e[19]=f):f=e[19];let c;e[20]!==t?(c=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=c):c=e[21];let g;e[22]!==D||e[23]!==c?(g=n.jsx(Z,{onClick:D,variant:"destructive",children:c}),e[22]=D,e[23]=c,e[24]=g):g=e[24];let h;e[25]!==f||e[26]!==g?(h=n.jsxs(ee,{children:[f,g]}),e[25]=f,e[26]=g,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==l?(j=n.jsxs(te,{children:[l,h]}),e[28]=h,e[29]=l,e[30]=j):j=e[30];let p;e[31]!==k||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:k,onOpenChange:m,children:j}),e[31]=k,e[32]=j,e[33]=m,e[34]=p):p=e[34];const Q=s.mode==="force-deleting";let N;e[35]!==r?(N=W=>{W||r()},e[35]=r,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let O;e[39]!==E?(O=n.jsx(z,{children:E}),e[39]=E,e[40]=O):O=e[40];let T;e[41]!==t?(T=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=T):T=e[42];const $=s.mode==="force-deleting"&&s.connection.title;let y;e[43]!==$?(y=n.jsx("span",{className:"font-medium text-foreground",children:$}),e[43]=$,e[44]=y):y=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const B=s.mode==="force-deleting"&&s.agentNames;let _;e[47]!==B?(_=n.jsx("span",{className:"font-medium text-foreground",children:B}),e[47]=B,e[48]=_):_=e[48];let A;e[49]!==T||e[50]!==y||e[51]!==S||e[52]!==_?(A=n.jsxs("p",{children:[T," ",y," ",S," ",_,"."]}),e[49]=T,e[50]=y,e[51]=S,e[52]=_,e[53]=A):A=e[53];let v;e[54]!==t?(v=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=v):v=e[55];let L;e[56]!==v?(L=n.jsx("p",{className:"mt-2",children:v}),e[56]=v,e[57]=L):L=e[57];let F;e[58]!==A||e[59]!==L?(F=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,L]})}),e[58]=A,e[59]=L,e[60]=F):F=e[60];let I;e[61]!==O||e[62]!==F?(I=n.jsxs(V,{children:[O,F]}),e[61]=O,e[62]=F,e[63]=I):I=e[63];let R;e[64]!==t?(R=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=R):R=e[65];let q;e[66]!==R?(q=n.jsx(X,{children:R}),e[66]=R,e[67]=q):q=e[67];let U;e[68]!==t?(U=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=U):U=e[69];let K;e[70]!==a||e[71]!==U?(K=n.jsx(Z,{onClick:a,variant:"destructive",children:U}),e[70]=a,e[71]=U,e[72]=K):K=e[72];let w;e[73]!==q||e[74]!==K?(w=n.jsxs(ee,{children:[q,K]}),e[73]=q,e[74]=K,e[75]=w):w=e[75];let H;e[76]!==I||e[77]!==w?(H=n.jsxs(te,{children:[I,w]}),e[76]=I,e[77]=w,e[78]=H):H=e[78];let b;e[79]!==Q||e[80]!==N||e[81]!==H?(b=n.jsx(ne,{open:Q,onOpenChange:N,children:H}),e[79]=Q,e[80]=N,e[81]=H,e[82]=b):b=e[82];let M;return e[83]!==p||e[84]!==b?(M=n.jsxs(n.Fragment,{children:[p,b]}),e[83]=p,e[84]=b,e[85]=M):M=e[85],M}function De({onSuccess:P}={}){const{org:e}=se(),s=ie(),r=ce(),D=oe(),[a,t]=re.useState({mode:"idle"}),k=()=>{ae(s,e.id)},m=o=>{de(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===me&&l.queryKey[3]===o})},d=o=>{k(),m(o),Y.success(D("orgs.connections.connectionDeleted")),t({mode:"idle"}),P?.()};return{deleteState:a,requestDelete:o=>{t({mode:"deleting",connection:o})},cancelDelete:()=>{t({mode:"idle"})},confirmDelete:async()=>{if(a.mode!=="deleting")return;const o=a.connection;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),d(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const c=JSON.parse(f);if(c.code==="CONNECTION_IN_USE"&&c.agentNames){t({mode:"force-deleting",connection:o,agentNames:c.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}},confirmForceDelete:async()=>{if(a.mode!=="force-deleting")return;const o=a.connection.id;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),d(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}}}}export{ge as D,De as u};
1
+ import{c as le,b as oe,j as n,aJ as z,aK as G,aL as V,aM as X,b9 as Z,aN as ee,aO as te,aP as ne,a6 as se,q as ie,am as ce,r as re,t as Y,go as ae,i2 as de,i3 as me}from"./index-D19iAD4s.js";function ge(P){const e=le.c(86),{deleteState:s,cancelDelete:r,confirmDelete:D,confirmForceDelete:a}=P,t=oe(),k=s.mode==="deleting";let m;e[0]!==r?(m=W=>{W||r()},e[0]=r,e[1]=m):m=e[1];let d;e[2]!==t?(d=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=d):d=e[3];let C;e[4]!==d?(C=n.jsx(z,{children:d}),e[4]=d,e[5]=C):C=e[5];let u;e[6]!==t?(u=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=u):u=e[7];const J=s.mode==="deleting"&&s.connection.title;let x;e[8]!==J?(x=n.jsx("span",{className:"font-medium text-foreground",children:J}),e[8]=J,e[9]=x):x=e[9];let o;e[10]!==u||e[11]!==x?(o=n.jsxs(G,{children:[u," ",x,"."]}),e[10]=u,e[11]=x,e[12]=o):o=e[12];let l;e[13]!==C||e[14]!==o?(l=n.jsxs(V,{children:[C,o]}),e[13]=C,e[14]=o,e[15]=l):l=e[15];let i;e[16]!==t?(i=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=i):i=e[17];let f;e[18]!==i?(f=n.jsx(X,{children:i}),e[18]=i,e[19]=f):f=e[19];let c;e[20]!==t?(c=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=c):c=e[21];let g;e[22]!==D||e[23]!==c?(g=n.jsx(Z,{onClick:D,variant:"destructive",children:c}),e[22]=D,e[23]=c,e[24]=g):g=e[24];let h;e[25]!==f||e[26]!==g?(h=n.jsxs(ee,{children:[f,g]}),e[25]=f,e[26]=g,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==l?(j=n.jsxs(te,{children:[l,h]}),e[28]=h,e[29]=l,e[30]=j):j=e[30];let p;e[31]!==k||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:k,onOpenChange:m,children:j}),e[31]=k,e[32]=j,e[33]=m,e[34]=p):p=e[34];const Q=s.mode==="force-deleting";let N;e[35]!==r?(N=W=>{W||r()},e[35]=r,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let O;e[39]!==E?(O=n.jsx(z,{children:E}),e[39]=E,e[40]=O):O=e[40];let T;e[41]!==t?(T=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=T):T=e[42];const $=s.mode==="force-deleting"&&s.connection.title;let y;e[43]!==$?(y=n.jsx("span",{className:"font-medium text-foreground",children:$}),e[43]=$,e[44]=y):y=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const B=s.mode==="force-deleting"&&s.agentNames;let _;e[47]!==B?(_=n.jsx("span",{className:"font-medium text-foreground",children:B}),e[47]=B,e[48]=_):_=e[48];let A;e[49]!==T||e[50]!==y||e[51]!==S||e[52]!==_?(A=n.jsxs("p",{children:[T," ",y," ",S," ",_,"."]}),e[49]=T,e[50]=y,e[51]=S,e[52]=_,e[53]=A):A=e[53];let v;e[54]!==t?(v=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=v):v=e[55];let L;e[56]!==v?(L=n.jsx("p",{className:"mt-2",children:v}),e[56]=v,e[57]=L):L=e[57];let F;e[58]!==A||e[59]!==L?(F=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,L]})}),e[58]=A,e[59]=L,e[60]=F):F=e[60];let I;e[61]!==O||e[62]!==F?(I=n.jsxs(V,{children:[O,F]}),e[61]=O,e[62]=F,e[63]=I):I=e[63];let R;e[64]!==t?(R=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=R):R=e[65];let q;e[66]!==R?(q=n.jsx(X,{children:R}),e[66]=R,e[67]=q):q=e[67];let U;e[68]!==t?(U=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=U):U=e[69];let K;e[70]!==a||e[71]!==U?(K=n.jsx(Z,{onClick:a,variant:"destructive",children:U}),e[70]=a,e[71]=U,e[72]=K):K=e[72];let w;e[73]!==q||e[74]!==K?(w=n.jsxs(ee,{children:[q,K]}),e[73]=q,e[74]=K,e[75]=w):w=e[75];let H;e[76]!==I||e[77]!==w?(H=n.jsxs(te,{children:[I,w]}),e[76]=I,e[77]=w,e[78]=H):H=e[78];let b;e[79]!==Q||e[80]!==N||e[81]!==H?(b=n.jsx(ne,{open:Q,onOpenChange:N,children:H}),e[79]=Q,e[80]=N,e[81]=H,e[82]=b):b=e[82];let M;return e[83]!==p||e[84]!==b?(M=n.jsxs(n.Fragment,{children:[p,b]}),e[83]=p,e[84]=b,e[85]=M):M=e[85],M}function De({onSuccess:P}={}){const{org:e}=se(),s=ie(),r=ce(),D=oe(),[a,t]=re.useState({mode:"idle"}),k=()=>{ae(s,e.id)},m=o=>{de(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===me&&l.queryKey[3]===o})},d=o=>{k(),m(o),Y.success(D("orgs.connections.connectionDeleted")),t({mode:"idle"}),P?.()};return{deleteState:a,requestDelete:o=>{t({mode:"deleting",connection:o})},cancelDelete:()=>{t({mode:"idle"})},confirmDelete:async()=>{if(a.mode!=="deleting")return;const o=a.connection;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),d(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const c=JSON.parse(f);if(c.code==="CONNECTION_IN_USE"&&c.agentNames){t({mode:"force-deleting",connection:o,agentNames:c.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}},confirmForceDelete:async()=>{if(a.mode!=="force-deleting")return;const o=a.connection.id;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),d(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}}}}export{ge as D,De as u};
@@ -1 +1 @@
1
- import{c as s,i as m,K as c}from"./index-B2vvUsuK.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:n}=m(t),r=a==="admin",o=a==="unverified";let i;return e[1]!==n||e[2]!==r||e[3]!==o?(i={isAdmin:r,loading:n,needsEmailVerification:o},e[1]=n,e[2]=r,e[3]=o,e[4]=i):i=e[4],i}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
1
+ import{c as s,i as m,K as c}from"./index-D19iAD4s.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:n}=m(t),r=a==="admin",o=a==="unverified";let i;return e[1]!==n||e[2]!==r||e[3]!==o?(i={isAdmin:r,loading:n,needsEmailVerification:o},e[1]=n,e[2]=r,e[3]=o,e[4]=i):i=e[4],i}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
@@ -1 +1 @@
1
- import{c,dI as f,K as d,i as g,eG as m,an as E}from"./index-B2vvUsuK.js";const p=1e6;function S(e,t,s){s>0&&e.setQueryData(d.aiPlanEntitlements(t),i=>{if(!i?.usage)return i;const n=i.usage;if(!n.limitMicros||n.usedMicros===null)return i;const u=n.usedMicros+s*p,r=Math.min(1,u/n.limitMicros);return{...i,usage:{...n,usedMicros:u,percent:r,state:r>=1?"exhausted":r>=.8?"warn":"ok"}}})}function l(){return m()?.plansEnabled===!0}function o(){const e=c.c(8),t=f(),s=t?.org.slug,i=l();let n;e[0]!==t?.org.id?(n=d.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=n):n=e[1];const u=!!s&&i;let r;e[2]!==s?(r=()=>E(s,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=s,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==u||e[6]!==r?(a={queryKey:n,enabled:u,staleTime:6e4,retry:1,queryFn:r},e[4]=n,e[5]=u,e[6]=r,e[7]=a):a=e[7],g(a)}function P(e){const{data:t}=o();return!e||!t?!0:t.features[e]===!0}function h(){const e=l(),{isPending:t,fetchStatus:s}=o();return!e||s==="idle"||s==="paused"?!0:!t}function x(){const e=c.c(4),t=l(),{isSuccess:s,data:i}=o(),n=i?.features?.model_choice;let u;return e[0]!==s||e[1]!==t||e[2]!==n?(u=b({plansEnabled:t,isSuccess:s,modelChoice:n}),e[0]=s,e[1]=t,e[2]=n,e[3]=u):u=e[3],u}function b({plansEnabled:e,isSuccess:t,modelChoice:s}){return e?t&&s===!0:!0}function y(){const{data:e}=o();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}export{o as a,x as b,S as c,P as d,h as e,y as f,l as u};
1
+ import{c,dI as f,K as d,i as g,eG as m,an as E}from"./index-D19iAD4s.js";const p=1e6;function S(e,t,s){s>0&&e.setQueryData(d.aiPlanEntitlements(t),i=>{if(!i?.usage)return i;const n=i.usage;if(!n.limitMicros||n.usedMicros===null)return i;const u=n.usedMicros+s*p,r=Math.min(1,u/n.limitMicros);return{...i,usage:{...n,usedMicros:u,percent:r,state:r>=1?"exhausted":r>=.8?"warn":"ok"}}})}function l(){return m()?.plansEnabled===!0}function o(){const e=c.c(8),t=f(),s=t?.org.slug,i=l();let n;e[0]!==t?.org.id?(n=d.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=n):n=e[1];const u=!!s&&i;let r;e[2]!==s?(r=()=>E(s,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=s,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==u||e[6]!==r?(a={queryKey:n,enabled:u,staleTime:6e4,retry:1,queryFn:r},e[4]=n,e[5]=u,e[6]=r,e[7]=a):a=e[7],g(a)}function P(e){const{data:t}=o();return!e||!t?!0:t.features[e]===!0}function h(){const e=l(),{isPending:t,fetchStatus:s}=o();return!e||s==="idle"||s==="paused"?!0:!t}function x(){const e=c.c(4),t=l(),{isSuccess:s,data:i}=o(),n=i?.features?.model_choice;let u;return e[0]!==s||e[1]!==t||e[2]!==n?(u=b({plansEnabled:t,isSuccess:s,modelChoice:n}),e[0]=s,e[1]=t,e[2]=n,e[3]=u):u=e[3],u}function b({plansEnabled:e,isSuccess:t,modelChoice:s}){return e?t&&s===!0:!0}function y(){const{data:e}=o();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}export{o as a,x as b,S as c,P as d,h as e,y as f,l as u};
@@ -1 +1 @@
1
- import{c as s}from"./index-B2vvUsuK.js";import{u as v,H as g,ae as h,aG as b,aH as P,aI as S,N as w}from"./site-editor-toast-DI5QMuI-.js";import{u as D}from"./use-voice-input-wPU7RMRz.js";function d(e){const t=s.c(3),u=D(e?.virtualMcpId).runtime==="cms",l=v(e?.virtualMcpId,e?.branch),o=l.kind==="protocol"&&l.source==="github",n=b(e),c=P(o?e:null);if(!e||!u)return null;if(o)return c;let i;return t[0]!==n||t[1]!==e?(i=n?S({...e,...n}):null,t[0]=n,t[1]=e,t[2]=i):i=t[2],i}function U(e){const t=s.c(3),u=d(e),l=v(e.virtualMcpId,e.branch),o=l.kind==="protocol"&&l.source==="github";let n;t[0]!==e.orgSlug||t[1]!==e.virtualMcpId?(n=g(e.orgSlug,e.virtualMcpId),t[0]=e.orgSlug,t[1]=e.virtualMcpId,t[2]=n):n=t[2];const c=h(n,o?u:null);return o?c:u}function R(e){const t=s.c(11);let u;t[0]!==e?(u=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=u):u=t[1];const l=d(u),o=e?.previewServerUrl??null;let n=null;if(o)try{let f;t[2]!==o?(f=new URL(o),t[2]=o,t[3]=f):f=t[3],n=f.host}catch{n=null}let c;t[4]!==l||t[5]!==e||t[6]!==o?(c=e&&o&&l?w(new URL(e.path,o).toString(),l):null,t[4]=l,t[5]=e,t[6]=o,t[7]=c):c=t[7];const i=c;let r;return t[8]!==n||t[9]!==i?(r={url:i,host:n},t[8]=n,t[9]=i,t[10]=r):r=t[10],r}export{R as a,d as b,U as u};
1
+ import{c as s}from"./index-D19iAD4s.js";import{u as v,H as g,ae as h,aG as b,aH as P,aI as S,N as w}from"./site-editor-toast-QCYxwt4C.js";import{u as D}from"./use-voice-input-D_lO17n9.js";function d(e){const t=s.c(3),u=D(e?.virtualMcpId).runtime==="cms",l=v(e?.virtualMcpId,e?.branch),o=l.kind==="protocol"&&l.source==="github",n=b(e),c=P(o?e:null);if(!e||!u)return null;if(o)return c;let i;return t[0]!==n||t[1]!==e?(i=n?S({...e,...n}):null,t[0]=n,t[1]=e,t[2]=i):i=t[2],i}function U(e){const t=s.c(3),u=d(e),l=v(e.virtualMcpId,e.branch),o=l.kind==="protocol"&&l.source==="github";let n;t[0]!==e.orgSlug||t[1]!==e.virtualMcpId?(n=g(e.orgSlug,e.virtualMcpId),t[0]=e.orgSlug,t[1]=e.virtualMcpId,t[2]=n):n=t[2];const c=h(n,o?u:null);return o?c:u}function R(e){const t=s.c(11);let u;t[0]!==e?(u=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=u):u=t[1];const l=d(u),o=e?.previewServerUrl??null;let n=null;if(o)try{let f;t[2]!==o?(f=new URL(o),t[2]=o,t[3]=f):f=t[3],n=f.host}catch{n=null}let c;t[4]!==l||t[5]!==e||t[6]!==o?(c=e&&o&&l?w(new URL(e.path,o).toString(),l):null,t[4]=l,t[5]=e,t[6]=o,t[7]=c):c=t[7];const i=c;let r;return t[8]!==n||t[9]!==i?(r={url:i,host:n},t[8]=n,t[9]=i,t[10]=r):r=t[10],r}export{R as a,d as b,U as u};
@@ -1 +1 @@
1
- import{c as r,a6 as f,am as d,K as C,i as E,V as I,q as F,e as g}from"./index-B2vvUsuK.js";function q(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{q as a,L as b,S as c,_ as u};
1
+ import{c as r,a6 as f,am as d,K as C,i as E,V as I,q as F,e as g}from"./index-D19iAD4s.js";function q(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{q as a,L as b,S as c,_ as u};
@@ -1 +1 @@
1
- import{c as x,r as I}from"./index-B2vvUsuK.js";function m(n){const e=x.c(15),[s,r]=I.useState(null);let d;e[0]!==n||e[1]!==s?(d=s!==null?n.findIndex(l=>l.id===s):-1,e[0]=n,e[1]=s,e[2]=d):d=e[2];const t=d,i=t!==-1?n[t]:null,a=i!==null;let u,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l=>r(l),f=()=>r(null),e[3]=u,e[4]=f):(u=e[3],f=e[4]);let c,o;e[5]!==t||e[6]!==n?(c=()=>{const l=n[t-1];t>0&&l&&r(l.id)},o=()=>{const l=n[t+1];t!==-1&&l&&r(l.id)},e[5]=t,e[6]=n,e[7]=c,e[8]=o):(c=e[7],o=e[8]);let p;return e[9]!==t||e[10]!==i||e[11]!==a||e[12]!==c||e[13]!==o?(p={selected:i,index:t,isOpen:a,select:u,close:f,prev:c,next:o},e[9]=t,e[10]=i,e[11]=a,e[12]=c,e[13]=o,e[14]=p):p=e[14],p}export{m as u};
1
+ import{c as x,r as I}from"./index-D19iAD4s.js";function m(n){const e=x.c(15),[s,r]=I.useState(null);let d;e[0]!==n||e[1]!==s?(d=s!==null?n.findIndex(l=>l.id===s):-1,e[0]=n,e[1]=s,e[2]=d):d=e[2];const t=d,i=t!==-1?n[t]:null,a=i!==null;let u,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l=>r(l),f=()=>r(null),e[3]=u,e[4]=f):(u=e[3],f=e[4]);let c,o;e[5]!==t||e[6]!==n?(c=()=>{const l=n[t-1];t>0&&l&&r(l.id)},o=()=>{const l=n[t+1];t!==-1&&l&&r(l.id)},e[5]=t,e[6]=n,e[7]=c,e[8]=o):(c=e[7],o=e[8]);let p;return e[9]!==t||e[10]!==i||e[11]!==a||e[12]!==c||e[13]!==o?(p={selected:i,index:t,isOpen:a,select:u,close:f,prev:c,next:o},e[9]=t,e[10]=i,e[11]=a,e[12]=c,e[13]=o,e[14]=p):p=e[14],p}export{m as u};
@@ -1 +1 @@
1
- import{c as s,a8 as o}from"./index-B2vvUsuK.js";function n(){const t=s.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},t[0]=e):e=t[0],!!o(e)}export{n as u};
1
+ import{c as s,a8 as o}from"./index-D19iAD4s.js";function n(){const t=s.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},t[0]=e):e=t[0],!!o(e)}export{n as u};
@@ -1 +1 @@
1
- import{c as k,a6 as M,am as S,q as T,e as v,a as q,r as A,K}from"./index-B2vvUsuK.js";import{u as O}from"./useInfiniteQuery-EaWUgCtN.js";import{n as Q}from"./watch-sse-pool-DSisQksD.js";const R=6e4;function E(e,n){return e.call("NOTIFICATION_LIST",n?{cursor:n}:{})}function L(e,n){if(!e)return e;const r=n?new Set(n):null;let i=0;const a=e.pages.map(t=>{const u=t.notifications.filter(c=>r&&!r.has(c.id)?!0:(i++,!1));return{...t,notifications:u}}),o=r?Math.max(0,(e.pages[0]?.unreadCount??0)-i):0;return{...e,pages:a.map(t=>({...t,unreadCount:o}))}}function w(e,n){const r=k.c(4),{data:i}=q.useSession(),a=i?.user?.id;let o;r[0]!==n||r[1]!==e||r[2]!==a?(o=t=>!e||!a?B:Q.subscribe(e,c=>{try{if(JSON.parse(c.data).subject!==a)return}catch{return}n(),t()},n),r[0]=n,r[1]=e,r[2]=a,r[3]=o):o=r[3],A.useSyncExternalStore(o,j,D)}function D(){return 0}function j(){return 0}function B(){}function G(){const e=k.c(37),{locator:n,org:r}=M(),i=S(),a=T();let o;e[0]!==n?(o=K.notifications(n),e[0]=n,e[1]=o):o=e[1];const t=o;let u;e[2]!==i?(u=l=>{const{pageParam:b}=l;return E(i,b)},e[2]=i,e[3]=u):u=e[3];let c;e[4]!==t||e[5]!==u?(c={queryKey:t,queryFn:u,initialPageParam:void 0,getNextPageParam:V,refetchInterval:R},e[4]=t,e[5]=u,e[6]=c):c=e[6];const s=O(c);let I;e[7]!==a||e[8]!==t?(I=()=>a.invalidateQueries({queryKey:t,refetchType:"active"}),e[7]=a,e[8]=t,e[9]=I):I=e[9],w(r.slug,I);let f;e[10]!==i?(f=l=>i.call("NOTIFICATION_MARK_READ",l?{ids:l}:{}),e[10]=i,e[11]=f):f=e[11];let m,p;e[12]!==a||e[13]!==t?(m=async l=>{await a.cancelQueries({queryKey:t}),a.setQueryData(t,b=>L(b,l))},p=()=>a.invalidateQueries({queryKey:t}),e[12]=a,e[13]=t,e[14]=m,e[15]=p):(m=e[14],p=e[15]);let y;e[16]!==f||e[17]!==m||e[18]!==p?(y={mutationFn:f,onMutate:m,onSettled:p},e[16]=f,e[17]=m,e[18]=p,e[19]=y):y=e[19];const P=v(y);let N;e[20]!==s.data?.pages?(N=s.data?.pages??[],e[20]=s.data?.pages,e[21]=N):N=e[21];const C=N;let d;e[22]!==C?(d=C.flatMap($),e[22]=C,e[23]=d):d=e[23];const _=C[0]?.unreadCount??0;let g;e[24]!==s?(g=()=>{s.hasNextPage&&!s.isFetchingNextPage&&s.fetchNextPage()},e[24]=s,e[25]=g):g=e[25];let h,x;e[26]!==P?(h=()=>P.mutate(null),x=l=>P.mutate([l]),e[26]=P,e[27]=h,e[28]=x):(h=e[27],x=e[28]);let F;return e[29]!==s.hasNextPage||e[30]!==s.isFetchingNextPage||e[31]!==_||e[32]!==g||e[33]!==h||e[34]!==x||e[35]!==d?(F={updates:d,redDotCount:_,hasMore:s.hasNextPage,isFetchingMore:s.isFetchingNextPage,fetchMore:g,markAllRead:h,markRead:x},e[29]=s.hasNextPage,e[30]=s.isFetchingNextPage,e[31]=_,e[32]=g,e[33]=h,e[34]=x,e[35]=d,e[36]=F):F=e[36],F}function $(e){return e.notifications.map(J)}function J(e){return{id:e.id,taskBoardItemId:e.taskBoardItemId,taskTitle:e.taskTitle,taskKeySeq:e.taskKeySeq,action:e.type,actorName:e.actorName,actorImage:e.actorImage,occurredAt:e.createdAt}}function V(e){return e.nextCursor??void 0}export{G as u};
1
+ import{c as k,a6 as M,am as S,q as T,e as v,a as q,r as A,K}from"./index-D19iAD4s.js";import{u as O}from"./useInfiniteQuery-BIIkqC2p.js";import{n as Q}from"./watch-sse-pool-CrHa0Ln_.js";const R=6e4;function E(e,n){return e.call("NOTIFICATION_LIST",n?{cursor:n}:{})}function L(e,n){if(!e)return e;const r=n?new Set(n):null;let i=0;const a=e.pages.map(t=>{const u=t.notifications.filter(c=>r&&!r.has(c.id)?!0:(i++,!1));return{...t,notifications:u}}),o=r?Math.max(0,(e.pages[0]?.unreadCount??0)-i):0;return{...e,pages:a.map(t=>({...t,unreadCount:o}))}}function w(e,n){const r=k.c(4),{data:i}=q.useSession(),a=i?.user?.id;let o;r[0]!==n||r[1]!==e||r[2]!==a?(o=t=>!e||!a?B:Q.subscribe(e,c=>{try{if(JSON.parse(c.data).subject!==a)return}catch{return}n(),t()},n),r[0]=n,r[1]=e,r[2]=a,r[3]=o):o=r[3],A.useSyncExternalStore(o,j,D)}function D(){return 0}function j(){return 0}function B(){}function G(){const e=k.c(37),{locator:n,org:r}=M(),i=S(),a=T();let o;e[0]!==n?(o=K.notifications(n),e[0]=n,e[1]=o):o=e[1];const t=o;let u;e[2]!==i?(u=l=>{const{pageParam:b}=l;return E(i,b)},e[2]=i,e[3]=u):u=e[3];let c;e[4]!==t||e[5]!==u?(c={queryKey:t,queryFn:u,initialPageParam:void 0,getNextPageParam:V,refetchInterval:R},e[4]=t,e[5]=u,e[6]=c):c=e[6];const s=O(c);let I;e[7]!==a||e[8]!==t?(I=()=>a.invalidateQueries({queryKey:t,refetchType:"active"}),e[7]=a,e[8]=t,e[9]=I):I=e[9],w(r.slug,I);let f;e[10]!==i?(f=l=>i.call("NOTIFICATION_MARK_READ",l?{ids:l}:{}),e[10]=i,e[11]=f):f=e[11];let m,p;e[12]!==a||e[13]!==t?(m=async l=>{await a.cancelQueries({queryKey:t}),a.setQueryData(t,b=>L(b,l))},p=()=>a.invalidateQueries({queryKey:t}),e[12]=a,e[13]=t,e[14]=m,e[15]=p):(m=e[14],p=e[15]);let y;e[16]!==f||e[17]!==m||e[18]!==p?(y={mutationFn:f,onMutate:m,onSettled:p},e[16]=f,e[17]=m,e[18]=p,e[19]=y):y=e[19];const P=v(y);let N;e[20]!==s.data?.pages?(N=s.data?.pages??[],e[20]=s.data?.pages,e[21]=N):N=e[21];const C=N;let d;e[22]!==C?(d=C.flatMap($),e[22]=C,e[23]=d):d=e[23];const _=C[0]?.unreadCount??0;let g;e[24]!==s?(g=()=>{s.hasNextPage&&!s.isFetchingNextPage&&s.fetchNextPage()},e[24]=s,e[25]=g):g=e[25];let h,x;e[26]!==P?(h=()=>P.mutate(null),x=l=>P.mutate([l]),e[26]=P,e[27]=h,e[28]=x):(h=e[27],x=e[28]);let F;return e[29]!==s.hasNextPage||e[30]!==s.isFetchingNextPage||e[31]!==_||e[32]!==g||e[33]!==h||e[34]!==x||e[35]!==d?(F={updates:d,redDotCount:_,hasMore:s.hasNextPage,isFetchingMore:s.isFetchingNextPage,fetchMore:g,markAllRead:h,markRead:x},e[29]=s.hasNextPage,e[30]=s.isFetchingNextPage,e[31]=_,e[32]=g,e[33]=h,e[34]=x,e[35]=d,e[36]=F):F=e[36],F}function $(e){return e.notifications.map(J)}function J(e){return{id:e.id,taskBoardItemId:e.taskBoardItemId,taskTitle:e.taskTitle,taskKeySeq:e.taskKeySeq,action:e.type,actorName:e.actorName,actorImage:e.actorImage,occurredAt:e.createdAt}}function V(e){return e.nextCursor??void 0}export{G as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-B2vvUsuK.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
1
+ import{r as e}from"./index-D19iAD4s.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{c as O,a6 as T,am as A,ax as _,K as I,i as v,q as J,b as Q,e as N,t as p}from"./index-B2vvUsuK.js";function j(){const e=O.c(10),{org:u}=T(),d=A(),{capabilities:c,isPrivileged:f}=_(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=v(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function F(){const e=O.c(29),{org:u,locator:d}=T(),c=A(),f=J(),s=Q();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let m;e[22]!==q||e[23]!==R||e[24]!==g?(m={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=m):m=e[25];const S=N(m);let E;return e[26]!==y||e[27]!==S?(E={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=E):E=e[28],E}export{F as a,j as u};
1
+ import{c as O,a6 as T,am as A,ax as _,K as I,i as v,q as J,b as Q,e as N,t as p}from"./index-D19iAD4s.js";function j(){const e=O.c(10),{org:u}=T(),d=A(),{capabilities:c,isPrivileged:f}=_(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=v(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function F(){const e=O.c(29),{org:u,locator:d}=T(),c=A(),f=J(),s=Q();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let m;e[22]!==q||e[23]!==R||e[24]!==g?(m={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=m):m=e[25];const S=N(m);let E;return e[26]!==y||e[27]!==S?(E={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=E):E=e[28],E}export{F as a,j as u};
@@ -1 +1 @@
1
- import{c as Ee,b as He,u as Le,a6 as Oe,h5 as Be,h6 as Ke,h7 as le,h8 as de,al as $e,ai as me,h9 as Qe,ha as We,r as Y,es as _e,U as pe,hb as qe,hc as ze}from"./index-B2vvUsuK.js";import{a as Ge}from"./use-chat-layout-state-CYDJQho2.js";import{b as Je}from"./agent-icon-ButaHLCM.js";import{i as Xe}from"./Monitor01-DtssQiym.js";import{b as Ye}from"./use-connection-BlQSFvXZ.js";import{a as Ze}from"./use-mcp-client-C25DU1dz.js";import{u as et}from"./use-mcp-tools-DU4EJz2s.js";import{b as tt}from"./repository-binding-DC98qYdg.js";import{g as at}from"./types-BmRTIjW9.js";import{t as ot}from"./utils-CVEq3hMx.js";import{a as R}from"./agent-capabilities-B8dQ_ZB8.js";import"./index-DOrEGYb6.js";import{u as nt}from"./use-sandbox-events-CrjWSBYb.js";import{F as ue}from"./file-type-icon-sxJ1fqoc.js";import{a as st,u as it}from"./use-panel-navigate-BvdMbLN8.js";import{r as Z}from"./resolve-tab-icon-CCnYS1It.js";import{u as ct}from"./use-task-metadata-DqYio8UA.js";import{r as rt}from"./preview-source-BsRLGWUP.js";import{i as lt,n as dt,s as mt}from"./use-org-notice-BmwTtllY.js";import{u as pt}from"./use-voice-input-wPU7RMRz.js";import{u as ut}from"./use-organization-settings-CeyizmcT.js";import{a as ft}from"./use-project-scope-TiMALD5Y.js";import{c as bt,u as Tt,d as It,e as vt,f as ht}from"./use-project-native-view-presence-Cj3jJM1f.js";import{c as Pt}from"./chat-context-DsLpz7ew.js";import{r as gt}from"./virtual-mcp-DeWQ4GR6.js";function Xt(o){const e=Ee.c(35),d=He(),{openPanel:f,closePanel:F}=st();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=it(),te=Ge(),i=tt(o.virtualMcpId),T=ct(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:I}=Pt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,v=T?.expanded_tools??[],h=ut(),{scopeId:Te,project:Ie}=ft(),U=bt(Te,Ie,i),P=Tt(U.project),ae=It(U.resolvedScopeId,R(U.project?.metadata),P.presence);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g={includeVirtual:!0},e[1]=g):g=e[1];const p=Ye(g),ve=nt(),x=I?.branch??be;let y;e[2]!==I?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==x?(y=rt({threadId:o.taskId,sandboxBranch:x,agentHasRepo:R(i?.metadata),threadHasRepo:R(T)||R(I?.metadata)}),e[2]=I?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=x,e[7]=y):y=e[7];const he=y,E=ve.lifecycle.phase==="running",{runtime:Pe,resolved:oe}=pt(o.virtualMcpId),H=!!r&&E;let k;e[8]!==H?(k={enabled:H},e[8]=H,e[9]=k):k=e[9];const ne=Ze({connectionId:r,orgId:n.id,orgSlug:n.slug},k),L=ne,O=!!ne&&E;let w;e[10]!==L||e[11]!==O?(w={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=w):w=e[12];const{data:ge}=et(w),se=r&&E?(ge?.tools??[]).filter(Vt).map(t=>({connectionId:r,toolName:t.name,label:ot(t.name),icon:null})):[],B=se[0],ye=B?se:[],u=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,ke=gt(m),ie={assets:P.assetsPending,siteAccess:P.siteAccessPending,blog:P.blogPending},{activeTab:V,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(wt)}:null}),we=u||m?{defaultMainView:u,tabs:c.map(kt)}:null,C=dt({hasSource:he==="repo"||h,runtime:Pe,cmsMode:ke}),Ve=C.includes("content"),Ce=le(we),Me=u?.type,ce=vt(Me,ae,ie,C,oe),K=ce?le(null):Ce,Se=ht(V,ae,ie),Ne=!C.includes("code")&&oe&&de(V)!==null,a=!ee&&!te&&ce||V==="content"&&!Ve||Ne||Se?K:V,$=$e(a);let M;e[13]!==d?(M=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=M):M=e[14];const je=M,Q=new Map;for(const t of v){const s=me(t.appId,t.toolName);Q.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ye){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);Q.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const W=Qe(a),_=W?W.key.split("/").pop()??W.key:null,Ae=_?[{id:a,title:_,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:_,...t})}}]:[],S=We(a),De=S?[{id:a,title:(S.path.split("/").pop()??S.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(S.path.startsWith("pages/")?Je:Xe,t)}}]:[],q=_e(a),z=q?q.path.split("/").pop()??q.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=lt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:p})})):[];let N;e[15]!==p?(N=t=>({id:qe(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=N):N=e[16];const Ue=[...Fe,...Ae,...De,...Re,...c.map(N),...Array.from(Q.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,G=Ue.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),xe=o.virtualMcpId;let j;e[17]!==n.id?(j=pe(n.id),e[17]=n.id,e[18]=j):j=e[18];const J=xe===j;let A;e[19]!==a||e[20]!==F||e[21]!==l||e[22]!==J||e[23]!==f||e[24]!==n.id||e[25]!==h?(A=t=>{if(mt({reportsOnly:h,onReportAgent:J,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:yt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?F():f(s.tabId)},e[19]=a,e[20]=F,e[21]=l,e[22]=J,e[23]=f,e[24]=n.id,e[25]=h,e[26]=A):A=e[26];const X=A;let D;return e[27]!==a||e[28]!==$||e[29]!==v||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(D={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:v,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=v,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=D):D=e[34],D}function yt(o){return{...o,thread:void 0}}function kt(o){return{id:o.id}}function wt(o){return{id:o.id}}function Vt(o){return!!at(o._meta)}export{Xt as u};
1
+ import{c as Ee,b as He,u as Le,a6 as Oe,h5 as Be,h6 as Ke,h7 as le,h8 as de,al as $e,ai as me,h9 as Qe,ha as We,r as Y,es as _e,U as pe,hb as qe,hc as ze}from"./index-D19iAD4s.js";import{a as Ge}from"./use-chat-layout-state-CAIrZGnL.js";import{b as Je}from"./agent-icon-CF35JltL.js";import{i as Xe}from"./Monitor01-B4iHbF93.js";import{b as Ye}from"./use-connection-CYsyXyy7.js";import{a as Ze}from"./use-mcp-client-CCT6q-zj.js";import{u as et}from"./use-mcp-tools-CdypNtPV.js";import{b as tt}from"./repository-binding-CP_PNLcQ.js";import{g as at}from"./types-6-Ps6AGR.js";import{t as ot}from"./utils-CVEq3hMx.js";import{a as R}from"./agent-capabilities-CTj-iH2e.js";import"./index-C3JbUkAn.js";import{u as nt}from"./use-sandbox-events-CdcsfdkO.js";import{F as ue}from"./file-type-icon-CNUBpmBv.js";import{a as st,u as it}from"./use-panel-navigate-DzpMtCDM.js";import{r as Z}from"./resolve-tab-icon-BqdaZDC9.js";import{u as ct}from"./use-task-metadata-DRyTcJBf.js";import{r as rt}from"./preview-source-BsRLGWUP.js";import{i as lt,n as dt,s as mt}from"./use-org-notice-BeUR_ZGA.js";import{u as pt}from"./use-voice-input-D_lO17n9.js";import{a as ut}from"./use-organization-settings-BEn5xJKT.js";import{a as ft}from"./use-project-scope-DdM0t1xa.js";import{c as bt,u as Tt,d as It,e as vt,f as ht}from"./use-project-native-view-presence-D4Mhq-72.js";import{c as Pt}from"./chat-context-D5EEwp_m.js";import{r as gt}from"./virtual-mcp-jT57t8xN.js";function Xt(o){const e=Ee.c(35),d=He(),{openPanel:f,closePanel:F}=st();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=it(),te=Ge(),i=tt(o.virtualMcpId),T=ct(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:I}=Pt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,v=T?.expanded_tools??[],h=ut(),{scopeId:Te,project:Ie}=ft(),U=bt(Te,Ie,i),P=Tt(U.project),ae=It(U.resolvedScopeId,R(U.project?.metadata),P.presence);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g={includeVirtual:!0},e[1]=g):g=e[1];const p=Ye(g),ve=nt(),x=I?.branch??be;let y;e[2]!==I?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==x?(y=rt({threadId:o.taskId,sandboxBranch:x,agentHasRepo:R(i?.metadata),threadHasRepo:R(T)||R(I?.metadata)}),e[2]=I?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=x,e[7]=y):y=e[7];const he=y,E=ve.lifecycle.phase==="running",{runtime:Pe,resolved:oe}=pt(o.virtualMcpId),H=!!r&&E;let k;e[8]!==H?(k={enabled:H},e[8]=H,e[9]=k):k=e[9];const ne=Ze({connectionId:r,orgId:n.id,orgSlug:n.slug},k),L=ne,O=!!ne&&E;let w;e[10]!==L||e[11]!==O?(w={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=w):w=e[12];const{data:ge}=et(w),se=r&&E?(ge?.tools??[]).filter(Vt).map(t=>({connectionId:r,toolName:t.name,label:ot(t.name),icon:null})):[],B=se[0],ye=B?se:[],u=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,ke=gt(m),ie={assets:P.assetsPending,siteAccess:P.siteAccessPending,blog:P.blogPending},{activeTab:V,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(wt)}:null}),we=u||m?{defaultMainView:u,tabs:c.map(kt)}:null,C=dt({hasSource:he==="repo"||h,runtime:Pe,cmsMode:ke}),Ve=C.includes("content"),Ce=le(we),Me=u?.type,ce=vt(Me,ae,ie,C,oe),K=ce?le(null):Ce,Se=ht(V,ae,ie),Ne=!C.includes("code")&&oe&&de(V)!==null,a=!ee&&!te&&ce||V==="content"&&!Ve||Ne||Se?K:V,$=$e(a);let M;e[13]!==d?(M=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=M):M=e[14];const je=M,Q=new Map;for(const t of v){const s=me(t.appId,t.toolName);Q.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ye){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);Q.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const W=Qe(a),_=W?W.key.split("/").pop()??W.key:null,Ae=_?[{id:a,title:_,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:_,...t})}}]:[],S=We(a),De=S?[{id:a,title:(S.path.split("/").pop()??S.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(S.path.startsWith("pages/")?Je:Xe,t)}}]:[],q=_e(a),z=q?q.path.split("/").pop()??q.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=lt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:p})})):[];let N;e[15]!==p?(N=t=>({id:qe(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=N):N=e[16];const Ue=[...Fe,...Ae,...De,...Re,...c.map(N),...Array.from(Q.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,G=Ue.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),xe=o.virtualMcpId;let j;e[17]!==n.id?(j=pe(n.id),e[17]=n.id,e[18]=j):j=e[18];const J=xe===j;let A;e[19]!==a||e[20]!==F||e[21]!==l||e[22]!==J||e[23]!==f||e[24]!==n.id||e[25]!==h?(A=t=>{if(mt({reportsOnly:h,onReportAgent:J,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:yt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?F():f(s.tabId)},e[19]=a,e[20]=F,e[21]=l,e[22]=J,e[23]=f,e[24]=n.id,e[25]=h,e[26]=A):A=e[26];const X=A;let D;return e[27]!==a||e[28]!==$||e[29]!==v||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(D={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:v,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=v,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=D):D=e[34],D}function yt(o){return{...o,thread:void 0}}function kt(o){return{id:o.id}}function wt(o){return{id:o.id}}function Vt(o){return!!at(o._meta)}export{Xt as u};
@@ -1 +1 @@
1
- import{c as I,b as k,a7 as N,b6 as S,j as o,a6 as $,K as A,V as L}from"./index-B2vvUsuK.js";import{B as g}from"./badge-CaU7DsCB.js";import{c as v,T,a as b,b as _}from"./tooltip-C0XDZQqg.js";import{g as H}from"./types-BmRTIjW9.js";import{s as P}from"./Eye-DvcGz393.js";import{a5 as U,az as w}from"./agent-icon-ButaHLCM.js";import{i as O}from"./mcp-oauth-DESKCBIm.js";const R=[{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:U,variant:"outline"}];function Q(y){const e=I.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?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(b,{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(b,{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 m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function V(y){const e=I.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{Q as T,V as u};
1
+ import{c as I,b as k,a7 as A,b6 as N,j as o,a6 as S,K as $,V as L}from"./index-D19iAD4s.js";import{B as g}from"./badge-CWKaTosK.js";import{c as v,T,a as b,b as _}from"./tooltip-B3-v7v0W.js";import{g as H}from"./types-6-Ps6AGR.js";import{s as P}from"./Eye-BSRrcDT9.js";import{a6 as U,aA as w}from"./agent-icon-CF35JltL.js";import{i as O}from"./mcp-oauth-CIbadsEV.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:A,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function Q(y){const e=I.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?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(b,{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(b,{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 m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function V(y){const e=I.c(11),{connectionId:c}=y,{org:r}=S();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=$.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{Q as T,V as u};
@@ -1,4 +1,4 @@
1
- import{cM as ce,cN as le,cO as ue,cP as de,cQ as he,cR as m,cS as g,cT as fe,cU as pe,cV as me,cW as M,cX as _e,cY as F,cZ as we,c_ as q,c$ as ge,d0 as D,d1 as Te,d2 as ye,d3 as ke,d4 as z,d5 as ve,d6 as Se,d7 as Ce,d8 as ee,d9 as be,da as Re,db as Ie,bP as Ee,dc as qe,dd as Pe,de as A,df as $e,dg as Me,dh as Ae,di as He,dj as Oe,dk as xe,dl as Ue,dm as Ne,dn as je,dp as Fe,dq as De,dr as Le,ds as Ve,bG as V,dt as Qe,du as U,K as te,T as ze,c as se,V as Je,i as We}from"./index-B2vvUsuK.js";import{U as P,b as H,c as J}from"./auth-DlYbrS5R.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(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 Ke(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 W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(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(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(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 m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(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),m.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)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(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(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(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=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(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 m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(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 m?n:new m(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 h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{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},Te,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},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(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=W(e);this._notificationHandlers.set(s,r=>{const o=K(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"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(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 m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(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 m(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=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(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=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(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];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class st{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(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 rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(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 at(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Be{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(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(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(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},$e,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},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(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 m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(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},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ne.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const N=a=>[{type:"text",text:a}];function it(a){const e=V(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(h){const f=h instanceof Error?h.message:"Network error";return{content:N(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:N(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:N(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function ut(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=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
1
+ import{cM as ce,cN as le,cO as ue,cP as de,cQ as he,cR as m,cS as g,cT as fe,cU as pe,cV as me,cW as M,cX as _e,cY as F,cZ as we,c_ as q,c$ as ge,d0 as D,d1 as Te,d2 as ye,d3 as ke,d4 as z,d5 as ve,d6 as Se,d7 as Ce,d8 as ee,d9 as be,da as Re,db as Ie,bP as Ee,dc as qe,dd as Pe,de as A,df as $e,dg as Me,dh as Ae,di as He,dj as Oe,dk as xe,dl as Ue,dm as Ne,dn as je,dp as Fe,dq as De,dr as Le,ds as Ve,bG as V,dt as Qe,du as U,K as te,T as ze,c as se,V as Je,i as We}from"./index-D19iAD4s.js";import{U as P,b as H,c as J}from"./auth-Ry9WrZV8.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(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 Ke(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 W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(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(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(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 m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(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),m.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)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(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(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(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=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(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 m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(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 m?n:new m(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 h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{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},Te,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},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(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=W(e);this._notificationHandlers.set(s,r=>{const o=K(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"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(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 m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(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 m(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=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(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=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(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];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class st{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(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 rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(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 at(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Be{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(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(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(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},$e,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},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(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 m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(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},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ne.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const N=a=>[{type:"text",text:a}];function it(a){const e=V(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(h){const f=h instanceof Error?h.message:"Network error";return{content:N(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:N(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:N(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function ut(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=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
2
2
  `)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=_+1,_=d.indexOf(`
4
4
  `,c);continue}const v=d.charCodeAt(c);if(Y(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(p===0&&d.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
@@ -1 +1 @@
1
- import{c as l,i as u,cR as m,cS as f,V as y,K as n}from"./index-B2vvUsuK.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,i as u,cR as m,cS as f,V as y,K as n}from"./index-D19iAD4s.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,V as p,i as q,K as m}from"./index-B2vvUsuK.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,V as p,i as q,K as m}from"./index-D19iAD4s.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{r as s}from"./index-B2vvUsuK.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-D19iAD4s.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{q as T,b as q,e as j,K as C,fM as B}from"./index-B2vvUsuK.js";import{u as F}from"./use-voice-input-wPU7RMRz.js";import{x as H,c as S,u as U,v as J,aj as N,ax as R,Z as W,X as A,Y as L,aq as Y,ar as g,as as z,au as G,aF as X,aE as Z,aD as _,y as b,$ as D}from"./site-editor-toast-DI5QMuI-.js";import{s as $}from"./sandbox-git-api-CJ3-CkeV.js";import{u as V}from"./chat-context-DsLpz7ew.js";import{i as M,H as I}from"./hosted-reconcile-DH-KyBYi.js";import{b as E}from"./sandbox-url-D3mC8qhT.js";import{d as O}from"./utils-C8EWsG3o.js";function ue({orgSlug:i,virtualMcpId:t,branch:o}){const s=T(),y=V()?.taskId??null,P=H(t),Q=F(t).runtime==="cms",{url:v}=S(t),d=U(t,o),f=d.kind==="protocol"?d:null,l=J({orgSlug:i,virtualMcpId:t,branch:o}),h=C.decofile(l),K=q(),x=async(r,c)=>{if(v)return{ok:!0};if(Q){const a=await Z({orgSlug:i,virtualMcpId:t,branch:o},{set:r,delete:c});return _(s,{orgSlug:i,virtualMcpId:t,branch:o},a),await s.invalidateQueries({queryKey:$({orgSlug:i,virtualMcpId:t,branch:o,threadId:y})}),a}const u={orgSlug:i,virtualMcpId:t,branch:o,threadId:y};for(const[a,n]of Object.entries(r)){const e=await fetch(E(u,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:b(P,O(a)),content:JSON.stringify(n,null,2)})});if(!e.ok)return D(e,"Write")}for(const a of c){const n=await fetch(E(u,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:b(P,O(a))})});if(!n.ok)return D(n,"Delete")}return{ok:!0}},p=j({mutationKey:L(i,t,o),scope:A(i,t,o),mutationFn:async({writes:r,deletes:c,copies:u,shown:a})=>{if(d.kind==="pending"||d.kind==="unavailable")throw N("CMS storage");const n=f?.source==="github"?r:B(r);return f?.source==="github"?M({queryClient:s,backend:f,params:{orgSlug:i,virtualMcpId:t,branch:o},cacheKey:l},{writes:n,deletes:c.filter(e=>!(e in n))},u,a?.()):f?R(s,f,{orgSlug:i,virtualMcpId:t,branch:o},l,{set:n,delete:c.filter(e=>!(e in n))}):W({queryClient:s,orgSlug:i,virtualMcpId:t,branch:o,backend:d,cacheKey:l},{kind:"edit",write:()=>x(n,c)})},onSuccess:()=>{f?.source!=="github"&&s.invalidateQueries({queryKey:C.liveMeta(i,t,o)})}});return{move:async(r,c)=>{const u=[...Object.keys(r.writes),...r.deletes],a=s.getQueryData(h),n=new Map;for(const e of u)a&&e in a&&n.set(e,a[e]);s.setQueryData(h,e=>ee(e,r)),s.cancelQueries({queryKey:h});try{return await p.mutateAsync({...r,copies:a,shown:c?.shown})}catch(e){throw e instanceof I?(Y(K,e.deleted,e.deleted&&r.deletes.length>0&&r.deletes.every(m=>g(s,l,m))),e):(z(K,e),f?.source==="github"&&(G(e)||e instanceof X)||s.setQueryData(h,m=>{if(!m)return m;const w={...m};for(const k of u)n.has(k)?w[k]=n.get(k):delete w[k];return w}),e)}},isPending:p.isPending,isError:p.isError}}function ee(i,{writes:t,deletes:o}){const s={...i??{},...t};for(const y of o)y in t||delete s[y];return s}export{ee as a,ue as u};
1
+ import{q as T,b as q,e as j,K as C,fM as B}from"./index-D19iAD4s.js";import{u as F}from"./use-voice-input-D_lO17n9.js";import{x as H,c as S,u as U,v as J,aj as N,ax as R,Z as W,X as A,Y as L,aq as Y,ar as g,as as z,au as G,aF as X,aE as Z,aD as _,y as b,$ as D}from"./site-editor-toast-QCYxwt4C.js";import{s as $}from"./sandbox-git-api-B73fIbEU.js";import{u as V}from"./chat-context-D5EEwp_m.js";import{i as M,H as I}from"./hosted-reconcile-BT71cbCZ.js";import{b as E}from"./sandbox-url-D3mC8qhT.js";import{d as O}from"./utils-CWN91Q0R.js";function ue({orgSlug:i,virtualMcpId:t,branch:o}){const s=T(),y=V()?.taskId??null,P=H(t),Q=F(t).runtime==="cms",{url:v}=S(t),d=U(t,o),f=d.kind==="protocol"?d:null,l=J({orgSlug:i,virtualMcpId:t,branch:o}),h=C.decofile(l),K=q(),x=async(r,c)=>{if(v)return{ok:!0};if(Q){const a=await Z({orgSlug:i,virtualMcpId:t,branch:o},{set:r,delete:c});return _(s,{orgSlug:i,virtualMcpId:t,branch:o},a),await s.invalidateQueries({queryKey:$({orgSlug:i,virtualMcpId:t,branch:o,threadId:y})}),a}const u={orgSlug:i,virtualMcpId:t,branch:o,threadId:y};for(const[a,n]of Object.entries(r)){const e=await fetch(E(u,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:b(P,O(a)),content:JSON.stringify(n,null,2)})});if(!e.ok)return D(e,"Write")}for(const a of c){const n=await fetch(E(u,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:b(P,O(a))})});if(!n.ok)return D(n,"Delete")}return{ok:!0}},p=j({mutationKey:L(i,t,o),scope:A(i,t,o),mutationFn:async({writes:r,deletes:c,copies:u,shown:a})=>{if(d.kind==="pending"||d.kind==="unavailable")throw N("CMS storage");const n=f?.source==="github"?r:B(r);return f?.source==="github"?M({queryClient:s,backend:f,params:{orgSlug:i,virtualMcpId:t,branch:o},cacheKey:l},{writes:n,deletes:c.filter(e=>!(e in n))},u,a?.()):f?R(s,f,{orgSlug:i,virtualMcpId:t,branch:o},l,{set:n,delete:c.filter(e=>!(e in n))}):W({queryClient:s,orgSlug:i,virtualMcpId:t,branch:o,backend:d,cacheKey:l},{kind:"edit",write:()=>x(n,c)})},onSuccess:()=>{f?.source!=="github"&&s.invalidateQueries({queryKey:C.liveMeta(i,t,o)})}});return{move:async(r,c)=>{const u=[...Object.keys(r.writes),...r.deletes],a=s.getQueryData(h),n=new Map;for(const e of u)a&&e in a&&n.set(e,a[e]);s.setQueryData(h,e=>ee(e,r)),s.cancelQueries({queryKey:h});try{return await p.mutateAsync({...r,copies:a,shown:c?.shown})}catch(e){throw e instanceof I?(Y(K,e.deleted,e.deleted&&r.deletes.length>0&&r.deletes.every(m=>g(s,l,m))),e):(z(K,e),f?.source==="github"&&(G(e)||e instanceof X)||s.setQueryData(h,m=>{if(!m)return m;const w={...m};for(const k of u)n.has(k)?w[k]=n.get(k):delete w[k];return w}),e)}},isPending:p.isPending,isError:p.isError}}function ee(i,{writes:t,deletes:o}){const s={...i??{},...t};for(const y of o)y in t||delete s[y];return s}export{ee as a,ue as u};
@@ -1 +1 @@
1
- import{c as m,at as j,av as F,i as E,an as _,K as y,dP as $,a6 as N,d as M,a as G,cK as H,dK as q}from"./index-B2vvUsuK.js";import{h as R,r as P,g as D,e as Q,d as x}from"./repository-binding-DC98qYdg.js";import{t as B,i as W,c as Y,w as z}from"./thread-intent-DC5UuPI5.js";const p=[],J=4;function V(t,e){return[e,...t.filter(n=>n!==e)].slice(0,J)}function X(t){const e=m.c(9);let n;e[0]!==t?(n=F.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[a,o]=j(n,p),r=Array.isArray(a)?a:p;let s,c;e[2]!==o?(s=l=>o(u=>V(Array.isArray(u)?u:p,l)),c=l=>o(u=>(Array.isArray(u)?u:p).filter(h=>h!==l)),e[2]=o,e[3]=s,e[4]=c):(s=e[3],c=e[4]);let i;return e[5]!==r||e[6]!==s||e[7]!==c?(i={recent:r,remember:s,forget:c},e[5]=r,e[6]=s,e[7]=c,e[8]=i):i=e[8],i}function C(t,e,n,a,o){let r=null;for(const s of t)s.virtual_mcp_id===e&&s.created_by===n&&(s.hidden||B(s,a)&&(o&&s.branch===o||(!r||s.updated_at>r.updated_at)&&(r=s)));return r}function be(t,e,n,a,o){const r=o?.blogDrafts??!1;return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&W(s.branch)===r&&B(s,a))}function Z(t,e,n,a,o,r){if(!o)return C(t,e,n,a)??void 0;const s=a==="cms"?new Set((r?.releases??[]).filter(i=>i.runtime==="sandbox").map(i=>i.branch)):null,c=s?.size?t.filter(i=>!i.branch||!s.has(i.branch)):t;return C(c,e,n,a,r?.baseBranch)??void 0}const S=6e4,ee=5*6e4,k=3e4;function T(t,e){const n=$(t.error);return n===null?0:Math.max(0,t.errorUpdatedAt+n-e)}const A={refetchOnWindowFocus:t=>T(t.state,Date.now())===0,refetchOnMount:t=>T(t.state,Date.now())===0};function L(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 te(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 ne(t,e){const n=T(t,e);return n>0?Math.max(n,S):t.data===void 0||t.data.changeRequest?.state==="open"?S:ee}function I(t){const{orgSlug:e,target:n,owner:a,repo:o,branch:r}=t;return{queryKey:y.githubPrState(e,P(n),a,o,r),queryFn:()=>_(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&R(n)&&!!a&&!!o,...A,refetchInterval:s=>ne(s.state,Date.now()),refetchIntervalInBackground:!1,staleTime:k}}function ae(t){const e=m.c(4);let n;e[0]!==t?(n=I(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:se},e[2]=n,e[3]=a):a=e[3],E(a)}function se(t){return t.changeRequest?L(t.changeRequest):null}function pe(t){const e=m.c(4);let n;e[0]!==t?(n=I(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:re},e[2]=n,e[3]=a):a=e[3],E(a)}function re(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(te):[]}const oe=5*6e4;function Ee(t){const e=m.c(20),{orgSlug:n,target:a,owner:o,repo:r,base:s}=t;let c;e[0]!==s||e[1]!==n||e[2]!==o||e[3]!==r||e[4]!==a?(c=y.githubLastPublishedPr(n,P(a),o,r,s),e[0]=s,e[1]=n,e[2]=o,e[3]=r,e[4]=a,e[5]=c):c=e[5];let i;e[6]!==s||e[7]!==n||e[8]!==a?(i=()=>_(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=i):i=e[9];let l;e[10]!==t.enabled||e[11]!==s||e[12]!==o||e[13]!==r||e[14]!==a?(l=(t.enabled??!0)&&!!s&&R(a)&&!!o&&!!r,e[10]=t.enabled,e[11]=s,e[12]=o,e[13]=r,e[14]=a,e[15]=l):l=e[15];let u;return e[16]!==c||e[17]!==i||e[18]!==l?(u={queryKey:c,queryFn:i,enabled:l,...A,staleTime:oe,select:ie},e[16]=c,e[17]=i,e[18]=l,e[19]=u):u=e[19],E(u)}function ie(t){return t.changeRequest?L(t.changeRequest):null}const ce=50;function Se(t){const e=m.c(17),{orgSlug:n,target:a,owner:o,repo:r}=t;let s;e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==a?(s=y.githubOpenPrs(n,P(a),o,r),e[0]=n,e[1]=o,e[2]=r,e[3]=a,e[4]=s):s=e[4];let c;e[5]!==n||e[6]!==a?(c=()=>_(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:ce}),e[5]=n,e[6]=a,e[7]=c):c=e[7];let i;e[8]!==t.enabled||e[9]!==o||e[10]!==r||e[11]!==a?(i=(t.enabled??!0)&&R(a)&&!!o&&!!r,e[8]=t.enabled,e[9]=o,e[10]=r,e[11]=a,e[12]=i):i=e[12];let l;return e[13]!==s||e[14]!==c||e[15]!==i?(l={queryKey:s,queryFn:c,enabled:i,...A,staleTime:k,select:le},e[13]=s,e[14]=c,e[15]=i,e[16]=l):l=e[16],E(l)}function le(t){return t.changeRequests.map(L)}function ue(t,e){const{org:n}=N(),a=D(t);return ae({orgId:n.id,orgSlug:n.slug,target:Q(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const de=[];function Te(){const t=m.c(13),e=M(),{org:n,locator:a}=N(),o=x(),{data:r}=G.useSession(),s=Y(),c=ue(void 0,null),{remember:i}=X(n.slug);let l;t[0]!==c||t[1]!==o||t[2]!==a||t[3]!==s?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(d,g,f)=>{if(H(g).kind==="org-destination"){q(e,{tabId:g,org:n.slug,agentId:d,replace:!1});return}const w=(o??[]).find(U=>U.id===d),K=!!(w&&D(w)),v=!f,O=v?void 0:Z(s?.threads.get()??de,d,r?.user?.id,f,K,{baseBranch:c}),b=v?void 0:O?.id??crypto.randomUUID();b&&!O&&f&&z(sessionStorage,a,b,{runtime:f}),q(e,{tabId:g,org:n.slug,agentId:d,search:()=>b?{thread:b}:{},replace:!1})},t[0]=c,t[1]=o,t[2]=a,t[3]=s?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const u=l;let h;return t[8]!==u||t[9]!==e||t[10]!==n.slug||t[11]!==i?(h=(d,g)=>{const f=g?.panel;if(!f){i(d),e(fe(n.slug,d));return}u(d,f,g?.runtime)},t[8]=u,t[9]=e,t[10]=n.slug,t[11]=i,t[12]=h):h=t[12],h}function fe(t,e){return{to:"/$org/projects/$agentId",params:{org:t,agentId:e},search:n=>({...n,project:void 0,virtualmcpid:void 0,thread:void 0,mainpanel:void 0})}}export{X as a,ue as b,Z as c,Se as d,ae as e,be as f,Ee as g,pe as h,I as p,Te as u};
1
+ import{c as m,at as j,av as F,i as E,an as _,K as y,dP as $,a6 as N,d as M,a as G,cK as H,dK as q}from"./index-D19iAD4s.js";import{h as R,r as P,g as D,e as Q,d as x}from"./repository-binding-CP_PNLcQ.js";import{t as B,i as W,c as Y,w as z}from"./thread-intent-BsMPgCKi.js";const p=[],J=4;function V(t,e){return[e,...t.filter(n=>n!==e)].slice(0,J)}function X(t){const e=m.c(9);let n;e[0]!==t?(n=F.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[a,o]=j(n,p),r=Array.isArray(a)?a:p;let s,c;e[2]!==o?(s=l=>o(u=>V(Array.isArray(u)?u:p,l)),c=l=>o(u=>(Array.isArray(u)?u:p).filter(h=>h!==l)),e[2]=o,e[3]=s,e[4]=c):(s=e[3],c=e[4]);let i;return e[5]!==r||e[6]!==s||e[7]!==c?(i={recent:r,remember:s,forget:c},e[5]=r,e[6]=s,e[7]=c,e[8]=i):i=e[8],i}function C(t,e,n,a,o){let r=null;for(const s of t)s.virtual_mcp_id===e&&s.created_by===n&&(s.hidden||B(s,a)&&(o&&s.branch===o||(!r||s.updated_at>r.updated_at)&&(r=s)));return r}function be(t,e,n,a,o){const r=o?.blogDrafts??!1;return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&W(s.branch)===r&&B(s,a))}function Z(t,e,n,a,o,r){if(!o)return C(t,e,n,a)??void 0;const s=a==="cms"?new Set((r?.releases??[]).filter(i=>i.runtime==="sandbox").map(i=>i.branch)):null,c=s?.size?t.filter(i=>!i.branch||!s.has(i.branch)):t;return C(c,e,n,a,r?.baseBranch)??void 0}const S=6e4,ee=5*6e4,k=3e4;function T(t,e){const n=$(t.error);return n===null?0:Math.max(0,t.errorUpdatedAt+n-e)}const A={refetchOnWindowFocus:t=>T(t.state,Date.now())===0,refetchOnMount:t=>T(t.state,Date.now())===0};function L(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 te(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 ne(t,e){const n=T(t,e);return n>0?Math.max(n,S):t.data===void 0||t.data.changeRequest?.state==="open"?S:ee}function I(t){const{orgSlug:e,target:n,owner:a,repo:o,branch:r}=t;return{queryKey:y.githubPrState(e,P(n),a,o,r),queryFn:()=>_(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&R(n)&&!!a&&!!o,...A,refetchInterval:s=>ne(s.state,Date.now()),refetchIntervalInBackground:!1,staleTime:k}}function ae(t){const e=m.c(4);let n;e[0]!==t?(n=I(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:se},e[2]=n,e[3]=a):a=e[3],E(a)}function se(t){return t.changeRequest?L(t.changeRequest):null}function pe(t){const e=m.c(4);let n;e[0]!==t?(n=I(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:re},e[2]=n,e[3]=a):a=e[3],E(a)}function re(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(te):[]}const oe=5*6e4;function Ee(t){const e=m.c(20),{orgSlug:n,target:a,owner:o,repo:r,base:s}=t;let c;e[0]!==s||e[1]!==n||e[2]!==o||e[3]!==r||e[4]!==a?(c=y.githubLastPublishedPr(n,P(a),o,r,s),e[0]=s,e[1]=n,e[2]=o,e[3]=r,e[4]=a,e[5]=c):c=e[5];let i;e[6]!==s||e[7]!==n||e[8]!==a?(i=()=>_(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=i):i=e[9];let l;e[10]!==t.enabled||e[11]!==s||e[12]!==o||e[13]!==r||e[14]!==a?(l=(t.enabled??!0)&&!!s&&R(a)&&!!o&&!!r,e[10]=t.enabled,e[11]=s,e[12]=o,e[13]=r,e[14]=a,e[15]=l):l=e[15];let u;return e[16]!==c||e[17]!==i||e[18]!==l?(u={queryKey:c,queryFn:i,enabled:l,...A,staleTime:oe,select:ie},e[16]=c,e[17]=i,e[18]=l,e[19]=u):u=e[19],E(u)}function ie(t){return t.changeRequest?L(t.changeRequest):null}const ce=50;function Se(t){const e=m.c(17),{orgSlug:n,target:a,owner:o,repo:r}=t;let s;e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==a?(s=y.githubOpenPrs(n,P(a),o,r),e[0]=n,e[1]=o,e[2]=r,e[3]=a,e[4]=s):s=e[4];let c;e[5]!==n||e[6]!==a?(c=()=>_(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:ce}),e[5]=n,e[6]=a,e[7]=c):c=e[7];let i;e[8]!==t.enabled||e[9]!==o||e[10]!==r||e[11]!==a?(i=(t.enabled??!0)&&R(a)&&!!o&&!!r,e[8]=t.enabled,e[9]=o,e[10]=r,e[11]=a,e[12]=i):i=e[12];let l;return e[13]!==s||e[14]!==c||e[15]!==i?(l={queryKey:s,queryFn:c,enabled:i,...A,staleTime:k,select:le},e[13]=s,e[14]=c,e[15]=i,e[16]=l):l=e[16],E(l)}function le(t){return t.changeRequests.map(L)}function ue(t,e){const{org:n}=N(),a=D(t);return ae({orgId:n.id,orgSlug:n.slug,target:Q(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const de=[];function Te(){const t=m.c(13),e=M(),{org:n,locator:a}=N(),o=x(),{data:r}=G.useSession(),s=Y(),c=ue(void 0,null),{remember:i}=X(n.slug);let l;t[0]!==c||t[1]!==o||t[2]!==a||t[3]!==s?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(d,g,f)=>{if(H(g).kind==="org-destination"){q(e,{tabId:g,org:n.slug,agentId:d,replace:!1});return}const w=(o??[]).find(U=>U.id===d),K=!!(w&&D(w)),v=!f,O=v?void 0:Z(s?.threads.get()??de,d,r?.user?.id,f,K,{baseBranch:c}),b=v?void 0:O?.id??crypto.randomUUID();b&&!O&&f&&z(sessionStorage,a,b,{runtime:f}),q(e,{tabId:g,org:n.slug,agentId:d,search:()=>b?{thread:b}:{},replace:!1})},t[0]=c,t[1]=o,t[2]=a,t[3]=s?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const u=l;let h;return t[8]!==u||t[9]!==e||t[10]!==n.slug||t[11]!==i?(h=(d,g)=>{const f=g?.panel;if(!f){i(d),e(fe(n.slug,d));return}u(d,f,g?.runtime)},t[8]=u,t[9]=e,t[10]=n.slug,t[11]=i,t[12]=h):h=t[12],h}function fe(t,e){return{to:"/$org/projects/$agentId",params:{org:t,agentId:e},search:n=>({...n,project:void 0,virtualmcpid:void 0,thread:void 0,mainpanel:void 0})}}export{X as a,ue as b,Z as c,Se as d,ae as e,be as f,Ee as g,pe as h,I as p,Te as u};