decocms 4.373.1 → 4.373.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 (364) hide show
  1. package/dist/client/assets/{AlertCircle-2L7lI8NL.js → AlertCircle-D0XfIdP3.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BSJ08P7a.js → AreaChart-BahcMnDC.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-8rouBEwC.js → ArrowLeft-COesgQ7q.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DCA5zjxW.js → ArrowRight-CnMpegh6.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BtksDHBQ.js → ArrowUp-17ZWJBkC.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-BbOaLmfq.js → CartesianChart-DqSaDs52.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BmVuh1xp.js → CheckCircle-GwUJIVVh.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-fg9sod-H.js → ChevronUp-CodzCI7T.js} +1 -1
  9. package/dist/client/assets/{Copy01-BgwuTJFm.js → Copy01-CrFZhFXo.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-CIt471eG.js → CreditCard01-DDojC3kk.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CE2o6L6N.js → DotsVertical-DMzYFBsd.js} +1 -1
  12. package/dist/client/assets/{Download01-DNhEQzg0.js → Download01-B93GUT2-.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-DxNax47N.js → ErrorBarContext-BUk8y7Bj.js} +1 -1
  14. package/dist/client/assets/{Eye-Dq6Vw6FI.js → Eye-Bxxku7SE.js} +1 -1
  15. package/dist/client/assets/{Globe01-g_y8gAs1.js → Globe01-DjdW3vEO.js} +1 -1
  16. package/dist/client/assets/{Globe04-GFiRExL0.js → Globe04-1G-_QSZW.js} +1 -1
  17. package/dist/client/assets/{Image01-QB6twEDu.js → Image01-DPvj49a-.js} +1 -1
  18. package/dist/client/assets/{Key01-CO_i2QPb.js → Key01-O_Ykzy8v.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-BfySK4h8.js → LayoutLeft-Cr5_A1QG.js} +1 -1
  20. package/dist/client/assets/{Line-Cr57fOtp.js → Line-aFR7lShe.js} +1 -1
  21. package/dist/client/assets/{Link01-BIFMl_M0.js → Link01-D8T6mRIR.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DQD59o7F.js → LinkExternal01-CWPNoGQ_.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Ddm2yOG6.js → Monitor01-CQaKbr3c.js} +1 -1
  24. package/dist/client/assets/{Package-CvzEol5_.js → Package-Cd3aVeK8.js} +1 -1
  25. package/dist/client/assets/{Palette-DT856bn6.js → Palette-HRmzWYeK.js} +1 -1
  26. package/dist/client/assets/{Play-wYDcJhBq.js → Play-CaxaoMwA.js} +1 -1
  27. package/dist/client/assets/{Plus-BSp00qOC.js → Plus-BjOenFFb.js} +1 -1
  28. package/dist/client/assets/{SearchLg-DFD1t2UL.js → SearchLg-CT-Vntfj.js} +1 -1
  29. package/dist/client/assets/{SearchMd-Bb5gjLcX.js → SearchMd-C6gkQ2l2.js} +1 -1
  30. package/dist/client/assets/{Sector-wViCnB96.js → Sector-B-fHBulW.js} +1 -1
  31. package/dist/client/assets/{Settings02-D9Qv7BDm.js → Settings02-DH86cX_B.js} +1 -1
  32. package/dist/client/assets/{Share07-CZ7JzYs9.js → Share07-Bw4Wicv2.js} +1 -1
  33. package/dist/client/assets/{Stars01-D-wYuyik.js → Stars01-B1kYoDFp.js} +1 -1
  34. package/dist/client/assets/{Sun-DLRcOzSd.js → Sun-kycCorOO.js} +1 -1
  35. package/dist/client/assets/{Tool01-Dwy1nlT9.js → Tool01-iak9ZtFE.js} +1 -1
  36. package/dist/client/assets/{Tool02-CvlAGFBM.js → Tool02-CFu103hl.js} +1 -1
  37. package/dist/client/assets/{Trash01-DtE0n00a.js → Trash01-CpN6r-a0.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-BCriuXJd.js → TrendUp01-DlYmFZ7k.js} +1 -1
  39. package/dist/client/assets/{Upload01-Ba-RLxE1.js → Upload01-DkDsqCWe.js} +1 -1
  40. package/dist/client/assets/{User01-DHd46PZp.js → User01-CmNzW4kH.js} +1 -1
  41. package/dist/client/assets/{UserSquare-CcF49LHs.js → UserSquare-1_FC93GE.js} +1 -1
  42. package/dist/client/assets/{Users01-B8gdz27Y.js → Users01-CVhfgklM.js} +1 -1
  43. package/dist/client/assets/{X-BtMi8Qau.js → X-DTaqHNcB.js} +1 -1
  44. package/dist/client/assets/{XCircle-BLCHBIhx.js → XCircle-BR8ZZHlj.js} +1 -1
  45. package/dist/client/assets/{XClose-CvcHLHe2.js → XClose-VLid_ZSM.js} +1 -1
  46. package/dist/client/assets/{Zap-DZAIluO6.js → Zap-D3d1wpzw.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DUFJq3-K.js → ZoomOut-B3S7N50e.js} +1 -1
  48. package/dist/client/assets/{access-gate-C9Dl5e5c.js → access-gate-DAO7tJ5A.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-DA05asFs.js → add-connection-dialog-CaHZ3eeK.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-CDo5Hugr.js → agent-analytics-CzbWclRj.js} +1 -1
  51. package/dist/client/assets/agent-app-DqzssWfL.js +1 -0
  52. package/dist/client/assets/{agent-assets-6UK-ev9d.js → agent-assets-Dfpjbzyj.js} +1 -1
  53. package/dist/client/assets/{agent-automation-BC-cMvrG.js → agent-automation-C8r5_lAR.js} +1 -1
  54. package/dist/client/assets/{agent-automations-CnHTcvU7.js → agent-automations-BSaV8k3Y.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-CJ8artss.js → agent-connect-sources-AkHuiIU0.js} +1 -1
  56. package/dist/client/assets/agent-deck-BQOqb5JA.js +1 -0
  57. package/dist/client/assets/{agent-e2e-Cj1Q_JS0.js → agent-e2e-CjCqLXH1.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-DJ13yAp9.js → agent-experiments-4inK9Pvj.js} +1 -1
  59. package/dist/client/assets/agent-file-CN4CJx4b.js +1 -0
  60. package/dist/client/assets/{agent-git-B8LMQ2zl.js → agent-git-BZmL1C91.js} +1 -1
  61. package/dist/client/assets/{agent-hosting-Bm-WxahY.js → agent-hosting-CP9gImki.js} +1 -1
  62. package/dist/client/assets/{agent-icon-CTsmTxHg.js → agent-icon-D5Ih-I28.js} +1 -1
  63. package/dist/client/assets/agent-library-file-CMtJlgeS.js +1 -0
  64. package/dist/client/assets/{agent-monitor-DgVt0zbx.js → agent-monitor-D7bE1AUL.js} +1 -1
  65. package/dist/client/assets/{agent-overview-pOglhwpN.js → agent-overview-C5zU0xJO.js} +1 -1
  66. package/dist/client/assets/agent-settings-G7qQl7Yj.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-DVT-M9T0.js → agent-site-editor-BRzwUORk.js} +1 -1
  68. package/dist/client/assets/agent-site-editor-code-BV4iQvoi.js +2 -0
  69. package/dist/client/assets/{agent-site-editor-content-eM0WchN0.js → agent-site-editor-content-Da0JfE-w.js} +2 -2
  70. package/dist/client/assets/{agent-site-editor-preview-3VO_kTqr.js → agent-site-editor-preview-DqMQfEJz.js} +3 -3
  71. package/dist/client/assets/agent-view-BinIwia6.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-BNYKK-x9.js → agent-view-guard-CmXIeKCe.js} +1 -1
  73. package/dist/client/assets/{agents-list-BXPjUzIN.js → agents-list-wHHXJTl8.js} +1 -1
  74. package/dist/client/assets/{ai-providers-BAmCFPvS.js → ai-providers-COexxMGY.js} +1 -1
  75. package/dist/client/assets/{alert-C8o4-kn8.js → alert-C_EPjsLF.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-9n2p5SCQ.js → alert-dialog-D6rlFoy0.js} +1 -1
  77. package/dist/client/assets/api-keys-CN-jy2XH.js +1 -0
  78. package/dist/client/assets/{api-keys-Cu1KdEtK.js → api-keys-o45lgGkw.js} +1 -1
  79. package/dist/client/assets/app-editor-BPKOcfIg.js +1 -0
  80. package/dist/client/assets/{asset-utils-CK3Em4fb.js → asset-utils-BG24FUsq.js} +1 -1
  81. package/dist/client/assets/{auth-BBW3DF0r.js → auth-B_QE3yd2.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-Bva2z4Gj.js → auth-catchall-BM8U6OhG.js} +1 -1
  83. package/dist/client/assets/{auth-entry-BuHqwUIr.js → auth-entry-CdieewWf.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-DMgxvbll.js → auth-split-layout-rKTEf0Lh.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-Pk9b2m8R.js → authenticate-and-persist-oauth-Cm242zr2.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-D-zBLXA-.js → automation-list-row-DDeJYMHS.js} +1 -1
  87. package/dist/client/assets/{automation-runs-C8Wbje-n.js → automation-runs-BGXJk3-4.js} +1 -1
  88. package/dist/client/assets/{automations-D69ikqKh.js → automations-BhhOtnrs.js} +1 -1
  89. package/dist/client/assets/{autosend-CVNOmzPu.js → autosend-DtYV6o0l.js} +1 -1
  90. package/dist/client/assets/{avatar-BzRNaDEk.js → avatar-Dwn9Bjsb.js} +1 -1
  91. package/dist/client/assets/{badge-C5M6nZd4.js → badge-BSirYRuD.js} +1 -1
  92. package/dist/client/assets/{block-document-UPtnFOJG.js → block-document-DjxI0Nln.js} +1 -1
  93. package/dist/client/assets/{blocks-preview-workspace-context-DAFMxzU6.js → blocks-preview-workspace-context-BwjlsTrq.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-0yy48vm9.js → breadcrumb-BpbnoaV3.js} +1 -1
  95. package/dist/client/assets/{buckets-CktpbsrB.js → buckets-DdptE4Pj.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-C-SX02eL.js → build-improve-prompt-doc-CIkgt5Ml.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-MrIv4eD2.js → bulk-category-panel-BUvAK76e.js} +1 -1
  98. package/dist/client/assets/{calendar-QcX36iLy.js → calendar-Bhg3W8Dv.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-BVb3VEU2.js → capability-load-error-l-yxDu1W.js} +1 -1
  100. package/dist/client/assets/category-editor-Crlp5xLx.js +1 -0
  101. package/dist/client/assets/{chart-BVjaATZw.js → chart-B7hxFGKr.js} +1 -1
  102. package/dist/client/assets/{chat-context-ELO8A2Ar.js → chat-context-CVZ1rNGo.js} +1 -1
  103. package/dist/client/assets/{chat-draft-tDfZTlxU.js → chat-draft-UIE-uNFd.js} +1 -1
  104. package/dist/client/assets/{checkbox-iGlb02v9.js → checkbox-VSstjUSb.js} +1 -1
  105. package/dist/client/assets/{choose-editor-CWLAiGtz.js → choose-editor-DD3-fBUp.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-DyNW_Pmq.js → cli-auth-success-LIJhoLzG.js} +1 -1
  107. package/dist/client/assets/{client-icons-BuRYGGKe.js → client-icons-D8SzN11F.js} +1 -1
  108. package/dist/client/assets/{collapsible-PyJ2NOzW.js → collapsible-BX137q_-.js} +1 -1
  109. package/dist/client/assets/{collection-detail-DXmBNKMr.js → collection-detail-Brbyx-hM.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-Cz5AkuIg.js → collection-display-button-LAyYKy93.js} +1 -1
  111. package/dist/client/assets/{collection-search-DM8MkJfo.js → collection-search-Dvf73igt.js} +1 -1
  112. package/dist/client/assets/collection-table-wrapper-_ZnQA9Nx.js +1 -0
  113. package/dist/client/assets/{collection-tabs-aKKPIP9M.js → collection-tabs-BW0egx-_.js} +1 -1
  114. package/dist/client/assets/{combobox-CQBdlQef.js → combobox-D6GclaQ-.js} +1 -1
  115. package/dist/client/assets/{command-CZcxzTcw.js → command-Dsz0XoYc.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-B7qgbnOZ.js → companion-mcps-section-D7ntAaGF.js} +1 -1
  117. package/dist/client/assets/{connect-D6Wz7x6C.js → connect-ChX83wmI.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DzSDvFP2.js → connect-layout-SP9zSVi3.js} +1 -1
  119. package/dist/client/assets/{connection-DStV2sLP.js → connection-2MR1zroe.js} +1 -1
  120. package/dist/client/assets/{connection-card-CpIJKLp3.js → connection-card-B5yTdNvS.js} +1 -1
  121. package/dist/client/assets/{connection-detail-junbbrHX.js → connection-detail-DKOxQWbq.js} +1 -1
  122. package/dist/client/assets/{connection-form-helpers-DM_wSOEJ.js → connection-form-helpers-PrMbwr2L.js} +1 -1
  123. package/dist/client/assets/{connections-DvjnCZJT.js → connections-lQVX-uGO.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-CvXOAbwA.js → create-organization-dialog-Ccojws8S.js} +1 -1
  125. package/dist/client/assets/{decofile-api-zRlIvvNL.js → decofile-api-DygXY02K.js} +1 -1
  126. package/dist/client/assets/{decopilot-BI8eOOPY.js → decopilot-rj_BJ_Z1.js} +1 -1
  127. package/dist/client/assets/{dialog-AoC07APJ.js → dialog-BKhaq-Xf.js} +1 -1
  128. package/dist/client/assets/{discover-zo2iAYFW.js → discover-C_imFiZx.js} +1 -1
  129. package/dist/client/assets/{domain-settings-C6kSznIr.js → domain-settings-CUKpZjNV.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-CsiIuf7j.js → download-app-dialog-wNu8nmu1.js} +1 -1
  131. package/dist/client/assets/{drawer-DGzquxJ8.js → drawer-CCmZWflK.js} +1 -1
  132. package/dist/client/assets/{editor-oL1B7LVJ.js → editor-DMij_Pa1.js} +1 -1
  133. package/dist/client/assets/{empty-state-DxJQDjCw.js → empty-state-BDpfsfUL.js} +1 -1
  134. package/dist/client/assets/{empty-state-Y08kvU5o.js → empty-state-DiRnF-wA.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-C7Wh9xkI.js → extract-connection-data-Bdk8iF2q.js} +1 -1
  136. package/dist/client/assets/{feature-gate-C1d068b1.js → feature-gate-KPNWzkBp.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-BoABVlUQ.js → feature-paywall-B3_no1lb.js} +1 -1
  138. package/dist/client/assets/{file-explorer-DG5Gvb-w.js → file-explorer-oIhs2jyB.js} +1 -1
  139. package/dist/client/assets/{file-preview-iaqpqUYi.js → file-preview-BFDgPeRr.js} +1 -1
  140. package/dist/client/assets/{file-share-button-D0lT5ixf.js → file-share-button-7xy_ju8b.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-lZW2ows7.js → file-type-icon-Co9lETmZ.js} +1 -1
  142. package/dist/client/assets/{folder-icon-DVG7PK8X.js → folder-icon-CPH1Bszw.js} +1 -1
  143. package/dist/client/assets/{form-CYsJTpNM.js → form-CxKBX2E3.js} +1 -1
  144. package/dist/client/assets/{gateway-client-CnYYocwu.js → gateway-client-B8HHtBA6.js} +1 -1
  145. package/dist/client/assets/{general-BiYLEv2o.js → general-BXQ_6idC.js} +1 -1
  146. package/dist/client/assets/{github-icon-swNUSpAU.js → github-icon-DSeg1rga.js} +1 -1
  147. package/dist/client/assets/{home-BbjS-573.js → home-FAOklPf6.js} +1 -1
  148. package/dist/client/assets/{hooks-D0dDgrIf.js → hooks-BFlZlUD7.js} +1 -1
  149. package/dist/client/assets/{hooks-BlE0QZwR.js → hooks-CFjlhRX0.js} +1 -1
  150. package/dist/client/assets/{icon-button-7c--Wy5B.js → icon-button-_3vMPXZp.js} +1 -1
  151. package/dist/client/assets/{index-DItj2r3e.js → index-B3clFfYi.js} +1 -1
  152. package/dist/client/assets/{index-DyCAAYSx.js → index-BcfYNZk_.js} +1 -1
  153. package/dist/client/assets/{index-C97O3ClY.js → index-BrLZxE6-.js} +1 -1
  154. package/dist/client/assets/{index-0-s9o3tr.js → index-BwwpOrcS.js} +1 -1
  155. package/dist/client/assets/{index-EcuFIS2a.js → index-CC7J7MsT.js} +2 -2
  156. package/dist/client/assets/{index-CutV0Ygc.js → index-CV2G6XgT.js} +1 -1
  157. package/dist/client/assets/{index-BUfoj27y.js → index-Ci8CqfCi.js} +1 -1
  158. package/dist/client/assets/{index-DKXWNSdB.js → index-Coo4IGyG.js} +1 -1
  159. package/dist/client/assets/{index-BDYXeKzz.js → index-CxsDd08k.js} +1 -1
  160. package/dist/client/assets/{index-Exw_Yjch.js → index-D2HOssRq.js} +1 -1
  161. package/dist/client/assets/{index-DllcfiZL.js → index-DZmKVVGY.js} +1 -1
  162. package/dist/client/assets/{index-DGY2nhhI.js → index-DoCuIH7r.js} +1 -1
  163. package/dist/client/assets/{index-fN6RkMSD.js → index-WfTG300W.js} +1 -1
  164. package/dist/client/assets/{index-redirect-Bm4zqVUy.js → index-redirect-BV59ZcWQ.js} +1 -1
  165. package/dist/client/assets/{index-BchRuDAc.js → index-zFkCX32V.js} +1 -1
  166. package/dist/client/assets/{infiniteQueryObserver-3RxH1tr-.js → infiniteQueryObserver-CKT-6XMq.js} +1 -1
  167. package/dist/client/assets/{infra-billing-CmY2herT.js → infra-billing-RcXbwjta.js} +1 -1
  168. package/dist/client/assets/{input-Buz_7xoG.js → input-DSV_9cOM.js} +1 -1
  169. package/dist/client/assets/{input-C5klQNJJ.js → input-QKe7l082.js} +1 -1
  170. package/dist/client/assets/{input-BrPa4I3Z.js → input-X38P96BY.js} +1 -1
  171. package/dist/client/assets/{integration-icon-D3FHJbYu.js → integration-icon-BARnXRTY.js} +1 -1
  172. package/dist/client/assets/{label-BX1BwzZ4.js → label-YKssz_GS.js} +1 -1
  173. package/dist/client/assets/{last-preview-page-BSVfE6AT.js → last-preview-page-D5EFEwR4.js} +1 -1
  174. package/dist/client/assets/{layout-030aDjqi.js → layout-UcqeKFE9.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-BblX_qPq.js → legacy-agents-deep-BYo-BuCs.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-BDaODIKZ.js → legacy-main-redirect-NyVTUirL.js} +1 -1
  177. package/dist/client/assets/{library-CmkU9fCT.js → library-FX2TKWir.js} +1 -1
  178. package/dist/client/assets/{login-BpUdj6Fq.js → login-gigmbDXu.js} +1 -1
  179. package/dist/client/assets/{markdown-VKlC4_bJ.js → markdown-tOSThun8.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-wS7imsel.js → mcp-app-renderer-c3JU3ROq.js} +1 -1
  181. package/dist/client/assets/{mcp-oauth-B7YJNr4N.js → mcp-oauth-Cr_ZflCp.js} +1 -1
  182. package/dist/client/assets/{members-2ZkimP3H.js → members-Cd4baVfz.js} +1 -1
  183. package/dist/client/assets/{message-templates-DyGM313y.js → message-templates-Pr7m4Pgn.js} +1 -1
  184. package/dist/client/assets/{mini-report-page-CYdef8vQ.js → mini-report-page-0G8UQBMn.js} +1 -1
  185. package/dist/client/assets/{mock-board-Dk2mRFCa.js → mock-board-Dw3AKqte.js} +3 -3
  186. package/dist/client/assets/{monaco-editor-ChRh_qus.js → monaco-editor-BhkNNN8A.js} +1 -1
  187. package/dist/client/assets/{monitoring-stats-row-DirMMFq2.js → monitoring-stats-row-D3wuHD5K.js} +1 -1
  188. package/dist/client/assets/{multi-select-CYKeAXVo.js → multi-select-Bw9uE0vh.js} +1 -1
  189. package/dist/client/assets/{mustache-BpzqsH6c.js → mustache-BMe4E-3i.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-CLQttSb2.js → oauth-callback-Ckn9o5ws.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-ai-provider-C5AqSldx.js → oauth-callback-ai-provider-B7dYzzRe.js} +1 -1
  192. package/dist/client/assets/{onboarding-BYeSkDcE.js → onboarding-BtLLloCy.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-hB0JGrCs.js → optimistic-project-sidebar-views-8yO8-q3h.js} +1 -1
  194. package/dist/client/assets/{org-file-open-context-D26BTBiX.js → org-file-open-context-k2zY7W2A.js} +1 -1
  195. package/dist/client/assets/{organization-choice-sm9k2ko4.js → organization-choice-oi5kPDHh.js} +1 -1
  196. package/dist/client/assets/{orgs-BT6gh3Sc.js → orgs-C8VfgzyW.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-Bhk-2qvu.js → page-seo-form-D-yemID7.js} +1 -1
  198. package/dist/client/assets/{pair-Bh73YYpe.js → pair-CbUh0olY.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-B-hb17ya.js → plan-ladder-DR8Snnfh.js} +1 -1
  200. package/dist/client/assets/{popover-Bff85VlI.js → popover-tYq49O5I.js} +1 -1
  201. package/dist/client/assets/{post-calendar-BUJnl75O.js → post-calendar-n3g3NXQN.js} +1 -1
  202. package/dist/client/assets/{post-editor-B8ClYTJb.js → post-editor-BCki1XwL.js} +1 -1
  203. package/dist/client/assets/{preview-content-C4FuOpTi.js → preview-content-BEe_g5h_.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-DY1kQ4y_.js → preview-dialog-B88KWjD7.js} +1 -1
  205. package/dist/client/assets/{primitives-BCCkMTJb.js → primitives-DvNXO9ko.js} +1 -1
  206. package/dist/client/assets/{profile-T7ySaz_t.js → profile-Dn8W-1_J.js} +1 -1
  207. package/dist/client/assets/{project-app-view-D4HCSkue.js → project-app-view-CHIgEuQJ.js} +1 -1
  208. package/dist/client/assets/{project-feed-CRHprIgj.js → project-feed-BeVLcst-.js} +1 -1
  209. package/dist/client/assets/{project-icon-D_oHwik9.js → project-icon-BuTPt9Ec.js} +1 -1
  210. package/dist/client/assets/project-reports-EFWj1j4Z.js +1 -0
  211. package/dist/client/assets/project-tasks-DGYfz1Ev.js +1 -0
  212. package/dist/client/assets/{prompts-BuPAnA4R.js → prompts-BrLG0HnD.js} +1 -1
  213. package/dist/client/assets/record-editor-AST5wQoO.js +1 -0
  214. package/dist/client/assets/{redirect-editor-BrEMZWAU.js → redirect-editor-DQh1NXo4.js} +1 -1
  215. package/dist/client/assets/registry-FGkay0Wa.js +2 -0
  216. package/dist/client/assets/{registry-layout-o90YrVKa.js → registry-layout-tLc7-FpU.js} +1 -1
  217. package/dist/client/assets/{reports-DEVutxJq.js → reports-Bgxd82xF.js} +1 -1
  218. package/dist/client/assets/reports-CqtPOzss.js +1 -0
  219. package/dist/client/assets/{reports-onboarding-Dt5mvf07.js → reports-onboarding-BORIliYh.js} +1 -1
  220. package/dist/client/assets/{reports-tab-C6PZg0b6.js → reports-tab-3yvhtU-e.js} +2 -2
  221. package/dist/client/assets/{repositories-DBFrDUwl.js → repositories-DnQQ93Vy.js} +1 -1
  222. package/dist/client/assets/{repository-import-picker-ftg0FRzY.js → repository-import-picker-B1zE1wEx.js} +1 -1
  223. package/dist/client/assets/repository-picker-DMUsWfjy.js +1 -0
  224. package/dist/client/assets/{require-capability-gpVnF6U4.js → require-capability-B9l2cjC7.js} +1 -1
  225. package/dist/client/assets/{required-auth-layout-BhdxJMdb.js → required-auth-layout-qQ6V67AS.js} +1 -1
  226. package/dist/client/assets/{reset-password-DD2ixVIR.js → reset-password-CzGwWM54.js} +1 -1
  227. package/dist/client/assets/{resizable-wU1MiASn.js → resizable-c-JEmBrU.js} +1 -1
  228. package/dist/client/assets/{review-settings-3uLiRV1J.js → review-settings-CBDmCs9f.js} +1 -1
  229. package/dist/client/assets/{rich-text-link-control-Bn-QsIS6.js → rich-text-link-control-B4QybUls.js} +1 -1
  230. package/dist/client/assets/{roles-DX_ap2B0.js → roles-9Q5Zr1_l.js} +1 -1
  231. package/dist/client/assets/{route-Bdqr734y.js → route-Cyp-PzpR.js} +1 -1
  232. package/dist/client/assets/{route-DGhKwFXa.js → route-D9feMXoH.js} +1 -1
  233. package/dist/client/assets/{route-Cg6AOuOY.js → route-DrZOVBG5.js} +1 -1
  234. package/dist/client/assets/{route-page-header-DKm5kHtX.js → route-page-header-BzWw0nja.js} +1 -1
  235. package/dist/client/assets/{runnable-block-editor-9i5DpxOA.js → runnable-block-editor-nQ69L6jb.js} +1 -1
  236. package/dist/client/assets/{sandbox-lifecycle-context-BHn9YFEW.js → sandbox-lifecycle-context-DLKr6QBG.js} +1 -1
  237. package/dist/client/assets/{schema-FDf70VFI.js → schema-CStbpjQf.js} +1 -1
  238. package/dist/client/assets/{scroll-area-DMmJ7JtI.js → scroll-area-BLDUQh9N.js} +1 -1
  239. package/dist/client/assets/{search-input-BHVk6m6A.js → search-input-MlNEh696.js} +1 -1
  240. package/dist/client/assets/{search-toggle-CCC7TvwN.js → search-toggle-SUy-5Oe0.js} +1 -1
  241. package/dist/client/assets/{secrets-BNtrMaDs.js → secrets-CEw0kB_t.js} +1 -1
  242. package/dist/client/assets/{sections-editor-HtflyYMM.js → sections-editor-l8Cc724N.js} +1 -1
  243. package/dist/client/assets/{select-DBfOOW9i.js → select-C_C7jdl-.js} +1 -1
  244. package/dist/client/assets/{select-model-2C5Fdpra.js → select-model-FW_XGeEU.js} +1 -1
  245. package/dist/client/assets/{seo-editor-CFULobkJ.js → seo-editor-BhZJvD6-.js} +1 -1
  246. package/dist/client/assets/{separator-8fswVHAH.js → separator-D-DaNCb-.js} +1 -1
  247. package/dist/client/assets/{settings-tab-s3d5MtS-.js → settings-tab-DhuuexRq.js} +1 -1
  248. package/dist/client/assets/{sheet-DWSThpSZ.js → sheet-B5ncClVO.js} +1 -1
  249. package/dist/client/assets/shell-layout-p-WJ7uxl.js +1 -0
  250. package/dist/client/assets/{sidebar-CoC2_Nad.js → sidebar-BlfpAzXY.js} +1 -1
  251. package/dist/client/assets/{skill-preview-QgrtYNqp.js → skill-preview-CeIBKDR2.js} +1 -1
  252. package/dist/client/assets/{skills-BVINvlqv.js → skills-Cpf0zAbB.js} +1 -1
  253. package/dist/client/assets/{sso-CSqM_F3b.js → sso-CYe8kGWS.js} +1 -1
  254. package/dist/client/assets/{store-DBNpNTVQ.js → store-DDl3lPqK.js} +1 -1
  255. package/dist/client/assets/store-registry-DUH5xq3l.js +2 -0
  256. package/dist/client/assets/{switch-BIfmgDHS.js → switch-C_FmZ5Us.js} +1 -1
  257. package/dist/client/assets/{synced-repos-CG_pm_Ch.js → synced-repos-DHbM7OOb.js} +1 -1
  258. package/dist/client/assets/{table-CEVOOGGz.js → table-mH2G1tkg.js} +1 -1
  259. package/dist/client/assets/{tabs-Dd0IWElc.js → tabs-jjUOgDeE.js} +1 -1
  260. package/dist/client/assets/{task-board-Dip4Wu9j.js → task-board-BtEMyO1f.js} +1 -1
  261. package/dist/client/assets/{task-route-SKFoAFiU.js → task-route-BaALoopn.js} +1 -1
  262. package/dist/client/assets/{task-status-k7EGfTLN.js → task-status-CCMsckzm.js} +1 -1
  263. package/dist/client/assets/{taskboard-analytics-C3lk9wb7.js → taskboard-analytics-CzQSxt8I.js} +1 -1
  264. package/dist/client/assets/tasks-CI20rxb_.js +1 -0
  265. package/dist/client/assets/{tasks-ebQIYdwz.js → tasks-K4e2STZ0.js} +1 -1
  266. package/dist/client/assets/{textarea-D5v3ol7T.js → textarea-B7wqTmSc.js} +1 -1
  267. package/dist/client/assets/{thread-button-C3YUAV-G.js → thread-button-B9U3gqvP.js} +1 -1
  268. package/dist/client/assets/{thread-intent-CTSjhfEo.js → thread-intent-DZx7N_NL.js} +1 -1
  269. package/dist/client/assets/{thread-route-B57JfaL5.js → thread-route-B3hhxYHj.js} +1 -1
  270. package/dist/client/assets/{thread-route-CHwqHPf_.js → thread-route-DnE31jZ2.js} +1 -1
  271. package/dist/client/assets/{thread-sheet-body-Hqh1hVbj.js → thread-sheet-body-D_py0jIP.js} +1 -1
  272. package/dist/client/assets/{toggle-group-CwAn2mKr.js → toggle-group-C-J6fFSZ.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-ChZE-2zp.js → toolbar-icon-button-DQAUOhdv.js} +1 -1
  274. package/dist/client/assets/{tooltip-nr5oS_bm.js → tooltip-DSCGYdw1.js} +1 -1
  275. package/dist/client/assets/{track-BDYWN4z3.js → track-BWEjISsx.js} +1 -1
  276. package/dist/client/assets/{types-7UQ7SDxU.js → types-BQYrCHfb.js} +1 -1
  277. package/dist/client/assets/{usage-stats-YafP0g9G.js → usage-stats-CH100JwP.js} +1 -1
  278. package/dist/client/assets/{use-ai-providers-D-abiIwe.js → use-ai-providers-DPIPADTm.js} +1 -1
  279. package/dist/client/assets/{use-automations-D_y1YNke.js → use-automations-Cm_whz3Q.js} +1 -1
  280. package/dist/client/assets/{use-autosave-z8cIzzdm.js → use-autosave-C09DCahC.js} +1 -1
  281. package/dist/client/assets/{use-connect-companion-jQzCS0Na.js → use-connect-companion-D45RJA2C.js} +1 -1
  282. package/dist/client/assets/{use-connection-BKZRi94S.js → use-connection-DAR6kA6F.js} +1 -1
  283. package/dist/client/assets/{use-copy-Cp_DyXH6.js → use-copy-CLZ5Gmjm.js} +1 -1
  284. package/dist/client/assets/{use-create-virtual-mcp-nvoTomrD.js → use-create-virtual-mcp-DlDbTDWh.js} +1 -1
  285. package/dist/client/assets/{use-date-fns-locale-CNoKSvxx.js → use-date-fns-locale-4a1GuGUG.js} +1 -1
  286. package/dist/client/assets/{use-debounced-autosave-B0HBbqeX.js → use-debounced-autosave-s6ooboiq.js} +1 -1
  287. package/dist/client/assets/{use-debounced-value-BgYHDTDk.js → use-debounced-value-C7PP6GCc.js} +1 -1
  288. package/dist/client/assets/{use-deco-credits-CqbkXgA9.js → use-deco-credits-C78gqYYg.js} +1 -1
  289. package/dist/client/assets/{use-decopilot-events-qaEKsixC.js → use-decopilot-events-DDN9tgML.js} +1 -1
  290. package/dist/client/assets/{use-delete-connection-CqvqqWgS.js → use-delete-connection-DT4K_5dd.js} +1 -1
  291. package/dist/client/assets/{use-deployment-admin-DzkF6L4b.js → use-deployment-admin-mukdSbJI.js} +1 -1
  292. package/dist/client/assets/{use-entitlements-kPr6KRf9.js → use-entitlements-CsT7-WMV.js} +1 -1
  293. package/dist/client/assets/{use-fast-preview-draft-url-BBBDyhsD.js → use-fast-preview-draft-url-BofBOVEy.js} +1 -1
  294. package/dist/client/assets/{use-file-configs-6ygOocDG.js → use-file-configs-DT6Slpub.js} +1 -1
  295. package/dist/client/assets/{use-in-settings-BCDqA2EC.js → use-in-settings-BuwNY17C.js} +1 -1
  296. package/dist/client/assets/{use-infinite-scroll-D0T36z_V.js → use-infinite-scroll-BEJH1fno.js} +1 -1
  297. package/dist/client/assets/{use-join-requests-BBovhUnp.js → use-join-requests-CRlXrVsN.js} +1 -1
  298. package/dist/client/assets/{use-main-panel-tabs-BghanH6r.js → use-main-panel-tabs-CHXW72tt.js} +1 -1
  299. package/dist/client/assets/{use-mcp-auth-status-h4sAecTI.js → use-mcp-auth-status-BUHt6LYh.js} +1 -1
  300. package/dist/client/assets/{use-mcp-client-B_gcvvCy.js → use-mcp-client-jmamuSRM.js} +1 -1
  301. package/dist/client/assets/{use-mcp-prompts-DfSKL4Gu.js → use-mcp-prompts-Cb12ACl6.js} +1 -1
  302. package/dist/client/assets/{use-mcp-tools-DC47roTz.js → use-mcp-tools-U5kwqIN7.js} +1 -1
  303. package/dist/client/assets/{use-members-C6brpkJ1.js → use-members-CZk_logh.js} +1 -1
  304. package/dist/client/assets/{use-mobile-BZ15DgEB.js → use-mobile-X_9uHXB5.js} +1 -1
  305. package/dist/client/assets/{use-navigate-to-agent-B8SXI0oO.js → use-navigate-to-agent-XZHI0vTx.js} +1 -1
  306. package/dist/client/assets/{use-open-billing-url-BAg3ZeFq.js → use-open-billing-url-BygdFnSn.js} +1 -1
  307. package/dist/client/assets/{use-org-auth-client-8fDIgHEZ.js → use-org-auth-client-6spdYft8.js} +1 -1
  308. package/dist/client/assets/{use-org-fs-Bf6n51Xm.js → use-org-fs-C4AEj3YR.js} +1 -1
  309. package/dist/client/assets/{use-org-repo-syncs-CnBqiATM.js → use-org-repo-syncs-D5-YS2q1.js} +1 -1
  310. package/dist/client/assets/{use-org-sso-QeqdMaIa.js → use-org-sso-CbtWg6df.js} +1 -1
  311. package/dist/client/assets/{use-organization-roles-tuKknI1K.js → use-organization-roles-B2NYy6qP.js} +1 -1
  312. package/dist/client/assets/{use-organization-settings-DvtBymY3.js → use-organization-settings-DiOLzOn-.js} +1 -1
  313. package/dist/client/assets/{use-panel-navigate-IItrbgmN.js → use-panel-navigate-YnjVvVnu.js} +1 -1
  314. package/dist/client/assets/{use-project-native-view-presence-WwnxvZuP.js → use-project-native-view-presence-S2GuqygD.js} +1 -1
  315. package/dist/client/assets/{use-project-scope-CCxyXvEU.js → use-project-scope-azWGklpf.js} +1 -1
  316. package/dist/client/assets/{use-registry-connections-Bd4wJHbx.js → use-registry-connections-Dr6Tl0jy.js} +1 -1
  317. package/dist/client/assets/{use-releases-DZvNer89.js → use-releases-sRilJRv7.js} +1 -1
  318. package/dist/client/assets/{use-reports-diagnostic-BeTEI2FZ.js → use-reports-diagnostic-b56ze7yP.js} +1 -1
  319. package/dist/client/assets/{use-route-default-main-BhbKsXCz.js → use-route-default-main-DAXdKSA3.js} +1 -1
  320. package/dist/client/assets/{use-secrets-Bq9yyXHE.js → use-secrets-BD25jCAi.js} +1 -1
  321. package/dist/client/assets/{use-section-preview-base--XbKHK2U.js → use-section-preview-base-CfKeOl7s.js} +1 -1
  322. package/dist/client/assets/{use-session-runtime-B5wMaHtP.js → use-session-runtime-D8PgcjtK.js} +1 -1
  323. package/dist/client/assets/{use-tags-Do2tDPSO.js → use-tags-DMzy8m-k.js} +1 -1
  324. package/dist/client/assets/{use-task-board-analytics-MK_Z2cUq.js → use-task-board-analytics-BXM0SDto.js} +1 -1
  325. package/dist/client/assets/{use-task-metadata-CQjLXps1.js → use-task-metadata-IzJB5PVG.js} +1 -1
  326. package/dist/client/assets/{use-thread-outputs-DYukUH5N.js → use-thread-outputs-BhhE_Gkc.js} +1 -1
  327. package/dist/client/assets/{use-view-mode-BEPkb8x0.js → use-view-mode-CUHkIbeG.js} +1 -1
  328. package/dist/client/assets/{use-virtual-mcp-Ji9vcgUj.js → use-virtual-mcp-Bt7oX0ej.js} +1 -1
  329. package/dist/client/assets/useInfiniteQuery-zZoTJbYm.js +1 -0
  330. package/dist/client/assets/{useQueries-D0xhxw7a.js → useQueries-D7ondynP.js} +1 -1
  331. package/dist/client/assets/useSuspenseInfiniteQuery-BvOl5Id0.js +1 -0
  332. package/dist/client/assets/{users-DzwkCv2F.js → users-CP4Dfulp.js} +1 -1
  333. package/dist/client/assets/{utils-y2q6u6PK.js → utils-CcX7wgow.js} +1 -1
  334. package/dist/client/assets/{variant-calendar-D1R9xk7D.js → variant-calendar-BYxVe-PM.js} +1 -1
  335. package/dist/client/assets/{variant-matcher-override-qHzE4baz.js → variant-matcher-override-CgX58Kkx.js} +1 -1
  336. package/dist/client/assets/{view-mode-toggle-Ca0bFull.js → view-mode-toggle-CRnJAx40.js} +1 -1
  337. package/dist/client/assets/{virtual-mcp-Dji-1ojO.js → virtual-mcp-BWl8nlWy.js} +1 -1
  338. package/dist/client/index.html +1 -1
  339. package/dist/server/cli.js +648 -648
  340. package/dist/server/migrate.js +170 -170
  341. package/dist/server/server.js +415 -415
  342. package/package.json +1 -1
  343. package/dist/client/assets/agent-app-lfl4wDqj.js +0 -1
  344. package/dist/client/assets/agent-deck-BCZ0G4O2.js +0 -1
  345. package/dist/client/assets/agent-file-DbKP1r-4.js +0 -1
  346. package/dist/client/assets/agent-library-file-DvybgEEZ.js +0 -1
  347. package/dist/client/assets/agent-settings-Bx-Ya3hQ.js +0 -1
  348. package/dist/client/assets/agent-site-editor-code-DpPWdLwT.js +0 -2
  349. package/dist/client/assets/agent-view-v-h5B6vN.js +0 -1
  350. package/dist/client/assets/api-keys-DCurVLgh.js +0 -1
  351. package/dist/client/assets/app-editor-C3QSidsO.js +0 -1
  352. package/dist/client/assets/category-editor-DZThBJlF.js +0 -1
  353. package/dist/client/assets/collection-table-wrapper-cBr_X4Jo.js +0 -1
  354. package/dist/client/assets/project-reports-CzVFjEoR.js +0 -1
  355. package/dist/client/assets/project-tasks-c_cBe8VF.js +0 -1
  356. package/dist/client/assets/record-editor-CHfqyrFA.js +0 -1
  357. package/dist/client/assets/registry-4kJYrulU.js +0 -2
  358. package/dist/client/assets/reports-COffkxyo.js +0 -1
  359. package/dist/client/assets/repository-picker-BKj90hIS.js +0 -1
  360. package/dist/client/assets/shell-layout-BQnbNNla.js +0 -1
  361. package/dist/client/assets/store-registry-DLmFNBij.js +0 -2
  362. package/dist/client/assets/tasks-Sl_c9zFF.js +0 -1
  363. package/dist/client/assets/useInfiniteQuery-CzQJkRT9.js +0 -1
  364. package/dist/client/assets/useSuspenseInfiniteQuery-D9iG0Y5m.js +0 -1
