decocms 4.293.2 → 4.294.1

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 (232) hide show
  1. package/dist/client/assets/{AlertCircle-CD9LrpfS.js → AlertCircle-BX7MJ072.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BnvptEOi.js → AreaChart-B2c5VlMF.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-B3G2yicp.js → ArrowLeft-D_iAJfNc.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CZYz7bTi.js → ArrowUp-DE3_BiFl.js} +1 -1
  5. package/dist/client/assets/{Check-Dlrnq12d.js → Check-CMgbiLaX.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-D_x_TnWr.js → CheckCircle-DSareV9G.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BI5tjO-E.js → ChevronDown-Dw8obt8m.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-D1vELAp3.js → ChevronRight-CmErvA0j.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-BoKT9OF1.js → ChevronSelectorVertical-DvwcNCCU.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DXmAB3XT.js → ChevronUp-zRZTeZ7W.js} +1 -1
  11. package/dist/client/assets/{Copy01-DjgS2HXy.js → Copy01-TuMirHlz.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-C_BlW4SQ.js → CreditCard01-DE9AkrGD.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-D26hKsV0.js → DotsVertical-BWlRnIv9.js} +1 -1
  14. package/dist/client/assets/{Download01-DFXE5FpC.js → Download01-BrELUVKh.js} +1 -1
  15. package/dist/client/assets/{Eye-BL9Cl1_z.js → Eye-C1diZla3.js} +1 -1
  16. package/dist/client/assets/{FilterLines-BAretQqt.js → FilterLines-CWtPXhPn.js} +1 -1
  17. package/dist/client/assets/{Globe01-EaicUoi2.js → Globe01-BLauj86P.js} +1 -1
  18. package/dist/client/assets/{Globe04-BynYihIs.js → Globe04-BZfohkfh.js} +1 -1
  19. package/dist/client/assets/{HardDrive-DI-BD_HJ.js → HardDrive-BooNC9Iz.js} +1 -1
  20. package/dist/client/assets/{Key01-BW1Rr_0E.js → Key01-BNf86BzY.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-DSikt04U.js → LinkExternal01-C5sEFVrU.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-18p0T9eT.js → LockUnlocked01-qFRWZtfh.js} +1 -1
  23. package/dist/client/assets/{LogOut01-BKJ67u66.js → LogOut01-945MQKA3.js} +1 -1
  24. package/dist/client/assets/{Monitor01-BZQ0hY6j.js → Monitor01-BYyknu9E.js} +1 -1
  25. package/dist/client/assets/{Palette-Bno2qVjY.js → Palette-CtmrE0Ya.js} +1 -1
  26. package/dist/client/assets/{Play-C-YG9yrD.js → Play-KEXVN9gu.js} +1 -1
  27. package/dist/client/assets/{Plus-DdaQ4Jl-.js → Plus-DVX_wDQ5.js} +1 -1
  28. package/dist/client/assets/{SearchLg-C--NWIKz.js → SearchLg--Jj0q90X.js} +1 -1
  29. package/dist/client/assets/{SearchMd-B6MT6Bio.js → SearchMd-BfGi9p6T.js} +1 -1
  30. package/dist/client/assets/{Settings02-Bgsm52IE.js → Settings02-NF-WIPx9.js} +1 -1
  31. package/dist/client/assets/{Share07-CWoqeiFa.js → Share07-CaDcjgW4.js} +1 -1
  32. package/dist/client/assets/{Shield01-HD6_sCSy.js → Shield01-BKKyhf4r.js} +1 -1
  33. package/dist/client/assets/{Stars01-D_TS2si3.js → Stars01--KT_Bx7a.js} +1 -1
  34. package/dist/client/assets/{Stars02-C5DCeEvT.js → Stars02-BX_P13x6.js} +1 -1
  35. package/dist/client/assets/{Sun-7xLgDnNq.js → Sun-DS3TtzGE.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-7sawt_65.js → SwitchHorizontal01-Cb_T5oPm.js} +1 -1
  37. package/dist/client/assets/{Tool01-CholylEI.js → Tool01-Ci1f_VX6.js} +1 -1
  38. package/dist/client/assets/{Tool02-CQHN0kwi.js → Tool02-BSzeWnI0.js} +1 -1
  39. package/dist/client/assets/{Trash01-WXazoj42.js → Trash01-BjqXjKjL.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-Cs8Uozm3.js → TrendUp01-BXDl_oA2.js} +1 -1
  41. package/dist/client/assets/{Upload01-B4nQDZ8y.js → Upload01-Dz2owj0l.js} +1 -1
  42. package/dist/client/assets/{User01-CliEfwvo.js → User01-DfNUsZjG.js} +1 -1
  43. package/dist/client/assets/{UserSquare-5p_taTUv.js → UserSquare-QpZbwdZV.js} +1 -1
  44. package/dist/client/assets/{Users01-Covi6RoT.js → Users01-CIQN8wG7.js} +1 -1
  45. package/dist/client/assets/{Users03-CvWTwj5Y.js → Users03-1JkDRbw6.js} +1 -1
  46. package/dist/client/assets/{XCircle-CfI3epA1.js → XCircle-BEPQ7ZR9.js} +1 -1
  47. package/dist/client/assets/{XClose-CF3G_jQw.js → XClose-CmC5bnde.js} +1 -1
  48. package/dist/client/assets/{YAxis-DtW1JYrI.js → YAxis-C68KAf7l.js} +1 -1
  49. package/dist/client/assets/{Zap-flZFj_ZW.js → Zap-BHFTnbC7.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-DfBJqbmB.js → ZapSquare-W_x0tYhG.js} +1 -1
  51. package/dist/client/assets/{access-gate-BfOH2ehr.js → access-gate-CJ1xrwBs.js} +1 -1
  52. package/dist/client/assets/{agent-icon-CoWSmZeI.js → agent-icon-DwW--uUY.js} +1 -1
  53. package/dist/client/assets/{agents-list-BC_9BnH9.js → agents-list-SZYdZyx8.js} +1 -1
  54. package/dist/client/assets/{ai-providers-DO3ALaUO.js → ai-providers--wPbboM3.js} +1 -1
  55. package/dist/client/assets/{alert-B9M-khBf.js → alert-IgKAs3o8.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-xk0i6uOf.js → alert-dialog-3i0jJzJ0.js} +1 -1
  57. package/dist/client/assets/{api-keys-DvdSzOBt.js → api-keys-CUKmb7Np.js} +1 -1
  58. package/dist/client/assets/{app-editor-BFyPvDC0.js → app-editor-C5RKxi_A.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-DN3O-XcI.js → auth-catchall-BCcqdIY-.js} +1 -1
  60. package/dist/client/assets/{auth-entry-BA5zF7Od.js → auth-entry-FNjcKTKE.js} +1 -1
  61. package/dist/client/assets/{auth-Uy0w4hkL.js → auth-jQituvKm.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-CyzyX7hp.js → auth-split-layout-DQfYa1Wy.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-DBPTryx5.js → authenticate-and-persist-oauth-DsOW9H5Z.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-C2XzpKdh.js → automation-list-row-CCZYSh-F.js} +1 -1
  65. package/dist/client/assets/{automation-runs--DeWLHLZ.js → automation-runs-BioqyUmT.js} +2 -2
  66. package/dist/client/assets/{automations-C3DtmndL.js → automations-Uhdu42lm.js} +1 -1
  67. package/dist/client/assets/{avatar-_-D5iDIN.js → avatar-DQGduv0U.js} +1 -1
  68. package/dist/client/assets/{badge-CDQQQbvb.js → badge-CAWKSDnJ.js} +1 -1
  69. package/dist/client/assets/{block-document-Culeyoxj.js → block-document-CvQIz5yK.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-NtLjhPhW.js → breadcrumb-Cl6tbNSR.js} +1 -1
  71. package/dist/client/assets/{buckets-CvEUyiW2.js → buckets-BwD1bAZL.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-CfDcaS2D.js → bulk-category-panel-Cqpjajjn.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-3Jz96HF2.js → capability-load-error-BTRZ_JFs.js} +1 -1
  74. package/dist/client/assets/{cards-CUbQM3D3.js → cards-Do4DMym-.js} +1 -1
  75. package/dist/client/assets/{category-editor-CC7R-OTf.js → category-editor-DJa80_RF.js} +1 -1
  76. package/dist/client/assets/{chart-EPThyboW.js → chart-CjmlfSOz.js} +1 -1
  77. package/dist/client/assets/{chat-context-DjotdD4C.js → chat-context-B5Wg5Lf5.js} +1 -1
  78. package/dist/client/assets/{checkbox-DVfc9X49.js → checkbox-BBaFR9e7.js} +1 -1
  79. package/dist/client/assets/{choose-editor-CILwoet7.js → choose-editor-D21isyag.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-qAmg-U4B.js → cli-auth-success-xs-iEptG.js} +1 -1
  81. package/dist/client/assets/{collection-detail-C9F7AoJJ.js → collection-detail-Bgc17VFa.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-ytZhkFQJ.js → collection-display-button-DXBEx_vc.js} +1 -1
  83. package/dist/client/assets/{collection-search-vQNkhmmK.js → collection-search-B-xYnw3X.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-BR0_6TaP.js → collection-table-wrapper-Ci0d113k.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-Co_XeSHS.js → collection-tabs-B9i9CP-Z.js} +1 -1
  86. package/dist/client/assets/{command-B8F0uHex.js → command-ClyqeQko.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-BGQ2Hlgl.js → commerce-onboarding-DoSINo3a.js} +1 -1
  88. package/dist/client/assets/config-C05cUmSb.js +1 -0
  89. package/dist/client/assets/{connect-BZRm8ITd.js → connect-DzIdwweE.js} +1 -1
  90. package/dist/client/assets/{connection-DB_75MPZ.js → connection-C10IpVW9.js} +1 -1
  91. package/dist/client/assets/{connection-card-M6hmLGZq.js → connection-card-BpdBS_Al.js} +1 -1
  92. package/dist/client/assets/{connection-detail-CEhh3XeN.js → connection-detail-Dyv8cSja.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-daJ-4E-F.js → connection-form-helpers-iTHnU6X5.js} +1 -1
  94. package/dist/client/assets/{connections-BfnIniTG.js → connections-DAyzQnUs.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-VQZMAg5B.js → decopilot-sse-pool-S5tux0kK.js} +1 -1
  96. package/dist/client/assets/{dialog-BQeVUlNg.js → dialog-BST7kHjs.js} +1 -1
  97. package/dist/client/assets/{domain-settings-DntxO5hc.js → domain-settings-BqlL-o8W.js} +1 -1
  98. package/dist/client/assets/{drawer-Cdb1rsne.js → drawer-Mrrueqfd.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-C0_Vnzhe.js → dropdown-menu-B1VRfncr.js} +1 -1
  100. package/dist/client/assets/{empty-state-BJDHE2BS.js → empty-state-N7iUhCDH.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-DLWzenU1.js → extract-connection-data-XOJUSxR8.js} +1 -1
  102. package/dist/client/assets/{file-explorer-qG6ew9Fb.js → file-explorer-C6yyRfaX.js} +1 -1
  103. package/dist/client/assets/{file-type-icon-ChXTeBJ-.js → file-type-icon-N4BWvB1b.js} +1 -1
  104. package/dist/client/assets/{form-DcxePO8A.js → form-kVV6q-fx.js} +1 -1
  105. package/dist/client/assets/{general-024875TR.js → general-Bb8jznvo.js} +1 -1
  106. package/dist/client/assets/{github-repo-picker-m3Jw1ZFD.js → github-repo-picker-Do0PQSNG.js} +1 -1
  107. package/dist/client/assets/{hooks-CJ16hHiH.js → hooks-B79ZY8IT.js} +1 -1
  108. package/dist/client/assets/{index-DFp8sE3x.js → index-B8RO7-AA.js} +1 -1
  109. package/dist/client/assets/{index-RdcCdojW.js → index-BoZ9u4m1.js} +4 -4
  110. package/dist/client/assets/{index-DO_6i8ae.js → index-C5hmsqzf.js} +1 -1
  111. package/dist/client/assets/{index-Wqx51PrS.js → index-CPq3T21x.js} +1 -1
  112. package/dist/client/assets/{index-C7sanlxA.js → index-CsQMHT9g.js} +1 -1
  113. package/dist/client/assets/{index-DQIXNoxg.js → index-D6UX70oA.js} +1 -1
  114. package/dist/client/assets/{index-BkWfJqUq.js → index-DEww-2EZ.js} +1 -1
  115. package/dist/client/assets/{index-CLdaL--4.js → index-DwmIdtlP.js} +1 -1
  116. package/dist/client/assets/{index-BVwOH7wh.js → index-UTTF9eic.js} +58 -58
  117. package/dist/client/assets/{index-redirect-BWxMOkr5.js → index-redirect-BBfeBIf1.js} +1 -1
  118. package/dist/client/assets/{infra-billing-DtobgH9i.js → infra-billing-B5uvzyJf.js} +1 -1
  119. package/dist/client/assets/{input-Du_Y4DA2.js → input-vNnjluS1.js} +1 -1
  120. package/dist/client/assets/{integration-icon-BxAzHrAu.js → integration-icon-DmJLuQ2R.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-CaxcKJI4.js → invite-member-dialog-c_6h1c9d.js} +1 -1
  122. package/dist/client/assets/{label-DliIyCSr.js → label-2hy1g0FP.js} +1 -1
  123. package/dist/client/assets/{layout-DlaNSsr1.js → layout-CTomL7O6.js} +1 -1
  124. package/dist/client/assets/{login-Ckbo-Vz5.js → login-DaQOw-0F.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-WauR-bs4.js → mcp-oauth-1M77jlWl.js} +1 -1
  126. package/dist/client/assets/{members-a949EBr4.js → members-ByBSVnV2.js} +1 -1
  127. package/dist/client/assets/{monaco-editor-IJ-39JCS.js → monaco-editor-Cfd7zTaZ.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-DaD2Jrr6.js → monitoring-stats-row-CS0MLT1M.js} +1 -1
  129. package/dist/client/assets/{multi-select-D5UXeLol.js → multi-select-Bc1Ex9je.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-ai-provider-CZNeWtz4.js → oauth-callback-ai-provider-g-Qo2pcQ.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-DxBWyg42.js → oauth-callback-rGk9Wox5.js} +1 -1
  132. package/dist/client/assets/{onboarding-DRVSKjPk.js → onboarding-DXUs-Zwj.js} +1 -1
  133. package/dist/client/assets/{org-layout-ClcynPuV.js → org-layout-w9rjradC.js} +1 -1
  134. package/dist/client/assets/{organization-choice-I-YI4Hfp.js → organization-choice-BhpYK3pU.js} +1 -1
  135. package/dist/client/assets/{orgs-DInZUyCT.js → orgs-B-lhj-vp.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-D3IStzwj.js → page-seo-form-CAkmJPih.js} +1 -1
  137. package/dist/client/assets/{popover-DT1H987m.js → popover-DrLCC3p5.js} +1 -1
  138. package/dist/client/assets/{post-calendar-JST7iWOD.js → post-calendar-C_H7bClE.js} +1 -1
  139. package/dist/client/assets/{post-editor-ByBw44q8.js → post-editor-BRsttkiY.js} +1 -1
  140. package/dist/client/assets/{primitives-Dnsli8EF.js → primitives-uAM2NwMD.js} +1 -1
  141. package/dist/client/assets/{profile-BbFIqW5a.js → profile-C00C8rDv.js} +1 -1
  142. package/dist/client/assets/{project-app-view-DbtCy7pb.js → project-app-view-CAw6sW8T.js} +1 -1
  143. package/dist/client/assets/{prompts-HkO-Vpz-.js → prompts-C1ft2jhs.js} +1 -1
  144. package/dist/client/assets/record-editor-Dmt20zx4.js +1 -0
  145. package/dist/client/assets/{redirect-editor-Ezo9udF_.js → redirect-editor-BTs-HhX2.js} +1 -1
  146. package/dist/client/assets/registry-BkvSu6Go.js +2 -0
  147. package/dist/client/assets/{registry-layout-BfN3Djd5.js → registry-layout-VFGZ8IpM.js} +1 -1
  148. package/dist/client/assets/{reports-BwEY90Df.js → reports-DhzLGuLY.js} +1 -1
  149. package/dist/client/assets/{require-capability-UslAqT6u.js → require-capability-CEAo1-fZ.js} +1 -1
  150. package/dist/client/assets/{required-auth-layout-BO2dyb3Z.js → required-auth-layout-DWW3HDyn.js} +1 -1
  151. package/dist/client/assets/{reset-password-CZD7IJ_X.js → reset-password-DreFZeIe.js} +1 -1
  152. package/dist/client/assets/{review-settings-rIJZr07q.js → review-settings-B-lAMYBo.js} +1 -1
  153. package/dist/client/assets/roles-BU6rptsx.js +1 -0
  154. package/dist/client/assets/{scroll-area-GoohikBy.js → scroll-area-B2Bvze19.js} +1 -1
  155. package/dist/client/assets/{search-input-q7fsDfhe.js → search-input-Ca_LFpsl.js} +1 -1
  156. package/dist/client/assets/{secrets-C9pq-vmx.js → secrets-CqakQjb1.js} +1 -1
  157. package/dist/client/assets/{sections-editor-B42Y1DLA.js → sections-editor-BBV08k5z.js} +1 -1
  158. package/dist/client/assets/{select-BCD3yHoj.js → select-DVeSr9Cv.js} +1 -1
  159. package/dist/client/assets/{select-model-CmeXughu.js → select-model-DSFTGsBN.js} +1 -1
  160. package/dist/client/assets/{self-tool-result-C_vauqtO.js → self-tool-result-Ck66n9EL.js} +1 -1
  161. package/dist/client/assets/{seo-editor-DhDGxqLq.js → seo-editor-BQV7KNe6.js} +1 -1
  162. package/dist/client/assets/{settings-layout-D7SbWIHX.js → settings-layout-2dsjZSYZ.js} +1 -1
  163. package/dist/client/assets/{shell-controls-uInUYrKF.js → shell-controls-BLPQ7kl6.js} +1 -1
  164. package/dist/client/assets/{shell-layout-Bs8Lt777.js → shell-layout-Bgj0rQDA.js} +1 -1
  165. package/dist/client/assets/{spinner-B6eC17SF.js → spinner-znMssV1b.js} +1 -1
  166. package/dist/client/assets/{sso-Bk4PrZ0u.js → sso-BksXn5ig.js} +1 -1
  167. package/dist/client/assets/{store-CPkZj-0x.js → store-q2_blJYB.js} +1 -1
  168. package/dist/client/assets/store-registry-DqrYH31S.js +2 -0
  169. package/dist/client/assets/{super-agent-icon-JVWXoXUu.js → super-agent-icon-D_RymLMx.js} +1 -1
  170. package/dist/client/assets/{switch-C-FkHg7r.js → switch-CE07liUg.js} +1 -1
  171. package/dist/client/assets/{synced-repos-DFsmXJPP.js → synced-repos-C0VYnIgW.js} +1 -1
  172. package/dist/client/assets/{table-Do7ccGVi.js → table-C54lPCoC.js} +1 -1
  173. package/dist/client/assets/{tabs-poHQpH5O.js → tabs-DVsDlywr.js} +1 -1
  174. package/dist/client/assets/{task-board-CQBNS0e1.js → task-board-C_FiCg7o.js} +1 -1
  175. package/dist/client/assets/tasks-DdrLr8z8.js +1 -0
  176. package/dist/client/assets/{textarea-DkW_z2IU.js → textarea-e01dAh4Q.js} +1 -1
  177. package/dist/client/assets/{toggle-group-Dke2CTaB.js → toggle-group-DVOGESuU.js} +1 -1
  178. package/dist/client/assets/{toolbar-DrpKuEOS.js → toolbar-iG8binbI.js} +1 -1
  179. package/dist/client/assets/{track-_bb26qlp.js → track-Don0wR2Q.js} +1 -1
  180. package/dist/client/assets/{types-D55csc5w.js → types-BMYq-irZ.js} +1 -1
  181. package/dist/client/assets/{use-ai-providers-B-OYAKkb.js → use-ai-providers-Cu5w7RQA.js} +1 -1
  182. package/dist/client/assets/{use-api-keys-DgMbMjH3.js → use-api-keys-CkhCpVU8.js} +1 -1
  183. package/dist/client/assets/{use-automations-CHyRAX5J.js → use-automations-CZQfO2ET.js} +1 -1
  184. package/dist/client/assets/{use-autosave-Y8_JQVtM.js → use-autosave-BLPSaddA.js} +1 -1
  185. package/dist/client/assets/{use-connection-CDBAVShn.js → use-connection-CabbUm7J.js} +1 -1
  186. package/dist/client/assets/{use-copy-A2iDXIiC.js → use-copy-CPSkWD8d.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-RE3GTo0q.js → use-create-virtual-mcp-DYdOafWL.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-BRpxCMxF.js → use-debounced-autosave-D494opKg.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-zLcMcGu_.js → use-debounced-value-wOe54Kkz.js} +1 -1
  190. package/dist/client/assets/{use-decopilot-events-BWpzWgPA.js → use-decopilot-events-CoDj3hx4.js} +1 -1
  191. package/dist/client/assets/{use-delete-connection-EL_dI6O3.js → use-delete-connection-Bh7pa4Y9.js} +1 -1
  192. package/dist/client/assets/{use-deployment-admin-B39gtWeS.js → use-deployment-admin-BhDeB0GP.js} +1 -1
  193. package/dist/client/assets/{use-destination-route-R7oVWY5R.js → use-destination-route-CUizQ3Ky.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-Qm8xBC7Z.js → use-file-configs-BlsniSlU.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-GqEVBMeV.js → use-infinite-scroll-BAdheIAu.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-BVuIrKnA.js → use-join-requests-DJVwnQoI.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-B-LZ1Wex.js → use-mcp-auth-status-BJbL5Csu.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-Bl7OJFcH.js → use-mcp-client-Cl4PpqBq.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-_tcIXZL0.js → use-mcp-tools-CAgTZP66.js} +1 -1
  200. package/dist/client/assets/{use-members-_ByrBAvF.js → use-members-C1QvIqWQ.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-C1od-jNe.js → use-navigate-to-agent-D8r5y5p4.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-BamEWpk2.js → use-org-auth-client-CIuw_wjP.js} +1 -1
  203. package/dist/client/assets/{use-org-repo-syncs-CG_xOEkn.js → use-org-repo-syncs-DCazGb2T.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-CnP_xN_9.js → use-org-sso-DoM99z93.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-BFHuemUc.js → use-organization-roles-DZlpT-Bq.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-CdhZq3TO.js → use-organization-settings-DLT--rXL.js} +1 -1
  207. package/dist/client/assets/{use-panel-navigate-hX9xgEkF.js → use-panel-navigate-jSEiIqVH.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-Debcpo6W.js → use-registry-connections-D0BvPX4D.js} +1 -1
  209. package/dist/client/assets/{use-secrets-Du7VCMTf.js → use-secrets-5seihYfj.js} +1 -1
  210. package/dist/client/assets/{use-section-preview-base-BoL1Z0zp.js → use-section-preview-base-DHqwJRrd.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-DNfv1_kv.js → use-status-sounds-DWru2W3X.js} +1 -1
  212. package/dist/client/assets/{use-tags-BWfTkjku.js → use-tags-DiSYGuJm.js} +1 -1
  213. package/dist/client/assets/{use-view-mode-Bv98Xblu.js → use-view-mode-B1U71rKz.js} +1 -1
  214. package/dist/client/assets/{use-virtual-mcp-BV3GNVOc.js → use-virtual-mcp-Df2Znans.js} +1 -1
  215. package/dist/client/assets/useInfiniteQuery-DsOKY7NR.js +1 -0
  216. package/dist/client/assets/useSuspenseInfiniteQuery-Ci2I5tLg.js +1 -0
  217. package/dist/client/assets/{users-CHSght6P.js → users-DpiU7_gm.js} +1 -1
  218. package/dist/client/assets/{variant-calendar-DwGEVcFc.js → variant-calendar-BjMZYHfG.js} +1 -1
  219. package/dist/client/assets/{view-mode-toggle-YRrKQ7HV.js → view-mode-toggle-D5s-POwP.js} +1 -1
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +590 -583
  222. package/dist/server/migrate.js +115 -108
  223. package/dist/server/server.js +377 -377
  224. package/package.json +1 -1
  225. package/dist/client/assets/config-BSqz_GMQ.js +0 -1
  226. package/dist/client/assets/record-editor-CWOvxS63.js +0 -1
  227. package/dist/client/assets/registry-Dr4KVLHz.js +0 -2
  228. package/dist/client/assets/roles-CEDnNlmJ.js +0 -1
  229. package/dist/client/assets/store-registry-BckmJcRr.js +0 -2
  230. package/dist/client/assets/tasks-Du4jU6Vj.js +0 -1
  231. package/dist/client/assets/useInfiniteQuery-D19sUk6p.js +0 -1
  232. package/dist/client/assets/useSuspenseInfiniteQuery-DdW-dVOd.js +0 -1
