decocms 4.518.1 → 4.518.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-Bis8M8cE.js → ActiveShapeUtils-EYkJV7tD.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-CF7oV00-.js → AlertCircle-CzTXJ0ax.js} +1 -1
  3. package/dist/client/assets/{AreaChart-rRgwbDdY.js → AreaChart-8lCOmLfE.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BYRX2oWU.js → ArrowLeft-BQThfb60.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C-Wi5Wp-.js → ArrowUp-DUhCibLH.js} +1 -1
  6. package/dist/client/assets/{BarChart-B-Yzzi8V.js → BarChart-2wCpTPJ2.js} +1 -1
  7. package/dist/client/assets/{Building02-BTo5ALb8.js → Building02-BOLEL9nK.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-D4q-R38l.js → CartesianChart-CmRg3x8T.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-DTvqZVLo.js → CategoricalChart-BtQQT8Ex.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-B7DLXg5D.js → CheckCircle-OCgBlAwW.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-ByVW2vd8.js → ChevronSelectorVertical-DaDJpoIU.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-i4o2LTaN.js → ChevronUp-DtSKb4be.js} +1 -1
  13. package/dist/client/assets/{Copy01-Ck9G4OUr.js → Copy01-DVWv3lef.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-DBL8NXSk.js → CreditCard01-Bw5uGiku.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-DGS_x5nz.js → DotsVertical-CEoX1VVK.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-ClwVJba6.js → ErrorBarContext-i8geYMQV.js} +1 -1
  17. package/dist/client/assets/{Globe04-lKXBAfc3.js → Globe04-CMBPkECo.js} +1 -1
  18. package/dist/client/assets/{Image01-Cwrowq3c.js → Image01-D_y3XkIW.js} +1 -1
  19. package/dist/client/assets/{Key01-CEbPGYnm.js → Key01-p2EsnMlr.js} +1 -1
  20. package/dist/client/assets/{Link01-DXqb71Uu.js → Link01-D28gAr0F.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-DhWTb9MO.js → LinkBroken01-Dz2vlPBe.js} +1 -1
  22. package/dist/client/assets/{Minus-C9yYSfDR.js → Minus-DNpWuD14.js} +1 -1
  23. package/dist/client/assets/{Monitor01-BL3DAm_1.js → Monitor01-CYm-wjzD.js} +1 -1
  24. package/dist/client/assets/{Play-CZ7QKkqf.js → Play-cNq95jJS.js} +1 -1
  25. package/dist/client/assets/{Plus-BRxUqR_F.js → Plus-C4rGoU1F.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-D1hjyX4I.js → ReferenceLine-BvmA07RC.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DiO3q0AT.js → SearchMd-BYCOzBqa.js} +1 -1
  28. package/dist/client/assets/{Sector-XuiRQ9ct.js → Sector-23KRNcXn.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-B4aQ0-ny.js → ShoppingBag01-DvN3FHxE.js} +1 -1
  30. package/dist/client/assets/{Sun-DqiY7Z2B.js → Sun-DFIh8Vd-.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-BbdJtypW.js → SwitchHorizontal01-D6mwjnXs.js} +1 -1
  32. package/dist/client/assets/{Tool01-C0vFHYhV.js → Tool01-_CVpzZpk.js} +1 -1
  33. package/dist/client/assets/{Trash01-bhcUMroB.js → Trash01-CgNTH-jr.js} +1 -1
  34. package/dist/client/assets/{Upload01-BwEuXdMa.js → Upload01-CiTZ5ZQQ.js} +1 -1
  35. package/dist/client/assets/{User01-DSs11bSF.js → User01-vLr2BfmM.js} +1 -1
  36. package/dist/client/assets/{UserSquare-DXYtKMfd.js → UserSquare-B7fe7FYj.js} +1 -1
  37. package/dist/client/assets/{Users01-CTqd0ZAH.js → Users01-BgSWeeD_.js} +1 -1
  38. package/dist/client/assets/{XClose-CxYwKo3k.js → XClose-B_rQyiiY.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-D-Ww048N.js → ZoomOut-DzrH576O.js} +1 -1
  40. package/dist/client/assets/{access-gate-Bq22oyfg.js → access-gate-CjdHb0j3.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-CQYwaYCv.js → add-connection-dialog-DyCA7E5B.js} +1 -1
  42. package/dist/client/assets/agent-analytics-C_1r2ktq.js +1 -0
  43. package/dist/client/assets/agent-app-DADhKCUS.js +1 -0
  44. package/dist/client/assets/{agent-assets-4YMODB__.js → agent-assets-AUU4xJcf.js} +1 -1
  45. package/dist/client/assets/{agent-automation-CmK6_mc6.js → agent-automation-H4qJ1HOM.js} +1 -1
  46. package/dist/client/assets/{agent-automations-BCX_o1aB.js → agent-automations-BCHMa4q1.js} +1 -1
  47. package/dist/client/assets/agent-calendar-BIC31eZQ.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-Bxy4Jo7k.js → agent-connect-sources-DO6Zn3Mx.js} +1 -1
  49. package/dist/client/assets/agent-deck-DfcsXmVh.js +1 -0
  50. package/dist/client/assets/{agent-e2e-BdqM7Rx1.js → agent-e2e-BswlcjA7.js} +1 -1
  51. package/dist/client/assets/agent-experiments-DacDH6n9.js +1 -0
  52. package/dist/client/assets/agent-file-DvvjQBtI.js +1 -0
  53. package/dist/client/assets/{agent-hosting-yUCKeG5I.js → agent-hosting-CgIJCVf2.js} +1 -1
  54. package/dist/client/assets/{agent-icon-CCDPFoN-.js → agent-icon-BVqmbz-P.js} +1 -1
  55. package/dist/client/assets/agent-library-D07m5-2P.js +1 -0
  56. package/dist/client/assets/agent-library-file-CKXkh_Ag.js +1 -0
  57. package/dist/client/assets/agent-monitor-T2Kisepj.js +1 -0
  58. package/dist/client/assets/{agent-overview-D27q04-k.js → agent-overview-BnCn329o.js} +1 -1
  59. package/dist/client/assets/{agent-releases-DhOHbzAx.js → agent-releases-PaWDRDlN.js} +1 -1
  60. package/dist/client/assets/agent-settings-CtpQVMq0.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-CoubOLH6.js → agent-site-editor-Dgv9OUYF.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-DEyTlk7z.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-CO78zdWN.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-C8DxePtH.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-BIS7z4mW.js → agent-view-guard-CIz__L_S.js} +1 -1
  66. package/dist/client/assets/agent-view-zDoYJpqf.js +1 -0
  67. package/dist/client/assets/{agents-list-CpVGk57l.js → agents-list-B9ydQIh8.js} +1 -1
  68. package/dist/client/assets/{ai-providers-C8dIcjWL.js → ai-providers-BvGFGpkW.js} +1 -1
  69. package/dist/client/assets/{alert-CmByshZi.js → alert-COKmPgNZ.js} +1 -1
  70. package/dist/client/assets/{alert-dialog-BcRtAren.js → alert-dialog-Bbqu21pF.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-CTEkK2Tf.js → analytics-sections-CXA9Djw5.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-DPVT4KOA.js → analytics-tab-CNbGVSyT.js} +2 -2
  73. package/dist/client/assets/api-keys-rvaVQMbg.js +1 -0
  74. package/dist/client/assets/{api-keys-DYTxKYWP.js → api-keys-zMWE0eW-.js} +1 -1
  75. package/dist/client/assets/{app-editor-C1ZA1u8T.js → app-editor-BnLt2HBc.js} +1 -1
  76. package/dist/client/assets/{asset-utils-DIN0M3zp.js → asset-utils-CQBKR3VN.js} +1 -1
  77. package/dist/client/assets/{auth-vu0NBiVX.js → auth-BypL5L1O.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-vhsgYqnn.js → auth-catchall-BeibfVV0.js} +1 -1
  79. package/dist/client/assets/{auth-entry-C6zNerIy.js → auth-entry-DgsnWxp_.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-DKwsje6s.js → auth-split-layout-Daxd6Ypw.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-Dj1wDkpb.js → authenticate-and-persist-oauth-ClTAD7nN.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DucKF7kG.js → automation-list-row-CvwYuhxk.js} +1 -1
  83. package/dist/client/assets/{automation-runs-Ui7o3JfN.js → automation-runs-CApbL_Sf.js} +1 -1
  84. package/dist/client/assets/{automations-CmK0evd4.js → automations-Di1Er6hW.js} +1 -1
  85. package/dist/client/assets/{autosend-ClHP6mj3.js → autosend-B4f5gabb.js} +1 -1
  86. package/dist/client/assets/{avatar-BfW8_V1B.js → avatar-CFO-sRGJ.js} +1 -1
  87. package/dist/client/assets/{badge-CqxA0I5-.js → badge-CYEiaJVw.js} +1 -1
  88. package/dist/client/assets/{block-document-l9rZniOP.js → block-document-C4MOQYjr.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-DIzgwExA.js → blocks-preview-workspace-context-Bq9hpUEB.js} +1 -1
  90. package/dist/client/assets/{blocks-tab-states-D014yZyw.js → blocks-tab-states-CwfYFgj9.js} +1 -1
  91. package/dist/client/assets/{blog-schema-p025Q_3k.js → blog-schema-CgYPJyE9.js} +1 -1
  92. package/dist/client/assets/{buckets-C4799eWK.js → buckets-DoEfEinO.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-C9nuC795.js → build-improve-prompt-doc-BByi4O7Q.js} +1 -1
  94. package/dist/client/assets/{calendar-C7UsyFmW.js → calendar-AEesHfNc.js} +1 -1
  95. package/dist/client/assets/{campaigns-view-Cz4ACJMm.js → campaigns-view-DTbZCmg6.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-rgxsCr8U.js → capability-load-error-BfKRzvUM.js} +1 -1
  97. package/dist/client/assets/{category-editor-CldKargp.js → category-editor-sR05FPNS.js} +1 -1
  98. package/dist/client/assets/cdn-tab-9RYVl35J.js +1 -0
  99. package/dist/client/assets/{chart-7lusH4mk.js → chart-D7lvPdFx.js} +1 -1
  100. package/dist/client/assets/{chat-context-DaG-xhpe.js → chat-context-DqNUlJMY.js} +1 -1
  101. package/dist/client/assets/{chat-draft-B4qXFQ20.js → chat-draft-DeylAkNb.js} +1 -1
  102. package/dist/client/assets/{checkbox-k3S7hbYo.js → checkbox-JO6XiJJq.js} +1 -1
  103. package/dist/client/assets/{choose-editor-DhoxAjmj.js → choose-editor-CQPIEsfr.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-9cwHK6DP.js → cli-auth-success-DksDQz1c.js} +1 -1
  105. package/dist/client/assets/{client-icons-XJM50Gvn.js → client-icons-DbBtP136.js} +1 -1
  106. package/dist/client/assets/cms-settings-editor-CD6Fhdzj.js +1 -0
  107. package/dist/client/assets/{collapsible-CCUbGddy.js → collapsible-CXUiqrZ3.js} +1 -1
  108. package/dist/client/assets/{collection-detail-BQphYH0i.js → collection-detail-BXm00G6J.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-DtypHbWr.js → collection-display-button-BYX1WGsT.js} +1 -1
  110. package/dist/client/assets/{collection-search-DFZiZHgj.js → collection-search-CVvFJ5Bb.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-D5vvhE9_.js → collection-table-wrapper-_tytodYv.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-5oBppmJp.js → collection-tabs-8dvqqnDR.js} +1 -1
  113. package/dist/client/assets/{column-rules-DikbPDpl.js → column-rules-iw7Orhw0.js} +1 -1
  114. package/dist/client/assets/{combobox--wUI1bJn.js → combobox-CS_HItwQ.js} +1 -1
  115. package/dist/client/assets/{command-A6J0_nSj.js → command-C9iGFbUT.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-DHW4_WEu.js → companion-mcps-section-DuvDeify.js} +1 -1
  117. package/dist/client/assets/{config-0cyLL49J.js → config-Ba5RPb40.js} +1 -1
  118. package/dist/client/assets/{connect-Bi8fTNRc.js → connect-Q-Yb-tbQ.js} +1 -1
  119. package/dist/client/assets/{connect-layout-BXupI1uo.js → connect-layout-BsURWVqR.js} +1 -1
  120. package/dist/client/assets/{connect-source-dialog-DUESoily.js → connect-source-dialog-Cugh2Kwq.js} +1 -1
  121. package/dist/client/assets/{connection-card-SGeLl-3V.js → connection-card-C_97TUuR.js} +1 -1
  122. package/dist/client/assets/{connection-detail-8iT2pzkA.js → connection-detail-B2pboQAc.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-5dAreg1i.js → connection-form-helpers-B61Y3llL.js} +1 -1
  124. package/dist/client/assets/{connection-DP0Tkqpu.js → connection-y8T_LUE4.js} +1 -1
  125. package/dist/client/assets/{connections-Ba0FzDee.js → connections-BtM211zd.js} +1 -1
  126. package/dist/client/assets/{content-tab-Co7UZ0ue.js → content-tab-6aM6SPfn.js} +3 -3
  127. package/dist/client/assets/{context-DSH71GyO.js → context-Dhzbo3rE.js} +1 -1
  128. package/dist/client/assets/{context-menu-m7JMy9Ts.js → context-menu-DvfYSbOF.js} +1 -1
  129. package/dist/client/assets/{context-shell-CHo3-a1U.js → context-shell-DQlTMTgZ.js} +3 -3
  130. package/dist/client/assets/{core.esm-BT3eS5hh.js → core.esm-Bnj1keGH.js} +1 -1
  131. package/dist/client/assets/{create-organization-dialog-t8CuAC-D.js → create-organization-dialog-BJw0GqGQ.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-EoXIBNAG.js → daily-pulse-ambOqGdx.js} +1 -1
  133. package/dist/client/assets/{discover-r5fXEWQj.js → discover-BaCG_0h-.js} +1 -1
  134. package/dist/client/assets/{domain-settings-Zd079_oe.js → domain-settings-DvRELpY-.js} +1 -1
  135. package/dist/client/assets/{drawer-BfInv3z-.js → drawer-txFUQcqx.js} +1 -1
  136. package/dist/client/assets/{editor-CpWj2GSL.js → editor-DxbkHv3R.js} +1 -1
  137. package/dist/client/assets/{editor-classes-5vsxGGPA.js → editor-classes-C__SrxMV.js} +1 -1
  138. package/dist/client/assets/{empty-state-BThdzdI0.js → empty-state-BCgDvmX-.js} +1 -1
  139. package/dist/client/assets/{empty-state-C97rGNTx.js → empty-state-bJzQYitF.js} +1 -1
  140. package/dist/client/assets/experiments-tab-DmhKoZxz.js +1 -0
  141. package/dist/client/assets/{experiments-tab-choice-CJxPrnzq.js → experiments-tab-choice-Ie5k_O6x.js} +1 -1
  142. package/dist/client/assets/{extract-connection-data-BJcueAXf.js → extract-connection-data-DrQExIK1.js} +1 -1
  143. package/dist/client/assets/{feature-gate-DOUh8nVg.js → feature-gate-Q2dMtYpF.js} +1 -1
  144. package/dist/client/assets/{feature-paywall-skggPdmN.js → feature-paywall-XpETcjbv.js} +1 -1
  145. package/dist/client/assets/{file-explorer-BB5wuYW2.js → file-explorer-CfVYwLoJ.js} +1 -1
  146. package/dist/client/assets/{file-preview-DYLPzEi6.js → file-preview-Dd06GGvy.js} +1 -1
  147. package/dist/client/assets/{file-share-button-B1svbxuR.js → file-share-button-BxZcqmJb.js} +1 -1
  148. package/dist/client/assets/{file-type-icon-Dh-YpP4t.js → file-type-icon-CIdo5ojc.js} +1 -1
  149. package/dist/client/assets/{folder-icon-CPXfYDTX.js → folder-icon-EiO3M0UC.js} +1 -1
  150. package/dist/client/assets/{form-Diz2j79C.js → form-uqsH1s-y.js} +1 -1
  151. package/dist/client/assets/{general-5pQPx87d.js → general-Vd-hJfIm.js} +1 -1
  152. package/dist/client/assets/{home-Dnlsm-wz.js → home-HWe4c99-.js} +1 -1
  153. package/dist/client/assets/{icon-button-DuuXKRCk.js → icon-button-BUDG7R_U.js} +1 -1
  154. package/dist/client/assets/{index-5O453B2L.js → index-7jvcir73.js} +1 -1
  155. package/dist/client/assets/{index-BvwkkTca.js → index-B4zmwgCj.js} +1 -1
  156. package/dist/client/assets/{index-D2_QRuAQ.js → index-B7PBSrog.js} +1 -1
  157. package/dist/client/assets/{index-Bw7ZdG0V.js → index-BCGh3XTH.js} +1 -1
  158. package/dist/client/assets/{index-CtJ5bSic.js → index-BP0spIbU.js} +1 -1
  159. package/dist/client/assets/{index-DY9jv8u5.js → index-BphI8pNH.js} +4 -4
  160. package/dist/client/assets/{index-Bpjyo8cb.js → index-BtufcGJ5.js} +1 -1
  161. package/dist/client/assets/{index-DPyR1fyZ.js → index-C5xgscqu.js} +1 -1
  162. package/dist/client/assets/{index-CH_rHFJ7.js → index-CW0mTKOH.js} +1 -1
  163. package/dist/client/assets/{index-u06bTyUt.js → index-C_7vDyVA.js} +1 -1
  164. package/dist/client/assets/{index-vOiCoekF.js → index-Codsxxmu.js} +1 -1
  165. package/dist/client/assets/{index-BMri_gPt.js → index-DDtLrgkt.js} +1 -1
  166. package/dist/client/assets/index-MPdUOMBb.css +1 -0
  167. package/dist/client/assets/{index-CjCEGRSu.js → index-kjyiSPIZ.js} +1 -1
  168. package/dist/client/assets/{index-redirect-BF2Ze6CX.js → index-redirect-TlUNx3Dt.js} +1 -1
  169. package/dist/client/assets/{index-hWaEVFzi.js → index-unPBFo0y.js} +1 -1
  170. package/dist/client/assets/{index-fElQwNzQ.js → index-v9zzzqiT.js} +1 -1
  171. package/dist/client/assets/{infiniteQueryObserver-Glyohd4p.js → infiniteQueryObserver-CD6zPv_B.js} +1 -1
  172. package/dist/client/assets/{infra-billing-Bd2bFoZ5.js → infra-billing-gJ1Pxkhj.js} +1 -1
  173. package/dist/client/assets/{input-Ca18CK1P.js → input-DeNGl9cT.js} +1 -1
  174. package/dist/client/assets/{input-F0XP3M77.js → input-otZYQGEr.js} +3 -3
  175. package/dist/client/assets/{integration-icon-BZ0SYBCb.js → integration-icon-C-_9oW7G.js} +1 -1
  176. package/dist/client/assets/{jira-icon-66RPgyoE.js → jira-icon-7kZdJvHs.js} +1 -1
  177. package/dist/client/assets/{label-CUbZuKc3.js → label-BXumUTqC.js} +1 -1
  178. package/dist/client/assets/{layout-Cedqx0JP.js → layout-Ba0KZf90.js} +1 -1
  179. package/dist/client/assets/{legacy-agents-deep-D41zNkt6.js → legacy-agents-deep-D4pxgM1l.js} +1 -1
  180. package/dist/client/assets/{legacy-main-redirect-B7bd3WDG.js → legacy-main-redirect-BQ_7LpiD.js} +1 -1
  181. package/dist/client/assets/library-1V2C8s_K.js +1 -0
  182. package/dist/client/assets/{login-BEUSAD5h.js → login-CtcB6JMd.js} +1 -1
  183. package/dist/client/assets/{markdown-CQTrkEJG.js → markdown-Bqq3R66p.js} +1 -1
  184. package/dist/client/assets/{mcp-app-renderer-CfeFa2D0.js → mcp-app-renderer-tCfKhIA1.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-DqI-dLnK.js → mcp-oauth-CaTRnuQU.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-dZFQnVjg.js → mcp-oauth-ZxlBJ_T6.js} +1 -1
  187. package/dist/client/assets/{members-D8letp2p.js → members-Ds3beXMQ.js} +1 -1
  188. package/dist/client/assets/{memory-C9mu7Zkb.js → memory-CgI9n1je.js} +1 -1
  189. package/dist/client/assets/{mini-report-page-JqpGP2GL.js → mini-report-page-C4CjzrcA.js} +1 -1
  190. package/dist/client/assets/{mock-board-BGHy2qG4.js → mock-board-x9OA1kIr.js} +3 -3
  191. package/dist/client/assets/{monaco-editor-nJc5wgpu.js → monaco-editor-DZ2Rp_C7.js} +1 -1
  192. package/dist/client/assets/monitoring-BkpBpvIZ.js +1 -0
  193. package/dist/client/assets/{monitoring-stats-row-BAFX8tUf.js → monitoring-stats-row-tdOtylzh.js} +1 -1
  194. package/dist/client/assets/{multi-select-DpaHzZAz.js → multi-select-BnYAqN90.js} +1 -1
  195. package/dist/client/assets/{mustache-CewpKCP1.js → mustache-DuPMqXPT.js} +1 -1
  196. package/dist/client/assets/{named-rule-uses-939Puzgt.js → named-rule-uses-BFHY2QY4.js} +1 -1
  197. package/dist/client/assets/{named-rule-view-CML2JnRp.js → named-rule-view-DHbEzjpv.js} +1 -1
  198. package/dist/client/assets/{new-project-dialog-BDUYA1Q9.js → new-project-dialog-Cs8HMQlb.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ClogQ-NW.js → oauth-callback-DSM8XE33.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-ai-provider-aAWOChDT.js → oauth-callback-ai-provider-DgCpBfDW.js} +1 -1
  201. package/dist/client/assets/{onboarding-DkM2lBLt.js → onboarding-DeVuIfK9.js} +1 -1
  202. package/dist/client/assets/{openai-conversation-CnNyoZHy.js → openai-conversation-CXYNFSGC.js} +1 -1
  203. package/dist/client/assets/{optimistic-project-sidebar-views-Dd9HCPLE.js → optimistic-project-sidebar-views-VOTXYU3D.js} +1 -1
  204. package/dist/client/assets/{order-monitor-day-D7yGjq7b.js → order-monitor-day-Bxp4gXEu.js} +1 -1
  205. package/dist/client/assets/{organization-choice-CVq2K-mi.js → organization-choice-BhCIGMjr.js} +1 -1
  206. package/dist/client/assets/{orgs-riRdPSVS.js → orgs-BPDKksL2.js} +1 -1
  207. package/dist/client/assets/{page-seo-form-DHiOVvvv.js → page-seo-form-WBlhJY38.js} +1 -1
  208. package/dist/client/assets/{pair-BiwOJOFx.js → pair-DRaIXAj-.js} +1 -1
  209. package/dist/client/assets/{parse-sections-Ce8e3CyM.js → parse-sections-ClqXxi6i.js} +1 -1
  210. package/dist/client/assets/{plan-Cpl6bs6l.js → plan-DVQ6L_2j.js} +1 -1
  211. package/dist/client/assets/{plan-ladder-DJwAssQD.js → plan-ladder-BJOn0tjJ.js} +1 -1
  212. package/dist/client/assets/{popover-B1ABR0kS.js → popover-D-MLGIKG.js} +1 -1
  213. package/dist/client/assets/{post-calendar-CtSEncUE.js → post-calendar-Ywpfpf68.js} +1 -1
  214. package/dist/client/assets/{post-editor-Cxxxfb0r.js → post-editor-tA48ONL1.js} +1 -1
  215. package/dist/client/assets/{preview-content-ULOD_UZt.js → preview-content-0nJULLLy.js} +1 -1
  216. package/dist/client/assets/{preview-dialog-CZYisvNu.js → preview-dialog-DweVJd_n.js} +1 -1
  217. package/dist/client/assets/{preview-panel-ItJi6Jc0.js → preview-panel-BJ3KrhDy.js} +1 -1
  218. package/dist/client/assets/{preview-tab-B6Q-8P-_.js → preview-tab-C3IiVwf1.js} +3 -3
  219. package/dist/client/assets/{product-picker-dialog-BHrHoQQK.js → product-picker-dialog-CCIg354O.js} +1 -1
  220. package/dist/client/assets/{profile-B6Cd5Dxw.js → profile-ZCnKsIdj.js} +1 -1
  221. package/dist/client/assets/{project-app-view-B1-HxYgX.js → project-app-view-BLZBQKeL.js} +1 -1
  222. package/dist/client/assets/{project-apps-Dler5z99.js → project-apps-FJ0TrEc6.js} +1 -1
  223. package/dist/client/assets/{project-feed-BwWFdPBj.js → project-feed-CZ6ECbBu.js} +1 -1
  224. package/dist/client/assets/{project-icon-BtGD--7Z.js → project-icon-J_TfV9WN.js} +1 -1
  225. package/dist/client/assets/project-reports-IwgSFkuk.js +1 -0
  226. package/dist/client/assets/project-tasks-DIh-1w8l.js +1 -0
  227. package/dist/client/assets/{projects-BbyUgZdk.js → projects-BGlrrPvQ.js} +1 -1
  228. package/dist/client/assets/{projects-empty-state-cl5VGT1T.js → projects-empty-state-B699jX9t.js} +1 -1
  229. package/dist/client/assets/{prompts-C7IgVGhQ.js → prompts-CL3pb_We.js} +1 -1
  230. package/dist/client/assets/record-editor-v6loIaK5.js +1 -0
  231. package/dist/client/assets/{redirect-editor-DGmg8IhI.js → redirect-editor-DwpwMdsP.js} +1 -1
  232. package/dist/client/assets/{releases-api-CS8wgmr5.js → releases-api-DX2L3yOb.js} +1 -1
  233. package/dist/client/assets/reports-VklqwHN4.js +1 -0
  234. package/dist/client/assets/{reports-J6WeamZr.js → reports-fz3ShzPV.js} +1 -1
  235. package/dist/client/assets/{reports-onboarding-BskSIDus.js → reports-onboarding-mTQFH_iA.js} +1 -1
  236. package/dist/client/assets/{reports-tab-a3KJftGt.js → reports-tab-Bon4oiNK.js} +2 -2
  237. package/dist/client/assets/repositories-DVBlDnPs.js +1 -0
  238. package/dist/client/assets/{repositories-BZocQhoR.js → repositories-Pjwn0cqi.js} +1 -1
  239. package/dist/client/assets/{repository-binding-DEE5HjOP.js → repository-binding-CqjA7Tko.js} +1 -1
  240. package/dist/client/assets/{repository-import-picker-WAot3Ghn.js → repository-import-picker-DRcn5MCM.js} +1 -1
  241. package/dist/client/assets/{repository-picker-DKd6y_Vd.js → repository-picker-BL6xlIly.js} +1 -1
  242. package/dist/client/assets/{require-capability-BdR5kRbu.js → require-capability-gPmNE28i.js} +1 -1
  243. package/dist/client/assets/{required-auth-layout-CXS5DXAp.js → required-auth-layout-BA3Gxw_5.js} +1 -1
  244. package/dist/client/assets/{reset-password-Br9V0wHS.js → reset-password-qyVzV1QI.js} +1 -1
  245. package/dist/client/assets/{resizable-CkWJ6g0G.js → resizable-Bu3AyxKl.js} +1 -1
  246. package/dist/client/assets/{resolve-tab-icon-BXRYZg2i.js → resolve-tab-icon-DXt8FU1X.js} +1 -1
  247. package/dist/client/assets/{review-settings-CfpCP4zo.js → review-settings-O8K_mvh6.js} +1 -1
  248. package/dist/client/assets/{roles-D-ySNiDm.js → roles-CCLRm2p0.js} +1 -1
  249. package/dist/client/assets/{route-DIJ9is23.js → route-DMrkbv9t.js} +1 -1
  250. package/dist/client/assets/{route-Bor9ph6H.js → route-DaeLPCnk.js} +1 -1
  251. package/dist/client/assets/route-jSSJr7H8.js +1 -0
  252. package/dist/client/assets/{runnable-block-editor-D1duQp0J.js → runnable-block-editor-DXVt1mRj.js} +3 -3
  253. package/dist/client/assets/{sandbox-lifecycle-context-DJrMSxNE.js → sandbox-lifecycle-context-CAD11jz7.js} +1 -1
  254. package/dist/client/assets/{schema-BiVd-UM7.js → schema-BKLQwKnK.js} +1 -1
  255. package/dist/client/assets/{schema-BXxpoJF8.js → schema-Ddw2ah-q.js} +1 -1
  256. package/dist/client/assets/{scroll-area-DdvxCYsk.js → scroll-area-GNWuujdQ.js} +1 -1
  257. package/dist/client/assets/{search-input-UGzUEySU.js → search-input-i8DAXvnS.js} +1 -1
  258. package/dist/client/assets/{search-toggle-09QkRcdu.js → search-toggle-C2BWIs4O.js} +1 -1
  259. package/dist/client/assets/{secret-ciphertext-D7Z8GkTt.js → secret-ciphertext-BA15G7qe.js} +1 -1
  260. package/dist/client/assets/{secret-picker-jW2RoOXq.js → secret-picker-CwZHe4Yx.js} +1 -1
  261. package/dist/client/assets/{secrets--oDOIL-g.js → secrets-BWNDO0aL.js} +1 -1
  262. package/dist/client/assets/{sections-Cktygxsr.js → sections-DhRieK41.js} +1 -1
  263. package/dist/client/assets/{sections-editor-Ykrd9ksj.js → sections-editor-TqSLQIU8.js} +1 -1
  264. package/dist/client/assets/{select-C48ly-p-.js → select-BAxIwkW7.js} +1 -1
  265. package/dist/client/assets/{select-model-qC-ddNWu.js → select-model-DKcSOpKv.js} +1 -1
  266. package/dist/client/assets/{seo-editor-vkCR941s.js → seo-editor-BhgypNCN.js} +1 -1
  267. package/dist/client/assets/{separator-CfwhkXab.js → separator-gKWGw3ec.js} +1 -1
  268. package/dist/client/assets/settings-tab-Cp66Lx0x.js +1 -0
  269. package/dist/client/assets/{sheet-C78dW_OW.js → sheet-Dy9d78N0.js} +1 -1
  270. package/dist/client/assets/{shell-layout-7jtYUd9L.js → shell-layout-DPflSDI7.js} +1 -1
  271. package/dist/client/assets/{site-draft-actions-DyZ1f4ik.js → site-draft-actions-BjAr6xi6.js} +1 -1
  272. package/dist/client/assets/site-draft-view-Bpwq-4Im.js +2 -0
  273. package/dist/client/assets/site-editor-CP2FSMmX.js +1 -0
  274. package/dist/client/assets/{site-editor-toast-C_UZBEd9.js → site-editor-toast-n7tT-SpR.js} +1 -1
  275. package/dist/client/assets/{skills-CHltBKqG.js → skills-C-lfUnzb.js} +1 -1
  276. package/dist/client/assets/{slider-DueO9EFe.js → slider-DMzP4oef.js} +1 -1
  277. package/dist/client/assets/{sortable.esm-D411R8sQ.js → sortable.esm-BEpH5tbt.js} +1 -1
  278. package/dist/client/assets/{sso-C7rH2Jsc.js → sso-Bdl8tzvn.js} +1 -1
  279. package/dist/client/assets/{suggestion-_sJX1Xs_.js → suggestion-BfzPP8A_.js} +1 -1
  280. package/dist/client/assets/{switch-Wb17Bg4i.js → switch-B0lPkF5_.js} +1 -1
  281. package/dist/client/assets/{symbol-CN-EQDYU.js → symbol-CcauWbN2.js} +1 -1
  282. package/dist/client/assets/{synced-repos-BRIUeky9.js → synced-repos-cKAzeg2x.js} +1 -1
  283. package/dist/client/assets/{tab-icon-glyph-BeHT1AU_.js → tab-icon-glyph-C2nHjzae.js} +1 -1
  284. package/dist/client/assets/{table-ChqbkXkJ.js → table-CeULXNQ2.js} +1 -1
  285. package/dist/client/assets/{tabs-D-bShRzz.js → tabs-fkqYJpP8.js} +1 -1
  286. package/dist/client/assets/{task-assignee-avatar-Db7T5j33.js → task-assignee-avatar-BuSQPIHq.js} +1 -1
  287. package/dist/client/assets/{task-board-NNGstnYy.js → task-board-Cv7D_3uN.js} +1 -1
  288. package/dist/client/assets/{task-route-BYz8Txhc.js → task-route-dMm35uIv.js} +1 -1
  289. package/dist/client/assets/{task-status-BtnjgBne.js → task-status-D3EaEAgF.js} +1 -1
  290. package/dist/client/assets/{taskboard-analytics-BiCEJijC.js → taskboard-analytics-C2Yib8gP.js} +1 -1
  291. package/dist/client/assets/tasks-5wUjot9O.js +1 -0
  292. package/dist/client/assets/{tasks-DscpmhWw.js → tasks-Cx6Zd4fY.js} +1 -1
  293. package/dist/client/assets/{textarea-DXNX9E30.js → textarea-aGNI5bvN.js} +1 -1
  294. package/dist/client/assets/{thread-analytics-BxM1u9ID.js → thread-analytics-B9HcTgTh.js} +1 -1
  295. package/dist/client/assets/{thread-intent-BYXYhdV9.js → thread-intent-BQGp3MKl.js} +1 -1
  296. package/dist/client/assets/{thread-route--lOZYDN5.js → thread-route-BEIPJEss.js} +1 -1
  297. package/dist/client/assets/{thread-route-EPwO0Tp5.js → thread-route-D147zL8e.js} +1 -1
  298. package/dist/client/assets/{thread-sheet-body-Doh4mgo7.js → thread-sheet-body-i2u8ULqW.js} +1 -1
  299. package/dist/client/assets/{time-range-picker-bYUcsgps.js → time-range-picker-0kVuNsQb.js} +1 -1
  300. package/dist/client/assets/{toggle-group-C__89QW8.js → toggle-group-DaYieoyW.js} +1 -1
  301. package/dist/client/assets/{tool-namespace-CjWGrg1d.js → tool-namespace-DqsoHKmd.js} +1 -1
  302. package/dist/client/assets/{toolbar-icon-button-Bn0QMDhj.js → toolbar-icon-button-3blDPoB6.js} +1 -1
  303. package/dist/client/assets/{tooltip-CjIqGzku.js → tooltip-2YCPx1DM.js} +1 -1
  304. package/dist/client/assets/{tooltipContext-BlJpYj2n.js → tooltipContext-CgeI21sB.js} +1 -1
  305. package/dist/client/assets/{track-DiwbUXrF.js → track-DO9rvMbw.js} +1 -1
  306. package/dist/client/assets/{types-2FdJQAcI.js → types-6BxgL_uJ.js} +1 -1
  307. package/dist/client/assets/{url-slug-SgUmhnUm.js → url-slug-DxJ8K4M_.js} +1 -1
  308. package/dist/client/assets/{usage-stats-mjbSmunu.js → usage-stats-BHO2m1GZ.js} +1 -1
  309. package/dist/client/assets/{use-ai-providers-Ui8zDguo.js → use-ai-providers-D11veeve.js} +1 -1
  310. package/dist/client/assets/{use-apply-named-rule-DqZvErCE.js → use-apply-named-rule-B4OGys4b.js} +1 -1
  311. package/dist/client/assets/{use-automations-C1_nM6XA.js → use-automations-tbwaowTj.js} +1 -1
  312. package/dist/client/assets/{use-autosave-DUE5eTHe.js → use-autosave-DfMGkaud.js} +1 -1
  313. package/dist/client/assets/{use-chat-layout-state-Civkwlwx.js → use-chat-layout-state-CIyU-XxO.js} +1 -1
  314. package/dist/client/assets/{use-clock-tick-BglfF91b.js → use-clock-tick-DRqivY5H.js} +1 -1
  315. package/dist/client/assets/{use-connect-companion-DXE20Cit.js → use-connect-companion-pRfQU03M.js} +1 -1
  316. package/dist/client/assets/{use-connection-DjG9Ar0-.js → use-connection-hBtWetVy.js} +1 -1
  317. package/dist/client/assets/{use-content-sync-UBduiNPN.js → use-content-sync-DTts1O7D.js} +1 -1
  318. package/dist/client/assets/{use-copy-D-ZUZJVe.js → use-copy-Ctyjo3u8.js} +1 -1
  319. package/dist/client/assets/{use-create-virtual-mcp-zb51VTao.js → use-create-virtual-mcp-BoVnWYo_.js} +1 -1
  320. package/dist/client/assets/{use-date-fns-locale-DDB69sAw.js → use-date-fns-locale-BL151nA9.js} +1 -1
  321. package/dist/client/assets/{use-debounced-autosave-sMVb1_hn.js → use-debounced-autosave-XfpamUxh.js} +1 -1
  322. package/dist/client/assets/{use-debounced-value-0e-te_rl.js → use-debounced-value-DppuiHxU.js} +1 -1
  323. package/dist/client/assets/{use-deco-credits-zw0Jw-tt.js → use-deco-credits-DAnq8bae.js} +1 -1
  324. package/dist/client/assets/{use-decopilot-events-BQLXDAAl.js → use-decopilot-events-CmWo-JmL.js} +1 -1
  325. package/dist/client/assets/{use-delete-connection-CcIoRjhU.js → use-delete-connection-D4L5Nbwc.js} +1 -1
  326. package/dist/client/assets/{use-deployment-admin-s7tGTRS4.js → use-deployment-admin-CqRFItVm.js} +1 -1
  327. package/dist/client/assets/{use-fast-preview-draft-url-B9Iu3h_6.js → use-fast-preview-draft-url-6n7ATrzr.js} +1 -1
  328. package/dist/client/assets/{use-file-configs-CDeU2xvZ.js → use-file-configs-BukUB2a7.js} +1 -1
  329. package/dist/client/assets/{use-inbox-feed-CFSuERBJ.js → use-inbox-feed-DWwwp0yB.js} +1 -1
  330. package/dist/client/assets/{use-infinite-scroll-BopUCEp4.js → use-infinite-scroll-CAGEOw6T.js} +1 -1
  331. package/dist/client/assets/{use-join-requests-D2jJesnC.js → use-join-requests-C5RVOca9.js} +1 -1
  332. package/dist/client/assets/{use-main-panel-tabs--2YvNIZr.js → use-main-panel-tabs-C_SiePFc.js} +1 -1
  333. package/dist/client/assets/{use-mcp-auth-status-DEXNa6Oz.js → use-mcp-auth-status-CPaTWfZe.js} +1 -1
  334. package/dist/client/assets/{use-mcp-client-owuI-9F9.js → use-mcp-client-DsrOnW9o.js} +1 -1
  335. package/dist/client/assets/{use-mcp-prompts-8FxF45h0.js → use-mcp-prompts-B5RvuVy4.js} +1 -1
  336. package/dist/client/assets/{use-mcp-tools-qNpUlzik.js → use-mcp-tools-oOqD73aG.js} +1 -1
  337. package/dist/client/assets/{use-members-VmpszULL.js → use-members-DQZYP7Cb.js} +1 -1
  338. package/dist/client/assets/{use-mobile-CqyBz8Dx.js → use-mobile-DruvZ2zF.js} +1 -1
  339. package/dist/client/assets/{use-move-blocks-Cnva5RwQ.js → use-move-blocks-C7t8R0hh.js} +1 -1
  340. package/dist/client/assets/{use-navigate-to-agent-DdSspEm5.js → use-navigate-to-agent-CfXi671z.js} +1 -1
  341. package/dist/client/assets/{use-open-billing-url-CO2ZloNb.js → use-open-billing-url-0u6Rqj8b.js} +1 -1
  342. package/dist/client/assets/{use-org-auth-client-BQ7kloKy.js → use-org-auth-client-CSFZu3Wj.js} +1 -1
  343. package/dist/client/assets/{use-org-fs-CvYQh_B2.js → use-org-fs-Bndw9m25.js} +1 -1
  344. package/dist/client/assets/{use-org-repo-syncs-BtFmt_qd.js → use-org-repo-syncs-DgWzYW9F.js} +1 -1
  345. package/dist/client/assets/{use-org-sso-B9p-4KH7.js → use-org-sso-B7o6rhq2.js} +1 -1
  346. package/dist/client/assets/{use-organization-roles-Cu4J92yA.js → use-organization-roles-DPfq-0hG.js} +1 -1
  347. package/dist/client/assets/{use-organization-settings-BcSo4teS.js → use-organization-settings-B2e749tN.js} +1 -1
  348. package/dist/client/assets/{use-panel-navigate-Co0XZmSD.js → use-panel-navigate-C-ip5ing.js} +1 -1
  349. package/dist/client/assets/{use-project-native-view-presence-BRsKjCEJ.js → use-project-native-view-presence-iEIqgCZR.js} +1 -1
  350. package/dist/client/assets/{use-project-scope-BL3NRFI4.js → use-project-scope-DN9qkINS.js} +1 -1
  351. package/dist/client/assets/{use-recent-apps-RjVee3Pq.js → use-recent-apps-Dieru2LM.js} +1 -1
  352. package/dist/client/assets/{use-releases-vjl0fUb-.js → use-releases-DJrTmfLZ.js} +1 -1
  353. package/dist/client/assets/{use-reports-diagnostic-B0L8y4wc.js → use-reports-diagnostic-BdDNwhZy.js} +1 -1
  354. package/dist/client/assets/{use-sandbox-events-Bjcn7PU6.js → use-sandbox-events-B-rKhgAE.js} +1 -1
  355. package/dist/client/assets/{use-secrets-D9Bq6nE_.js → use-secrets-C3hSYvUx.js} +1 -1
  356. package/dist/client/assets/{use-section-preview-base-Vjigvtig.js → use-section-preview-base-NrYdhHI5.js} +1 -1
  357. package/dist/client/assets/{use-session-runtime-C-ErRuug.js → use-session-runtime-RS_ZeJDS.js} +1 -1
  358. package/dist/client/assets/{use-sidebar-collapsed-oSws9nsi.js → use-sidebar-collapsed-C9KH2wzy.js} +1 -1
  359. package/dist/client/assets/{use-tags-pfCDbF9Z.js → use-tags-DBJgOg0Z.js} +1 -1
  360. package/dist/client/assets/{use-task-board-analytics-CopE-4zr.js → use-task-board-analytics-Bl-3jKgS.js} +1 -1
  361. package/dist/client/assets/{use-task-board-events-C280-Zim.js → use-task-board-events-CemAfTjA.js} +1 -1
  362. package/dist/client/assets/{use-task-board-item-prs-x7ZAMu8t.js → use-task-board-item-prs-83sFKoAa.js} +1 -1
  363. package/dist/client/assets/{use-task-metadata-CDV-25sQ.js → use-task-metadata-DYSGuNJN.js} +1 -1
  364. package/dist/client/assets/{use-thread-analytics-RcDxA37Q.js → use-thread-analytics-B-gfPcTz.js} +1 -1
  365. package/dist/client/assets/{use-thread-outputs-orGxjs9L.js → use-thread-outputs-9KkInEd1.js} +1 -1
  366. package/dist/client/assets/useInfiniteQuery-Ctv8zOi3.js +1 -0
  367. package/dist/client/assets/{useQueries-M-H4-oNf.js → useQueries-BRUig2bT.js} +1 -1
  368. package/dist/client/assets/useSuspenseInfiniteQuery-DRLUIOlU.js +1 -0
  369. package/dist/client/assets/{users-Yugcw0oy.js → users-zGj6iqQJ.js} +1 -1
  370. package/dist/client/assets/{utils-Cwt2fdOd.js → utils-DnxtSQ0E.js} +1 -1
  371. package/dist/client/assets/{variant-calendar-r5D0JiAM.js → variant-calendar-DzngKeid.js} +1 -1
  372. package/dist/client/assets/{variant-matcher-override-Dcw_0UNB.js → variant-matcher-override-BvLc7beb.js} +1 -1
  373. package/dist/client/assets/{virtual-mcp-D9lu2UG3.js → virtual-mcp-CKcyAjRE.js} +1 -1
  374. package/dist/client/assets/{watch-sse-pool-BEBGvoea.js → watch-sse-pool-B6MhK1l7.js} +1 -1
  375. package/dist/client/index.html +2 -2
  376. package/dist/server/server.js +1 -1
  377. package/package.json +1 -1
  378. package/dist/client/assets/agent-analytics-B-zaohtV.js +0 -1
  379. package/dist/client/assets/agent-app-BbV2xIu_.js +0 -1
  380. package/dist/client/assets/agent-calendar-Ddf3r2JM.js +0 -1
  381. package/dist/client/assets/agent-deck-UP8oQtvT.js +0 -1
  382. package/dist/client/assets/agent-experiments-CrVBOIKR.js +0 -1
  383. package/dist/client/assets/agent-file-Cb4leotK.js +0 -1
  384. package/dist/client/assets/agent-library-DMqKWgMi.js +0 -1
  385. package/dist/client/assets/agent-library-file-DOe-l166.js +0 -1
  386. package/dist/client/assets/agent-monitor-DpSfxETg.js +0 -1
  387. package/dist/client/assets/agent-settings-D_kjSJft.js +0 -1
  388. package/dist/client/assets/agent-site-editor-code-CdfJCg4-.js +0 -2
  389. package/dist/client/assets/agent-site-editor-content-C-o-blM5.js +0 -1
  390. package/dist/client/assets/agent-site-editor-preview-D1F79zUW.js +0 -1
  391. package/dist/client/assets/agent-view-PuW3-X6q.js +0 -1
  392. package/dist/client/assets/api-keys-CNy2dZat.js +0 -1
  393. package/dist/client/assets/cms-settings-editor-VytgeION.js +0 -1
  394. package/dist/client/assets/experiments-tab-BQyQ_6Nt.js +0 -1
  395. package/dist/client/assets/index-DjdMnw7p.css +0 -1
  396. package/dist/client/assets/library-D71H_oBI.js +0 -1
  397. package/dist/client/assets/monitor-v8-CHgzPfyd.js +0 -1
  398. package/dist/client/assets/monitoring-BtZh6NEX.js +0 -1
  399. package/dist/client/assets/project-reports-DigBj5UN.js +0 -1
  400. package/dist/client/assets/project-tasks-ckZ9YIhp.js +0 -1
  401. package/dist/client/assets/record-editor-DulCdbwX.js +0 -1
  402. package/dist/client/assets/reports-ChrL-50F.js +0 -1
  403. package/dist/client/assets/repositories-BS-pBlSH.js +0 -1
  404. package/dist/client/assets/route-DTfdE-p1.js +0 -1
  405. package/dist/client/assets/settings-tab-BR68FSDQ.js +0 -1
  406. package/dist/client/assets/site-draft-view-BRWWuiN5.js +0 -2
  407. package/dist/client/assets/site-editor-JG7QILYD.js +0 -1
  408. package/dist/client/assets/tasks-CtzEjcDR.js +0 -1
  409. package/dist/client/assets/useInfiniteQuery-C3FB4QSd.js +0 -1
  410. package/dist/client/assets/useSuspenseInfiniteQuery-zAujesU3.js +0 -1