@@ -1 +1 @@
1
- import{c as m,r as n}from"./index-EcuFIS2a.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
1
+ import{c as m,r as n}from"./index-CC7J7MsT.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
@@ -1 +1 @@
1
- import{a0 as C,a6 as I,m as g,K,r as S,q as b}from"./index-EcuFIS2a.js";import{u as m}from"./use-ai-providers-D-abiIwe.js";const a=new Map;function w(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{w as u};
1
+ import{a0 as C,a6 as I,m as g,K,r as S,q as b}from"./index-CC7J7MsT.js";import{u as m}from"./use-ai-providers-DPIPADTm.js";const a=new Map;function w(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{w as u};
@@ -1 +1 @@
1
- import{r as n}from"./index-EcuFIS2a.js";import{d as h,D as u}from"./hooks-D0dDgrIf.js";const E=()=>0;function m(d){const{orgSlug:t,taskId:a,enabled:s=!0,onStep:S,onFinish:i,onTaskStatus:l,onReconnect:p}=d,c=n.useRef({taskId:a,onStep:S,onFinish:i,onTaskStatus:l,onReconnect:p});c.current={taskId:a,onStep:S,onFinish:i,onTaskStatus:l,onReconnect:p};const o=n.useRef(null),b=n.useRef(s),f=n.useRef(t);(!o.current||b.current!==s||f.current!==t)&&(b.current=s,f.current=t,o.current=k=>{if(!s||!t)return()=>{};const R=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=c.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}k()}};return h.subscribe(t,R,()=>c.current.onReconnect?.())}),n.useSyncExternalStore(o.current,E,E)}export{m as u};
1
+ import{r as n}from"./index-CC7J7MsT.js";import{d as h,D as u}from"./hooks-BFlZlUD7.js";const E=()=>0;function m(d){const{orgSlug:t,taskId:a,enabled:s=!0,onStep:S,onFinish:i,onTaskStatus:l,onReconnect:p}=d,c=n.useRef({taskId:a,onStep:S,onFinish:i,onTaskStatus:l,onReconnect:p});c.current={taskId:a,onStep:S,onFinish:i,onTaskStatus:l,onReconnect:p};const o=n.useRef(null),b=n.useRef(s),f=n.useRef(t);(!o.current||b.current!==s||f.current!==t)&&(b.current=s,f.current=t,o.current=k=>{if(!s||!t)return()=>{};const R=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=c.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}k()}};return h.subscribe(t,R,()=>c.current.onReconnect?.())}),n.useSyncExternalStore(o.current,E,E)}export{m as u};
@@ -1 +1 @@
1
- import{c as oe,b as le,j as n,a0 as se,o as ie,a6 as ce,r as re,t as Y,fc as ae,fd as de}from"./index-EcuFIS2a.js";import{A as z,a as G,b as V,c as X,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-9n2p5SCQ.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let f;e[0]!==a?(f=W=>{W||a()},e[0]=a,e[1]=f):f=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let m;e[16]!==t?(m=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=m):m=e[17];let r;e[18]!==m?(r=n.jsx(X,{children:m}),e[18]=m,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let N;e[31]!==w||e[32]!==j||e[33]!==f?(N=n.jsx(ne,{open:w,onOpenChange:f,children:j}),e[31]=w,e[32]=j,e[33]=f,e[34]=N):N=e[34];const J=s.mode==="force-deleting";let p;e[35]!==a?(p=W=>{W||a()},e[35]=a,e[36]=p):p=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let I;e[58]!==A||e[59]!==F?(I=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=I):I=e[60];let L;e[61]!==y||e[62]!==I?(L=n.jsxs(V,{children:[y,I]}),e[61]=y,e[62]=I,e[63]=L):L=e[63];let b;e[64]!==t?(b=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=b):b=e[65];let R;e[66]!==b?(R=n.jsx(X,{children:b}),e[66]=b,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==L||e[77]!==K?($=n.jsxs(te,{children:[L,K]}),e[76]=L,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==p||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:p,children:$}),e[79]=J,e[80]=p,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==N||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[N,k]}),e[83]=N,e[84]=k,e[85]=Q):Q=e[85],Q}function ue({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},f=o=>{t(),w(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),f(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(m);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),f(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ge as D,ue as u};
1
+ import{c as oe,b as le,j as n,a0 as se,o as ie,a6 as ce,r as re,t as Y,fc as ae,fd as de}from"./index-CC7J7MsT.js";import{A as z,a as G,b as V,c as X,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-D6rlFoy0.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let f;e[0]!==a?(f=W=>{W||a()},e[0]=a,e[1]=f):f=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let m;e[16]!==t?(m=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=m):m=e[17];let r;e[18]!==m?(r=n.jsx(X,{children:m}),e[18]=m,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let N;e[31]!==w||e[32]!==j||e[33]!==f?(N=n.jsx(ne,{open:w,onOpenChange:f,children:j}),e[31]=w,e[32]=j,e[33]=f,e[34]=N):N=e[34];const J=s.mode==="force-deleting";let p;e[35]!==a?(p=W=>{W||a()},e[35]=a,e[36]=p):p=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let I;e[58]!==A||e[59]!==F?(I=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=I):I=e[60];let L;e[61]!==y||e[62]!==I?(L=n.jsxs(V,{children:[y,I]}),e[61]=y,e[62]=I,e[63]=L):L=e[63];let b;e[64]!==t?(b=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=b):b=e[65];let R;e[66]!==b?(R=n.jsx(X,{children:b}),e[66]=b,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==L||e[77]!==K?($=n.jsxs(te,{children:[L,K]}),e[76]=L,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==p||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:p,children:$}),e[79]=J,e[80]=p,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==N||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[N,k]}),e[83]=N,e[84]=k,e[85]=Q):Q=e[85],Q}function ue({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},f=o=>{t(),w(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),f(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(m);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),f(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ge as D,ue as u};
@@ -1 +1 @@
1
- import{c as s,m,K as c}from"./index-EcuFIS2a.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-CC7J7MsT.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,dD as f,K as d,m,dE as g,aE as E}from"./index-EcuFIS2a.js";const p=1e6;function S(e,t,s){s>0&&e.setQueryData(d.aiPlanEntitlements(t),i=>{if(!i?.usage)return i;const n=i.usage;if(!n.limitMicros||n.usedMicros===null)return i;const u=n.usedMicros+s*p,r=Math.min(1,u/n.limitMicros);return{...i,usage:{...n,usedMicros:u,percent:r,state:r>=1?"exhausted":r>=.8?"warn":"ok"}}})}function l(){return g()?.plansEnabled===!0}function o(){const e=c.c(8),t=f(),s=t?.org.slug,i=l();let n;e[0]!==t?.org.id?(n=d.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=n):n=e[1];const u=!!s&&i;let r;e[2]!==s?(r=()=>E(s,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=s,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==u||e[6]!==r?(a={queryKey:n,enabled:u,staleTime:6e4,retry:1,queryFn:r},e[4]=n,e[5]=u,e[6]=r,e[7]=a):a=e[7],m(a)}function P(e){const{data:t}=o();return!e||!t?!0:t.features[e]===!0}function h(){const e=l(),{isPending:t,fetchStatus:s}=o();return!e||s==="idle"||s==="paused"?!0:!t}function x(){const e=c.c(4),t=l(),{isSuccess:s,data:i}=o(),n=i?.features?.model_choice;let u;return e[0]!==s||e[1]!==t||e[2]!==n?(u=b({plansEnabled:t,isSuccess:s,modelChoice:n}),e[0]=s,e[1]=t,e[2]=n,e[3]=u):u=e[3],u}function b({plansEnabled:e,isSuccess:t,modelChoice:s}){return e?t&&s===!0:!0}function y(){const{data:e}=o();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}export{o as a,x as b,S as c,P as d,h as e,y as f,l as u};
1
+ import{c,dD as f,K as d,m,dE as g,aE as E}from"./index-CC7J7MsT.js";const p=1e6;function S(e,t,s){s>0&&e.setQueryData(d.aiPlanEntitlements(t),i=>{if(!i?.usage)return i;const n=i.usage;if(!n.limitMicros||n.usedMicros===null)return i;const u=n.usedMicros+s*p,r=Math.min(1,u/n.limitMicros);return{...i,usage:{...n,usedMicros:u,percent:r,state:r>=1?"exhausted":r>=.8?"warn":"ok"}}})}function l(){return g()?.plansEnabled===!0}function o(){const e=c.c(8),t=f(),s=t?.org.slug,i=l();let n;e[0]!==t?.org.id?(n=d.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=n):n=e[1];const u=!!s&&i;let r;e[2]!==s?(r=()=>E(s,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=s,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==u||e[6]!==r?(a={queryKey:n,enabled:u,staleTime:6e4,retry:1,queryFn:r},e[4]=n,e[5]=u,e[6]=r,e[7]=a):a=e[7],m(a)}function P(e){const{data:t}=o();return!e||!t?!0:t.features[e]===!0}function h(){const e=l(),{isPending:t,fetchStatus:s}=o();return!e||s==="idle"||s==="paused"?!0:!t}function x(){const e=c.c(4),t=l(),{isSuccess:s,data:i}=o(),n=i?.features?.model_choice;let u;return e[0]!==s||e[1]!==t||e[2]!==n?(u=b({plansEnabled:t,isSuccess:s,modelChoice:n}),e[0]=s,e[1]=t,e[2]=n,e[3]=u):u=e[3],u}function b({plansEnabled:e,isSuccess:t,modelChoice:s}){return e?t&&s===!0:!0}function y(){const{data:e}=o();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}export{o as a,x as b,S as c,P as d,h as e,y as f,l as u};
@@ -1 +1 @@
1
- import{c as s}from"./index-EcuFIS2a.js";import{c as v,w}from"./section-preview-url-Csj0_ZDg.js";import{u as h}from"./decofile-api-zRlIvvNL.js";import{u as d}from"./use-session-runtime-B5wMaHtP.js";function D(e){const t=s.c(4),r=d(e?.virtualMcpId).runtime==="cms",i=h(e);let l;return t[0]!==i||t[1]!==r||t[2]!==e?(l=e&&i&&r?v({...e,...i}):null,t[0]=i,t[1]=r,t[2]=e,t[3]=l):l=t[3],l}function R(e){const t=s.c(11);let r;t[0]!==e?(r=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=r):r=t[1];const i=D(r),l=e?.previewServerUrl??null;let n=null;if(l)try{let c;t[2]!==l?(c=new URL(l),t[2]=l,t[3]=c):c=t[3],n=c.host}catch{n=null}let o;t[4]!==i||t[5]!==e||t[6]!==l?(o=e&&l&&i?w(new URL(e.path,l).toString(),i):null,t[4]=i,t[5]=e,t[6]=l,t[7]=o):o=t[7];const f=o;let u;return t[8]!==n||t[9]!==f?(u={url:f,host:n},t[8]=n,t[9]=f,t[10]=u):u=t[10],u}export{D as a,R as u};
1
+ import{c as s}from"./index-CC7J7MsT.js";import{c as v,w}from"./section-preview-url-Csj0_ZDg.js";import{u as h}from"./decofile-api-DygXY02K.js";import{u as d}from"./use-session-runtime-D8PgcjtK.js";function D(e){const t=s.c(4),r=d(e?.virtualMcpId).runtime==="cms",i=h(e);let l;return t[0]!==i||t[1]!==r||t[2]!==e?(l=e&&i&&r?v({...e,...i}):null,t[0]=i,t[1]=r,t[2]=e,t[3]=l):l=t[3],l}function R(e){const t=s.c(11);let r;t[0]!==e?(r=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=r):r=t[1];const i=D(r),l=e?.previewServerUrl??null;let n=null;if(l)try{let c;t[2]!==l?(c=new URL(l),t[2]=l,t[3]=c):c=t[3],n=c.host}catch{n=null}let o;t[4]!==i||t[5]!==e||t[6]!==l?(o=e&&l&&i?w(new URL(e.path,l).toString(),i):null,t[4]=i,t[5]=e,t[6]=l,t[7]=o):o=t[7];const f=o;let u;return t[8]!==n||t[9]!==f?(u={url:f,host:n},t[8]=n,t[9]=f,t[10]=u):u=t[10],u}export{D as a,R as u};
@@ -1 +1 @@
1
- import{c as u,a0 as c,a6 as r,K as a,m as y,D as F,o as C,e as d}from"./index-EcuFIS2a.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,m as b,q as c,E as u};
1
+ import{c as u,a0 as c,a6 as r,K as a,m as y,D as F,o as C,e as d}from"./index-CC7J7MsT.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,m as b,q as c,E as u};
@@ -1 +1 @@
1
- import{c as s,a3 as o}from"./index-EcuFIS2a.js";function n(){const t=s.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},t[0]=e):e=t[0],!!o(e)}export{n as u};
1
+ import{c as s,a3 as o}from"./index-CC7J7MsT.js";function n(){const t=s.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},t[0]=e):e=t[0],!!o(e)}export{n as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-EcuFIS2a.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-CC7J7MsT.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,a0 as q,o as Q,a as V,ar as z,b as B,e as T,q as F,t as S,K as M,j as t,B as P,ap as G,c as J,a6 as K,ah as U,m as Z}from"./index-EcuFIS2a.js";import{D as k,a as Y,b as $,c as H,d as W,e as X}from"./dialog-AoC07APJ.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-CYsJTpNM.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-DBfOOW9i.js";import{T as re}from"./textarea-D5v3ol7T.js";import{u as ae}from"./use-org-auth-client-8fDIgHEZ.js";import{u as le}from"./use-organization-roles-tuKknI1K.js";const ce=G().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(),x=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(),v=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async R=>{const y=await x.organization.inviteMember({email:R,role:s});if(y.error)throw new Error(y.error.message);return y.data})),w=a.filter(R=>R.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}v.mutate({emails:p,role:n.role})},b=p.length>0&&!!j;return t.jsxs(k,{open:d,onOpenChange:c,children:[t.jsx(Y,{asChild:!0,children:e}),t.jsxs($,{className:"sm:max-w-lg",children:[t.jsx(H,{children:t.jsx(W,{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:v.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:v.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(X,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:v.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:v.isPending||!b,children:v.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:x}=U(),r=x||!!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}=Z(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function je(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),x=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==x?(m=()=>{x.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),x.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=x,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=b=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:b}),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=b=>S.error(b instanceof Error?b.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=b=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:b}),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=b=>S.error(b instanceof Error?b.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 v=T(i);let D;return e[26]!==E||e[27]!==v?(D={approve:E,deny:v},e[26]=E,e[27]=v,e[28]=D):D=e[28],D}export{ve as I,je as a,xe as u};
1
+ import{r as L,a0 as q,o as Q,a as V,ar as z,b as B,e as T,q as F,t as S,K as M,j as t,B as P,ap as G,c as J,a6 as K,ah as U,m as Z}from"./index-CC7J7MsT.js";import{D as k,a as Y,b as $,c as H,d as W,e as X}from"./dialog-BKhaq-Xf.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-CxKBX2E3.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-C_C7jdl-.js";import{T as re}from"./textarea-B7wqTmSc.js";import{u as ae}from"./use-org-auth-client-6spdYft8.js";import{u as le}from"./use-organization-roles-B2NYy6qP.js";const ce=G().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(),x=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(),v=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async R=>{const y=await x.organization.inviteMember({email:R,role:s});if(y.error)throw new Error(y.error.message);return y.data})),w=a.filter(R=>R.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}v.mutate({emails:p,role:n.role})},b=p.length>0&&!!j;return t.jsxs(k,{open:d,onOpenChange:c,children:[t.jsx(Y,{asChild:!0,children:e}),t.jsxs($,{className:"sm:max-w-lg",children:[t.jsx(H,{children:t.jsx(W,{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:v.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:v.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(X,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:v.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:v.isPending||!b,children:v.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:x}=U(),r=x||!!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}=Z(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function je(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),x=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==x?(m=()=>{x.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),x.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=x,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=b=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:b}),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=b=>S.error(b instanceof Error?b.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=b=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:b}),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=b=>S.error(b instanceof Error?b.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 v=T(i);let D;return e[26]!==E||e[27]!==v?(D={approve:E,deny:v},e[26]=E,e[27]=v,e[28]=D):D=e[28],D}export{ve as I,je as a,xe as u};
@@ -1 +1 @@
1
- import{aj as ot,ad as st,c as it,b as rt,u as ct,a0 as lt,dZ as dt,d_ as pt,d$ as we,e0 as Ce,ae as mt,ac as Se,e1 as ut,e2 as ft,r as ce,dI as bt,C as Me,e3 as Tt,e4 as It}from"./index-EcuFIS2a.js";import{u as vt}from"./use-route-default-main-BhbKsXCz.js";import{i as Ae}from"./Globe01-g_y8gAs1.js";import{i as gt}from"./Monitor01-Ddm2yOG6.js";import{u as kt}from"./use-connection-BKZRi94S.js";import{b as yt}from"./use-mcp-client-B_gcvvCy.js";import{u as ht}from"./use-mcp-tools-DC47roTz.js";import{a as Pt}from"./use-virtual-mcp-Ji9vcgUj.js";import{g as wt}from"./types-7UQ7SDxU.js";import{t as Ct}from"./utils-CVEq3hMx.js";import{d as St,u as Mt,b as B}from"./use-project-scope-CCxyXvEU.js";import"./index-CutV0Ygc.js";import{g as Vt,a as Rt}from"./github-repo-BknN0SVI.js";import{d as At}from"./use-navigate-to-agent-B8SXI0oO.js";import{c as Nt,d as jt}from"./sandbox-lifecycle-context-BHn9YFEW.js";import{F as Ve}from"./file-type-icon-lZW2ows7.js";import{a as Dt,u as $t}from"./use-panel-navigate-IItrbgmN.js";import{j as xt,f as Ut,az as Et,d as Ft,aF as Ht,g as Ot,aG as Bt,a5 as Lt}from"./agent-icon-CTsmTxHg.js";import{e as Gt}from"./TrendUp01-BCriuXJd.js";import{i as Kt}from"./ZoomOut-DUFJq3-K.js";import{i as Qt}from"./Share07-CZ7JzYs9.js";import{a as _t}from"./Package-CvzEol5_.js";import{u as zt}from"./use-task-metadata-CQjLXps1.js";import{i as Wt,r as Yt,s as Zt}from"./shell-layout-BQnbNNla.js";import{u as qt}from"./use-session-runtime-B5wMaHtP.js";import{u as Jt}from"./use-is-desktop-app-BNujXJc_.js";import{u as Xt}from"./use-organization-settings-DvtBymY3.js";import{b as en,u as tn,c as nn,d as an,f as on}from"./use-project-native-view-presence-WwnxvZuP.js";import{b as sn}from"./chat-context-ELO8A2Ar.js";import{r as rn}from"./virtual-mcp-Dji-1ojO.js";const Ne={overview:Ot,settings:Ht,automations:Ft,"site-editor":Ae,code:Et,content:Kt,assets:_t,hosting:st,e2e:Gt,analytics:Ut,cdn:xt,git:ot,files:Qt};function cn(n){return n in Ne}function Re(n){const e=Bt(n);if(e.type==="icon"){const s=Lt(e.name);return s?{kind:"component",Component:s}:null}return e.type==="url"?{kind:"url",src:e.url}:null}function L(n){if(n.kind==="system")return cn(n.tabId)?{kind:"component",Component:Ne[n.tabId]}:{kind:"fallback"};const e=Re(n.iconUrl);if(e)return e;if(!n.appId)return{kind:"fallback"};const s=n.connections.find(I=>I.id===n.appId);if(!s)return{kind:"fallback"};const c=Re(s.icon);return c||{kind:"fallback"}}function ln(n,e){return!!n&&!!e&&e===`thread:${n}`}function dn(n){return n.threadHasRepo?"repo":ln(n.threadId,n.sandboxBranch)?"none":n.agentHasRepo?"repo":"none"}function Qn(n){const e=it.c(52),s=rt(),{openPanel:c,closePanel:I}=Dt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={strict:!1},e[0]=y):y=e[0];const je=ct(y),le=$t(),de=vt(),i=Pt(n.virtualMcpId),h=zt(n.taskId),{org:o}=lt(),{currentBranch:pe,activeTask:P}=sn(),me=Jt();let l,p,m,u,w;e[1]!==i||e[2]!==o.id||e[3]!==o.slug?(l=Vt(i),w=At,p=o.id,m=o.slug,u=Rt(l),e[1]=i,e[2]=o.id,e[3]=o.slug,e[4]=l,e[5]=p,e[6]=m,e[7]=u,e[8]=w):(l=e[4],p=e[5],m=e[6],u=e[7],w=e[8]);const G=l?.owner??"",K=l?.name??"",Q=l?pe:null;let C;e[9]!==p||e[10]!==m||e[11]!==u||e[12]!==G||e[13]!==K||e[14]!==Q?(C={orgId:p,orgSlug:m,target:u,owner:G,repo:K,branch:Q},e[9]=p,e[10]=m,e[11]=u,e[12]=G,e[13]=K,e[14]=Q,e[15]=C):C=e[15];const S=w(C),De=S.data?.state==="open",v=i?.metadata.ui?.layout??null,f=v?.tabs??[],g=i?.id?dt(i.id):null,M=h?.expanded_tools??[],$e=St(i),V=Xt(),{scopeId:xe,project:Ue}=Mt(),_=en(xe,Ue,i),z=tn(_.project),ue=nn(_.resolvedScopeId,B(_.project?.metadata),z.presence);let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R={includeVirtual:!0},e[16]=R):R=e[16];const b=kt(R),Ee=Nt(),{vmEntry:fe,previewUrl:be}=jt(),W=P?.branch??pe;let A;e[17]!==P?.metadata||e[18]!==n.taskId||e[19]!==i?.metadata||e[20]!==h||e[21]!==W?(A=dn({threadId:n.taskId,sandboxBranch:W,agentHasRepo:B(i?.metadata),threadHasRepo:B(h)||B(P?.metadata)}),e[17]=P?.metadata,e[18]=n.taskId,e[19]=i?.metadata,e[20]=h,e[21]=W,e[22]=A):A=e[22];const Fe=A,Te=Ee.lifecycle.phase==="running",{runtime:He,resolved:Ie}=qt(n.virtualMcpId);let N;e[23]!==me||e[24]!==be||e[25]!==fe?(N=void 0,e[23]=me,e[24]=be,e[25]=fe,e[26]=N):N=e[26];const Oe=N,ve=yt({connectionId:g??void 0,orgId:o.id,orgSlug:o.slug,mcpUrl:Oe}),Y=ve,Z=!!ve&&Te;let j;e[27]!==Y||e[28]!==Z?(j={client:Y,enabled:Z},e[27]=Y,e[28]=Z,e[29]=j):j=e[29];const{data:Be}=ht(j),ge=g&&Te?(Be?.tools??[]).filter(fn).map(t=>({connectionId:g,toolName:t.name,label:Ct(t.name),icon:null})):[],q=ge[0],Le=q?ge:[],k=q&&g?{type:"ext-apps",id:g,toolName:q.toolName}:v?.defaultMainView??null,Ge=rn(v),ke={assets:z.assetsPending,siteAccess:z.siteAccessPending},{activeTab:d,mainOpen:Ke}=pt({panelTabId:le,mainPanelParam:je.mainpanel,routeDefaultMain:de,metadata:k||v?{defaultMainView:k,tabs:f.map(un)}:null}),J=$e&&(De||S.isPending&&d==="git"),Qe=k||v?{defaultMainView:k,tabs:f.map(mn)}:null,D=Yt({hasSource:Fe==="repo"||V,runtime:He,cmsMode:Ge}),_e=D.includes("content"),ze=we(Qe),We=k?.type,ye=an(We,ue,ke,D,Ie),$=ye?we(null):ze,Ye=on(d,ue,ke),Ze=!D.includes("code")&&Ie&&Ce(d)!==null,a=!le&&!de&&ye||d==="git"&&!J&&!S.isPending||d==="content"&&!_e||Ze||Ye?$:d,T=d==="git"&&!J&&!S.isPending?!1:Ke,X=mt(a);let x;e[30]!==s?(x=t=>s(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[30]=s,e[31]=x):x=e[31];const qe=x,he=[];J&&he.push({id:"git",title:s("common.mainPanelTabs.reviewChanges")});const ee=new Map;for(const t of M){const r=Se(t.appId,t.toolName);ee.set(r,{id:r,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Le){if(t.toolName==="fetch_assets")continue;const r=Se(t.connectionId,t.toolName);ee.set(r,{id:r,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const te=ut(a),ne=te?te.key.split("/").pop()??te.key:null,Je=ne?[{id:a,title:ne,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Ve,{filename:ne,...t})}}]:[],U=ft(a),Xe=U?[{id:a,title:(U.path.split("/").pop()??U.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>ce.createElement(U.path.startsWith("pages/")?Ae:gt,t)}}]:[],ae=bt(a),oe=ae?ae.path.split("/").pop()??ae.path:null,et=oe?[{id:a,title:oe,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Ve,{filename:oe,...t})}}]:[],tt=Wt(a)?D.map(t=>({id:t==="code"&&Ce(a)?a:t,title:qe(t),kind:"system",icon:L({tabId:t,kind:"system",connections:b})})):[];let E;e[32]!==b?(E=t=>({id:Tt(t.id),title:t.title,kind:"agent",icon:L({tabId:t.id,kind:"agent",appId:t.view.appId,connections:b})}),e[32]=b,e[33]=E):E=e[33];const nt=[...tt,...he.map(t=>({id:t.id,title:t.title,kind:"system",icon:L({tabId:t.id,kind:"system",connections:b})})),...Je,...Xe,...et,...f.map(E),...Array.from(ee.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:L({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:b})}))],Pe=new Set,se=nt.filter(t=>Pe.has(t.id)?!1:(Pe.add(t.id),!0)),at=n.virtualMcpId;let F;e[34]!==o.id?(F=Me(o.id),e[34]=o.id,e[35]=F):F=e[35];const ie=at===F;let H;e[36]!==a||e[37]!==I||e[38]!==T||e[39]!==ie||e[40]!==c||e[41]!==o.id||e[42]!==V?(H=t=>{if(Zt({reportsOnly:V,onReportAgent:ie,tabId:t})){c(t,{virtualmcpid:Me(o.id),search:pn});return}const r=It({clickedId:t,activeTab:a,mainOpen:T});"close"in r?I():c(r.tabId)},e[36]=a,e[37]=I,e[38]=T,e[39]=ie,e[40]=c,e[41]=o.id,e[42]=V,e[43]=H):H=e[43];const re=H;let O;return e[44]!==a||e[45]!==X||e[46]!==M||e[47]!==f||e[48]!==T||e[49]!==re||e[50]!==se?(O={activeTab:a,mainOpen:T,setActiveTab:re,layoutTabs:f,expandedTools:M,automationTabParsed:X,tabs:se},e[44]=a,e[45]=X,e[46]=M,e[47]=f,e[48]=T,e[49]=re,e[50]=se,e[51]=O):O=e[51],O}function pn(n){return{...n,thread:void 0}}function mn(n){return{id:n.id}}function un(n){return{id:n.id}}function fn(n){return!!wt(n._meta)}export{dn as r,Qn as u};
1
+ import{aj as ot,ad as st,c as it,b as rt,u as ct,a0 as lt,dZ as dt,d_ as pt,d$ as we,e0 as Ce,ae as mt,ac as Se,e1 as ut,e2 as ft,r as ce,dI as bt,C as Me,e3 as Tt,e4 as It}from"./index-CC7J7MsT.js";import{u as vt}from"./use-route-default-main-DAXdKSA3.js";import{i as Ae}from"./Globe01-DjdW3vEO.js";import{i as gt}from"./Monitor01-CQaKbr3c.js";import{u as kt}from"./use-connection-DAR6kA6F.js";import{b as yt}from"./use-mcp-client-jmamuSRM.js";import{u as ht}from"./use-mcp-tools-U5kwqIN7.js";import{a as Pt}from"./use-virtual-mcp-Bt7oX0ej.js";import{g as wt}from"./types-BQYrCHfb.js";import{t as Ct}from"./utils-CVEq3hMx.js";import{d as St,u as Mt,b as B}from"./use-project-scope-azWGklpf.js";import"./index-CV2G6XgT.js";import{g as Vt,a as Rt}from"./github-repo-BknN0SVI.js";import{d as At}from"./use-navigate-to-agent-XZHI0vTx.js";import{c as Nt,d as jt}from"./sandbox-lifecycle-context-DLKr6QBG.js";import{F as Ve}from"./file-type-icon-Co9lETmZ.js";import{a as Dt,u as $t}from"./use-panel-navigate-YnjVvVnu.js";import{j as xt,f as Ut,az as Et,d as Ft,aF as Ht,g as Ot,aG as Bt,a5 as Lt}from"./agent-icon-D5Ih-I28.js";import{e as Gt}from"./TrendUp01-DlYmFZ7k.js";import{i as Kt}from"./ZoomOut-B3S7N50e.js";import{i as Qt}from"./Share07-Bw4Wicv2.js";import{a as _t}from"./Package-Cd3aVeK8.js";import{u as zt}from"./use-task-metadata-IzJB5PVG.js";import{i as Wt,r as Yt,s as Zt}from"./shell-layout-p-WJ7uxl.js";import{u as qt}from"./use-session-runtime-D8PgcjtK.js";import{u as Jt}from"./use-is-desktop-app-BNujXJc_.js";import{u as Xt}from"./use-organization-settings-DiOLzOn-.js";import{b as en,u as tn,c as nn,d as an,f as on}from"./use-project-native-view-presence-S2GuqygD.js";import{b as sn}from"./chat-context-CVZ1rNGo.js";import{r as rn}from"./virtual-mcp-BWl8nlWy.js";const Ne={overview:Ot,settings:Ht,automations:Ft,"site-editor":Ae,code:Et,content:Kt,assets:_t,hosting:st,e2e:Gt,analytics:Ut,cdn:xt,git:ot,files:Qt};function cn(n){return n in Ne}function Re(n){const e=Bt(n);if(e.type==="icon"){const s=Lt(e.name);return s?{kind:"component",Component:s}:null}return e.type==="url"?{kind:"url",src:e.url}:null}function L(n){if(n.kind==="system")return cn(n.tabId)?{kind:"component",Component:Ne[n.tabId]}:{kind:"fallback"};const e=Re(n.iconUrl);if(e)return e;if(!n.appId)return{kind:"fallback"};const s=n.connections.find(I=>I.id===n.appId);if(!s)return{kind:"fallback"};const c=Re(s.icon);return c||{kind:"fallback"}}function ln(n,e){return!!n&&!!e&&e===`thread:${n}`}function dn(n){return n.threadHasRepo?"repo":ln(n.threadId,n.sandboxBranch)?"none":n.agentHasRepo?"repo":"none"}function Qn(n){const e=it.c(52),s=rt(),{openPanel:c,closePanel:I}=Dt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={strict:!1},e[0]=y):y=e[0];const je=ct(y),le=$t(),de=vt(),i=Pt(n.virtualMcpId),h=zt(n.taskId),{org:o}=lt(),{currentBranch:pe,activeTask:P}=sn(),me=Jt();let l,p,m,u,w;e[1]!==i||e[2]!==o.id||e[3]!==o.slug?(l=Vt(i),w=At,p=o.id,m=o.slug,u=Rt(l),e[1]=i,e[2]=o.id,e[3]=o.slug,e[4]=l,e[5]=p,e[6]=m,e[7]=u,e[8]=w):(l=e[4],p=e[5],m=e[6],u=e[7],w=e[8]);const G=l?.owner??"",K=l?.name??"",Q=l?pe:null;let C;e[9]!==p||e[10]!==m||e[11]!==u||e[12]!==G||e[13]!==K||e[14]!==Q?(C={orgId:p,orgSlug:m,target:u,owner:G,repo:K,branch:Q},e[9]=p,e[10]=m,e[11]=u,e[12]=G,e[13]=K,e[14]=Q,e[15]=C):C=e[15];const S=w(C),De=S.data?.state==="open",v=i?.metadata.ui?.layout??null,f=v?.tabs??[],g=i?.id?dt(i.id):null,M=h?.expanded_tools??[],$e=St(i),V=Xt(),{scopeId:xe,project:Ue}=Mt(),_=en(xe,Ue,i),z=tn(_.project),ue=nn(_.resolvedScopeId,B(_.project?.metadata),z.presence);let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R={includeVirtual:!0},e[16]=R):R=e[16];const b=kt(R),Ee=Nt(),{vmEntry:fe,previewUrl:be}=jt(),W=P?.branch??pe;let A;e[17]!==P?.metadata||e[18]!==n.taskId||e[19]!==i?.metadata||e[20]!==h||e[21]!==W?(A=dn({threadId:n.taskId,sandboxBranch:W,agentHasRepo:B(i?.metadata),threadHasRepo:B(h)||B(P?.metadata)}),e[17]=P?.metadata,e[18]=n.taskId,e[19]=i?.metadata,e[20]=h,e[21]=W,e[22]=A):A=e[22];const Fe=A,Te=Ee.lifecycle.phase==="running",{runtime:He,resolved:Ie}=qt(n.virtualMcpId);let N;e[23]!==me||e[24]!==be||e[25]!==fe?(N=void 0,e[23]=me,e[24]=be,e[25]=fe,e[26]=N):N=e[26];const Oe=N,ve=yt({connectionId:g??void 0,orgId:o.id,orgSlug:o.slug,mcpUrl:Oe}),Y=ve,Z=!!ve&&Te;let j;e[27]!==Y||e[28]!==Z?(j={client:Y,enabled:Z},e[27]=Y,e[28]=Z,e[29]=j):j=e[29];const{data:Be}=ht(j),ge=g&&Te?(Be?.tools??[]).filter(fn).map(t=>({connectionId:g,toolName:t.name,label:Ct(t.name),icon:null})):[],q=ge[0],Le=q?ge:[],k=q&&g?{type:"ext-apps",id:g,toolName:q.toolName}:v?.defaultMainView??null,Ge=rn(v),ke={assets:z.assetsPending,siteAccess:z.siteAccessPending},{activeTab:d,mainOpen:Ke}=pt({panelTabId:le,mainPanelParam:je.mainpanel,routeDefaultMain:de,metadata:k||v?{defaultMainView:k,tabs:f.map(un)}:null}),J=$e&&(De||S.isPending&&d==="git"),Qe=k||v?{defaultMainView:k,tabs:f.map(mn)}:null,D=Yt({hasSource:Fe==="repo"||V,runtime:He,cmsMode:Ge}),_e=D.includes("content"),ze=we(Qe),We=k?.type,ye=an(We,ue,ke,D,Ie),$=ye?we(null):ze,Ye=on(d,ue,ke),Ze=!D.includes("code")&&Ie&&Ce(d)!==null,a=!le&&!de&&ye||d==="git"&&!J&&!S.isPending||d==="content"&&!_e||Ze||Ye?$:d,T=d==="git"&&!J&&!S.isPending?!1:Ke,X=mt(a);let x;e[30]!==s?(x=t=>s(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[30]=s,e[31]=x):x=e[31];const qe=x,he=[];J&&he.push({id:"git",title:s("common.mainPanelTabs.reviewChanges")});const ee=new Map;for(const t of M){const r=Se(t.appId,t.toolName);ee.set(r,{id:r,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Le){if(t.toolName==="fetch_assets")continue;const r=Se(t.connectionId,t.toolName);ee.set(r,{id:r,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const te=ut(a),ne=te?te.key.split("/").pop()??te.key:null,Je=ne?[{id:a,title:ne,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Ve,{filename:ne,...t})}}]:[],U=ft(a),Xe=U?[{id:a,title:(U.path.split("/").pop()??U.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>ce.createElement(U.path.startsWith("pages/")?Ae:gt,t)}}]:[],ae=bt(a),oe=ae?ae.path.split("/").pop()??ae.path:null,et=oe?[{id:a,title:oe,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Ve,{filename:oe,...t})}}]:[],tt=Wt(a)?D.map(t=>({id:t==="code"&&Ce(a)?a:t,title:qe(t),kind:"system",icon:L({tabId:t,kind:"system",connections:b})})):[];let E;e[32]!==b?(E=t=>({id:Tt(t.id),title:t.title,kind:"agent",icon:L({tabId:t.id,kind:"agent",appId:t.view.appId,connections:b})}),e[32]=b,e[33]=E):E=e[33];const nt=[...tt,...he.map(t=>({id:t.id,title:t.title,kind:"system",icon:L({tabId:t.id,kind:"system",connections:b})})),...Je,...Xe,...et,...f.map(E),...Array.from(ee.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:L({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:b})}))],Pe=new Set,se=nt.filter(t=>Pe.has(t.id)?!1:(Pe.add(t.id),!0)),at=n.virtualMcpId;let F;e[34]!==o.id?(F=Me(o.id),e[34]=o.id,e[35]=F):F=e[35];const ie=at===F;let H;e[36]!==a||e[37]!==I||e[38]!==T||e[39]!==ie||e[40]!==c||e[41]!==o.id||e[42]!==V?(H=t=>{if(Zt({reportsOnly:V,onReportAgent:ie,tabId:t})){c(t,{virtualmcpid:Me(o.id),search:pn});return}const r=It({clickedId:t,activeTab:a,mainOpen:T});"close"in r?I():c(r.tabId)},e[36]=a,e[37]=I,e[38]=T,e[39]=ie,e[40]=c,e[41]=o.id,e[42]=V,e[43]=H):H=e[43];const re=H;let O;return e[44]!==a||e[45]!==X||e[46]!==M||e[47]!==f||e[48]!==T||e[49]!==re||e[50]!==se?(O={activeTab:a,mainOpen:T,setActiveTab:re,layoutTabs:f,expandedTools:M,automationTabParsed:X,tabs:se},e[44]=a,e[45]=X,e[46]=M,e[47]=f,e[48]=T,e[49]=re,e[50]=se,e[51]=O):O=e[51],O}function pn(n){return{...n,thread:void 0}}function mn(n){return{id:n.id}}function un(n){return{id:n.id}}function fn(n){return!!wt(n._meta)}export{dn as r,Qn as u};
@@ -1 +1 @@
1
- import{c as b,b as k,T as N,aH as S,j as o,a0 as $,K as A,D as H}from"./index-EcuFIS2a.js";import{B as g}from"./badge-C5M6nZd4.js";import{c as T,T as v,a as I,b as L}from"./tooltip-nr5oS_bm.js";import{g as _}from"./types-7UQ7SDxU.js";import{s as P}from"./Eye-Dq6Vw6FI.js";import{j as U,aB as w}from"./agent-icon-CTsmTxHg.js";import{i as B}from"./mcp-oauth-B7YJNr4N.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=_(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=L,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(T,{children:[o.jsx(v,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(T,{children:[o.jsx(v,{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 Q(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=H,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=()=>B({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,Q as u};
1
+ import{c as b,b as k,T as N,aH as S,j as o,a0 as $,K as A,D as H}from"./index-CC7J7MsT.js";import{B as g}from"./badge-BSirYRuD.js";import{c as T,T as v,a as I,b as L}from"./tooltip-DSCGYdw1.js";import{g as _}from"./types-BQYrCHfb.js";import{s as P}from"./Eye-Bxxku7SE.js";import{j as U,aB as w}from"./agent-icon-D5Ih-I28.js";import{i as B}from"./mcp-oauth-Cr_ZflCp.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=_(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=L,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(T,{children:[o.jsx(v,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(T,{children:[o.jsx(v,{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 Q(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=H,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=()=>B({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,Q as u};
@@ -1,4 +1,4 @@
1
- import{c3 as ue,c4 as de,c5 as he,c6 as fe,c7 as pe,c8 as _,c9 as g,ca as me,cb as _e,cc as we,cd as M,ce as ge,cf as D,cg as Te,ch as q,ci as ye,cj as L,ck as ke,cl as ve,cm as Se,cn as W,co as Ce,cp as be,cq as Re,cr as se,cs as Ie,ct as Ee,cu as qe,b3 as Pe,cv as $e,cw as Me,cx as A,cy as Ae,cz as He,cA as Oe,cB as Ue,cC as xe,cD as Ne,cE as je,cF as Fe,cG as De,cH as Le,cI as Ve,cJ as ze,cK as Qe,aW as U,cL as Je,cM as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-EcuFIS2a.js";import{U as P,b as H,c as K}from"./auth-BBW3DF0r.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let it=class extends Ze{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?ze:Qe,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
1
+ import{c3 as ue,c4 as de,c5 as he,c6 as fe,c7 as pe,c8 as _,c9 as g,ca as me,cb as _e,cc as we,cd as M,ce as ge,cf as D,cg as Te,ch as q,ci as ye,cj as L,ck as ke,cl as ve,cm as Se,cn as W,co as Ce,cp as be,cq as Re,cr as se,cs as Ie,ct as Ee,cu as qe,b3 as Pe,cv as $e,cw as Me,cx as A,cy as Ae,cz as He,cA as Oe,cB as Ue,cC as xe,cD as Ne,cE as je,cF as Fe,cG as De,cH as Le,cI as Ve,cJ as ze,cK as Qe,aW as U,cL as Je,cM as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-CC7J7MsT.js";import{U as P,b as H,c as K}from"./auth-B_QE3yd2.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let it=class extends Ze{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?ze:Qe,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
2
2
  `)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const w=f(c);w!==""&&o.push(w)}function f(h){let c=0;if(h.indexOf("\r")===-1){let w=h.indexOf(`
3
3
  `,c);for(;w!==-1;){if(c===w){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=w+1,w=h.indexOf(`
4
4
  `,c);continue}const v=h.charCodeAt(c);if(ee(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,C=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===X){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
@@ -1 +1 @@
1
- import{c as l,m as u,c8 as m,c9 as f,D as y,K as n}from"./index-EcuFIS2a.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
1
+ import{c as l,m as u,c8 as m,c9 as f,D as y,K as n}from"./index-CC7J7MsT.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
@@ -1 +1 @@
1
- import{c as m,D as p,m as q,K as T}from"./index-EcuFIS2a.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,O as b,w as c,K as u};
1
+ import{c as m,D as p,m as q,K as T}from"./index-CC7J7MsT.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,O as b,w as c,K as u};
@@ -1 +1 @@
1
- import{c,a0 as m,m as b,D as M,K as f}from"./index-EcuFIS2a.js";import{u as y}from"./use-org-auth-client-8fDIgHEZ.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,a0 as m,m as b,D as M,K as f}from"./index-CC7J7MsT.js";import{u as y}from"./use-org-auth-client-6spdYft8.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{c as m,r}from"./index-EcuFIS2a.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-CC7J7MsT.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{c as m,m as b,K as T,aE as E,a0 as U,d as K,o as $,a as H,cY as N,cZ as k}from"./index-EcuFIS2a.js";import{e as Q,f as D}from"./use-virtual-mcp-Ji9vcgUj.js";import{u as I}from"./hooks-D0dDgrIf.js";import{p as V,d as _,w as Y}from"./thread-intent-CTSjhfEo.js";import{r as S,h as P,g as B,a as j}from"./github-repo-BknN0SVI.js";function O(t,e){if(!e)return!0;if(t.partial)return!1;const n=V(t.metadata?.runtime);return n===null||n===e}function w(t,e,n,a,s){let o=null;for(const r of t)r.virtual_mcp_id===e&&r.created_by===n&&(r.hidden||O(r,a)&&(s&&r.branch===s||(!o||r.updated_at>o.updated_at)&&(o=r)));return o}function me(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&O(s,a))}function x(t,e,n,a,s,o){return s?w(t,e,n,a,o?.baseBranch)??void 0:w(t,e,n,a)??void 0}const Z=6e4,A=3e4;function C(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function z(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function q(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:T.githubPrState(e,S(n),a,s,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&P(n)&&!!a&&!!s,refetchInterval:Z,refetchIntervalInBackground:!1,staleTime:A}}function J(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:W},e[2]=n,e[3]=a):a=e[3],b(a)}function W(t){return t.changeRequest?C(t.changeRequest):null}function ge(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:X},e[2]=n,e[3]=a):a=e[3],b(a)}function X(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(z):[]}function be(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:M},e[2]=n,e[3]=a):a=e[3],b(a)}function M(t){return(t.changeRequest?.comments??[]).map(ee)}function ee(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const te=5*6e4;function pe(t){const e=m.c(20),{orgSlug:n,target:a,owner:s,repo:o,base:r}=t;let u;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(u=T.githubLastPublishedPr(n,S(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==r||e[7]!==n||e[8]!==a?(i=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=i):i=e[9];let l;e[10]!==t.enabled||e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!r&&P(a)&&!!s&&!!o,e[10]=t.enabled,e[11]=r,e[12]=s,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==u||e[17]!==i||e[18]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:te,select:ne},e[16]=u,e[17]=i,e[18]=l,e[19]=c):c=e[19],b(c)}function ne(t){return t.changeRequest?C(t.changeRequest):null}const ae=50;function ye(t){const e=m.c(17),{orgSlug:n,target:a,owner:s,repo:o}=t;let r;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==a?(r=T.githubOpenPrs(n,S(a),s,o),e[0]=n,e[1]=s,e[2]=o,e[3]=a,e[4]=r):r=e[4];let u;e[5]!==n||e[6]!==a?(u=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:ae}),e[5]=n,e[6]=a,e[7]=u):u=e[7];let i;e[8]!==t.enabled||e[9]!==s||e[10]!==o||e[11]!==a?(i=(t.enabled??!0)&&P(a)&&!!s&&!!o,e[8]=t.enabled,e[9]=s,e[10]=o,e[11]=a,e[12]=i):i=e[12];let l;return e[13]!==r||e[14]!==u||e[15]!==i?(l={queryKey:r,queryFn:u,enabled:i,staleTime:A,select:se},e[13]=r,e[14]=u,e[15]=i,e[16]=l):l=e[16],b(l)}function se(t){return t.changeRequests.map(C)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:s,repo:o,checkRunId:r}=t;let u;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(u=T.githubCheckRun(n,S(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==r||e[7]!==n||e[8]!==a?(i=()=>E(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=i):i=e[9];const l=t.enabled&&!!r;let c;return e[10]!==u||e[11]!==i||e[12]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:A,select:re},e[10]=u,e[11]=i,e[12]=l,e[13]=c):c=e[13],b(c)}function re(t){return{title:null,summary:t.report,text:null}}function oe(t,e){const{org:n}=U(),a=B(t);return J({orgId:n.id,orgSlug:n.slug,target:j(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ue=[];function Te(){const t=m.c(13),e=K(),{org:n,locator:a}=U(),s=$(),o=Q(),{data:r}=H.useSession(),u=I(),i=oe(void 0,null);let l;t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==u?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(f,d,y)=>{const h=d?.panel??"overview";if(N(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:f,replace:!1});return}const g=(o??[]).find(G=>G.id===f),F=!!(g&&B(g)),L=!d?.runtime,v=L?void 0:x(u?.threads.get()??ue,f,r?.user?.id,y??(g?_(g.metadata):void 0),F,{baseBranch:i}),R=L?void 0:v?.id??crypto.randomUUID();R&&!v&&d?.runtime&&Y(sessionStorage,a,R,{runtime:d.runtime}),k(e,{tabId:h,org:n.slug,agentId:f,search:()=>R?{thread:R}:{},replace:!1})},t[0]=i,t[1]=o,t[2]=a,t[3]=u?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const c=l;let p;return t[8]!==o||t[9]!==c||t[10]!==n||t[11]!==s?(p=(f,d)=>{if(N(d?.panel??"overview").kind==="org-destination")return c(f,d,void 0);const y=o.find(h=>h.id===f);if(d?.runtime)return c(f,d,d.runtime);if(y)return c(f,d,_(y.metadata));D(s,n).then(h=>h.find(g=>g.id===f)).catch(ie).then(h=>c(f,d,h?_(h.metadata):void 0))},t[8]=o,t[9]=c,t[10]=n,t[11]=s,t[12]=p):p=t[12],p}function ie(){}export{oe as a,x as b,ye as c,J as d,pe as e,me as f,ge as g,Re as h,be as i,q as p,Te as u};
1
+ import{c as m,m as b,K as T,aE as E,a0 as U,d as K,o as $,a as H,cY as N,cZ as k}from"./index-CC7J7MsT.js";import{e as Q,f as D}from"./use-virtual-mcp-Bt7oX0ej.js";import{u as I}from"./hooks-BFlZlUD7.js";import{p as V,d as _,w as Y}from"./thread-intent-DZx7N_NL.js";import{r as S,h as P,g as B,a as j}from"./github-repo-BknN0SVI.js";function O(t,e){if(!e)return!0;if(t.partial)return!1;const n=V(t.metadata?.runtime);return n===null||n===e}function w(t,e,n,a,s){let o=null;for(const r of t)r.virtual_mcp_id===e&&r.created_by===n&&(r.hidden||O(r,a)&&(s&&r.branch===s||(!o||r.updated_at>o.updated_at)&&(o=r)));return o}function me(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&O(s,a))}function x(t,e,n,a,s,o){return s?w(t,e,n,a,o?.baseBranch)??void 0:w(t,e,n,a)??void 0}const Z=6e4,A=3e4;function C(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function z(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function q(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:T.githubPrState(e,S(n),a,s,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&P(n)&&!!a&&!!s,refetchInterval:Z,refetchIntervalInBackground:!1,staleTime:A}}function J(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:W},e[2]=n,e[3]=a):a=e[3],b(a)}function W(t){return t.changeRequest?C(t.changeRequest):null}function ge(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:X},e[2]=n,e[3]=a):a=e[3],b(a)}function X(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(z):[]}function be(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:M},e[2]=n,e[3]=a):a=e[3],b(a)}function M(t){return(t.changeRequest?.comments??[]).map(ee)}function ee(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const te=5*6e4;function pe(t){const e=m.c(20),{orgSlug:n,target:a,owner:s,repo:o,base:r}=t;let u;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(u=T.githubLastPublishedPr(n,S(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==r||e[7]!==n||e[8]!==a?(i=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=i):i=e[9];let l;e[10]!==t.enabled||e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!r&&P(a)&&!!s&&!!o,e[10]=t.enabled,e[11]=r,e[12]=s,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==u||e[17]!==i||e[18]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:te,select:ne},e[16]=u,e[17]=i,e[18]=l,e[19]=c):c=e[19],b(c)}function ne(t){return t.changeRequest?C(t.changeRequest):null}const ae=50;function ye(t){const e=m.c(17),{orgSlug:n,target:a,owner:s,repo:o}=t;let r;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==a?(r=T.githubOpenPrs(n,S(a),s,o),e[0]=n,e[1]=s,e[2]=o,e[3]=a,e[4]=r):r=e[4];let u;e[5]!==n||e[6]!==a?(u=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:ae}),e[5]=n,e[6]=a,e[7]=u):u=e[7];let i;e[8]!==t.enabled||e[9]!==s||e[10]!==o||e[11]!==a?(i=(t.enabled??!0)&&P(a)&&!!s&&!!o,e[8]=t.enabled,e[9]=s,e[10]=o,e[11]=a,e[12]=i):i=e[12];let l;return e[13]!==r||e[14]!==u||e[15]!==i?(l={queryKey:r,queryFn:u,enabled:i,staleTime:A,select:se},e[13]=r,e[14]=u,e[15]=i,e[16]=l):l=e[16],b(l)}function se(t){return t.changeRequests.map(C)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:s,repo:o,checkRunId:r}=t;let u;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(u=T.githubCheckRun(n,S(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==r||e[7]!==n||e[8]!==a?(i=()=>E(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=i):i=e[9];const l=t.enabled&&!!r;let c;return e[10]!==u||e[11]!==i||e[12]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:A,select:re},e[10]=u,e[11]=i,e[12]=l,e[13]=c):c=e[13],b(c)}function re(t){return{title:null,summary:t.report,text:null}}function oe(t,e){const{org:n}=U(),a=B(t);return J({orgId:n.id,orgSlug:n.slug,target:j(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ue=[];function Te(){const t=m.c(13),e=K(),{org:n,locator:a}=U(),s=$(),o=Q(),{data:r}=H.useSession(),u=I(),i=oe(void 0,null);let l;t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==u?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(f,d,y)=>{const h=d?.panel??"overview";if(N(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:f,replace:!1});return}const g=(o??[]).find(G=>G.id===f),F=!!(g&&B(g)),L=!d?.runtime,v=L?void 0:x(u?.threads.get()??ue,f,r?.user?.id,y??(g?_(g.metadata):void 0),F,{baseBranch:i}),R=L?void 0:v?.id??crypto.randomUUID();R&&!v&&d?.runtime&&Y(sessionStorage,a,R,{runtime:d.runtime}),k(e,{tabId:h,org:n.slug,agentId:f,search:()=>R?{thread:R}:{},replace:!1})},t[0]=i,t[1]=o,t[2]=a,t[3]=u?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const c=l;let p;return t[8]!==o||t[9]!==c||t[10]!==n||t[11]!==s?(p=(f,d)=>{if(N(d?.panel??"overview").kind==="org-destination")return c(f,d,void 0);const y=o.find(h=>h.id===f);if(d?.runtime)return c(f,d,d.runtime);if(y)return c(f,d,_(y.metadata));D(s,n).then(h=>h.find(g=>g.id===f)).catch(ie).then(h=>c(f,d,h?_(h.metadata):void 0))},t[8]=o,t[9]=c,t[10]=n,t[11]=s,t[12]=p):p=t[12],p}function ie(){}export{oe as a,x as b,ye as c,J as d,pe as e,me as f,ge as g,Re as h,be as i,q as p,Te as u};
@@ -1 +1 @@
1
- import{c as l,a6 as f,b as p,e as T,t as m}from"./index-EcuFIS2a.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,a6 as f,b as p,e as T,t as m}from"./index-CC7J7MsT.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,a0 as j,a as i}from"./index-EcuFIS2a.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,a0 as j,a as i}from"./index-CC7J7MsT.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,a0 as S,K as y,m as $,o as T,e as K}from"./index-EcuFIS2a.js";function Y(s){return s.contentHash??`${s.size}-${s.updatedAt}`}function F(s,e,t,n){const i=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(s)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(s,e,t){const n=await fetch(s,e);if(n.ok||t?.allow404&&n.status===404)return n;let i="";try{i=(await n.json()).error??""}catch{}throw new Error(i||`HTTP ${n.status}`)}function z(s,e){const t=p.c(15),{org:n}=S();let i;t[0]!==n.id||t[1]!==e||t[2]!==s?(i=y.orgFsList(n.id,s,e),t[0]=n.id,t[1]=e,t[2]=s,t[3]=i):i=t[3];let r;t[4]!==n.id||t[5]!==s?(r=(c,o)=>o?.queryKey[1]===n.id&&o.queryKey[2]===s?c:void 0,t[4]=n.id,t[5]=s,t[6]=r):r=t[6];let a;t[7]!==n.slug||t[8]!==e||t[9]!==s?(a=async()=>(await(await h(F(n.slug,s,"list",{path:e}))).json()).entries.toSorted(x),t[7]=n.slug,t[8]=e,t[9]=s,t[10]=a):a=t[10];let l;return t[11]!==i||t[12]!==r||t[13]!==a?(l={queryKey:i,placeholderData:r,queryFn:a},t[11]=i,t[12]=r,t[13]=a,t[14]=l):l=t[14],$(l)}function x(s,e){return s.kind!==e.kind?s.kind==="dir"?-1:1:s.path.localeCompare(e.path)}async function C(s,e,t){const n=await h(F(s,e,"stat",{path:t}),void 0,{allow404:!0});return n.status===404?null:(await n.json()).entry}function B(s,e,t){const n=p.c(15),{org:i}=S();let r;n[0]!==i.id||n[1]!==e||n[2]!==s?(r=y.orgFsStat(i.id,s??"",e),n[0]=i.id,n[1]=e,n[2]=s,n[3]=r):r=n[3];const a=s!==null;let l;n[4]!==t?(l=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,n[4]=t,n[5]=l):l=n[5];let c;n[6]!==i.slug||n[7]!==e||n[8]!==s?(c=()=>C(i.slug,s??"",e),n[6]=i.slug,n[7]=e,n[8]=s,n[9]=c):c=n[9];let o;return n[10]!==r||n[11]!==a||n[12]!==l||n[13]!==c?(o={queryKey:r,enabled:a,refetchInterval:l,queryFn:c},n[10]=r,n[11]=a,n[12]=l,n[13]=c,n[14]=o):o=n[14],$(o)}function J(s){const e=p.c(9),{org:t}=S();let n;e[0]!==t.id||e[1]!==s?(n=y.orgFsUsage(t.id,s),e[0]=t.id,e[1]=s,e[2]=n):n=e[2];let i;e[3]!==t.slug||e[4]!==s?(i=async()=>await(await h(F(t.slug,s,"usage"))).json(),e[3]=t.slug,e[4]=s,e[5]=i):i=e[5];let r;return e[6]!==n||e[7]!==i?(r={queryKey:n,queryFn:i},e[6]=n,e[7]=i,e[8]=r):r=e[8],$(r)}function V(s,e){const t=p.c(9),n=s===void 0?60:s,{org:i}=S();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let l;t[2]!==n||t[3]!==i.slug?(l=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${n}`)).json()).entries,t[2]=n,t[3]=i.slug,t[4]=l):l=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==l?(c={queryKey:r,enabled:a,queryFn:l},t[5]=r,t[6]=a,t[7]=l,t[8]=c):c=t[8],$(c)}const _=50;function G(s,e){const t=p.c(16),{org:n}=S();let i;t[0]!==n.id||t[1]!==s||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(n.id,s,e?.volume??"",e?.prefix??""),t[0]=n.id,t[1]=s,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=s.length>0;let a;t[5]!==n.id?(a=(o,f)=>f?.queryKey[1]===n.id?o:void 0,t[5]=n.id,t[6]=a):a=t[6];let l;t[7]!==n.slug||t[8]!==s||t[9]!==e?(l=async()=>{const o=new URLSearchParams({q:s,limit:String(_)});return e&&(o.set("volume",e.volume),e.prefix&&o.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(n.slug)}/fs/search?${o}`)).json()).entries},t[7]=n.slug,t[8]=s,t[9]=e,t[10]=l):l=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==l?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:l},t[11]=i,t[12]=r,t[13]=a,t[14]=l,t[15]=c):c=t[15],$(c)}function Z(s){const e=p.c(8),{org:t}=S();let n;e[0]!==t.id?(n=y.orgFsSkills(t.id),e[0]=t.id,e[1]=n):n=e[1];const i=s?.enabled;let r;e[2]!==t.slug?(r=async()=>{const l=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await l.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==i||e[6]!==r?(a={queryKey:n,enabled:i,queryFn:r},e[4]=n,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(s){return{volume:s.volume,path:s.path}}async function E(s){const e=await h(`/api/${encodeURIComponent(s)}/fs/skills`),{skills:t}=await e.json();return t}function v(){const s=p.c(7),{org:e}=S();let t;s[0]!==e.id?(t=y.slashSkills(e.id),s[0]=e.id,s[1]=t):t=s[1];let n;s[2]!==e.slug?(n=()=>E(e.slug),s[2]=e.slug,s[3]=n):n=s[3];let i;return s[4]!==t||s[5]!==n?(i={queryKey:t,queryFn:n,staleTime:6e4},s[4]=t,s[5]=n,s[6]=i):i=s[6],$(i)}async function R(s,e,t){return(await h(F(s,e,"read",{path:t}))).text()}function ee(s,e){const t=p.c(8);let n;t[0]!==s?(n=y.fileText(s),t[0]=s,t[1]=n):n=t[1];const i=e?.enabled!==!1&&s!=="";let r;t[2]!==s?(r=async()=>{const l=await fetch(s,{credentials:"include"});return l.ok?await l.text():null},t[2]=s,t[3]=r):r=t[3];let a;return t[4]!==n||t[5]!==i||t[6]!==r?(a={queryKey:n,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=n,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const U=new Set(["md","mdx","markdown","txt","text"]),Q=25,M=64*1024,A=256*1024,D=4;function N(s){const e=s.lastIndexOf(".");return e===-1?!1:U.has(s.slice(e+1).toLowerCase())}async function te(s,e,t){const n=t?`${t}/`:"",i=u=>u.startsWith(n)?u.slice(n.length):u,r=[],a=[],l=[{path:t,depth:0}];for(;l.length>0;){const u=l.shift();if(!u)break;let g;try{g=(await(await h(F(s,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((I,q)=>I.path.localeCompare(q.path))){if(d.kind==="dir"){u.depth<D&&l.push({path:d.path,depth:u.depth+1});continue}N(d.path)&&d.size<=M&&r.length<Q?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>R(s,e,u).catch(()=>null))),o=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>A){a.push(i(u));return}f+=d.length,o.push({relPath:i(u),content:d})}),o.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:o,omittedPaths:a}}function se(){const s=p.c(7),{org:e}=S();let t;s[0]!==e.id?(t=y.orgFsPublicSets(e.id),s[0]=e.id,s[1]=t):t=s[1];let n;s[2]!==e.slug?(n=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,s[2]=e.slug,s[3]=n):n=s[3];let i;return s[4]!==t||s[5]!==n?(i={queryKey:t,staleTime:3e5,queryFn:n},s[4]=t,s[5]=n,s[6]=i):i=s[6],$(i)}function ne(s){const e=p.c(3),{org:t}=S();let n;return e[0]!==t.slug||e[1]!==s?(n=i=>F(t.slug,s,"read",{path:i}),e[0]=t.slug,e[1]=s,e[2]=n):n=e[2],n}function ie(){const s=p.c(2),{org:e}=S();let t;return s[0]!==e.slug?(t=(n,i)=>F(e.slug,n,"read",{path:i}),s[0]=e.slug,s[1]=t):t=s[1],t}function re(s){const e=p.c(3),{org:t}=S();let n;return e[0]!==t||e[1]!==s?(n={mutationFn:async i=>(await(await h(F(t.slug,s,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=s,e[2]=n):n=e[2],K(n)}function ae(s){const e=p.c(18),{org:t}=S(),n=T();let i;e[0]!==t||e[1]!==s?(i=async o=>(await(await h(F(t.slug,s,"public",{path:o.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:o.mode,password:o.password})})).json()).entry,e[0]=t,e[1]=s,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==n||e[5]!==s?(r=async o=>{const f=y.orgFsStat(t.id,s,o.path);await n.cancelQueries({queryKey:f});const u=n.getQueryData(f),g=o.mode!=="private";return n.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:o.mode}),{key:f,previous:u}},e[3]=t,e[4]=n,e[5]=s,e[6]=r):r=e[6];let a;e[7]!==n?(a=(o,f,u)=>{u&&n.setQueryData(u.key,u.previous)},e[7]=n,e[8]=a):a=e[8];let l;e[9]!==t||e[10]!==n||e[11]!==s?(l=(o,f,u)=>{n.invalidateQueries({queryKey:y.orgFsStat(t.id,s,u.path)}),n.invalidateQueries({queryKey:y.orgFsVolume(t.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=n,e[11]=s,e[12]=l):l=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==l?(c={mutationFn:i,onMutate:r,onError:a,onSettled:l},e[13]=i,e[14]=r,e[15]=a,e[16]=l,e[17]=c):c=e[17],K(c)}function le(s){const e=p.c(33),{org:t}=S(),n=T();let i;e[0]!==t||e[1]!==n||e[2]!==s?(i=()=>{n.invalidateQueries({queryKey:y.orgFsVolume(t.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=n,e[2]=s,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==s?(a=async w=>{const k=(await Promise.allSettled(w.files.map(O=>{const P=w.dir?`${w.dir}/${O.name}`:O.name;return h(F(t.slug,s,"file",{path:P}),{method:"PUT",headers:{"content-type":O.type||"application/octet-stream"},body:O})}))).find(X);if(k)throw k.reason},e[4]=t,e[5]=s,e[6]=a):a=e[6];let l;e[7]!==r||e[8]!==a?(l={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=l):l=e[9];const c=K(l);let o;e[10]!==t||e[11]!==s?(o=async w=>{await h(F(t.slug,s,"dir",{path:w}),{method:"POST"})},e[10]=t,e[11]=s,e[12]=o):o=e[12];let f;e[13]!==r||e[14]!==o?(f={mutationFn:o,onSuccess:r},e[13]=r,e[14]=o,e[15]=f):f=e[15];const u=K(f);let g;e[16]!==t||e[17]!==s?(g=async w=>{await h(F(t.slug,s,"file",{path:w}),{method:"DELETE"})},e[16]=t,e[17]=s,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=d):d=e[21];const I=K(d);let q;e[22]!==t||e[23]!==s?(q=async w=>{await h(F(t.slug,s,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(w)})},e[22]=t,e[23]=s,e[24]=q):q=e[24];let m;e[25]!==r||e[26]!==q?(m={mutationFn:q,onSuccess:r},e[25]=r,e[26]=q,e[27]=m):m=e[27];const b=K(m);let L;return e[28]!==u||e[29]!==b||e[30]!==I||e[31]!==c?(L={upload:c,mkdir:u,remove:I,move:b},e[28]=u,e[29]=b,e[30]=I,e[31]=c,e[32]=L):L=e[32],L}function X(s){return s.status==="rejected"}export{E as a,ne as b,ee as c,re as d,Y as e,te as f,ae as g,le as h,ie as i,V as j,Z as k,G as l,se as m,z as n,J as o,v as p,C as q,B as u};
1
+ import{c as p,a0 as S,K as y,m as $,o as T,e as K}from"./index-CC7J7MsT.js";function Y(s){return s.contentHash??`${s.size}-${s.updatedAt}`}function F(s,e,t,n){const i=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(s)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(s,e,t){const n=await fetch(s,e);if(n.ok||t?.allow404&&n.status===404)return n;let i="";try{i=(await n.json()).error??""}catch{}throw new Error(i||`HTTP ${n.status}`)}function z(s,e){const t=p.c(15),{org:n}=S();let i;t[0]!==n.id||t[1]!==e||t[2]!==s?(i=y.orgFsList(n.id,s,e),t[0]=n.id,t[1]=e,t[2]=s,t[3]=i):i=t[3];let r;t[4]!==n.id||t[5]!==s?(r=(c,o)=>o?.queryKey[1]===n.id&&o.queryKey[2]===s?c:void 0,t[4]=n.id,t[5]=s,t[6]=r):r=t[6];let a;t[7]!==n.slug||t[8]!==e||t[9]!==s?(a=async()=>(await(await h(F(n.slug,s,"list",{path:e}))).json()).entries.toSorted(x),t[7]=n.slug,t[8]=e,t[9]=s,t[10]=a):a=t[10];let l;return t[11]!==i||t[12]!==r||t[13]!==a?(l={queryKey:i,placeholderData:r,queryFn:a},t[11]=i,t[12]=r,t[13]=a,t[14]=l):l=t[14],$(l)}function x(s,e){return s.kind!==e.kind?s.kind==="dir"?-1:1:s.path.localeCompare(e.path)}async function C(s,e,t){const n=await h(F(s,e,"stat",{path:t}),void 0,{allow404:!0});return n.status===404?null:(await n.json()).entry}function B(s,e,t){const n=p.c(15),{org:i}=S();let r;n[0]!==i.id||n[1]!==e||n[2]!==s?(r=y.orgFsStat(i.id,s??"",e),n[0]=i.id,n[1]=e,n[2]=s,n[3]=r):r=n[3];const a=s!==null;let l;n[4]!==t?(l=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,n[4]=t,n[5]=l):l=n[5];let c;n[6]!==i.slug||n[7]!==e||n[8]!==s?(c=()=>C(i.slug,s??"",e),n[6]=i.slug,n[7]=e,n[8]=s,n[9]=c):c=n[9];let o;return n[10]!==r||n[11]!==a||n[12]!==l||n[13]!==c?(o={queryKey:r,enabled:a,refetchInterval:l,queryFn:c},n[10]=r,n[11]=a,n[12]=l,n[13]=c,n[14]=o):o=n[14],$(o)}function J(s){const e=p.c(9),{org:t}=S();let n;e[0]!==t.id||e[1]!==s?(n=y.orgFsUsage(t.id,s),e[0]=t.id,e[1]=s,e[2]=n):n=e[2];let i;e[3]!==t.slug||e[4]!==s?(i=async()=>await(await h(F(t.slug,s,"usage"))).json(),e[3]=t.slug,e[4]=s,e[5]=i):i=e[5];let r;return e[6]!==n||e[7]!==i?(r={queryKey:n,queryFn:i},e[6]=n,e[7]=i,e[8]=r):r=e[8],$(r)}function V(s,e){const t=p.c(9),n=s===void 0?60:s,{org:i}=S();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let l;t[2]!==n||t[3]!==i.slug?(l=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${n}`)).json()).entries,t[2]=n,t[3]=i.slug,t[4]=l):l=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==l?(c={queryKey:r,enabled:a,queryFn:l},t[5]=r,t[6]=a,t[7]=l,t[8]=c):c=t[8],$(c)}const _=50;function G(s,e){const t=p.c(16),{org:n}=S();let i;t[0]!==n.id||t[1]!==s||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(n.id,s,e?.volume??"",e?.prefix??""),t[0]=n.id,t[1]=s,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=s.length>0;let a;t[5]!==n.id?(a=(o,f)=>f?.queryKey[1]===n.id?o:void 0,t[5]=n.id,t[6]=a):a=t[6];let l;t[7]!==n.slug||t[8]!==s||t[9]!==e?(l=async()=>{const o=new URLSearchParams({q:s,limit:String(_)});return e&&(o.set("volume",e.volume),e.prefix&&o.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(n.slug)}/fs/search?${o}`)).json()).entries},t[7]=n.slug,t[8]=s,t[9]=e,t[10]=l):l=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==l?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:l},t[11]=i,t[12]=r,t[13]=a,t[14]=l,t[15]=c):c=t[15],$(c)}function Z(s){const e=p.c(8),{org:t}=S();let n;e[0]!==t.id?(n=y.orgFsSkills(t.id),e[0]=t.id,e[1]=n):n=e[1];const i=s?.enabled;let r;e[2]!==t.slug?(r=async()=>{const l=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await l.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==i||e[6]!==r?(a={queryKey:n,enabled:i,queryFn:r},e[4]=n,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(s){return{volume:s.volume,path:s.path}}async function E(s){const e=await h(`/api/${encodeURIComponent(s)}/fs/skills`),{skills:t}=await e.json();return t}function v(){const s=p.c(7),{org:e}=S();let t;s[0]!==e.id?(t=y.slashSkills(e.id),s[0]=e.id,s[1]=t):t=s[1];let n;s[2]!==e.slug?(n=()=>E(e.slug),s[2]=e.slug,s[3]=n):n=s[3];let i;return s[4]!==t||s[5]!==n?(i={queryKey:t,queryFn:n,staleTime:6e4},s[4]=t,s[5]=n,s[6]=i):i=s[6],$(i)}async function R(s,e,t){return(await h(F(s,e,"read",{path:t}))).text()}function ee(s,e){const t=p.c(8);let n;t[0]!==s?(n=y.fileText(s),t[0]=s,t[1]=n):n=t[1];const i=e?.enabled!==!1&&s!=="";let r;t[2]!==s?(r=async()=>{const l=await fetch(s,{credentials:"include"});return l.ok?await l.text():null},t[2]=s,t[3]=r):r=t[3];let a;return t[4]!==n||t[5]!==i||t[6]!==r?(a={queryKey:n,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=n,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const U=new Set(["md","mdx","markdown","txt","text"]),Q=25,M=64*1024,A=256*1024,D=4;function N(s){const e=s.lastIndexOf(".");return e===-1?!1:U.has(s.slice(e+1).toLowerCase())}async function te(s,e,t){const n=t?`${t}/`:"",i=u=>u.startsWith(n)?u.slice(n.length):u,r=[],a=[],l=[{path:t,depth:0}];for(;l.length>0;){const u=l.shift();if(!u)break;let g;try{g=(await(await h(F(s,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((I,q)=>I.path.localeCompare(q.path))){if(d.kind==="dir"){u.depth<D&&l.push({path:d.path,depth:u.depth+1});continue}N(d.path)&&d.size<=M&&r.length<Q?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>R(s,e,u).catch(()=>null))),o=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>A){a.push(i(u));return}f+=d.length,o.push({relPath:i(u),content:d})}),o.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:o,omittedPaths:a}}function se(){const s=p.c(7),{org:e}=S();let t;s[0]!==e.id?(t=y.orgFsPublicSets(e.id),s[0]=e.id,s[1]=t):t=s[1];let n;s[2]!==e.slug?(n=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,s[2]=e.slug,s[3]=n):n=s[3];let i;return s[4]!==t||s[5]!==n?(i={queryKey:t,staleTime:3e5,queryFn:n},s[4]=t,s[5]=n,s[6]=i):i=s[6],$(i)}function ne(s){const e=p.c(3),{org:t}=S();let n;return e[0]!==t.slug||e[1]!==s?(n=i=>F(t.slug,s,"read",{path:i}),e[0]=t.slug,e[1]=s,e[2]=n):n=e[2],n}function ie(){const s=p.c(2),{org:e}=S();let t;return s[0]!==e.slug?(t=(n,i)=>F(e.slug,n,"read",{path:i}),s[0]=e.slug,s[1]=t):t=s[1],t}function re(s){const e=p.c(3),{org:t}=S();let n;return e[0]!==t||e[1]!==s?(n={mutationFn:async i=>(await(await h(F(t.slug,s,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=s,e[2]=n):n=e[2],K(n)}function ae(s){const e=p.c(18),{org:t}=S(),n=T();let i;e[0]!==t||e[1]!==s?(i=async o=>(await(await h(F(t.slug,s,"public",{path:o.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:o.mode,password:o.password})})).json()).entry,e[0]=t,e[1]=s,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==n||e[5]!==s?(r=async o=>{const f=y.orgFsStat(t.id,s,o.path);await n.cancelQueries({queryKey:f});const u=n.getQueryData(f),g=o.mode!=="private";return n.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:o.mode}),{key:f,previous:u}},e[3]=t,e[4]=n,e[5]=s,e[6]=r):r=e[6];let a;e[7]!==n?(a=(o,f,u)=>{u&&n.setQueryData(u.key,u.previous)},e[7]=n,e[8]=a):a=e[8];let l;e[9]!==t||e[10]!==n||e[11]!==s?(l=(o,f,u)=>{n.invalidateQueries({queryKey:y.orgFsStat(t.id,s,u.path)}),n.invalidateQueries({queryKey:y.orgFsVolume(t.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=n,e[11]=s,e[12]=l):l=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==l?(c={mutationFn:i,onMutate:r,onError:a,onSettled:l},e[13]=i,e[14]=r,e[15]=a,e[16]=l,e[17]=c):c=e[17],K(c)}function le(s){const e=p.c(33),{org:t}=S(),n=T();let i;e[0]!==t||e[1]!==n||e[2]!==s?(i=()=>{n.invalidateQueries({queryKey:y.orgFsVolume(t.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=n,e[2]=s,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==s?(a=async w=>{const k=(await Promise.allSettled(w.files.map(O=>{const P=w.dir?`${w.dir}/${O.name}`:O.name;return h(F(t.slug,s,"file",{path:P}),{method:"PUT",headers:{"content-type":O.type||"application/octet-stream"},body:O})}))).find(X);if(k)throw k.reason},e[4]=t,e[5]=s,e[6]=a):a=e[6];let l;e[7]!==r||e[8]!==a?(l={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=l):l=e[9];const c=K(l);let o;e[10]!==t||e[11]!==s?(o=async w=>{await h(F(t.slug,s,"dir",{path:w}),{method:"POST"})},e[10]=t,e[11]=s,e[12]=o):o=e[12];let f;e[13]!==r||e[14]!==o?(f={mutationFn:o,onSuccess:r},e[13]=r,e[14]=o,e[15]=f):f=e[15];const u=K(f);let g;e[16]!==t||e[17]!==s?(g=async w=>{await h(F(t.slug,s,"file",{path:w}),{method:"DELETE"})},e[16]=t,e[17]=s,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=d):d=e[21];const I=K(d);let q;e[22]!==t||e[23]!==s?(q=async w=>{await h(F(t.slug,s,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(w)})},e[22]=t,e[23]=s,e[24]=q):q=e[24];let m;e[25]!==r||e[26]!==q?(m={mutationFn:q,onSuccess:r},e[25]=r,e[26]=q,e[27]=m):m=e[27];const b=K(m);let L;return e[28]!==u||e[29]!==b||e[30]!==I||e[31]!==c?(L={upload:c,mkdir:u,remove:I,move:b},e[28]=u,e[29]=b,e[30]=I,e[31]=c,e[32]=L):L=e[32],L}function X(s){return s.status==="rejected"}export{E as a,ne as b,ee as c,re as d,Y as e,te as f,ae as g,le as h,ie as i,V as j,Z as k,G as l,se as m,z as n,J as o,v as p,C as q,B as u};
@@ -1,4 +1,4 @@
1
- import{c as S,b as M,l as F,j as a,G as T,F as Y,B as H,H as V,I as Q,r as P,m as W,K as R,a0 as L,a6 as A,o as J,e as Z}from"./index-EcuFIS2a.js";import{c as X}from"./use-org-fs-Bf6n51Xm.js";import{i as ee}from"./DotsVertical-CE2o6L6N.js";import{n as re}from"./Download01-DNhEQzg0.js";import{i as le,a as ie}from"./Share07-CZ7JzYs9.js";import{i as oe}from"./Globe01-g_y8gAs1.js";import{i as ae}from"./Key01-CO_i2QPb.js";import{a as ce}from"./Palette-DT856bn6.js";import{s as te}from"./Trash01-DtE0n00a.js";import{i as fe}from"./Zap-DZAIluO6.js";import{F as O,d as G}from"./file-type-icon-lZW2ows7.js";import{F as de}from"./folder-icon-DVG7PK8X.js";import{p as ue}from"./skill-md-ChfVs4uF.js";function me(t,e,s){return e?"color":s?"font":/^--brand-(text|fw|leading|tracking)/i.test(t)?"type":/^--brand-space/i.test(t)?"space":/^--brand-radius/i.test(t)?"radius":/^--brand-shadow/i.test(t)?"shadow":/^--brand-(duration|delay|ease)/i.test(t)?"motion":"other"}const pe=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,xe=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,he=["svg","png","jpg","jpeg","webp","avif","gif"];function ge(t){return t.split(".").pop()?.toLowerCase()??""}function be(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(t){const e=t.trim();return xe.test(e)||pe.test(e)}function it(t){const e=t.trim(),s=e.match(/^#([0-9a-f]{3})$/i);return s?.[1]?`#${[...s[1]].map(i=>i+i).join("")}`:e}function je(t){const e=[],s=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let n;for(;(n=i.exec(t))!==null;){const r=n[1],l=n[2].trim();s.has(r)||e.push(r),s.set(r,l)}return e.map(r=>{const l=s.get(r),c=ye(l),o=/^--brand-font/i.test(r);return{name:r,value:l,isColor:c,isFont:o,kind:me(r,c,o)}})}const K=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function we(t){return t.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??t}function ot(t){const e=[],s=new Map;for(const n of t){if(n.kind!=="color")continue;const r=we(n.name);s.has(r)||(e.push(r),s.set(r,[])),s.get(r).push(n)}return e.map(n=>{const r=s.get(n);return{family:n,tokens:r,isRamp:r.filter(l=>/-\d+$/.test(l.name)).length>=5}}).sort((n,r)=>{const l=K.indexOf(n.family),c=K.indexOf(r.family);return l===-1&&c===-1?0:l===-1?1:c===-1?-1:l-c})}function at(t,e,s){const i=new RegExp(`(${be(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(t))return t.replace(i,(l,c,o)=>`${c}${s}${o}`);const n=t.search(/:root\s*\{/);if(n!==-1){const l=t.indexOf("{",n)+1;return`${t.slice(0,l)}
1
+ import{c as S,b as M,l as F,j as a,G as T,F as Y,B as H,H as V,I as Q,r as P,m as W,K as R,a0 as L,a6 as A,o as J,e as Z}from"./index-CC7J7MsT.js";import{c as X}from"./use-org-fs-C4AEj3YR.js";import{i as ee}from"./DotsVertical-DMzYFBsd.js";import{n as re}from"./Download01-B93GUT2-.js";import{i as le,a as ie}from"./Share07-Bw4Wicv2.js";import{i as oe}from"./Globe01-DjdW3vEO.js";import{i as ae}from"./Key01-O_Ykzy8v.js";import{a as ce}from"./Palette-HRmzWYeK.js";import{s as te}from"./Trash01-CpN6r-a0.js";import{i as fe}from"./Zap-D3d1wpzw.js";import{F as O,d as G}from"./file-type-icon-Co9lETmZ.js";import{F as de}from"./folder-icon-CPH1Bszw.js";import{p as ue}from"./skill-md-ChfVs4uF.js";function me(t,e,s){return e?"color":s?"font":/^--brand-(text|fw|leading|tracking)/i.test(t)?"type":/^--brand-space/i.test(t)?"space":/^--brand-radius/i.test(t)?"radius":/^--brand-shadow/i.test(t)?"shadow":/^--brand-(duration|delay|ease)/i.test(t)?"motion":"other"}const pe=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,xe=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,he=["svg","png","jpg","jpeg","webp","avif","gif"];function ge(t){return t.split(".").pop()?.toLowerCase()??""}function be(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(t){const e=t.trim();return xe.test(e)||pe.test(e)}function it(t){const e=t.trim(),s=e.match(/^#([0-9a-f]{3})$/i);return s?.[1]?`#${[...s[1]].map(i=>i+i).join("")}`:e}function je(t){const e=[],s=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let n;for(;(n=i.exec(t))!==null;){const r=n[1],l=n[2].trim();s.has(r)||e.push(r),s.set(r,l)}return e.map(r=>{const l=s.get(r),c=ye(l),o=/^--brand-font/i.test(r);return{name:r,value:l,isColor:c,isFont:o,kind:me(r,c,o)}})}const K=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function we(t){return t.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??t}function ot(t){const e=[],s=new Map;for(const n of t){if(n.kind!=="color")continue;const r=we(n.name);s.has(r)||(e.push(r),s.set(r,[])),s.get(r).push(n)}return e.map(n=>{const r=s.get(n);return{family:n,tokens:r,isRamp:r.filter(l=>/-\d+$/.test(l.name)).length>=5}}).sort((n,r)=>{const l=K.indexOf(n.family),c=K.indexOf(r.family);return l===-1&&c===-1?0:l===-1?1:c===-1?-1:l-c})}function at(t,e,s){const i=new RegExp(`(${be(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(t))return t.replace(i,(l,c,o)=>`${c}${s}${o}`);const n=t.search(/:root\s*\{/);if(n!==-1){const l=t.indexOf("{",n)+1;return`${t.slice(0,l)}
2
2
  ${e}: ${s};${t.slice(l)}`}const r=t.length>0&&!t.endsWith(`
3
3
  `)?`
4
4
  `:"";return`${t}${r}:root {
@@ -1 +1 @@
1
- import{c as u,m as S,o as r,e as y,K as c}from"./index-EcuFIS2a.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-CC7J7MsT.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-8fDIgHEZ.js";import{a0 as b,m as P,K as y}from"./index-EcuFIS2a.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-6spdYft8.js";import{a0 as b,m as P,K as y}from"./index-CC7J7MsT.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};