@@ -1 +1 @@
1
- import{c as u,n as T,j as i,r as g,b as j,f as k,aH as p,L as N,bz as y,c5 as L}from"./index-RdcCdojW.js";function B(t){const e=u.c(14);let l,s,o,n,r;e[0]!==t?({active:l,className:s,ref:n,type:r,...o}=t,e[0]=t,e[1]=l,e[2]=s,e[3]=o,e[4]=n,e[5]=r):(l=e[1],s=e[2],o=e[3],n=e[4],r=e[5]);const c=r===void 0?"button":r,a=l?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let f;e[6]!==s||e[7]!==a?(f=T("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md transition-colors","max-md:[&_svg]:size-5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",a,s),e[6]=s,e[7]=a,e[8]=f):f=e[8];let b;return e[9]!==o||e[10]!==n||e[11]!==f||e[12]!==c?(b=i.jsx("button",{ref:n,type:c,className:f,...o}),e[9]=o,e[10]=n,e[11]=f,e[12]=c,e[13]=b):b=e[13],b}const S=g.createContext(null);function x(){const t=g.use(S);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function v(t){const e=u.c(8),{children:l}=t,[s,o]=g.useState(null),[n,r]=g.useState(null),[c,a]=g.useState(null),[f,b]=g.useState(null);let d;e[0]!==c||e[1]!==f||e[2]!==n||e[3]!==s?(d={togglesEl:s,setTogglesEl:o,tabsEl:n,setTabsEl:r,centerEl:c,setCenterEl:a,rightEl:f,setRightEl:b},e[0]=c,e[1]=f,e[2]=n,e[3]=s,e[4]=d):d=e[4];let h;return e[5]!==l||e[6]!==d?(h=i.jsx(S,{value:d,children:l}),e[5]=l,e[6]=d,e[7]=h):h=e[7],h}function m(t){const e=u.c(2),{children:l}=t;let s;return e[0]!==l?(s=i.jsx(v,{children:i.jsx("div",{className:"flex flex-col h-full min-h-0",children:l})}),e[0]=l,e[1]=s):s=e[1],s}function $(t){const e=u.c(10);let l,s,o;e[0]!==t?({children:l,className:s,...o}=t,e[0]=t,e[1]=l,e[2]=s,e[3]=o):(l=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=T("relative z-10 shrink-0 grid grid-cols-3 items-center pl-1 pr-2 h-12 bg-sidebar",s),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==l||e[7]!==o||e[8]!==n?(r=i.jsx("div",{className:n,...o,children:l}),e[6]=l,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function C(t){const e=u.c(2),{children:l}=t;let s;return e[0]!==l?(s=i.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:l}),e[0]=l,e[1]=s):s=e[1],s}function z(t){const e=u.c(2),{children:l}=t;let s;return e[0]!==l?(s=i.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:l}),e[0]=l,e[1]=s):s=e[1],s}function R(){const t=u.c(13),e=j(),s=y().logo??L,o=typeof s=="string"?s:s.light,n=typeof s=="string"?s:s.dark;let r;t[0]!==e?(r=e("agentShellLayout.toolbar.logo"),t[0]=e,t[1]=r):r=t[1];let c;t[2]!==o||t[3]!==r?(c=i.jsx("img",{src:o,alt:r,className:"size-6 object-contain dark:hidden"}),t[2]=o,t[3]=r,t[4]=c):c=t[4];let a;t[5]!==e?(a=e("agentShellLayout.toolbar.logo"),t[5]=e,t[6]=a):a=t[6];let f;t[7]!==n||t[8]!==a?(f=i.jsx("img",{src:n,alt:a,className:"size-6 object-contain hidden dark:block"}),t[7]=n,t[8]=a,t[9]=f):f=t[9];let b;return t[10]!==c||t[11]!==f?(b=i.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,f]}),t[10]=c,t[11]=f,t[12]=b):b=t[12],b}function E(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(g.Suspense,{fallback:i.jsx("span",{className:"shrink-0 size-6 mx-2"}),children:i.jsx(R,{})}),t[0]=e):e=t[0],e}function _(){const t=u.c(12),e=j();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org"},t[0]=l):l=t[0];const{org:s}=k(l);let o;t[1]!==s?(o={org:s},t[1]=s,t[2]=o):o=t[2];let n;t[3]!==e?(n=e("agentShellLayout.toolbar.backToHome"),t[3]=e,t[4]=n):n=t[4];let r;t[5]!==e?(r=e("agentShellLayout.toolbar.backToHome"),t[5]=e,t[6]=r):r=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(E,{}),t[7]=c):c=t[7];let a;return t[8]!==o||t[9]!==n||t[10]!==r?(a=i.jsx(N,{to:"/$org",params:o,"aria-label":n,title:r,className:"flex items-center shrink-0 cursor-pointer pl-1",children:c}),t[8]=o,t[9]=n,t[10]=r,t[11]=a):a=t[11],a}function P(){const t=u.c(2),{setCenterEl:e}=x();let l;return t[0]!==e?(l=i.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=l):l=t[1],l}function w(t){const e=u.c(3),{children:l}=t,{centerEl:s}=x();if(!s)return null;let o;return e[0]!==s||e[1]!==l?(o=p.createPortal(l,s),e[0]=s,e[1]=l,e[2]=o):o=e[2],o}function H(t){const e=u.c(5),{className:l}=t,{setTabsEl:s}=x();let o;e[0]!==l?(o=T("shrink-0 flex items-center",l),e[0]=l,e[1]=o):o=e[1];let n;return e[2]!==s||e[3]!==o?(n=i.jsx("div",{ref:s,className:o}),e[2]=s,e[3]=o,e[4]=n):n=e[4],n}function I(t){const e=u.c(3),{children:l}=t,{tabsEl:s}=x();if(!s)return null;let o;return e[0]!==l||e[1]!==s?(o=p.createPortal(l,s),e[0]=l,e[1]=s,e[2]=o):o=e[2],o}function D(t){const e=u.c(5),{className:l}=t,{setTogglesEl:s}=x();let o;e[0]!==l?(o=T("contents",l),e[0]=l,e[1]=o):o=e[1];let n;return e[2]!==s||e[3]!==o?(n=i.jsx("div",{ref:s,className:o}),e[2]=s,e[3]=o,e[4]=n):n=e[4],n}function O(){const t=u.c(2),{setRightEl:e}=x();let l;return t[0]!==e?(l=i.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=l):l=t[1],l}m.Provider=v;m.Header=$;m.LeftColumn=C;m.RightColumn=z;m.Logo=E;m.LogoLink=_;m.CenterSlot=P;m.Center=w;m.TabsSlot=H;m.Tabs=I;m.TogglesSlot=D;m.RightSlot=O;export{B as T,m as a};
1
+ import{c as u,n as T,j as i,r as g,b as j,f as k,aH as p,L as N,bz as y,c5 as L}from"./index-BoZ9u4m1.js";function B(t){const e=u.c(14);let l,s,o,n,r;e[0]!==t?({active:l,className:s,ref:n,type:r,...o}=t,e[0]=t,e[1]=l,e[2]=s,e[3]=o,e[4]=n,e[5]=r):(l=e[1],s=e[2],o=e[3],n=e[4],r=e[5]);const c=r===void 0?"button":r,a=l?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let f;e[6]!==s||e[7]!==a?(f=T("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md transition-colors","max-md:[&_svg]:size-5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",a,s),e[6]=s,e[7]=a,e[8]=f):f=e[8];let b;return e[9]!==o||e[10]!==n||e[11]!==f||e[12]!==c?(b=i.jsx("button",{ref:n,type:c,className:f,...o}),e[9]=o,e[10]=n,e[11]=f,e[12]=c,e[13]=b):b=e[13],b}const S=g.createContext(null);function x(){const t=g.use(S);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function v(t){const e=u.c(8),{children:l}=t,[s,o]=g.useState(null),[n,r]=g.useState(null),[c,a]=g.useState(null),[f,b]=g.useState(null);let d;e[0]!==c||e[1]!==f||e[2]!==n||e[3]!==s?(d={togglesEl:s,setTogglesEl:o,tabsEl:n,setTabsEl:r,centerEl:c,setCenterEl:a,rightEl:f,setRightEl:b},e[0]=c,e[1]=f,e[2]=n,e[3]=s,e[4]=d):d=e[4];let h;return e[5]!==l||e[6]!==d?(h=i.jsx(S,{value:d,children:l}),e[5]=l,e[6]=d,e[7]=h):h=e[7],h}function m(t){const e=u.c(2),{children:l}=t;let s;return e[0]!==l?(s=i.jsx(v,{children:i.jsx("div",{className:"flex flex-col h-full min-h-0",children:l})}),e[0]=l,e[1]=s):s=e[1],s}function $(t){const e=u.c(10);let l,s,o;e[0]!==t?({children:l,className:s,...o}=t,e[0]=t,e[1]=l,e[2]=s,e[3]=o):(l=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=T("relative z-10 shrink-0 grid grid-cols-3 items-center pl-1 pr-2 h-12 bg-sidebar",s),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==l||e[7]!==o||e[8]!==n?(r=i.jsx("div",{className:n,...o,children:l}),e[6]=l,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function C(t){const e=u.c(2),{children:l}=t;let s;return e[0]!==l?(s=i.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:l}),e[0]=l,e[1]=s):s=e[1],s}function z(t){const e=u.c(2),{children:l}=t;let s;return e[0]!==l?(s=i.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:l}),e[0]=l,e[1]=s):s=e[1],s}function R(){const t=u.c(13),e=j(),s=y().logo??L,o=typeof s=="string"?s:s.light,n=typeof s=="string"?s:s.dark;let r;t[0]!==e?(r=e("agentShellLayout.toolbar.logo"),t[0]=e,t[1]=r):r=t[1];let c;t[2]!==o||t[3]!==r?(c=i.jsx("img",{src:o,alt:r,className:"size-6 object-contain dark:hidden"}),t[2]=o,t[3]=r,t[4]=c):c=t[4];let a;t[5]!==e?(a=e("agentShellLayout.toolbar.logo"),t[5]=e,t[6]=a):a=t[6];let f;t[7]!==n||t[8]!==a?(f=i.jsx("img",{src:n,alt:a,className:"size-6 object-contain hidden dark:block"}),t[7]=n,t[8]=a,t[9]=f):f=t[9];let b;return t[10]!==c||t[11]!==f?(b=i.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,f]}),t[10]=c,t[11]=f,t[12]=b):b=t[12],b}function E(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(g.Suspense,{fallback:i.jsx("span",{className:"shrink-0 size-6 mx-2"}),children:i.jsx(R,{})}),t[0]=e):e=t[0],e}function _(){const t=u.c(12),e=j();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org"},t[0]=l):l=t[0];const{org:s}=k(l);let o;t[1]!==s?(o={org:s},t[1]=s,t[2]=o):o=t[2];let n;t[3]!==e?(n=e("agentShellLayout.toolbar.backToHome"),t[3]=e,t[4]=n):n=t[4];let r;t[5]!==e?(r=e("agentShellLayout.toolbar.backToHome"),t[5]=e,t[6]=r):r=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(E,{}),t[7]=c):c=t[7];let a;return t[8]!==o||t[9]!==n||t[10]!==r?(a=i.jsx(N,{to:"/$org",params:o,"aria-label":n,title:r,className:"flex items-center shrink-0 cursor-pointer pl-1",children:c}),t[8]=o,t[9]=n,t[10]=r,t[11]=a):a=t[11],a}function P(){const t=u.c(2),{setCenterEl:e}=x();let l;return t[0]!==e?(l=i.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=l):l=t[1],l}function w(t){const e=u.c(3),{children:l}=t,{centerEl:s}=x();if(!s)return null;let o;return e[0]!==s||e[1]!==l?(o=p.createPortal(l,s),e[0]=s,e[1]=l,e[2]=o):o=e[2],o}function H(t){const e=u.c(5),{className:l}=t,{setTabsEl:s}=x();let o;e[0]!==l?(o=T("shrink-0 flex items-center",l),e[0]=l,e[1]=o):o=e[1];let n;return e[2]!==s||e[3]!==o?(n=i.jsx("div",{ref:s,className:o}),e[2]=s,e[3]=o,e[4]=n):n=e[4],n}function I(t){const e=u.c(3),{children:l}=t,{tabsEl:s}=x();if(!s)return null;let o;return e[0]!==l||e[1]!==s?(o=p.createPortal(l,s),e[0]=l,e[1]=s,e[2]=o):o=e[2],o}function D(t){const e=u.c(5),{className:l}=t,{setTogglesEl:s}=x();let o;e[0]!==l?(o=T("contents",l),e[0]=l,e[1]=o):o=e[1];let n;return e[2]!==s||e[3]!==o?(n=i.jsx("div",{ref:s,className:o}),e[2]=s,e[3]=o,e[4]=n):n=e[4],n}function O(){const t=u.c(2),{setRightEl:e}=x();let l;return t[0]!==e?(l=i.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=l):l=t[1],l}m.Provider=v;m.Header=$;m.LeftColumn=C;m.RightColumn=z;m.Logo=E;m.LogoLink=_;m.CenterSlot=P;m.Center=w;m.TabsSlot=H;m.Tabs=I;m.TogglesSlot=D;m.RightSlot=O;export{B as T,m as a};
@@ -1 +1 @@
1
- import{v as _,T as l}from"./index-RdcCdojW.js";let s=!1;const p="report:auth-attempt:",f=3600*1e3;function h(e){const t=new URLSearchParams(e),n=t.get("share_id")||void 0,o=t.get("email_run_id")||void 0,r=t.get("utm_source")||void 0,u=t.get("utm_medium")||void 0,a=t.get("utm_campaign")||void 0;return{entrypoint:n||r==="share"?"share":o||t.has("d")||r==="email"?"email":r?"campaign":"direct",...n?{share_id:n}:{},...o?{email_run_id:o}:{},...r?{utm_source:r}:{},...u?{utm_medium:u}:{},...a?{utm_campaign:a}:{}}}function c(){return h(typeof window>"u"?"":window.location.search)}function i(e){return`${p}${e}`}function g(){try{return globalThis.crypto.randomUUID()}catch{return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}}function d(e){try{const t=window.sessionStorage.getItem(i(e));if(!t)return null;const n=JSON.parse(t);return n.domain!==e||typeof n.attempt_id!="string"||typeof n.gate_shown_at!="number"||Date.now()-n.gate_shown_at>f?(window.sessionStorage.removeItem(i(e)),null):n}catch{return null}}function m(e){try{window.sessionStorage.setItem(i(e.domain),JSON.stringify(e))}catch{}}function w(e){const t=d(e);if(t)return t;const n={attempt_id:g(),domain:e,gate_shown_at:Date.now(),...c()};return m(n),n}function y(e,t){const n={...w(e),...t};return m(n),n}function T(e){return{auth_attempt_id:e.attempt_id,entrypoint:e.entrypoint,...e.share_id?{share_id:e.share_id}:{},...e.email_run_id?{email_run_id:e.email_run_id}:{},...e.utm_source?{utm_source:e.utm_source}:{},...e.utm_medium?{utm_medium:e.utm_medium}:{},...e.utm_campaign?{utm_campaign:e.utm_campaign}:{}}}function R(e){const t=d(e);if(!t)return null;try{window.sessionStorage.removeItem(i(e))}catch{}return t}function S(e){const t=e.toLowerCase();return t==="invalid_email"?"invalid_email":t.includes("429")||t.includes("rate limit")?"rate_limited":t.includes("otp")||t.includes("verification code")||t.includes("invalid code")||t.includes("expired code")||t.includes("código")||t.includes("codigo")?"invalid_or_expired_code":t.includes("401")||t.includes("unauthorized")?"invalid_credentials":t.includes("409")||t.includes("already exists")?"account_exists":t.includes("network")||t.includes("fetch")?"network":t.includes("cancel")||t.includes("closed")?"cancelled":"unknown"}function I(e){s=e}function M(e,t,n){if(_())try{l.capture(e,{...c(),...t,...s?{report_preview:"reviewer"}:{}},n)}catch{}}export{S as a,w as b,M as c,T as d,R as e,h as r,I as s,y as u};
1
+ import{v as _,T as l}from"./index-BoZ9u4m1.js";let s=!1;const p="report:auth-attempt:",f=3600*1e3;function h(e){const t=new URLSearchParams(e),n=t.get("share_id")||void 0,o=t.get("email_run_id")||void 0,r=t.get("utm_source")||void 0,u=t.get("utm_medium")||void 0,a=t.get("utm_campaign")||void 0;return{entrypoint:n||r==="share"?"share":o||t.has("d")||r==="email"?"email":r?"campaign":"direct",...n?{share_id:n}:{},...o?{email_run_id:o}:{},...r?{utm_source:r}:{},...u?{utm_medium:u}:{},...a?{utm_campaign:a}:{}}}function c(){return h(typeof window>"u"?"":window.location.search)}function i(e){return`${p}${e}`}function g(){try{return globalThis.crypto.randomUUID()}catch{return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}}function d(e){try{const t=window.sessionStorage.getItem(i(e));if(!t)return null;const n=JSON.parse(t);return n.domain!==e||typeof n.attempt_id!="string"||typeof n.gate_shown_at!="number"||Date.now()-n.gate_shown_at>f?(window.sessionStorage.removeItem(i(e)),null):n}catch{return null}}function m(e){try{window.sessionStorage.setItem(i(e.domain),JSON.stringify(e))}catch{}}function w(e){const t=d(e);if(t)return t;const n={attempt_id:g(),domain:e,gate_shown_at:Date.now(),...c()};return m(n),n}function y(e,t){const n={...w(e),...t};return m(n),n}function T(e){return{auth_attempt_id:e.attempt_id,entrypoint:e.entrypoint,...e.share_id?{share_id:e.share_id}:{},...e.email_run_id?{email_run_id:e.email_run_id}:{},...e.utm_source?{utm_source:e.utm_source}:{},...e.utm_medium?{utm_medium:e.utm_medium}:{},...e.utm_campaign?{utm_campaign:e.utm_campaign}:{}}}function R(e){const t=d(e);if(!t)return null;try{window.sessionStorage.removeItem(i(e))}catch{}return t}function S(e){const t=e.toLowerCase();return t==="invalid_email"?"invalid_email":t.includes("429")||t.includes("rate limit")?"rate_limited":t.includes("otp")||t.includes("verification code")||t.includes("invalid code")||t.includes("expired code")||t.includes("código")||t.includes("codigo")?"invalid_or_expired_code":t.includes("401")||t.includes("unauthorized")?"invalid_credentials":t.includes("409")||t.includes("already exists")?"account_exists":t.includes("network")||t.includes("fetch")?"network":t.includes("cancel")||t.includes("closed")?"cancelled":"unknown"}function I(e){s=e}function M(e,t,n){if(_())try{l.capture(e,{...c(),...t,...s?{report_preview:"reviewer"}:{}},n)}catch{}}export{S as a,w as b,M as c,T as d,R as e,h as r,I as s,y as u};
@@ -1,4 +1,4 @@
1
- import{ci as p,at as t,ap as v,an as a,d4 as q,ak as s,am as g,al as u,ar as h,au as x,cg as O,d5 as fe,d6 as be,d7 as B,d8 as j,d9 as ye,da as ve,db as $,dc as _e,dd as He,de as Me,df as ke,dg as Pe,dh as qe,di as Te,dj as Ie,cu as Ee,dk as Le,dl as ze,dm as Ae,dn as De,dp as Ue,dq as Ne,dr as Oe,cs as je,r as oe,c as V,j as y,ds as Be,dt as $e,q as Ve,x as Fe,n as se}from"./index-RdcCdojW.js";import{P as We}from"./use-mcp-client-Bl7OJFcH.js";const ce=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Ke(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${Je(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,l=r.match(n);if(l){const f=(l.index??0)+l[0].length;return r.slice(0,f)+`
1
+ import{ci as p,at as t,ap as v,an as a,d4 as q,ak as s,am as g,al as u,ar as h,au as x,cg as O,d5 as fe,d6 as be,d7 as B,d8 as j,d9 as ye,da as ve,db as $,dc as _e,dd as He,de as Me,df as ke,dg as Pe,dh as qe,di as Te,dj as Ie,cu as Ee,dk as Le,dl as ze,dm as Ae,dn as De,dp as Ue,dq as Ne,dr as Oe,cs as je,r as oe,c as V,j as y,ds as Be,dt as $e,q as Ve,x as Fe,n as se}from"./index-BoZ9u4m1.js";import{P as We}from"./use-mcp-client-Cl4PpqBq.js";const ce=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Ke(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${Je(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,l=r.match(n);if(l){const f=(l.index??0)+l[0].length;return r.slice(0,f)+`
2
2
  `+i+r.slice(f)}const c=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,d=r.match(c);if(d){const f=(d.index??0)+d[0].length;return r.slice(0,f)+`
3
3
  <head>
4
4
  `+i+`
@@ -1 +1 @@
1
- import{c as p,H as h,ac as R,K as m,o as y,z as S,aY as D}from"./index-RdcCdojW.js";const P=["deco","anthropic","openrouter","llmapi","google","openai-compatible"],M=new Set(P);function O(o){return M.has(o)}const A={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"]},v={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"]},L={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"]},T={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},K={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},w={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function _(o){return o.toLowerCase().replace(/[^a-z0-9]/g,"")}function x(o){return _(o).includes("deepresearch")}const q=["sonar","searchpreview","online"];function I(o){const e=_(o);return e.includes("deepresearch")?!1:q.some(t=>e.includes(t))}function C(o){return o.asyncResearch!==!0&&I(o.modelId)}function F(o){return o.asyncResearch===!0||x(o.modelId)||I(o.modelId)}function u(o,e,t,n){for(const i of t){const s=o.find(a=>a.modelId===i);if(s)return{keyId:e,modelId:s.modelId,title:s.title}}for(const i of t){const s=o.find(a=>a.modelId.includes(i));if(s)return{keyId:e,modelId:s.modelId,title:s.title}}if(n){const i=o.find(n);if(i)return{keyId:e,modelId:i.modelId,title:i.title}}return null}function b(o,e){const t={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const n of o){const i=e[n.id]??[],s=n.providerId;t.chat.fast||(t.chat.fast=u(i,n.id,A[s]??[])),t.chat.smart||(t.chat.smart=u(i,n.id,v[s]??[])),t.chat.thinking||(t.chat.thinking=u(i,n.id,L[s]??[])),t.image||(t.image=u(i,n.id,T[s]??[],a=>a.capabilities?.includes("image")===!0)),t.webSearch||(t.webSearch=u(i,n.id,K[s]??[],C)),t.deepResearch||(t.deepResearch=u(i,n.id,w[s]??[],F))}return t}function H(o,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await D(o,"AI_PROVIDER_KEY_LIST",{})}}function $(){const o=p.c(7),{org:e}=h(),t=R();let n;o[0]!==e.id?(n=m.aiProviders(e.id),o[0]=e.id,o[1]=n):n=o[1];let i;o[2]!==t?(i=async()=>await t.call("AI_PROVIDERS_LIST",{}),o[2]=t,o[3]=i):i=o[3];let s;o[4]!==n||o[5]!==i?(s={queryKey:n,staleTime:1/0,queryFn:i},o[4]=n,o[5]=i,o[6]=s):s=o[6];const{data:a}=S(s);return a}function N(){const o=p.c(5),{org:e}=h();let t;o[0]!==e.id||o[1]!==e.slug?(t=H(e.slug,e.id),o[0]=e.id,o[1]=e.slug,o[2]=t):t=o[2];const{data:n}=S(t);let i;return o[3]!==n?.keys?(i=n?.keys??[],o[3]=n?.keys,o[4]=i):i=o[4],i}function z(){const o=p.c(2),e=N();let t;return o[0]!==e?(t=e.filter(Q),o[0]=e,o[1]=t):t=o[1],t}function Q(o){return O(o.providerId)}function E(o){const e=p.c(15),{org:t}=h(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=m.aiProviderModels(t.id,o??""),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];const s=!!o;let a;e[3]!==o||e[4]!==n?(a=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o??""}),e[3]=o,e[4]=n,e[5]=a):a=e[5];let r;e[6]!==i||e[7]!==s||e[8]!==a?(r={queryKey:i,enabled:s,staleTime:6e4,queryFn:a},e[6]=i,e[7]=s,e[8]=a,e[9]=r):r=e[9];const{data:l,isLoading:c}=y(r);let d;e[10]!==l?.models?(d=l?.models??[],e[10]=l?.models,e[11]=d):d=e[11];const g=!!o&&c;let f;return e[12]!==d||e[13]!==g?(f={models:d,isLoading:g},e[12]=d,e[13]=g,e[14]=f):f=e[14],f}function Y(o){const e=p.c(8),t=o[0],n=o[1],i=o[2],{models:s}=E(t?.id),{models:a}=E(n?.id),{models:r}=E(i?.id);let l;if(e[0]!==t||e[1]!==n||e[2]!==i||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==r){const c={};t?.id&&(c[t.id]=s),n?.id&&(c[n.id]=a),i?.id&&(c[i.id]=r),l=b(o,c),e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=s,e[5]=a,e[6]=r,e[7]=l}else l=e[7];return l}function B(o){const e=p.c(11),{org:t}=h(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=m.aiProviderModels(t.id,o),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];let s;e[3]!==o||e[4]!==n?(s=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i||e[7]!==s?(a={queryKey:i,staleTime:6e4,queryFn:s},e[6]=i,e[7]=s,e[8]=a):a=e[8];const{data:r}=S(a);let l;return e[9]!==r?.models?(l=r?.models??[],e[9]=r?.models,e[10]=l):l=e[10],l}export{Y as a,E as b,F as c,N as d,O as e,$ as f,B as g,C as i,b as p,z as u};
1
+ import{c as p,H as h,ac as R,K as m,o as y,z as S,aY as D}from"./index-BoZ9u4m1.js";const P=["deco","anthropic","openrouter","llmapi","google","openai-compatible"],M=new Set(P);function O(o){return M.has(o)}const A={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"]},v={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"]},L={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"]},T={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},K={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},w={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function _(o){return o.toLowerCase().replace(/[^a-z0-9]/g,"")}function x(o){return _(o).includes("deepresearch")}const q=["sonar","searchpreview","online"];function I(o){const e=_(o);return e.includes("deepresearch")?!1:q.some(t=>e.includes(t))}function C(o){return o.asyncResearch!==!0&&I(o.modelId)}function F(o){return o.asyncResearch===!0||x(o.modelId)||I(o.modelId)}function u(o,e,t,n){for(const i of t){const s=o.find(a=>a.modelId===i);if(s)return{keyId:e,modelId:s.modelId,title:s.title}}for(const i of t){const s=o.find(a=>a.modelId.includes(i));if(s)return{keyId:e,modelId:s.modelId,title:s.title}}if(n){const i=o.find(n);if(i)return{keyId:e,modelId:i.modelId,title:i.title}}return null}function b(o,e){const t={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const n of o){const i=e[n.id]??[],s=n.providerId;t.chat.fast||(t.chat.fast=u(i,n.id,A[s]??[])),t.chat.smart||(t.chat.smart=u(i,n.id,v[s]??[])),t.chat.thinking||(t.chat.thinking=u(i,n.id,L[s]??[])),t.image||(t.image=u(i,n.id,T[s]??[],a=>a.capabilities?.includes("image")===!0)),t.webSearch||(t.webSearch=u(i,n.id,K[s]??[],C)),t.deepResearch||(t.deepResearch=u(i,n.id,w[s]??[],F))}return t}function H(o,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await D(o,"AI_PROVIDER_KEY_LIST",{})}}function $(){const o=p.c(7),{org:e}=h(),t=R();let n;o[0]!==e.id?(n=m.aiProviders(e.id),o[0]=e.id,o[1]=n):n=o[1];let i;o[2]!==t?(i=async()=>await t.call("AI_PROVIDERS_LIST",{}),o[2]=t,o[3]=i):i=o[3];let s;o[4]!==n||o[5]!==i?(s={queryKey:n,staleTime:1/0,queryFn:i},o[4]=n,o[5]=i,o[6]=s):s=o[6];const{data:a}=S(s);return a}function N(){const o=p.c(5),{org:e}=h();let t;o[0]!==e.id||o[1]!==e.slug?(t=H(e.slug,e.id),o[0]=e.id,o[1]=e.slug,o[2]=t):t=o[2];const{data:n}=S(t);let i;return o[3]!==n?.keys?(i=n?.keys??[],o[3]=n?.keys,o[4]=i):i=o[4],i}function z(){const o=p.c(2),e=N();let t;return o[0]!==e?(t=e.filter(Q),o[0]=e,o[1]=t):t=o[1],t}function Q(o){return O(o.providerId)}function E(o){const e=p.c(15),{org:t}=h(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=m.aiProviderModels(t.id,o??""),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];const s=!!o;let a;e[3]!==o||e[4]!==n?(a=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o??""}),e[3]=o,e[4]=n,e[5]=a):a=e[5];let r;e[6]!==i||e[7]!==s||e[8]!==a?(r={queryKey:i,enabled:s,staleTime:6e4,queryFn:a},e[6]=i,e[7]=s,e[8]=a,e[9]=r):r=e[9];const{data:l,isLoading:c}=y(r);let d;e[10]!==l?.models?(d=l?.models??[],e[10]=l?.models,e[11]=d):d=e[11];const g=!!o&&c;let f;return e[12]!==d||e[13]!==g?(f={models:d,isLoading:g},e[12]=d,e[13]=g,e[14]=f):f=e[14],f}function Y(o){const e=p.c(8),t=o[0],n=o[1],i=o[2],{models:s}=E(t?.id),{models:a}=E(n?.id),{models:r}=E(i?.id);let l;if(e[0]!==t||e[1]!==n||e[2]!==i||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==r){const c={};t?.id&&(c[t.id]=s),n?.id&&(c[n.id]=a),i?.id&&(c[i.id]=r),l=b(o,c),e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=s,e[5]=a,e[6]=r,e[7]=l}else l=e[7];return l}function B(o){const e=p.c(11),{org:t}=h(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=m.aiProviderModels(t.id,o),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];let s;e[3]!==o||e[4]!==n?(s=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i||e[7]!==s?(a={queryKey:i,staleTime:6e4,queryFn:s},e[6]=i,e[7]=s,e[8]=a):a=e[8];const{data:r}=S(a);let l;return e[9]!==r?.models?(l=r?.models??[],e[9]=r?.models,e[10]=l):l=e[10],l}export{Y as a,E as b,F as c,N as d,O as e,$ as f,B as g,C as i,b as p,z as u};
@@ -1 +1 @@
1
- import{c,H as d,p,e as I,K as g,o as E}from"./index-RdcCdojW.js";import{u as y}from"./use-mcp-client-Bl7OJFcH.js";import{S as m}from"./constants-dLUUoWH7.js";function f(e,t){if(e?.isError)throw new Error(e.content?.[0]?.text??t);if(!e.structuredContent)throw new Error(t);return e.structuredContent}function S(){const e=c.c(10),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=y(n);let o;e[3]!==t.id?(o=g.apiKeysList(t.id),e[3]=t.id,e[4]=o):o=e[4];let s;e[5]!==r?(s=async()=>{const l=await r.callTool({name:"API_KEY_LIST",arguments:{}});return f(l,"Failed to list API keys").items},e[5]=r,e[6]=s):s=e[6];let i;return e[7]!==o||e[8]!==s?(i={queryKey:o,queryFn:s,staleTime:3e4},e[7]=o,e[8]=s,e[9]=i):i=e[9],E(i)}function P(){const e=c.c(11),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=y(n),o=p();let s;e[3]!==r?(s=async u=>{const a=await r.callTool({name:"API_KEY_CREATE",arguments:{name:u.name,permissions:u.permissions??{"*":["*"]}}});return f(a,"Failed to create API key")},e[3]=r,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==s||e[9]!==i?(l={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=l):l=e[10],I(l)}function _(){const e=c.c(11),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=y(n),o=p();let s;e[3]!==r?(s=async u=>{const a=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:u}});return f(a,"Failed to delete API key")},e[3]=r,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==s||e[9]!==i?(l={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=l):l=e[10],I(l)}export{S as a,_ as b,P as u};
1
+ import{c,H as d,p,e as I,K as g,o as E}from"./index-BoZ9u4m1.js";import{u as y}from"./use-mcp-client-Cl4PpqBq.js";import{S as m}from"./constants-dLUUoWH7.js";function f(e,t){if(e?.isError)throw new Error(e.content?.[0]?.text??t);if(!e.structuredContent)throw new Error(t);return e.structuredContent}function S(){const e=c.c(10),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=y(n);let o;e[3]!==t.id?(o=g.apiKeysList(t.id),e[3]=t.id,e[4]=o):o=e[4];let s;e[5]!==r?(s=async()=>{const l=await r.callTool({name:"API_KEY_LIST",arguments:{}});return f(l,"Failed to list API keys").items},e[5]=r,e[6]=s):s=e[6];let i;return e[7]!==o||e[8]!==s?(i={queryKey:o,queryFn:s,staleTime:3e4},e[7]=o,e[8]=s,e[9]=i):i=e[9],E(i)}function P(){const e=c.c(11),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=y(n),o=p();let s;e[3]!==r?(s=async u=>{const a=await r.callTool({name:"API_KEY_CREATE",arguments:{name:u.name,permissions:u.permissions??{"*":["*"]}}});return f(a,"Failed to create API key")},e[3]=r,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==s||e[9]!==i?(l={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=l):l=e[10],I(l)}function _(){const e=c.c(11),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=y(n),o=p();let s;e[3]!==r?(s=async u=>{const a=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:u}});return f(a,"Failed to delete API key")},e[3]=r,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==s||e[9]!==i?(l={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=l):l=e[10],I(l)}export{S as a,_ as b,P as u};
@@ -1 +1 @@
1
- import{c as U,H as q,ac as I,K as T,o as Q,p as x,e as y,t as m}from"./index-RdcCdojW.js";import{u as z}from"./use-mcp-client-Bl7OJFcH.js";import{S as H}from"./constants-dLUUoWH7.js";function J(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??H;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=z(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(J)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],Q(r)}function it(t){const e=U.c(9),{org:s}=q(),l=I();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],Q(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=I();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],Q(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=I();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],Q(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=I(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let p;t[13]!==s?(p=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=p):p=t[14];let A;t[15]!==i||t[16]!==o?(A=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=A):A=t[17];let G;t[18]!==p||t[19]!==A?(G={mutationFn:p,onSuccess:A,onError:W},t[18]=p,t[19]=A,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:B},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:Y,onError:V},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function V(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function Y(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function B(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
1
+ import{c as U,H as q,ac as I,K as T,o as Q,p as x,e as y,t as m}from"./index-BoZ9u4m1.js";import{u as z}from"./use-mcp-client-Cl4PpqBq.js";import{S as H}from"./constants-dLUUoWH7.js";function J(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??H;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=z(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(J)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],Q(r)}function it(t){const e=U.c(9),{org:s}=q(),l=I();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],Q(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=I();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],Q(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=I();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],Q(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=I(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let p;t[13]!==s?(p=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=p):p=t[14];let A;t[15]!==i||t[16]!==o?(A=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=A):A=t[17];let G;t[18]!==p||t[19]!==A?(G={mutationFn:p,onSuccess:A,onError:W},t[18]=p,t[19]=A,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:B},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:Y,onError:V},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function V(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function Y(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function B(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
@@ -1 +1 @@
1
- import{c as T,r as o}from"./index-RdcCdojW.js";const y=700;function x(r,l,_){const e=T.c(7),f=y,[a,m]=o.useState(r),[i,S]=o.useState(r),[A,d]=o.useState(!1),t=o.useRef(null);r!==i&&(S(r),A||m(r));let s;e[0]!==f||e[1]!==l?(s=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},f)},e[0]=f,e[1]=l,e[2]=s):s=e[2];const p=s;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==a||e[5]!==p?(n=[a,p,E],e[4]=a,e[5]=p,e[6]=n):n=e[6],n}export{x as u};
1
+ import{c as T,r as o}from"./index-BoZ9u4m1.js";const y=700;function x(r,l,_){const e=T.c(7),f=y,[a,m]=o.useState(r),[i,S]=o.useState(r),[A,d]=o.useState(!1),t=o.useRef(null);r!==i&&(S(r),A||m(r));let s;e[0]!==f||e[1]!==l?(s=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},f)},e[0]=f,e[1]=l,e[2]=s):s=e[2];const p=s;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==a||e[5]!==p?(n=[a,p,E],e[4]=a,e[5]=p,e[6]=n):n=e[6],n}export{x as u};
@@ -1 +1 @@
1
- import{c as f,H as C,cc as N,fe as O,cb as S}from"./index-RdcCdojW.js";import{u as I}from"./use-mcp-client-Bl7OJFcH.js";import{S as m}from"./constants-dLUUoWH7.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:m,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=I(a);return O(u.id,"CONNECTIONS",A,p)}function _(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:m,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=I(n);return S(i.id,"CONNECTIONS",t,l)}function x(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:m,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=I(i);return N(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
1
+ import{c as f,H as C,cc as N,fe as O,cb as S}from"./index-BoZ9u4m1.js";import{u as I}from"./use-mcp-client-Cl4PpqBq.js";import{S as m}from"./constants-dLUUoWH7.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:m,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=I(a);return O(u.id,"CONNECTIONS",A,p)}function _(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:m,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=I(n);return S(i.id,"CONNECTIONS",t,l)}function x(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:m,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=I(i);return N(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
@@ -1 +1 @@
1
- import{c as i,r as n}from"./index-RdcCdojW.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
1
+ import{c as i,r as n}from"./index-BoZ9u4m1.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
@@ -1 +1 @@
1
- import{c as g}from"./index-RdcCdojW.js";import{b as p}from"./use-virtual-mcp-BV3GNVOc.js";import{c as f}from"./use-navigate-to-agent-C1od-jNe.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const u=n,{navigateOnCreate:d}=u,c=d===void 0?!1:d,t=p(),o=f();let s;e[2]!==t.create||e[3]!==c||e[4]!==o?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&o(l.id,{panel:"settings"}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=o,e[5]=s):s=e[5];const r=s;let a;return e[6]!==t.create.isPending||e[7]!==r?(a={createVirtualMCP:r,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=r,e[8]=a):a=e[8],a}export{A as u};
1
+ import{c as g}from"./index-BoZ9u4m1.js";import{b as p}from"./use-virtual-mcp-Df2Znans.js";import{c as f}from"./use-navigate-to-agent-D8r5y5p4.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const u=n,{navigateOnCreate:d}=u,c=d===void 0?!1:d,t=p(),o=f();let s;e[2]!==t.create||e[3]!==c||e[4]!==o?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&o(l.id,{panel:"settings"}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=o,e[5]=s):s=e[5];const r=s;let a;return e[6]!==t.create.isPending||e[7]!==r?(a={createVirtualMCP:r,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=r,e[8]=a):a=e[8],a}export{A as u};
@@ -1 +1 @@
1
- import{r as u}from"./index-RdcCdojW.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
1
+ import{r as u}from"./index-BoZ9u4m1.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
@@ -1 +1 @@
1
- import{c as m,r as n}from"./index-RdcCdojW.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-BoZ9u4m1.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{r as s}from"./index-RdcCdojW.js";import{d as R,D as u}from"./decopilot-sse-pool-VQZMAg5B.js";const f=()=>0;function g(E){const{orgSlug:t,taskId:a,enabled:n=!0,onStep:o,onFinish:S,onTaskStatus:i}=E,l=s.useRef({taskId:a,onStep:o,onFinish:S,onTaskStatus:i});l.current={taskId:a,onStep:o,onFinish:S,onTaskStatus:i};const c=s.useRef(null),p=s.useRef(n),b=s.useRef(t);(!c.current||p.current!==n||b.current!==t)&&(p.current=n,b.current=t,c.current=d=>{if(!n||!t)return()=>{};const k=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=l.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}d()}};return R.subscribe(t,k)}),s.useSyncExternalStore(c.current,f,f)}export{g as u};
1
+ import{r as s}from"./index-BoZ9u4m1.js";import{d as R,D as u}from"./decopilot-sse-pool-S5tux0kK.js";const f=()=>0;function g(E){const{orgSlug:t,taskId:a,enabled:n=!0,onStep:o,onFinish:S,onTaskStatus:i}=E,l=s.useRef({taskId:a,onStep:o,onFinish:S,onTaskStatus:i});l.current={taskId:a,onStep:o,onFinish:S,onTaskStatus:i};const c=s.useRef(null),p=s.useRef(n),b=s.useRef(t);(!c.current||p.current!==n||b.current!==t)&&(p.current=n,b.current=t,c.current=d=>{if(!n||!t)return()=>{};const k=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=l.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}d()}};return R.subscribe(t,k)}),s.useSyncExternalStore(c.current,f,f)}export{g as u};
@@ -1 +1 @@
1
- import{c as oe,b as le,j as n,H as se,p as ie,ac as ce,r as re,t as Y,c9 as ae,ca as de}from"./index-RdcCdojW.js";import{c as z,d as G,b as V,f as X,g as Z,e as ee,a as te,A as ne}from"./alert-dialog-xk0i6uOf.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),k=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=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 w=s.mode==="deleting"&&s.connection.title;let o;e[8]!==w?(o=n.jsx("span",{className:"font-medium text-foreground",children:w}),e[8]=w,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 f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,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 p;e[31]!==k||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:k,onOpenChange:m,children:j}),e[31]=k,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let 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 H;e[73]!==R||e[74]!==U?(H=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=H):H=e[75];let K;e[76]!==L||e[77]!==H?(K=n.jsxs(te,{children:[L,H]}),e[76]=L,e[77]=H,e[78]=K):K=e[78];let $;e[79]!==J||e[80]!==N||e[81]!==K?($=n.jsx(ne,{open:J,onOpenChange:N,children:K}),e[79]=J,e[80]=N,e[81]=K,e[82]=$):$=e[82];let Q;return e[83]!==p||e[84]!==$?(Q=n.jsxs(n.Fragment,{children:[p,$]}),e[83]=p,e[84]=$,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"}})},k=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},m=o=>{t(),k(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}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);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}),m(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,H as se,p as ie,ac as ce,r as re,t as Y,c9 as ae,ca as de}from"./index-BoZ9u4m1.js";import{c as z,d as G,b as V,f as X,g as Z,e as ee,a as te,A as ne}from"./alert-dialog-3i0jJzJ0.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),k=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=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 w=s.mode==="deleting"&&s.connection.title;let o;e[8]!==w?(o=n.jsx("span",{className:"font-medium text-foreground",children:w}),e[8]=w,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 f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,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 p;e[31]!==k||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:k,onOpenChange:m,children:j}),e[31]=k,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let 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 H;e[73]!==R||e[74]!==U?(H=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=H):H=e[75];let K;e[76]!==L||e[77]!==H?(K=n.jsxs(te,{children:[L,H]}),e[76]=L,e[77]=H,e[78]=K):K=e[78];let $;e[79]!==J||e[80]!==N||e[81]!==K?($=n.jsx(ne,{open:J,onOpenChange:N,children:K}),e[79]=J,e[80]=N,e[81]=K,e[82]=$):$=e[82];let Q;return e[83]!==p||e[84]!==$?(Q=n.jsxs(n.Fragment,{children:[p,$]}),e[83]=p,e[84]=$,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"}})},k=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},m=o=>{t(),k(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}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);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}),m(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,o as m,K as c}from"./index-RdcCdojW.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,o as m,K as c}from"./index-BoZ9u4m1.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 as r,m as o}from"./index-RdcCdojW.js";const n={home:"/$org/home",agents:"/$org/agents/{-$project}/{-$panel}",tasks:"/$org/tasks/{-$taskKey}",reports:"/$org/reports",library:"/$org/library",orgIndex:"/$org/"};function c(){const e=r.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:s},e[0]=t):t=e[0],o(t)}function s(e){return e.matches.at(-1)?.fullPath??""}export{n as D,c as u};
1
+ import{c as r,m as o}from"./index-BoZ9u4m1.js";const n={home:"/$org/home",agents:"/$org/agents/{-$project}/{-$panel}",tasks:"/$org/tasks/{-$taskKey}",reports:"/$org/reports",library:"/$org/library",orgIndex:"/$org/"};function c(){const e=r.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:s},e[0]=t):t=e[0],o(t)}function s(e){return e.matches.at(-1)?.fullPath??""}export{n as D,c as u};
@@ -1 +1 @@
1
- import{c as u,H as c,ac as r,K as a,o as y,z as F,p as C,e as d}from"./index-RdcCdojW.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{E as a,m as b,q as c,I as u};
1
+ import{c as u,H as c,ac as r,K as a,o as y,z as F,p as C,e as d}from"./index-BoZ9u4m1.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{E as a,m as b,q as c,I as u};
@@ -1 +1 @@
1
- import{bR as l,fg as d,fh as v,r as i}from"./index-RdcCdojW.js";var b=class extends l{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:d(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function p(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{b as I,p as u};
1
+ import{bR as l,fg as d,fh as v,r as i}from"./index-BoZ9u4m1.js";var b=class extends l{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:d(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function p(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{b as I,p as u};
@@ -1 +1 @@
1
- import{c as O,H as T,ac as A,c1 as _,K as I,o as v,p as J,b as Q,e as N,t as p}from"./index-RdcCdojW.js";function j(){const e=O.c(10),{org:u}=T(),d=A(),{capabilities:c,isPrivileged:f}=_(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=v(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function F(){const e=O.c(29),{org:u,locator:d}=T(),c=A(),f=J(),s=Q();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let E;e[22]!==q||e[23]!==R||e[24]!==g?(E={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=E):E=e[25];const S=N(E);let m;return e[26]!==y||e[27]!==S?(m={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=m):m=e[28],m}export{F as a,j as u};
1
+ import{c as O,H as T,ac as A,c1 as _,K as I,o as v,p as J,b as Q,e as N,t as p}from"./index-BoZ9u4m1.js";function j(){const e=O.c(10),{org:u}=T(),d=A(),{capabilities:c,isPrivileged:f}=_(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=v(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function F(){const e=O.c(29),{org:u,locator:d}=T(),c=A(),f=J(),s=Q();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let E;e[22]!==q||e[23]!==R||e[24]!==g?(E={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=E):E=e[25];const S=N(E);let m;return e[26]!==y||e[27]!==S?(m={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=m):m=e[28],m}export{F as a,j as u};
@@ -1 +1 @@
1
- import{c as I,b as k,D as N,bb as S,j as o,ab as g,a8 as v,a9 as b,aa as $,H as A,K as H,z as L}from"./index-RdcCdojW.js";import{B as T}from"./badge-CDQQQbvb.js";import{g as P}from"./types-D55csc5w.js";import{s as _}from"./Eye-BL9Cl1_z.js";import{s as U,aP as w}from"./agent-icon-CoWSmZeI.js";import{i as O}from"./mcp-oauth-WauR-bs4.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:_,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 D(y){const e=I.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=P(r),e[0]=r,e[1]=l):l=e[1];const n=!!l;let s,i,a,u,d;if(e[2]!==c||e[3]!==n||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!n){d=null;break e}s=$,i="flex gap-1 flex-nowrap",e[10]!==n||e[11]!==t?(a=n&&o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(T,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(b,{children:t("tools.toolsList.interactive")})]}),e[10]=n,e[11]=t,e[12]=a):a=e[12];let m;e[13]!==t?(m=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(T,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(b,{children:t(j)})]},j)},e[13]=t,e[14]=m):m=e[14],u=x.map(m)}e[2]=c,e[3]=n,e[4]=t,e[5]=s,e[6]=i,e[7]=a,e[8]=u,e[9]=d}else s=e[5],i=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==i||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:i,children:[a,u]}),e[15]=i,e[16]=a,e[17]=u,e[18]=p):p=e[18];let f;return e[19]!==s||e[20]!==p?(f=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=f):f=e[21],f}function F(y){const e=I.c(11),{connectionId:c}=y,{org:r}=A();let t,l,n;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),n=L,l=H.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=n):(t=e[2],l=e[3],n=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let i;e[8]!==l||e[9]!==s?(i={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=i):i=e[10];const{data:a}=n(i);return a}export{D as T,F as u};
1
+ import{c as I,b as k,D as N,bb as S,j as o,ab as g,a8 as v,a9 as b,aa as $,H as A,K as H,z as L}from"./index-BoZ9u4m1.js";import{B as T}from"./badge-CAWKSDnJ.js";import{g as P}from"./types-BMYq-irZ.js";import{s as _}from"./Eye-C1diZla3.js";import{s as U,aP as w}from"./agent-icon-DwW--uUY.js";import{i as O}from"./mcp-oauth-1M77jlWl.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:_,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 D(y){const e=I.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=P(r),e[0]=r,e[1]=l):l=e[1];const n=!!l;let s,i,a,u,d;if(e[2]!==c||e[3]!==n||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!n){d=null;break e}s=$,i="flex gap-1 flex-nowrap",e[10]!==n||e[11]!==t?(a=n&&o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(T,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(b,{children:t("tools.toolsList.interactive")})]}),e[10]=n,e[11]=t,e[12]=a):a=e[12];let m;e[13]!==t?(m=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(T,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(b,{children:t(j)})]},j)},e[13]=t,e[14]=m):m=e[14],u=x.map(m)}e[2]=c,e[3]=n,e[4]=t,e[5]=s,e[6]=i,e[7]=a,e[8]=u,e[9]=d}else s=e[5],i=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==i||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:i,children:[a,u]}),e[15]=i,e[16]=a,e[17]=u,e[18]=p):p=e[18];let f;return e[19]!==s||e[20]!==p?(f=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=f):f=e[21],f}function F(y){const e=I.c(11),{connectionId:c}=y,{org:r}=A();let t,l,n;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),n=L,l=H.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=n):(t=e[2],l=e[3],n=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let i;e[8]!==l||e[9]!==s?(i={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=i):i=e[10];const{data:a}=n(i);return a}export{D as T,F as u};
@@ -1,4 +1,4 @@
1
- import{eo as le,ep as ue,eq as de,dd as he,er as fe,cR as _,cS as g,es as pe,et as me,eu as _e,ev as M,ew as we,ex as D,ey as ge,ez as q,eA as Te,eB as L,eC as ye,eD as ke,eE as ve,eF as J,cw as Se,cy as Ce,ct as Re,d8 as te,dk as be,dr as Ie,dp as Ee,dR as qe,eG as Pe,eH as $e,eI as A,eJ as Me,eK as Ae,dq as He,dl as Oe,dm as Ue,dn as xe,cu as Ne,eL as je,eM as Fe,eN as De,df as Le,eO as Ve,eP as ze,dN as U,eQ as Qe,cs as N,c as se,z as re,K as z}from"./index-RdcCdojW.js";import{S as Je}from"./constants-dLUUoWH7.js";import{U as P,a as H,e as W}from"./auth-Uy0w4hkL.js";function x(a){return!!a._zod}function R(a,e){return x(a)?le(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 We(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 b(a){return a==="completed"||a==="failed"||a==="cancelled"}function K(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=We(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(a,e){const t=R(a,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Ge{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(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,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(pe,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(!b(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(b(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(me,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(_e,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(b(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)||we(o)?this._onresponse(o):D(o)?this._onrequest(o,n):ge(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=Te(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},b(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=R(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??Ke,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},ye,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},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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=K(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=G(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=K(e);this._notificationHandlers.set(s,r=>{const o=G(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=J.parse({method:"notifications/tasks/status",params:i});await this.notification(u),b(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(b(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=J.parse({method:"notifications/tasks/status",params:u});await this.notification(p),b(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function B(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Be(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];B(n)&&B(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Ce();const Ye=Se(Ze);function Xe(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class et{constructor(e){this._ajv=e??Xe()}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 tt{constructor(e){this._client=e}async*callToolStream(e,t=te,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 st(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 rt(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 ot(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 at=class extends Ge{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 et,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new tt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Be(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=R(Fe,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}=ot(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=R(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=R(De,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=R(Le,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=R(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?Ve:ze,y=R(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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.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){st(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&rt(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},Me,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},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},He,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Oe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ue,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=te,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},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=je.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 nt(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 it(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 Z 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 Y=10,ct=13,I=32;function F(a){}function lt(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{eo as le,ep as ue,eq as de,dd as he,er as fe,cR as _,cS as g,es as pe,et as me,eu as _e,ev as M,ew as we,ex as D,ey as ge,ez as q,eA as Te,eB as L,eC as ye,eD as ke,eE as ve,eF as J,cw as Se,cy as Ce,ct as Re,d8 as te,dk as be,dr as Ie,dp as Ee,dR as qe,eG as Pe,eH as $e,eI as A,eJ as Me,eK as Ae,dq as He,dl as Oe,dm as Ue,dn as xe,cu as Ne,eL as je,eM as Fe,eN as De,df as Le,eO as Ve,eP as ze,dN as U,eQ as Qe,cs as N,c as se,z as re,K as z}from"./index-BoZ9u4m1.js";import{S as Je}from"./constants-dLUUoWH7.js";import{U as P,a as H,e as W}from"./auth-jQituvKm.js";function x(a){return!!a._zod}function R(a,e){return x(a)?le(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 We(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 b(a){return a==="completed"||a==="failed"||a==="cancelled"}function K(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=We(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(a,e){const t=R(a,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Ge{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(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,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(pe,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(!b(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(b(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(me,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(_e,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(b(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)||we(o)?this._onresponse(o):D(o)?this._onrequest(o,n):ge(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=Te(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},b(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=R(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??Ke,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},ye,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},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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=K(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=G(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=K(e);this._notificationHandlers.set(s,r=>{const o=G(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=J.parse({method:"notifications/tasks/status",params:i});await this.notification(u),b(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(b(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=J.parse({method:"notifications/tasks/status",params:u});await this.notification(p),b(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function B(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Be(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];B(n)&&B(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Ce();const Ye=Se(Ze);function Xe(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class et{constructor(e){this._ajv=e??Xe()}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 tt{constructor(e){this._client=e}async*callToolStream(e,t=te,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 st(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 rt(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 ot(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 at=class extends Ge{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 et,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new tt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Be(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=R(Fe,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}=ot(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=R(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=R(De,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=R(Le,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=R(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?Ve:ze,y=R(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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.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){st(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&rt(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},Me,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},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},He,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Oe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ue,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=te,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},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=je.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 nt(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 it(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 Z 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 Y=10,ct=13,I=32;function F(a){}function lt(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(X(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)===Y){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 m,o as p,z as q,K as T}from"./index-RdcCdojW.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
1
+ import{c as m,o as p,z as q,K as T}from"./index-BoZ9u4m1.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
@@ -1 +1 @@
1
- import{c,H as m,z as b,o as M,K as f}from"./index-RdcCdojW.js";import{u as y}from"./use-org-auth-client-BamEWpk2.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),r=y();let o;t[0]!==e?(o=f.members(e),t[0]=e,t[1]=o):o=t[1];let s;t[2]!==r?(s=()=>r.organization.listMembers(),t[2]=r,t[3]=s):s=t[3];let n;return t[4]!==o||t[5]!==s?(n={queryKey:o,queryFn:s},t[4]=o,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let r;e[0]!==t?(r=t===void 0?{}:t,e[0]=t,e[1]=r):r=e[1];const{enabled:o}=r,s=o===void 0?!0:o,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
1
+ import{c,H as m,z as b,o as M,K as f}from"./index-BoZ9u4m1.js";import{u as y}from"./use-org-auth-client-CIuw_wjP.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),r=y();let o;t[0]!==e?(o=f.members(e),t[0]=e,t[1]=o):o=t[1];let s;t[2]!==r?(s=()=>r.organization.listMembers(),t[2]=r,t[3]=s):s=t[3];let n;return t[4]!==o||t[5]!==s?(n={queryKey:o,queryFn:s},t[4]=o,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let r;e[0]!==t?(r=t===void 0?{}:t,e[0]=t,e[1]=r):r=e[1];const{enabled:o}=r,s=o===void 0?!0:o,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{D as R}from"./use-destination-route-R7oVWY5R.js";import{I as O,r as c,c as v,j as A,d as x,H as C,a as E,dF as T}from"./index-RdcCdojW.js";import{u as _}from"./use-virtual-mcp-BV3GNVOc.js";import{u as N}from"./hooks-CJ16hHiH.js";import{p as w,d as P}from"./session-runtime-wVXsCwcJ.js";const f=new Map;function y(r){return`${r.orgId}:${r.userId}`}function U(r){return`sidebar.group-order.${r}`}function h(r){try{const e=localStorage.getItem(r),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function G(r,e){try{localStorage.setItem(r,JSON.stringify(e))}catch{}}function j(r){const e=y(r),t=f.get(e);if(t)return t;const n=O.sidebarGroupOrder(r.orgId,r.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=h(n);if(!s&&o.length===0&&r.userId!=="anon"){const d=h(U(r.orgId));d.length>0&&(o=d)}return f.set(e,o),o}function D(r,e){const t=new Set(e);return j(r).filter(n=>!t.has(n))}function K(r,e){f.set(y(r),e),G(O.sidebarGroupOrder(r.orgId,r.userId),e)}function $(r,e,t=[]){if(t.includes(e))return;const n=D(r,t);n.includes(e)||K(r,[e,...n])}const m=c.createContext(null);function X(r){const e=v.c(7),{children:t}=r,[n,s]=c.useState(!1),[o,d]=c.useState(0);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>d(L),e[0]=i):i=e[0];const l=i;let a;e[1]!==n||e[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:l},e[1]=n,e[2]=o,e[3]=a):a=e[3];let u;return e[4]!==t||e[5]!==a?(u=A.jsx(m.Provider,{value:a,children:t}),e[4]=t,e[5]=a,e[6]=u):u=e[6],u}function L(r){return r+1}function Z(){return c.useContext(m)?.empty??!1}function k(){return c.useContext(m)?.bumpOrderRevision??F}function F(){}function H(r,e,t,n){return r.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===t&&s.title==="New chat"&&!s.harness_id&&J(s,n))}function J(r,e){if(!e)return!0;if(r.partial)return!1;const t=w(r.metadata?.runtime);return t===null||t===e}const S=[],B=()=>()=>{};function V(r){return(r??[]).filter(e=>!!e.pinned).map(e=>e.id)}function M(){const r=x(),{org:e}=C(),t=_(),{data:n}=E.useSession(),s=n?.user?.id??"anon",o=V(t),d=k(),i=N(),l=c.useSyncExternalStore(i?.threads.subscribe??B,i?.threads.get??(()=>S),i?.threads.get??(()=>S));return(a,u)=>{$({orgId:e.id,userId:s},a,o),d();const g=(t??[]).find(I=>I.id===a),b=H(l,a,n?.user?.id,g?P(g.metadata):void 0)?.id??crypto.randomUUID(),p=u?.panel?T(u.panel):null;r({to:R.agents,params:{org:e.slug,project:a,panel:p?.panel},search:{...p?.payload??{},thread:b}})}}export{X as S,k as a,$ as b,M as c,H as f,V as g,Z as u};
1
+ import{D as R}from"./use-destination-route-CUizQ3Ky.js";import{I as O,r as c,c as v,j as A,d as x,H as C,a as E,dF as T}from"./index-BoZ9u4m1.js";import{u as _}from"./use-virtual-mcp-Df2Znans.js";import{u as N}from"./hooks-B79ZY8IT.js";import{p as w,d as P}from"./session-runtime-wVXsCwcJ.js";const f=new Map;function y(r){return`${r.orgId}:${r.userId}`}function U(r){return`sidebar.group-order.${r}`}function h(r){try{const e=localStorage.getItem(r),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function G(r,e){try{localStorage.setItem(r,JSON.stringify(e))}catch{}}function j(r){const e=y(r),t=f.get(e);if(t)return t;const n=O.sidebarGroupOrder(r.orgId,r.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=h(n);if(!s&&o.length===0&&r.userId!=="anon"){const d=h(U(r.orgId));d.length>0&&(o=d)}return f.set(e,o),o}function D(r,e){const t=new Set(e);return j(r).filter(n=>!t.has(n))}function K(r,e){f.set(y(r),e),G(O.sidebarGroupOrder(r.orgId,r.userId),e)}function $(r,e,t=[]){if(t.includes(e))return;const n=D(r,t);n.includes(e)||K(r,[e,...n])}const m=c.createContext(null);function X(r){const e=v.c(7),{children:t}=r,[n,s]=c.useState(!1),[o,d]=c.useState(0);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>d(L),e[0]=i):i=e[0];const l=i;let a;e[1]!==n||e[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:l},e[1]=n,e[2]=o,e[3]=a):a=e[3];let u;return e[4]!==t||e[5]!==a?(u=A.jsx(m.Provider,{value:a,children:t}),e[4]=t,e[5]=a,e[6]=u):u=e[6],u}function L(r){return r+1}function Z(){return c.useContext(m)?.empty??!1}function k(){return c.useContext(m)?.bumpOrderRevision??F}function F(){}function H(r,e,t,n){return r.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===t&&s.title==="New chat"&&!s.harness_id&&J(s,n))}function J(r,e){if(!e)return!0;if(r.partial)return!1;const t=w(r.metadata?.runtime);return t===null||t===e}const S=[],B=()=>()=>{};function V(r){return(r??[]).filter(e=>!!e.pinned).map(e=>e.id)}function M(){const r=x(),{org:e}=C(),t=_(),{data:n}=E.useSession(),s=n?.user?.id??"anon",o=V(t),d=k(),i=N(),l=c.useSyncExternalStore(i?.threads.subscribe??B,i?.threads.get??(()=>S),i?.threads.get??(()=>S));return(a,u)=>{$({orgId:e.id,userId:s},a,o),d();const g=(t??[]).find(I=>I.id===a),b=H(l,a,n?.user?.id,g?P(g.metadata):void 0)?.id??crypto.randomUUID(),p=u?.panel?T(u.panel):null;r({to:R.agents,params:{org:e.slug,project:a,panel:p?.panel},search:{...p?.payload??{},thread:b}})}}export{X as S,k as a,$ as b,M as c,H as f,V as g,Z as u};
@@ -1 +1 @@
1
- import{c as x,H as j,a as i}from"./index-RdcCdojW.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,H as j,a as i}from"./index-BoZ9u4m1.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 r,H as f,ac as y,K as S,o as _,p as d,e as R}from"./index-RdcCdojW.js";const p=5e3;function m(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return m(e.state.data)?p:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,T as c,g as u};
1
+ import{c as r,H as f,ac as y,K as S,o as _,p as d,e as R}from"./index-BoZ9u4m1.js";const p=5e3;function m(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return m(e.state.data)?p:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,T as c,g as u};
@@ -1 +1 @@
1
- import{c as u,o as S,p as r,e as y,K as c}from"./index-RdcCdojW.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 q(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 C(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 O(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 m(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{C as a,O as b,m as c,h as d,q as u};
1
+ import{c as u,o as S,p as r,e as y,K as c}from"./index-BoZ9u4m1.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 q(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 C(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 O(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 m(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{C as a,O as b,m as c,h as d,q as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-BamEWpk2.js";import{H as b,o as P,K as y}from"./index-RdcCdojW.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-CIuw_wjP.js";import{H as b,o as P,K as y}from"./index-BoZ9u4m1.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -1 +1 @@
1
- import{c as o,H as y,o as T,aY as $,K as _,ac as z,p as I,e as D,r as M}from"./index-RdcCdojW.js";import{W as G}from"./constants-dLUUoWH7.js";import{d as P,o as Q,r as C}from"./task-board-CQBNS0e1.js";const O={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},w={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...O,organizationId:e}}},staleTime:6e4}}function c(t){const e=o.c(6),{org:s}=y();let n;e[0]!==s.id||e[1]!==s.slug?(n=N(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let a;return e[3]!==n||e[4]!==i?(a={...n,select:i},e[3]=n,e[4]=i,e[5]=a):a=e[5],T(a)}function B(t,e){const s=o.c(3);let n;s[0]!==t||s[1]!==e?(n=N(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=T(n);return i??null}function f(){const t=o.c(9),{org:e}=y(),s=z(),n=I();let i;t[0]!==e||t[1]!==s?(i=async u=>{const l=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!l)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return l},t[0]=e,t[1]=s,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n?(a=u=>{n.setQueryData(_.organizationSettings(e.id),l=>({...l??O,...u}))},t[3]=e,t[4]=n,t[5]=a):a=t[5];let r;return t[6]!==i||t[7]!==a?(r={mutationFn:i,onSuccess:a},t[6]=i,t[7]=a,t[8]=r):r=t[8],D(r)}function F(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:w}function J(){const{data:t}=c(U);return t??w}function U(t){return F(t.simple_mode)}function V(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({simple_mode:a},r),n=(a,r)=>e.mutateAsync({simple_mode:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function X(){return k("reports_only")}function k(t){const e=o.c(5);let s;e[0]!==t?(s=a=>Q(a.flags,t),e[0]=t,e[1]=s):s=e[1];const{data:n}=c(s);let i;return e[2]!==n||e[3]!==t?(i=n??P.has(t),e[2]=n,e[3]=t,e[4]=i):i=e[4],i}function tt(){const{data:t}=c(x);return t??!0}function x(t){return C(t.flags)}function et(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r,u)=>e.mutate({flags:{[a]:r}},u),n=(a,r,u)=>e.mutateAsync({flags:{[a]:r}},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function q(){const{data:t}=c(K);return t??null}function K(t){return t.registry_config}function nt(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({registry_config:a},r),n=(a,r)=>e.mutateAsync({registry_config:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function st(){const{data:t}=c(Y);return t??null}function Y(t){return t.default_home_agents}function H(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({default_home_agents:a},r),n=(a,r)=>e.mutateAsync({default_home_agents:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function it(){const t=o.c(14),{org:e}=y(),s=H(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const a=M.useRef(i);let r;t[1]!==e.id?(r=_.organizationSettings(e.id),t[1]=e.id,t[2]=r):r=t[2];const u=r;let l;t[3]!==u||t[4]!==n?(l=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=l):l=t[5];const p=l;let d;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(d=b=>{const S=a.current.then(async()=>{const E=n.getQueryData(u),A=b(E?.default_home_agents?.ids??[]);if(A!==null){n.setQueryData(u,m=>m&&{...m,default_home_agents:{ids:A}});try{await s.mutateAsync({ids:A}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(m){const R=m;throw n.setQueryData(u,E),R}}});return a.current=S.catch(L),S},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=d):d=t[10];const h=d;let g;return t[11]!==h||t[12]!==p?(g={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=g):g=t[13],g}function L(){}function at(){const t=o.c(3),{data:e,isPending:s}=c(W),n=e??null;let i;return t[0]!==s||t[1]!==n?(i={mainAgentId:n,isPending:s},t[0]=s,t[1]=n,t[2]=i):i=t[2],i}function W(t){return t.main_agent_id??null}function rt(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({main_agent_id:a},r),n=(a,r)=>e.mutateAsync({main_agent_id:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function ut(){const t=o.c(5),{org:e}=y(),s=q();let n;t[0]!==e.id?(n=G.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let a;return t[2]!==i||t[3]!==s?(a=r=>{if(!s)return r===i;const u=s.registries[r];return u?u.enabled:r===i},t[2]=i,t[3]=s,t[4]=a):a=t[4],a}export{X as a,J as b,st as c,it as d,tt as e,at as f,ut as g,B as h,rt as i,V as j,q as k,et as l,nt as m,k as u};
1
+ import{c as o,H as y,o as T,aY as $,K as _,ac as z,p as I,e as D,r as M}from"./index-BoZ9u4m1.js";import{W as G}from"./constants-dLUUoWH7.js";import{d as P,o as Q,r as C}from"./task-board-C_FiCg7o.js";const O={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},w={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...O,organizationId:e}}},staleTime:6e4}}function c(t){const e=o.c(6),{org:s}=y();let n;e[0]!==s.id||e[1]!==s.slug?(n=N(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let a;return e[3]!==n||e[4]!==i?(a={...n,select:i},e[3]=n,e[4]=i,e[5]=a):a=e[5],T(a)}function B(t,e){const s=o.c(3);let n;s[0]!==t||s[1]!==e?(n=N(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=T(n);return i??null}function f(){const t=o.c(9),{org:e}=y(),s=z(),n=I();let i;t[0]!==e||t[1]!==s?(i=async u=>{const l=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!l)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return l},t[0]=e,t[1]=s,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n?(a=u=>{n.setQueryData(_.organizationSettings(e.id),l=>({...l??O,...u}))},t[3]=e,t[4]=n,t[5]=a):a=t[5];let r;return t[6]!==i||t[7]!==a?(r={mutationFn:i,onSuccess:a},t[6]=i,t[7]=a,t[8]=r):r=t[8],D(r)}function F(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:w}function J(){const{data:t}=c(U);return t??w}function U(t){return F(t.simple_mode)}function V(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({simple_mode:a},r),n=(a,r)=>e.mutateAsync({simple_mode:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function X(){return k("reports_only")}function k(t){const e=o.c(5);let s;e[0]!==t?(s=a=>Q(a.flags,t),e[0]=t,e[1]=s):s=e[1];const{data:n}=c(s);let i;return e[2]!==n||e[3]!==t?(i=n??P.has(t),e[2]=n,e[3]=t,e[4]=i):i=e[4],i}function tt(){const{data:t}=c(x);return t??!0}function x(t){return C(t.flags)}function et(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r,u)=>e.mutate({flags:{[a]:r}},u),n=(a,r,u)=>e.mutateAsync({flags:{[a]:r}},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function q(){const{data:t}=c(K);return t??null}function K(t){return t.registry_config}function nt(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({registry_config:a},r),n=(a,r)=>e.mutateAsync({registry_config:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function st(){const{data:t}=c(Y);return t??null}function Y(t){return t.default_home_agents}function H(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({default_home_agents:a},r),n=(a,r)=>e.mutateAsync({default_home_agents:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function it(){const t=o.c(14),{org:e}=y(),s=H(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const a=M.useRef(i);let r;t[1]!==e.id?(r=_.organizationSettings(e.id),t[1]=e.id,t[2]=r):r=t[2];const u=r;let l;t[3]!==u||t[4]!==n?(l=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=l):l=t[5];const p=l;let d;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(d=b=>{const S=a.current.then(async()=>{const E=n.getQueryData(u),A=b(E?.default_home_agents?.ids??[]);if(A!==null){n.setQueryData(u,m=>m&&{...m,default_home_agents:{ids:A}});try{await s.mutateAsync({ids:A}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(m){const R=m;throw n.setQueryData(u,E),R}}});return a.current=S.catch(L),S},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=d):d=t[10];const h=d;let g;return t[11]!==h||t[12]!==p?(g={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=g):g=t[13],g}function L(){}function at(){const t=o.c(3),{data:e,isPending:s}=c(W),n=e??null;let i;return t[0]!==s||t[1]!==n?(i={mainAgentId:n,isPending:s},t[0]=s,t[1]=n,t[2]=i):i=t[2],i}function W(t){return t.main_agent_id??null}function rt(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({main_agent_id:a},r),n=(a,r)=>e.mutateAsync({main_agent_id:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function ut(){const t=o.c(5),{org:e}=y(),s=q();let n;t[0]!==e.id?(n=G.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let a;return t[2]!==i||t[3]!==s?(a=r=>{if(!s)return r===i;const u=s.registries[r];return u?u.enabled:r===i},t[2]=i,t[3]=s,t[4]=a):a=t[4],a}export{X as a,J as b,st as c,it as d,tt as e,at as f,ut as g,B as h,rt as i,V as j,q as k,et as l,nt as m,k as u};