@@ -1 +1 @@
1
- import{c as s,m,K as c}from"./index-DY9jv8u5.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:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}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,m,K as c}from"./index-BphI8pNH.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:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}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,r as S}from"./index-DY9jv8u5.js";import{D,w,c as P}from"./section-preview-url-7zfngvgW.js";import{u as g,z as b,al as M,am as I}from"./site-editor-toast-C_UZBEd9.js";import{i as O,w as k}from"./preview-link-C762yHOt.js";import{a as R}from"./variant-draft-pointer-BeAKcq_c.js";import{u as y}from"./use-session-runtime-C-ErRuug.js";function F(e){const{pointer:t}=e;if(!t||t===D)return null;const n=t.indexOf("?");return O(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:k(R(t,e.forcedVariants),e.previewOptions)}function L(e,t){if(!e||!t)return null;try{return w(e,t)}catch{return null}}function B(e,t,n){if(!e||!n)return null;try{return L(new URL(t,e).toString(),n)}catch{return null}}const a={forcedVariants:[],previewOptions:{}},d=new Map,v=new Map;function x(e,t){return JSON.stringify(e)===JSON.stringify(t)}function C(e,t){const n=d.get(e)??a,i=t??a;if(!x(n,i)){t?d.set(e,i):d.delete(e);for(const r of v.get(e)??[])r()}}function V(e){return d.get(e)??a}function $(e,t){let n=v.get(e);return n||(n=new Set,v.set(e,n)),n.add(t),()=>{n.delete(t)}}function E(e){const t=c.c(3);let n,i;return t[0]!==e?(n=r=>$(e,r),i=()=>V(e),t[0]=e,t[1]=n,t[2]=i):(n=t[1],i=t[2]),S.useSyncExternalStore(n,i,U)}function U(){return a}function N(e,t){const n=c.c(3),i=E(e);let r;return n[0]!==i||n[1]!==t?(r=F({pointer:t,...i}),n[0]=i,n[1]=t,n[2]=r):r=n[2],r}function h(e){const t=c.c(3),n=y(e?.virtualMcpId).runtime==="cms",i=g(e?.virtualMcpId,e?.branch),r=i.kind==="protocol"&&i.source==="github",o=M(e),u=I(r?e:null);if(!e||!n)return null;if(r)return u;let l;return t[0]!==o||t[1]!==e?(l=o?P({...e,...o}):null,t[0]=o,t[1]=e,t[2]=l):l=t[2],l}function T(e){const t=c.c(3),n=h(e),i=g(e.virtualMcpId,e.branch),r=i.kind==="protocol"&&i.source==="github";let o;t[0]!==e.orgSlug||t[1]!==e.virtualMcpId?(o=b(e.orgSlug,e.virtualMcpId),t[0]=e.orgSlug,t[1]=e.virtualMcpId,t[2]=o):o=t[2];const u=N(o,r?n:null);return r?u:n}function j(e){const t=c.c(11);let n;t[0]!==e?(n=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=n):n=t[1];const i=h(n),r=e?.previewServerUrl??null;let o=null;if(r)try{let s;t[2]!==r?(s=new URL(r),t[2]=r,t[3]=s):s=t[3],o=s.host}catch{o=null}let u;t[4]!==i||t[5]!==e||t[6]!==r?(u=e&&r&&i?w(new URL(e.path,r).toString(),i):null,t[4]=i,t[5]=e,t[6]=r,t[7]=u):u=t[7];const l=u;let f;return t[8]!==o||t[9]!==l?(f={url:l,host:o},t[8]=o,t[9]=l,t[10]=f):f=t[10],f}export{L as a,C as b,h as c,N as d,B as e,T as f,F as p,j as u};
1
+ import{c,r as S}from"./index-BphI8pNH.js";import{D,w,c as P}from"./section-preview-url-7zfngvgW.js";import{u as g,z as b,al as M,am as I}from"./site-editor-toast-n7tT-SpR.js";import{i as O,w as k}from"./preview-link-C762yHOt.js";import{a as R}from"./variant-draft-pointer-BeAKcq_c.js";import{u as y}from"./use-session-runtime-RS_ZeJDS.js";function F(e){const{pointer:t}=e;if(!t||t===D)return null;const n=t.indexOf("?");return O(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:k(R(t,e.forcedVariants),e.previewOptions)}function L(e,t){if(!e||!t)return null;try{return w(e,t)}catch{return null}}function B(e,t,n){if(!e||!n)return null;try{return L(new URL(t,e).toString(),n)}catch{return null}}const a={forcedVariants:[],previewOptions:{}},d=new Map,v=new Map;function x(e,t){return JSON.stringify(e)===JSON.stringify(t)}function C(e,t){const n=d.get(e)??a,i=t??a;if(!x(n,i)){t?d.set(e,i):d.delete(e);for(const r of v.get(e)??[])r()}}function V(e){return d.get(e)??a}function $(e,t){let n=v.get(e);return n||(n=new Set,v.set(e,n)),n.add(t),()=>{n.delete(t)}}function E(e){const t=c.c(3);let n,i;return t[0]!==e?(n=r=>$(e,r),i=()=>V(e),t[0]=e,t[1]=n,t[2]=i):(n=t[1],i=t[2]),S.useSyncExternalStore(n,i,U)}function U(){return a}function N(e,t){const n=c.c(3),i=E(e);let r;return n[0]!==i||n[1]!==t?(r=F({pointer:t,...i}),n[0]=i,n[1]=t,n[2]=r):r=n[2],r}function h(e){const t=c.c(3),n=y(e?.virtualMcpId).runtime==="cms",i=g(e?.virtualMcpId,e?.branch),r=i.kind==="protocol"&&i.source==="github",o=M(e),u=I(r?e:null);if(!e||!n)return null;if(r)return u;let l;return t[0]!==o||t[1]!==e?(l=o?P({...e,...o}):null,t[0]=o,t[1]=e,t[2]=l):l=t[2],l}function T(e){const t=c.c(3),n=h(e),i=g(e.virtualMcpId,e.branch),r=i.kind==="protocol"&&i.source==="github";let o;t[0]!==e.orgSlug||t[1]!==e.virtualMcpId?(o=b(e.orgSlug,e.virtualMcpId),t[0]=e.orgSlug,t[1]=e.virtualMcpId,t[2]=o):o=t[2];const u=N(o,r?n:null);return r?u:n}function j(e){const t=c.c(11);let n;t[0]!==e?(n=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=n):n=t[1];const i=h(n),r=e?.previewServerUrl??null;let o=null;if(r)try{let s;t[2]!==r?(s=new URL(r),t[2]=r,t[3]=s):s=t[3],o=s.host}catch{o=null}let u;t[4]!==i||t[5]!==e||t[6]!==r?(u=e&&r&&i?w(new URL(e.path,r).toString(),i):null,t[4]=i,t[5]=e,t[6]=r,t[7]=u):u=t[7];const l=u;let f;return t[8]!==o||t[9]!==l?(f={url:l,host:o},t[8]=o,t[9]=l,t[10]=f):f=t[10],f}export{L as a,C as b,h as c,N as d,B as e,T as f,F as p,j as u};
@@ -1 +1 @@
1
- import{c as r,a2 as f,an as d,K as C,m as E,R as I,o as F,e as g}from"./index-DY9jv8u5.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,a2 as f,an as d,K as C,m as E,R as I,o as F,e as g}from"./index-BphI8pNH.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 k,a2 as M,an as S,o as T,e as v,a as A,r as q,K}from"./index-DY9jv8u5.js";import{u as O}from"./useInfiniteQuery-C3FB4QSd.js";import{n as Q}from"./watch-sse-pool-BEBGvoea.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}=A.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],q.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,a2 as M,an as S,o as T,e as v,a as A,r as q,K}from"./index-BphI8pNH.js";import{u as O}from"./useInfiniteQuery-Ctv8zOi3.js";import{n as Q}from"./watch-sse-pool-B6MhK1l7.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}=A.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],q.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-DY9jv8u5.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-BphI8pNH.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{r as L,a2 as q,o as Q,a as V,aE as z,b as B,e as T,y as F,t as S,K as M,j as t,D as G,p as U,q as Z,s as k,v as Y,w as $,B as P,aG as H,c as J,an as K,ax as W,m as X}from"./index-DY9jv8u5.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-Diz2j79C.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-C48ly-p-.js";import{T as re}from"./textarea-DXNX9E30.js";import{u as ae}from"./use-org-auth-client-BQ7kloKy.js";import{u as le}from"./use-organization-roles-Cu4J92yA.js";const ce=H().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),b=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),x=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async y=>{const R=await b.organization.inviteMember({email:y,role:s});if(R.error)throw new Error(R.error.message);return R.data})),w=a.filter(y=>y.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}x.mutate({emails:p,role:n.role})},v=p.length>0&&!!j;return t.jsxs(G,{open:d,onOpenChange:c,children:[t.jsx(U,{asChild:!0,children:e}),t.jsxs(Z,{className:"sm:max-w-lg",children:[t.jsx(k,{children:t.jsx(Y,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:x.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:x.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs($,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:x.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:x.isPending||!v,children:x.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:b}=W(),r=b||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=X(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function be(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),b=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==b?(m=()=>{b.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),b.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=b,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=v=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:v}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=v=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:v}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const x=T(i);let D;return e[26]!==E||e[27]!==x?(D={approve:E,deny:x},e[26]=E,e[27]=x,e[28]=D):D=e[28],D}export{ve as I,be as a,xe as u};
1
+ import{r as L,a2 as q,o as Q,a as V,aE as z,b as B,e as T,y as F,t as S,K as M,j as t,D as G,p as U,q as Z,s as k,v as Y,w as $,B as P,aG as H,c as J,an as K,ax as W,m as X}from"./index-BphI8pNH.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-uqsH1s-y.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-BAxIwkW7.js";import{T as re}from"./textarea-aGNI5bvN.js";import{u as ae}from"./use-org-auth-client-CSFZu3Wj.js";import{u as le}from"./use-organization-roles-DPfq-0hG.js";const ce=H().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),b=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),x=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async y=>{const R=await b.organization.inviteMember({email:y,role:s});if(R.error)throw new Error(R.error.message);return R.data})),w=a.filter(y=>y.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}x.mutate({emails:p,role:n.role})},v=p.length>0&&!!j;return t.jsxs(G,{open:d,onOpenChange:c,children:[t.jsx(U,{asChild:!0,children:e}),t.jsxs(Z,{className:"sm:max-w-lg",children:[t.jsx(k,{children:t.jsx(Y,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:x.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:x.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs($,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:x.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:x.isPending||!v,children:x.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:b}=W(),r=b||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=X(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function be(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),b=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==b?(m=()=>{b.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),b.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=b,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=v=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:v}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=v=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:v}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const x=T(i);let D;return e[26]!==E||e[27]!==x?(D={approve:E,deny:x},e[26]=E,e[27]=x,e[28]=D):D=e[28],D}export{ve as I,be as a,xe as u};
@@ -1 +1 @@
1
- import{c as Ee,b as He,u as Le,a2 as Oe,fl as Be,fm as Ke,fn as le,fo as de,al as $e,aj as me,fp as qe,fq as Qe,r as Y,dU as We,M as pe,fr as _e,fs as ze}from"./index-DY9jv8u5.js";import{a as Ge}from"./use-chat-layout-state-Civkwlwx.js";import{b as Je}from"./agent-icon-CCDPFoN-.js";import{i as Xe}from"./Monitor01-BL3DAm_1.js";import{u as Ye}from"./use-connection-DjG9Ar0-.js";import{a as Ze}from"./use-mcp-client-owuI-9F9.js";import{u as et}from"./use-mcp-tools-qNpUlzik.js";import{a as tt}from"./repository-binding-DEE5HjOP.js";import{g as at}from"./types-2FdJQAcI.js";import{t as ot}from"./utils-CVEq3hMx.js";import{u as nt,a as F}from"./experiments-tab-choice-CJxPrnzq.js";import"./index-vOiCoekF.js";import{u as st}from"./use-sandbox-events-Bjcn7PU6.js";import{F as ue}from"./file-type-icon-Dh-YpP4t.js";import{a as it,u as rt}from"./use-panel-navigate-Co0XZmSD.js";import{r as Z}from"./resolve-tab-icon-BXRYZg2i.js";import{u as ct}from"./use-task-metadata-CDV-25sQ.js";import{r as lt}from"./preview-source-BsRLGWUP.js";import{i as dt,r as mt,s as pt}from"./shell-layout-7jtYUd9L.js";import{u as ut}from"./use-session-runtime-C-ErRuug.js";import{u as ft}from"./use-organization-settings-BcSo4teS.js";import{u as bt}from"./use-project-scope-BL3NRFI4.js";import{b as Tt,u as It,c as vt,d as Pt,f as yt}from"./use-project-native-view-presence-BRsKjCEJ.js";import{c as gt}from"./chat-context-DaG-xhpe.js";import{r as kt}from"./virtual-mcp-D9lu2UG3.js";function Yt(o){const e=Ee.c(35),d=He(),{openPanel:b,closePanel:U}=it();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T={strict:!1},e[0]=T):T=e[0];const fe=Le(T),ee=rt(),te=Ge(),i=tt(o.virtualMcpId),I=ct(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=gt(),m=i?.metadata.ui?.layout??null,r=m?.tabs??[],c=i?.id?Be(i.id):null,P=I?.expanded_tools??[],y=ft(),{scopeId:Te,project:Ie}=bt(),g=Tt(Te,Ie,i),p=It(g.project);nt(g.project?.id);const ae=vt(g.resolvedScopeId,F(g.project?.metadata),p.presence);let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k={includeVirtual:!0},e[1]=k):k=e[1];const u=Ye(k),ve=st(),x=v?.branch??be;let w;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==I||e[6]!==x?(w=lt({threadId:o.taskId,sandboxBranch:x,agentHasRepo:F(i?.metadata),threadHasRepo:F(I)||F(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=I,e[6]=x,e[7]=w):w=e[7];const Pe=w,E=ve.lifecycle.phase==="running",{runtime:ye,resolved:oe}=ut(o.virtualMcpId),H=!!c&&E;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=Ze({connectionId:c,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&E;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:ge}=et(V),se=c&&E?(ge?.tools??[]).filter(Mt).map(t=>({connectionId:c,toolName:t.name,label:ot(t.name),icon:null})):[],B=se[0],ke=B?se:[],f=B&&c?{type:"ext-apps",id:c,toolName:B.toolName}:m?.defaultMainView??null,we=kt(m),ie={assets:p.assetsPending,siteAccess:p.siteAccessPending,releases:p.releasesPending,calendar:p.calendarPending},{activeTab:M,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:f||m?{defaultMainView:f,tabs:r.map(Vt)}:null}),he=f||m?{defaultMainView:f,tabs:r.map(ht)}:null,C=mt({hasSource:Pe==="repo"||y,runtime:ye,cmsMode:we}),Ve=C.includes("content"),Me=le(he),Ce=f?.type,re=Pt(Ce,ae,ie,C,oe),K=re?le(null):Me,Se=yt(M,ae,ie),Ne=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&re||M==="content"&&!Ve||Ne||Se?K:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const je=S,q=new Map;for(const t of P){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 ke){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 Q=qe(a),W=Q?Q.key.split("/").pop()??Q.key:null,Ae=W?[{id:a,title:W,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:W,...t})}}]:[],N=Qe(a),De=N?[{id:a,title:(N.path.split("/").pop()??N.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(N.path.startsWith("pages/")?Je:Xe,t)}}]:[],_=We(a),z=_?_.path.split("/").pop()??_.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=dt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:u})})):[];let j;e[15]!==u?(j=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:u})}),e[15]=u,e[16]=j):j=e[16];const Ue=[...Fe,...Ae,...De,...Re,...r.map(j),...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:u})}))],ce=new Set,G=Ue.filter(t=>ce.has(t.id)?!1:(ce.add(t.id),!0)),xe=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const J=xe===A;let D;e[19]!==a||e[20]!==U||e[21]!==l||e[22]!==J||e[23]!==b||e[24]!==n.id||e[25]!==y?(D=t=>{if(pt({reportsOnly:y,onReportAgent:J,tabId:t})){b(t,{virtualmcpid:pe(n.id),search:wt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?U():b(s.tabId)},e[19]=a,e[20]=U,e[21]=l,e[22]=J,e[23]=b,e[24]=n.id,e[25]=y,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==P||e[30]!==r||e[31]!==l||e[32]!==X||e[33]!==G?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:r,expandedTools:P,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=P,e[30]=r,e[31]=l,e[32]=X,e[33]=G,e[34]=R):R=e[34],R}function wt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!at(o._meta)}export{Yt as u};
1
+ import{c as Ee,b as He,u as Le,a2 as Oe,fl as Be,fm as Ke,fn as le,fo as de,al as $e,aj as me,fp as qe,fq as Qe,r as Y,dU as We,M as pe,fr as _e,fs as ze}from"./index-BphI8pNH.js";import{a as Ge}from"./use-chat-layout-state-CIyU-XxO.js";import{b as Je}from"./agent-icon-BVqmbz-P.js";import{i as Xe}from"./Monitor01-CYm-wjzD.js";import{u as Ye}from"./use-connection-hBtWetVy.js";import{a as Ze}from"./use-mcp-client-DsrOnW9o.js";import{u as et}from"./use-mcp-tools-oOqD73aG.js";import{a as tt}from"./repository-binding-CqjA7Tko.js";import{g as at}from"./types-6BxgL_uJ.js";import{t as ot}from"./utils-CVEq3hMx.js";import{u as nt,a as F}from"./experiments-tab-choice-Ie5k_O6x.js";import"./index-Codsxxmu.js";import{u as st}from"./use-sandbox-events-B-rKhgAE.js";import{F as ue}from"./file-type-icon-CIdo5ojc.js";import{a as it,u as rt}from"./use-panel-navigate-C-ip5ing.js";import{r as Z}from"./resolve-tab-icon-DXt8FU1X.js";import{u as ct}from"./use-task-metadata-DYSGuNJN.js";import{r as lt}from"./preview-source-BsRLGWUP.js";import{i as dt,r as mt,s as pt}from"./shell-layout-DPflSDI7.js";import{u as ut}from"./use-session-runtime-RS_ZeJDS.js";import{u as ft}from"./use-organization-settings-B2e749tN.js";import{u as bt}from"./use-project-scope-DN9qkINS.js";import{b as Tt,u as It,c as vt,d as Pt,f as yt}from"./use-project-native-view-presence-iEIqgCZR.js";import{c as gt}from"./chat-context-DqNUlJMY.js";import{r as kt}from"./virtual-mcp-CKcyAjRE.js";function Yt(o){const e=Ee.c(35),d=He(),{openPanel:b,closePanel:U}=it();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T={strict:!1},e[0]=T):T=e[0];const fe=Le(T),ee=rt(),te=Ge(),i=tt(o.virtualMcpId),I=ct(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=gt(),m=i?.metadata.ui?.layout??null,r=m?.tabs??[],c=i?.id?Be(i.id):null,P=I?.expanded_tools??[],y=ft(),{scopeId:Te,project:Ie}=bt(),g=Tt(Te,Ie,i),p=It(g.project);nt(g.project?.id);const ae=vt(g.resolvedScopeId,F(g.project?.metadata),p.presence);let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k={includeVirtual:!0},e[1]=k):k=e[1];const u=Ye(k),ve=st(),x=v?.branch??be;let w;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==I||e[6]!==x?(w=lt({threadId:o.taskId,sandboxBranch:x,agentHasRepo:F(i?.metadata),threadHasRepo:F(I)||F(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=I,e[6]=x,e[7]=w):w=e[7];const Pe=w,E=ve.lifecycle.phase==="running",{runtime:ye,resolved:oe}=ut(o.virtualMcpId),H=!!c&&E;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=Ze({connectionId:c,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&E;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:ge}=et(V),se=c&&E?(ge?.tools??[]).filter(Mt).map(t=>({connectionId:c,toolName:t.name,label:ot(t.name),icon:null})):[],B=se[0],ke=B?se:[],f=B&&c?{type:"ext-apps",id:c,toolName:B.toolName}:m?.defaultMainView??null,we=kt(m),ie={assets:p.assetsPending,siteAccess:p.siteAccessPending,releases:p.releasesPending,calendar:p.calendarPending},{activeTab:M,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:f||m?{defaultMainView:f,tabs:r.map(Vt)}:null}),he=f||m?{defaultMainView:f,tabs:r.map(ht)}:null,C=mt({hasSource:Pe==="repo"||y,runtime:ye,cmsMode:we}),Ve=C.includes("content"),Me=le(he),Ce=f?.type,re=Pt(Ce,ae,ie,C,oe),K=re?le(null):Me,Se=yt(M,ae,ie),Ne=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&re||M==="content"&&!Ve||Ne||Se?K:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const je=S,q=new Map;for(const t of P){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 ke){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 Q=qe(a),W=Q?Q.key.split("/").pop()??Q.key:null,Ae=W?[{id:a,title:W,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:W,...t})}}]:[],N=Qe(a),De=N?[{id:a,title:(N.path.split("/").pop()??N.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(N.path.startsWith("pages/")?Je:Xe,t)}}]:[],_=We(a),z=_?_.path.split("/").pop()??_.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=dt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:u})})):[];let j;e[15]!==u?(j=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:u})}),e[15]=u,e[16]=j):j=e[16];const Ue=[...Fe,...Ae,...De,...Re,...r.map(j),...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:u})}))],ce=new Set,G=Ue.filter(t=>ce.has(t.id)?!1:(ce.add(t.id),!0)),xe=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const J=xe===A;let D;e[19]!==a||e[20]!==U||e[21]!==l||e[22]!==J||e[23]!==b||e[24]!==n.id||e[25]!==y?(D=t=>{if(pt({reportsOnly:y,onReportAgent:J,tabId:t})){b(t,{virtualmcpid:pe(n.id),search:wt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?U():b(s.tabId)},e[19]=a,e[20]=U,e[21]=l,e[22]=J,e[23]=b,e[24]=n.id,e[25]=y,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==P||e[30]!==r||e[31]!==l||e[32]!==X||e[33]!==G?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:r,expandedTools:P,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=P,e[30]=r,e[31]=l,e[32]=X,e[33]=G,e[34]=R):R=e[34],R}function wt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!at(o._meta)}export{Yt as u};
@@ -1 +1 @@
1
- import{c as b,b as N,a3 as k,aV as S,j as o,a2 as $,K as A,R as L}from"./index-DY9jv8u5.js";import{B as g}from"./badge-CqxA0I5-.js";import{c as v,T,a as I,b as _}from"./tooltip-CjIqGzku.js";import{g as H}from"./types-2FdJQAcI.js";import{s as P}from"./Image01-Cwrowq3c.js";import{v as R,aN as U}from"./agent-icon-CCDPFoN-.js";import{i as w}from"./mcp-oauth-DqI-dLnK.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:R,variant:"outline"}];function Q(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=N();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?O.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(U,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let 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=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>w({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,V as u};
1
+ import{c as b,b as N,a3 as k,aV as S,j as o,a2 as $,K as A,R as L}from"./index-BphI8pNH.js";import{B as g}from"./badge-CYEiaJVw.js";import{c as v,T,a as I,b as _}from"./tooltip-2YCPx1DM.js";import{g as H}from"./types-6BxgL_uJ.js";import{s as P}from"./Image01-D_y3XkIW.js";import{v as R,aN as U}from"./agent-icon-BVqmbz-P.js";import{i as w}from"./mcp-oauth-CaTRnuQU.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:R,variant:"outline"}];function Q(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=N();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?O.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(U,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let 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=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>w({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,V as u};
@@ -1,4 +1,4 @@
1
- import{ca as ce,cb as le,cc as ue,cd as de,ce as he,cf as m,cg as g,ch as fe,ci as pe,cj as me,ck as M,cl as _e,cm as F,cn as we,co as q,cp as ge,cq as D,cr as Te,cs as ye,ct as ke,cu as z,cv as ve,cw as Se,cx as Ce,cy as ee,cz as be,cA as Re,cB as Ie,bg as Ee,cC as qe,cD as Pe,cE as A,cF as $e,cG as Me,cH as Ae,cI as He,cJ as Oe,cK as xe,cL as Ne,cM as Ue,cN as je,cO as Fe,cP as De,cQ as Le,cR as Ve,b7 as V,cS as Qe,cT as N,K as te,J as ze,c as se,R as Je,m as We}from"./index-DY9jv8u5.js";import{U as P,b as H,c as J}from"./auth-vu0NBiVX.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},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,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 U=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:U(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:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(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{ca as ce,cb as le,cc as ue,cd as de,ce as he,cf as m,cg as g,ch as fe,ci as pe,cj as me,ck as M,cl as _e,cm as F,cn as we,co as q,cp as ge,cq as D,cr as Te,cs as ye,ct as ke,cu as z,cv as ve,cw as Se,cx as Ce,cy as ee,cz as be,cA as Re,cB as Ie,bg as Ee,cC as qe,cD as Pe,cE as A,cF as $e,cG as Me,cH as Ae,cI as He,cJ as Oe,cK as xe,cL as Ne,cM as Ue,cN as je,cO as Fe,cP as De,cQ as Le,cR as Ve,b7 as V,cS as Qe,cT as N,K as te,J as ze,c as se,R as Je,m as We}from"./index-BphI8pNH.js";import{U as P,b as H,c as J}from"./auth-BypL5L1O.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},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,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 U=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:U(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:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(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,m as u,cf as m,cg as f,R as y,K as n}from"./index-DY9jv8u5.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
1
+ import{c as l,m as u,cf as m,cg as f,R as y,K as n}from"./index-BphI8pNH.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,R as p,m as q,K as m}from"./index-DY9jv8u5.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,R as p,m as q,K as m}from"./index-BphI8pNH.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
@@ -1 +1 @@
1
- import{c,a2 as m,m as b,R as M,K as f}from"./index-DY9jv8u5.js";import{u as y}from"./use-org-auth-client-BQ7kloKy.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],M(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],b(l)}export{d as a,q as u};
1
+ import{c,a2 as m,m as b,R as M,K as f}from"./index-BphI8pNH.js";import{u as y}from"./use-org-auth-client-CSFZu3Wj.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],M(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],b(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-DY9jv8u5.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-BphI8pNH.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
@@ -1 +1 @@
1
- import{c as I,o as N,e as U,K as R}from"./index-DY9jv8u5.js";import{u as A}from"./use-session-runtime-C-ErRuug.js";import{o as G,c as L,u as z,D as H,F as Y,Q as $,P as V,q as T,J as W,G as X,M as Z,H as ee}from"./site-editor-toast-C_UZBEd9.js";import{s as te}from"./sandbox-git-api-CH_-QFpD.js";import{u as oe}from"./chat-context-DaG-xhpe.js";import{b as _}from"./sandbox-url-D3mC8qhT.js";import{d as B}from"./utils-Cwt2fdOd.js";import{K as se}from"./parse-sections-Ce8e3CyM.js";function ye(C){const e=I.c(50),{orgSlug:s,virtualMcpId:t,branch:o}=C,r=N(),P=oe()?.taskId??null,g=G(t),E=A(t).runtime==="cms",{url:x}=L(t),k=z(t,o),w=k.kind==="protocol"?k:null;let b;e[0]!==o||e[1]!==s||e[2]!==t?(b={orgSlug:s,virtualMcpId:t,branch:o},e[0]=o,e[1]=s,e[2]=t,e[3]=b):b=e[3];const u=H(b);let v;e[4]!==u?(v=R.decofile(u),e[4]=u,e[5]=v):v=e[5];const d=v;let K;e[6]!==o||e[7]!==E||e[8]!==x||e[9]!==s||e[10]!==g||e[11]!==r||e[12]!==P||e[13]!==t?(K=async(c,f)=>{if(x)return{ok:!0};if(E){const n=await $({orgSlug:s,virtualMcpId:t,branch:o},{set:c,delete:f});return V(r,{orgSlug:s,virtualMcpId:t,branch:o},n),await r.invalidateQueries({queryKey:te({orgSlug:s,virtualMcpId:t,branch:o,threadId:P})}),n}const l={orgSlug:s,virtualMcpId:t,branch:o,threadId:P};for(const[n,i]of Object.entries(c)){const M=await fetch(_(l,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:T(g,B(n)),content:JSON.stringify(i,null,2)})});if(!M.ok)return W(M,"Write")}for(const n of f){const i=await fetch(_(l,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:T(g,B(n))})});if(!i.ok)return W(i,"Delete")}return{ok:!0}},e[6]=o,e[7]=E,e[8]=x,e[9]=s,e[10]=g,e[11]=r,e[12]=P,e[13]=t,e[14]=K):K=e[14];const q=K;let y;e[15]!==o||e[16]!==s||e[17]!==t?(y=X(s,t,o),e[15]=o,e[16]=s,e[17]=t,e[18]=y):y=e[18];let p;e[19]!==o||e[20]!==s||e[21]!==t?(p=Y(s,t,o),e[19]=o,e[20]=s,e[21]=t,e[22]=p):p=e[22];let m;e[23]!==k||e[24]!==o||e[25]!==u||e[26]!==q||e[27]!==s||e[28]!==w||e[29]!==r||e[30]!==t?(m=async c=>{const{writes:f,deletes:l}=c,n=se(f);return w?Z(r,w,{orgSlug:s,virtualMcpId:t,branch:o},u,{set:n,delete:l.filter(i=>!(i in n))}):ee({queryClient:r,orgSlug:s,virtualMcpId:t,branch:o,backend:k,cacheKey:u},{kind:"edit",write:()=>q(n,l)})},e[23]=k,e[24]=o,e[25]=u,e[26]=q,e[27]=s,e[28]=w,e[29]=r,e[30]=t,e[31]=m):m=e[31];let h;e[32]!==o||e[33]!==s||e[34]!==r||e[35]!==t?(h=()=>{r.invalidateQueries({queryKey:R.liveMeta(s,t,o)})},e[32]=o,e[33]=s,e[34]=r,e[35]=t,e[36]=h):h=e[36];let S;e[37]!==y||e[38]!==p||e[39]!==m||e[40]!==h?(S={mutationKey:y,scope:p,mutationFn:m,onSuccess:h},e[37]=y,e[38]=p,e[39]=m,e[40]=h,e[41]=S):S=e[41];const a=U(S);let D;e[42]!==a||e[43]!==r||e[44]!==d?(D=async c=>{const f=[...Object.keys(c.writes),...c.deletes],l=r.getQueryData(d),n=new Map;for(const i of f)l&&i in l&&n.set(i,l[i]);r.setQueryData(d,i=>re(i,c)),r.cancelQueries({queryKey:d});try{return await a.mutateAsync(c)}catch(i){const M=i;throw r.setQueryData(d,F=>{if(!F)return F;const J={...F};for(const O of f)n.has(O)?J[O]=n.get(O):delete J[O];return J}),M}},e[42]=a,e[43]=r,e[44]=d,e[45]=D):D=e[45];const j=D;let Q;return e[46]!==j||e[47]!==a.isError||e[48]!==a.isPending?(Q={move:j,isPending:a.isPending,isError:a.isError},e[46]=j,e[47]=a.isError,e[48]=a.isPending,e[49]=Q):Q=e[49],Q}function re(C,{writes:e,deletes:s}){const t={...C??{},...e};for(const o of s)o in e||delete t[o];return t}export{re as a,ye as u};
1
+ import{c as I,o as N,e as U,K as R}from"./index-BphI8pNH.js";import{u as A}from"./use-session-runtime-RS_ZeJDS.js";import{o as G,c as L,u as z,D as H,F as Y,Q as $,P as V,q as T,J as W,G as X,M as Z,H as ee}from"./site-editor-toast-n7tT-SpR.js";import{s as te}from"./sandbox-git-api-CH_-QFpD.js";import{u as oe}from"./chat-context-DqNUlJMY.js";import{b as _}from"./sandbox-url-D3mC8qhT.js";import{d as B}from"./utils-DnxtSQ0E.js";import{K as se}from"./parse-sections-ClqXxi6i.js";function ye(C){const e=I.c(50),{orgSlug:s,virtualMcpId:t,branch:o}=C,r=N(),P=oe()?.taskId??null,g=G(t),E=A(t).runtime==="cms",{url:x}=L(t),k=z(t,o),w=k.kind==="protocol"?k:null;let b;e[0]!==o||e[1]!==s||e[2]!==t?(b={orgSlug:s,virtualMcpId:t,branch:o},e[0]=o,e[1]=s,e[2]=t,e[3]=b):b=e[3];const u=H(b);let v;e[4]!==u?(v=R.decofile(u),e[4]=u,e[5]=v):v=e[5];const d=v;let K;e[6]!==o||e[7]!==E||e[8]!==x||e[9]!==s||e[10]!==g||e[11]!==r||e[12]!==P||e[13]!==t?(K=async(c,f)=>{if(x)return{ok:!0};if(E){const n=await $({orgSlug:s,virtualMcpId:t,branch:o},{set:c,delete:f});return V(r,{orgSlug:s,virtualMcpId:t,branch:o},n),await r.invalidateQueries({queryKey:te({orgSlug:s,virtualMcpId:t,branch:o,threadId:P})}),n}const l={orgSlug:s,virtualMcpId:t,branch:o,threadId:P};for(const[n,i]of Object.entries(c)){const M=await fetch(_(l,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:T(g,B(n)),content:JSON.stringify(i,null,2)})});if(!M.ok)return W(M,"Write")}for(const n of f){const i=await fetch(_(l,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:T(g,B(n))})});if(!i.ok)return W(i,"Delete")}return{ok:!0}},e[6]=o,e[7]=E,e[8]=x,e[9]=s,e[10]=g,e[11]=r,e[12]=P,e[13]=t,e[14]=K):K=e[14];const q=K;let y;e[15]!==o||e[16]!==s||e[17]!==t?(y=X(s,t,o),e[15]=o,e[16]=s,e[17]=t,e[18]=y):y=e[18];let p;e[19]!==o||e[20]!==s||e[21]!==t?(p=Y(s,t,o),e[19]=o,e[20]=s,e[21]=t,e[22]=p):p=e[22];let m;e[23]!==k||e[24]!==o||e[25]!==u||e[26]!==q||e[27]!==s||e[28]!==w||e[29]!==r||e[30]!==t?(m=async c=>{const{writes:f,deletes:l}=c,n=se(f);return w?Z(r,w,{orgSlug:s,virtualMcpId:t,branch:o},u,{set:n,delete:l.filter(i=>!(i in n))}):ee({queryClient:r,orgSlug:s,virtualMcpId:t,branch:o,backend:k,cacheKey:u},{kind:"edit",write:()=>q(n,l)})},e[23]=k,e[24]=o,e[25]=u,e[26]=q,e[27]=s,e[28]=w,e[29]=r,e[30]=t,e[31]=m):m=e[31];let h;e[32]!==o||e[33]!==s||e[34]!==r||e[35]!==t?(h=()=>{r.invalidateQueries({queryKey:R.liveMeta(s,t,o)})},e[32]=o,e[33]=s,e[34]=r,e[35]=t,e[36]=h):h=e[36];let S;e[37]!==y||e[38]!==p||e[39]!==m||e[40]!==h?(S={mutationKey:y,scope:p,mutationFn:m,onSuccess:h},e[37]=y,e[38]=p,e[39]=m,e[40]=h,e[41]=S):S=e[41];const a=U(S);let D;e[42]!==a||e[43]!==r||e[44]!==d?(D=async c=>{const f=[...Object.keys(c.writes),...c.deletes],l=r.getQueryData(d),n=new Map;for(const i of f)l&&i in l&&n.set(i,l[i]);r.setQueryData(d,i=>re(i,c)),r.cancelQueries({queryKey:d});try{return await a.mutateAsync(c)}catch(i){const M=i;throw r.setQueryData(d,F=>{if(!F)return F;const J={...F};for(const O of f)n.has(O)?J[O]=n.get(O):delete J[O];return J}),M}},e[42]=a,e[43]=r,e[44]=d,e[45]=D):D=e[45];const j=D;let Q;return e[46]!==j||e[47]!==a.isError||e[48]!==a.isPending?(Q={move:j,isPending:a.isPending,isError:a.isError},e[46]=j,e[47]=a.isError,e[48]=a.isPending,e[49]=Q):Q=e[49],Q}function re(C,{writes:e,deletes:s}){const t={...C??{},...e};for(const o of s)o in e||delete t[o];return t}export{re as a,ye as u};
@@ -1 +1 @@
1
- import{c as g,au as I,aw as D,m as S,ap as A,K as L,a2 as _,d as Y,o as V,a as J,aa as F,d6 as j,d7 as k,dc as W}from"./index-DY9jv8u5.js";import{h as v,r as C,g as $,f as x,e as z,i as X}from"./repository-binding-DEE5HjOP.js";import{p as Z,u as M,d as P,w as ee}from"./thread-intent-BYXYhdV9.js";const E=[],te=4;function ne(t,e){return[e,...t.filter(n=>n!==e)].slice(0,te)}function ae(t){const e=g.c(9);let n;e[0]!==t?(n=D.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[a,r]=I(n,E),o=Array.isArray(a)?a:E;let s,i;e[2]!==r?(s=c=>r(l=>ne(Array.isArray(l)?l:E,c)),i=c=>r(l=>(Array.isArray(l)?l:E).filter(m=>m!==c)),e[2]=r,e[3]=s,e[4]=i):(s=e[3],i=e[4]);let u;return e[5]!==o||e[6]!==s||e[7]!==i?(u={recent:o,remember:s,forget:i},e[5]=o,e[6]=s,e[7]=i,e[8]=u):u=e[8],u}function B(t,e){if(!e)return!0;if(t.partial)return!1;const n=Z(t.metadata?.runtime);return n===null||n===e}function O(t,e,n,a,r){let o=null;for(const s of t)s.virtual_mcp_id===e&&s.created_by===n&&(s.hidden||B(s,a)&&(r&&s.branch===r||(!o||s.updated_at>o.updated_at)&&(o=s)));return o}function Re(t,e,n,a){return t.find(r=>!r.hidden&&r.virtual_mcp_id===e&&r.created_by===n&&r.title==="New chat"&&!r.harness_id&&B(r,a))}function re(t,e,n,a,r,o){return r?O(t,e,n,a,o?.baseBranch)??void 0:O(t,e,n,a)??void 0}const se=6e4,U=3e4;function N(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function oe(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 K(t){const{orgSlug:e,target:n,owner:a,repo:r,branch:o}=t;return{queryKey:L.githubPrState(e,C(n),a,r,o),queryFn:()=>A(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&v(n)&&!!a&&!!r,refetchInterval:se,refetchIntervalInBackground:!1,staleTime:U}}function ie(t){const e=g.c(4);let n;e[0]!==t?(n=K(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ue},e[2]=n,e[3]=a):a=e[3],S(a)}function ue(t){return t.changeRequest?N(t.changeRequest):null}function Ee(t){const e=g.c(4);let n;e[0]!==t?(n=K(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ce},e[2]=n,e[3]=a):a=e[3],S(a)}function ce(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(oe):[]}const le=5*6e4;function Se(t){const e=g.c(20),{orgSlug:n,target:a,owner:r,repo:o,base:s}=t;let i;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==a?(i=L.githubLastPublishedPr(n,C(a),r,o,s),e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==s||e[7]!==n||e[8]!==a?(u=()=>A(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=u):u=e[9];let c;e[10]!==t.enabled||e[11]!==s||e[12]!==r||e[13]!==o||e[14]!==a?(c=(t.enabled??!0)&&!!s&&v(a)&&!!r&&!!o,e[10]=t.enabled,e[11]=s,e[12]=r,e[13]=o,e[14]=a,e[15]=c):c=e[15];let l;return e[16]!==i||e[17]!==u||e[18]!==c?(l={queryKey:i,queryFn:u,enabled:c,staleTime:le,select:de},e[16]=i,e[17]=u,e[18]=c,e[19]=l):l=e[19],S(l)}function de(t){return t.changeRequest?N(t.changeRequest):null}const fe=50;function Pe(t){const e=g.c(17),{orgSlug:n,target:a,owner:r,repo:o}=t;let s;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==a?(s=L.githubOpenPrs(n,C(a),r,o),e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=s):s=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>A(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:fe}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==r||e[10]!==o||e[11]!==a?(u=(t.enabled??!0)&&v(a)&&!!r&&!!o,e[8]=t.enabled,e[9]=r,e[10]=o,e[11]=a,e[12]=u):u=e[12];let c;return e[13]!==s||e[14]!==i||e[15]!==u?(c={queryKey:s,queryFn:i,enabled:u,staleTime:U,select:he},e[13]=s,e[14]=i,e[15]=u,e[16]=c):c=e[16],S(c)}function he(t){return t.changeRequests.map(N)}function ge(t,e){const{org:n}=_(),a=$(t);return ie({orgId:n.id,orgSlug:n.slug,target:x(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const me=[];function Ae(){const t=g.c(15),e=Y(),{org:n,locator:a}=_(),r=V(),o=z(),{data:s}=J.useSession(),i=M(),u=ge(void 0,null),c=F(),{remember:l}=ae(n.slug);let m;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==c||t[7]!==l||t[8]!==s?.user?.id?(m=(d,f,y)=>{if(c&&!f?.panel){l(d),e(G(n.slug,d));return}const h=f?.panel??"overview";if(j(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:d,replace:!1});return}const p=(o??[]).find(H=>H.id===d),Q=!!(p&&$(p)),q=!f?.runtime,w=q?void 0:re(i?.threads.get()??me,d,s?.user?.id,y??(p?P(p.metadata):void 0),Q,{baseBranch:u}),R=q?void 0:w?.id??crypto.randomUUID();R&&!w&&f?.runtime&&ee(sessionStorage,a,R,{runtime:f.runtime}),k(e,{tabId:h,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=c,t[7]=l,t[8]=s?.user?.id,t[9]=m):m=t[9];const b=m;let T;return t[10]!==o||t[11]!==b||t[12]!==n||t[13]!==r?(T=(d,f)=>{if(j(f?.panel??"overview").kind==="org-destination")return b(d,f,void 0);const y=o.find(h=>h.id===d);if(f?.runtime)return b(d,f,f.runtime);if(y)return b(d,f,P(y.metadata));X(r,n).then(h=>h.find(p=>p.id===d)).catch(be).then(h=>b(d,f,h?P(h.metadata):void 0))},t[10]=o,t[11]=b,t[12]=n,t[13]=r,t[14]=T):T=t[14],T}function be(){}function G(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})}}function Le(){const t=g.c(3),{org:e}=_(),n=F();let a;return t[0]!==e.slug||t[1]!==n?(a=(r,o)=>{if(n&&!o)return G(e.slug,r);const s=W({tabId:o??"overview",org:e.slug,agentId:r});return{to:s.to,params:s.params,search:s.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{Le as a,ae as b,ge as c,re as d,Pe as e,Re as f,ie as g,Se as h,Ee as i,K as p,Ae as u};
1
+ import{c as g,au as I,aw as D,m as S,ap as A,K as L,a2 as _,d as Y,o as V,a as J,aa as F,d6 as j,d7 as k,dc as W}from"./index-BphI8pNH.js";import{h as v,r as C,g as $,f as x,e as z,i as X}from"./repository-binding-CqjA7Tko.js";import{p as Z,u as M,d as P,w as ee}from"./thread-intent-BQGp3MKl.js";const E=[],te=4;function ne(t,e){return[e,...t.filter(n=>n!==e)].slice(0,te)}function ae(t){const e=g.c(9);let n;e[0]!==t?(n=D.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[a,r]=I(n,E),o=Array.isArray(a)?a:E;let s,i;e[2]!==r?(s=c=>r(l=>ne(Array.isArray(l)?l:E,c)),i=c=>r(l=>(Array.isArray(l)?l:E).filter(m=>m!==c)),e[2]=r,e[3]=s,e[4]=i):(s=e[3],i=e[4]);let u;return e[5]!==o||e[6]!==s||e[7]!==i?(u={recent:o,remember:s,forget:i},e[5]=o,e[6]=s,e[7]=i,e[8]=u):u=e[8],u}function B(t,e){if(!e)return!0;if(t.partial)return!1;const n=Z(t.metadata?.runtime);return n===null||n===e}function O(t,e,n,a,r){let o=null;for(const s of t)s.virtual_mcp_id===e&&s.created_by===n&&(s.hidden||B(s,a)&&(r&&s.branch===r||(!o||s.updated_at>o.updated_at)&&(o=s)));return o}function Re(t,e,n,a){return t.find(r=>!r.hidden&&r.virtual_mcp_id===e&&r.created_by===n&&r.title==="New chat"&&!r.harness_id&&B(r,a))}function re(t,e,n,a,r,o){return r?O(t,e,n,a,o?.baseBranch)??void 0:O(t,e,n,a)??void 0}const se=6e4,U=3e4;function N(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function oe(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 K(t){const{orgSlug:e,target:n,owner:a,repo:r,branch:o}=t;return{queryKey:L.githubPrState(e,C(n),a,r,o),queryFn:()=>A(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&v(n)&&!!a&&!!r,refetchInterval:se,refetchIntervalInBackground:!1,staleTime:U}}function ie(t){const e=g.c(4);let n;e[0]!==t?(n=K(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ue},e[2]=n,e[3]=a):a=e[3],S(a)}function ue(t){return t.changeRequest?N(t.changeRequest):null}function Ee(t){const e=g.c(4);let n;e[0]!==t?(n=K(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ce},e[2]=n,e[3]=a):a=e[3],S(a)}function ce(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(oe):[]}const le=5*6e4;function Se(t){const e=g.c(20),{orgSlug:n,target:a,owner:r,repo:o,base:s}=t;let i;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==a?(i=L.githubLastPublishedPr(n,C(a),r,o,s),e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==s||e[7]!==n||e[8]!==a?(u=()=>A(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=u):u=e[9];let c;e[10]!==t.enabled||e[11]!==s||e[12]!==r||e[13]!==o||e[14]!==a?(c=(t.enabled??!0)&&!!s&&v(a)&&!!r&&!!o,e[10]=t.enabled,e[11]=s,e[12]=r,e[13]=o,e[14]=a,e[15]=c):c=e[15];let l;return e[16]!==i||e[17]!==u||e[18]!==c?(l={queryKey:i,queryFn:u,enabled:c,staleTime:le,select:de},e[16]=i,e[17]=u,e[18]=c,e[19]=l):l=e[19],S(l)}function de(t){return t.changeRequest?N(t.changeRequest):null}const fe=50;function Pe(t){const e=g.c(17),{orgSlug:n,target:a,owner:r,repo:o}=t;let s;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==a?(s=L.githubOpenPrs(n,C(a),r,o),e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=s):s=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>A(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:fe}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==r||e[10]!==o||e[11]!==a?(u=(t.enabled??!0)&&v(a)&&!!r&&!!o,e[8]=t.enabled,e[9]=r,e[10]=o,e[11]=a,e[12]=u):u=e[12];let c;return e[13]!==s||e[14]!==i||e[15]!==u?(c={queryKey:s,queryFn:i,enabled:u,staleTime:U,select:he},e[13]=s,e[14]=i,e[15]=u,e[16]=c):c=e[16],S(c)}function he(t){return t.changeRequests.map(N)}function ge(t,e){const{org:n}=_(),a=$(t);return ie({orgId:n.id,orgSlug:n.slug,target:x(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const me=[];function Ae(){const t=g.c(15),e=Y(),{org:n,locator:a}=_(),r=V(),o=z(),{data:s}=J.useSession(),i=M(),u=ge(void 0,null),c=F(),{remember:l}=ae(n.slug);let m;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==c||t[7]!==l||t[8]!==s?.user?.id?(m=(d,f,y)=>{if(c&&!f?.panel){l(d),e(G(n.slug,d));return}const h=f?.panel??"overview";if(j(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:d,replace:!1});return}const p=(o??[]).find(H=>H.id===d),Q=!!(p&&$(p)),q=!f?.runtime,w=q?void 0:re(i?.threads.get()??me,d,s?.user?.id,y??(p?P(p.metadata):void 0),Q,{baseBranch:u}),R=q?void 0:w?.id??crypto.randomUUID();R&&!w&&f?.runtime&&ee(sessionStorage,a,R,{runtime:f.runtime}),k(e,{tabId:h,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=c,t[7]=l,t[8]=s?.user?.id,t[9]=m):m=t[9];const b=m;let T;return t[10]!==o||t[11]!==b||t[12]!==n||t[13]!==r?(T=(d,f)=>{if(j(f?.panel??"overview").kind==="org-destination")return b(d,f,void 0);const y=o.find(h=>h.id===d);if(f?.runtime)return b(d,f,f.runtime);if(y)return b(d,f,P(y.metadata));X(r,n).then(h=>h.find(p=>p.id===d)).catch(be).then(h=>b(d,f,h?P(h.metadata):void 0))},t[10]=o,t[11]=b,t[12]=n,t[13]=r,t[14]=T):T=t[14],T}function be(){}function G(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})}}function Le(){const t=g.c(3),{org:e}=_(),n=F();let a;return t[0]!==e.slug||t[1]!==n?(a=(r,o)=>{if(n&&!o)return G(e.slug,r);const s=W({tabId:o??"overview",org:e.slug,agentId:r});return{to:s.to,params:s.params,search:s.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{Le as a,ae as b,ge as c,re as d,Pe as e,Re as f,ie as g,Se as h,Ee as i,K as p,Ae as u};
@@ -1 +1 @@
1
- import{c as l,an as f,b as p,e as T,t as m}from"./index-DY9jv8u5.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
1
+ import{c as l,an as f,b as p,e as T,t as m}from"./index-BphI8pNH.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
@@ -1 +1 @@
1
- import{c as x,a2 as j,a as i}from"./index-DY9jv8u5.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,a2 as j,a as i}from"./index-BphI8pNH.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
@@ -1 +1 @@
1
- import{c as p,a2 as w,K as y,m as $,o as O,e as P}from"./index-DY9jv8u5.js";import{u as _}from"./useInfiniteQuery-C3FB4QSd.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Z(n,e,t){const s=p.c(16),{org:r}=w(),i=t?.enabled??!0;let a;s[0]!==r.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(r.id,n,e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==r.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===r.id&&u.queryKey[2]===n?f:void 0,s[4]=r.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==r.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(r.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=r.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==i||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:i,queryKey:a,placeholderData:o,queryFn:c},s[11]=i,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function E(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=p.c(16),{org:r}=w();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==r.slug||s[7]!==e||s[8]!==n?(l=()=>E(r.slug,n??"",e),s[6]=r.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:i,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=p.c(9),s=n===void 0?60:n,{org:r}=w();let i;t[0]!==r.id?(i=y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=p.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,initialPageParam:null,queryFn:r,getNextPageParam:C},e[6]=s,e[7]=r,e[8]=i):i=e[8],_(i)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=p.c(16),{org:s}=w();let r;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(r=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=r):r=t[4];const i=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==r||t[12]!==i||t[13]!==a||t[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},t[11]=r,t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=p.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function re(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}async function M(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ie(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const r=e?.enabled!==!1&&n!=="";let i;t[2]!==n?(i=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==s||t[5]!==r||t[6]!==i?(a={queryKey:s,enabled:r,staleTime:6e4,retry:!1,queryFn:i},t[4]=s,t[5]=r,t[6]=i,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&i.length<D?i.push(d.path):a.push(r(d.path))}}const c=await Promise.all(i.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return i.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(r(u));return}f+=d.length,l.push({relPath:r(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}function le(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>F(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=p.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,r)=>F(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await h(F(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,r,i="text/markdown; charset=utf-8"){const a={"content-type":i};r&&"absent"in r?a["if-none-match"]="*":r&&(a["if-match"]=`"${r.contentHash}"`);const o=await fetch(F(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=p.c(18),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==n?(r=async l=>(await(await h(F(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=p.c(33),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async S=>{const L=(await Promise.allSettled(S.files.map(T=>{const q=S.dir?`${S.dir}/${T.name}`:T.name;return h(F(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(Y);if(L)throw L.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(F(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==i||e[14]!==l?(f={mutationFn:l,onSuccess:i},e[13]=i,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(F(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==i||e[20]!==g?(d={mutationFn:g,onSuccess:i},e[19]=i,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==i||e[26]!==m?(I={mutationFn:m,onSuccess:i},e[25]=i,e[26]=m,e[27]=I):I=e[27];const k=P(I);let K;return e[28]!==u||e[29]!==k||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:k},e[28]=u,e[29]=k,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{Q as a,le as b,ue as c,de as d,G as e,ae as f,ie as g,re as h,ge as i,ce as j,ee as k,ne as l,X as m,oe as n,Z as o,se as p,te as q,E as r,M as s,v as u,fe as w};
1
+ import{c as p,a2 as w,K as y,m as $,o as O,e as P}from"./index-BphI8pNH.js";import{u as _}from"./useInfiniteQuery-Ctv8zOi3.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Z(n,e,t){const s=p.c(16),{org:r}=w(),i=t?.enabled??!0;let a;s[0]!==r.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(r.id,n,e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==r.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===r.id&&u.queryKey[2]===n?f:void 0,s[4]=r.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==r.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(r.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=r.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==i||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:i,queryKey:a,placeholderData:o,queryFn:c},s[11]=i,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function E(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=p.c(16),{org:r}=w();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==r.slug||s[7]!==e||s[8]!==n?(l=()=>E(r.slug,n??"",e),s[6]=r.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:i,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=p.c(9),s=n===void 0?60:n,{org:r}=w();let i;t[0]!==r.id?(i=y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=p.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,initialPageParam:null,queryFn:r,getNextPageParam:C},e[6]=s,e[7]=r,e[8]=i):i=e[8],_(i)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=p.c(16),{org:s}=w();let r;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(r=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=r):r=t[4];const i=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==r||t[12]!==i||t[13]!==a||t[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},t[11]=r,t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=p.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function re(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}async function M(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ie(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const r=e?.enabled!==!1&&n!=="";let i;t[2]!==n?(i=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==s||t[5]!==r||t[6]!==i?(a={queryKey:s,enabled:r,staleTime:6e4,retry:!1,queryFn:i},t[4]=s,t[5]=r,t[6]=i,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&i.length<D?i.push(d.path):a.push(r(d.path))}}const c=await Promise.all(i.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return i.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(r(u));return}f+=d.length,l.push({relPath:r(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}function le(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>F(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=p.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,r)=>F(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await h(F(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,r,i="text/markdown; charset=utf-8"){const a={"content-type":i};r&&"absent"in r?a["if-none-match"]="*":r&&(a["if-match"]=`"${r.contentHash}"`);const o=await fetch(F(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=p.c(18),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==n?(r=async l=>(await(await h(F(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=p.c(33),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async S=>{const L=(await Promise.allSettled(S.files.map(T=>{const q=S.dir?`${S.dir}/${T.name}`:T.name;return h(F(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(Y);if(L)throw L.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(F(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==i||e[14]!==l?(f={mutationFn:l,onSuccess:i},e[13]=i,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(F(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==i||e[20]!==g?(d={mutationFn:g,onSuccess:i},e[19]=i,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==i||e[26]!==m?(I={mutationFn:m,onSuccess:i},e[25]=i,e[26]=m,e[27]=I):I=e[27];const k=P(I);let K;return e[28]!==u||e[29]!==k||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:k},e[28]=u,e[29]=k,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{Q as a,le as b,ue as c,de as d,G as e,ae as f,ie as g,re as h,ge as i,ce as j,ee as k,ne as l,X as m,oe as n,Z as o,se as p,te as q,E as r,M as s,v as u,fe as w};
@@ -1 +1 @@
1
- import{c as r,a2 as f,an as y,K as S,m as _,o as d,e as R}from"./index-DY9jv8u5.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,T as c,g as u};
1
+ import{c as r,a2 as f,an as y,K as S,m as _,o as d,e as R}from"./index-BphI8pNH.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,T as c,g as u};
@@ -1 +1 @@
1
- import{c as u,m as S,o as r,e as y,K as c}from"./index-DY9jv8u5.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
1
+ import{c as u,m as S,o as r,e as y,K as c}from"./index-BphI8pNH.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
@@ -1 +1 @@
1
- import{u as E}from"./use-org-auth-client-BQ7kloKy.js";import{a2 as I,m as N,K as b}from"./index-DY9jv8u5.js";const B="connections",d="*",m="!";function g(e){return`${m}${e}`}function _(e){return e.startsWith(m)?e.slice(m.length):null}function P(e){if(e.includes(g(d)))return{kind:"only",names:[]};const n=new Set,i=new Set;for(const t of e){const a=_(t);a!==null?n.add(a):t!==d&&i.add(t)}return e.includes(d)?n.size===0?{kind:"all"}:{kind:"except",names:[...n]}:{kind:"only",names:[...i].filter(t=>!n.has(t))}}function z(e){return[d,...e.names.map(g)]}const R="projects";function L(e){if(!e)return null;const n=e[R];return Array.isArray(n)?n:null}function j(e){return e===null?{kind:"all"}:P(e)}const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function F(e){return e.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function T(e){if(!e)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const t=[];let a=!1;const c=new Set;let r=!1,f=0,o=!1;for(const[l,s]of Object.entries(e)){if(l==="self"){s.includes("*")?i=!0:n.push(...s);continue}if(l==="models"){s.includes("*:*")?o=!0:f=s.length;continue}if(l!==R){if(l===B){P(s).kind!=="only"&&(a=!0,r=!0);continue}if(l==="*"){if(a=!0,s.includes("*"))r=!0;else for(const u of s)c.add(u);continue}if(t.push(l),s.includes("*"))r=!0;else for(const u of s)c.add(u)}}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:t,allowsAllConnections:a,toolNames:Array.from(c),allowsAllTools:r,modelCount:f,allowsAllModels:o}}function K(){const{locator:e}=I(),n=E(),{data:i,isLoading:t,error:a,refetch:c}=N({queryKey:b.organizationRoles(e),queryFn:async()=>{try{const o=await n.organization.listRoles();return o?.error?(console.error("[useOrganizationRoles] API error:",o.error),[]):o?.data??[]}catch(o){return console.error("[useOrganizationRoles] Fetch error:",o),[]}},staleTime:3e4}),r=w.map(o=>({role:o.value,label:o.label,isBuiltin:o.isBuiltin}));if(i&&Array.isArray(i))for(const o of i){const l=o.role;if(!l||w.some(O=>O.value===l))continue;const{staticPermissions:s,allowsAllStaticPermissions:u,connectionIds:S,allowsAllConnections:A,toolNames:y,allowsAllTools:p,modelCount:h,allowsAllModels:C}=T(o.permission);r.push({id:o.id,role:l,label:F(l),isBuiltin:!1,permission:o.permission??void 0,staticPermissionCount:u?-1:s.length,allowsAllStaticPermissions:u,connectionCount:A?-1:S.length,allowsAllConnections:A,toolCount:p?-1:y.length,allowsAllTools:p,modelCount:C?-1:h,allowsAllModels:C})}const f=r.filter(o=>!o.isBuiltin);return{roles:r,customRoles:f,builtinRoles:r.filter(o=>o.isBuiltin),isLoading:t,error:a,refetch:c}}export{B as C,R as P,d as a,P as b,g as d,L as g,z as l,j as p,K as u};
1
+ import{u as E}from"./use-org-auth-client-CSFZu3Wj.js";import{a2 as I,m as N,K as b}from"./index-BphI8pNH.js";const B="connections",d="*",m="!";function g(e){return`${m}${e}`}function _(e){return e.startsWith(m)?e.slice(m.length):null}function P(e){if(e.includes(g(d)))return{kind:"only",names:[]};const n=new Set,i=new Set;for(const t of e){const a=_(t);a!==null?n.add(a):t!==d&&i.add(t)}return e.includes(d)?n.size===0?{kind:"all"}:{kind:"except",names:[...n]}:{kind:"only",names:[...i].filter(t=>!n.has(t))}}function z(e){return[d,...e.names.map(g)]}const R="projects";function L(e){if(!e)return null;const n=e[R];return Array.isArray(n)?n:null}function j(e){return e===null?{kind:"all"}:P(e)}const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function F(e){return e.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function T(e){if(!e)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const t=[];let a=!1;const c=new Set;let r=!1,f=0,o=!1;for(const[l,s]of Object.entries(e)){if(l==="self"){s.includes("*")?i=!0:n.push(...s);continue}if(l==="models"){s.includes("*:*")?o=!0:f=s.length;continue}if(l!==R){if(l===B){P(s).kind!=="only"&&(a=!0,r=!0);continue}if(l==="*"){if(a=!0,s.includes("*"))r=!0;else for(const u of s)c.add(u);continue}if(t.push(l),s.includes("*"))r=!0;else for(const u of s)c.add(u)}}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:t,allowsAllConnections:a,toolNames:Array.from(c),allowsAllTools:r,modelCount:f,allowsAllModels:o}}function K(){const{locator:e}=I(),n=E(),{data:i,isLoading:t,error:a,refetch:c}=N({queryKey:b.organizationRoles(e),queryFn:async()=>{try{const o=await n.organization.listRoles();return o?.error?(console.error("[useOrganizationRoles] API error:",o.error),[]):o?.data??[]}catch(o){return console.error("[useOrganizationRoles] Fetch error:",o),[]}},staleTime:3e4}),r=w.map(o=>({role:o.value,label:o.label,isBuiltin:o.isBuiltin}));if(i&&Array.isArray(i))for(const o of i){const l=o.role;if(!l||w.some(O=>O.value===l))continue;const{staticPermissions:s,allowsAllStaticPermissions:u,connectionIds:S,allowsAllConnections:A,toolNames:y,allowsAllTools:p,modelCount:h,allowsAllModels:C}=T(o.permission);r.push({id:o.id,role:l,label:F(l),isBuiltin:!1,permission:o.permission??void 0,staticPermissionCount:u?-1:s.length,allowsAllStaticPermissions:u,connectionCount:A?-1:S.length,allowsAllConnections:A,toolCount:p?-1:y.length,allowsAllTools:p,modelCount:C?-1:h,allowsAllModels:C})}const f=r.filter(o=>!o.isBuiltin);return{roles:r,customRoles:f,builtinRoles:r.filter(o=>o.isBuiltin),isLoading:t,error:a,refetch:c}}export{B as C,R as P,d as a,P as b,g as d,L as g,z as l,j as p,K as u};
@@ -1 +1 @@
1
- import{a as T,c as u,b4 as A,a2 as b,m as z,ap as D,K as E,an as O,o as C,e as I}from"./index-DY9jv8u5.js";import{D as G,o as x,a as P}from"./schema-BXxpoJF8.js";import{r as R}from"./task-board-NNGstnYy.js";const F={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function k(t,e){return{queryKey:E.organizationSettings(e),queryFn:async()=>{try{return await D(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...F,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(7),{org:n}=b();let s;e[0]!==n.id||e[1]!==n.slug?(s=k(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],z(i)}function _(){const t=u.c(9),{org:e}=b(),n=O(),s=C();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(E.organizationSettings(e.id),r=>({...r??F,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],I(i)}function L(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function B(){const{data:t}=d(Q);return t??N}function Q(t){return L(t.simple_mode)}function V(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function W(){return c("reports_only")}function c(t){const e=u.c(5);let n;e[0]!==t?(n=a=>x(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??G.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function H(t){const e=u.c(6);let n;e[0]!==t?(n=i=>x(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=d(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?G.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function J(){const t=c("chat_harness_sandbox_only");return A().runtime.agentSandbox&&t}function X(){const t=u.c(8),{org:e}=b(),n=O(),s=C();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(E.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],I(i)}function w(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function tt(){const{data:t}=T.useSession();return w(t?.user?.email)}function et(){const t=u.c(9),{data:e}=T.useSession(),n=A();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||w(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=c("hosting_enabled"),r=c("deco_analytics_enabled"),m=c("e2e_enabled"),M=c("monitor_enabled"),$=c("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||a||m,y=o||i||M,h=o||a||$;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==y||t[7]!==h?(f={hosting:g,analytics:S,e2e:p,monitor:y,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=y,t[7]=h,t[8]=f):f=t[8],f}function nt(){const{data:t}=d(U);return t??!1}function U(t){return P(t.flags)}function st(){const{data:t}=d(q);return t??!0}function q(t){return R(t.flags)}function ot(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function at(){const t=u.c(2),{data:e}=d(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function it(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function lt(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.submodule_credentials}function ut(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{c as a,J as b,H as c,B as d,et as e,st as f,X as g,nt as h,ot as i,at as j,it as k,V as l,lt as m,ut as n,tt as o,W as u};
1
+ import{a as T,c as u,b4 as A,a2 as b,m as z,ap as D,K as E,an as O,o as C,e as I}from"./index-BphI8pNH.js";import{D as G,o as x,a as P}from"./schema-Ddw2ah-q.js";import{r as R}from"./task-board-Cv7D_3uN.js";const F={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function k(t,e){return{queryKey:E.organizationSettings(e),queryFn:async()=>{try{return await D(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...F,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(7),{org:n}=b();let s;e[0]!==n.id||e[1]!==n.slug?(s=k(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],z(i)}function _(){const t=u.c(9),{org:e}=b(),n=O(),s=C();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(E.organizationSettings(e.id),r=>({...r??F,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],I(i)}function L(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function B(){const{data:t}=d(Q);return t??N}function Q(t){return L(t.simple_mode)}function V(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function W(){return c("reports_only")}function c(t){const e=u.c(5);let n;e[0]!==t?(n=a=>x(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??G.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function H(t){const e=u.c(6);let n;e[0]!==t?(n=i=>x(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=d(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?G.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function J(){const t=c("chat_harness_sandbox_only");return A().runtime.agentSandbox&&t}function X(){const t=u.c(8),{org:e}=b(),n=O(),s=C();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(E.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],I(i)}function w(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function tt(){const{data:t}=T.useSession();return w(t?.user?.email)}function et(){const t=u.c(9),{data:e}=T.useSession(),n=A();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||w(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=c("hosting_enabled"),r=c("deco_analytics_enabled"),m=c("e2e_enabled"),M=c("monitor_enabled"),$=c("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||a||m,y=o||i||M,h=o||a||$;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==y||t[7]!==h?(f={hosting:g,analytics:S,e2e:p,monitor:y,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=y,t[7]=h,t[8]=f):f=t[8],f}function nt(){const{data:t}=d(U);return t??!1}function U(t){return P(t.flags)}function st(){const{data:t}=d(q);return t??!0}function q(t){return R(t.flags)}function ot(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function at(){const t=u.c(2),{data:e}=d(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function it(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function lt(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.submodule_credentials}function ut(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{c as a,J as b,H as c,B as d,et as e,st as f,X as g,nt as h,ot as i,at as j,it as k,V as l,lt as m,ut as n,tt as o,W as u};
@@ -1 +1 @@
1
- import{c as p,f as g,u as S,d5 as _,d as k,k as b,d6 as P,d7 as E}from"./index-DY9jv8u5.js";import{b as I}from"./thread-route--lOZYDN5.js";import{a as R}from"./use-project-scope-BL3NRFI4.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],b(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(u,c)=>{const h=P(u),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:u,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=u=>t({to:".",search:z,replace:u?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let d;return e[8]!==f||e[9]!==m?(d={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=d):d=e[10],d}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
1
+ import{c as p,f as g,u as S,d5 as _,d as k,k as b,d6 as P,d7 as E}from"./index-BphI8pNH.js";import{b as I}from"./thread-route-BEIPJEss.js";import{a as R}from"./use-project-scope-DN9qkINS.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],b(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(u,c)=>{const h=P(u),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:u,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=u=>t({to:".",search:z,replace:u?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let d;return e[8]!==f||e[9]!==m?(d={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=d):d=e[10],d}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};