decocms 4.572.0 → 4.574.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. package/dist/client/assets/{AlertCircle-kYtqXGU8.js → AlertCircle-Co3RPbIZ.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DDNkWSZu.js → AreaChart-BvS2pAoE.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-B1m5qQi9.js → ArrowLeft-XBSBGQal.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DcYpepHk.js → ArrowUp-DLnkUu9S.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-BfCEFz3y.js → CartesianChart-DOb1QHVF.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-Bp-vLaQf.js → CategoricalChart-BkeCXQf9.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-B4NfGYxe.js → CheckCircle-kNwBDDVU.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-EqyUOMMk.js → ChevronSelectorVertical-Gg7YcxlH.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DRG0w_P4.js → ChevronUp-D1T3kSyr.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-BLl0RgXC.js → CreditCard01-D65BAIaV.js} +1 -1
  11. package/dist/client/assets/{Globe04--FaZazgw.js → Globe04-D17A2x5l.js} +1 -1
  12. package/dist/client/assets/{Key01-D0Pq98hT.js → Key01-awxHKnoL.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-C9GtmpYY.js → LinkBroken01-loTkm0G5.js} +1 -1
  14. package/dist/client/assets/{Minus-eGpg4-RN.js → Minus-CYrsmoRb.js} +1 -1
  15. package/dist/client/assets/{Monitor01-Su614Ctg.js → Monitor01-DalIAdj7.js} +1 -1
  16. package/dist/client/assets/{Play-D_ph4pZ0.js → Play-C6Weq-wk.js} +1 -1
  17. package/dist/client/assets/{Plus-D8rFucQH.js → Plus-D7X8Q2-q.js} +1 -1
  18. package/dist/client/assets/{ReferenceLine-BsZk9TgE.js → ReferenceLine-HGyXAqMo.js} +1 -1
  19. package/dist/client/assets/{SearchMd-2MPq0KPN.js → SearchMd-e6xPeRPD.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-DDCYsqx9.js → ShoppingBag01-zloi0TDl.js} +1 -1
  21. package/dist/client/assets/{Sun-Dvv08Urq.js → Sun-C1lyqton.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-D7HAXgYP.js → SwitchHorizontal01-elXb4-4d.js} +1 -1
  23. package/dist/client/assets/{Tool01-BTDYOKsB.js → Tool01-Bo2g-Ylw.js} +1 -1
  24. package/dist/client/assets/{Tooltip-CPoCGNVz.js → Tooltip-C2g-R1Ae.js} +1 -1
  25. package/dist/client/assets/{Trash01-CHCe7_6o.js → Trash01-C-PU5Hm-.js} +1 -1
  26. package/dist/client/assets/{Upload01-Q6ECKQXp.js → Upload01-NPnXKs-J.js} +1 -1
  27. package/dist/client/assets/{UserSquare-BJHrMhrM.js → UserSquare-Qd-FKVqK.js} +1 -1
  28. package/dist/client/assets/{Users01-DHfg9AEk.js → Users01-CTNixqdX.js} +1 -1
  29. package/dist/client/assets/{XClose-BDiB_Nvo.js → XClose-BuJ6u6eL.js} +1 -1
  30. package/dist/client/assets/{Zap-DpvU6Dp2.js → Zap-pmN7zSOE.js} +1 -1
  31. package/dist/client/assets/{access-gate-BjRwuLrP.js → access-gate-Bj4L1Bay.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-Bh0vHlQ5.js → add-connection-dialog-BL3Uj9Py.js} +1 -1
  33. package/dist/client/assets/agent-app-C3J9IT10.js +1 -0
  34. package/dist/client/assets/agent-assets-CvnH7aBA.js +1 -0
  35. package/dist/client/assets/{agent-automation-C1Vdho1R.js → agent-automation-Bea1eB6T.js} +3 -3
  36. package/dist/client/assets/agent-automations-R-Eaz2To.js +1 -0
  37. package/dist/client/assets/agent-calendar-Cd8km6Ln.js +1 -0
  38. package/dist/client/assets/{agent-capabilities-C80Nj8dH.js → agent-capabilities-BGShibnD.js} +1 -1
  39. package/dist/client/assets/agent-connect-sources-BrM4y83H.js +1 -0
  40. package/dist/client/assets/agent-deck-DRKoTD-S.js +1 -0
  41. package/dist/client/assets/agent-e2e-BuKHozb1.js +1 -0
  42. package/dist/client/assets/agent-experiments-CgtwbbvZ.js +1 -0
  43. package/dist/client/assets/agent-file-wlYMcv_9.js +1 -0
  44. package/dist/client/assets/agent-hosting-BaITgwKU.js +1 -0
  45. package/dist/client/assets/{agent-icon-DqjTL3cE.js → agent-icon-CTbTFMnU.js} +1 -1
  46. package/dist/client/assets/agent-library-CC7Sh_px.js +1 -0
  47. package/dist/client/assets/agent-library-file-DB9_i_YI.js +1 -0
  48. package/dist/client/assets/agent-overview-BkJ7Az2Q.js +1 -0
  49. package/dist/client/assets/agent-releases-Dh0xH2nd.js +2 -0
  50. package/dist/client/assets/agent-settings-B8F88lFa.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-gGRvmvu9.js → agent-site-editor-D_QBdAc9.js} +2 -2
  52. package/dist/client/assets/agent-site-editor-code-TQZ-nnUV.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-CAE4z8AF.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-gLgYeQTA.js +1 -0
  55. package/dist/client/assets/{agent-view-guard-Bppi7Mra.js → agent-view-guard-CL3qLzE2.js} +1 -1
  56. package/dist/client/assets/agent-view-mJs78en_.js +1 -0
  57. package/dist/client/assets/{ai-providers-JXuyHqZ0.js → ai-providers-CKuZmBiu.js} +1 -1
  58. package/dist/client/assets/{alert-Cddl0pAs.js → alert-wYcDlQSf.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-DFGgGKah.js → analytics-sections-BjzpdbBT.js} +1 -1
  60. package/dist/client/assets/api-keys-BtDMAyj2.js +1 -0
  61. package/dist/client/assets/{api-keys-CyRPnxt1.js → api-keys-am7hNPgd.js} +1 -1
  62. package/dist/client/assets/app-editor-D88RxUP1.js +1 -0
  63. package/dist/client/assets/{asset-utils-Cekn7DV3.js → asset-utils-C5mv1eiH.js} +1 -1
  64. package/dist/client/assets/{auth-qAWEiaXq.js → auth-CQxDIkM-.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-BEu29rgq.js → auth-catchall-DX0dhfK_.js} +1 -1
  66. package/dist/client/assets/{auth-entry-C-rkFm2s.js → auth-entry-Bkznmv5L.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-E78PPbPV.js → auth-split-layout-BRZioxOZ.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-D7iMHNSW.js → authenticate-and-persist-oauth-o7XKLq_6.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-guzwZg5A.js → automation-list-row-knBDKeRb.js} +1 -1
  70. package/dist/client/assets/{automation-runs-BHP_sOU-.js → automation-runs-CvC4BqLv.js} +1 -1
  71. package/dist/client/assets/{automations-BgweD4e5.js → automations-Ajx2woko.js} +1 -1
  72. package/dist/client/assets/{autosend-_WPHuuuS.js → autosend-B0POegpm.js} +1 -1
  73. package/dist/client/assets/{badge-DtxRsHGH.js → badge-BpzeYR5Z.js} +1 -1
  74. package/dist/client/assets/{block-document-CT7wSVO4.js → block-document-DIhkVhEf.js} +1 -1
  75. package/dist/client/assets/{blocks-preview-workspace-context-BoHWp5NJ.js → blocks-preview-workspace-context-BnkXYZX_.js} +1 -1
  76. package/dist/client/assets/{blocks-tab-states-2A_KUVRA.js → blocks-tab-states-BRjgrPty.js} +1 -1
  77. package/dist/client/assets/{blog-schema-DyhIMTKN.js → blog-schema-BdMdKJFM.js} +1 -1
  78. package/dist/client/assets/{buckets-B6SQeYKj.js → buckets-C62arTZK.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc--GJGk9lj.js → build-improve-prompt-doc-DNVGwsoG.js} +1 -1
  80. package/dist/client/assets/{calendar-gF784tOB.js → calendar-SB5YBzj8.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-gokttFVD.js → capability-load-error-BkOUGX51.js} +1 -1
  82. package/dist/client/assets/category-editor-CozNeVRI.js +1 -0
  83. package/dist/client/assets/{chart-2s7SvZtT.js → chart-D-gatwT8.js} +1 -1
  84. package/dist/client/assets/{chat-context-aSjAR9mm.js → chat-context-PvP_Q1CV.js} +6 -6
  85. package/dist/client/assets/{chat-draft-C4Ql1o7U.js → chat-draft-C714j1Wd.js} +1 -1
  86. package/dist/client/assets/{checkbox-CBfkrmis.js → checkbox-Bk98t4UK.js} +1 -1
  87. package/dist/client/assets/{choose-editor-DOrF20ax.js → choose-editor-DmqmkbHo.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-B188GHrd.js → cli-auth-success-D4NODEkN.js} +1 -1
  89. package/dist/client/assets/{client-icons-CGEm3mRa.js → client-icons-WHlOXnmn.js} +1 -1
  90. package/dist/client/assets/cms-settings-editor-kiB9O6al.js +1 -0
  91. package/dist/client/assets/{cms-store-drafts-CSMnfrKb.js → cms-store-drafts-DEGbfccc.js} +1 -1
  92. package/dist/client/assets/collapsible-C7N88_dp.js +1 -0
  93. package/dist/client/assets/collection-detail-a6oC0bB8.js +1 -0
  94. package/dist/client/assets/{collection-display-button-CiexA8e6.js → collection-display-button-Dl9vfdLR.js} +1 -1
  95. package/dist/client/assets/{collection-search-iHJVqUHB.js → collection-search-Din8SB5Y.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-Dw3f1ge7.js → collection-table-wrapper-BYDcFi4z.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-Trcf-II9.js → collection-tabs-BJDa_4_F.js} +1 -1
  98. package/dist/client/assets/{combobox-DqTAA7CX.js → combobox-CVchGkTE.js} +1 -1
  99. package/dist/client/assets/{command-CtR4gjCr.js → command-DA2t4jTW.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-CMxxXZB8.js → companion-mcps-section-BKP3xr1j.js} +1 -1
  101. package/dist/client/assets/{config-BpJVAl-p.js → config-B1mE6oOL.js} +1 -1
  102. package/dist/client/assets/{connect-DjUzAPce.js → connect-CAAYdS8d.js} +2 -2
  103. package/dist/client/assets/{connect-layout-atO8SWTe.js → connect-layout-DUesEwTl.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-CpTTYi_l.js → connect-source-dialog-DQtWLoYH.js} +1 -1
  105. package/dist/client/assets/{connection-card-Dt4OQ0Zk.js → connection-card-CPhS4jEh.js} +1 -1
  106. package/dist/client/assets/{connection-detail-weWLbsDk.js → connection-detail-D0-sYPQS.js} +1 -1
  107. package/dist/client/assets/{connection-form-helpers-KX0UMFtC.js → connection-form-helpers-CRMRmqMW.js} +1 -1
  108. package/dist/client/assets/{connection-CZHWvxVM.js → connection-giFDA0-u.js} +1 -1
  109. package/dist/client/assets/{connection-slug-BQwcAWfG.js → connection-slug-DTdYIX0A.js} +1 -1
  110. package/dist/client/assets/{connections-i22Te-Si.js → connections-D-1tH9cf.js} +1 -1
  111. package/dist/client/assets/{content-tab-CxWiT9yK.js → content-tab-DH5bq_bz.js} +3 -3
  112. package/dist/client/assets/context-DK_qXRQL.js +1 -0
  113. package/dist/client/assets/{context-menu-CmlGLO8r.js → context-menu-CsBFFEsr.js} +1 -1
  114. package/dist/client/assets/{context-shell-PkAxZmyt.js → context-shell-l0daBgQ1.js} +3 -3
  115. package/dist/client/assets/{core.esm-DkzVh4mV.js → core.esm-tIHbtjKb.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-_VIsUUpV.js → create-organization-dialog-Dy6I2vcX.js} +1 -1
  117. package/dist/client/assets/{device-hint-CdtW8Ayx.js → device-hint-DslC2w9a.js} +1 -1
  118. package/dist/client/assets/discover-DzzEIO43.js +1 -0
  119. package/dist/client/assets/{domain-settings-BuPEVvED.js → domain-settings-Dq_m7HYl.js} +1 -1
  120. package/dist/client/assets/{drawer-ChCkx76W.js → drawer-BYGTIOoj.js} +1 -1
  121. package/dist/client/assets/{editor-classes-BNXGx3Ep.js → editor-classes-LFKjNX_0.js} +1 -1
  122. package/dist/client/assets/{editor-BKO3Ouyu.js → editor-x1lgFdfy.js} +1 -1
  123. package/dist/client/assets/{empty-state-ajQCApN0.js → empty-state-CH3GYanB.js} +1 -1
  124. package/dist/client/assets/{empty-state-DiGOrU7G.js → empty-state-CtwVPMDf.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-BUQKBcCh.js → experiments-tab-choice-DMVM7f3S.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-CTb_9Cpr.js → extract-connection-data-hvaA6rrK.js} +1 -1
  127. package/dist/client/assets/{feature-gate-DReJia4Z.js → feature-gate-ru6FBLZU.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-DbaCusI2.js → feature-paywall-eifo7eqe.js} +1 -1
  129. package/dist/client/assets/feedback-BqoIMOg7.js +1 -0
  130. package/dist/client/assets/file-explorer-Bgho9rLt.js +2 -0
  131. package/dist/client/assets/{file-preview-CO8Jx_5T.js → file-preview-BzUEEwEK.js} +1 -1
  132. package/dist/client/assets/{file-share-button-B1R4GS_L.js → file-share-button-CFBrVPAQ.js} +1 -1
  133. package/dist/client/assets/{file-type-icon-Bo3Nsgdh.js → file-type-icon-DM9o0Fkb.js} +1 -1
  134. package/dist/client/assets/{folder-icon-DHVgg162.js → folder-icon-DSGoR_x6.js} +1 -1
  135. package/dist/client/assets/{form-BhXakrt_.js → form-gd_hA5VT.js} +1 -1
  136. package/dist/client/assets/{general-BvxlAOrY.js → general-Cn8XvemK.js} +1 -1
  137. package/dist/client/assets/{github-icon-BBNizm_E.js → github-icon-BVy-v7gH.js} +1 -1
  138. package/dist/client/assets/home-C9onXt5U.js +1 -0
  139. package/dist/client/assets/{home-overview-6RI8kIqs.js → home-overview-DZBjDQoG.js} +1 -1
  140. package/dist/client/assets/{hosted-reconcile-C9_-UERm.js → hosted-reconcile-DNkBVm-1.js} +1 -1
  141. package/dist/client/assets/{icon-button-muPqJd-h.js → icon-button-Ze0c1pwp.js} +1 -1
  142. package/dist/client/assets/{index-Bcy7_FA1.js → index-B-T__H4R.js} +1 -1
  143. package/dist/client/assets/{index-B6_lV1vO.js → index-Bbmo8mh-.js} +1 -1
  144. package/dist/client/assets/{index-DhM4mrtt.js → index-Bgxp_wDH.js} +1 -1
  145. package/dist/client/assets/index-BkJtJQz4.css +1 -0
  146. package/dist/client/assets/{index-TupjNSVk.js → index-C3XZ4Hr3.js} +2 -2
  147. package/dist/client/assets/{index-BRwiTdyd.js → index-CQQpem-0.js} +1 -1
  148. package/dist/client/assets/{index-8ANyj4B7.js → index-CnOVjrIG.js} +1 -1
  149. package/dist/client/assets/{index-GYpV5EH9.js → index-D5i1_B2b.js} +1 -1
  150. package/dist/client/assets/{index-878qqrH2.js → index-D8y5KFA4.js} +1 -1
  151. package/dist/client/assets/index-DB454549.js +1 -0
  152. package/dist/client/assets/{index-CcqLnTyv.js → index-DEZ1imMJ.js} +41 -41
  153. package/dist/client/assets/{index-DCh3kkGn.js → index-DYgzDE_k.js} +1 -1
  154. package/dist/client/assets/{index-BlAiq0AL.js → index-DkhsKOTp.js} +1 -1
  155. package/dist/client/assets/{index-D146teOp.js → index-DsbWutG1.js} +1 -1
  156. package/dist/client/assets/index-Kbjjvu85.js +1 -0
  157. package/dist/client/assets/{index-n9xCS6Sf.js → index-_l1iac4T.js} +1 -1
  158. package/dist/client/assets/{index-QDvBZCSy.js → index-i75UpmlW.js} +1 -1
  159. package/dist/client/assets/{index-redirect-BUCPvmVN.js → index-redirect-BbZ_bzp6.js} +1 -1
  160. package/dist/client/assets/{infiniteQueryObserver-uDA4YvYL.js → infiniteQueryObserver-C0Gb02df.js} +1 -1
  161. package/dist/client/assets/{infra-billing-Bql8vBuZ.js → infra-billing-BCVZN9OG.js} +1 -1
  162. package/dist/client/assets/{input-COtL628i.js → input-CxHdmxHa.js} +1 -1
  163. package/dist/client/assets/{input-BDAmWj4c.js → input-Dla4T1vA.js} +4 -4
  164. package/dist/client/assets/{integration-icon-ChQEBlMz.js → integration-icon-CFHOt7sY.js} +1 -1
  165. package/dist/client/assets/{jira-icon-CJhoZQuc.js → jira-icon-_AEc9Yhw.js} +1 -1
  166. package/dist/client/assets/{label-CsfAEF08.js → label-BEWDSeNl.js} +1 -1
  167. package/dist/client/assets/{layout-B-LTaCR7.js → layout--y8zVnrP.js} +1 -1
  168. package/dist/client/assets/legacy-admin-welcome-dialog-B223MrIf.js +1 -0
  169. package/dist/client/assets/{legacy-agents-deep-B3LnX3dE.js → legacy-agents-deep-PO1FuZ04.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-KlovZkVM.js → legacy-main-redirect-CLP7AoCb.js} +1 -1
  171. package/dist/client/assets/library-Cx1S-GVi.js +1 -0
  172. package/dist/client/assets/{library-tab-DdqY20-1.js → library-tab-CqMcp5u0.js} +1 -1
  173. package/dist/client/assets/login-BuRZE0OR.js +1 -0
  174. package/dist/client/assets/{markdown-CPuTm6Mv.js → markdown-Db8a3LUX.js} +1 -1
  175. package/dist/client/assets/{mcp-app-renderer-Cigj7X9N.js → mcp-app-renderer-C8G6NLBz.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-ChfuZkYU.js → mcp-oauth-BBT3ip6Z.js} +1 -1
  177. package/dist/client/assets/{mcp-oauth-BU_Qloaj.js → mcp-oauth-CHmbtYyN.js} +1 -1
  178. package/dist/client/assets/{members-BDBxWp17.js → members-CF1S2ayK.js} +1 -1
  179. package/dist/client/assets/{memory-B9jEAxkU.js → memory-Bk61fr1m.js} +2 -2
  180. package/dist/client/assets/mock-board-CYJBKLD5.js +10 -0
  181. package/dist/client/assets/{monaco-editor-XS1Vx7aB.js → monaco-editor-DTwBEUg_.js} +1 -1
  182. package/dist/client/assets/{monitoring-B3WSTrVO.js → monitoring-Cqe9DCsk.js} +2 -2
  183. package/dist/client/assets/{monitoring-stats-row-CuWemrnJ.js → monitoring-stats-row-GkTmJnnE.js} +1 -1
  184. package/dist/client/assets/{multi-select-C2R3RZPE.js → multi-select-GRYee_BH.js} +1 -1
  185. package/dist/client/assets/{mustache-ByRkTjky.js → mustache-DtDLolVD.js} +1 -1
  186. package/dist/client/assets/{named-rule-view-D9J5jfxv.js → named-rule-view-BNwXQD8T.js} +1 -1
  187. package/dist/client/assets/{new-project-dialog-C_1Rs0SG.js → new-project-dialog-Dfe2Pik9.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-Du4CoqhX.js → oauth-callback-C9LKZChW.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-CGOatJwS.js → oauth-callback-ai-provider-C7LWQiJX.js} +1 -1
  190. package/dist/client/assets/{oauth-consent-DP5dM3Bl.js → oauth-consent-Dm4zOEtc.js} +1 -1
  191. package/dist/client/assets/{onboarding-CNJgq5g8.js → onboarding-xP-6CuuS.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-RmvHRGWP.js → openai-conversation-BH1GqT3q.js} +2 -2
  193. package/dist/client/assets/{optimistic-project-sidebar-views-BF6tqK9w.js → optimistic-project-sidebar-views-BcV4r24I.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-Cs26_K8M.js → order-monitor-day-BrCrwZlv.js} +1 -1
  195. package/dist/client/assets/{organization-choice-Bntbf3d6.js → organization-choice-Bb3OozNa.js} +1 -1
  196. package/dist/client/assets/{orgs-CGfTnYKc.js → orgs-BwWx4Gpo.js} +1 -1
  197. package/dist/client/assets/{own-accounts-section-Dv_Ox_cI.js → own-accounts-section-CL57nUX5.js} +1 -1
  198. package/dist/client/assets/{pair-h0916MQd.js → pair-D5JEvK2M.js} +7 -7
  199. package/dist/client/assets/{parse-sections-BhaTg9vA.js → parse-sections-Ca4qHQSq.js} +3 -3
  200. package/dist/client/assets/{plan-ladder-BLc0_1i8.js → plan-ladder-DdqVPKf9.js} +1 -1
  201. package/dist/client/assets/plan-q4Vm_z4g.js +1 -0
  202. package/dist/client/assets/{plan-usage-card-DWVVT2WQ.js → plan-usage-card-397aTXRB.js} +2 -2
  203. package/dist/client/assets/{popover-BQnTqyWU.js → popover-DsvzKyw_.js} +1 -1
  204. package/dist/client/assets/post-calendar-CvHtHQHg.js +1 -0
  205. package/dist/client/assets/{post-editor-B1Q3Pcgn.js → post-editor-0bthmrQK.js} +2 -2
  206. package/dist/client/assets/{preview-content-DHz0okBk.js → preview-content-Bs_qZ8yA.js} +1 -1
  207. package/dist/client/assets/{preview-dialog-geLovY3F.js → preview-dialog-Bn3JJkpc.js} +1 -1
  208. package/dist/client/assets/{preview-panel-5qTld6rM.js → preview-panel-CX3l3cru.js} +1 -1
  209. package/dist/client/assets/{preview-tab-DTmM7FWc.js → preview-tab-C506bsNP.js} +3 -3
  210. package/dist/client/assets/{product-picker-dialog-CkKwZuBF.js → product-picker-dialog-DRJETx9Q.js} +1 -1
  211. package/dist/client/assets/{profile-DDg9c8sx.js → profile-BlRaDfot.js} +1 -1
  212. package/dist/client/assets/project-app-view-CKUZlcwf.js +1 -0
  213. package/dist/client/assets/{project-apps-sFKq8oaX.js → project-apps-B_xWF85u.js} +1 -1
  214. package/dist/client/assets/{project-icon-BlOLnUr2.js → project-icon-rrJh6PJx.js} +1 -1
  215. package/dist/client/assets/{project-index-C12cl71J.js → project-index-CoA3rtsT.js} +1 -1
  216. package/dist/client/assets/project-reports-bT7h-_SM.js +1 -0
  217. package/dist/client/assets/project-tasks-CqL0-1p3.js +1 -0
  218. package/dist/client/assets/{projects-APtBmhWY.js → projects-CM1tg94T.js} +1 -1
  219. package/dist/client/assets/{projects-empty-state-B_-RYmNY.js → projects-empty-state-llpcLXG9.js} +1 -1
  220. package/dist/client/assets/{prompts-rGT4H9HS.js → prompts-B0OAMamK.js} +1 -1
  221. package/dist/client/assets/record-editor-fYL_geiT.js +1 -0
  222. package/dist/client/assets/redirect-editor-CqeB0Mu0.js +1 -0
  223. package/dist/client/assets/reports-CtLMPNBD.js +1 -0
  224. package/dist/client/assets/{reports-B5SaRV3H.js → reports-Rgui-AzR.js} +1 -1
  225. package/dist/client/assets/{reports-onboarding-C3O3uPM5.js → reports-onboarding-Bb3vI6W8.js} +1 -1
  226. package/dist/client/assets/reports-tab-BaN84XaS.js +2 -0
  227. package/dist/client/assets/repositories-DR2_ORl-.js +1 -0
  228. package/dist/client/assets/{repositories-EzK0gp8T.js → repositories-OwZ7bC1j.js} +1 -1
  229. package/dist/client/assets/{repository-binding-CuR-5wbj.js → repository-binding-C0msapZZ.js} +1 -1
  230. package/dist/client/assets/{repository-picker-DEa_L5X-.js → repository-picker-BYFeDBpn.js} +1 -1
  231. package/dist/client/assets/{require-capability-s4T8ky9G.js → require-capability-cQiPB2TO.js} +1 -1
  232. package/dist/client/assets/{required-auth-layout-BnfTNype.js → required-auth-layout-DfUx9vzb.js} +1 -1
  233. package/dist/client/assets/{reset-password-DyQQJ8dn.js → reset-password-CwNbLDfo.js} +1 -1
  234. package/dist/client/assets/{resizable-G0IV9sBv.js → resizable-CHI5UJHW.js} +1 -1
  235. package/dist/client/assets/resolve-tab-icon-BWeUUKzK.js +1 -0
  236. package/dist/client/assets/review-settings-DUhDHWEg.js +1 -0
  237. package/dist/client/assets/{role-color-DsX-V5ks.js → role-color-DlPdNUQM.js} +1 -1
  238. package/dist/client/assets/{roles-Dx9qwbnQ.js → roles-ChXNdo9W.js} +1 -1
  239. package/dist/client/assets/route-8zXp8Zmg.js +1 -0
  240. package/dist/client/assets/route-DW6RzQLd.js +1 -0
  241. package/dist/client/assets/route-oGUs3Dt9.js +1 -0
  242. package/dist/client/assets/{sandbox-lifecycle-context-BbXRjeM5.js → sandbox-lifecycle-context-WXIR2CMZ.js} +1 -1
  243. package/dist/client/assets/{schema-D4ZSsKIV.js → schema-9jBUPMLq.js} +1 -1
  244. package/dist/client/assets/{schema-DyZV-W0g.js → schema-BFmIytlm.js} +1 -1
  245. package/dist/client/assets/{scroll-area-Dc2A2LkE.js → scroll-area-CQ_g6hBm.js} +1 -1
  246. package/dist/client/assets/search-input-Co3g-t6C.js +1 -0
  247. package/dist/client/assets/{search-toggle-B9QbSQeA.js → search-toggle-CO5TN956.js} +1 -1
  248. package/dist/client/assets/{secret-picker-DmxIms9y.js → secret-picker-VlsiGxPi.js} +1 -1
  249. package/dist/client/assets/{secrets-AGU75gav.js → secrets-DJboETC0.js} +1 -1
  250. package/dist/client/assets/{section-array-field-ClWKGp_4.js → section-array-field-CvmfLv3q.js} +1 -1
  251. package/dist/client/assets/{sections-BVT_1GZf.js → sections-C_Jmzzpn.js} +1 -1
  252. package/dist/client/assets/sections-editor-D1U5_lZq.js +1 -0
  253. package/dist/client/assets/{select-DQqbq83t.js → select-BJaUvbIR.js} +1 -1
  254. package/dist/client/assets/{select-model-DrY_3vXN.js → select-model-CftP-ks_.js} +1 -1
  255. package/dist/client/assets/{seo-editor-BlBhyBAl.js → seo-editor-B6UrHPko.js} +1 -1
  256. package/dist/client/assets/{separator-C0H8Yj6d.js → separator-BXKmXRi8.js} +1 -1
  257. package/dist/client/assets/settings-tab-CHBeACws.js +1 -0
  258. package/dist/client/assets/{sheet-B2jsXlHJ.js → sheet-D2hfPw7P.js} +1 -1
  259. package/dist/client/assets/shell-layout-BLRNx2fV.js +1 -0
  260. package/dist/client/assets/{site-draft-actions-CD85gRfI.js → site-draft-actions-5nXph2SS.js} +3 -3
  261. package/dist/client/assets/{site-draft-view-D0hJTk9N.js → site-draft-view-3CfqUHrV.js} +1 -1
  262. package/dist/client/assets/site-editor-BqlLTFw0.js +1 -0
  263. package/dist/client/assets/{site-editor-toast-CIOA7Zq3.js → site-editor-toast-Cgezu0A5.js} +1 -1
  264. package/dist/client/assets/skills-B_05tfLr.js +1 -0
  265. package/dist/client/assets/{slider-84yNNCUP.js → slider-C6h9g0cI.js} +1 -1
  266. package/dist/client/assets/{sortable.esm-BHALCXRV.js → sortable.esm-D2_ALuVf.js} +1 -1
  267. package/dist/client/assets/{sso-6pnL0iJa.js → sso-CtTl7KnN.js} +1 -1
  268. package/dist/client/assets/{suggestion-C3enCUG8.js → suggestion-C8VoNVDk.js} +2 -2
  269. package/dist/client/assets/super-agent-icon-B-73GF60.js +1 -0
  270. package/dist/client/assets/{switch-2cMTOO8e.js → switch-C53DVv3y.js} +1 -1
  271. package/dist/client/assets/{synced-repos-bmkfQV3e.js → synced-repos-Cqz-evGv.js} +1 -1
  272. package/dist/client/assets/{tab-icon-glyph-lzQzl_Ov.js → tab-icon-glyph-I3aa1qRZ.js} +1 -1
  273. package/dist/client/assets/{table-DvZCTg5z.js → table-DjgVXWdP.js} +1 -1
  274. package/dist/client/assets/{tabs-BzwzpfZ1.js → tabs-DtOFAaIp.js} +1 -1
  275. package/dist/client/assets/{task-board-DcTNURQy.js → task-board-D3wT6_aG.js} +1 -1
  276. package/dist/client/assets/{task-route-DfbZq1yE.js → task-route-DngvTiyh.js} +1 -1
  277. package/dist/client/assets/{task-status-CxLWWnTs.js → task-status-BfFZ6nf8.js} +1 -1
  278. package/dist/client/assets/taskboard-analytics-D-vAg9Px.js +1 -0
  279. package/dist/client/assets/{tasks-CzV2b6I-.js → tasks-BHa2qCWg.js} +3 -3
  280. package/dist/client/assets/tasks-adXvugV8.js +1 -0
  281. package/dist/client/assets/{textarea-CpPhDLVU.js → textarea-_jcGqOvl.js} +1 -1
  282. package/dist/client/assets/thread-analytics-DPDga_ap.js +1 -0
  283. package/dist/client/assets/{thread-intent-pegObLq9.js → thread-intent-DuI80508.js} +1 -1
  284. package/dist/client/assets/{thread-route-D5E5K-lU.js → thread-route-B-uAlF3E.js} +1 -1
  285. package/dist/client/assets/{thread-route-DORnlP1l.js → thread-route-Ci8rIker.js} +1 -1
  286. package/dist/client/assets/{thread-sheet-body-BFBUt-Sx.js → thread-sheet-body-BiNfUUQ_.js} +1 -1
  287. package/dist/client/assets/{time-range-picker-CO070soZ.js → time-range-picker-F9SEOG2b.js} +1 -1
  288. package/dist/client/assets/{toggle-group-D9bXIbAb.js → toggle-group-C6oiEKlf.js} +1 -1
  289. package/dist/client/assets/{tool-namespace-BQSaNq7N.js → tool-namespace-DdU5nhii.js} +1 -1
  290. package/dist/client/assets/{tool-set-selector-DM-ejAZy.js → tool-set-selector-2nfgy8us.js} +1 -1
  291. package/dist/client/assets/{toolbar-icon-button-CTRAa2ng.js → toolbar-icon-button-BmJKmAUK.js} +1 -1
  292. package/dist/client/assets/{tooltip-AKf-E49i.js → tooltip-Dam-ym8O.js} +1 -1
  293. package/dist/client/assets/{tooltipContext-C6xZbBgY.js → tooltipContext-PzKiic-J.js} +1 -1
  294. package/dist/client/assets/{track-ClB7tKVt.js → track-Dj7QHX2C.js} +1 -1
  295. package/dist/client/assets/{types-BQOtvCBo.js → types-gyofjZHf.js} +6 -6
  296. package/dist/client/assets/{url-slug-ihGFL5bo.js → url-slug-BMHzx0XY.js} +1 -1
  297. package/dist/client/assets/{usage-stats-CVX23WNU.js → usage-stats-C3KvQP9T.js} +1 -1
  298. package/dist/client/assets/{use-ai-providers-BrqJh5BT.js → use-ai-providers-DwpUgHpj.js} +1 -1
  299. package/dist/client/assets/{use-apply-named-rule-BVdRelp-.js → use-apply-named-rule-BnEs0jP7.js} +1 -1
  300. package/dist/client/assets/use-ask-in-chat-BIANNd7Z.js +1 -0
  301. package/dist/client/assets/{use-automations-B64sqUmg.js → use-automations-CyrAu8XA.js} +1 -1
  302. package/dist/client/assets/{use-autosave-CXs3BFTf.js → use-autosave-TV-hF63e.js} +1 -1
  303. package/dist/client/assets/use-blocks-v8-project-4PZwWSEO.js +1 -0
  304. package/dist/client/assets/{use-chat-layout-state-Be9vIJ9A.js → use-chat-layout-state-BG2-xqQp.js} +1 -1
  305. package/dist/client/assets/{use-cms-publish-actions-_yzMD1wJ.js → use-cms-publish-actions-CmQuU9AY.js} +5 -5
  306. package/dist/client/assets/{use-connect-companion-CB7F6AWc.js → use-connect-companion-CowVgnp9.js} +1 -1
  307. package/dist/client/assets/use-connection-BozgIoMu.js +1 -0
  308. package/dist/client/assets/{use-content-sync-D6gXnizV.js → use-content-sync-BBbOIir0.js} +1 -1
  309. package/dist/client/assets/{use-copy-CtSedmtg.js → use-copy-o0P-kroy.js} +1 -1
  310. package/dist/client/assets/{use-date-fns-locale-DQTvoMF-.js → use-date-fns-locale-bKU2Q73X.js} +1 -1
  311. package/dist/client/assets/{use-debounced-autosave-BLJ3k7wG.js → use-debounced-autosave-BmvZzlB_.js} +1 -1
  312. package/dist/client/assets/{use-debounced-value-CcMMD4Qy.js → use-debounced-value-yZdJ1f2K.js} +1 -1
  313. package/dist/client/assets/{use-deco-credits-C6qbWrOQ.js → use-deco-credits-Bjfx0bAt.js} +1 -1
  314. package/dist/client/assets/{use-decopilot-events-Dc1L96mp.js → use-decopilot-events-C_C16-Ln.js} +1 -1
  315. package/dist/client/assets/{use-delete-connection-Cw1Qu4uu.js → use-delete-connection-B4rX1qgg.js} +1 -1
  316. package/dist/client/assets/{use-deployment-admin-D9sSgOb1.js → use-deployment-admin-CS9K9Ea9.js} +1 -1
  317. package/dist/client/assets/{use-entitlements-BKF4jYfc.js → use-entitlements-DidlVdLU.js} +1 -1
  318. package/dist/client/assets/{use-fast-preview-draft-url-TUtYOptx.js → use-fast-preview-draft-url-KJzyk03O.js} +1 -1
  319. package/dist/client/assets/{use-file-configs-D7-mFpqA.js → use-file-configs-DhXDYO83.js} +1 -1
  320. package/dist/client/assets/{use-id-selection-JEuFRU8t.js → use-id-selection-BHXFVfAt.js} +1 -1
  321. package/dist/client/assets/{use-inbox-feed-RrCfNvIm.js → use-inbox-feed-CKkWXum7.js} +1 -1
  322. package/dist/client/assets/{use-infinite-scroll-Z_9MLZyx.js → use-infinite-scroll-CED9GMTE.js} +1 -1
  323. package/dist/client/assets/{use-join-requests-CANHKzNj.js → use-join-requests-DAuosANz.js} +1 -1
  324. package/dist/client/assets/use-main-panel-tabs-DfOwinBC.js +1 -0
  325. package/dist/client/assets/{use-mcp-auth-status-CMC6AisX.js → use-mcp-auth-status-Dls0bLQE.js} +1 -1
  326. package/dist/client/assets/{use-mcp-client-DvDomB9A.js → use-mcp-client-DJjkIlNp.js} +1 -1
  327. package/dist/client/assets/{use-mcp-prompts-CgDM8qHG.js → use-mcp-prompts-it9pO2QZ.js} +1 -1
  328. package/dist/client/assets/{use-mcp-tools-mI5K7YKF.js → use-mcp-tools-wfurU0oX.js} +1 -1
  329. package/dist/client/assets/{use-mobile-BgN1E82d.js → use-mobile-CJITN8uI.js} +1 -1
  330. package/dist/client/assets/{use-move-blocks-CPMJkp5h.js → use-move-blocks-CC1C41-K.js} +1 -1
  331. package/dist/client/assets/{use-navigate-to-agent-DmfSMV3R.js → use-navigate-to-agent-MlXDIBYX.js} +1 -1
  332. package/dist/client/assets/{use-org-fs-BWA2rFQC.js → use-org-fs-BH012Up0.js} +1 -1
  333. package/dist/client/assets/{use-org-repo-syncs-CTHMawzN.js → use-org-repo-syncs-jV2kVf-q.js} +1 -1
  334. package/dist/client/assets/{use-org-sso-CGB_T6WF.js → use-org-sso-Bo72RJ5p.js} +1 -1
  335. package/dist/client/assets/{use-organization-settings-sxurgilE.js → use-organization-settings-bWX185lw.js} +1 -1
  336. package/dist/client/assets/{use-project-native-view-presence-CwgTlxOv.js → use-project-native-view-presence-DhhbOsoh.js} +1 -1
  337. package/dist/client/assets/use-project-scope-pwqcjGo8.js +1 -0
  338. package/dist/client/assets/{use-recent-apps-DD97o_H1.js → use-recent-apps-Rr1jTj-T.js} +1 -1
  339. package/dist/client/assets/{use-reports-diagnostic-BA9L8p6c.js → use-reports-diagnostic-0n4ScjpC.js} +1 -1
  340. package/dist/client/assets/{use-sandbox-events-CdAdPYjL.js → use-sandbox-events-D1_GHzsF.js} +1 -1
  341. package/dist/client/assets/{use-secrets-rjK8WMv5.js → use-secrets-Dim43C3b.js} +1 -1
  342. package/dist/client/assets/{use-section-preview-base-DcuAqWGB.js → use-section-preview-base-B6FS0lTt.js} +1 -1
  343. package/dist/client/assets/{use-sidebar-collapsed-B34u6RwD.js → use-sidebar-collapsed-DcAIYhdp.js} +1 -1
  344. package/dist/client/assets/{use-tags-0YxcWwJI.js → use-tags-6ljf50Kl.js} +1 -1
  345. package/dist/client/assets/{use-task-board-analytics-tpDvOzAs.js → use-task-board-analytics-5XuzJjLw.js} +1 -1
  346. package/dist/client/assets/{use-task-board-events-CGZxY00s.js → use-task-board-events-DnEp5edD.js} +1 -1
  347. package/dist/client/assets/{use-task-board-item-prs-B6YW8nsa.js → use-task-board-item-prs-CycVEDhs.js} +1 -1
  348. package/dist/client/assets/{use-task-board-items-BcL-6L6N.js → use-task-board-items-pvi4Vcv1.js} +1 -1
  349. package/dist/client/assets/{use-task-board-prompts-B9dDmO_e.js → use-task-board-prompts-CE5ytMaB.js} +1 -1
  350. package/dist/client/assets/{use-task-metadata-hgLXNv36.js → use-task-metadata-D4kXdUwO.js} +1 -1
  351. package/dist/client/assets/{use-thread-outputs-X5IsW797.js → use-thread-outputs-BPYn8k3d.js} +1 -1
  352. package/dist/client/assets/{use-voice-input-DmZaOhTZ.js → use-voice-input-BKZpbbiI.js} +1 -1
  353. package/dist/client/assets/useInfiniteQuery-CtNfxLxq.js +1 -0
  354. package/dist/client/assets/{useQueries-BbhbAWNG.js → useQueries-B3iHMIbL.js} +1 -1
  355. package/dist/client/assets/useSuspenseInfiniteQuery-OzDVxqdl.js +1 -0
  356. package/dist/client/assets/{users-BNwLmtY6.js → users-7Hqe-w13.js} +1 -1
  357. package/dist/client/assets/{utils-KeMhVvdQ.js → utils-BbEfYi1l.js} +1 -1
  358. package/dist/client/assets/{variant-calendar-VCJbhkWd.js → variant-calendar-vayISj1w.js} +1 -1
  359. package/dist/client/assets/{variant-matcher-override-DLQRivi9.js → variant-matcher-override-ulDJ4YBu.js} +1 -1
  360. package/dist/client/assets/{view-header-cnfShdRT.js → view-header-y27ISHbd.js} +1 -1
  361. package/dist/client/assets/{virtual-mcp-YmAa-VVd.js → virtual-mcp-vRvxAZ15.js} +1 -1
  362. package/dist/client/assets/{watch-sse-pool-CYcZM1HP.js → watch-sse-pool-DhoYakYc.js} +1 -1
  363. package/dist/client/index.html +2 -2
  364. package/dist/client/legacy-admin-welcome.webp +0 -0
  365. package/dist/server/server.js +528 -528
  366. package/package.json +1 -1
  367. package/dist/client/assets/agent-app-IWHPMxEK.js +0 -1
  368. package/dist/client/assets/agent-assets-BZWSLrfd.js +0 -1
  369. package/dist/client/assets/agent-automations-BOxoQlGs.js +0 -1
  370. package/dist/client/assets/agent-calendar-CdFd9RbD.js +0 -1
  371. package/dist/client/assets/agent-connect-sources-CEmlztKl.js +0 -1
  372. package/dist/client/assets/agent-deck-CtBABaGT.js +0 -1
  373. package/dist/client/assets/agent-e2e-CFF1rulz.js +0 -1
  374. package/dist/client/assets/agent-experiments-ui7FfvYG.js +0 -1
  375. package/dist/client/assets/agent-file-Cq3onOpE.js +0 -1
  376. package/dist/client/assets/agent-hosting-vCUxyXYf.js +0 -1
  377. package/dist/client/assets/agent-library-CrZB4N_E.js +0 -1
  378. package/dist/client/assets/agent-library-file-BOxLy0sn.js +0 -1
  379. package/dist/client/assets/agent-overview-BcgCBEmB.js +0 -1
  380. package/dist/client/assets/agent-releases-aYJGzx-T.js +0 -2
  381. package/dist/client/assets/agent-settings-CxJPBxUl.js +0 -1
  382. package/dist/client/assets/agent-site-editor-code-CLO4vASe.js +0 -2
  383. package/dist/client/assets/agent-site-editor-content-DwQjPdJR.js +0 -1
  384. package/dist/client/assets/agent-site-editor-preview-DVAXUJER.js +0 -1
  385. package/dist/client/assets/agent-view-BWBpZVUF.js +0 -1
  386. package/dist/client/assets/api-keys-G9chtY31.js +0 -1
  387. package/dist/client/assets/app-editor-XjHMyWR2.js +0 -1
  388. package/dist/client/assets/category-editor-DH5eEcV-.js +0 -1
  389. package/dist/client/assets/cms-settings-editor-CLowE0HB.js +0 -1
  390. package/dist/client/assets/collapsible-C6tkGF0M.js +0 -1
  391. package/dist/client/assets/collection-detail-EKABwIVL.js +0 -1
  392. package/dist/client/assets/context-BHoetvxj.js +0 -1
  393. package/dist/client/assets/discover-DylE9QvC.js +0 -1
  394. package/dist/client/assets/feedback-CVUSSdB5.js +0 -1
  395. package/dist/client/assets/file-explorer-CgN8XtEL.js +0 -2
  396. package/dist/client/assets/home-CppOBOPg.js +0 -1
  397. package/dist/client/assets/index-2LwpmkET.js +0 -1
  398. package/dist/client/assets/index-A822oipr.js +0 -1
  399. package/dist/client/assets/index-CKEKSTrk.css +0 -1
  400. package/dist/client/assets/library-B2C1_FfB.js +0 -1
  401. package/dist/client/assets/login-DRAz2Byx.js +0 -1
  402. package/dist/client/assets/mock-board-Bsls4MQk.js +0 -10
  403. package/dist/client/assets/plan-GL1imSbx.js +0 -1
  404. package/dist/client/assets/post-calendar-HNq1Smaq.js +0 -1
  405. package/dist/client/assets/project-app-view-BTrJDLFt.js +0 -1
  406. package/dist/client/assets/project-reports-AxUmLNIH.js +0 -1
  407. package/dist/client/assets/project-tasks-CAr2Cqy5.js +0 -1
  408. package/dist/client/assets/record-editor-Ci0iG6uP.js +0 -1
  409. package/dist/client/assets/redirect-editor-CMuoDESV.js +0 -1
  410. package/dist/client/assets/reports-D-qIr9kO.js +0 -1
  411. package/dist/client/assets/reports-tab-BU0ZPXc5.js +0 -2
  412. package/dist/client/assets/repositories-DcYP84R5.js +0 -1
  413. package/dist/client/assets/resolve-tab-icon-73RgcuQe.js +0 -1
  414. package/dist/client/assets/review-settings-CuOWj38_.js +0 -1
  415. package/dist/client/assets/route-BhRhH95H.js +0 -1
  416. package/dist/client/assets/route-CSMzYXoN.js +0 -1
  417. package/dist/client/assets/route-DyaXyBfS.js +0 -1
  418. package/dist/client/assets/search-input-DFXG_UYw.js +0 -1
  419. package/dist/client/assets/sections-editor-CYlxI1p5.js +0 -1
  420. package/dist/client/assets/settings-tab-DWTMFT0X.js +0 -1
  421. package/dist/client/assets/shell-layout-CBX9BtMX.js +0 -1
  422. package/dist/client/assets/site-editor-CWVoX5OY.js +0 -1
  423. package/dist/client/assets/skills-XkOrIlnS.js +0 -1
  424. package/dist/client/assets/taskboard-analytics-Cmr5hCm9.js +0 -1
  425. package/dist/client/assets/tasks-140YlmT4.js +0 -1
  426. package/dist/client/assets/thread-analytics-9huoP8m_.js +0 -1
  427. package/dist/client/assets/use-ask-in-chat-CtKzpyFU.js +0 -1
  428. package/dist/client/assets/use-blocks-v8-project-BPQNHFav.js +0 -1
  429. package/dist/client/assets/use-connection-CECJF8rf.js +0 -1
  430. package/dist/client/assets/use-main-panel-tabs-DA6Ypr8r.js +0 -1
  431. package/dist/client/assets/use-project-scope-Cb4T7-Pe.js +0 -1
  432. package/dist/client/assets/useInfiniteQuery-WRSkkanY.js +0 -1
  433. package/dist/client/assets/useSuspenseInfiniteQuery-B1s2URZC.js +0 -1
