decocms 4.143.0 → 4.144.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 (235) hide show
  1. package/dist/client/assets/{AlertCircle-B-jqRzEl.js → AlertCircle-bjC8VX70.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BiVN9Rbg.js → AreaChart-Berf1Wcn.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-8wVhqZbY.js → ArrowUp-SkFIu_Mh.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-C79Mz0y9.js → ArrowUpRight-C-B3vUF1.js} +1 -1
  5. package/dist/client/assets/{Check-D2OTmp9f.js → Check-HrXMyT9G.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CagdexBy.js → CheckCircle-DiAhctKs.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-6d9u53mr.js → ChevronDown-CJjb9vl_.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CNc7IJBh.js → ChevronRight-fsZHCheQ.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CFeWkGPA.js → ChevronUp-BczRZV-Y.js} +1 -1
  10. package/dist/client/assets/{Copy01-DAcswqJ-.js → Copy01-B9fZV42-.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-C3lcToNm.js → DotsVertical-ATIM5zu0.js} +1 -1
  12. package/dist/client/assets/{Eye-5baqKWh-.js → Eye-BfiAoz0S.js} +1 -1
  13. package/dist/client/assets/{FilterLines-DdzesZPL.js → FilterLines-vkHMVWtQ.js} +1 -1
  14. package/dist/client/assets/{HardDrive-BKIKC-Q_.js → HardDrive-D6SAii7J.js} +1 -1
  15. package/dist/client/assets/{Key01-fqq_MFu4.js → Key01-C0p_oPg8.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CuMVXGUK.js → LayoutLeft-CpDk0EOr.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BqkooxOV.js → LinkExternal01-CNjcXqd6.js} +1 -1
  18. package/dist/client/assets/{LogOut01-B8UpmR8a.js → LogOut01-DqWMJEg8.js} +1 -1
  19. package/dist/client/assets/{Monitor01-BLwSOYdr.js → Monitor01-C07z4FWm.js} +1 -1
  20. package/dist/client/assets/{Palette-DIrZPBgO.js → Palette-D2Y58mS8.js} +1 -1
  21. package/dist/client/assets/{Play-b1Vma0LR.js → Play-DZHQldRw.js} +1 -1
  22. package/dist/client/assets/{Plus-Dn7E2MbI.js → Plus-Dli8Eqb0.js} +1 -1
  23. package/dist/client/assets/{SearchLg-CcdcmJuJ.js → SearchLg-Cl8SJOV5.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BE8PZTOt.js → SearchMd-CuwSJsL7.js} +1 -1
  25. package/dist/client/assets/{Settings02-CyPLPNW_.js → Settings02-CmjWJ1c6.js} +1 -1
  26. package/dist/client/assets/{Shield01-CcpD-xYP.js → Shield01-ByboMUx5.js} +1 -1
  27. package/dist/client/assets/{Star01-CYWNL4zV.js → Star01-C42DJ-xk.js} +1 -1
  28. package/dist/client/assets/{Stars01-CNYsGUE-.js → Stars01-efT3oOwc.js} +1 -1
  29. package/dist/client/assets/{Stars02-BUKsUmOb.js → Stars02-BAQ5qRk1.js} +1 -1
  30. package/dist/client/assets/{Sun-Bls3wdhD.js → Sun-C_hjFhxT.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CzML4bwn.js → SwitchHorizontal01-GV0--qUc.js} +1 -1
  32. package/dist/client/assets/{Tool01-D6778Lob.js → Tool01-BdMCBLCF.js} +1 -1
  33. package/dist/client/assets/{Tool02-Z0l-5_iB.js → Tool02-CLHYu0yn.js} +1 -1
  34. package/dist/client/assets/{Trash01--va9a-rZ.js → Trash01-Do1QH01I.js} +1 -1
  35. package/dist/client/assets/{TrendUp01-B0vVWAUw.js → TrendUp01-46hVQ0WU.js} +1 -1
  36. package/dist/client/assets/{Upload01-DJH5T0zl.js → Upload01-C_4FIdsq.js} +1 -1
  37. package/dist/client/assets/{User01-BIYw5tFf.js → User01-BccqDgbp.js} +1 -1
  38. package/dist/client/assets/{Users01-CJQ3NAZn.js → Users01-BDoRfuXn.js} +1 -1
  39. package/dist/client/assets/{Users03-Da7W4Ncu.js → Users03-Cm6zJrF0.js} +1 -1
  40. package/dist/client/assets/{X-DM8kZX3_.js → X-v0Mh0h2J.js} +1 -1
  41. package/dist/client/assets/{XCircle-Mi8kCDLZ.js → XCircle-CItxK-fi.js} +1 -1
  42. package/dist/client/assets/{XClose-CnleH_rn.js → XClose-CmUu59X-.js} +1 -1
  43. package/dist/client/assets/{Zap-Caskj5Xs.js → Zap-C9AHpIXN.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-D_Ea99yn.js → ZapSquare-CYXtyGQc.js} +1 -1
  45. package/dist/client/assets/{access-gate-BFCJT7AK.js → access-gate-gWiySoB6.js} +1 -1
  46. package/dist/client/assets/{add-section-modal-IrUHBk2G.js → add-section-modal-CHtxZWG_.js} +1 -1
  47. package/dist/client/assets/{agent-icon-C_Bcs5w3.js → agent-icon-BGbirapc.js} +1 -1
  48. package/dist/client/assets/{agents-list-DVtyxn3w.js → agents-list-CTlDK04C.js} +1 -1
  49. package/dist/client/assets/{ai-providers-Bj3HzBuS.js → ai-providers-DpKQQFBK.js} +1 -1
  50. package/dist/client/assets/{alert-B_zsxySU.js → alert-BDE3aQzs.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-lKGaIGJ0.js → alert-dialog-BmYTAKM-.js} +1 -1
  52. package/dist/client/assets/app-editor-Co9YISCK.js +1 -0
  53. package/dist/client/assets/{auth-CyQvgFY_.js → auth-D6tgJd48.js} +1 -1
  54. package/dist/client/assets/{auth-catchall-DSya8pvs.js → auth-catchall-Xm12qM-O.js} +1 -1
  55. package/dist/client/assets/{auth-entry-CD-vn7aB.js → auth-entry-gVU-BKt3.js} +1 -1
  56. package/dist/client/assets/{auth-split-layout-4TADJHe3.js → auth-split-layout-BLxKbBEG.js} +1 -1
  57. package/dist/client/assets/{authenticate-and-persist-oauth-CYAmEm23.js → authenticate-and-persist-oauth-C7W8HXB-.js} +1 -1
  58. package/dist/client/assets/{automation-list-row-BNoWYkqJ.js → automation-list-row-UuK5SZ3b.js} +1 -1
  59. package/dist/client/assets/{automation-runs-BCXsq8ct.js → automation-runs-ZSHknXFL.js} +1 -1
  60. package/dist/client/assets/{automations-DaWbO5W0.js → automations-CkVQDRvh.js} +1 -1
  61. package/dist/client/assets/{avatar-D-26TcjI.js → avatar-CzQ7J9Py.js} +1 -1
  62. package/dist/client/assets/{badge-Bt07rmj0.js → badge-DxUkTZDX.js} +1 -1
  63. package/dist/client/assets/{block-document-DHwqz4ng.js → block-document-Dk1DKZt0.js} +1 -1
  64. package/dist/client/assets/{brand-context-DcWJH1eE.js → brand-context-Gz-FJLMN.js} +1 -1
  65. package/dist/client/assets/{buckets-BN8tEEe8.js → buckets-DpOfdOye.js} +1 -1
  66. package/dist/client/assets/bulk-category-panel-DzONs21U.js +1 -0
  67. package/dist/client/assets/{calendar-D-kF2A1V.js → calendar-ioOOy9x4.js} +1 -1
  68. package/dist/client/assets/{capability-load-error-DaoU0HSz.js → capability-load-error-BT6aAl1G.js} +1 -1
  69. package/dist/client/assets/{card-BJkx-TlV.js → card-Bzi6yUGv.js} +1 -1
  70. package/dist/client/assets/category-editor-DvvQDNn3.js +1 -0
  71. package/dist/client/assets/{chat-context-CRLCG-7m.js → chat-context-D_Gjawoo.js} +1 -1
  72. package/dist/client/assets/{checkbox-L_8J0VEc.js → checkbox-CsXwodnZ.js} +1 -1
  73. package/dist/client/assets/{cli-auth-success-CIORuBy8.js → cli-auth-success-B1L3aMzW.js} +1 -1
  74. package/dist/client/assets/{collection-detail-D-Ew8P97.js → collection-detail-DXl61wQP.js} +1 -1
  75. package/dist/client/assets/{collection-display-button-_4wEvm8K.js → collection-display-button-CkYsI7NF.js} +1 -1
  76. package/dist/client/assets/{collection-search-BP_osQGg.js → collection-search-Bw_AYyWe.js} +1 -1
  77. package/dist/client/assets/{collection-table-wrapper-CpxPnXz4.js → collection-table-wrapper-CDBGf-WF.js} +1 -1
  78. package/dist/client/assets/{collection-tabs-rQ-lQQ1f.js → collection-tabs-CPcyvgV6.js} +1 -1
  79. package/dist/client/assets/command-C0ZjGtQ6.js +1 -0
  80. package/dist/client/assets/{commerce-onboarding-D84or4Tp.js → commerce-onboarding-663-SWD1.js} +1 -1
  81. package/dist/client/assets/{companions-core-XkORCpwR.js → companions-core-BUUkoH1J.js} +1 -1
  82. package/dist/client/assets/{connect-CGvuELFE.js → connect-C39WuO_1.js} +1 -1
  83. package/dist/client/assets/{connect-desktop-dialog-ePivWtSb.js → connect-desktop-dialog-1q_x4ynM.js} +1 -1
  84. package/dist/client/assets/{connection-ByK9rd24.js → connection-CphxB6Hn.js} +1 -1
  85. package/dist/client/assets/{connection-card-CAxRM9Mg.js → connection-card-BJQrv-Sf.js} +1 -1
  86. package/dist/client/assets/{connection-detail-BRFBfHBS.js → connection-detail-CT2pr4RA.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-BJFFbUQU.js → connection-form-helpers-pGgztUvg.js} +1 -1
  88. package/dist/client/assets/{connections-UQfEHlso.js → connections-DpT97VsB.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-CG8MNCkB.js → decopilot-sse-pool-7Tzx6-E9.js} +1 -1
  90. package/dist/client/assets/{dialog-D33iO7_V.js → dialog-DbxgvIzU.js} +1 -1
  91. package/dist/client/assets/{domain-settings-DOD8a9FC.js → domain-settings-CmAKlGDM.js} +1 -1
  92. package/dist/client/assets/{drawer-DEBuno2i.js → drawer-DcSDhvlR.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-C6KbRlri.js → dropdown-menu-zLzf58UF.js} +1 -1
  94. package/dist/client/assets/{empty-state-Dd-cQnoB.js → empty-state-C8A6v1EQ.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-DV9ilPpM.js → extract-connection-data-BgqfCUzt.js} +1 -1
  96. package/dist/client/assets/file-explorer-Dq2OrUP8.js +2 -0
  97. package/dist/client/assets/{form-DU_fCIQ-.js → form-DXHtZ3Xd.js} +1 -1
  98. package/dist/client/assets/{general-D3ZVfxSw.js → general-6XhFsMt5.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-BjxldoVh.js → github-repo-picker-BOuY27Fo.js} +1 -1
  100. package/dist/client/assets/{hooks-UN_3FMZE.js → hooks-DRoQyAYD.js} +1 -1
  101. package/dist/client/assets/index-BbUR22_I.css +1 -0
  102. package/dist/client/assets/index-BrkQ12GR.js +8 -0
  103. package/dist/client/assets/{index-BMkx_fVM.js → index-C7eCvrix.js} +1 -1
  104. package/dist/client/assets/{index-CHxi5qA7.js → index-C_xlULy7.js} +1 -1
  105. package/dist/client/assets/{index-BEgR1yze.js → index-Cie8bNR2.js} +1 -1
  106. package/dist/client/assets/{index-DRZiVvJy.js → index-Cn6kNK5d.js} +1 -1
  107. package/dist/client/assets/{index-CCDNDdqy.js → index-Cz3eCJot.js} +1 -1
  108. package/dist/client/assets/{index-3s9Tew9h.js → index-DEjVUbQZ.js} +5 -5
  109. package/dist/client/assets/{index-ItRmrjqK.js → index-DFspaUcC.js} +5 -5
  110. package/dist/client/assets/{index-DwxbseCq.js → index-DV478YQv.js} +1 -1
  111. package/dist/client/assets/{index-O8J1Dp2X.js → index-Dw9Kh9ea.js} +1 -1
  112. package/dist/client/assets/{index-CKYr3lDt.js → index-Ge9lsRXc.js} +1 -1
  113. package/dist/client/assets/{index-redirect-Cd1hqm3U.js → index-redirect-BSBsnQKV.js} +1 -1
  114. package/dist/client/assets/{input-BfYMrULt.js → input-BsFsRYpb.js} +1 -1
  115. package/dist/client/assets/{integration-icon-efY4xiAf.js → integration-icon-Zd6y2lnO.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-Da_OF_ll.js → invite-member-dialog-ea2rgdiV.js} +1 -1
  117. package/dist/client/assets/{label-IYRseMIB.js → label-Dy22a1G_.js} +1 -1
  118. package/dist/client/assets/{layout-DO22NBVL.js → layout-DTofO_A0.js} +1 -1
  119. package/dist/client/assets/{login-DNgu6l3u.js → login-Cz3Rtqo-.js} +1 -1
  120. package/dist/client/assets/{mcp-oauth-CSNCpmPq.js → mcp-oauth-CsDk7r71.js} +1 -1
  121. package/dist/client/assets/members-DuveJzOm.js +1 -0
  122. package/dist/client/assets/{monaco-editor-CG32495o.js → monaco-editor-p1KcCRI9.js} +1 -1
  123. package/dist/client/assets/{monitoring-stats-row-5WdWKDvN.js → monitoring-stats-row-C9gIDwLW.js} +1 -1
  124. package/dist/client/assets/{multi-select-daLSotTk.js → multi-select-Bzs4Ibjn.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-DaIiIjJz.js → oauth-callback-Bwf5O6A5.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-BgQLj9jp.js → oauth-callback-ai-provider-CoWQsYYc.js} +1 -1
  127. package/dist/client/assets/{onboarding-ChhvT3pz.js → onboarding-CPfNxv8z.js} +1 -1
  128. package/dist/client/assets/{org-install-BkjDyn8G.js → org-install-aMCVBdo1.js} +1 -1
  129. package/dist/client/assets/{org-layout-quA4JXB-.js → org-layout-DuTct6ab.js} +1 -1
  130. package/dist/client/assets/{organization-choice-DrOHVIOZ.js → organization-choice-6tMLFUIz.js} +1 -1
  131. package/dist/client/assets/{orgs-uafRHIoi.js → orgs-t7TB--eL.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-DQF2bT-S.js → page-seo-form-OgfFKVEU.js} +1 -1
  133. package/dist/client/assets/{popover-B0IAIvG1.js → popover-QmmuC2j3.js} +1 -1
  134. package/dist/client/assets/post-editor-847fBebh.js +1 -0
  135. package/dist/client/assets/{primitives-TeELpOAu.js → primitives-DCjJZijO.js} +1 -1
  136. package/dist/client/assets/{profile-CwdfRf3t.js → profile-dxQOIoy6.js} +1 -1
  137. package/dist/client/assets/project-app-view-DDvhy0js.js +1 -0
  138. package/dist/client/assets/record-editor-DZP5PoIz.js +1 -0
  139. package/dist/client/assets/redirect-editor-Cj7N-Dee.js +1 -0
  140. package/dist/client/assets/registry-DdNbIMiF.js +2 -0
  141. package/dist/client/assets/{registry-layout-BiwVm6BS.js → registry-layout-hMOd-Vu6.js} +1 -1
  142. package/dist/client/assets/{reports-BAIAc8a3.js → reports-B36h6JQw.js} +1 -1
  143. package/dist/client/assets/{require-capability-5JvRqOC5.js → require-capability-BSRjSQ8m.js} +1 -1
  144. package/dist/client/assets/{required-auth-layout-pECQLZu3.js → required-auth-layout-DyZfLiuc.js} +1 -1
  145. package/dist/client/assets/{reset-password-6785Ja9D.js → reset-password-V6kMwcFG.js} +1 -1
  146. package/dist/client/assets/{roles-Ssu2ZMMo.js → roles-lc89Fi8t.js} +1 -1
  147. package/dist/client/assets/{search-input-Cs8XLlxq.js → search-input-eBi3jOVU.js} +1 -1
  148. package/dist/client/assets/{secrets-C3NcHdrk.js → secrets-BMRegWEv.js} +1 -1
  149. package/dist/client/assets/{sections-editor-BmggDKtT.js → sections-editor-BkTrlAhT.js} +2 -2
  150. package/dist/client/assets/{select-BVLvxRY_.js → select-ZZ2niYJE.js} +1 -1
  151. package/dist/client/assets/{select-model-B1FCO1sL.js → select-model-BUi0DPCz.js} +1 -1
  152. package/dist/client/assets/{self-tool-result-CiannG5U.js → self-tool-result-DabJKGlc.js} +1 -1
  153. package/dist/client/assets/seo-editor-ip7TK0og.js +1 -0
  154. package/dist/client/assets/{settings-layout-DAXoBBEe.js → settings-layout-BnjA-1vO.js} +1 -1
  155. package/dist/client/assets/{settings-section-DK8lFIzK.js → settings-section-DHLuH-PS.js} +1 -1
  156. package/dist/client/assets/{shell-controls-KuQmFzu6.js → shell-controls-vY4IuJVQ.js} +1 -1
  157. package/dist/client/assets/{shell-layout-BijKU0-I.js → shell-layout-DT_JVhSf.js} +1 -1
  158. package/dist/client/assets/{sidebar-CDXYvtn9.js → sidebar-DbuIqiea.js} +1 -1
  159. package/dist/client/assets/{skeleton-CGU246-L.js → skeleton-COECUkwI.js} +1 -1
  160. package/dist/client/assets/{sso-D91DYNig.js → sso-e-1MoLDx.js} +1 -1
  161. package/dist/client/assets/{store-DbD53Dwf.js → store-Xehwc_cL.js} +1 -1
  162. package/dist/client/assets/store-registry-B8Cc-Qyz.js +2 -0
  163. package/dist/client/assets/{studio-tools-VGyC9GwV.js → studio-tools-0zl4dMkN.js} +1 -1
  164. package/dist/client/assets/{switch-C4OvS2MT.js → switch-BFhEckeE.js} +1 -1
  165. package/dist/client/assets/{tab-id-BPYTTZ6r.js → tab-id-DBqQfYhM.js} +1 -1
  166. package/dist/client/assets/{table-ZV_kuvYr.js → table-jSwBp7om.js} +1 -1
  167. package/dist/client/assets/{tabs-C6hrxr6a.js → tabs-DStJuoyx.js} +1 -1
  168. package/dist/client/assets/{textarea-x-bE9Bxs.js → textarea-DoBp39jT.js} +1 -1
  169. package/dist/client/assets/{toggle-group-CRooMtRv.js → toggle-group-Cfybgxkd.js} +1 -1
  170. package/dist/client/assets/{toolbar-yFGKx-ED.js → toolbar-Chezv8Oj.js} +1 -1
  171. package/dist/client/assets/{tooltip-DDodsVeB.js → tooltip-BZNMQNvf.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-DVmSse-1.js → use-ai-providers-CbOFGwQ8.js} +1 -1
  173. package/dist/client/assets/{use-api-keys-uTQcq8rB.js → use-api-keys-6oSFOvUw.js} +1 -1
  174. package/dist/client/assets/{use-automations-CLUBhaHO.js → use-automations-D5QBILsR.js} +1 -1
  175. package/dist/client/assets/{use-autosave-Dzaioffs.js → use-autosave-d6m_eram.js} +1 -1
  176. package/dist/client/assets/{use-capability-kDNoyWdY.js → use-capability-CgcHlLav.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-BayrL0TS.js → use-clock-tick-N2b0izvt.js} +1 -1
  178. package/dist/client/assets/{use-connection-ChhJlAvS.js → use-connection-BD9Io0lK.js} +1 -1
  179. package/dist/client/assets/{use-copy-i2NkP3Jk.js → use-copy-yJAZMqb7.js} +1 -1
  180. package/dist/client/assets/{use-create-virtual-mcp-BImE2T8X.js → use-create-virtual-mcp-Dg_-07Uk.js} +1 -1
  181. package/dist/client/assets/{use-debounced-autosave-v1sdssj4.js → use-debounced-autosave-KyajsL3_.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-c9xf8WS9.js → use-debounced-value-BJf-6MsT.js} +1 -1
  183. package/dist/client/assets/{use-deco-credits-baDwitBx.js → use-deco-credits-bLxVczgz.js} +1 -1
  184. package/dist/client/assets/{use-decopilot-events-DZ9DZDbU.js → use-decopilot-events-B7L7auHL.js} +1 -1
  185. package/dist/client/assets/{use-delete-connection-CMAwaYVC.js → use-delete-connection-h726MShe.js} +1 -1
  186. package/dist/client/assets/{use-deployment-admin-1iMj6395.js → use-deployment-admin-BntjQTYI.js} +1 -1
  187. package/dist/client/assets/{use-file-configs-DN8YUUYy.js → use-file-configs-Dvqefsen.js} +1 -1
  188. package/dist/client/assets/{use-infinite-scroll-B7GLw7FT.js → use-infinite-scroll-BVn-n2Jl.js} +1 -1
  189. package/dist/client/assets/{use-join-requests-CKgL2XRY.js → use-join-requests-8HOi_Rh1.js} +1 -1
  190. package/dist/client/assets/{use-mcp-auth-status-Diqe229X.js → use-mcp-auth-status-hcqVaZjN.js} +1 -1
  191. package/dist/client/assets/{use-mcp-client-S8Ro9wXt.js → use-mcp-client-B--rl5yR.js} +1 -1
  192. package/dist/client/assets/{use-mcp-tools-Ds6vRkno.js → use-mcp-tools-BgLiM38H.js} +1 -1
  193. package/dist/client/assets/{use-members-1gWDO4iq.js → use-members-B-fG1LMe.js} +1 -1
  194. package/dist/client/assets/{use-mobile-BvKWcALO.js → use-mobile-BCA9NX4p.js} +1 -1
  195. package/dist/client/assets/{use-navigate-to-agent-BizqM7da.js → use-navigate-to-agent-KNBtuqax.js} +1 -1
  196. package/dist/client/assets/{use-org-auth-client-CjJB7VYj.js → use-org-auth-client-qpocT7z8.js} +1 -1
  197. package/dist/client/assets/{use-org-sso-BwEUjK1Y.js → use-org-sso-DaQhuxoB.js} +1 -1
  198. package/dist/client/assets/{use-organization-roles-C2rXgNfu.js → use-organization-roles-CLIu6Xv4.js} +1 -1
  199. package/dist/client/assets/{use-organization-settings-CzkVoVdP.js → use-organization-settings-TEhzXl51.js} +1 -1
  200. package/dist/client/assets/{use-registry-app-Cqp0RcKu.js → use-registry-app-COCi1sPa.js} +1 -1
  201. package/dist/client/assets/{use-registry-connections-BPeS8-S0.js → use-registry-connections-DRPB_2pH.js} +1 -1
  202. package/dist/client/assets/{use-secrets-DNpJcNyZ.js → use-secrets-DVcl6Hd_.js} +1 -1
  203. package/dist/client/assets/{use-status-sounds-Dl0inIB_.js → use-status-sounds-BNilDfXk.js} +1 -1
  204. package/dist/client/assets/use-tags-Ce5L6-F5.js +1 -0
  205. package/dist/client/assets/{use-view-mode-BkwnM4KV.js → use-view-mode-DLfr09AM.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-BerfEExf.js → use-virtual-mcp-BUKJpjSh.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-gzOQBHzL.js +1 -0
  208. package/dist/client/assets/{useQueries-BaAVLqaJ.js → useQueries-B6CU5OfR.js} +1 -1
  209. package/dist/client/assets/{useRouterState-BvY77fPk.js → useRouterState-CN5lLbjm.js} +1 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-DKovPPK2.js +1 -0
  211. package/dist/client/assets/{users-UlTXYJI6.js → users-CrtLImOC.js} +1 -1
  212. package/dist/client/assets/{variant-calendar-C3Io3KuI.js → variant-calendar-Ca6VyXSd.js} +1 -1
  213. package/dist/client/assets/{view-mode-toggle-3iPqRACB.js → view-mode-toggle-Bqak8ar1.js} +1 -1
  214. package/dist/client/index.html +2 -2
  215. package/dist/server/cli.js +579 -497
  216. package/dist/server/migrate.js +114 -114
  217. package/dist/server/server.js +315 -315
  218. package/package.json +1 -1
  219. package/dist/client/assets/app-editor-yVBKDLck.js +0 -1
  220. package/dist/client/assets/bulk-category-panel-BoXTOaok.js +0 -1
  221. package/dist/client/assets/category-editor-DLlLtm6q.js +0 -1
  222. package/dist/client/assets/command-C8JQ6fDH.js +0 -1
  223. package/dist/client/assets/file-explorer-DH5RcxcZ.js +0 -2
  224. package/dist/client/assets/index-DZpEhuMO.css +0 -1
  225. package/dist/client/assets/index-DdPmVGw1.js +0 -8
  226. package/dist/client/assets/members-CI7yJEQa.js +0 -1
  227. package/dist/client/assets/post-editor-kMykRTTR.js +0 -1
  228. package/dist/client/assets/project-app-view-D56KUgUw.js +0 -1
  229. package/dist/client/assets/record-editor-DwPka5iP.js +0 -1
  230. package/dist/client/assets/redirect-editor-BG5ZYn8w.js +0 -1
  231. package/dist/client/assets/registry-yjuga6ab.js +0 -2
  232. package/dist/client/assets/seo-editor-DQpqd24m.js +0 -1
  233. package/dist/client/assets/store-registry-CP1Njx2O.js +0 -2
  234. package/dist/client/assets/useInfiniteQuery-DVRcq0Og.js +0 -1
  235. package/dist/client/assets/useSuspenseInfiniteQuery-B2iCNXWP.js +0 -1
@@ -1 +1 @@
1
- import{c as P,F as H,r as Z,j as i,B as te,L as ue,X as fe,Y as J,b as K,d as pe,o as he,_ as xe,Z as je,e as le,p as ie,t as F,K as oe,a6 as re,G as ae,w as Se}from"./index-3s9Tew9h.js";import{P as W}from"./index-DRZiVvJy.js";import{A as ze,b as ve}from"./alert-B_zsxySU.js";import{i as be}from"./XCircle-Mi8kCDLZ.js";import{n as Ae}from"./LinkExternal01-BqkooxOV.js";import{s as ye}from"./XClose-CnleH_rn.js";import{u as Ce}from"./use-org-auth-client-CjJB7VYj.js";import{u as _e}from"./use-debounced-autosave-v1sdssj4.js";import{A as Oe}from"./avatar-D-26TcjI.js";import{I as ce}from"./input-BfYMrULt.js";import{S as se,a as ne,b as Q,c as we}from"./settings-section-DK8lFIzK.js";import{d as me,S as Ne,a as De,b as Te,c as Fe}from"./select-BVLvxRY_.js";import{S as Ee}from"./skeleton-CGU246-L.js";import{A as ge}from"./agent-icon-C_Bcs5w3.js";import{a as Pe,i as ke,f as Re}from"./use-mcp-client-S8Ro9wXt.js";import{a as Ie}from"./use-virtual-mcp-BerfEExf.js";import{a as Le}from"./agent-capabilities-cXfbMfjV.js";import{e as Me,h as Ve}from"./use-organization-settings-CzkVoVdP.js";import{D as $e}from"./domain-settings-DOD8a9FC.js";import{u as Be}from"./studio-tools-VGyC9GwV.js";import{c as Ge,d as Ue,b as qe,f as Ke,g as Qe,e as Ze,a as Ye,A as We}from"./alert-dialog-lKGaIGJ0.js";import{R as He}from"./require-capability-5JvRqOC5.js";import"./sidebar-CDXYvtn9.js";import"./LayoutLeft-CuMVXGUK.js";import"./use-mobile-BvKWcALO.js";import"./X-DM8kZX3_.js";import"./tooltip-DDodsVeB.js";import"./User01-BIYw5tFf.js";import"./card-BJkx-TlV.js";import"./ArrowUpRight-C79Mz0y9.js";import"./Check-D2OTmp9f.js";import"./ChevronDown-6d9u53mr.js";import"./ChevronUp-CFeWkGPA.js";import"./AlertCircle-B-jqRzEl.js";import"./Tool01-D6778Lob.js";import"./ArrowUp-8wVhqZbY.js";import"./Settings02-CyPLPNW_.js";import"./Tool02-Z0l-5_iB.js";import"./TrendUp01-B0vVWAUw.js";import"./ZapSquare-D_Ea99yn.js";import"./Users03-Da7W4Ncu.js";import"./CheckCircle-CagdexBy.js";import"./ChevronRight-CNc7IJBh.js";import"./DotsVertical-C3lcToNm.js";import"./Stars02-BUKsUmOb.js";import"./Copy01-DAcswqJ-.js";import"./Eye-5baqKWh-.js";import"./FilterLines-DdzesZPL.js";import"./Star01-CYWNL4zV.js";import"./Palette-DIrZPBgO.js";import"./SwitchHorizontal01-CzML4bwn.js";import"./HardDrive-BKIKC-Q_.js";import"./Key01-fqq_MFu4.js";import"./LogOut01-B8UpmR8a.js";import"./Monitor01-BLwSOYdr.js";import"./Sun-Bls3wdhD.js";import"./Play-b1Vma0LR.js";import"./Plus-Dn7E2MbI.js";import"./SearchLg-CcdcmJuJ.js";import"./SearchMd-BE8PZTOt.js";import"./Shield01-CcpD-xYP.js";import"./Stars01-CNYsGUE-.js";import"./Trash01--va9a-rZ.js";import"./Upload01-DJH5T0zl.js";import"./Users01-CJQ3NAZn.js";import"./Zap-Caskj5Xs.js";import"./auth-CyQvgFY_.js";import"./badge-Bt07rmj0.js";import"./use-capability-kDNoyWdY.js";import"./access-gate-BFCJT7AK.js";import"./capability-load-error-DaoU0HSz.js";function de(e){return`connect-banner-dismissed:${e}`}function Xe(e){if(typeof window>"u")return!0;try{return localStorage.getItem(de(e))==="1"}catch{return!1}}function Je(){const e=P.c(17),{org:t}=H();let s;e[0]!==t.id?(s=()=>Xe(t.id),e[0]=t.id,e[1]=s):s=e[1];const[g,u]=Z.useState(s);if(g)return null;let o;e[2]!==t.id?(o=()=>{u(!0);try{localStorage.setItem(de(t.id),"1")}catch{}},e[2]=t.id,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ae,{}),e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=a):a=e[5];let c;e[6]!==t.slug?(c={org:t.slug},e[6]=t.slug,e[7]=c):c=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(be,{size:12}),e[8]=f):f=e[8];let n;e[9]!==c?(n=i.jsx(te,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ue,{to:"/$org/settings/connect",params:c,children:["Connect to clients ",f]})}),e[9]=c,e[10]=n):n=e[10];let r;e[11]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(ye,{size:14}),e[11]=r):r=e[11];let l;e[12]!==d?(l=i.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:d,"aria-label":"Dismiss",children:r}),e[12]=d,e[13]=l):l=e[13];let p;return e[14]!==n||e[15]!==l?(p=i.jsxs(ze,{variant:"info",className:"items-center",children:[m,i.jsxs(ve,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[a,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n,l]})]})]}),e[14]=n,e[15]=l,e[16]=p):p=e[16],p}const et=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function tt(e){return typeof e=="string"&&et.has(e.trim().toLowerCase())}const it=fe({name:J().min(1,"Name is required").max(255,"Name is too long"),slug:J().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!tt(e),"This organization URL is reserved by Studio"),logo:J().optional()});function st(e){const t=P.c(17),{value:s,onChange:g,name:u,disabled:o}=e,d=K(),m=Z.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const c=a;let f;t[1]!==g||t[2]!==d?(f=O=>{const h=O.target.files?.[0];if(!h)return;if(h.size>2097152){F.error(d("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>F.error(d("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&g(x.result),m.current&&(m.current.value="")},x.readAsDataURL(h)},t[1]=g,t[2]=d,t[3]=f):f=t[3];const n=f;let r;t[4]!==d?(r=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=r):r=t[5];let l;t[6]!==o||t[7]!==n?(l=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),t[6]=o,t[7]=n,t[8]=l):l=t[8];const p=s||void 0,j=u??"?";let S;t[9]!==p||t[10]!==j?(S=i.jsx(Oe,{url:p,fallback:j,shape:"square",size:"base"}),t[9]=p,t[10]=j,t[11]=S):S=t[11];let v;return t[12]!==o||t[13]!==r||t[14]!==l||t[15]!==S?(v=i.jsxs("button",{type:"button",onClick:c,disabled:o,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":r,children:[l,S]}),t[12]=o,t[13]=r,t[14]=l,t[15]=S,t[16]=v):v=t[16],v}function nt(){const e=K(),t=pe(),{org:s}=H(),g=Ce(),u=he(),o=xe({resolver:je(it),values:{name:s.name??"",slug:s.slug??"",logo:s.logo??""}}),d=le({mutationFn:async n=>{const r={name:n.name,slug:n.slug};n.logo&&(r.logo=n.logo);const l=await g.organization.update({data:r});if(l?.error)throw new Error(l.error.message||e("settings.organizationForm.failedToUpdateOrg"));return l},onSuccess:(n,r)=>{ie("organization_settings_updated",{organization_id:s.id,fields:Object.keys(r)}),u.invalidateQueries({queryKey:oe.organizations()}),u.invalidateQueries({queryKey:oe.activeOrganization(s.slug)}),F.success(e("settings.organizationForm.updateSuccess")),n?.data?.slug&&n.data.slug!==s.slug&&t({to:"/$org/settings/general",params:{org:n.data.slug}})},onError:(n,r)=>{ie("organization_settings_update_failed",{organization_id:s.id,fields:Object.keys(r),error:n instanceof Error?n.message:String(n)}),F.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:m,flush:a}=_e({save:async()=>{const n=o.control._formState.dirtyFields;if(Object.keys(n).length===0||!await o.trigger())return;const l=o.getValues(),p=o.control._defaultValues;o.reset(l,{keepValues:!0});try{await d.mutateAsync(l)}catch{o.reset(p,{keepValues:!0})}}}),c=o.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(ne,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(st,{value:o.watch("logo"),onChange:n=>{o.setValue("logo",n??"",{shouldDirty:!0}),a()},name:o.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(re,{control:o.control,name:"name",render:({field:n})=>i.jsx(ce,{id:"org-name",...n,onChange:r=>{n.onChange(r),m()},onBlur:()=>{n.onBlur(),a()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx(re,{control:o.control,name:"slug",render:({field:n})=>i.jsx("input",{id:"org-slug",value:n.value??"",name:n.name,ref:n.ref,placeholder:e("settings.organizationForm.slugPlaceholder"),className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:r=>{const l=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",l,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{n.onBlur(),a()}})})]})}),(c.name||c.slug||c.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&i.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&i.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&i.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]})]})})}const ee="__super_agent__";function ot(){const e=P.c(42),t=K(),{org:s}=H(),g=Ie(),{mainAgentId:u}=Me(),o=Ve();let d,m,a,c,f,n,r,l;if(e[0]!==g||e[1]!==u||e[2]!==s.id||e[3]!==o||e[4]!==t){const S=Le(g),v=(g??[]).filter(lt).filter(z=>!S.has(z.id)).filter(at);let O;e[13]!==s.id?(O=Pe(s.id),e[13]=s.id,e[14]=O):O=e[14];const h=O,x=u!=null?(g??[]).find(z=>z.id===u):void 0,w=x?x.id:ee,N=x&&!v.some(z=>z.id===x.id)?[x,...v]:v;let _;e[15]!==g||e[16]!==o||e[17]!==h.title||e[18]!==t?(_=z=>{const C=z===ee?null:z,k=C===null?h.title:(g??[]).find(T=>T.id===C)?.title??"";o.mutate(C,{onSuccess:()=>F.success(C===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:k})),onError:()=>F.error(t("settings.mainAgent.errorToast"))})},e[15]=g,e[16]=o,e[17]=h.title,e[18]=t,e[19]=_):_=e[19];const D=_;m=Ne,f=w,n=D,r=o.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(De,{className:"w-full sm:w-[280px]",children:i.jsx(Te,{})}),e[20]=l):l=e[20],d=Fe;let b;e[21]!==h.icon||e[22]!==h.title?(b=i.jsx(ge,{icon:h.icon,name:h.title,size:"xs",className:"shrink-0"}),e[21]=h.icon,e[22]=h.title,e[23]=b):b=e[23];let A;e[24]!==t?(A=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=A):A=e[25];let y;e[26]!==A?(y=i.jsx("span",{className:"truncate",children:A}),e[26]=A,e[27]=y):y=e[27],e[28]!==y||e[29]!==b?(a=i.jsx(me,{value:ee,children:i.jsxs("span",{className:"flex items-center gap-2",children:[b,y]})}),e[28]=y,e[29]=b,e[30]=a):a=e[30],c=N.map(rt),e[0]=g,e[1]=u,e[2]=s.id,e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=a,e[8]=c,e[9]=f,e[10]=n,e[11]=r,e[12]=l}else d=e[5],m=e[6],a=e[7],c=e[8],f=e[9],n=e[10],r=e[11],l=e[12];let p;e[31]!==d||e[32]!==a||e[33]!==c?(p=i.jsxs(d,{children:[a,c]}),e[31]=d,e[32]=a,e[33]=c,e[34]=p):p=e[34];let j;return e[35]!==m||e[36]!==f||e[37]!==n||e[38]!==r||e[39]!==l||e[40]!==p?(j=i.jsxs(m,{value:f,onValueChange:n,disabled:r,children:[l,p]}),e[35]=m,e[36]=f,e[37]=n,e[38]=r,e[39]=l,e[40]=p,e[41]=j):j=e[41],j}function rt(e){return i.jsx(me,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(ge,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function at(e){return!Re(e.id)}function lt(e){return!ke(e.id)}function ct(){const e=P.c(16),t=K();let s;e[0]!==t?(s=t("settings.mainAgent.title"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==t?(g=t("settings.mainAgent.description"),e[2]=t,e[3]=g):g=e[3];let u;e[4]!==t?(u=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=u):u=e[5];let o;e[6]!==t?(o=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=o):o=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Z.Suspense,{fallback:i.jsx(Ee,{className:"h-9 w-[280px]"}),children:i.jsx(ot,{})}),e[8]=d):d=e[8];let m;e[9]!==u||e[10]!==o?(m=i.jsx(ne,{children:i.jsx(Q,{title:u,description:o,action:d})}),e[9]=u,e[10]=o,e[11]=m):m=e[11];let a;return e[12]!==s||e[13]!==g||e[14]!==m?(a=i.jsx(se,{title:s,description:g,children:m}),e[12]=s,e[13]=g,e[14]=m,e[15]=a):a=e[15],a}function mt(){const e=P.c(86),t=K(),{org:s}=H(),[g,u]=Z.useState(!1),[o,d]=Z.useState(""),m=Be();let a;e[0]!==s.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=m,e[2]=a):a=e[2];let c;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(c=()=>{ie("organization_deleted",{organization_id:s.id}),localStorage.getItem(ae.lastOrgSlug())===s.slug&&localStorage.removeItem(ae.lastOrgSlug()),Se(),F.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=c):c=e[6];let f;e[7]!==t?(f=E=>{F.error(E instanceof Error?E.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=f):f=e[8];let n;e[9]!==a||e[10]!==c||e[11]!==f?(n={mutationFn:a,onSuccess:c,onError:f},e[9]=a,e[10]=c,e[11]=f,e[12]=n):n=e[12];const r=le(n);let l;e[13]!==t?(l=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=l):l=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=()=>u(!0),e[21]=v):v=e[21];const O=r.isPending;let h;e[22]!==t?(h=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=h):h=e[23];let x;e[24]!==r.isPending||e[25]!==h?(x=i.jsx(te,{variant:"destructive",size:"sm",onClick:v,disabled:O,children:h}),e[24]=r.isPending,e[25]=h,e[26]=x):x=e[26];let w;e[27]!==x||e[28]!==j||e[29]!==S?(w=i.jsx(ne,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:S,action:x})}),e[27]=x,e[28]=j,e[29]=S,e[30]=w):w=e[30];let N;e[31]!==w||e[32]!==l||e[33]!==p?(N=i.jsx(se,{title:l,description:p,children:w}),e[31]=w,e[32]=l,e[33]=p,e[34]=N):N=e[34];let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=E=>{u(E),E||d("")},e[35]=_):_=e[35];let D;e[36]!==t?(D=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=D):D=e[37];let b;e[38]!==D?(b=i.jsx(Ge,{children:D}),e[38]=D,e[39]=b):b=e[39];let A;e[40]!==s.name||e[41]!==t?(A=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=A):A=e[42];let y;e[43]!==A?(y=i.jsx("p",{children:A}),e[43]=A,e[44]=y):y=e[44];let z;e[45]!==s.name||e[46]!==t?(z=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=z):z=e[47];let C;e[48]!==z?(C=i.jsx("p",{className:"mt-3 mb-1.5",children:z}),e[48]=z,e[49]=C):C=e[49];let k;e[50]===Symbol.for("react.memo_cache_sentinel")?(k=E=>d(E.target.value),e[50]=k):k=e[50];let T;e[51]!==o||e[52]!==s.name?(T=i.jsx(ce,{value:o,onChange:k,placeholder:s.name,autoFocus:!0}),e[51]=o,e[52]=s.name,e[53]=T):T=e[53];let R;e[54]!==y||e[55]!==C||e[56]!==T?(R=i.jsx(Ue,{asChild:!0,children:i.jsxs("div",{children:[y,C,T]})}),e[54]=y,e[55]=C,e[56]=T,e[57]=R):R=e[57];let I;e[58]!==b||e[59]!==R?(I=i.jsxs(qe,{children:[b,R]}),e[58]=b,e[59]=R,e[60]=I):I=e[60];let L;e[61]!==t?(L=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=L):L=e[62];let M;e[63]!==L?(M=i.jsx(Ke,{children:L}),e[63]=L,e[64]=M):M=e[64];let V;e[65]!==r?(V=()=>r.mutate(),e[65]=r,e[66]=V):V=e[66];const X=o!==s.name||r.isPending;let $;e[67]!==r.isPending||e[68]!==t?($=r.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=r.isPending,e[68]=t,e[69]=$):$=e[69];let B;e[70]!==V||e[71]!==X||e[72]!==$?(B=i.jsx(Qe,{onClick:V,disabled:X,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:$}),e[70]=V,e[71]=X,e[72]=$,e[73]=B):B=e[73];let G;e[74]!==M||e[75]!==B?(G=i.jsxs(Ze,{children:[M,B]}),e[74]=M,e[75]=B,e[76]=G):G=e[76];let U;e[77]!==I||e[78]!==G?(U=i.jsxs(Ye,{children:[I,G]}),e[77]=I,e[78]=G,e[79]=U):U=e[79];let q;e[80]!==g||e[81]!==U?(q=i.jsx(We,{open:g,onOpenChange:_,children:U}),e[80]=g,e[81]=U,e[82]=q):q=e[82];let Y;return e[83]!==N||e[84]!==q?(Y=i.jsxs(i.Fragment,{children:[N,q]}),e[83]=N,e[84]=q,e[85]=Y):Y=e[85],Y}function gt(){const e=P.c(11),t=K();let s;e[0]!==t?(s=t("settings.orgGeneral.organization"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==s?(g=i.jsx(W.Title,{children:s}),e[2]=s,e[3]=g):g=e[3];let u,o,d,m,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Je,{}),o=i.jsx(nt,{}),d=i.jsx(ct,{}),m=i.jsx($e,{}),a=i.jsx(mt,{}),e[4]=u,e[5]=o,e[6]=d,e[7]=m,e[8]=a):(u=e[4],o=e[5],d=e[6],m=e[7],a=e[8]);let c;return e[9]!==g?(c=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(we,{children:[g,u,o,d,m,a]})})})}),e[9]=g,e[10]=c):c=e[10],c}function Ni(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(He,{capability:"org:manage",area:"general settings",children:i.jsx(gt,{})}),e[0]=t):t=e[0],t}export{Ni as default};
1
+ import{c as P,F as H,r as Z,j as i,B as te,L as ue,X as fe,Y as J,b as K,d as pe,o as he,_ as xe,Z as je,e as le,p as ie,t as F,K as oe,a6 as re,G as ae,w as Se}from"./index-DEjVUbQZ.js";import{P as W}from"./index-Cn6kNK5d.js";import{A as ze,b as ve}from"./alert-BDE3aQzs.js";import{i as be}from"./XCircle-CItxK-fi.js";import{n as Ae}from"./LinkExternal01-CNjcXqd6.js";import{s as ye}from"./XClose-CmUu59X-.js";import{u as Ce}from"./use-org-auth-client-qpocT7z8.js";import{u as _e}from"./use-debounced-autosave-KyajsL3_.js";import{A as Oe}from"./avatar-CzQ7J9Py.js";import{I as ce}from"./input-BsFsRYpb.js";import{S as se,a as ne,b as Q,c as we}from"./settings-section-DHLuH-PS.js";import{d as me,S as Ne,a as De,b as Te,c as Fe}from"./select-ZZ2niYJE.js";import{S as Ee}from"./skeleton-COECUkwI.js";import{A as ge}from"./agent-icon-BGbirapc.js";import{a as Pe,i as ke,f as Re}from"./use-mcp-client-B--rl5yR.js";import{a as Ie}from"./use-virtual-mcp-BUKJpjSh.js";import{a as Le}from"./agent-capabilities-cXfbMfjV.js";import{e as Me,h as Ve}from"./use-organization-settings-TEhzXl51.js";import{D as $e}from"./domain-settings-CmAKlGDM.js";import{u as Be}from"./studio-tools-0zl4dMkN.js";import{c as Ge,d as Ue,b as qe,f as Ke,g as Qe,e as Ze,a as Ye,A as We}from"./alert-dialog-BmYTAKM-.js";import{R as He}from"./require-capability-BSRjSQ8m.js";import"./sidebar-DbuIqiea.js";import"./LayoutLeft-CpDk0EOr.js";import"./use-mobile-BCA9NX4p.js";import"./X-v0Mh0h2J.js";import"./tooltip-BZNMQNvf.js";import"./User01-BccqDgbp.js";import"./card-Bzi6yUGv.js";import"./ArrowUpRight-C-B3vUF1.js";import"./Check-HrXMyT9G.js";import"./ChevronDown-CJjb9vl_.js";import"./ChevronUp-BczRZV-Y.js";import"./AlertCircle-bjC8VX70.js";import"./Tool01-BdMCBLCF.js";import"./ArrowUp-SkFIu_Mh.js";import"./Settings02-CmjWJ1c6.js";import"./Tool02-CLHYu0yn.js";import"./TrendUp01-46hVQ0WU.js";import"./ZapSquare-CYXtyGQc.js";import"./Users03-Cm6zJrF0.js";import"./CheckCircle-DiAhctKs.js";import"./ChevronRight-fsZHCheQ.js";import"./DotsVertical-ATIM5zu0.js";import"./Stars02-BAQ5qRk1.js";import"./Copy01-B9fZV42-.js";import"./Eye-BfiAoz0S.js";import"./FilterLines-vkHMVWtQ.js";import"./Star01-C42DJ-xk.js";import"./Palette-D2Y58mS8.js";import"./SwitchHorizontal01-GV0--qUc.js";import"./HardDrive-D6SAii7J.js";import"./Key01-C0p_oPg8.js";import"./LogOut01-DqWMJEg8.js";import"./Monitor01-C07z4FWm.js";import"./Sun-C_hjFhxT.js";import"./Play-DZHQldRw.js";import"./Plus-Dli8Eqb0.js";import"./SearchLg-Cl8SJOV5.js";import"./SearchMd-CuwSJsL7.js";import"./Shield01-ByboMUx5.js";import"./Stars01-efT3oOwc.js";import"./Trash01-Do1QH01I.js";import"./Upload01-C_4FIdsq.js";import"./Users01-BDoRfuXn.js";import"./Zap-C9AHpIXN.js";import"./auth-D6tgJd48.js";import"./badge-DxUkTZDX.js";import"./use-capability-CgcHlLav.js";import"./access-gate-gWiySoB6.js";import"./capability-load-error-BT6aAl1G.js";function de(e){return`connect-banner-dismissed:${e}`}function Xe(e){if(typeof window>"u")return!0;try{return localStorage.getItem(de(e))==="1"}catch{return!1}}function Je(){const e=P.c(17),{org:t}=H();let s;e[0]!==t.id?(s=()=>Xe(t.id),e[0]=t.id,e[1]=s):s=e[1];const[g,u]=Z.useState(s);if(g)return null;let o;e[2]!==t.id?(o=()=>{u(!0);try{localStorage.setItem(de(t.id),"1")}catch{}},e[2]=t.id,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ae,{}),e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=a):a=e[5];let c;e[6]!==t.slug?(c={org:t.slug},e[6]=t.slug,e[7]=c):c=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(be,{size:12}),e[8]=f):f=e[8];let n;e[9]!==c?(n=i.jsx(te,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ue,{to:"/$org/settings/connect",params:c,children:["Connect to clients ",f]})}),e[9]=c,e[10]=n):n=e[10];let r;e[11]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(ye,{size:14}),e[11]=r):r=e[11];let l;e[12]!==d?(l=i.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:d,"aria-label":"Dismiss",children:r}),e[12]=d,e[13]=l):l=e[13];let p;return e[14]!==n||e[15]!==l?(p=i.jsxs(ze,{variant:"info",className:"items-center",children:[m,i.jsxs(ve,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[a,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n,l]})]})]}),e[14]=n,e[15]=l,e[16]=p):p=e[16],p}const et=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function tt(e){return typeof e=="string"&&et.has(e.trim().toLowerCase())}const it=fe({name:J().min(1,"Name is required").max(255,"Name is too long"),slug:J().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!tt(e),"This organization URL is reserved by Studio"),logo:J().optional()});function st(e){const t=P.c(17),{value:s,onChange:g,name:u,disabled:o}=e,d=K(),m=Z.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const c=a;let f;t[1]!==g||t[2]!==d?(f=O=>{const h=O.target.files?.[0];if(!h)return;if(h.size>2097152){F.error(d("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>F.error(d("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&g(x.result),m.current&&(m.current.value="")},x.readAsDataURL(h)},t[1]=g,t[2]=d,t[3]=f):f=t[3];const n=f;let r;t[4]!==d?(r=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=r):r=t[5];let l;t[6]!==o||t[7]!==n?(l=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),t[6]=o,t[7]=n,t[8]=l):l=t[8];const p=s||void 0,j=u??"?";let S;t[9]!==p||t[10]!==j?(S=i.jsx(Oe,{url:p,fallback:j,shape:"square",size:"base"}),t[9]=p,t[10]=j,t[11]=S):S=t[11];let v;return t[12]!==o||t[13]!==r||t[14]!==l||t[15]!==S?(v=i.jsxs("button",{type:"button",onClick:c,disabled:o,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":r,children:[l,S]}),t[12]=o,t[13]=r,t[14]=l,t[15]=S,t[16]=v):v=t[16],v}function nt(){const e=K(),t=pe(),{org:s}=H(),g=Ce(),u=he(),o=xe({resolver:je(it),values:{name:s.name??"",slug:s.slug??"",logo:s.logo??""}}),d=le({mutationFn:async n=>{const r={name:n.name,slug:n.slug};n.logo&&(r.logo=n.logo);const l=await g.organization.update({data:r});if(l?.error)throw new Error(l.error.message||e("settings.organizationForm.failedToUpdateOrg"));return l},onSuccess:(n,r)=>{ie("organization_settings_updated",{organization_id:s.id,fields:Object.keys(r)}),u.invalidateQueries({queryKey:oe.organizations()}),u.invalidateQueries({queryKey:oe.activeOrganization(s.slug)}),F.success(e("settings.organizationForm.updateSuccess")),n?.data?.slug&&n.data.slug!==s.slug&&t({to:"/$org/settings/general",params:{org:n.data.slug}})},onError:(n,r)=>{ie("organization_settings_update_failed",{organization_id:s.id,fields:Object.keys(r),error:n instanceof Error?n.message:String(n)}),F.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:m,flush:a}=_e({save:async()=>{const n=o.control._formState.dirtyFields;if(Object.keys(n).length===0||!await o.trigger())return;const l=o.getValues(),p=o.control._defaultValues;o.reset(l,{keepValues:!0});try{await d.mutateAsync(l)}catch{o.reset(p,{keepValues:!0})}}}),c=o.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(ne,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(st,{value:o.watch("logo"),onChange:n=>{o.setValue("logo",n??"",{shouldDirty:!0}),a()},name:o.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(re,{control:o.control,name:"name",render:({field:n})=>i.jsx(ce,{id:"org-name",...n,onChange:r=>{n.onChange(r),m()},onBlur:()=>{n.onBlur(),a()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx(re,{control:o.control,name:"slug",render:({field:n})=>i.jsx("input",{id:"org-slug",value:n.value??"",name:n.name,ref:n.ref,placeholder:e("settings.organizationForm.slugPlaceholder"),className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:r=>{const l=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",l,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{n.onBlur(),a()}})})]})}),(c.name||c.slug||c.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&i.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&i.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&i.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]})]})})}const ee="__super_agent__";function ot(){const e=P.c(42),t=K(),{org:s}=H(),g=Ie(),{mainAgentId:u}=Me(),o=Ve();let d,m,a,c,f,n,r,l;if(e[0]!==g||e[1]!==u||e[2]!==s.id||e[3]!==o||e[4]!==t){const S=Le(g),v=(g??[]).filter(lt).filter(z=>!S.has(z.id)).filter(at);let O;e[13]!==s.id?(O=Pe(s.id),e[13]=s.id,e[14]=O):O=e[14];const h=O,x=u!=null?(g??[]).find(z=>z.id===u):void 0,w=x?x.id:ee,N=x&&!v.some(z=>z.id===x.id)?[x,...v]:v;let _;e[15]!==g||e[16]!==o||e[17]!==h.title||e[18]!==t?(_=z=>{const C=z===ee?null:z,k=C===null?h.title:(g??[]).find(T=>T.id===C)?.title??"";o.mutate(C,{onSuccess:()=>F.success(C===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:k})),onError:()=>F.error(t("settings.mainAgent.errorToast"))})},e[15]=g,e[16]=o,e[17]=h.title,e[18]=t,e[19]=_):_=e[19];const D=_;m=Ne,f=w,n=D,r=o.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(De,{className:"w-full sm:w-[280px]",children:i.jsx(Te,{})}),e[20]=l):l=e[20],d=Fe;let b;e[21]!==h.icon||e[22]!==h.title?(b=i.jsx(ge,{icon:h.icon,name:h.title,size:"xs",className:"shrink-0"}),e[21]=h.icon,e[22]=h.title,e[23]=b):b=e[23];let A;e[24]!==t?(A=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=A):A=e[25];let y;e[26]!==A?(y=i.jsx("span",{className:"truncate",children:A}),e[26]=A,e[27]=y):y=e[27],e[28]!==y||e[29]!==b?(a=i.jsx(me,{value:ee,children:i.jsxs("span",{className:"flex items-center gap-2",children:[b,y]})}),e[28]=y,e[29]=b,e[30]=a):a=e[30],c=N.map(rt),e[0]=g,e[1]=u,e[2]=s.id,e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=a,e[8]=c,e[9]=f,e[10]=n,e[11]=r,e[12]=l}else d=e[5],m=e[6],a=e[7],c=e[8],f=e[9],n=e[10],r=e[11],l=e[12];let p;e[31]!==d||e[32]!==a||e[33]!==c?(p=i.jsxs(d,{children:[a,c]}),e[31]=d,e[32]=a,e[33]=c,e[34]=p):p=e[34];let j;return e[35]!==m||e[36]!==f||e[37]!==n||e[38]!==r||e[39]!==l||e[40]!==p?(j=i.jsxs(m,{value:f,onValueChange:n,disabled:r,children:[l,p]}),e[35]=m,e[36]=f,e[37]=n,e[38]=r,e[39]=l,e[40]=p,e[41]=j):j=e[41],j}function rt(e){return i.jsx(me,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(ge,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function at(e){return!Re(e.id)}function lt(e){return!ke(e.id)}function ct(){const e=P.c(16),t=K();let s;e[0]!==t?(s=t("settings.mainAgent.title"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==t?(g=t("settings.mainAgent.description"),e[2]=t,e[3]=g):g=e[3];let u;e[4]!==t?(u=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=u):u=e[5];let o;e[6]!==t?(o=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=o):o=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Z.Suspense,{fallback:i.jsx(Ee,{className:"h-9 w-[280px]"}),children:i.jsx(ot,{})}),e[8]=d):d=e[8];let m;e[9]!==u||e[10]!==o?(m=i.jsx(ne,{children:i.jsx(Q,{title:u,description:o,action:d})}),e[9]=u,e[10]=o,e[11]=m):m=e[11];let a;return e[12]!==s||e[13]!==g||e[14]!==m?(a=i.jsx(se,{title:s,description:g,children:m}),e[12]=s,e[13]=g,e[14]=m,e[15]=a):a=e[15],a}function mt(){const e=P.c(86),t=K(),{org:s}=H(),[g,u]=Z.useState(!1),[o,d]=Z.useState(""),m=Be();let a;e[0]!==s.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=m,e[2]=a):a=e[2];let c;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(c=()=>{ie("organization_deleted",{organization_id:s.id}),localStorage.getItem(ae.lastOrgSlug())===s.slug&&localStorage.removeItem(ae.lastOrgSlug()),Se(),F.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=c):c=e[6];let f;e[7]!==t?(f=E=>{F.error(E instanceof Error?E.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=f):f=e[8];let n;e[9]!==a||e[10]!==c||e[11]!==f?(n={mutationFn:a,onSuccess:c,onError:f},e[9]=a,e[10]=c,e[11]=f,e[12]=n):n=e[12];const r=le(n);let l;e[13]!==t?(l=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=l):l=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=()=>u(!0),e[21]=v):v=e[21];const O=r.isPending;let h;e[22]!==t?(h=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=h):h=e[23];let x;e[24]!==r.isPending||e[25]!==h?(x=i.jsx(te,{variant:"destructive",size:"sm",onClick:v,disabled:O,children:h}),e[24]=r.isPending,e[25]=h,e[26]=x):x=e[26];let w;e[27]!==x||e[28]!==j||e[29]!==S?(w=i.jsx(ne,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:S,action:x})}),e[27]=x,e[28]=j,e[29]=S,e[30]=w):w=e[30];let N;e[31]!==w||e[32]!==l||e[33]!==p?(N=i.jsx(se,{title:l,description:p,children:w}),e[31]=w,e[32]=l,e[33]=p,e[34]=N):N=e[34];let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=E=>{u(E),E||d("")},e[35]=_):_=e[35];let D;e[36]!==t?(D=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=D):D=e[37];let b;e[38]!==D?(b=i.jsx(Ge,{children:D}),e[38]=D,e[39]=b):b=e[39];let A;e[40]!==s.name||e[41]!==t?(A=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=A):A=e[42];let y;e[43]!==A?(y=i.jsx("p",{children:A}),e[43]=A,e[44]=y):y=e[44];let z;e[45]!==s.name||e[46]!==t?(z=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=z):z=e[47];let C;e[48]!==z?(C=i.jsx("p",{className:"mt-3 mb-1.5",children:z}),e[48]=z,e[49]=C):C=e[49];let k;e[50]===Symbol.for("react.memo_cache_sentinel")?(k=E=>d(E.target.value),e[50]=k):k=e[50];let T;e[51]!==o||e[52]!==s.name?(T=i.jsx(ce,{value:o,onChange:k,placeholder:s.name,autoFocus:!0}),e[51]=o,e[52]=s.name,e[53]=T):T=e[53];let R;e[54]!==y||e[55]!==C||e[56]!==T?(R=i.jsx(Ue,{asChild:!0,children:i.jsxs("div",{children:[y,C,T]})}),e[54]=y,e[55]=C,e[56]=T,e[57]=R):R=e[57];let I;e[58]!==b||e[59]!==R?(I=i.jsxs(qe,{children:[b,R]}),e[58]=b,e[59]=R,e[60]=I):I=e[60];let L;e[61]!==t?(L=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=L):L=e[62];let M;e[63]!==L?(M=i.jsx(Ke,{children:L}),e[63]=L,e[64]=M):M=e[64];let V;e[65]!==r?(V=()=>r.mutate(),e[65]=r,e[66]=V):V=e[66];const X=o!==s.name||r.isPending;let $;e[67]!==r.isPending||e[68]!==t?($=r.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=r.isPending,e[68]=t,e[69]=$):$=e[69];let B;e[70]!==V||e[71]!==X||e[72]!==$?(B=i.jsx(Qe,{onClick:V,disabled:X,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:$}),e[70]=V,e[71]=X,e[72]=$,e[73]=B):B=e[73];let G;e[74]!==M||e[75]!==B?(G=i.jsxs(Ze,{children:[M,B]}),e[74]=M,e[75]=B,e[76]=G):G=e[76];let U;e[77]!==I||e[78]!==G?(U=i.jsxs(Ye,{children:[I,G]}),e[77]=I,e[78]=G,e[79]=U):U=e[79];let q;e[80]!==g||e[81]!==U?(q=i.jsx(We,{open:g,onOpenChange:_,children:U}),e[80]=g,e[81]=U,e[82]=q):q=e[82];let Y;return e[83]!==N||e[84]!==q?(Y=i.jsxs(i.Fragment,{children:[N,q]}),e[83]=N,e[84]=q,e[85]=Y):Y=e[85],Y}function gt(){const e=P.c(11),t=K();let s;e[0]!==t?(s=t("settings.orgGeneral.organization"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==s?(g=i.jsx(W.Title,{children:s}),e[2]=s,e[3]=g):g=e[3];let u,o,d,m,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Je,{}),o=i.jsx(nt,{}),d=i.jsx(ct,{}),m=i.jsx($e,{}),a=i.jsx(mt,{}),e[4]=u,e[5]=o,e[6]=d,e[7]=m,e[8]=a):(u=e[4],o=e[5],d=e[6],m=e[7],a=e[8]);let c;return e[9]!==g?(c=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(we,{children:[g,u,o,d,m,a]})})})}),e[9]=g,e[10]=c):c=e[10],c}function Ni(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(He,{capability:"org:manage",area:"general settings",children:i.jsx(gt,{})}),e[0]=t):t=e[0],t}export{Ni as default};
@@ -1 +1 @@
1
- import{F as xe,a as ye,o as me,r as $,$ as oe,c as se,b as ee,j as t,k as Z,e as ge,t as le,dS as Ne,K as te,G as ve,n as ke,m as ue,B as ce,x as Ce,y as we}from"./index-3s9Tew9h.js";import{a as Re,b as Se,d as Pe,e as Ie}from"./dialog-D33iO7_V.js";import{C as Ee}from"./collection-search-BP_osQGg.js";import{u as _e}from"./use-debounced-value-c9xf8WS9.js";import{b as pe,u as Te}from"./use-connection-ChhJlAvS.js";import{u as re,S as he}from"./use-mcp-client-S8Ro9wXt.js";import{a as be}from"./authenticate-and-persist-oauth-CYAmEm23.js";import{b as de}from"./Settings02-CyPLPNW_.js";import{n as Ae}from"./LinkExternal01-BqkooxOV.js";import{W as ze}from"./agent-icon-C_Bcs5w3.js";import{u as Le,G as q}from"./use-registry-app-Cqp0RcKu.js";import{e as Ge}from"./extract-connection-data-DV9ilPpM.js";import{c as Fe}from"./use-navigate-to-agent-BizqM7da.js";import{p as fe,f as Oe}from"./provision-repo-scoped-github-connection-Dp638N7g.js";import{g as Ue}from"./github-repo-scope-CKSTLD3W.js";const De="deco/mcp-github";function $e(P){const{org:e}=xe(),{data:u}=ye.useSession(),p=pe(),k=me(),[l,r]=$.useState("idle"),[o,s]=$.useState(null),[f,v]=$.useState(null),{data:j,isLoading:w}=Le(De,{enabled:P.enabled}),d=$.useRef(!1);P.enabled&&j&&!w&&!d.current&&u?.user?.id&&l==="idle"&&(d.current=!0,c());async function c(){if(!(!j||!u?.user?.id||!e))try{r("installing"),s(null);const i=Ge(j,e.id,u.user.id,{remoteIndex:0});if(!i.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await p.create.mutateAsync(i);r("authenticating");const b=await be({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>p.update.mutateAsync({id:x,data:{connection_token:m}}).then(()=>{})});if(b.ran&&!b.ok){try{await p.delete.mutateAsync(x)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}oe(k,e.id),v(i),r("ready")}catch(i){s(i instanceof Error?i.message:String(i)),r("error")}}function a(){r("idle"),s(null),v(null),d.current=!1}return P.enabled&&w&&l==="idle"?{status:"installing",error:null,connection:null,retry:a}:{status:l,error:o,connection:f,retry:a}}function at(P){const e=se.c(27),{open:u,onOpenChange:p,title:k,onImportComplete:l,mode:r}=P,o=r===void 0?"agent":r,s=ee();let f;e[0]!==o||e[1]!==s||e[2]!==k?(f=k??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=k,e[3]=f):f=e[3];const v=f,[j,w]=$.useState(null);let d;e[4]!==v?(d=t.jsx(Re,{className:"sr-only",children:t.jsx(Se,{children:v})}),e[4]=v,e[5]=d):d=e[5];let c;e[6]!==v||e[7]!==j||e[8]!==s?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:j?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>w(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:j.avatarUrl,alt:j.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:j.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v})]})}),e[6]=v,e[7]=j,e[8]=s,e[9]=c):c=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10];let i;e[11]!==p?(i=()=>p(!1),e[11]=p,e[12]=i):i=e[12];let g;e[13]!==o||e[14]!==l||e[15]!==u||e[16]!==j||e[17]!==i?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx($.Suspense,{fallback:a,children:t.jsx(He,{open:u,onComplete:i,selectedInstallation:j,onSelectInstallation:w,onImportComplete:l,mode:o})})}),e[13]=o,e[14]=l,e[15]=u,e[16]=j,e[17]=i,e[18]=g):g=e[18];let x;e[19]!==d||e[20]!==c||e[21]!==g?(x=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,c,g]}),e[19]=d,e[20]=c,e[21]=g,e[22]=x):x=e[22];let b;return e[23]!==p||e[24]!==u||e[25]!==x?(b=t.jsx(Ie,{open:u,onOpenChange:p,children:x}),e[23]=p,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function He({open:P,onComplete:e,selectedInstallation:u,onSelectInstallation:p,onImportComplete:k,mode:l="agent"}){const r=ee(),{org:o}=xe(),s=me(),f=Fe(),[v,j]=$.useState(null),w=Te({slug:"mcp-github"}),d=Ue(w),c=$e({enabled:P&&d.length===0}),a=d.length===1?d[0]??null:v,i=re({connectionId:a?.id??"",orgId:o.id,orgSlug:o.slug}),g=re({connectionId:he,orgId:o.id,orgSlug:o.slug}),x=async(n,y)=>{try{const R=await i.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:y}});if(R.isError)return null;const S=R.content?.find(I=>I.type==="resource")?.resource?.text;if(!S)return null;try{const I=JSON.parse(S);return typeof I=="string"?I:JSON.stringify(I)}catch{return S}}catch{return null}},b=(n,y)=>{Promise.all([x(y,"AGENTS.md"),x(y,"CLAUDE.md")]).then(async([N,R])=>{const C=N??R??null;C&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:C}}}}),oe(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},m=ge({mutationFn:async n=>{if(!a||!u)throw new Error("No GitHub connection or installation");const y=u.installationId;if(l==="connection"){const{childConnectionId:C}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:S=>i.callTool(S),selfCallTool:S=>g.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:C,item:null}}const{childConnectionId:N}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:C=>i.callTool(C),selfCallTool:C=>g.callTool(C)});let R=null;try{const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:y,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),S=C.structuredContent??C,I=S.item?.id;if(!S.item||!I)throw new Error("Failed to create the imported agent");return R=I,{virtualMcpId:I,repo:n,connectionId:N,item:S.item}}catch(C){throw R&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:R}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),C}},onSuccess:({virtualMcpId:n,repo:y,connectionId:N,item:R})=>{if(l==="connection"||!n||!R){oe(s,o.id),Ne(s,o.id),le.success(r("common.githubRepoPicker.addedRepo",{name:y.name})),e();return}if(s.setQueryData(te.collectionItem(g,o.id,"","VIRTUAL_MCP",n),{item:R}),oe(s,o.id),b(n,y),k){k({virtualMcpId:n,repo:y,connectionId:N});return}le.success(r("common.githubRepoPicker.importedRepo",{name:y.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),f(n)},onError:n=>{le.error(r("common.githubRepoPicker.failedImport",{error:n instanceof Error?n.message:r("common.githubRepoPicker.unknownError")}))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(ae,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(ae,{status:"error",error:c.error,retry:c.retry}):d.length===0&&c.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:c.retry}):d.length>1&&!a?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.githubRepoPicker.selectConnection")})}),d.map(n=>t.jsxs("button",{type:"button",onClick:()=>j(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?u?t.jsx(Qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,installation:u,onSelectRepo:n=>m.mutate(n),isSaving:m.isPending}):t.jsx(qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,onSelect:p,showBackButton:d.length>1,onBack:()=>j(null)}):null}function qe(P){const e=se.c(126),{connectionId:u,orgId:p,orgSlug:k,onSelect:l,showBackButton:r,onBack:o}=P,s=ee();let f;e[0]!==p||e[1]!==k?(f={connectionId:he,orgId:p,orgSlug:k},e[0]=p,e[1]=k,e[2]=f):f=e[2];const v=re(f),j=me(),w=pe();let d;e[3]!==u||e[4]!==p?(d=te.githubUserOrgs(p,u),e[3]=u,e[4]=p,e[5]=d):d=e[5];let c;e[6]!==u||e[7]!==v?(c=()=>Oe(h=>v.callTool(h),u),e[6]=u,e[7]=v,e[8]=c):c=e[8];let a;e[9]!==d||e[10]!==c?(a={queryKey:d,queryFn:c},e[9]=d,e[10]=c,e[11]=a):a=e[11];const i=ke(a);let g;e[12]!==w||e[13]!==u||e[14]!==i||e[15]!==p||e[16]!==k||e[17]!==j?(g=async()=>{const h=await be({connectionId:u,orgId:p,orgSlug:k,persistFallback:A=>w.update.mutateAsync({id:u,data:{connection_token:A}}).then(Me)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const E=new URL(`/api/${k}/mcp/${u}`,window.location.origin);await j.invalidateQueries({queryKey:te.isMCPAuthenticated(E.href,null)}),await j.invalidateQueries({queryKey:te.mcpClientPrefix()}),await i.refetch()},e[12]=w,e[13]=u,e[14]=i,e[15]=p,e[16]=k,e[17]=j,e[18]=g):g=e[18];let x;e[19]!==s?(x=h=>{le.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=x):x=e[20];let b;e[21]!==g||e[22]!==x?(b={mutationFn:g,onError:x},e[21]=g,e[22]=x,e[23]=b):b=e[23];const m=ge(b);if(i.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=h):h=e[24],h}if(i.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let E;e[27]!==h?(E=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=E):E=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==m?(L=()=>m.mutate(),e[33]=m,e[34]=L):L=e[34];const H=m.isPending;let G;e[35]!==m.isPending?(G=m.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(q,{className:"size-3.5"}),e[35]=m.isPending,e[36]=G):G=e[36];let F;e[37]!==s?(F=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=F):F=e[38];let O;e[39]!==m.isPending||e[40]!==L||e[41]!==G||e[42]!==F?(O=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:H,children:[G,F]}),e[39]=m.isPending,e[40]=L,e[41]=G,e[42]=F,e[43]=O):O=e[43];let D;return e[44]!==z||e[45]!==O||e[46]!==E?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[E,z,O]}),e[44]=z,e[45]=O,e[46]=E,e[47]=D):D=e[47],D}const n=i.data;if(!n)return null;const y=n.appSlug?`https://github.com/apps/${n.appSlug}/installations/new`:"https://github.com/settings/installations";if(n.installations.length===0){let h;e[48]!==o||e[49]!==r||e[50]!==s?(h=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=r,e[50]=s,e[51]=h):h=e[51];let E;e[52]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-8 text-foreground"})}),e[52]=E):E=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let G;e[60]!==H?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=G):G=e[61];let F;e[62]!==s?(F=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=F):F=e[63];let O;e[64]!==F?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:F}),e[64]=F,e[65]=O):O=e[65];let D;e[66]!==s?(D=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=D):D=e[67];let ne;e[68]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Ae,{size:14}),e[68]=ne):ne=e[68];let M;e[69]!==y||e[70]!==D?(M=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:[D,ne]})}),e[69]=y,e[70]=D,e[71]=M):M=e[71];let Q;e[72]!==i?(Q=()=>{i.refetch()},e[72]=i,e[73]=Q):Q=e[73];const je=i.isFetching;let B;e[74]!==i.isFetching?(B=i.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[74]=i.isFetching,e[75]=B):B=e[75];let V;e[76]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=V):V=e[77];let K;e[78]!==i.isFetching||e[79]!==Q||e[80]!==B||e[81]!==V?(K=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:Q,disabled:je,children:[B,V]}),e[78]=i.isFetching,e[79]=Q,e[80]=B,e[81]=V,e[82]=K):K=e[82];let J;e[83]!==M||e[84]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[M,K]}),e[83]=M,e[84]=K,e[85]=J):J=e[85];let W;e[86]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=W):W=e[87];let Y;e[88]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[88]=W,e[89]=Y):Y=e[89];let X;e[90]!==L||e[91]!==G||e[92]!==O||e[93]!==J||e[94]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[E,L,G,O,J,Y]}),e[90]=L,e[91]=G,e[92]=O,e[93]=J,e[94]=Y,e[95]=X):X=e[95];let ie;return e[96]!==X||e[97]!==h?(ie=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,X]}),e[96]=X,e[97]=h,e[98]=ie):ie=e[98],ie}let N;e[99]!==o||e[100]!==r||e[101]!==s?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=o,e[100]=r,e[101]=s,e[102]=N):N=e[102];let R;if(e[103]!==n.installations||e[104]!==l||e[105]!==s){let h;e[107]!==l||e[108]!==s?(h=E=>t.jsxs("button",{type:"button",onClick:()=>l(E),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:E.avatarUrl,alt:E.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:E.login}),E.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},E.installationId),e[107]=l,e[108]=s,e[109]=h):h=e[109],R=n.installations.map(h),e[103]=n.installations,e[104]=l,e[105]=s,e[106]=R}else R=e[106];let C;e[110]!==R?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:R}),e[110]=R,e[111]=C):C=e[111];let S;e[112]!==s?(S=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=S):S=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let _;e[116]!==I?(_=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=_):_=e[117];let T;e[118]!==y||e[119]!==S||e[120]!==_?(T=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[S," ",_]})}),e[118]=y,e[119]=S,e[120]=_,e[121]=T):T=e[121];let U;return e[122]!==C||e[123]!==T||e[124]!==N?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,C,T]}),e[122]=C,e[123]=T,e[124]=N,e[125]=U):U=e[125],U}function Me(){}function Qe(P){const e=se.c(23),{connectionId:u,orgId:p,orgSlug:k,installation:l,onSelectRepo:r,isSaving:o}=P,s=ee(),[f,v]=$.useState(""),j=_e(f,300),w=$.useDeferredValue(j),d=f!==w;let c;e[0]!==s?(c=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==d||e[3]!==f||e[4]!==c?(a=t.jsx(Ee,{placeholder:c,value:f,onChange:v,isSearching:d}),e[2]=d,e[3]=f,e[4]=c,e[5]=a):a=e[5];const i=d?"opacity-40":"opacity-100";let g;e[6]!==i?(g=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",i),e[6]=i,e[7]=g):g=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=x):x=e[8];let b;e[9]!==u||e[10]!==w||e[11]!==l||e[12]!==o||e[13]!==r||e[14]!==p||e[15]!==k?(b=t.jsx($.Suspense,{fallback:x,children:t.jsx(Be,{connectionId:u,orgId:p,orgSlug:k,installation:l,query:w,onSelectRepo:r,isSaving:o})}),e[9]=u,e[10]=w,e[11]=l,e[12]=o,e[13]=r,e[14]=p,e[15]=k,e[16]=b):b=e[16];let m;e[17]!==g||e[18]!==b?(m=t.jsx("div",{className:g,children:b}),e[17]=g,e[18]=b,e[19]=m):m=e[19];let n;return e[20]!==a||e[21]!==m?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a,m]}),e[20]=a,e[21]=m,e[22]=n):n=e[22],n}function Be(P){const e=se.c(36),{connectionId:u,orgId:p,orgSlug:k,installation:l,query:r,onSelectRepo:o,isSaving:s}=P,f=ee();let v;e[0]!==u||e[1]!==p||e[2]!==k?(v={connectionId:u,orgId:p,orgSlug:k},e[0]=u,e[1]=p,e[2]=k,e[3]=v):v=e[3];const j=re(v),w=l.type==="User"?"user":"org",d=r?`${w}:${l.login} ${r} in:name`:`${w}:${l.login}`;let c;e[4]!==u||e[5]!==l.login||e[6]!==p||e[7]!==r?(c=te.githubOrgRepos(p,u,l.login,r),e[4]=u,e[5]=l.login,e[6]=p,e[7]=r,e[8]=c):c=e[8];let a;e[9]!==j||e[10]!==d?(a=async m=>{const{signal:n}=m,N=(await j.callTool({name:"search_repositories",arguments:{query:d,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Ve)},e[9]=j,e[10]=d,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i={queryKey:c,queryFn:a},e[12]=c,e[13]=a,e[14]=i):i=e[14];const{data:g}=Ce(i);if(g.length===0){let m;e[15]!==f?(m=f("common.githubRepoPicker.noRepositoriesFound"),e[15]=f,e[16]=m):m=e[16];let n;e[17]!==m?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[17]=m,e[18]=n):n=e[18];let y;e[19]!==r||e[20]!==f?(y=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:f("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=r,e[20]=f,e[21]=y):y=e[21];let N;return e[22]!==n||e[23]!==y?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,y]}),e[22]=n,e[23]=y,e[24]=N):N=e[24],N}let x;if(e[25]!==s||e[26]!==o||e[27]!==g||e[28]!==f){let m;e[30]!==s||e[31]!==o||e[32]!==f?(m=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(q,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:n.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(we,{size:10}):t.jsx(ze,{size:10}),n.private?f("common.githubRepoPicker.private"):f("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=f,e[33]=m):m=e[33],x=g.map(m),e[25]=s,e[26]=o,e[27]=g,e[28]=f,e[29]=x}else x=e[29];let b;return e[34]!==x?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[34]=x,e[35]=b):b=e[35],b}function Ve(P){return{name:P.name,fullName:P.full_name,owner:P.full_name.split("/")[0]??"",url:P.html_url,private:P.private,description:P.description,updatedAt:P.updated_at}}function ae(P){const e=se.c(51),{status:u,error:p,retry:k}=P,l=ee();if(u==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let R;e[1]!==l?(R=l("common.githubRepoPicker.connectionFailed"),e[1]=l,e[2]=R):R=e[2];let C;e[3]!==R?(C=t.jsx("p",{className:"text-sm font-medium",children:R}),e[3]=R,e[4]=C):C=e[4];let S;e[5]!==p||e[6]!==l?(S=p??l("common.githubRepoPicker.somethingWentWrong"),e[5]=p,e[6]=l,e[7]=S):S=e[7];let I;e[8]!==S?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:S}),e[8]=S,e[9]=I):I=e[9];let _;e[10]!==C||e[11]!==I?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,I]}),e[10]=C,e[11]=I,e[12]=_):_=e[12];let T;e[13]!==l?(T=l("common.githubRepoPicker.tryAgain"),e[13]=l,e[14]=T):T=e[14];let U;e[15]!==k||e[16]!==T?(U=t.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:T}),e[15]=k,e[16]=T,e[17]=U):U=e[17];let h;return e[18]!==_||e[19]!==U?(h=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,U]}),e[18]=_,e[19]=U,e[20]=h):h=e[20],h}const r=u==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let f;e[23]!==r||e[24]!==l?(f=l(r?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=r,e[24]=l,e[25]=f):f=e[25];let v;e[26]!==f?(v=t.jsx("p",{className:"text-sm font-medium",children:f}),e[26]=f,e[27]=v):v=e[27];let j;e[28]!==r||e[29]!==l?(j=l(r?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=r,e[29]=l,e[30]=j):j=e[30];let w;e[31]!==j?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:j}),e[31]=j,e[32]=w):w=e[32];let d;e[33]!==v||e[34]!==w?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,w]}),e[33]=v,e[34]=w,e[35]=d):d=e[35];const c=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[36]!==c?(a=ue("size-1.5 rounded-full",c),e[36]=c,e[37]=a):a=e[37];let i;e[38]!==a?(i=t.jsx("span",{className:a}),e[38]=a,e[39]=i):i=e[39];const g=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[40]!==g?(x=ue("size-1.5 rounded-full",g),e[40]=g,e[41]=x):x=e[41];let b;e[42]!==x?(b=t.jsx("span",{className:x}),e[42]=x,e[43]=b):b=e[43];let m;e[44]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=m):m=e[44];let n;e[45]!==i||e[46]!==b?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[i,b,m]}),e[45]=i,e[46]=b,e[47]=n):n=e[47];let y;return e[48]!==n||e[49]!==d?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,d,n]}),e[48]=n,e[49]=d,e[50]=y):y=e[50],y}export{at as G,$e as u};
1
+ import{F as xe,a as ye,o as me,r as $,$ as oe,c as se,b as ee,j as t,k as Z,e as ge,t as le,dS as Ne,K as te,G as ve,n as ke,m as ue,B as ce,x as Ce,y as we}from"./index-DEjVUbQZ.js";import{a as Re,b as Se,d as Pe,e as Ie}from"./dialog-DbxgvIzU.js";import{C as Ee}from"./collection-search-Bw_AYyWe.js";import{u as _e}from"./use-debounced-value-BJf-6MsT.js";import{b as pe,u as Te}from"./use-connection-BD9Io0lK.js";import{u as re,S as he}from"./use-mcp-client-B--rl5yR.js";import{a as be}from"./authenticate-and-persist-oauth-C7W8HXB-.js";import{b as de}from"./Settings02-CmjWJ1c6.js";import{n as Ae}from"./LinkExternal01-CNjcXqd6.js";import{W as ze}from"./agent-icon-BGbirapc.js";import{u as Le,G as q}from"./use-registry-app-COCi1sPa.js";import{e as Ge}from"./extract-connection-data-BgqfCUzt.js";import{c as Fe}from"./use-navigate-to-agent-KNBtuqax.js";import{p as fe,f as Oe}from"./provision-repo-scoped-github-connection-Dp638N7g.js";import{g as Ue}from"./github-repo-scope-CKSTLD3W.js";const De="deco/mcp-github";function $e(P){const{org:e}=xe(),{data:u}=ye.useSession(),p=pe(),k=me(),[l,r]=$.useState("idle"),[o,s]=$.useState(null),[f,v]=$.useState(null),{data:j,isLoading:w}=Le(De,{enabled:P.enabled}),d=$.useRef(!1);P.enabled&&j&&!w&&!d.current&&u?.user?.id&&l==="idle"&&(d.current=!0,c());async function c(){if(!(!j||!u?.user?.id||!e))try{r("installing"),s(null);const i=Ge(j,e.id,u.user.id,{remoteIndex:0});if(!i.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await p.create.mutateAsync(i);r("authenticating");const b=await be({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>p.update.mutateAsync({id:x,data:{connection_token:m}}).then(()=>{})});if(b.ran&&!b.ok){try{await p.delete.mutateAsync(x)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}oe(k,e.id),v(i),r("ready")}catch(i){s(i instanceof Error?i.message:String(i)),r("error")}}function a(){r("idle"),s(null),v(null),d.current=!1}return P.enabled&&w&&l==="idle"?{status:"installing",error:null,connection:null,retry:a}:{status:l,error:o,connection:f,retry:a}}function at(P){const e=se.c(27),{open:u,onOpenChange:p,title:k,onImportComplete:l,mode:r}=P,o=r===void 0?"agent":r,s=ee();let f;e[0]!==o||e[1]!==s||e[2]!==k?(f=k??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=k,e[3]=f):f=e[3];const v=f,[j,w]=$.useState(null);let d;e[4]!==v?(d=t.jsx(Re,{className:"sr-only",children:t.jsx(Se,{children:v})}),e[4]=v,e[5]=d):d=e[5];let c;e[6]!==v||e[7]!==j||e[8]!==s?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:j?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>w(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:j.avatarUrl,alt:j.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:j.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v})]})}),e[6]=v,e[7]=j,e[8]=s,e[9]=c):c=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10];let i;e[11]!==p?(i=()=>p(!1),e[11]=p,e[12]=i):i=e[12];let g;e[13]!==o||e[14]!==l||e[15]!==u||e[16]!==j||e[17]!==i?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx($.Suspense,{fallback:a,children:t.jsx(He,{open:u,onComplete:i,selectedInstallation:j,onSelectInstallation:w,onImportComplete:l,mode:o})})}),e[13]=o,e[14]=l,e[15]=u,e[16]=j,e[17]=i,e[18]=g):g=e[18];let x;e[19]!==d||e[20]!==c||e[21]!==g?(x=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,c,g]}),e[19]=d,e[20]=c,e[21]=g,e[22]=x):x=e[22];let b;return e[23]!==p||e[24]!==u||e[25]!==x?(b=t.jsx(Ie,{open:u,onOpenChange:p,children:x}),e[23]=p,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function He({open:P,onComplete:e,selectedInstallation:u,onSelectInstallation:p,onImportComplete:k,mode:l="agent"}){const r=ee(),{org:o}=xe(),s=me(),f=Fe(),[v,j]=$.useState(null),w=Te({slug:"mcp-github"}),d=Ue(w),c=$e({enabled:P&&d.length===0}),a=d.length===1?d[0]??null:v,i=re({connectionId:a?.id??"",orgId:o.id,orgSlug:o.slug}),g=re({connectionId:he,orgId:o.id,orgSlug:o.slug}),x=async(n,y)=>{try{const R=await i.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:y}});if(R.isError)return null;const S=R.content?.find(I=>I.type==="resource")?.resource?.text;if(!S)return null;try{const I=JSON.parse(S);return typeof I=="string"?I:JSON.stringify(I)}catch{return S}}catch{return null}},b=(n,y)=>{Promise.all([x(y,"AGENTS.md"),x(y,"CLAUDE.md")]).then(async([N,R])=>{const C=N??R??null;C&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:C}}}}),oe(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},m=ge({mutationFn:async n=>{if(!a||!u)throw new Error("No GitHub connection or installation");const y=u.installationId;if(l==="connection"){const{childConnectionId:C}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:S=>i.callTool(S),selfCallTool:S=>g.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:C,item:null}}const{childConnectionId:N}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:C=>i.callTool(C),selfCallTool:C=>g.callTool(C)});let R=null;try{const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:y,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),S=C.structuredContent??C,I=S.item?.id;if(!S.item||!I)throw new Error("Failed to create the imported agent");return R=I,{virtualMcpId:I,repo:n,connectionId:N,item:S.item}}catch(C){throw R&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:R}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),C}},onSuccess:({virtualMcpId:n,repo:y,connectionId:N,item:R})=>{if(l==="connection"||!n||!R){oe(s,o.id),Ne(s,o.id),le.success(r("common.githubRepoPicker.addedRepo",{name:y.name})),e();return}if(s.setQueryData(te.collectionItem(g,o.id,"","VIRTUAL_MCP",n),{item:R}),oe(s,o.id),b(n,y),k){k({virtualMcpId:n,repo:y,connectionId:N});return}le.success(r("common.githubRepoPicker.importedRepo",{name:y.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),f(n)},onError:n=>{le.error(r("common.githubRepoPicker.failedImport",{error:n instanceof Error?n.message:r("common.githubRepoPicker.unknownError")}))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(ae,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(ae,{status:"error",error:c.error,retry:c.retry}):d.length===0&&c.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:c.retry}):d.length>1&&!a?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.githubRepoPicker.selectConnection")})}),d.map(n=>t.jsxs("button",{type:"button",onClick:()=>j(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?u?t.jsx(Qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,installation:u,onSelectRepo:n=>m.mutate(n),isSaving:m.isPending}):t.jsx(qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,onSelect:p,showBackButton:d.length>1,onBack:()=>j(null)}):null}function qe(P){const e=se.c(126),{connectionId:u,orgId:p,orgSlug:k,onSelect:l,showBackButton:r,onBack:o}=P,s=ee();let f;e[0]!==p||e[1]!==k?(f={connectionId:he,orgId:p,orgSlug:k},e[0]=p,e[1]=k,e[2]=f):f=e[2];const v=re(f),j=me(),w=pe();let d;e[3]!==u||e[4]!==p?(d=te.githubUserOrgs(p,u),e[3]=u,e[4]=p,e[5]=d):d=e[5];let c;e[6]!==u||e[7]!==v?(c=()=>Oe(h=>v.callTool(h),u),e[6]=u,e[7]=v,e[8]=c):c=e[8];let a;e[9]!==d||e[10]!==c?(a={queryKey:d,queryFn:c},e[9]=d,e[10]=c,e[11]=a):a=e[11];const i=ke(a);let g;e[12]!==w||e[13]!==u||e[14]!==i||e[15]!==p||e[16]!==k||e[17]!==j?(g=async()=>{const h=await be({connectionId:u,orgId:p,orgSlug:k,persistFallback:A=>w.update.mutateAsync({id:u,data:{connection_token:A}}).then(Me)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const E=new URL(`/api/${k}/mcp/${u}`,window.location.origin);await j.invalidateQueries({queryKey:te.isMCPAuthenticated(E.href,null)}),await j.invalidateQueries({queryKey:te.mcpClientPrefix()}),await i.refetch()},e[12]=w,e[13]=u,e[14]=i,e[15]=p,e[16]=k,e[17]=j,e[18]=g):g=e[18];let x;e[19]!==s?(x=h=>{le.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=x):x=e[20];let b;e[21]!==g||e[22]!==x?(b={mutationFn:g,onError:x},e[21]=g,e[22]=x,e[23]=b):b=e[23];const m=ge(b);if(i.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=h):h=e[24],h}if(i.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let E;e[27]!==h?(E=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=E):E=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==m?(L=()=>m.mutate(),e[33]=m,e[34]=L):L=e[34];const H=m.isPending;let G;e[35]!==m.isPending?(G=m.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(q,{className:"size-3.5"}),e[35]=m.isPending,e[36]=G):G=e[36];let F;e[37]!==s?(F=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=F):F=e[38];let O;e[39]!==m.isPending||e[40]!==L||e[41]!==G||e[42]!==F?(O=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:H,children:[G,F]}),e[39]=m.isPending,e[40]=L,e[41]=G,e[42]=F,e[43]=O):O=e[43];let D;return e[44]!==z||e[45]!==O||e[46]!==E?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[E,z,O]}),e[44]=z,e[45]=O,e[46]=E,e[47]=D):D=e[47],D}const n=i.data;if(!n)return null;const y=n.appSlug?`https://github.com/apps/${n.appSlug}/installations/new`:"https://github.com/settings/installations";if(n.installations.length===0){let h;e[48]!==o||e[49]!==r||e[50]!==s?(h=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=r,e[50]=s,e[51]=h):h=e[51];let E;e[52]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-8 text-foreground"})}),e[52]=E):E=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let G;e[60]!==H?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=G):G=e[61];let F;e[62]!==s?(F=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=F):F=e[63];let O;e[64]!==F?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:F}),e[64]=F,e[65]=O):O=e[65];let D;e[66]!==s?(D=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=D):D=e[67];let ne;e[68]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Ae,{size:14}),e[68]=ne):ne=e[68];let M;e[69]!==y||e[70]!==D?(M=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:[D,ne]})}),e[69]=y,e[70]=D,e[71]=M):M=e[71];let Q;e[72]!==i?(Q=()=>{i.refetch()},e[72]=i,e[73]=Q):Q=e[73];const je=i.isFetching;let B;e[74]!==i.isFetching?(B=i.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[74]=i.isFetching,e[75]=B):B=e[75];let V;e[76]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=V):V=e[77];let K;e[78]!==i.isFetching||e[79]!==Q||e[80]!==B||e[81]!==V?(K=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:Q,disabled:je,children:[B,V]}),e[78]=i.isFetching,e[79]=Q,e[80]=B,e[81]=V,e[82]=K):K=e[82];let J;e[83]!==M||e[84]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[M,K]}),e[83]=M,e[84]=K,e[85]=J):J=e[85];let W;e[86]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=W):W=e[87];let Y;e[88]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[88]=W,e[89]=Y):Y=e[89];let X;e[90]!==L||e[91]!==G||e[92]!==O||e[93]!==J||e[94]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[E,L,G,O,J,Y]}),e[90]=L,e[91]=G,e[92]=O,e[93]=J,e[94]=Y,e[95]=X):X=e[95];let ie;return e[96]!==X||e[97]!==h?(ie=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,X]}),e[96]=X,e[97]=h,e[98]=ie):ie=e[98],ie}let N;e[99]!==o||e[100]!==r||e[101]!==s?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=o,e[100]=r,e[101]=s,e[102]=N):N=e[102];let R;if(e[103]!==n.installations||e[104]!==l||e[105]!==s){let h;e[107]!==l||e[108]!==s?(h=E=>t.jsxs("button",{type:"button",onClick:()=>l(E),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:E.avatarUrl,alt:E.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:E.login}),E.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},E.installationId),e[107]=l,e[108]=s,e[109]=h):h=e[109],R=n.installations.map(h),e[103]=n.installations,e[104]=l,e[105]=s,e[106]=R}else R=e[106];let C;e[110]!==R?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:R}),e[110]=R,e[111]=C):C=e[111];let S;e[112]!==s?(S=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=S):S=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let _;e[116]!==I?(_=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=_):_=e[117];let T;e[118]!==y||e[119]!==S||e[120]!==_?(T=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[S," ",_]})}),e[118]=y,e[119]=S,e[120]=_,e[121]=T):T=e[121];let U;return e[122]!==C||e[123]!==T||e[124]!==N?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,C,T]}),e[122]=C,e[123]=T,e[124]=N,e[125]=U):U=e[125],U}function Me(){}function Qe(P){const e=se.c(23),{connectionId:u,orgId:p,orgSlug:k,installation:l,onSelectRepo:r,isSaving:o}=P,s=ee(),[f,v]=$.useState(""),j=_e(f,300),w=$.useDeferredValue(j),d=f!==w;let c;e[0]!==s?(c=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==d||e[3]!==f||e[4]!==c?(a=t.jsx(Ee,{placeholder:c,value:f,onChange:v,isSearching:d}),e[2]=d,e[3]=f,e[4]=c,e[5]=a):a=e[5];const i=d?"opacity-40":"opacity-100";let g;e[6]!==i?(g=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",i),e[6]=i,e[7]=g):g=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=x):x=e[8];let b;e[9]!==u||e[10]!==w||e[11]!==l||e[12]!==o||e[13]!==r||e[14]!==p||e[15]!==k?(b=t.jsx($.Suspense,{fallback:x,children:t.jsx(Be,{connectionId:u,orgId:p,orgSlug:k,installation:l,query:w,onSelectRepo:r,isSaving:o})}),e[9]=u,e[10]=w,e[11]=l,e[12]=o,e[13]=r,e[14]=p,e[15]=k,e[16]=b):b=e[16];let m;e[17]!==g||e[18]!==b?(m=t.jsx("div",{className:g,children:b}),e[17]=g,e[18]=b,e[19]=m):m=e[19];let n;return e[20]!==a||e[21]!==m?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a,m]}),e[20]=a,e[21]=m,e[22]=n):n=e[22],n}function Be(P){const e=se.c(36),{connectionId:u,orgId:p,orgSlug:k,installation:l,query:r,onSelectRepo:o,isSaving:s}=P,f=ee();let v;e[0]!==u||e[1]!==p||e[2]!==k?(v={connectionId:u,orgId:p,orgSlug:k},e[0]=u,e[1]=p,e[2]=k,e[3]=v):v=e[3];const j=re(v),w=l.type==="User"?"user":"org",d=r?`${w}:${l.login} ${r} in:name`:`${w}:${l.login}`;let c;e[4]!==u||e[5]!==l.login||e[6]!==p||e[7]!==r?(c=te.githubOrgRepos(p,u,l.login,r),e[4]=u,e[5]=l.login,e[6]=p,e[7]=r,e[8]=c):c=e[8];let a;e[9]!==j||e[10]!==d?(a=async m=>{const{signal:n}=m,N=(await j.callTool({name:"search_repositories",arguments:{query:d,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Ve)},e[9]=j,e[10]=d,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i={queryKey:c,queryFn:a},e[12]=c,e[13]=a,e[14]=i):i=e[14];const{data:g}=Ce(i);if(g.length===0){let m;e[15]!==f?(m=f("common.githubRepoPicker.noRepositoriesFound"),e[15]=f,e[16]=m):m=e[16];let n;e[17]!==m?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[17]=m,e[18]=n):n=e[18];let y;e[19]!==r||e[20]!==f?(y=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:f("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=r,e[20]=f,e[21]=y):y=e[21];let N;return e[22]!==n||e[23]!==y?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,y]}),e[22]=n,e[23]=y,e[24]=N):N=e[24],N}let x;if(e[25]!==s||e[26]!==o||e[27]!==g||e[28]!==f){let m;e[30]!==s||e[31]!==o||e[32]!==f?(m=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(q,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:n.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(we,{size:10}):t.jsx(ze,{size:10}),n.private?f("common.githubRepoPicker.private"):f("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=f,e[33]=m):m=e[33],x=g.map(m),e[25]=s,e[26]=o,e[27]=g,e[28]=f,e[29]=x}else x=e[29];let b;return e[34]!==x?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[34]=x,e[35]=b):b=e[35],b}function Ve(P){return{name:P.name,fullName:P.full_name,owner:P.full_name.split("/")[0]??"",url:P.html_url,private:P.private,description:P.description,updatedAt:P.updated_at}}function ae(P){const e=se.c(51),{status:u,error:p,retry:k}=P,l=ee();if(u==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let R;e[1]!==l?(R=l("common.githubRepoPicker.connectionFailed"),e[1]=l,e[2]=R):R=e[2];let C;e[3]!==R?(C=t.jsx("p",{className:"text-sm font-medium",children:R}),e[3]=R,e[4]=C):C=e[4];let S;e[5]!==p||e[6]!==l?(S=p??l("common.githubRepoPicker.somethingWentWrong"),e[5]=p,e[6]=l,e[7]=S):S=e[7];let I;e[8]!==S?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:S}),e[8]=S,e[9]=I):I=e[9];let _;e[10]!==C||e[11]!==I?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,I]}),e[10]=C,e[11]=I,e[12]=_):_=e[12];let T;e[13]!==l?(T=l("common.githubRepoPicker.tryAgain"),e[13]=l,e[14]=T):T=e[14];let U;e[15]!==k||e[16]!==T?(U=t.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:T}),e[15]=k,e[16]=T,e[17]=U):U=e[17];let h;return e[18]!==_||e[19]!==U?(h=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,U]}),e[18]=_,e[19]=U,e[20]=h):h=e[20],h}const r=u==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let f;e[23]!==r||e[24]!==l?(f=l(r?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=r,e[24]=l,e[25]=f):f=e[25];let v;e[26]!==f?(v=t.jsx("p",{className:"text-sm font-medium",children:f}),e[26]=f,e[27]=v):v=e[27];let j;e[28]!==r||e[29]!==l?(j=l(r?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=r,e[29]=l,e[30]=j):j=e[30];let w;e[31]!==j?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:j}),e[31]=j,e[32]=w):w=e[32];let d;e[33]!==v||e[34]!==w?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,w]}),e[33]=v,e[34]=w,e[35]=d):d=e[35];const c=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[36]!==c?(a=ue("size-1.5 rounded-full",c),e[36]=c,e[37]=a):a=e[37];let i;e[38]!==a?(i=t.jsx("span",{className:a}),e[38]=a,e[39]=i):i=e[39];const g=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[40]!==g?(x=ue("size-1.5 rounded-full",g),e[40]=g,e[41]=x):x=e[41];let b;e[42]!==x?(b=t.jsx("span",{className:x}),e[42]=x,e[43]=b):b=e[43];let m;e[44]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=m):m=e[44];let n;e[45]!==i||e[46]!==b?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[i,b,m]}),e[45]=i,e[46]=b,e[47]=n):n=e[47];let y;return e[48]!==n||e[49]!==d?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,d,n]}),e[48]=n,e[49]=d,e[50]=y):y=e[50],y}export{at as G,$e as u};
@@ -1,4 +1,4 @@
1
- import{dv as St,dw as It,ba as R,Y as c,dx as de,bg as ze,dy as Et,b9 as Tt,aI as wt,a5 as O,a4 as G,a2 as oe,X as _,bb as m,b0 as F,cp as Mt,dz as I,a3 as At,t as ge,c as Ee,r as W,F as Ot,j as Ct}from"./index-3s9Tew9h.js";import{S as Rt,u as Nt}from"./use-mcp-client-S8Ro9wXt.js";import{d as xt}from"./delay-CnY5UFtP.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{d as Dt,D as kt}from"./decopilot-sse-pool-CG8MNCkB.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",Lt=Symbol.for(Je),Ce,Re,Z=class We extends(Re=Error,Ce=Lt,Re){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Ne,xe,Zt=class extends(xe=Z,Ne=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Ne]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,ke=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
1
+ import{dv as St,dw as It,ba as R,Y as c,dx as de,bg as ze,dy as Et,b9 as Tt,aI as wt,a5 as O,a4 as G,a2 as oe,X as _,bb as m,b0 as F,cp as Mt,dz as I,a3 as At,t as ge,c as Ee,r as W,F as Ot,j as Ct}from"./index-DEjVUbQZ.js";import{S as Rt,u as Nt}from"./use-mcp-client-B--rl5yR.js";import{d as xt}from"./delay-CnY5UFtP.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{d as Dt,D as kt}from"./decopilot-sse-pool-7Tzx6-E9.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",Lt=Symbol.for(Je),Ce,Re,Z=class We extends(Re=Error,Ce=Lt,Re){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Ne,xe,Zt=class extends(xe=Z,Ne=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Ne]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,ke=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ge(e)}`,cause:e}),this[Pe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Xe)}},Qe="AI_TypeValidationError",Ke=`vercel.ai.error.${Qe}`,Ut=Symbol.for(Ke),Le,je,X=class ve extends(je=Z,Le=Ut,je){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Qe,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ge(a)}`,cause:a}),this[Le]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Ke)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Zt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ft=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Bt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ze(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ft.test(t)===!1&&Bt.test(t)===!1?e:Vt(e)}function Vt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function zt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ze(t)}try{return Ze(t)}finally{Error.stackTraceLimit=e}}function Te(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Te(t)}var Jt=Symbol("Let zodToJsonSchema decide on which parser to use"),$e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Wt=t=>typeof t=="string"?{...$e,name:t}:{...$e,...t};function N(){return{}}function Gt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Yt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Ht(){return{type:"boolean"}}function et(t,e){return b(t.type._def,e)}var qt=(t,e)=>b(t.innerType._def,e);function tt(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>tt(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Xt(t)}}var Xt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Qt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Kt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function ea(t){return{type:"string",enum:Array.from(t.values)}}var ta=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function aa(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ta(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function ra(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function at(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?na(t):t}var sa=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function na(t){let e="";for(let a=0;a<t.length;a++)sa.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ue(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Ue(e,r)}function Ue(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r