@@ -1 +1 @@
1
- import{c as le,b as oe,j as n,aH as X,aI as z,aJ as G,aK as V,bj as Z,aL as ee,aM as te,aN as ne,a5 as se,q as ie,ak as ce,r as re,t as W,ge as ae,hX as de,hY as fe}from"./index-CcqLnTyv.js";function ge(Q){const e=le.c(86),{deleteState:s,cancelDelete:r,confirmDelete:D,confirmForceDelete:a}=Q,t=oe(),b=s.mode==="deleting";let f;e[0]!==r?(f=P=>{P||r()},e[0]=r,e[1]=f):f=e[1];let d;e[2]!==t?(d=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=d):d=e[3];let C;e[4]!==d?(C=n.jsx(X,{children:d}),e[4]=d,e[5]=C):C=e[5];let u;e[6]!==t?(u=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=u):u=e[7];const J=s.mode==="deleting"&&s.connection.title;let h;e[8]!==J?(h=n.jsx("span",{className:"font-medium text-foreground",children:J}),e[8]=J,e[9]=h):h=e[9];let o;e[10]!==u||e[11]!==h?(o=n.jsxs(z,{children:[u," ",h,"."]}),e[10]=u,e[11]=h,e[12]=o):o=e[12];let l;e[13]!==C||e[14]!==o?(l=n.jsxs(G,{children:[C,o]}),e[13]=C,e[14]=o,e[15]=l):l=e[15];let i;e[16]!==t?(i=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=i):i=e[17];let m;e[18]!==i?(m=n.jsx(V,{children:i}),e[18]=i,e[19]=m):m=e[19];let c;e[20]!==t?(c=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=c):c=e[21];let g;e[22]!==D||e[23]!==c?(g=n.jsx(Z,{onClick:D,variant:"destructive",children:c}),e[22]=D,e[23]=c,e[24]=g):g=e[24];let x;e[25]!==m||e[26]!==g?(x=n.jsxs(ee,{children:[m,g]}),e[25]=m,e[26]=g,e[27]=x):x=e[27];let j;e[28]!==x||e[29]!==l?(j=n.jsxs(te,{children:[l,x]}),e[28]=x,e[29]=l,e[30]=j):j=e[30];let p;e[31]!==b||e[32]!==j||e[33]!==f?(p=n.jsx(ne,{open:b,onOpenChange:f,children:j}),e[31]=b,e[32]=j,e[33]=f,e[34]=p):p=e[34];const Y=s.mode==="force-deleting";let N;e[35]!==r?(N=P=>{P||r()},e[35]=r,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let T;e[39]!==E?(T=n.jsx(X,{children:E}),e[39]=E,e[40]=T):T=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const $=s.mode==="force-deleting"&&s.connection.title;let y;e[43]!==$?(y=n.jsx("span",{className:"font-medium text-foreground",children:$}),e[43]=$,e[44]=y):y=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const B=s.mode==="force-deleting"&&s.agentNames;let _;e[47]!==B?(_=n.jsx("span",{className:"font-medium text-foreground",children:B}),e[47]=B,e[48]=_):_=e[48];let A;e[49]!==O||e[50]!==y||e[51]!==S||e[52]!==_?(A=n.jsxs("p",{children:[O," ",y," ",S," ",_,"."]}),e[49]=O,e[50]=y,e[51]=S,e[52]=_,e[53]=A):A=e[53];let v;e[54]!==t?(v=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=v):v=e[55];let L;e[56]!==v?(L=n.jsx("p",{className:"mt-2",children:v}),e[56]=v,e[57]=L):L=e[57];let I;e[58]!==A||e[59]!==L?(I=n.jsx(z,{asChild:!0,children:n.jsxs("div",{children:[A,L]})}),e[58]=A,e[59]=L,e[60]=I):I=e[60];let F;e[61]!==T||e[62]!==I?(F=n.jsxs(G,{children:[T,I]}),e[61]=T,e[62]=I,e[63]=F):F=e[63];let R;e[64]!==t?(R=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=R):R=e[65];let q;e[66]!==R?(q=n.jsx(V,{children:R}),e[66]=R,e[67]=q):q=e[67];let U;e[68]!==t?(U=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=U):U=e[69];let H;e[70]!==a||e[71]!==U?(H=n.jsx(Z,{onClick:a,variant:"destructive",children:U}),e[70]=a,e[71]=U,e[72]=H):H=e[72];let K;e[73]!==q||e[74]!==H?(K=n.jsxs(ee,{children:[q,H]}),e[73]=q,e[74]=H,e[75]=K):K=e[75];let k;e[76]!==F||e[77]!==K?(k=n.jsxs(te,{children:[F,K]}),e[76]=F,e[77]=K,e[78]=k):k=e[78];let w;e[79]!==Y||e[80]!==N||e[81]!==k?(w=n.jsx(ne,{open:Y,onOpenChange:N,children:k}),e[79]=Y,e[80]=N,e[81]=k,e[82]=w):w=e[82];let M;return e[83]!==p||e[84]!==w?(M=n.jsxs(n.Fragment,{children:[p,w]}),e[83]=p,e[84]=w,e[85]=M):M=e[85],M}function De({onSuccess:Q}={}){const{org:e}=se(),s=ie(),r=ce(),D=oe(),[a,t]=re.useState({mode:"idle"}),b=()=>{ae(s,e.id)},f=o=>{de(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===fe&&l.queryKey[3]===o})},d=o=>{b(),f(o),W.success(D("orgs.connections.connectionDeleted")),t({mode:"idle"}),Q?.()};return{deleteState:a,requestDelete:o=>{t({mode:"deleting",connection:o})},cancelDelete:()=>{t({mode:"idle"})},confirmDelete:async()=>{if(a.mode!=="deleting")return;const o=a.connection;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),d(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const c=JSON.parse(m);if(c.code==="CONNECTION_IN_USE"&&c.agentNames){t({mode:"force-deleting",connection:o,agentNames:c.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}W.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}},confirmForceDelete:async()=>{if(a.mode!=="force-deleting")return;const o=a.connection.id;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),d(o)}catch(l){const i=l instanceof Error?l.message:String(l);W.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}}}}export{ge as D,De as u};
1
+ import{c as le,b as oe,j as n,aH as Z,aI as z,aJ as G,aK as V,bj as X,aL as ee,aM as te,aN as ne,a5 as se,q as ie,ak as ce,r as re,t as Y,gg as ae,hZ as de,h_ as fe}from"./index-DEZ1imMJ.js";function ge(Q){const e=le.c(86),{deleteState:s,cancelDelete:r,confirmDelete:D,confirmForceDelete:a}=Q,t=oe(),b=s.mode==="deleting";let f;e[0]!==r?(f=W=>{W||r()},e[0]=r,e[1]=f):f=e[1];let d;e[2]!==t?(d=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=d):d=e[3];let C;e[4]!==d?(C=n.jsx(Z,{children:d}),e[4]=d,e[5]=C):C=e[5];let u;e[6]!==t?(u=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=u):u=e[7];const J=s.mode==="deleting"&&s.connection.title;let h;e[8]!==J?(h=n.jsx("span",{className:"font-medium text-foreground",children:J}),e[8]=J,e[9]=h):h=e[9];let o;e[10]!==u||e[11]!==h?(o=n.jsxs(z,{children:[u," ",h,"."]}),e[10]=u,e[11]=h,e[12]=o):o=e[12];let l;e[13]!==C||e[14]!==o?(l=n.jsxs(G,{children:[C,o]}),e[13]=C,e[14]=o,e[15]=l):l=e[15];let i;e[16]!==t?(i=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=i):i=e[17];let m;e[18]!==i?(m=n.jsx(V,{children:i}),e[18]=i,e[19]=m):m=e[19];let c;e[20]!==t?(c=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=c):c=e[21];let g;e[22]!==D||e[23]!==c?(g=n.jsx(X,{onClick:D,variant:"destructive",children:c}),e[22]=D,e[23]=c,e[24]=g):g=e[24];let x;e[25]!==m||e[26]!==g?(x=n.jsxs(ee,{children:[m,g]}),e[25]=m,e[26]=g,e[27]=x):x=e[27];let j;e[28]!==x||e[29]!==l?(j=n.jsxs(te,{children:[l,x]}),e[28]=x,e[29]=l,e[30]=j):j=e[30];let p;e[31]!==b||e[32]!==j||e[33]!==f?(p=n.jsx(ne,{open:b,onOpenChange:f,children:j}),e[31]=b,e[32]=j,e[33]=f,e[34]=p):p=e[34];const $=s.mode==="force-deleting";let N;e[35]!==r?(N=W=>{W||r()},e[35]=r,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let T;e[39]!==E?(T=n.jsx(Z,{children:E}),e[39]=E,e[40]=T):T=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const B=s.mode==="force-deleting"&&s.connection.title;let y;e[43]!==B?(y=n.jsx("span",{className:"font-medium text-foreground",children:B}),e[43]=B,e[44]=y):y=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let _;e[47]!==P?(_=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=_):_=e[48];let A;e[49]!==O||e[50]!==y||e[51]!==S||e[52]!==_?(A=n.jsxs("p",{children:[O," ",y," ",S," ",_,"."]}),e[49]=O,e[50]=y,e[51]=S,e[52]=_,e[53]=A):A=e[53];let v;e[54]!==t?(v=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=v):v=e[55];let L;e[56]!==v?(L=n.jsx("p",{className:"mt-2",children:v}),e[56]=v,e[57]=L):L=e[57];let I;e[58]!==A||e[59]!==L?(I=n.jsx(z,{asChild:!0,children:n.jsxs("div",{children:[A,L]})}),e[58]=A,e[59]=L,e[60]=I):I=e[60];let F;e[61]!==T||e[62]!==I?(F=n.jsxs(G,{children:[T,I]}),e[61]=T,e[62]=I,e[63]=F):F=e[63];let R;e[64]!==t?(R=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=R):R=e[65];let q;e[66]!==R?(q=n.jsx(V,{children:R}),e[66]=R,e[67]=q):q=e[67];let U;e[68]!==t?(U=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=U):U=e[69];let H;e[70]!==a||e[71]!==U?(H=n.jsx(X,{onClick:a,variant:"destructive",children:U}),e[70]=a,e[71]=U,e[72]=H):H=e[72];let K;e[73]!==q||e[74]!==H?(K=n.jsxs(ee,{children:[q,H]}),e[73]=q,e[74]=H,e[75]=K):K=e[75];let k;e[76]!==F||e[77]!==K?(k=n.jsxs(te,{children:[F,K]}),e[76]=F,e[77]=K,e[78]=k):k=e[78];let w;e[79]!==$||e[80]!==N||e[81]!==k?(w=n.jsx(ne,{open:$,onOpenChange:N,children:k}),e[79]=$,e[80]=N,e[81]=k,e[82]=w):w=e[82];let M;return e[83]!==p||e[84]!==w?(M=n.jsxs(n.Fragment,{children:[p,w]}),e[83]=p,e[84]=w,e[85]=M):M=e[85],M}function De({onSuccess:Q}={}){const{org:e}=se(),s=ie(),r=ce(),D=oe(),[a,t]=re.useState({mode:"idle"}),b=()=>{ae(s,e.id)},f=o=>{de(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===fe&&l.queryKey[3]===o})},d=o=>{b(),f(o),Y.success(D("orgs.connections.connectionDeleted")),t({mode:"idle"}),Q?.()};return{deleteState:a,requestDelete:o=>{t({mode:"deleting",connection:o})},cancelDelete:()=>{t({mode:"idle"})},confirmDelete:async()=>{if(a.mode!=="deleting")return;const o=a.connection;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),d(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const c=JSON.parse(m);if(c.code==="CONNECTION_IN_USE"&&c.agentNames){t({mode:"force-deleting",connection:o,agentNames:c.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}},confirmForceDelete:async()=>{if(a.mode!=="force-deleting")return;const o=a.connection.id;t({mode:"idle"});try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),d(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(D("orgs.connections.failedToDeleteConnection",{error:i}))}}}}export{ge as D,De as u};
@@ -1 +1 @@
1
- import{c as s,i as m,K as c}from"./index-CcqLnTyv.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:n}=m(t),r=a==="admin",o=a==="unverified";let i;return e[1]!==n||e[2]!==r||e[3]!==o?(i={isAdmin:r,loading:n,needsEmailVerification:o},e[1]=n,e[2]=r,e[3]=o,e[4]=i):i=e[4],i}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
1
+ import{c as s,i as m,K as c}from"./index-DEZ1imMJ.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:n}=m(t),r=a==="admin",o=a==="unverified";let i;return e[1]!==n||e[2]!==r||e[3]!==o?(i={isAdmin:r,loading:n,needsEmailVerification:o},e[1]=n,e[2]=r,e[3]=o,e[4]=i):i=e[4],i}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
@@ -1 +1 @@
1
- import{c,f7 as f,K as d,i as g,f8 as m,al as E}from"./index-CcqLnTyv.js";const p=1e6;function S(e,t,s){s>0&&e.setQueryData(d.aiPlanEntitlements(t),i=>{if(!i?.usage)return i;const n=i.usage;if(!n.limitMicros||n.usedMicros===null)return i;const u=n.usedMicros+s*p,r=Math.min(1,u/n.limitMicros);return{...i,usage:{...n,usedMicros:u,percent:r,state:r>=1?"exhausted":r>=.8?"warn":"ok"}}})}function l(){return m()?.plansEnabled===!0}function o(){const e=c.c(8),t=f(),s=t?.org.slug,i=l();let n;e[0]!==t?.org.id?(n=d.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=n):n=e[1];const u=!!s&&i;let r;e[2]!==s?(r=()=>E(s,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=s,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==u||e[6]!==r?(a={queryKey:n,enabled:u,staleTime:6e4,retry:1,queryFn:r},e[4]=n,e[5]=u,e[6]=r,e[7]=a):a=e[7],g(a)}function P(e){const{data:t}=o();return!e||!t?!0:t.features[e]===!0}function h(){const e=l(),{isPending:t,fetchStatus:s}=o();return!e||s==="idle"||s==="paused"?!0:!t}function x(){const e=c.c(4),t=l(),{isSuccess:s,data:i}=o(),n=i?.features?.model_choice;let u;return e[0]!==s||e[1]!==t||e[2]!==n?(u=b({plansEnabled:t,isSuccess:s,modelChoice:n}),e[0]=s,e[1]=t,e[2]=n,e[3]=u):u=e[3],u}function b({plansEnabled:e,isSuccess:t,modelChoice:s}){return e?t&&s===!0:!0}function y(){const{data:e}=o();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}export{o as a,x as b,S as c,P as d,h as e,y as f,l as u};
1
+ import{c,fa as f,K as d,i as g,fb as m,al as E}from"./index-DEZ1imMJ.js";const b=1e6;function S(e,t,s){s>0&&e.setQueryData(d.aiPlanEntitlements(t),i=>{if(!i?.usage)return i;const n=i.usage;if(!n.limitMicros||n.usedMicros===null)return i;const u=n.usedMicros+s*b,r=Math.min(1,u/n.limitMicros);return{...i,usage:{...n,usedMicros:u,percent:r,state:r>=1?"exhausted":r>=.8?"warn":"ok"}}})}function l(){return m()?.plansEnabled===!0}function o(){const e=c.c(8),t=f(),s=t?.org.slug,i=l();let n;e[0]!==t?.org.id?(n=d.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=n):n=e[1];const u=!!s&&i;let r;e[2]!==s?(r=()=>E(s,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=s,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==u||e[6]!==r?(a={queryKey:n,enabled:u,staleTime:6e4,retry:1,queryFn:r},e[4]=n,e[5]=u,e[6]=r,e[7]=a):a=e[7],g(a)}function P(e){const{data:t}=o();return!e||!t?!0:t.features[e]===!0}function h(){const e=l(),{isPending:t,fetchStatus:s}=o();return!e||s==="idle"||s==="paused"?!0:!t}function x(){const e=c.c(4),t=l(),{isSuccess:s,data:i}=o(),n=i?.features?.model_choice;let u;return e[0]!==s||e[1]!==t||e[2]!==n?(u=p({plansEnabled:t,isSuccess:s,modelChoice:n}),e[0]=s,e[1]=t,e[2]=n,e[3]=u):u=e[3],u}function p({plansEnabled:e,isSuccess:t,modelChoice:s}){return e?t&&s===!0:!0}function y(){const{data:e}=o();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}export{o as a,x as b,S as c,P as d,h as e,y as f,l as u};
@@ -1 +1 @@
1
- import{c as s}from"./index-CcqLnTyv.js";import{u as v,G as g,ay as h,aM as b,aN as P,aO as S,M}from"./site-editor-toast-CIOA7Zq3.js";import{u as w}from"./use-voice-input-DmZaOhTZ.js";function d(e){const t=s.c(3),u=w(e?.virtualMcpId).runtime==="cms",l=v(e?.virtualMcpId,e?.branch),o=l.kind==="protocol"&&l.source==="github",n=b(e),c=P(o?e:null);if(!e||!u)return null;if(o)return c;let i;return t[0]!==n||t[1]!==e?(i=n?S({...e,...n}):null,t[0]=n,t[1]=e,t[2]=i):i=t[2],i}function U(e){const t=s.c(3),u=d(e),l=v(e.virtualMcpId,e.branch),o=l.kind==="protocol"&&l.source==="github";let n;t[0]!==e.orgSlug||t[1]!==e.virtualMcpId?(n=g(e.orgSlug,e.virtualMcpId),t[0]=e.orgSlug,t[1]=e.virtualMcpId,t[2]=n):n=t[2];const c=h(n,o?u:null);return o?c:u}function R(e){const t=s.c(11);let u;t[0]!==e?(u=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=u):u=t[1];const l=d(u),o=e?.previewServerUrl??null;let n=null;if(o)try{let f;t[2]!==o?(f=new URL(o),t[2]=o,t[3]=f):f=t[3],n=f.host}catch{n=null}let c;t[4]!==l||t[5]!==e||t[6]!==o?(c=e&&o&&l?M(new URL(e.path,o).toString(),l):null,t[4]=l,t[5]=e,t[6]=o,t[7]=c):c=t[7];const i=c;let r;return t[8]!==n||t[9]!==i?(r={url:i,host:n},t[8]=n,t[9]=i,t[10]=r):r=t[10],r}export{d as a,U as b,R as u};
1
+ import{c as s}from"./index-DEZ1imMJ.js";import{u as v,G as g,ay as h,aM as b,aN as P,aO as S,M}from"./site-editor-toast-Cgezu0A5.js";import{u as w}from"./use-voice-input-BKZpbbiI.js";function d(e){const t=s.c(3),u=w(e?.virtualMcpId).runtime==="cms",l=v(e?.virtualMcpId,e?.branch),o=l.kind==="protocol"&&l.source==="github",n=b(e),c=P(o?e:null);if(!e||!u)return null;if(o)return c;let i;return t[0]!==n||t[1]!==e?(i=n?S({...e,...n}):null,t[0]=n,t[1]=e,t[2]=i):i=t[2],i}function U(e){const t=s.c(3),u=d(e),l=v(e.virtualMcpId,e.branch),o=l.kind==="protocol"&&l.source==="github";let n;t[0]!==e.orgSlug||t[1]!==e.virtualMcpId?(n=g(e.orgSlug,e.virtualMcpId),t[0]=e.orgSlug,t[1]=e.virtualMcpId,t[2]=n):n=t[2];const c=h(n,o?u:null);return o?c:u}function R(e){const t=s.c(11);let u;t[0]!==e?(u=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=u):u=t[1];const l=d(u),o=e?.previewServerUrl??null;let n=null;if(o)try{let f;t[2]!==o?(f=new URL(o),t[2]=o,t[3]=f):f=t[3],n=f.host}catch{n=null}let c;t[4]!==l||t[5]!==e||t[6]!==o?(c=e&&o&&l?M(new URL(e.path,o).toString(),l):null,t[4]=l,t[5]=e,t[6]=o,t[7]=c):c=t[7];const i=c;let r;return t[8]!==n||t[9]!==i?(r={url:i,host:n},t[8]=n,t[9]=i,t[10]=r):r=t[10],r}export{d as a,U as b,R as u};
@@ -1 +1 @@
1
- import{c as r,a5 as f,ak as d,K as C,i as E,V as I,q as F,e as g}from"./index-CcqLnTyv.js";function m(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{m as a,L as b,S as c,_ as u};
1
+ import{c as r,a5 as f,ak as d,K as C,i as E,V as I,q as F,e as g}from"./index-DEZ1imMJ.js";function m(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{m as a,L as b,S as c,_ as u};
@@ -1 +1 @@
1
- import{c as x,r as I}from"./index-CcqLnTyv.js";function m(n){const e=x.c(15),[s,r]=I.useState(null);let d;e[0]!==n||e[1]!==s?(d=s!==null?n.findIndex(l=>l.id===s):-1,e[0]=n,e[1]=s,e[2]=d):d=e[2];const t=d,i=t!==-1?n[t]:null,a=i!==null;let u,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l=>r(l),f=()=>r(null),e[3]=u,e[4]=f):(u=e[3],f=e[4]);let c,o;e[5]!==t||e[6]!==n?(c=()=>{const l=n[t-1];t>0&&l&&r(l.id)},o=()=>{const l=n[t+1];t!==-1&&l&&r(l.id)},e[5]=t,e[6]=n,e[7]=c,e[8]=o):(c=e[7],o=e[8]);let p;return e[9]!==t||e[10]!==i||e[11]!==a||e[12]!==c||e[13]!==o?(p={selected:i,index:t,isOpen:a,select:u,close:f,prev:c,next:o},e[9]=t,e[10]=i,e[11]=a,e[12]=c,e[13]=o,e[14]=p):p=e[14],p}export{m as u};
1
+ import{c as x,r as I}from"./index-DEZ1imMJ.js";function m(n){const e=x.c(15),[s,r]=I.useState(null);let d;e[0]!==n||e[1]!==s?(d=s!==null?n.findIndex(l=>l.id===s):-1,e[0]=n,e[1]=s,e[2]=d):d=e[2];const t=d,i=t!==-1?n[t]:null,a=i!==null;let u,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l=>r(l),f=()=>r(null),e[3]=u,e[4]=f):(u=e[3],f=e[4]);let c,o;e[5]!==t||e[6]!==n?(c=()=>{const l=n[t-1];t>0&&l&&r(l.id)},o=()=>{const l=n[t+1];t!==-1&&l&&r(l.id)},e[5]=t,e[6]=n,e[7]=c,e[8]=o):(c=e[7],o=e[8]);let p;return e[9]!==t||e[10]!==i||e[11]!==a||e[12]!==c||e[13]!==o?(p={selected:i,index:t,isOpen:a,select:u,close:f,prev:c,next:o},e[9]=t,e[10]=i,e[11]=a,e[12]=c,e[13]=o,e[14]=p):p=e[14],p}export{m as u};
@@ -1 +1 @@
1
- import{c as b,a5 as M,ak as S,q as T,e as v,a as q,r as A,K}from"./index-CcqLnTyv.js";import{u as O}from"./useInfiniteQuery-WRSkkanY.js";import{n as Q}from"./watch-sse-pool-CYcZM1HP.js";const R=6e4;function E(e,n){return e.call("NOTIFICATION_LIST",n?{cursor:n}:{})}function L(e,n){if(!e)return e;const r=n?new Set(n):null;let i=0;const a=e.pages.map(t=>{const u=t.notifications.filter(c=>r&&!r.has(c.id)?!0:(i++,!1));return{...t,notifications:u}}),o=r?Math.max(0,(e.pages[0]?.unreadCount??0)-i):0;return{...e,pages:a.map(t=>({...t,unreadCount:o}))}}function w(e,n){const r=b.c(4),{data:i}=q.useSession(),a=i?.user?.id;let o;r[0]!==n||r[1]!==e||r[2]!==a?(o=t=>!e||!a?B:Q.subscribe(e,c=>{try{if(JSON.parse(c.data).subject!==a)return}catch{return}n(),t()},n),r[0]=n,r[1]=e,r[2]=a,r[3]=o):o=r[3],A.useSyncExternalStore(o,j,D)}function D(){return 0}function j(){return 0}function B(){}function G(){const e=b.c(37),{locator:n,org:r}=M(),i=S(),a=T();let o;e[0]!==n?(o=K.notifications(n),e[0]=n,e[1]=o):o=e[1];const t=o;let u;e[2]!==i?(u=l=>{const{pageParam:_}=l;return E(i,_)},e[2]=i,e[3]=u):u=e[3];let c;e[4]!==t||e[5]!==u?(c={queryKey:t,queryFn:u,initialPageParam:void 0,getNextPageParam:V,refetchInterval:R},e[4]=t,e[5]=u,e[6]=c):c=e[6];const s=O(c);let I;e[7]!==a||e[8]!==t?(I=()=>a.invalidateQueries({queryKey:t,refetchType:"active"}),e[7]=a,e[8]=t,e[9]=I):I=e[9],w(r.slug,I);let f;e[10]!==i?(f=l=>i.call("NOTIFICATION_MARK_READ",l?{ids:l}:{}),e[10]=i,e[11]=f):f=e[11];let m,p;e[12]!==a||e[13]!==t?(m=async l=>{await a.cancelQueries({queryKey:t}),a.setQueryData(t,_=>L(_,l))},p=()=>a.invalidateQueries({queryKey:t}),e[12]=a,e[13]=t,e[14]=m,e[15]=p):(m=e[14],p=e[15]);let y;e[16]!==f||e[17]!==m||e[18]!==p?(y={mutationFn:f,onMutate:m,onSettled:p},e[16]=f,e[17]=m,e[18]=p,e[19]=y):y=e[19];const P=v(y);let N;e[20]!==s.data?.pages?(N=s.data?.pages??[],e[20]=s.data?.pages,e[21]=N):N=e[21];const C=N;let d;e[22]!==C?(d=C.flatMap($),e[22]=C,e[23]=d):d=e[23];const F=C[0]?.unreadCount??0;let g;e[24]!==s?(g=()=>{s.hasNextPage&&!s.isFetchingNextPage&&s.fetchNextPage()},e[24]=s,e[25]=g):g=e[25];let h,x;e[26]!==P?(h=()=>P.mutate(null),x=l=>P.mutate([l]),e[26]=P,e[27]=h,e[28]=x):(h=e[27],x=e[28]);let k;return e[29]!==s.hasNextPage||e[30]!==s.isFetchingNextPage||e[31]!==F||e[32]!==g||e[33]!==h||e[34]!==x||e[35]!==d?(k={updates:d,redDotCount:F,hasMore:s.hasNextPage,isFetchingMore:s.isFetchingNextPage,fetchMore:g,markAllRead:h,markRead:x},e[29]=s.hasNextPage,e[30]=s.isFetchingNextPage,e[31]=F,e[32]=g,e[33]=h,e[34]=x,e[35]=d,e[36]=k):k=e[36],k}function $(e){return e.notifications.map(J)}function J(e){return{id:e.id,taskBoardItemId:e.taskBoardItemId,taskTitle:e.taskTitle,taskKeySeq:e.taskKeySeq,action:e.type,actorName:e.actorName,actorImage:e.actorImage,occurredAt:e.createdAt}}function V(e){return e.nextCursor??void 0}export{G as u};
1
+ import{c as b,a5 as M,ak as S,q as T,e as v,a as q,r as A,K}from"./index-DEZ1imMJ.js";import{u as O}from"./useInfiniteQuery-CtNfxLxq.js";import{n as Q}from"./watch-sse-pool-DhoYakYc.js";const R=6e4;function E(e,n){return e.call("NOTIFICATION_LIST",n?{cursor:n}:{})}function L(e,n){if(!e)return e;const r=n?new Set(n):null;let i=0;const a=e.pages.map(t=>{const u=t.notifications.filter(c=>r&&!r.has(c.id)?!0:(i++,!1));return{...t,notifications:u}}),o=r?Math.max(0,(e.pages[0]?.unreadCount??0)-i):0;return{...e,pages:a.map(t=>({...t,unreadCount:o}))}}function w(e,n){const r=b.c(4),{data:i}=q.useSession(),a=i?.user?.id;let o;r[0]!==n||r[1]!==e||r[2]!==a?(o=t=>!e||!a?B:Q.subscribe(e,c=>{try{if(JSON.parse(c.data).subject!==a)return}catch{return}n(),t()},n),r[0]=n,r[1]=e,r[2]=a,r[3]=o):o=r[3],A.useSyncExternalStore(o,j,D)}function D(){return 0}function j(){return 0}function B(){}function G(){const e=b.c(37),{locator:n,org:r}=M(),i=S(),a=T();let o;e[0]!==n?(o=K.notifications(n),e[0]=n,e[1]=o):o=e[1];const t=o;let u;e[2]!==i?(u=l=>{const{pageParam:_}=l;return E(i,_)},e[2]=i,e[3]=u):u=e[3];let c;e[4]!==t||e[5]!==u?(c={queryKey:t,queryFn:u,initialPageParam:void 0,getNextPageParam:V,refetchInterval:R},e[4]=t,e[5]=u,e[6]=c):c=e[6];const s=O(c);let I;e[7]!==a||e[8]!==t?(I=()=>a.invalidateQueries({queryKey:t,refetchType:"active"}),e[7]=a,e[8]=t,e[9]=I):I=e[9],w(r.slug,I);let f;e[10]!==i?(f=l=>i.call("NOTIFICATION_MARK_READ",l?{ids:l}:{}),e[10]=i,e[11]=f):f=e[11];let m,p;e[12]!==a||e[13]!==t?(m=async l=>{await a.cancelQueries({queryKey:t}),a.setQueryData(t,_=>L(_,l))},p=()=>a.invalidateQueries({queryKey:t}),e[12]=a,e[13]=t,e[14]=m,e[15]=p):(m=e[14],p=e[15]);let y;e[16]!==f||e[17]!==m||e[18]!==p?(y={mutationFn:f,onMutate:m,onSettled:p},e[16]=f,e[17]=m,e[18]=p,e[19]=y):y=e[19];const P=v(y);let N;e[20]!==s.data?.pages?(N=s.data?.pages??[],e[20]=s.data?.pages,e[21]=N):N=e[21];const C=N;let d;e[22]!==C?(d=C.flatMap($),e[22]=C,e[23]=d):d=e[23];const F=C[0]?.unreadCount??0;let g;e[24]!==s?(g=()=>{s.hasNextPage&&!s.isFetchingNextPage&&s.fetchNextPage()},e[24]=s,e[25]=g):g=e[25];let h,x;e[26]!==P?(h=()=>P.mutate(null),x=l=>P.mutate([l]),e[26]=P,e[27]=h,e[28]=x):(h=e[27],x=e[28]);let k;return e[29]!==s.hasNextPage||e[30]!==s.isFetchingNextPage||e[31]!==F||e[32]!==g||e[33]!==h||e[34]!==x||e[35]!==d?(k={updates:d,redDotCount:F,hasMore:s.hasNextPage,isFetchingMore:s.isFetchingNextPage,fetchMore:g,markAllRead:h,markRead:x},e[29]=s.hasNextPage,e[30]=s.isFetchingNextPage,e[31]=F,e[32]=g,e[33]=h,e[34]=x,e[35]=d,e[36]=k):k=e[36],k}function $(e){return e.notifications.map(J)}function J(e){return{id:e.id,taskBoardItemId:e.taskBoardItemId,taskTitle:e.taskTitle,taskKeySeq:e.taskKeySeq,action:e.type,actorName:e.actorName,actorImage:e.actorImage,occurredAt:e.createdAt}}function V(e){return e.nextCursor??void 0}export{G as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-CcqLnTyv.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
1
+ import{r as e}from"./index-DEZ1imMJ.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{c as O,a5 as T,ak as v,av as A,K as I,i as _,q as J,b as Q,e as N,t as p}from"./index-CcqLnTyv.js";function j(){const e=O.c(10),{org:u}=T(),d=v(),{capabilities:c,isPrivileged:f}=A(),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}=_(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=v(),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,a5 as T,ak as v,av as A,K as I,i as _,q as J,b as Q,e as N,t as p}from"./index-DEZ1imMJ.js";function j(){const e=O.c(10),{org:u}=T(),d=v(),{capabilities:c,isPrivileged:f}=A(),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}=_(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=v(),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};
@@ -0,0 +1 @@
1
+ import{c as Ee,b as He,u as Le,a5 as Oe,h0 as Be,h1 as Ke,h2 as le,h3 as de,aj as $e,ah as me,h4 as Qe,h5 as We,r as Y,eQ as _e,U as pe,h6 as qe,h7 as ze}from"./index-DEZ1imMJ.js";import{a as Ge}from"./use-chat-layout-state-BG2-xqQp.js";import{b as Je}from"./agent-icon-CTbTFMnU.js";import{i as Xe}from"./Monitor01-DalIAdj7.js";import{u as Ye}from"./use-connection-BozgIoMu.js";import{a as Ze}from"./use-mcp-client-DJjkIlNp.js";import{u as et}from"./use-mcp-tools-wfurU0oX.js";import{u as tt}from"./repository-binding-C0msapZZ.js";import{g as at}from"./types-gyofjZHf.js";import{t as ot}from"./utils-CVEq3hMx.js";import{a as D}from"./agent-capabilities-BGShibnD.js";import"./index-_l1iac4T.js";import{u as nt}from"./use-sandbox-events-D1_GHzsF.js";import{F as ue}from"./file-type-icon-DM9o0Fkb.js";import{a as st,u as it}from"./autosend-B0POegpm.js";import{r as Z}from"./resolve-tab-icon-BWeUUKzK.js";import{u as ct}from"./use-task-metadata-D4kXdUwO.js";import{r as rt}from"./preview-source-BsRLGWUP.js";import{i as lt,p as dt,s as mt}from"./shell-layout-BLRNx2fV.js";import{u as pt}from"./use-voice-input-BKZpbbiI.js";import{u as ut}from"./use-organization-settings-bWX185lw.js";import{a as ft}from"./use-project-scope-pwqcjGo8.js";import{c as bt,u as Tt,d as It,e as vt,f as ht}from"./use-project-native-view-presence-DhhbOsoh.js";import{c as Pt}from"./chat-context-PvP_Q1CV.js";import{r as yt}from"./virtual-mcp-vRvxAZ15.js";function Xt(o){const e=Ee.c(35),d=He(),{openPanel:f,closePanel:R}=st();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=it(),te=Ge(),i=tt(o.virtualMcpId),T=ct(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:I}=Pt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,v=T?.expanded_tools??[],h=ut(),{scopeId:Te,project:Ie}=ft(),F=bt(Te,Ie,i),U=Tt(F.project),ae=It(F.resolvedScopeId,D(F.project?.metadata),U.presence);let P;e[1]===Symbol.for("react.memo_cache_sentinel")?(P={includeVirtual:!0},e[1]=P):P=e[1];const p=Ye(P),ve=nt(),x=I?.branch??be;let y;e[2]!==I?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==x?(y=rt({threadId:o.taskId,sandboxBranch:x,agentHasRepo:D(i?.metadata),threadHasRepo:D(T)||D(I?.metadata)}),e[2]=I?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=x,e[7]=y):y=e[7];const he=y,E=ve.lifecycle.phase==="running",{runtime:Pe,resolved:oe}=pt(o.virtualMcpId),H=!!r&&E;let k;e[8]!==H?(k={enabled:H},e[8]=H,e[9]=k):k=e[9];const ne=Ze({connectionId:r,orgId:n.id,orgSlug:n.slug},k),L=ne,O=!!ne&&E;let w;e[10]!==L||e[11]!==O?(w={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=w):w=e[12];const{data:ye}=et(w),se=r&&E?(ye?.tools??[]).filter(Vt).map(t=>({connectionId:r,toolName:t.name,label:ot(t.name),icon:null})):[],B=se[0],ke=B?se:[],u=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,we=yt(m),ie={assets:U.assetsPending,siteAccess:U.siteAccessPending},{activeTab:g,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(gt)}:null}),ge=u||m?{defaultMainView:u,tabs:c.map(wt)}:null,V=dt({hasSource:he==="repo"||h,runtime:Pe,cmsMode:we}),Ve=V.includes("content"),Ce=le(ge),Me=u?.type,ce=vt(Me,ae,ie,V,oe),K=ce?le(null):Ce,Se=ht(g,ae,ie),Ne=!V.includes("code")&&oe&&de(g)!==null,a=!ee&&!te&&ce||g==="content"&&!Ve||Ne||Se?K:g,$=$e(a);let C;e[13]!==d?(C=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=C):C=e[14];const je=C,Q=new Map;for(const t of v){const s=me(t.appId,t.toolName);Q.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ke){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);Q.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const W=Qe(a),_=W?W.key.split("/").pop()??W.key:null,Ae=_?[{id:a,title:_,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:_,...t})}}]:[],M=We(a),De=M?[{id:a,title:(M.path.split("/").pop()??M.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(M.path.startsWith("pages/")?Je:Xe,t)}}]:[],q=_e(a),z=q?q.path.split("/").pop()??q.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=lt(a)?V.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:p})})):[];let S;e[15]!==p?(S=t=>({id:qe(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=S):S=e[16];const Ue=[...Fe,...Ae,...De,...Re,...c.map(S),...Array.from(Q.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,G=Ue.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),xe=o.virtualMcpId;let N;e[17]!==n.id?(N=pe(n.id),e[17]=n.id,e[18]=N):N=e[18];const J=xe===N;let j;e[19]!==a||e[20]!==R||e[21]!==l||e[22]!==J||e[23]!==f||e[24]!==n.id||e[25]!==h?(j=t=>{if(mt({reportsOnly:h,onReportAgent:J,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:kt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?R():f(s.tabId)},e[19]=a,e[20]=R,e[21]=l,e[22]=J,e[23]=f,e[24]=n.id,e[25]=h,e[26]=j):j=e[26];const X=j;let A;return e[27]!==a||e[28]!==$||e[29]!==v||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(A={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:v,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=v,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=A):A=e[34],A}function kt(o){return{...o,thread:void 0}}function wt(o){return{id:o.id}}function gt(o){return{id:o.id}}function Vt(o){return!!at(o._meta)}export{Xt as u};
@@ -1 +1 @@
1
- import{c as I,b as k,a6 as N,b3 as S,j as o,a5 as $,K as A,V as L}from"./index-CcqLnTyv.js";import{B as g}from"./badge-DtxRsHGH.js";import{c as v,T,a as b,b as _}from"./tooltip-AKf-E49i.js";import{g as H}from"./types-BQOtvCBo.js";import{s as O}from"./Tool01-BTDYOKsB.js";import{aC as P,aO as U}from"./agent-icon-DqjTL3cE.js";import{i as w}from"./mcp-oauth-ChfuZkYU.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:O,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:P,variant:"outline"}];function Q(y){const e=I.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(U,{})})}),o.jsx(b,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(b,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function V(y){const e=I.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>w({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,V as u};
1
+ import{c as I,b as k,a6 as N,b3 as S,j as o,a5 as $,K as A,V as L}from"./index-DEZ1imMJ.js";import{B as g}from"./badge-BpzeYR5Z.js";import{c as v,T,a as b,b as _}from"./tooltip-Dam-ym8O.js";import{g as H}from"./types-gyofjZHf.js";import{s as O}from"./Tool01-Bo2g-Ylw.js";import{aC as P,aO as U}from"./agent-icon-CTbTFMnU.js";import{i as w}from"./mcp-oauth-BBT3ip6Z.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:O,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:P,variant:"outline"}];function Q(y){const e=I.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(U,{})})}),o.jsx(b,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(b,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function V(y){const e=I.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>w({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,V as u};
@@ -1,4 +1,4 @@
1
- import{de as ce,df as le,dg as de,dh as ue,di as he,dj as m,dk as g,dl as fe,dm as pe,dn as me,dp as M,dq as _e,dr as F,ds as we,dt as q,du as ge,dv as D,dw as Te,dx as ye,dy as ke,dz as z,dA as ve,dB as Se,dC as Ce,dD as ee,dE as be,dF as Re,dG as Ie,ci as Ee,dH as qe,dI as Pe,dJ as A,dK as $e,dL as Me,dM as Ae,dN as He,dO as Oe,dP as xe,dQ as Ue,dR as Ne,dS as je,dT as Fe,dU as De,dV as Le,dW as Ve,c9 as V,dX as Qe,dY as U,K as te,T as ze,c as se,V as Je,i as We}from"./index-CcqLnTyv.js";import{U as P,b as H,c as J}from"./auth-qAWEiaXq.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ke(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(ue,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const d=i.message,p=d.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(d);else{const h=d,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,d=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&d&&await d.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:d,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(d){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(d);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const d=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,d)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:d}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),d&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:d}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const u=d?.taskId;if(u){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(u,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(d=>this._onerror(d))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const d=z.parse({method:"notifications/tasks/status",params:i});await this.notification(d),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const d=await s.getTask(r,t);if(d){const p=z.parse({method:"notifications/tasks/status",params:d});await this.notification(p),R(d.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class st{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const d of n){if(d.type==="result"&&i){const p=d.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield d}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function at(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Be{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(d,p)=>{const l=b(je,d);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(d,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,u=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{O(u,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(d,p)=>{const l=b(De,d);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(d,p));if(h.task){const k=b(D,f);if(!k.success){const u=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${u}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ne.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:d}=s,p=async()=>{if(!n){d(null,null);return}try{const h=await r();d(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));d(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const N=a=>[{type:"text",text:a}];function it(a){const e=V(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=d=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${d}`,e).href,r=async d=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(d.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(d.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:N(f),isError:!0}}if(!p.ok){let h=`${d.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:N(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:N(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const d=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return d.ok?await d.json():{tools:[]}},n=d=>()=>Promise.reject(new Error(`RestSelfClient: ${d} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,d="",p=0,l;function h(u){if(n&&(n=!1,u.charCodeAt(0)===239&&u.charCodeAt(1)===187&&u.charCodeAt(2)===191&&(u=u.slice(3))),o.length===0){const v=f(u);v!==""&&o.push(v);return}if(u.indexOf(`
1
+ import{dh as ce,di as le,dj as de,dk as ue,dl as he,dm as m,dn as g,dp as fe,dq as pe,dr as me,ds as M,dt as _e,du as F,dv as we,dw as q,dx as ge,dy as D,dz as Te,dA as ye,dB as ke,dC as z,dD as ve,dE as Se,dF as Ce,dG as ee,dH as be,dI as Re,dJ as Ie,cl as Ee,dK as qe,dL as Pe,dM as A,dN as $e,dO as Me,dP as Ae,dQ as He,dR as Oe,dS as xe,dT as Ue,dU as Ne,dV as je,dW as Fe,dX as De,dY as Le,dZ as Ve,cc as V,d_ as Qe,d$ as U,K as te,T as ze,c as se,V as Je,i as We}from"./index-DEZ1imMJ.js";import{U as P,b as H,c as J}from"./auth-CQxDIkM-.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ke(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(ue,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const d=i.message,p=d.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(d);else{const h=d,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,d=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&d&&await d.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:d,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(d){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(d);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const d=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,d)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:d}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),d&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:d}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const u=d?.taskId;if(u){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(u,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(d=>this._onerror(d))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const d=z.parse({method:"notifications/tasks/status",params:i});await this.notification(d),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const d=await s.getTask(r,t);if(d){const p=z.parse({method:"notifications/tasks/status",params:d});await this.notification(p),R(d.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class st{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const d of n){if(d.type==="result"&&i){const p=d.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield d}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function at(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Be{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(d,p)=>{const l=b(je,d);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(d,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,u=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{O(u,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(d,p)=>{const l=b(De,d);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(d,p));if(h.task){const k=b(D,f);if(!k.success){const u=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${u}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ne.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:d}=s,p=async()=>{if(!n){d(null,null);return}try{const h=await r();d(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));d(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const N=a=>[{type:"text",text:a}];function it(a){const e=V(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=d=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${d}`,e).href,r=async d=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(d.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(d.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:N(f),isError:!0}}if(!p.ok){let h=`${d.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:N(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:N(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const d=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return d.ok?await d.json():{tools:[]}},n=d=>()=>Promise.reject(new Error(`RestSelfClient: ${d} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,d="",p=0,l;function h(u){if(n&&(n=!1,u.charCodeAt(0)===239&&u.charCodeAt(1)===187&&u.charCodeAt(2)===191&&(u=u.slice(3))),o.length===0){const v=f(u);v!==""&&o.push(v);return}if(u.indexOf(`
2
2
  `)===-1&&u.indexOf("\r")===-1){o.push(u);return}o.push(u);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(u){let c=0;if(u.indexOf("\r")===-1){let _=u.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:d}),i=void 0,d="",p=0,l=void 0,c=_+1,_=u.indexOf(`
4
4
  `,c);continue}const v=u.charCodeAt(c);if(Y(u,c,v)){const S=u.charCodeAt(c+5)===I?c+6:c+5,C=u.slice(S,_);if(p===0&&u.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,d="",l=void 0,c=_+2,_=u.indexOf(`
@@ -1 +1 @@
1
- import{c as l,i as c,dj as m,dk as f,V as y,K as n}from"./index-CcqLnTyv.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function d(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{g as a,b as g,u as l,d as u};
1
+ import{c as l,i as c,dm as m,dn as f,V as y,K as n}from"./index-DEZ1imMJ.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function d(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{g as a,b as g,u as l,d as u};
@@ -1 +1 @@
1
- import{c as f,V as p,i as q,K as m}from"./index-CcqLnTyv.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
1
+ import{c as f,V as p,i as q,K as m}from"./index-DEZ1imMJ.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-CcqLnTyv.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
1
+ import{r as s}from"./index-DEZ1imMJ.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
@@ -1 +1 @@
1
- import{q as x,b as j,e as v,K as b,bn as B}from"./index-CcqLnTyv.js";import{u as H}from"./use-voice-input-DmZaOhTZ.js";import{o as U,c as A,u as F,U as J,ab as N,Z as R,X as S,Y as W,a4 as z,a5 as L,a6 as Y,a8 as G,aA as X,ah as Z,ag as _,q as C,$ as D}from"./site-editor-toast-CIOA7Zq3.js";import{s as $}from"./sandbox-git-api-DcqI6XE4.js";import{u as g}from"./chat-context-aSjAR9mm.js";import{z as V,H as M}from"./hosted-reconcile-C9_-UERm.js";import{b as O}from"./sandbox-url-D3mC8qhT.js";import{d as Q}from"./utils-KeMhVvdQ.js";function fe({orgSlug:i,virtualMcpId:t,branch:o}){const s=x(),y=g()?.taskId??null,P=U(t),T=H(t).runtime==="cms",{url:q}=A(t),k=F(t,o),f=k.kind==="protocol"?k:null,d=J({orgSlug:i,virtualMcpId:t,branch:o}),m=b.decofile(d),K=j(),E=async(r,c)=>{if(q)return{ok:!0};if(T){const a=await Z({orgSlug:i,virtualMcpId:t,branch:o},{set:r,delete:c});return _(s,{orgSlug:i,virtualMcpId:t,branch:o},a),await s.invalidateQueries({queryKey:$({orgSlug:i,virtualMcpId:t,branch:o,threadId:y})}),a}const u={orgSlug:i,virtualMcpId:t,branch:o,threadId:y};for(const[a,n]of Object.entries(r)){const e=await fetch(O(u,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:C(P,Q(a)),content:JSON.stringify(n,null,2)})});if(!e.ok)return D(e,"Write")}for(const a of c){const n=await fetch(O(u,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:C(P,Q(a))})});if(!n.ok)return D(n,"Delete")}return{ok:!0}},p=v({mutationKey:W(i,t,o),scope:S(i,t,o),mutationFn:async({writes:r,deletes:c,copies:u,shown:a})=>{const n=f?.source==="github"?r:B(r);return f?.source==="github"?V({queryClient:s,backend:f,params:{orgSlug:i,virtualMcpId:t,branch:o},cacheKey:d},{writes:n,deletes:c.filter(e=>!(e in n))},u,a?.()):f?N(s,f,{orgSlug:i,virtualMcpId:t,branch:o},d,{set:n,delete:c.filter(e=>!(e in n))}):R({queryClient:s,orgSlug:i,virtualMcpId:t,branch:o,backend:k,cacheKey:d},{kind:"edit",write:()=>E(n,c)})},onSuccess:()=>{f?.source!=="github"&&s.invalidateQueries({queryKey:b.liveMeta(i,t,o)})}});return{move:async(r,c)=>{const u=[...Object.keys(r.writes),...r.deletes],a=s.getQueryData(m),n=new Map;for(const e of u)a&&e in a&&n.set(e,a[e]);s.setQueryData(m,e=>I(e,r)),s.cancelQueries({queryKey:m});try{return await p.mutateAsync({...r,copies:a,shown:c?.shown})}catch(e){throw e instanceof M?(z(K,e.deleted,e.deleted&&r.deletes.length>0&&r.deletes.every(l=>L(s,d,l))),e):(Y(K,e),f?.source==="github"&&(G(e)||e instanceof X)||s.setQueryData(m,l=>{if(!l)return l;const w={...l};for(const h of u)n.has(h)?w[h]=n.get(h):delete w[h];return w}),e)}},isPending:p.isPending,isError:p.isError}}function I(i,{writes:t,deletes:o}){const s={...i??{},...t};for(const y of o)y in t||delete s[y];return s}export{I as a,fe as u};
1
+ import{q as x,b as j,e as v,K as b,bn as B}from"./index-DEZ1imMJ.js";import{u as H}from"./use-voice-input-BKZpbbiI.js";import{o as U,c as A,u as F,U as J,ab as N,Z as R,X as S,Y as W,a4 as z,a5 as L,a6 as Y,a8 as G,aA as X,ah as Z,ag as _,q as C,$ as D}from"./site-editor-toast-Cgezu0A5.js";import{s as $}from"./sandbox-git-api-DcqI6XE4.js";import{u as g}from"./chat-context-PvP_Q1CV.js";import{z as V,H as M}from"./hosted-reconcile-DNkBVm-1.js";import{b as O}from"./sandbox-url-D3mC8qhT.js";import{d as Q}from"./utils-BbEfYi1l.js";function fe({orgSlug:i,virtualMcpId:t,branch:o}){const s=x(),y=g()?.taskId??null,P=U(t),T=H(t).runtime==="cms",{url:q}=A(t),k=F(t,o),f=k.kind==="protocol"?k:null,d=J({orgSlug:i,virtualMcpId:t,branch:o}),m=b.decofile(d),K=j(),E=async(r,c)=>{if(q)return{ok:!0};if(T){const a=await Z({orgSlug:i,virtualMcpId:t,branch:o},{set:r,delete:c});return _(s,{orgSlug:i,virtualMcpId:t,branch:o},a),await s.invalidateQueries({queryKey:$({orgSlug:i,virtualMcpId:t,branch:o,threadId:y})}),a}const u={orgSlug:i,virtualMcpId:t,branch:o,threadId:y};for(const[a,n]of Object.entries(r)){const e=await fetch(O(u,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:C(P,Q(a)),content:JSON.stringify(n,null,2)})});if(!e.ok)return D(e,"Write")}for(const a of c){const n=await fetch(O(u,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:C(P,Q(a))})});if(!n.ok)return D(n,"Delete")}return{ok:!0}},p=v({mutationKey:W(i,t,o),scope:S(i,t,o),mutationFn:async({writes:r,deletes:c,copies:u,shown:a})=>{const n=f?.source==="github"?r:B(r);return f?.source==="github"?V({queryClient:s,backend:f,params:{orgSlug:i,virtualMcpId:t,branch:o},cacheKey:d},{writes:n,deletes:c.filter(e=>!(e in n))},u,a?.()):f?N(s,f,{orgSlug:i,virtualMcpId:t,branch:o},d,{set:n,delete:c.filter(e=>!(e in n))}):R({queryClient:s,orgSlug:i,virtualMcpId:t,branch:o,backend:k,cacheKey:d},{kind:"edit",write:()=>E(n,c)})},onSuccess:()=>{f?.source!=="github"&&s.invalidateQueries({queryKey:b.liveMeta(i,t,o)})}});return{move:async(r,c)=>{const u=[...Object.keys(r.writes),...r.deletes],a=s.getQueryData(m),n=new Map;for(const e of u)a&&e in a&&n.set(e,a[e]);s.setQueryData(m,e=>I(e,r)),s.cancelQueries({queryKey:m});try{return await p.mutateAsync({...r,copies:a,shown:c?.shown})}catch(e){throw e instanceof M?(z(K,e.deleted,e.deleted&&r.deletes.length>0&&r.deletes.every(l=>L(s,d,l))),e):(Y(K,e),f?.source==="github"&&(G(e)||e instanceof X)||s.setQueryData(m,l=>{if(!l)return l;const w={...l};for(const h of u)n.has(h)?w[h]=n.get(h):delete w[h];return w}),e)}},isPending:p.isPending,isError:p.isError}}function I(i,{writes:t,deletes:o}){const s={...i??{},...t};for(const y of o)y in t||delete s[y];return s}export{I as a,fe as u};
@@ -1 +1 @@
1
- import{c as m,ar as U,at as $,i as T,al as E,K as S,a5 as N,d as F,a as I,dc as K,dd as q}from"./index-CcqLnTyv.js";import{h as y,r as _,g as v,e as G,d as D}from"./repository-binding-CuR-5wbj.js";import{p as H,u as Q,w as M}from"./thread-intent-pegObLq9.js";const b=[],Y=4;function z(t,e){return[e,...t.filter(n=>n!==e)].slice(0,Y)}function J(t){const e=m.c(9);let n;e[0]!==t?(n=$.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[s,r]=U(n,b),o=Array.isArray(s)?s:b;let a,l;e[2]!==r?(a=u=>r(c=>z(Array.isArray(c)?c:b,u)),l=u=>r(c=>(Array.isArray(c)?c:b).filter(h=>h!==u)),e[2]=r,e[3]=a,e[4]=l):(a=e[3],l=e[4]);let i;return e[5]!==o||e[6]!==a||e[7]!==l?(i={recent:o,remember:a,forget:l},e[5]=o,e[6]=a,e[7]=l,e[8]=i):i=e[8],i}function O(t,e){if(!e)return!0;if(t.partial)return!1;const n=H(t.metadata?.runtime);return n===null||n===e}function C(t,e,n,s,r){let o=null;for(const a of t)a.virtual_mcp_id===e&&a.created_by===n&&(a.hidden||O(a,s)&&(r&&a.branch===r||(!o||a.updated_at>o.updated_at)&&(o=a)));return o}function de(t,e,n,s){return t.find(r=>!r.hidden&&r.virtual_mcp_id===e&&r.created_by===n&&r.title==="New chat"&&!r.harness_id&&O(r,s))}function V(t,e,n,s,r,o){if(!r)return C(t,e,n,s)??void 0;const a=s==="cms"?new Set((o?.releases??[]).filter(i=>i.runtime==="sandbox").map(i=>i.branch)):null,l=a?.size?t.filter(i=>!i.branch||!a.has(i.branch)):t;return C(l,e,n,s,o?.baseBranch)??void 0}const W=6e4,w=3e4;function R(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function x(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function k(t){const{orgSlug:e,target:n,owner:s,repo:r,branch:o}=t;return{queryKey:S.githubPrState(e,_(n),s,r,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&y(n)&&!!s&&!!r,refetchInterval:W,refetchIntervalInBackground:!1,staleTime:w}}function X(t){const e=m.c(4);let n;e[0]!==t?(n=k(t),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s={...n,select:Z},e[2]=n,e[3]=s):s=e[3],T(s)}function Z(t){return t.changeRequest?R(t.changeRequest):null}function fe(t){const e=m.c(4);let n;e[0]!==t?(n=k(t),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s={...n,select:ee},e[2]=n,e[3]=s):s=e[3],T(s)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(x):[]}const te=5*6e4;function he(t){const e=m.c(20),{orgSlug:n,target:s,owner:r,repo:o,base:a}=t;let l;e[0]!==a||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==s?(l=S.githubLastPublishedPr(n,_(s),r,o,a),e[0]=a,e[1]=n,e[2]=r,e[3]=o,e[4]=s,e[5]=l):l=e[5];let i;e[6]!==a||e[7]!==n||e[8]!==s?(i=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...s,base:a}),e[6]=a,e[7]=n,e[8]=s,e[9]=i):i=e[9];let u;e[10]!==t.enabled||e[11]!==a||e[12]!==r||e[13]!==o||e[14]!==s?(u=(t.enabled??!0)&&!!a&&y(s)&&!!r&&!!o,e[10]=t.enabled,e[11]=a,e[12]=r,e[13]=o,e[14]=s,e[15]=u):u=e[15];let c;return e[16]!==l||e[17]!==i||e[18]!==u?(c={queryKey:l,queryFn:i,enabled:u,staleTime:te,select:ne},e[16]=l,e[17]=i,e[18]=u,e[19]=c):c=e[19],T(c)}function ne(t){return t.changeRequest?R(t.changeRequest):null}const se=50;function ge(t){const e=m.c(17),{orgSlug:n,target:s,owner:r,repo:o}=t;let a;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==s?(a=S.githubOpenPrs(n,_(s),r,o),e[0]=n,e[1]=r,e[2]=o,e[3]=s,e[4]=a):a=e[4];let l;e[5]!==n||e[6]!==s?(l=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...s,limit:se}),e[5]=n,e[6]=s,e[7]=l):l=e[7];let i;e[8]!==t.enabled||e[9]!==r||e[10]!==o||e[11]!==s?(i=(t.enabled??!0)&&y(s)&&!!r&&!!o,e[8]=t.enabled,e[9]=r,e[10]=o,e[11]=s,e[12]=i):i=e[12];let u;return e[13]!==a||e[14]!==l||e[15]!==i?(u={queryKey:a,queryFn:l,enabled:i,staleTime:w,select:ae},e[13]=a,e[14]=l,e[15]=i,e[16]=u):u=e[16],T(u)}function ae(t){return t.changeRequests.map(R)}function re(t,e){const{org:n}=N(),s=v(t);return X({orgId:n.id,orgSlug:n.slug,target:G(s),owner:s?.owner??"",repo:s?.name??"",branch:e??null}).data?.base??"main"}const oe=[];function me(){const t=m.c(13),e=F(),{org:n,locator:s}=N(),r=D(),{data:o}=I.useSession(),a=Q(),l=re(void 0,null),{remember:i}=J(n.slug);let u;t[0]!==l||t[1]!==r||t[2]!==s||t[3]!==a?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==o?.user?.id?(u=(d,g,f)=>{if(K(g).kind==="org-destination"){q(e,{tabId:g,org:n.slug,agentId:d,replace:!1});return}const A=(r??[]).find(j=>j.id===d),B=!!(A&&v(A)),P=!f,L=P?void 0:V(a?.threads.get()??oe,d,o?.user?.id,f,B,{baseBranch:l}),p=P?void 0:L?.id??crypto.randomUUID();p&&!L&&f&&M(sessionStorage,s,p,{runtime:f}),q(e,{tabId:g,org:n.slug,agentId:d,search:()=>p?{thread:p}:{},replace:!1})},t[0]=l,t[1]=r,t[2]=s,t[3]=a?.threads,t[4]=e,t[5]=n.slug,t[6]=o?.user?.id,t[7]=u):u=t[7];const c=u;let h;return t[8]!==c||t[9]!==e||t[10]!==n.slug||t[11]!==i?(h=(d,g)=>{const f=g?.panel;if(!f){i(d),e(ie(n.slug,d));return}c(d,f,g?.runtime)},t[8]=c,t[9]=e,t[10]=n.slug,t[11]=i,t[12]=h):h=t[12],h}function ie(t,e){return{to:"/$org/projects/$agentId",params:{org:t,agentId:e},search:n=>({...n,project:void 0,virtualmcpid:void 0,thread:void 0,mainpanel:void 0})}}export{J as a,re as b,V as c,ge as d,X as e,de as f,he as g,fe as h,k as p,me as u};
1
+ import{c as m,ar as U,at as $,i as T,al as E,K as S,a5 as N,d as F,a as I,df as K,dg as q}from"./index-DEZ1imMJ.js";import{h as y,r as _,g as v,e as G,d as D}from"./repository-binding-C0msapZZ.js";import{p as H,u as Q,w as M}from"./thread-intent-DuI80508.js";const b=[],Y=4;function z(t,e){return[e,...t.filter(n=>n!==e)].slice(0,Y)}function J(t){const e=m.c(9);let n;e[0]!==t?(n=$.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[s,r]=U(n,b),o=Array.isArray(s)?s:b;let a,l;e[2]!==r?(a=u=>r(c=>z(Array.isArray(c)?c:b,u)),l=u=>r(c=>(Array.isArray(c)?c:b).filter(h=>h!==u)),e[2]=r,e[3]=a,e[4]=l):(a=e[3],l=e[4]);let i;return e[5]!==o||e[6]!==a||e[7]!==l?(i={recent:o,remember:a,forget:l},e[5]=o,e[6]=a,e[7]=l,e[8]=i):i=e[8],i}function O(t,e){if(!e)return!0;if(t.partial)return!1;const n=H(t.metadata?.runtime);return n===null||n===e}function C(t,e,n,s,r){let o=null;for(const a of t)a.virtual_mcp_id===e&&a.created_by===n&&(a.hidden||O(a,s)&&(r&&a.branch===r||(!o||a.updated_at>o.updated_at)&&(o=a)));return o}function de(t,e,n,s){return t.find(r=>!r.hidden&&r.virtual_mcp_id===e&&r.created_by===n&&r.title==="New chat"&&!r.harness_id&&O(r,s))}function V(t,e,n,s,r,o){if(!r)return C(t,e,n,s)??void 0;const a=s==="cms"?new Set((o?.releases??[]).filter(i=>i.runtime==="sandbox").map(i=>i.branch)):null,l=a?.size?t.filter(i=>!i.branch||!a.has(i.branch)):t;return C(l,e,n,s,o?.baseBranch)??void 0}const W=6e4,w=3e4;function R(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function x(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function k(t){const{orgSlug:e,target:n,owner:s,repo:r,branch:o}=t;return{queryKey:S.githubPrState(e,_(n),s,r,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&y(n)&&!!s&&!!r,refetchInterval:W,refetchIntervalInBackground:!1,staleTime:w}}function X(t){const e=m.c(4);let n;e[0]!==t?(n=k(t),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s={...n,select:Z},e[2]=n,e[3]=s):s=e[3],T(s)}function Z(t){return t.changeRequest?R(t.changeRequest):null}function fe(t){const e=m.c(4);let n;e[0]!==t?(n=k(t),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s={...n,select:ee},e[2]=n,e[3]=s):s=e[3],T(s)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(x):[]}const te=5*6e4;function he(t){const e=m.c(20),{orgSlug:n,target:s,owner:r,repo:o,base:a}=t;let l;e[0]!==a||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==s?(l=S.githubLastPublishedPr(n,_(s),r,o,a),e[0]=a,e[1]=n,e[2]=r,e[3]=o,e[4]=s,e[5]=l):l=e[5];let i;e[6]!==a||e[7]!==n||e[8]!==s?(i=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...s,base:a}),e[6]=a,e[7]=n,e[8]=s,e[9]=i):i=e[9];let u;e[10]!==t.enabled||e[11]!==a||e[12]!==r||e[13]!==o||e[14]!==s?(u=(t.enabled??!0)&&!!a&&y(s)&&!!r&&!!o,e[10]=t.enabled,e[11]=a,e[12]=r,e[13]=o,e[14]=s,e[15]=u):u=e[15];let c;return e[16]!==l||e[17]!==i||e[18]!==u?(c={queryKey:l,queryFn:i,enabled:u,staleTime:te,select:ne},e[16]=l,e[17]=i,e[18]=u,e[19]=c):c=e[19],T(c)}function ne(t){return t.changeRequest?R(t.changeRequest):null}const se=50;function ge(t){const e=m.c(17),{orgSlug:n,target:s,owner:r,repo:o}=t;let a;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==s?(a=S.githubOpenPrs(n,_(s),r,o),e[0]=n,e[1]=r,e[2]=o,e[3]=s,e[4]=a):a=e[4];let l;e[5]!==n||e[6]!==s?(l=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...s,limit:se}),e[5]=n,e[6]=s,e[7]=l):l=e[7];let i;e[8]!==t.enabled||e[9]!==r||e[10]!==o||e[11]!==s?(i=(t.enabled??!0)&&y(s)&&!!r&&!!o,e[8]=t.enabled,e[9]=r,e[10]=o,e[11]=s,e[12]=i):i=e[12];let u;return e[13]!==a||e[14]!==l||e[15]!==i?(u={queryKey:a,queryFn:l,enabled:i,staleTime:w,select:ae},e[13]=a,e[14]=l,e[15]=i,e[16]=u):u=e[16],T(u)}function ae(t){return t.changeRequests.map(R)}function re(t,e){const{org:n}=N(),s=v(t);return X({orgId:n.id,orgSlug:n.slug,target:G(s),owner:s?.owner??"",repo:s?.name??"",branch:e??null}).data?.base??"main"}const oe=[];function me(){const t=m.c(13),e=F(),{org:n,locator:s}=N(),r=D(),{data:o}=I.useSession(),a=Q(),l=re(void 0,null),{remember:i}=J(n.slug);let u;t[0]!==l||t[1]!==r||t[2]!==s||t[3]!==a?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==o?.user?.id?(u=(d,g,f)=>{if(K(g).kind==="org-destination"){q(e,{tabId:g,org:n.slug,agentId:d,replace:!1});return}const A=(r??[]).find(j=>j.id===d),B=!!(A&&v(A)),P=!f,L=P?void 0:V(a?.threads.get()??oe,d,o?.user?.id,f,B,{baseBranch:l}),p=P?void 0:L?.id??crypto.randomUUID();p&&!L&&f&&M(sessionStorage,s,p,{runtime:f}),q(e,{tabId:g,org:n.slug,agentId:d,search:()=>p?{thread:p}:{},replace:!1})},t[0]=l,t[1]=r,t[2]=s,t[3]=a?.threads,t[4]=e,t[5]=n.slug,t[6]=o?.user?.id,t[7]=u):u=t[7];const c=u;let h;return t[8]!==c||t[9]!==e||t[10]!==n.slug||t[11]!==i?(h=(d,g)=>{const f=g?.panel;if(!f){i(d),e(ie(n.slug,d));return}c(d,f,g?.runtime)},t[8]=c,t[9]=e,t[10]=n.slug,t[11]=i,t[12]=h):h=t[12],h}function ie(t,e){return{to:"/$org/projects/$agentId",params:{org:t,agentId:e},search:n=>({...n,project:void 0,virtualmcpid:void 0,thread:void 0,mainpanel:void 0})}}export{J as a,re as b,V as c,ge as d,X as e,de as f,he as g,fe as h,k as p,me as u};
@@ -1 +1 @@
1
- import{c as F,a5 as w,K as y,i as $,q as k,e as P}from"./index-CcqLnTyv.js";import{u as x}from"./useInfiniteQuery-WRSkkanY.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function p(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}async function E(n,e,t){return(await(await h(p(n,e,"list",{path:t}))).json()).entries.toSorted((r,a)=>r.kind!==a.kind?r.kind==="dir"?-1:1:r.path.localeCompare(a.path))}function Z(n,e,t){const s=F.c(16),{org:i}=w(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==i.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?f:void 0,s[4]=i.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=()=>E(i.slug,n,e),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==r||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:r,queryKey:a,placeholderData:o,queryFn:c},s[11]=r,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}async function _(n,e,t){const s=await h(p(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=F.c(16),{org:i}=w();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==i.slug||s[7]!==e||s[8]!==n?(l=()=>_(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==r||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:r,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=r,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=F.c(9),s=n===void 0?60:n,{org:i}=w();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==i.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=o):o=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==o?(c={queryKey:r,enabled:a,queryFn:o},t[5]=r,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=F.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==t.slug||e[4]!==n?(i=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,initialPageParam:null,queryFn:i,getNextPageParam:C},e[6]=s,e[7]=i,e[8]=r):r=e[8],x(r)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=F.c(16),{org:s}=w();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==o?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:o},t[11]=i,t[12]=r,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=F.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const i=n?.enabled;let r;e[2]!==t.slug?(r=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function ie(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function M(n,e,t){return(await h(p(n,e,"read",{path:t}))).text()}function re(n,e){const t=F.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(p(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&r.length<D?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(i(u));return}f+=d.length,l.push({relPath:i(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function le(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>p(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=F.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,i)=>p(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(p(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,i,r="text/markdown; charset=utf-8"){const a={"content-type":r};i&&"absent"in i?a["if-none-match"]="*":i&&(a["if-match"]=`"${i.contentHash}"`);const o=await fetch(p(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=F.c(18),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==n?(i=async l=>(await(await h(p(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=r):r=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==o?(c={mutationFn:i,onMutate:r,onError:a,onSettled:o},e[13]=i,e[14]=r,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=F.c(33),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async S=>{const T=(await Promise.allSettled(S.files.map(L=>{const q=S.dir?`${S.dir}/${L.name}`:L.name;return h(p(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(Y);if(T)throw T.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==r||e[8]!==a?(o={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(p(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==r||e[14]!==l?(f={mutationFn:l,onSuccess:r},e[13]=r,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(p(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(p(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==r||e[26]!==m?(I={mutationFn:m,onSuccess:r},e[25]=r,e[26]=m,e[27]=I):I=e[27];const O=P(I);let K;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{le as a,Q as b,v as c,ue as d,G as e,ae as f,de as g,re as h,E as i,ie as j,ge as k,ce as l,X as m,_ as n,M as o,ee as p,ne as q,oe as r,se as s,te as t,Z as u,fe as w};
1
+ import{c as F,a5 as w,K as y,i as $,q as k,e as P}from"./index-DEZ1imMJ.js";import{u as x}from"./useInfiniteQuery-CtNfxLxq.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function p(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}async function E(n,e,t){return(await(await h(p(n,e,"list",{path:t}))).json()).entries.toSorted((r,a)=>r.kind!==a.kind?r.kind==="dir"?-1:1:r.path.localeCompare(a.path))}function Z(n,e,t){const s=F.c(16),{org:i}=w(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==i.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?f:void 0,s[4]=i.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=()=>E(i.slug,n,e),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==r||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:r,queryKey:a,placeholderData:o,queryFn:c},s[11]=r,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}async function _(n,e,t){const s=await h(p(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=F.c(16),{org:i}=w();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==i.slug||s[7]!==e||s[8]!==n?(l=()=>_(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==r||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:r,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=r,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=F.c(9),s=n===void 0?60:n,{org:i}=w();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==i.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=o):o=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==o?(c={queryKey:r,enabled:a,queryFn:o},t[5]=r,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=F.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==t.slug||e[4]!==n?(i=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,initialPageParam:null,queryFn:i,getNextPageParam:C},e[6]=s,e[7]=i,e[8]=r):r=e[8],x(r)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=F.c(16),{org:s}=w();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==o?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:o},t[11]=i,t[12]=r,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=F.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const i=n?.enabled;let r;e[2]!==t.slug?(r=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function ie(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function M(n,e,t){return(await h(p(n,e,"read",{path:t}))).text()}function re(n,e){const t=F.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(p(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&r.length<D?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(i(u));return}f+=d.length,l.push({relPath:i(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function le(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>p(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=F.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,i)=>p(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(p(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,i,r="text/markdown; charset=utf-8"){const a={"content-type":r};i&&"absent"in i?a["if-none-match"]="*":i&&(a["if-match"]=`"${i.contentHash}"`);const o=await fetch(p(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=F.c(18),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==n?(i=async l=>(await(await h(p(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=r):r=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==o?(c={mutationFn:i,onMutate:r,onError:a,onSettled:o},e[13]=i,e[14]=r,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=F.c(33),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async S=>{const T=(await Promise.allSettled(S.files.map(L=>{const q=S.dir?`${S.dir}/${L.name}`:L.name;return h(p(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(Y);if(T)throw T.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==r||e[8]!==a?(o={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(p(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==r||e[14]!==l?(f={mutationFn:l,onSuccess:r},e[13]=r,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(p(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(p(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==r||e[26]!==m?(I={mutationFn:m,onSuccess:r},e[25]=r,e[26]=m,e[27]=I):I=e[27];const O=P(I);let K;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{le as a,Q as b,v as c,ue as d,G as e,ae as f,de as g,re as h,E as i,ie as j,ge as k,ce as l,X as m,_ as n,M as o,ee as p,ne as q,oe as r,se as s,te as t,Z as u,fe as w};
@@ -1 +1 @@
1
- import{c as r,a5 as f,ak as y,K as S,i as _,q as d,e as R}from"./index-CcqLnTyv.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 i;e[0]!==n.id?(i=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=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]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,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(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=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]!==c||e[10]!==a?(l={mutationFn:c,onSuccess:a,onSettled:o},e[8]=o,e[9]=c,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(),i=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]!==i?(o=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{P as a,q as b,T as c,g as u};
1
+ import{c as r,a5 as f,ak as y,K as S,i as _,q as d,e as R}from"./index-DEZ1imMJ.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 i;e[0]!==n.id?(i=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=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]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,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(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=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]!==c||e[10]!==a?(l={mutationFn:c,onSuccess:a,onSettled:o},e[8]=o,e[9]=c,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(),i=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]!==i?(o=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{P as a,q as b,T as c,g as u};
@@ -1 +1 @@
1
- import{c as u,i as S,q as r,e as y,K as c}from"./index-CcqLnTyv.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,i as S,q as r,e as y,K as c}from"./index-DEZ1imMJ.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{c as u,a as w,bU as y,a5 as E,i as F,al as M,K as b,ak as T,q as A,e as O}from"./index-CcqLnTyv.js";import{D as C,o as G,a as $}from"./schema-D4ZSsKIV.js";import{r as z}from"./task-board-DcTNURQy.js";const I={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},x={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function P(t,e){return{queryKey:b.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function c(t){const e=u.c(7),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=P(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],F(i)}function _(){const t=u.c(9),{org:e}=E(),n=T(),s=A();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(b.organizationSettings(e.id),r=>({...r??I,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],O(i)}function R(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}}:x}function Y(){const{data:t}=c(D);return t??x}function D(t){return R(t.simple_mode)}function j(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function B(){return d("reports_only")}function d(t){const e=u.c(5);let n;e[0]!==t?(n=a=>G(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=c(n);let o;return e[2]!==s||e[3]!==t?(o=s??C.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function V(t){const e=u.c(6);let n;e[0]!==t?(n=i=>G(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=c(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?C.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function W(){const t=d("chat_harness_sandbox_only");return y().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=E(),n=T(),s=A();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(b.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],O(i)}function k(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const t=u.c(8),{data:e}=w.useSession(),n=y();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||k(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=d("hosting_enabled"),r=d("e2e_enabled"),m=d("monitor_enabled"),N=d("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||i||m,h=o||a||N;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==h?(f={hosting:g,e2e:S,monitor:p,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=h,t[7]=f):f=t[7],f}function X(){const{data:t}=c(L);return t??!1}function L(t){return $(t.flags)}function tt(){const{data:t}=c(U);return t??!0}function U(t){return z(t.flags)}function et(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function nt(){const t=u.c(2),{data:e}=c(q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function q(t){return t.coding_agent_mcp_excluded}function st(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function ot(){const t=u.c(2),{data:e}=c(Q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Q(t){return t.submodule_credentials}function at(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{d as a,W as b,V as c,Y as d,J as e,tt as f,H as g,X as h,et as i,nt as j,st as k,j as l,ot as m,at as n,B as u};
1
+ import{c as u,a as w,bU as y,a5 as E,i as F,al as M,K as b,ak as T,q as A,e as O}from"./index-DEZ1imMJ.js";import{D as C,o as G,a as $}from"./schema-9jBUPMLq.js";import{r as z}from"./task-board-D3wT6_aG.js";const I={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},x={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function P(t,e){return{queryKey:b.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function c(t){const e=u.c(7),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=P(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],F(i)}function _(){const t=u.c(9),{org:e}=E(),n=T(),s=A();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(b.organizationSettings(e.id),r=>({...r??I,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],O(i)}function R(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}}:x}function Y(){const{data:t}=c(D);return t??x}function D(t){return R(t.simple_mode)}function j(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function B(){return d("reports_only")}function d(t){const e=u.c(5);let n;e[0]!==t?(n=a=>G(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=c(n);let o;return e[2]!==s||e[3]!==t?(o=s??C.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function V(t){const e=u.c(6);let n;e[0]!==t?(n=i=>G(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=c(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?C.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function W(){const t=d("chat_harness_sandbox_only");return y().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=E(),n=T(),s=A();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(b.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],O(i)}function k(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const t=u.c(8),{data:e}=w.useSession(),n=y();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||k(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=d("hosting_enabled"),r=d("e2e_enabled"),m=d("monitor_enabled"),N=d("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||i||m,h=o||a||N;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==h?(f={hosting:g,e2e:S,monitor:p,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=h,t[7]=f):f=t[7],f}function X(){const{data:t}=c(L);return t??!1}function L(t){return $(t.flags)}function tt(){const{data:t}=c(U);return t??!0}function U(t){return z(t.flags)}function et(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function nt(){const t=u.c(2),{data:e}=c(q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function q(t){return t.coding_agent_mcp_excluded}function st(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function ot(){const t=u.c(2),{data:e}=c(Q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Q(t){return t.submodule_credentials}function at(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{d as a,W as b,V as c,Y as d,J as e,tt as f,H as g,X as h,et as i,nt as j,st as k,j as l,ot as m,at as n,B as u};
@@ -1 +1 @@
1
- import{c as v,a5 as D,bU as y,gN as C,i as N,K as O}from"./index-CcqLnTyv.js";import{m as T}from"./match-site-slug-config-D3fUJ6vX.js";import{u as W}from"./use-file-configs-D7-mFpqA.js";import{e as B}from"./use-organization-settings-sxurgilE.js";import{b as J}from"./use-blocks-v8-project-BPQNHFav.js";const l=["overview","context","monitor","plan","reports","board","site-editor","calendar","experiments","assets","releases","hosting","e2e","automations"],U=["overview","reports","board","site-editor"],R=1,P=["overview","context","monitor","plan","board"],K=["calendar","experiments"];function h(t){return t?[...P,...K]:P}function $(t,e){const n=new Set(t??[]);return h(e).filter(s=>!n.has(s))}function ee(t,e){const n=new Set([...t??[],...h(e)]);return l.filter(s=>n.has(s))}function te(t,e){if(!t&&e===void 0)return new Set(P);const n=new Set(e!==void 0?S(e,R):S(F(t),t?.sidebarViewsVersion,$(t?.sidebarViewsSeen,!1)));return new Set(P.filter(s=>n.has(s)))}const k=["calendar","experiments","assets","releases","hosting","e2e"];function se(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const s=e?.id===t?e:n?.id===t?n:null;return{project:s,resolvedScopeId:s?t:null}}function F(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function S(t,e,n=[]){const s=new Set(t??[]);if(e!==R)for(const r of U)s.add(r);for(const r of n)s.add(r);return l.filter(r=>s.has(r))}function q(t){return l.some(e=>e===t)}function L(t){return k.some(e=>e===t)}function Q(t,e){return{overview:t,context:!0,monitor:!0,plan:!0,reports:t,board:t,"site-editor":t,assets:e.assets,releases:t&&e.releases,hosting:e.hosting,e2e:e.e2e,calendar:t&&e.calendar,experiments:t&&e.experiments,automations:!0}}function ne(t,e,n){const s=Q(e,n);return t?s:{...s,overview:!0,reports:!0,board:!0}}function re(t,e,n,s=[]){const r=new Set(S(t,n,s));return l.filter(o=>e[o]&&r.has(o))}function oe(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ie(t){return l.filter(e=>t[e])}function Y(t,e,n){return!q(t)||e[t]?!1:!L(t)||t==="releases"||t==="calendar"||t==="experiments"?!0:!(t==="assets"?n.assets:n.siteAccess)}function ce(t,e,n,s,r){return Y(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!s.includes("content")||t==="code"&&r&&!s.includes("code")}function ae(t,e,n,s){const r=new Set(S(t,s));return n?r.add(e):r.delete(e),l.filter(o=>r.has(o))}function fe(t){const e=v.c(19),{org:n}=D(),s=y(),r=B(),o=W();let i;e[0]!==t?(i=J(t),e[0]=t,e[1]=i):i=e[1];const c=i;let d;e[2]!==t?(d=C(t),e[2]=t,e[3]=d):d=e[3];const a=d,p=s.hostingEnabled===!0,A=p&&!!a,x=z(n.slug,a,A),I=x.data?.owned===!0;let f;e[4]!==o.data?.configs?(f=o.data?.configs??[],e[4]=o.data?.configs,e[5]=f):f=e[5];let V;e[6]!==a||e[7]!==f?(V=T(f,a),e[6]=a,e[7]=f,e[8]=V):V=e[8];const b=!!V,m=c&&!!t?.metadata?.siteSlug,E=p&&I&&r.hosting,g=p&&I&&r.e2e;let u;e[9]!==b||e[10]!==m||e[11]!==E||e[12]!==g||e[13]!==c?(u={assets:b,releases:m,hosting:E,e2e:g,calendar:c,experiments:c},e[9]=b,e[10]=m,e[11]=E,e[12]=g,e[13]=c,e[14]=u):u=e[14];const _=!!a&&o.isPending,j=A&&x.isPending;let w;return e[15]!==j||e[16]!==u||e[17]!==_?(w={presence:u,assetsPending:_,siteAccessPending:j},e[15]=j,e[16]=u,e[17]=_,e[18]=w):w=e[18],w}function z(t,e,n){const s=v.c(10);let r;s[0]!==t||s[1]!==e?(r=O.hostingAccess(t,e??""),s[0]=t,s[1]=e,s[2]=r):r=s[2];let o;s[3]!==t||s[4]!==e?(o=async()=>{const c=await fetch(`/api/${t}/hosting/${encodeURIComponent(e??"")}/access`);return c.ok?await c.json():{owned:!1,canWrite:!1}},s[3]=t,s[4]=e,s[5]=o):o=s[5];let i;return s[6]!==n||s[7]!==r||s[8]!==o?(i={queryKey:r,queryFn:o,enabled:n,staleTime:6e4},s[6]=n,s[7]=r,s[8]=o,s[9]=i):i=s[9],N(i)}export{k as P,re as a,R as b,se as c,ne as d,ce as e,Y as f,S as g,ie as h,P as i,ee as j,oe as k,$ as o,Q as p,F as r,te as s,ae as t,fe as u};
1
+ import{c as v,a5 as D,bU as y,gP as C,i as O,K as T}from"./index-DEZ1imMJ.js";import{m as W}from"./match-site-slug-config-D3fUJ6vX.js";import{u as N}from"./use-file-configs-DhXDYO83.js";import{e as B}from"./use-organization-settings-bWX185lw.js";import{b as J}from"./use-blocks-v8-project-4PZwWSEO.js";const l=["overview","context","monitor","plan","reports","board","site-editor","calendar","experiments","assets","releases","hosting","e2e","automations"],U=["overview","reports","board","site-editor"],R=1,w=["overview","context","monitor","plan","board"],K=["calendar","experiments"];function h(t){return t?[...w,...K]:w}function $(t,e){const n=new Set(t??[]);return h(e).filter(s=>!n.has(s))}function ee(t,e){const n=new Set([...t??[],...h(e)]);return l.filter(s=>n.has(s))}function te(t,e){if(!t&&e===void 0)return new Set(w);const n=new Set(e!==void 0?S(e,R):S(F(t),t?.sidebarViewsVersion,$(t?.sidebarViewsSeen,!1)));return new Set(w.filter(s=>n.has(s)))}const k=["calendar","experiments","assets","releases","hosting","e2e"];function se(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const s=e?.id===t?e:n?.id===t?n:null;return{project:s,resolvedScopeId:s?t:null}}function F(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function S(t,e,n=[]){const s=new Set(t??[]);if(e!==R)for(const r of U)s.add(r);for(const r of n)s.add(r);return l.filter(r=>s.has(r))}function q(t){return l.some(e=>e===t)}function L(t){return k.some(e=>e===t)}function Q(t,e){return{overview:t,context:!0,monitor:!0,plan:!0,reports:t,board:t,"site-editor":t,assets:e.assets,releases:t&&e.releases,hosting:e.hosting,e2e:e.e2e,calendar:t&&e.calendar,experiments:t&&e.experiments,automations:!0}}function ne(t,e,n){const s=Q(e,n);return t?s:{...s,overview:!0,reports:!0,board:!0}}function re(t,e,n,s=[]){const r=new Set(S(t,n,s));return l.filter(o=>e[o]&&r.has(o))}function oe(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ie(t){return l.filter(e=>t[e])}function Y(t,e,n){return!q(t)||e[t]?!1:!L(t)||t==="releases"||t==="calendar"||t==="experiments"?!0:!(t==="assets"?n.assets:n.siteAccess)}function ce(t,e,n,s,r){return Y(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!s.includes("content")||t==="code"&&r&&!s.includes("code")}function ae(t,e,n,s){const r=new Set(S(t,s));return n?r.add(e):r.delete(e),l.filter(o=>r.has(o))}function fe(t){const e=v.c(19),{org:n}=D(),s=y(),r=B(),o=N();let i;e[0]!==t?(i=J(t),e[0]=t,e[1]=i):i=e[1];const c=i;let d;e[2]!==t?(d=C(t),e[2]=t,e[3]=d):d=e[3];const a=d,p=s.hostingEnabled===!0,A=p&&!!a,x=z(n.slug,a,A),I=x.data?.owned===!0;let f;e[4]!==o.data?.configs?(f=o.data?.configs??[],e[4]=o.data?.configs,e[5]=f):f=e[5];let V;e[6]!==a||e[7]!==f?(V=W(f,a),e[6]=a,e[7]=f,e[8]=V):V=e[8];const b=!!V,m=c&&!!t?.metadata?.siteSlug,E=p&&I&&r.hosting,g=p&&I&&r.e2e;let u;e[9]!==b||e[10]!==m||e[11]!==E||e[12]!==g||e[13]!==c?(u={assets:b,releases:m,hosting:E,e2e:g,calendar:c,experiments:c},e[9]=b,e[10]=m,e[11]=E,e[12]=g,e[13]=c,e[14]=u):u=e[14];const _=!!a&&o.isPending,j=A&&x.isPending;let P;return e[15]!==j||e[16]!==u||e[17]!==_?(P={presence:u,assetsPending:_,siteAccessPending:j},e[15]=j,e[16]=u,e[17]=_,e[18]=P):P=e[18],P}function z(t,e,n){const s=v.c(10);let r;s[0]!==t||s[1]!==e?(r=T.hostingAccess(t,e??""),s[0]=t,s[1]=e,s[2]=r):r=s[2];let o;s[3]!==t||s[4]!==e?(o=async()=>{const c=await fetch(`/api/${t}/hosting/${encodeURIComponent(e??"")}/access`);return c.ok?await c.json():{owned:!1,canWrite:!1}},s[3]=t,s[4]=e,s[5]=o):o=s[5];let i;return s[6]!==n||s[7]!==r||s[8]!==o?(i={queryKey:r,queryFn:o,enabled:n,staleTime:6e4},s[6]=n,s[7]=r,s[8]=o,s[9]=i):i=s[9],O(i)}export{k as P,re as a,R as b,se as c,ne as d,ce as e,Y as f,S as g,ie as h,w as i,ee as j,oe as k,$ as o,Q as p,F as r,te as s,ae as t,fe as u};
@@ -0,0 +1 @@
1
+ import{c as I,f as P,u as T,d as N,ee as R,ef as E,dg as k,af as l}from"./index-DEZ1imMJ.js";import{d as C,b as O,p as w}from"./repository-binding-C0msapZZ.js";const x=1;function _(e){return(e??[]).filter(E)}function M(){const e=I.c(4);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const r=P(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const t=T(n);if(r.agentId)return r.agentId;let a;return e[2]!==t?(a="virtualmcpid"in t&&typeof t.virtualmcpid=="string"?t.virtualmcpid.trim():void 0,e[2]=t,e[3]=a):a=e[3],a||null}function D(){const e=I.c(16),o=N();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const n=P(r),t=R(),a=C(),c=_(a),s=M(),y=c.find(i=>i.id===s)??null;let p;e[1]!==a||e[2]!==s?(p=s&&a.length>0&&!a.some(i=>i.id===s)?s:null,e[1]=a,e[2]=s,e[3]=p):p=e[3];const b=O(p),u=y??_(b?[b]:[])[0]??null;let m;e[4]!==t||e[5]!==o||e[6]!==n||e[7]!==s?(m=i=>{if(i===s&&t!==void 0)return;const h=n.org??"",S=V;if(i){k(o,{org:h,agentId:i,tabId:t==="board"||t==="reports"?t:"overview",search:S,replace:!1});return}if(t==="board"){o({to:l.tasks,params:{org:h,taskKey:void 0},search:S});return}const j=t==="files"?l.library:t==="monitoring"?l.monitoring:t==="plan"?l.plan:l.home;o({to:j,params:{org:h},search:S})},e[4]=t,e[5]=o,e[6]=n,e[7]=s,e[8]=m):m=e[8];const d=m,v=w(u),g=c.length>=x;let f;return e[9]!==u||e[10]!==c||e[11]!==s||e[12]!==d||e[13]!==v||e[14]!==g?(f={scopeId:s,project:u,repo:v,projects:c,hasProjects:g,setScope:d},e[9]=u,e[10]=c,e[11]=s,e[12]=d,e[13]=v,e[14]=g,e[15]=f):f=e[15],f}function V(e){return{...e,virtualmcpid:void 0,thread:void 0,mainpanel:void 0,path:void 0,preview:void 0,expanded:void 0}}export{D as a,_ as s,M as u};
@@ -1 +1 @@
1
- import{r as m,c as f,l as I,ar as A,at as j,ah as y}from"./index-CcqLnTyv.js";import{P as N}from"./project-apps-sFKq8oaX.js";import{b}from"./repository-binding-CuR-5wbj.js";function g(n,t){const e=new Set(t);return e.size===0?n:n.filter(c=>e.has(c.connectionId))}function E(n){const t=n.metadata?.ui;return Array.isArray(t?.pinnedViews)?t.pinnedViews.filter(e=>!!e&&typeof e=="object"&&typeof e.connectionId=="string"&&typeof e.toolName=="string"&&["undefined","string"].includes(typeof e.label)&&(e.icon==null||typeof e.icon=="string")):[]}const P=4;function d(n,t){return n.app===t.app&&n.projectId===t.projectId}function R(n,t,e=P){return[t,...n.filter(c=>!d(c,t))].slice(0,e)}function h(n,t){return n.filter(e=>!d(e,t))}function w(n,t,e){const c=n.findLast(l=>l.staticData.mainView);if(!c)return null;const{mainView:i,siteEditorView:s,local:r}=c.staticData;if(!i)return null;const o=c.params,a=o?.agentId;if(a&&i==="app"&&o.connectionId&&o.toolName)return{app:e(o.connectionId,o.toolName),projectId:a,connection:{id:o.connectionId,toolName:o.toolName}};const p=s?"site-editor":i;return t(p)?a?{app:p,projectId:a}:r?{app:p,projectId:null}:null:null}const u=[];function V(n){const t=f.c(9);let e;t[0]!==n?(e=j.recentApps(n),t[0]=n,t[1]=e):e=t[1];const[c,i]=A(e,u),s=Array.isArray(c)?c:u;let r,o;t[2]!==i?(r=p=>i(l=>R(Array.isArray(l)?l:[],p)),o=p=>i(l=>h(Array.isArray(l)?l:[],p)),t[2]=i,t[3]=r,t[4]=o):(r=t[3],o=t[4]);let a;return t[5]!==s||t[6]!==r||t[7]!==o?(a={recent:s,remember:r,forget:o},t[5]=s,t[6]=r,t[7]=o,t[8]=a):a=t[8],a}function O(){const n=f.c(1);let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:S,structuralSharing:!0},n[0]=t):t=n[0],I(t)}function S(n){return w(n.matches,T,y)}function T(n){return n in N}function k(n){const{remember:t}=V(n),e=O(),c=b(e?.projectId),i=e?.projectId&&c?.id===e.projectId?c.title:null,s=e?.connection&&c?E(c).find(o=>o.connectionId===e.connection?.id&&o.toolName===e.connection.toolName):void 0,r=e?.connection&&{id:e.connection.id,toolName:e.connection.toolName,label:s?.label||e.connection.toolName,icon:s?.icon};m.useEffect(()=>{!e?.projectId||!i||t({app:e.app,projectId:e.projectId,projectTitle:i,...r&&{connection:r}})},[n,e?.app,e?.projectId,i,r?.label,r?.icon])}export{O as a,V as b,g as k,E as p,k as u};
1
+ import{r as m,c as f,l as I,ar as A,at as j,ah as y}from"./index-DEZ1imMJ.js";import{P as N}from"./project-apps-B_xWF85u.js";import{b}from"./repository-binding-C0msapZZ.js";function g(n,t){const e=new Set(t);return e.size===0?n:n.filter(c=>e.has(c.connectionId))}function E(n){const t=n.metadata?.ui;return Array.isArray(t?.pinnedViews)?t.pinnedViews.filter(e=>!!e&&typeof e=="object"&&typeof e.connectionId=="string"&&typeof e.toolName=="string"&&["undefined","string"].includes(typeof e.label)&&(e.icon==null||typeof e.icon=="string")):[]}const P=4;function d(n,t){return n.app===t.app&&n.projectId===t.projectId}function R(n,t,e=P){return[t,...n.filter(c=>!d(c,t))].slice(0,e)}function h(n,t){return n.filter(e=>!d(e,t))}function w(n,t,e){const c=n.findLast(l=>l.staticData.mainView);if(!c)return null;const{mainView:i,siteEditorView:s,local:r}=c.staticData;if(!i)return null;const o=c.params,a=o?.agentId;if(a&&i==="app"&&o.connectionId&&o.toolName)return{app:e(o.connectionId,o.toolName),projectId:a,connection:{id:o.connectionId,toolName:o.toolName}};const p=s?"site-editor":i;return t(p)?a?{app:p,projectId:a}:r?{app:p,projectId:null}:null:null}const u=[];function V(n){const t=f.c(9);let e;t[0]!==n?(e=j.recentApps(n),t[0]=n,t[1]=e):e=t[1];const[c,i]=A(e,u),s=Array.isArray(c)?c:u;let r,o;t[2]!==i?(r=p=>i(l=>R(Array.isArray(l)?l:[],p)),o=p=>i(l=>h(Array.isArray(l)?l:[],p)),t[2]=i,t[3]=r,t[4]=o):(r=t[3],o=t[4]);let a;return t[5]!==s||t[6]!==r||t[7]!==o?(a={recent:s,remember:r,forget:o},t[5]=s,t[6]=r,t[7]=o,t[8]=a):a=t[8],a}function O(){const n=f.c(1);let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:S,structuralSharing:!0},n[0]=t):t=n[0],I(t)}function S(n){return w(n.matches,T,y)}function T(n){return n in N}function k(n){const{remember:t}=V(n),e=O(),c=b(e?.projectId),i=e?.projectId&&c?.id===e.projectId?c.title:null,s=e?.connection&&c?E(c).find(o=>o.connectionId===e.connection?.id&&o.toolName===e.connection.toolName):void 0,r=e?.connection&&{id:e.connection.id,toolName:e.connection.toolName,label:s?.label||e.connection.toolName,icon:s?.icon};m.useEffect(()=>{!e?.projectId||!i||t({app:e.app,projectId:e.projectId,projectTitle:i,...r&&{connection:r}})},[n,e?.app,e?.projectId,i,r?.label,r?.icon])}export{O as a,V as b,g as k,E as p,k as u};
@@ -1 +1 @@
1
- import{c as N,a5 as Q,W as F,T as A,i as f,K as R,gV as L,$ as K,U}from"./index-CcqLnTyv.js";import{m as O}from"./use-mcp-client-DvDomB9A.js";import{u as h}from"./companions-core-DhUD88pR.js";function D(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function M(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:R.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const _=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(_)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=R.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const _=await s.callTool({name:L,arguments:{}});return h(_).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=M({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const T=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==T||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:T},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=T,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&D(n.state.data)==="generating"?b:!1}function B(n,e){return{to:K.app,params:{org:n.slug,agentId:U(n.id),connectionId:e,toolName:L},search:{}}}export{D as d,B as r,j as u};
1
+ import{c as N,a5 as Q,W as F,T as A,i as f,K as R,gX as L,$ as K,U}from"./index-DEZ1imMJ.js";import{m as O}from"./use-mcp-client-DJjkIlNp.js";import{u as h}from"./companions-core-DhUD88pR.js";function D(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function M(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:R.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const _=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(_)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=R.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const _=await s.callTool({name:L,arguments:{}});return h(_).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=M({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const T=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==T||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:T},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=T,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&D(n.state.data)==="generating"?b:!1}function B(n,e){return{to:K.app,params:{org:n.slug,agentId:U(n.id),connectionId:e,toolName:L},search:{}}}export{D as d,B as r,j as u};