decocms 4.463.3 → 4.463.4

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 (359) hide show
  1. package/dist/client/assets/{AlertCircle-BhMkw6G-.js → AlertCircle-C4DXnwFn.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Djqy9_mJ.js → AreaChart-C4aYAk3M.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DcJDauRN.js → ArrowLeft-CrkIBy0V.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BHuZc3SQ.js → ArrowUp-BnfRDCtj.js} +1 -1
  5. package/dist/client/assets/{Building02-C9-aLDDW.js → Building02-BPYbBF2i.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-D2FdeRLg.js → CartesianChart-CRugr-3S.js} +1 -1
  7. package/dist/client/assets/{Check-DuNCwVUq.js → Check-C9M_J-LM.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-4sUPwCq5.js → CheckCircle-DQXE_7xq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Dd2FpxrP.js → ChevronUp-CBkP5lJ3.js} +1 -1
  10. package/dist/client/assets/{Copy01-BzG1c_n8.js → Copy01-CKIM4Pkm.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-7ZJx7Cex.js → CreditCard01-mihIPdMc.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BTTcniRE.js → DotsVertical-MDoiMcyS.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-Q-T-kXz3.js → ErrorBarContext-YQZ6sHbN.js} +1 -1
  14. package/dist/client/assets/{Globe04-DZu_XZyu.js → Globe04-BVo4VIK3.js} +1 -1
  15. package/dist/client/assets/{Image01-BCqKNNl-.js → Image01-DAxDkgZe.js} +1 -1
  16. package/dist/client/assets/{Key01-B58LrIAp.js → Key01-BecEypam.js} +1 -1
  17. package/dist/client/assets/{Line-DvCMsMJt.js → Line-CnwZfFbk.js} +1 -1
  18. package/dist/client/assets/{Link01-B6ccLoRw.js → Link01-BaYhDh62.js} +1 -1
  19. package/dist/client/assets/{LinkBroken01-BgFKKSJa.js → LinkBroken01-L4YdRGCB.js} +1 -1
  20. package/dist/client/assets/{LinkExternal01-Cr1orhHQ.js → LinkExternal01-DxB383PE.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CdUkMYIm.js → Monitor01-BZ4Tb3b1.js} +1 -1
  22. package/dist/client/assets/{Plus-D2dfD4p3.js → Plus-Cs-2g2Qd.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BAGTLAFl.js → SearchMd-5FUtMWhs.js} +1 -1
  24. package/dist/client/assets/{Sector-Cz54yckR.js → Sector-BQIwpgQ2.js} +1 -1
  25. package/dist/client/assets/{ShoppingBag01-CVMvSW_p.js → ShoppingBag01-BTLZ3hJs.js} +1 -1
  26. package/dist/client/assets/{Sun-CDKOQkF0.js → Sun-DcYaxvKG.js} +1 -1
  27. package/dist/client/assets/{Tool01-Ctm1gRtP.js → Tool01-CNesLJor.js} +1 -1
  28. package/dist/client/assets/{Trash01-CHTvyGfK.js → Trash01-DE391E6L.js} +1 -1
  29. package/dist/client/assets/{Upload01-DCdZxmro.js → Upload01-Bpw1Ptny.js} +1 -1
  30. package/dist/client/assets/{User01-D4qTh6Ur.js → User01-CALUsh4b.js} +1 -1
  31. package/dist/client/assets/{UserSquare-Benpxvyd.js → UserSquare-4sy2jBCi.js} +1 -1
  32. package/dist/client/assets/{Users01-DjEwuQ89.js → Users01-0TYS4mlz.js} +1 -1
  33. package/dist/client/assets/{X-D6rJihdk.js → X-vN3laxlE.js} +1 -1
  34. package/dist/client/assets/{XAxis-Ca3F-Q2E.js → XAxis-Cg3y9K45.js} +1 -1
  35. package/dist/client/assets/{XClose-6Cqx-6v9.js → XClose-B2A5kkkA.js} +1 -1
  36. package/dist/client/assets/{ZoomOut-DDsV5ypx.js → ZoomOut-BDXMBoQj.js} +1 -1
  37. package/dist/client/assets/{access-gate-B22wMnh4.js → access-gate-DaCns1ta.js} +1 -1
  38. package/dist/client/assets/{add-connection-dialog-BYVgSY9r.js → add-connection-dialog-C_DxcbJU.js} +1 -1
  39. package/dist/client/assets/{agent-analytics-DDLpcqkp.js → agent-analytics-BA0230tU.js} +1 -1
  40. package/dist/client/assets/agent-app-BQQbKwQ3.js +1 -0
  41. package/dist/client/assets/{agent-assets-Ck0nPRtr.js → agent-assets-BmNu-rqc.js} +1 -1
  42. package/dist/client/assets/{agent-automation-BLgnjQH4.js → agent-automation-Dp9VCXvd.js} +1 -1
  43. package/dist/client/assets/{agent-automations-TSmmfktY.js → agent-automations-pzZlCv0K.js} +1 -1
  44. package/dist/client/assets/{agent-connect-sources-CPahKZe_.js → agent-connect-sources-CWxuT9Ym.js} +1 -1
  45. package/dist/client/assets/agent-deck-kfV_Sekm.js +1 -0
  46. package/dist/client/assets/{agent-e2e-DzZJ4BEu.js → agent-e2e-DUEsXfL0.js} +1 -1
  47. package/dist/client/assets/{agent-experiments-Z0dHWWAJ.js → agent-experiments-e-uhjS-2.js} +1 -1
  48. package/dist/client/assets/{agent-file-DmPgV_kY.js → agent-file-BLu5RCXn.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-GqIsomZ8.js → agent-hosting-BEb4O812.js} +1 -1
  50. package/dist/client/assets/{agent-icon-C8YMMRrt.js → agent-icon-M8hOOBGO.js} +1 -1
  51. package/dist/client/assets/agent-library-file-PymEv3wg.js +1 -0
  52. package/dist/client/assets/agent-library-q7_BMuya.js +1 -0
  53. package/dist/client/assets/{agent-monitor-Bjic3f8P.js → agent-monitor-DhEGMHVd.js} +1 -1
  54. package/dist/client/assets/{agent-overview-BDCT050y.js → agent-overview-BZMTPL9y.js} +1 -1
  55. package/dist/client/assets/agent-settings-CIgSNyzG.js +1 -0
  56. package/dist/client/assets/agent-site-editor-code-Bi-NRJwq.js +2 -0
  57. package/dist/client/assets/{agent-site-editor-content-Ds5VNfTv.js → agent-site-editor-content-nNrgHJFZ.js} +3 -3
  58. package/dist/client/assets/{agent-site-editor-preview-CVKbmDFy.js → agent-site-editor-preview-DRNs2tRR.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-Hm5iv78v.js → agent-site-editor-wXWXEvau.js} +1 -1
  60. package/dist/client/assets/agent-view-BfryexEv.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-Behk99ll.js → agent-view-guard-CuJWB1rc.js} +1 -1
  62. package/dist/client/assets/{agents-list-DdqMBZwE.js → agents-list-B8PgWXTV.js} +1 -1
  63. package/dist/client/assets/{ai-providers-BQ1z_imc.js → ai-providers-CooNHK9c.js} +1 -1
  64. package/dist/client/assets/{alert-IACn6LPh.js → alert-CNfOXZXm.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-D1dlDE_u.js → alert-dialog-CD7bONGt.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-we_WnrlY.js → analytics-sections-B3KvVOzm.js} +1 -1
  67. package/dist/client/assets/{api-keys-CtEPuWxn.js → api-keys-CvrvRwIy.js} +1 -1
  68. package/dist/client/assets/api-keys-U338CYMg.js +1 -0
  69. package/dist/client/assets/app-editor-DG2e4wZO.js +1 -0
  70. package/dist/client/assets/{asset-utils-BlgWeEPo.js → asset-utils-BhBXVEWW.js} +1 -1
  71. package/dist/client/assets/{auth-02qGA-p0.js → auth-BSrtHG_U.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-BM2JY_oQ.js → auth-catchall-B-AsjQQJ.js} +1 -1
  73. package/dist/client/assets/{auth-entry-DYuFXBaw.js → auth-entry-DAP_uAT-.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-BjwTSEJI.js → auth-split-layout-Dd9Sk0t6.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-t00H27kM.js → authenticate-and-persist-oauth-2jMjQnil.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-D8vgoHki.js → automation-list-row-CMM007f8.js} +1 -1
  77. package/dist/client/assets/{automation-runs-CGCI90E9.js → automation-runs-Daf8st2N.js} +1 -1
  78. package/dist/client/assets/{automations-_kbQvN4w.js → automations-Bog_z4EB.js} +1 -1
  79. package/dist/client/assets/{autosend-u-nZ5MtK.js → autosend-XlMc1k2t.js} +1 -1
  80. package/dist/client/assets/{avatar-CthfUkky.js → avatar-CnRwulV6.js} +1 -1
  81. package/dist/client/assets/{badge-CbUAfbf9.js → badge-BdUUSOSl.js} +1 -1
  82. package/dist/client/assets/{block-document-Csn5-Fe8.js → block-document-pc2wT72O.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-C0N8G6nk.js → blocks-preview-workspace-context-BaEmHZHR.js} +1 -1
  84. package/dist/client/assets/{blog-schema-d1oJMCCX.js → blog-schema-CL1GKnSp.js} +1 -1
  85. package/dist/client/assets/{buckets-DnzyN6eP.js → buckets-KxS-7OtP.js} +1 -1
  86. package/dist/client/assets/{build-improve-prompt-doc-CBBzQaM4.js → build-improve-prompt-doc-C2Fp9U8b.js} +1 -1
  87. package/dist/client/assets/{calendar-C32qxSvi.js → calendar-Cijmm0eN.js} +1 -1
  88. package/dist/client/assets/{capability-load-error-J3R2Qssf.js → capability-load-error-BZwFnQBq.js} +1 -1
  89. package/dist/client/assets/{category-editor-CyThNNtf.js → category-editor-DtPlLIY_.js} +1 -1
  90. package/dist/client/assets/{chart-D2lvLprP.js → chart-DJqB9fzG.js} +1 -1
  91. package/dist/client/assets/{chat-context-BXtfkoIh.js → chat-context-CmUEyw_S.js} +1 -1
  92. package/dist/client/assets/{chat-draft-IU8BlLdh.js → chat-draft-cWvyWURL.js} +1 -1
  93. package/dist/client/assets/{checkbox-BaPdGKHa.js → checkbox-DNDTd2PL.js} +1 -1
  94. package/dist/client/assets/{choose-editor-D2zD9R2E.js → choose-editor-CKpM7oiY.js} +1 -1
  95. package/dist/client/assets/{claim-phase-copy-JYB7wUQB.js → claim-phase-copy-B2P2zW65.js} +1 -1
  96. package/dist/client/assets/{cli-auth-success-Dmle9Fq9.js → cli-auth-success-DpJGsn94.js} +1 -1
  97. package/dist/client/assets/{client-icons-AHyXi4gu.js → client-icons-CFe1J8S6.js} +1 -1
  98. package/dist/client/assets/{collapsible-B_MwoX8i.js → collapsible-CVmupvCA.js} +1 -1
  99. package/dist/client/assets/{collection-detail-x61mxxzA.js → collection-detail-BlZcNZ2C.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-D3FMSrxS.js → collection-display-button-CxzEp_83.js} +1 -1
  101. package/dist/client/assets/{collection-search-Be7ynVfq.js → collection-search-CwnvK4XY.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-20gbjjzR.js → collection-table-wrapper-CqZNwayf.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-CAX6VpVI.js → collection-tabs-BFd1UDzi.js} +1 -1
  104. package/dist/client/assets/{column-rules-Bui5Y10P.js → column-rules-DeO1GQGi.js} +1 -1
  105. package/dist/client/assets/{combobox-BQN2MDH_.js → combobox-D8LAHHQn.js} +1 -1
  106. package/dist/client/assets/{command-B3EymxZU.js → command-Db_xDGOA.js} +1 -1
  107. package/dist/client/assets/{companion-mcps-section-DcT15IcT.js → companion-mcps-section-Brye3YBv.js} +1 -1
  108. package/dist/client/assets/{config-AftjVqgc.js → config-BeqEvn5c.js} +1 -1
  109. package/dist/client/assets/{connect-BEDow5fx.js → connect-BbNbISa1.js} +1 -1
  110. package/dist/client/assets/{connect-layout-AmS4fIUX.js → connect-layout-BCuoMMK8.js} +1 -1
  111. package/dist/client/assets/{connection-Cb0v50WY.js → connection-DN7wKcUN.js} +1 -1
  112. package/dist/client/assets/{connection-card-HrKN819A.js → connection-card-Dh0pA57A.js} +1 -1
  113. package/dist/client/assets/{connection-detail-Dn_z5aW_.js → connection-detail-B8mScgEz.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-CIlkmbGO.js → connection-form-helpers-DsyFIBZi.js} +1 -1
  115. package/dist/client/assets/{connections-D97Ixpkw.js → connections-COZbDLgw.js} +1 -1
  116. package/dist/client/assets/{context-LlRMDZ3t.js → context-BtBMcyCO.js} +1 -1
  117. package/dist/client/assets/{context-menu-Bp7m6j0p.js → context-menu-BDYBxqWz.js} +1 -1
  118. package/dist/client/assets/{core.esm-CfKrW38i.js → core.esm-BqvPRiP4.js} +1 -1
  119. package/dist/client/assets/{create-organization-dialog-CnSkXde7.js → create-organization-dialog-FTVVO_At.js} +1 -1
  120. package/dist/client/assets/{daily-pulse-AdfL0ICz.js → daily-pulse-DTuozo6P.js} +1 -1
  121. package/dist/client/assets/{decopilot-DKotfY0G.js → decopilot-k0GhcGeT.js} +1 -1
  122. package/dist/client/assets/{device-hint-TLhbPn0X.js → device-hint-CUmrR_6F.js} +1 -1
  123. package/dist/client/assets/{dialog-BkXK10Y7.js → dialog-CO7_Aog-.js} +1 -1
  124. package/dist/client/assets/{discover-v7oeZhfF.js → discover-SPORwYNc.js} +1 -1
  125. package/dist/client/assets/{domain-settings-DtW0MWSe.js → domain-settings-BMzJMRXq.js} +1 -1
  126. package/dist/client/assets/{download-app-dialog-BUEj7of5.js → download-app-dialog-DnwHS1PT.js} +1 -1
  127. package/dist/client/assets/{drawer-iIkl0Hcs.js → drawer-oFC8StUp.js} +1 -1
  128. package/dist/client/assets/{editor-C4erZJlN.js → editor-BzFGeG3l.js} +1 -1
  129. package/dist/client/assets/{empty-state-CcI2Oj76.js → empty-state-D1CWJ8ql.js} +1 -1
  130. package/dist/client/assets/{empty-state-DO5Mz-Iw.js → empty-state-NGQMUmeG.js} +1 -1
  131. package/dist/client/assets/{extract-connection-data-BAD8MV2m.js → extract-connection-data-BgBd9DCF.js} +1 -1
  132. package/dist/client/assets/{feature-gate-CksEKMxB.js → feature-gate-BRLcRTY8.js} +1 -1
  133. package/dist/client/assets/{feature-paywall-CDz-3te0.js → feature-paywall-DN29gnnp.js} +1 -1
  134. package/dist/client/assets/{file-explorer-eg8DxwjL.js → file-explorer-BS5C5Qma.js} +1 -1
  135. package/dist/client/assets/{file-preview-Dm-4rImk.js → file-preview-BaVjTppN.js} +1 -1
  136. package/dist/client/assets/{file-share-button-DKdH0OG7.js → file-share-button-CHqbxQ2g.js} +1 -1
  137. package/dist/client/assets/{file-type-icon-BHDYgS_B.js → file-type-icon-Dpv7TxDs.js} +1 -1
  138. package/dist/client/assets/flat-project-BJ7gmR72.js +1 -0
  139. package/dist/client/assets/{folder-icon-4CMJTr_y.js → folder-icon-CeSOff0I.js} +1 -1
  140. package/dist/client/assets/{form-Dhq6pwjc.js → form-DhLA4e9V.js} +1 -1
  141. package/dist/client/assets/{gateway-client-Bvwj4KeZ.js → gateway-client-CfQ0xy5j.js} +1 -1
  142. package/dist/client/assets/{general-A8aXHTtd.js → general-BIPOgqg4.js} +1 -1
  143. package/dist/client/assets/{home-BJxWgn_z.js → home-H1MypeCx.js} +1 -1
  144. package/dist/client/assets/{icon-button-1OVYjib7.js → icon-button-DRmJWdFS.js} +1 -1
  145. package/dist/client/assets/{index-J4XiVR26.js → index-2NyPySDN.js} +1 -1
  146. package/dist/client/assets/{index-2HiTLF2D.js → index-4T-3pOoC.js} +1 -1
  147. package/dist/client/assets/{index-6Rmwx6ZZ.js → index-B81tZ0cc.js} +1 -1
  148. package/dist/client/assets/{index-C4wOv8VD.js → index-BAhcg2K-.js} +2 -2
  149. package/dist/client/assets/{index-DgKBjSMr.js → index-BV9sT4Zt.js} +1 -1
  150. package/dist/client/assets/{index-J91yyAk8.js → index-BkOteY4c.js} +1 -1
  151. package/dist/client/assets/{index-Bx_gIcRM.js → index-By0hja7x.js} +1 -1
  152. package/dist/client/assets/{index-DicreNkO.js → index-C4WmY2mf.js} +1 -1
  153. package/dist/client/assets/{index-OVuXzm0y.js → index-CAuUMShE.js} +1 -1
  154. package/dist/client/assets/{index-pNcCOIW3.js → index-CDvvQ8mj.js} +3 -3
  155. package/dist/client/assets/{index-C0RSO_pC.js → index-Cew4MYfd.js} +1 -1
  156. package/dist/client/assets/{index-BAVwPxHD.js → index-Cp_9VTvZ.js} +1 -1
  157. package/dist/client/assets/{index-BPni3tVh.js → index-DDjki-DS.js} +1 -1
  158. package/dist/client/assets/{index-y4A49tOV.js → index-DlA1sXNf.js} +1 -1
  159. package/dist/client/assets/{index-DRL-XclN.js → index-MungJLiq.js} +1 -1
  160. package/dist/client/assets/{index-redirect-lPl9jiiH.js → index-redirect-DCZ7y0Zv.js} +1 -1
  161. package/dist/client/assets/{infiniteQueryObserver-CMRZg1PP.js → infiniteQueryObserver-Criet79k.js} +1 -1
  162. package/dist/client/assets/{infra-billing-C8-uyCrt.js → infra-billing-1jBUonK5.js} +1 -1
  163. package/dist/client/assets/{input-DAcmE8NY.js → input--oqEkg4e.js} +1 -1
  164. package/dist/client/assets/{input-BK1C09vq.js → input-BVnBMwgz.js} +1 -1
  165. package/dist/client/assets/{input-CUA-JfMl.js → input-CtT1bndp.js} +3 -3
  166. package/dist/client/assets/{integration-icon-CehhGvG3.js → integration-icon-C3Eb4y6v.js} +1 -1
  167. package/dist/client/assets/{label-DBQJbIfI.js → label-DTHRCZU2.js} +1 -1
  168. package/dist/client/assets/{layout-DBJR_vIC.js → layout-CIhgL_6i.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-DStzyavo.js → legacy-agents-deep-BVExVzvA.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-BDnA0U1u.js → legacy-main-redirect-BOLfolkB.js} +1 -1
  171. package/dist/client/assets/library-CzbB-zjT.js +1 -0
  172. package/dist/client/assets/{library-tab-ClEM_Dsd.js → library-tab-BDQZAjZl.js} +1 -1
  173. package/dist/client/assets/{login-DFVB_v4a.js → login-D0gfA0n6.js} +1 -1
  174. package/dist/client/assets/{markdown-DruvHgkd.js → markdown-BImqcCfy.js} +1 -1
  175. package/dist/client/assets/{mcp-app-renderer-DjHAlu0J.js → mcp-app-renderer-Udj2fjiO.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-dpH7PMvU.js → mcp-oauth-BLd7mHPD.js} +1 -1
  177. package/dist/client/assets/{members-Bh6sRW02.js → members-FJEMo5iQ.js} +1 -1
  178. package/dist/client/assets/{memory-PqalD6sO.js → memory-BXgoZJ8S.js} +1 -1
  179. package/dist/client/assets/{mini-report-page-CINTuAQl.js → mini-report-page-BmXU622N.js} +1 -1
  180. package/dist/client/assets/{mock-board-C0uGamQw.js → mock-board-BVYoej1h.js} +1 -1
  181. package/dist/client/assets/{monaco-editor-BT3mm5-n.js → monaco-editor-CmLSIzfu.js} +1 -1
  182. package/dist/client/assets/{monitoring-stats-row-BI40-HEM.js → monitoring-stats-row-CPIx5sjP.js} +1 -1
  183. package/dist/client/assets/{multi-select-Tq_Id2Wd.js → multi-select-Tv0Y-nlA.js} +1 -1
  184. package/dist/client/assets/{mustache-CC6y4StJ.js → mustache-CE0WA6lU.js} +1 -1
  185. package/dist/client/assets/{new-project-dialog-Ck09CICz.js → new-project-dialog-Crf97C1d.js} +1 -1
  186. package/dist/client/assets/{oauth-callback-B5glNvg_.js → oauth-callback-DGLdc_Gt.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-ai-provider-CeqhOy-B.js → oauth-callback-ai-provider-BFSS179L.js} +1 -1
  188. package/dist/client/assets/{onboarding-g9QTzLNR.js → onboarding-CQ8EldV7.js} +1 -1
  189. package/dist/client/assets/{openai-conversation-Bc292jpE.js → openai-conversation-C_enqR7A.js} +1 -1
  190. package/dist/client/assets/{optimistic-project-sidebar-views-CsLDsAzq.js → optimistic-project-sidebar-views-Cyqpnahl.js} +1 -1
  191. package/dist/client/assets/{org-file-open-context-B370udlE.js → org-file-open-context-Dv3GKmEo.js} +1 -1
  192. package/dist/client/assets/{organization-choice-D5ERPTgu.js → organization-choice-Dx6vK-tB.js} +1 -1
  193. package/dist/client/assets/{orgs-CvmS9M2f.js → orgs-BRfbfZqD.js} +1 -1
  194. package/dist/client/assets/{page-seo-form-DF0WItCp.js → page-seo-form-CrMMgt7T.js} +1 -1
  195. package/dist/client/assets/{pair-Cc0VCv64.js → pair-CROt8_FJ.js} +1 -1
  196. package/dist/client/assets/{plan-ladder-BfXiKruf.js → plan-ladder-DX67mjcp.js} +1 -1
  197. package/dist/client/assets/{popover-DW2q2rdh.js → popover-DMbWhm29.js} +1 -1
  198. package/dist/client/assets/{post-calendar-BmrlNw-J.js → post-calendar-C0eje06n.js} +1 -1
  199. package/dist/client/assets/{post-editor-Cm6EceFk.js → post-editor-CKtjxE4V.js} +1 -1
  200. package/dist/client/assets/{preview-content-DMI5_Hyx.js → preview-content-BZXctQxE.js} +1 -1
  201. package/dist/client/assets/{preview-dialog-BsmqcIlm.js → preview-dialog-BWOLrKwV.js} +1 -1
  202. package/dist/client/assets/{preview-panel-BN7n4A-a.js → preview-panel-BnAE8y85.js} +1 -1
  203. package/dist/client/assets/{profile-PVQ0WC1P.js → profile-DyQH_aNd.js} +1 -1
  204. package/dist/client/assets/{project-app-view-DeP8gtvI.js → project-app-view-CTiwNh-z.js} +1 -1
  205. package/dist/client/assets/{project-feed-Dqm8Jh8g.js → project-feed-Bvaou8kc.js} +1 -1
  206. package/dist/client/assets/{project-icon-DJFR_w-f.js → project-icon-YWrhQ2Db.js} +1 -1
  207. package/dist/client/assets/project-reports-B8p6v-Rj.js +1 -0
  208. package/dist/client/assets/project-tasks-BUAL7eqS.js +1 -0
  209. package/dist/client/assets/{projects-DmulPELr.js → projects-Cz_obcPK.js} +1 -1
  210. package/dist/client/assets/{projects-empty-state-CT09qdDW.js → projects-empty-state-BscoRvNd.js} +1 -1
  211. package/dist/client/assets/{prompts-D08t2g80.js → prompts-DxBOW8-N.js} +1 -1
  212. package/dist/client/assets/record-editor-Bzuq8LjV.js +1 -0
  213. package/dist/client/assets/{redirect-editor-Dy2RaWJB.js → redirect-editor-8k6qDFXn.js} +1 -1
  214. package/dist/client/assets/{reports-CQLHR3_5.js → reports-DL-r5LZy.js} +1 -1
  215. package/dist/client/assets/reports-DVBfYzhG.js +1 -0
  216. package/dist/client/assets/{reports-onboarding-BiTt-iiG.js → reports-onboarding-BkzJEYoO.js} +1 -1
  217. package/dist/client/assets/{reports-tab-HZuKaMwx.js → reports-tab-xSDSQUq-.js} +2 -2
  218. package/dist/client/assets/{repositories-DN-VjXji.js → repositories-9gi_nAff.js} +1 -1
  219. package/dist/client/assets/{repository-binding-C1oHgnyD.js → repository-binding-Dvarn2QQ.js} +1 -1
  220. package/dist/client/assets/{repository-import-picker-CquoDPq5.js → repository-import-picker-D6An77pP.js} +1 -1
  221. package/dist/client/assets/{repository-picker-wcIXI-8m.js → repository-picker-CGsou9yY.js} +1 -1
  222. package/dist/client/assets/{require-capability-KckNg4hn.js → require-capability-T4uMBp9X.js} +1 -1
  223. package/dist/client/assets/{required-auth-layout-dy_B3GQa.js → required-auth-layout-OTwiT8Ou.js} +1 -1
  224. package/dist/client/assets/{reset-password-BxV30n-s.js → reset-password-D57jaJI7.js} +1 -1
  225. package/dist/client/assets/{resizable-DvIdkFVI.js → resizable-CoiWgWDL.js} +1 -1
  226. package/dist/client/assets/{resolve-tab-icon-3--eUHyi.js → resolve-tab-icon-iAO74BlB.js} +1 -1
  227. package/dist/client/assets/{review-settings-BdgRnspZ.js → review-settings-D8o1AgpU.js} +1 -1
  228. package/dist/client/assets/{rich-text-link-control-CWBNly_s.js → rich-text-link-control-CnMnIlFy.js} +1 -1
  229. package/dist/client/assets/{roles-Cja9GOQq.js → roles-Cnz75rmE.js} +1 -1
  230. package/dist/client/assets/{route-DGtlAB5H.js → route-81TBsXsV.js} +1 -1
  231. package/dist/client/assets/{route-DsZ9GVf5.js → route-B0j3BuC3.js} +1 -1
  232. package/dist/client/assets/route-VTD663Jc.js +1 -0
  233. package/dist/client/assets/{runnable-block-editor-C1-D68Bo.js → runnable-block-editor-DWI9hEay.js} +1 -1
  234. package/dist/client/assets/{sandbox-lifecycle-context-BwkSw288.js → sandbox-lifecycle-context-Ce_ER-vx.js} +1 -1
  235. package/dist/client/assets/{schema-CrhsNm55.js → schema-BWozGVyy.js} +1 -1
  236. package/dist/client/assets/{scroll-area-CMEo43Ub.js → scroll-area-CDjQxGxU.js} +1 -1
  237. package/dist/client/assets/{search-input-LERf6Qhg.js → search-input-BP1ITVRE.js} +1 -1
  238. package/dist/client/assets/{search-toggle-DRe_fGlG.js → search-toggle-DREXsbsC.js} +1 -1
  239. package/dist/client/assets/{secret-picker-ClQvK5XA.js → secret-picker-BygbS_Im.js} +1 -1
  240. package/dist/client/assets/{secrets-BvSch6aM.js → secrets-CwmFXXVK.js} +1 -1
  241. package/dist/client/assets/{sections-editor-ryWTU5Lu.js → sections-editor-B_-ExFTX.js} +1 -1
  242. package/dist/client/assets/{select-CeOOzuwB.js → select-DugEew9E.js} +1 -1
  243. package/dist/client/assets/{select-model-B9IZt2bw.js → select-model-DWNaSKrk.js} +1 -1
  244. package/dist/client/assets/{seo-editor-D3vW227e.js → seo-editor-DRWu0V_n.js} +1 -1
  245. package/dist/client/assets/{separator-D8Qsd27h.js → separator-CGBOq1fk.js} +1 -1
  246. package/dist/client/assets/{settings-tab-B6QhTgaG.js → settings-tab-S6-bKh7j.js} +1 -1
  247. package/dist/client/assets/{sheet-6pjtjkXK.js → sheet-CKDS5Xoz.js} +1 -1
  248. package/dist/client/assets/{shell-layout-CPxvqBKI.js → shell-layout-B590ACBF.js} +1 -1
  249. package/dist/client/assets/{skills-_zNx8LwL.js → skills-BTYH3GVR.js} +1 -1
  250. package/dist/client/assets/{sso-CaBy3jph.js → sso-C71_cFUO.js} +1 -1
  251. package/dist/client/assets/{suggestion-CgTZllJW.js → suggestion-DHWFYHdN.js} +1 -1
  252. package/dist/client/assets/{switch-C8GL1Rd2.js → switch-B2MgHt30.js} +1 -1
  253. package/dist/client/assets/{synced-repos-iIy2qrgi.js → synced-repos-QhdC2fuS.js} +1 -1
  254. package/dist/client/assets/{tab-icon-glyph-CWA8cBZ6.js → tab-icon-glyph-DCDLOv32.js} +1 -1
  255. package/dist/client/assets/{table-aCXBAoQN.js → table-CUmKlTWK.js} +1 -1
  256. package/dist/client/assets/{tabs-BfhjNZnx.js → tabs-B-P9k5cW.js} +1 -1
  257. package/dist/client/assets/{task-board-JGCJaP3X.js → task-board-ZQVJfgC6.js} +1 -1
  258. package/dist/client/assets/{task-route-BjfKZfGk.js → task-route-Dc2j9FAj.js} +1 -1
  259. package/dist/client/assets/{task-status-BGZJ3Vdy.js → task-status-Dh8XOg4W.js} +1 -1
  260. package/dist/client/assets/{taskboard-analytics-Dr0JG0NP.js → taskboard-analytics-DYtAUD1o.js} +1 -1
  261. package/dist/client/assets/tasks-CEmX1CUM.js +1 -0
  262. package/dist/client/assets/{tasks-C_pmScDQ.js → tasks-Dl1wpwQV.js} +1 -1
  263. package/dist/client/assets/{textarea-BYviC5WM.js → textarea-_bF5dcXL.js} +1 -1
  264. package/dist/client/assets/{thread-analytics-DxbQ5aWP.js → thread-analytics-pZgA9PKq.js} +1 -1
  265. package/dist/client/assets/{thread-button-DM8OFo-M.js → thread-button-JC2S1tup.js} +1 -1
  266. package/dist/client/assets/{thread-intent-CdOI6M-W.js → thread-intent-DVUhGxKs.js} +1 -1
  267. package/dist/client/assets/{thread-route-BP6I8iBt.js → thread-route-CChJ4SIt.js} +1 -1
  268. package/dist/client/assets/{thread-route-B8tWsziC.js → thread-route-CYefGjgy.js} +1 -1
  269. package/dist/client/assets/{thread-sheet-body-D4_1ph-x.js → thread-sheet-body--ZBnIe-c.js} +1 -1
  270. package/dist/client/assets/{toggle-group-DKTtsyHf.js → toggle-group-DbwDHQsp.js} +1 -1
  271. package/dist/client/assets/{toolbar-icon-button-BsnhfKU-.js → toolbar-icon-button-_Xpiy5Mx.js} +1 -1
  272. package/dist/client/assets/{tooltip-CDv5NaPA.js → tooltip-BtKdL9Sw.js} +1 -1
  273. package/dist/client/assets/{track-CTU_XWQa.js → track-BOyqFhQG.js} +1 -1
  274. package/dist/client/assets/{types-CmkCLGEH.js → types-D7c7j-nZ.js} +1 -1
  275. package/dist/client/assets/{usage-stats-i1ICol6b.js → usage-stats-BFH_VT4g.js} +1 -1
  276. package/dist/client/assets/{use-ai-providers-DOy-yqcL.js → use-ai-providers-Bwpw-Apu.js} +1 -1
  277. package/dist/client/assets/{use-automations-CX5K2wAM.js → use-automations-DGPX0cJ9.js} +1 -1
  278. package/dist/client/assets/{use-autosave-DcL8KK3g.js → use-autosave-CI3fM1LK.js} +1 -1
  279. package/dist/client/assets/{use-chat-layout-state--A7df80n.js → use-chat-layout-state-JT4q9rDL.js} +1 -1
  280. package/dist/client/assets/{use-chat-navigation-B9JQjtA_.js → use-chat-navigation-eIpLZmGO.js} +1 -1
  281. package/dist/client/assets/{use-clock-tick-h6JqduaF.js → use-clock-tick-BjEdUP2i.js} +1 -1
  282. package/dist/client/assets/{use-connect-companion-DzIsbhcX.js → use-connect-companion-CVPZznHr.js} +1 -1
  283. package/dist/client/assets/{use-connection-CXczCUj5.js → use-connection-brKVr3Fw.js} +1 -1
  284. package/dist/client/assets/{use-copy-BQ_7b_NM.js → use-copy-UYJLbF9Z.js} +1 -1
  285. package/dist/client/assets/{use-create-virtual-mcp-Br-GJt46.js → use-create-virtual-mcp-Djh9llK5.js} +1 -1
  286. package/dist/client/assets/{use-date-fns-locale-DebLySC8.js → use-date-fns-locale-DcFiK_Yg.js} +1 -1
  287. package/dist/client/assets/{use-debounced-autosave-7-sB3Fqi.js → use-debounced-autosave-uyQKmOKd.js} +1 -1
  288. package/dist/client/assets/{use-debounced-value-QOxbpeHd.js → use-debounced-value-C6y6B5qv.js} +1 -1
  289. package/dist/client/assets/{use-deco-credits-BtZJqxeZ.js → use-deco-credits-jXdH-7Tu.js} +1 -1
  290. package/dist/client/assets/{use-decopilot-events-Cb3pZyg7.js → use-decopilot-events-B_T_2QPQ.js} +1 -1
  291. package/dist/client/assets/{use-delete-connection-BUWirmhI.js → use-delete-connection-C2qwDp_a.js} +1 -1
  292. package/dist/client/assets/{use-deployment-admin-BQIJ8hKQ.js → use-deployment-admin-Bxh-MFV9.js} +1 -1
  293. package/dist/client/assets/{use-ensure-project-folder-PVZ8CXtp.js → use-ensure-project-folder-C8H_bP_w.js} +1 -1
  294. package/dist/client/assets/{use-fast-preview-draft-url-Nh5dJ3f6.js → use-fast-preview-draft-url-D4xlhBPD.js} +1 -1
  295. package/dist/client/assets/{use-file-configs-BMv1Gkn7.js → use-file-configs-DbwKKD7f.js} +1 -1
  296. package/dist/client/assets/{use-infinite-scroll-DNSYehlB.js → use-infinite-scroll-BJGILMKO.js} +1 -1
  297. package/dist/client/assets/{use-join-requests-9oisRIdi.js → use-join-requests-DzIL0Icd.js} +1 -1
  298. package/dist/client/assets/{use-main-panel-tabs-AvDIAfYm.js → use-main-panel-tabs-B6SU0VvF.js} +1 -1
  299. package/dist/client/assets/{use-mcp-auth-status-BbLGT-o-.js → use-mcp-auth-status-hcIHFlxg.js} +1 -1
  300. package/dist/client/assets/{use-mcp-client-CeUgeePg.js → use-mcp-client-C80Rcg0W.js} +1 -1
  301. package/dist/client/assets/{use-mcp-prompts-BFZwAW55.js → use-mcp-prompts-C68kWfXm.js} +1 -1
  302. package/dist/client/assets/{use-mcp-tools-Cua0wkV4.js → use-mcp-tools-Ctdc1xYy.js} +1 -1
  303. package/dist/client/assets/{use-members-DdQS3iPt.js → use-members-BiHGI8XY.js} +1 -1
  304. package/dist/client/assets/{use-mobile-DlIugPPF.js → use-mobile-BDecCscv.js} +1 -1
  305. package/dist/client/assets/{use-navigate-to-agent-ge4w9Na9.js → use-navigate-to-agent-CUKUrqz8.js} +1 -1
  306. package/dist/client/assets/use-new-blocks-editor-Zj6wjfnw.js +1 -0
  307. package/dist/client/assets/{use-open-billing-url-CvIIrTyD.js → use-open-billing-url-PixTYx32.js} +1 -1
  308. package/dist/client/assets/{use-org-auth-client-D4VGJEAN.js → use-org-auth-client-B5FQgswR.js} +1 -1
  309. package/dist/client/assets/{use-org-fs-DCFeZfzS.js → use-org-fs-CYmNAvQQ.js} +1 -1
  310. package/dist/client/assets/{use-org-repo-syncs-iPnI-DST.js → use-org-repo-syncs-D09FLJNZ.js} +1 -1
  311. package/dist/client/assets/{use-org-sso-CNzLYHP5.js → use-org-sso-DRLA8Vbf.js} +1 -1
  312. package/dist/client/assets/{use-organization-roles-B1gbJbPN.js → use-organization-roles-CVGE992M.js} +1 -1
  313. package/dist/client/assets/{use-organization-settings-B5RlFwsP.js → use-organization-settings-D4Byt2gj.js} +1 -1
  314. package/dist/client/assets/{use-panel-navigate-CitmTlg-.js → use-panel-navigate-N_ZLezId.js} +1 -1
  315. package/dist/client/assets/{use-project-scope-B6u3BQm-.js → use-project-scope-G-Gyk-m5.js} +1 -1
  316. package/dist/client/assets/{use-releases-C3Wx1FNK.js → use-releases-BBFqP8G2.js} +1 -1
  317. package/dist/client/assets/{use-reports-diagnostic-CwEPU_X_.js → use-reports-diagnostic-D7aNY7lB.js} +1 -1
  318. package/dist/client/assets/{use-secrets-Dl4FmH2F.js → use-secrets-DelhSTS_.js} +1 -1
  319. package/dist/client/assets/{use-section-preview-base-CcOgqtsR.js → use-section-preview-base-CLJqRVwo.js} +1 -1
  320. package/dist/client/assets/{use-session-runtime-BcpxMNJM.js → use-session-runtime-C6eyRsK9.js} +1 -1
  321. package/dist/client/assets/{use-tags-Cy_dO4Nd.js → use-tags-CPeu6da4.js} +1 -1
  322. package/dist/client/assets/{use-task-board-analytics-D1SYRx-p.js → use-task-board-analytics-gE47QEsU.js} +1 -1
  323. package/dist/client/assets/{use-task-board-events-DW9lCMnD.js → use-task-board-events-Cx17PZDn.js} +1 -1
  324. package/dist/client/assets/{use-task-metadata-CQxw3jYw.js → use-task-metadata-C3lM4vdZ.js} +1 -1
  325. package/dist/client/assets/{use-thread-analytics-C-GfIqdZ.js → use-thread-analytics-BxMnaIYh.js} +1 -1
  326. package/dist/client/assets/{use-thread-outputs-CE6mB5nx.js → use-thread-outputs-Bma_v6QO.js} +1 -1
  327. package/dist/client/assets/useInfiniteQuery-DXwFDh0j.js +1 -0
  328. package/dist/client/assets/{useQueries-CCAKbITr.js → useQueries-BlR_NaTj.js} +1 -1
  329. package/dist/client/assets/useSuspenseInfiniteQuery-C-TN9JId.js +1 -0
  330. package/dist/client/assets/{users-BiwFlug7.js → users-84mMEShN.js} +1 -1
  331. package/dist/client/assets/{utils-CQIvmH4V.js → utils-YaXW9l1Q.js} +1 -1
  332. package/dist/client/assets/{variant-calendar-BIe7OpbI.js → variant-calendar-DYMSFNzX.js} +1 -1
  333. package/dist/client/assets/{variant-matcher-override-B92kR4eN.js → variant-matcher-override-CfjwCSF5.js} +1 -1
  334. package/dist/client/assets/{view-mode-toggle-haIypn5s.js → view-mode-toggle-D0hM0HXO.js} +1 -1
  335. package/dist/client/assets/{virtual-mcp-BtRikOYR.js → virtual-mcp-CcroxAhs.js} +1 -1
  336. package/dist/client/index.html +1 -1
  337. package/dist/server/cli.js +132 -132
  338. package/dist/server/server.js +129 -129
  339. package/package.json +1 -1
  340. package/dist/client/assets/agent-app-sAHLy5Ic.js +0 -1
  341. package/dist/client/assets/agent-deck-DG_76I-j.js +0 -1
  342. package/dist/client/assets/agent-library-Cxf3Tywp.js +0 -1
  343. package/dist/client/assets/agent-library-file-Cp7BpQZN.js +0 -1
  344. package/dist/client/assets/agent-settings-BiLfgSqW.js +0 -1
  345. package/dist/client/assets/agent-site-editor-code-CF_eQch0.js +0 -2
  346. package/dist/client/assets/agent-view-DkyjmGW5.js +0 -1
  347. package/dist/client/assets/api-keys-B7rTK5kd.js +0 -1
  348. package/dist/client/assets/app-editor-CKn-8XiP.js +0 -1
  349. package/dist/client/assets/flat-project-Ck2u8B45.js +0 -1
  350. package/dist/client/assets/library-D6lvbjQe.js +0 -1
  351. package/dist/client/assets/project-reports-Kn3-ox_K.js +0 -1
  352. package/dist/client/assets/project-tasks-C9B-vvJd.js +0 -1
  353. package/dist/client/assets/record-editor-CtOcjp7f.js +0 -1
  354. package/dist/client/assets/reports-DgQ2P4L4.js +0 -1
  355. package/dist/client/assets/route-JIrPuo4v.js +0 -1
  356. package/dist/client/assets/tasks-bFbiw1vb.js +0 -1
  357. package/dist/client/assets/use-new-blocks-editor-BiMj4QFn.js +0 -1
  358. package/dist/client/assets/useInfiniteQuery-CWQU9XP-.js +0 -1
  359. package/dist/client/assets/useSuspenseInfiniteQuery-B5_OMPT8.js +0 -1
@@ -1 +1 @@
1
- import{c as s}from"./index-C4wOv8VD.js";import{c as v,w}from"./section-preview-url-7zfngvgW.js";import{ap as h}from"./claim-phase-copy-JYB7wUQB.js";import{u as d}from"./use-session-runtime-BcpxMNJM.js";function D(e){const t=s.c(4),r=d(e?.virtualMcpId).runtime==="cms",i=h(e);let l;return t[0]!==i||t[1]!==r||t[2]!==e?(l=e&&i&&r?v({...e,...i}):null,t[0]=i,t[1]=r,t[2]=e,t[3]=l):l=t[3],l}function R(e){const t=s.c(11);let r;t[0]!==e?(r=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=r):r=t[1];const i=D(r),l=e?.previewServerUrl??null;let n=null;if(l)try{let c;t[2]!==l?(c=new URL(l),t[2]=l,t[3]=c):c=t[3],n=c.host}catch{n=null}let o;t[4]!==i||t[5]!==e||t[6]!==l?(o=e&&l&&i?w(new URL(e.path,l).toString(),i):null,t[4]=i,t[5]=e,t[6]=l,t[7]=o):o=t[7];const f=o;let u;return t[8]!==n||t[9]!==f?(u={url:f,host:n},t[8]=n,t[9]=f,t[10]=u):u=t[10],u}export{D as a,R as u};
1
+ import{c as s}from"./index-BAhcg2K-.js";import{c as v,w}from"./section-preview-url-7zfngvgW.js";import{ap as h}from"./claim-phase-copy-B2P2zW65.js";import{u as d}from"./use-session-runtime-C6eyRsK9.js";function D(e){const t=s.c(4),r=d(e?.virtualMcpId).runtime==="cms",i=h(e);let l;return t[0]!==i||t[1]!==r||t[2]!==e?(l=e&&i&&r?v({...e,...i}):null,t[0]=i,t[1]=r,t[2]=e,t[3]=l):l=t[3],l}function R(e){const t=s.c(11);let r;t[0]!==e?(r=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=r):r=t[1];const i=D(r),l=e?.previewServerUrl??null;let n=null;if(l)try{let c;t[2]!==l?(c=new URL(l),t[2]=l,t[3]=c):c=t[3],n=c.host}catch{n=null}let o;t[4]!==i||t[5]!==e||t[6]!==l?(o=e&&l&&i?w(new URL(e.path,l).toString(),i):null,t[4]=i,t[5]=e,t[6]=l,t[7]=o):o=t[7];const f=o;let u;return t[8]!==n||t[9]!==f?(u={url:f,host:n},t[8]=n,t[9]=f,t[10]=u):u=t[10],u}export{D as a,R as u};
@@ -1 +1 @@
1
- import{c as u,X as c,a2 as r,K as a,m as y,D as F,o as C,e as d}from"./index-C4wOv8VD.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,m as b,q as c,E as u};
1
+ import{c as u,X as c,a2 as r,K as a,m as y,D as F,o as C,e as d}from"./index-BAhcg2K-.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,m as b,q as c,E as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-C4wOv8VD.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
1
+ import{r as e}from"./index-BAhcg2K-.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{r as L,X as q,o as Q,a as V,at as z,b as B,e as T,q as F,t as S,K as M,j as t,B as P,av as G,c as J,a2 as K,am as U,m as Z}from"./index-C4wOv8VD.js";import{D as k,a as Y,b as $,c as H,d as X,e as W}from"./dialog-BkXK10Y7.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-Dhq6pwjc.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-CeOOzuwB.js";import{T as re}from"./textarea-BYviC5WM.js";import{u as ae}from"./use-org-auth-client-D4VGJEAN.js";import{u as le}from"./use-organization-roles-B1gbJbPN.js";const ce=G().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),x=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),v=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async R=>{const y=await x.organization.inviteMember({email:R,role:s});if(y.error)throw new Error(y.error.message);return y.data})),w=a.filter(R=>R.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}v.mutate({emails:p,role:n.role})},b=p.length>0&&!!j;return t.jsxs(k,{open:d,onOpenChange:c,children:[t.jsx(Y,{asChild:!0,children:e}),t.jsxs($,{className:"sm:max-w-lg",children:[t.jsx(H,{children:t.jsx(X,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:v.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:v.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs(W,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:v.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:v.isPending||!b,children:v.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:x}=U(),r=x||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=Z(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function je(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),x=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==x?(m=()=>{x.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),x.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=x,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=b=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:b}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=b=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:b}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const v=T(i);let D;return e[26]!==E||e[27]!==v?(D={approve:E,deny:v},e[26]=E,e[27]=v,e[28]=D):D=e[28],D}export{ve as I,je as a,xe as u};
1
+ import{r as L,X as q,o as Q,a as V,at as z,b as B,e as T,q as F,t as S,K as M,j as t,B as P,av as G,c as J,a2 as K,am as U,m as Z}from"./index-BAhcg2K-.js";import{D as k,a as Y,b as $,c as H,d as X,e as W}from"./dialog-CO7_Aog-.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-DhLA4e9V.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-DugEew9E.js";import{T as re}from"./textarea-_bF5dcXL.js";import{u as ae}from"./use-org-auth-client-B5FQgswR.js";import{u as le}from"./use-organization-roles-CVGE992M.js";const ce=G().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),x=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),v=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async R=>{const y=await x.organization.inviteMember({email:R,role:s});if(y.error)throw new Error(y.error.message);return y.data})),w=a.filter(R=>R.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}v.mutate({emails:p,role:n.role})},b=p.length>0&&!!j;return t.jsxs(k,{open:d,onOpenChange:c,children:[t.jsx(Y,{asChild:!0,children:e}),t.jsxs($,{className:"sm:max-w-lg",children:[t.jsx(H,{children:t.jsx(X,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:v.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:v.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs(W,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:v.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:v.isPending||!b,children:v.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:x}=U(),r=x||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=Z(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function je(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),x=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==x?(m=()=>{x.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),x.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=x,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=b=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:b}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=b=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:b}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const v=T(i);let D;return e[26]!==E||e[27]!==v?(D={approve:E,deny:v},e[26]=E,e[27]=v,e[28]=D):D=e[28],D}export{ve as I,je as a,xe as u};
@@ -1 +1 @@
1
- import{c as Oe,b as $e,u as Ke,X as Be,eh as Qe,ei as We,ej as pe,ek as me,ac as Xe,aa as ue,el as _e,em as qe,r as G,e2 as ze,C as fe,en as Ge,eo as Je}from"./index-C4wOv8VD.js";import{g as Ye,h as Ze,u as et,j as tt,k as at,l as ot}from"./use-chat-layout-state--A7df80n.js";import{b as nt}from"./agent-icon-C8YMMRrt.js";import{i as st}from"./Monitor01-CdUkMYIm.js";import{u as it}from"./use-connection-CXczCUj5.js";import{b as rt}from"./use-mcp-client-CeUgeePg.js";import{u as ct}from"./use-mcp-tools-Cua0wkV4.js";import{a as lt}from"./repository-binding-C1oHgnyD.js";import{g as dt}from"./types-CmkCLGEH.js";import{t as pt}from"./utils-CVEq3hMx.js";import{u as mt,b as D}from"./use-project-scope-B6u3BQm-.js";import"./index-BPni3tVh.js";import{c as ut,d as ft}from"./sandbox-lifecycle-context-BwkSw288.js";import{F as be}from"./file-type-icon-BHDYgS_B.js";import{a as bt,u as Tt}from"./use-panel-navigate-CitmTlg-.js";import{r as J}from"./resolve-tab-icon-3--eUHyi.js";import{u as vt}from"./use-task-metadata-CQxw3jYw.js";import{i as It,r as kt,s as yt}from"./shell-layout-CPxvqBKI.js";import{u as Pt}from"./use-session-runtime-BcpxMNJM.js";import{u as ht}from"./use-is-desktop-app-BNujXJc_.js";import{u as wt}from"./use-organization-settings-B5RlFwsP.js";import{b as gt}from"./chat-context-BXtfkoIh.js";import{r as Ct}from"./virtual-mcp-BtRikOYR.js";function Vt(a,e){return!!a&&!!e&&e===`thread:${a}`}function Mt(a){return a.threadHasRepo?"repo":Vt(a.threadId,a.sandboxBranch)?"none":a.agentHasRepo?"repo":"none"}function ta(a){const e=Oe.c(37),l=$e(),{openPanel:f,closePanel:N}=bt();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const Te=Ke(b),Y=Tt(),Z=Ye(),i=lt(a.virtualMcpId),T=vt(a.taskId),{org:n}=Be(),{currentBranch:ve,activeTask:v}=gt(),ee=ht(),d=i?.metadata.ui?.layout??null,r=d?.tabs??[],p=i?.id?Qe(i.id):null,I=T?.expanded_tools??[],k=wt(),{scopeId:Ie,project:ke}=mt(),U=Ze(Ie,ke,i),x=et(U.project),te=tt(U.resolvedScopeId,D(U.project?.metadata),x.presence);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y={includeVirtual:!0},e[1]=y):y=e[1];const m=it(y),ye=ut(),{vmEntry:ae,previewUrl:oe}=ft(),E=v?.branch??ve;let P;e[2]!==v?.metadata||e[3]!==a.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==E?(P=Mt({threadId:a.taskId,sandboxBranch:E,agentHasRepo:D(i?.metadata),threadHasRepo:D(T)||D(v?.metadata)}),e[2]=v?.metadata,e[3]=a.taskId,e[4]=i?.metadata,e[5]=T,e[6]=E,e[7]=P):P=e[7];const Pe=P,ne=ye.lifecycle.phase==="running",{runtime:he,resolved:se}=Pt(a.virtualMcpId);let h;e[8]!==ee||e[9]!==oe||e[10]!==ae?(h=void 0,e[8]=ee,e[9]=oe,e[10]=ae,e[11]=h):h=e[11];const we=h,ie=rt({connectionId:p??void 0,orgId:n.id,orgSlug:n.slug,mcpUrl:we}),F=ie,H=!!ie&≠let w;e[12]!==F||e[13]!==H?(w={client:F,enabled:H},e[12]=F,e[13]=H,e[14]=w):w=e[14];const{data:ge}=ct(w),re=p&&ne?(ge?.tools??[]).filter(At).map(t=>({connectionId:p,toolName:t.name,label:pt(t.name),icon:null})):[],L=re[0],Ce=L?re:[],u=L&&p?{type:"ext-apps",id:p,toolName:L.toolName}:d?.defaultMainView??null,Ve=Ct(d),ce={assets:x.assetsPending,siteAccess:x.siteAccessPending},{activeTab:g,mainOpen:c}=We({panelTabId:Y,mainPanelParam:Te.mainpanel,routeDefaultMain:Z,metadata:u||d?{defaultMainView:u,tabs:r.map(jt)}:null}),Me=u||d?{defaultMainView:u,tabs:r.map(Rt)}:null,C=kt({hasSource:Pe==="repo"||k,runtime:he,cmsMode:Ve}),Se=C.includes("content"),Re=pe(Me),je=u?.type,le=at(je,te,ce,C,se),O=le?pe(null):Re,Ae=ot(g,te,ce),De=!C.includes("code")&&se&&me(g)!==null,o=!Y&&!Z&&le||g==="content"&&!Se||De||Ae?O:g,$=Xe(o);let V;e[15]!==l?(V=t=>l(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[15]=l,e[16]=V):V=e[16];const Ne=V,K=new Map;for(const t of I){const s=ue(t.appId,t.toolName);K.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Ce){if(t.toolName==="fetch_assets")continue;const s=ue(t.connectionId,t.toolName);K.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const B=_e(o),Q=B?B.key.split("/").pop()??B.key:null,Ue=Q?[{id:o,title:Q,kind:"file",icon:{kind:"component",Component:t=>G.createElement(be,{filename:Q,...t})}}]:[],M=qe(o),xe=M?[{id:o,title:(M.path.split("/").pop()??M.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>G.createElement(M.path.startsWith("pages/")?nt:st,t)}}]:[],W=ze(o),X=W?W.path.split("/").pop()??W.path:null,Ee=X?[{id:o,title:X,kind:"file",icon:{kind:"component",Component:t=>G.createElement(be,{filename:X,...t})}}]:[],Fe=It(o)?C.map(t=>({id:t==="code"&&me(o)?o:t,title:Ne(t),kind:"system",icon:J({tabId:t,kind:"system",connections:m})})):[];let S;e[17]!==m?(S=t=>({id:Ge(t.id),title:t.title,kind:"agent",icon:J({tabId:t.id,kind:"agent",appId:t.view.appId,connections:m})}),e[17]=m,e[18]=S):S=e[18];const He=[...Fe,...Ue,...xe,...Ee,...r.map(S),...Array.from(K.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:J({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:m})}))],de=new Set,_=He.filter(t=>de.has(t.id)?!1:(de.add(t.id),!0)),Le=a.virtualMcpId;let R;e[19]!==n.id?(R=fe(n.id),e[19]=n.id,e[20]=R):R=e[20];const q=Le===R;let j;e[21]!==o||e[22]!==N||e[23]!==c||e[24]!==q||e[25]!==f||e[26]!==n.id||e[27]!==k?(j=t=>{if(yt({reportsOnly:k,onReportAgent:q,tabId:t})){f(t,{virtualmcpid:fe(n.id),search:St});return}const s=Je({clickedId:t,activeTab:o,mainOpen:c});"close"in s?N():f(s.tabId)},e[21]=o,e[22]=N,e[23]=c,e[24]=q,e[25]=f,e[26]=n.id,e[27]=k,e[28]=j):j=e[28];const z=j;let A;return e[29]!==o||e[30]!==$||e[31]!==I||e[32]!==r||e[33]!==c||e[34]!==z||e[35]!==_?(A={activeTab:o,mainOpen:c,setActiveTab:z,layoutTabs:r,expandedTools:I,automationTabParsed:$,tabs:_},e[29]=o,e[30]=$,e[31]=I,e[32]=r,e[33]=c,e[34]=z,e[35]=_,e[36]=A):A=e[36],A}function St(a){return{...a,thread:void 0}}function Rt(a){return{id:a.id}}function jt(a){return{id:a.id}}function At(a){return!!dt(a._meta)}export{Mt as r,ta as u};
1
+ import{c as Oe,b as $e,u as Ke,X as Be,eh as Qe,ei as We,ej as pe,ek as me,ac as Xe,aa as ue,el as _e,em as qe,r as G,e2 as ze,C as fe,en as Ge,eo as Je}from"./index-BAhcg2K-.js";import{g as Ye,h as Ze,u as et,j as tt,k as at,l as ot}from"./use-chat-layout-state-JT4q9rDL.js";import{b as nt}from"./agent-icon-M8hOOBGO.js";import{i as st}from"./Monitor01-BZ4Tb3b1.js";import{u as it}from"./use-connection-brKVr3Fw.js";import{b as rt}from"./use-mcp-client-C80Rcg0W.js";import{u as ct}from"./use-mcp-tools-Ctdc1xYy.js";import{a as lt}from"./repository-binding-Dvarn2QQ.js";import{g as dt}from"./types-D7c7j-nZ.js";import{t as pt}from"./utils-CVEq3hMx.js";import{u as mt,b as D}from"./use-project-scope-G-Gyk-m5.js";import"./index-DDjki-DS.js";import{c as ut,d as ft}from"./sandbox-lifecycle-context-Ce_ER-vx.js";import{F as be}from"./file-type-icon-Dpv7TxDs.js";import{a as bt,u as Tt}from"./use-panel-navigate-N_ZLezId.js";import{r as J}from"./resolve-tab-icon-iAO74BlB.js";import{u as vt}from"./use-task-metadata-C3lM4vdZ.js";import{i as It,r as kt,s as yt}from"./shell-layout-B590ACBF.js";import{u as Pt}from"./use-session-runtime-C6eyRsK9.js";import{u as ht}from"./use-is-desktop-app-BNujXJc_.js";import{u as wt}from"./use-organization-settings-D4Byt2gj.js";import{b as gt}from"./chat-context-CmUEyw_S.js";import{r as Ct}from"./virtual-mcp-CcroxAhs.js";function Vt(a,e){return!!a&&!!e&&e===`thread:${a}`}function Mt(a){return a.threadHasRepo?"repo":Vt(a.threadId,a.sandboxBranch)?"none":a.agentHasRepo?"repo":"none"}function ta(a){const e=Oe.c(37),l=$e(),{openPanel:f,closePanel:N}=bt();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const Te=Ke(b),Y=Tt(),Z=Ye(),i=lt(a.virtualMcpId),T=vt(a.taskId),{org:n}=Be(),{currentBranch:ve,activeTask:v}=gt(),ee=ht(),d=i?.metadata.ui?.layout??null,r=d?.tabs??[],p=i?.id?Qe(i.id):null,I=T?.expanded_tools??[],k=wt(),{scopeId:Ie,project:ke}=mt(),U=Ze(Ie,ke,i),x=et(U.project),te=tt(U.resolvedScopeId,D(U.project?.metadata),x.presence);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y={includeVirtual:!0},e[1]=y):y=e[1];const m=it(y),ye=ut(),{vmEntry:ae,previewUrl:oe}=ft(),E=v?.branch??ve;let P;e[2]!==v?.metadata||e[3]!==a.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==E?(P=Mt({threadId:a.taskId,sandboxBranch:E,agentHasRepo:D(i?.metadata),threadHasRepo:D(T)||D(v?.metadata)}),e[2]=v?.metadata,e[3]=a.taskId,e[4]=i?.metadata,e[5]=T,e[6]=E,e[7]=P):P=e[7];const Pe=P,ne=ye.lifecycle.phase==="running",{runtime:he,resolved:se}=Pt(a.virtualMcpId);let h;e[8]!==ee||e[9]!==oe||e[10]!==ae?(h=void 0,e[8]=ee,e[9]=oe,e[10]=ae,e[11]=h):h=e[11];const we=h,ie=rt({connectionId:p??void 0,orgId:n.id,orgSlug:n.slug,mcpUrl:we}),F=ie,H=!!ie&≠let w;e[12]!==F||e[13]!==H?(w={client:F,enabled:H},e[12]=F,e[13]=H,e[14]=w):w=e[14];const{data:ge}=ct(w),re=p&&ne?(ge?.tools??[]).filter(At).map(t=>({connectionId:p,toolName:t.name,label:pt(t.name),icon:null})):[],L=re[0],Ce=L?re:[],u=L&&p?{type:"ext-apps",id:p,toolName:L.toolName}:d?.defaultMainView??null,Ve=Ct(d),ce={assets:x.assetsPending,siteAccess:x.siteAccessPending},{activeTab:g,mainOpen:c}=We({panelTabId:Y,mainPanelParam:Te.mainpanel,routeDefaultMain:Z,metadata:u||d?{defaultMainView:u,tabs:r.map(jt)}:null}),Me=u||d?{defaultMainView:u,tabs:r.map(Rt)}:null,C=kt({hasSource:Pe==="repo"||k,runtime:he,cmsMode:Ve}),Se=C.includes("content"),Re=pe(Me),je=u?.type,le=at(je,te,ce,C,se),O=le?pe(null):Re,Ae=ot(g,te,ce),De=!C.includes("code")&&se&&me(g)!==null,o=!Y&&!Z&&le||g==="content"&&!Se||De||Ae?O:g,$=Xe(o);let V;e[15]!==l?(V=t=>l(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[15]=l,e[16]=V):V=e[16];const Ne=V,K=new Map;for(const t of I){const s=ue(t.appId,t.toolName);K.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Ce){if(t.toolName==="fetch_assets")continue;const s=ue(t.connectionId,t.toolName);K.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const B=_e(o),Q=B?B.key.split("/").pop()??B.key:null,Ue=Q?[{id:o,title:Q,kind:"file",icon:{kind:"component",Component:t=>G.createElement(be,{filename:Q,...t})}}]:[],M=qe(o),xe=M?[{id:o,title:(M.path.split("/").pop()??M.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>G.createElement(M.path.startsWith("pages/")?nt:st,t)}}]:[],W=ze(o),X=W?W.path.split("/").pop()??W.path:null,Ee=X?[{id:o,title:X,kind:"file",icon:{kind:"component",Component:t=>G.createElement(be,{filename:X,...t})}}]:[],Fe=It(o)?C.map(t=>({id:t==="code"&&me(o)?o:t,title:Ne(t),kind:"system",icon:J({tabId:t,kind:"system",connections:m})})):[];let S;e[17]!==m?(S=t=>({id:Ge(t.id),title:t.title,kind:"agent",icon:J({tabId:t.id,kind:"agent",appId:t.view.appId,connections:m})}),e[17]=m,e[18]=S):S=e[18];const He=[...Fe,...Ue,...xe,...Ee,...r.map(S),...Array.from(K.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:J({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:m})}))],de=new Set,_=He.filter(t=>de.has(t.id)?!1:(de.add(t.id),!0)),Le=a.virtualMcpId;let R;e[19]!==n.id?(R=fe(n.id),e[19]=n.id,e[20]=R):R=e[20];const q=Le===R;let j;e[21]!==o||e[22]!==N||e[23]!==c||e[24]!==q||e[25]!==f||e[26]!==n.id||e[27]!==k?(j=t=>{if(yt({reportsOnly:k,onReportAgent:q,tabId:t})){f(t,{virtualmcpid:fe(n.id),search:St});return}const s=Je({clickedId:t,activeTab:o,mainOpen:c});"close"in s?N():f(s.tabId)},e[21]=o,e[22]=N,e[23]=c,e[24]=q,e[25]=f,e[26]=n.id,e[27]=k,e[28]=j):j=e[28];const z=j;let A;return e[29]!==o||e[30]!==$||e[31]!==I||e[32]!==r||e[33]!==c||e[34]!==z||e[35]!==_?(A={activeTab:o,mainOpen:c,setActiveTab:z,layoutTabs:r,expandedTools:I,automationTabParsed:$,tabs:_},e[29]=o,e[30]=$,e[31]=I,e[32]=r,e[33]=c,e[34]=z,e[35]=_,e[36]=A):A=e[36],A}function St(a){return{...a,thread:void 0}}function Rt(a){return{id:a.id}}function jt(a){return{id:a.id}}function At(a){return!!dt(a._meta)}export{Mt as r,ta as u};
@@ -1 +1 @@
1
- import{c as b,b as k,Z as N,aJ as S,j as o,X as $,K as A,D as L}from"./index-C4wOv8VD.js";import{B as g}from"./badge-CbUAfbf9.js";import{b as T,T as v,a as I,c as _}from"./tooltip-CDv5NaPA.js";import{g as H}from"./types-CmkCLGEH.js";import{s as P}from"./Image01-BCqKNNl-.js";import{q as U,aT as w}from"./agent-icon-C8YMMRrt.js";import{i as O}from"./mcp-oauth-dpH7PMvU.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(T,{children:[o.jsx(v,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(T,{children:[o.jsx(v,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function J(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,J as u};
1
+ import{c as b,b as k,Z as N,aJ as S,j as o,X as $,K as A,D as L}from"./index-BAhcg2K-.js";import{B as g}from"./badge-BdUUSOSl.js";import{b as T,T as v,a as I,c as _}from"./tooltip-BtKdL9Sw.js";import{g as H}from"./types-D7c7j-nZ.js";import{s as P}from"./Image01-DAxDkgZe.js";import{q as U,aT as w}from"./agent-icon-M8hOOBGO.js";import{i as O}from"./mcp-oauth-BLd7mHPD.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(T,{children:[o.jsx(v,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(T,{children:[o.jsx(v,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function J(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,J as u};
@@ -1,4 +1,4 @@
1
- import{c1 as ue,c2 as de,c3 as he,c4 as fe,c5 as pe,c6 as _,c7 as g,c8 as me,c9 as _e,ca as we,cb as M,cc as ge,cd as D,ce as Te,cf as q,cg as ye,ch as L,ci as ke,cj as ve,ck as Se,cl as W,cm as Ce,cn as be,co as Re,cp as se,cq as Ie,cr as Ee,cs as qe,b3 as Pe,ct as $e,cu as Me,cv as A,cw as Ae,cx as He,cy as Oe,cz as Ue,cA as xe,cB as Ne,cC as je,cD as Fe,cE as De,cF as Le,cG as Ve,cH as ze,cI as Qe,aW as U,cJ as Je,cK as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-C4wOv8VD.js";import{U as P,b as H,c as K}from"./auth-02qGA-p0.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let it=class extends Ze{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?ze:Qe,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
1
+ import{c1 as ue,c2 as de,c3 as he,c4 as fe,c5 as pe,c6 as _,c7 as g,c8 as me,c9 as _e,ca as we,cb as M,cc as ge,cd as D,ce as Te,cf as q,cg as ye,ch as L,ci as ke,cj as ve,ck as Se,cl as W,cm as Ce,cn as be,co as Re,cp as se,cq as Ie,cr as Ee,cs as qe,b3 as Pe,ct as $e,cu as Me,cv as A,cw as Ae,cx as He,cy as Oe,cz as Ue,cA as xe,cB as Ne,cC as je,cD as Fe,cE as De,cF as Le,cG as Ve,cH as ze,cI as Qe,aW as U,cJ as Je,cK as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-BAhcg2K-.js";import{U as P,b as H,c as K}from"./auth-BSrtHG_U.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let it=class extends Ze{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?ze:Qe,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
2
2
  `)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const w=f(c);w!==""&&o.push(w)}function f(h){let c=0;if(h.indexOf("\r")===-1){let w=h.indexOf(`
3
3
  `,c);for(;w!==-1;){if(c===w){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=w+1,w=h.indexOf(`
4
4
  `,c);continue}const v=h.charCodeAt(c);if(ee(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,C=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===X){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
@@ -1 +1 @@
1
- import{c as l,m as u,c6 as m,c7 as f,D as y,K as n}from"./index-C4wOv8VD.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
1
+ import{c as l,m as u,c6 as m,c7 as f,D as y,K as n}from"./index-BAhcg2K-.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
@@ -1 +1 @@
1
- import{c as f,D as p,m as q,K as m}from"./index-C4wOv8VD.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
1
+ import{c as f,D as p,m as q,K as m}from"./index-BAhcg2K-.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
@@ -1 +1 @@
1
- import{c,X as m,D as b,m as M,K as f}from"./index-C4wOv8VD.js";import{u as y}from"./use-org-auth-client-D4VGJEAN.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
1
+ import{c,X as m,D as b,m as M,K as f}from"./index-BAhcg2K-.js";import{u as y}from"./use-org-auth-client-B5FQgswR.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-C4wOv8VD.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
1
+ import{r as s}from"./index-BAhcg2K-.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
@@ -1 +1 @@
1
- import{c as b,m as S,K as E,af as P,X as A,d as Q,o as G,a as H,Y as k,cZ as C,c_ as F,d4 as D}from"./index-C4wOv8VD.js";import{r as _,h as N,g as B,d as I,i as V,j as Y}from"./repository-binding-C1oHgnyD.js";import{i as X,u as Z,d as v,w as x}from"./thread-intent-CdOI6M-W.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=X(t.metadata?.runtime);return n===null||n===e}function j(t,e,n,a,s){let r=null;for(const o of t)o.virtual_mcp_id===e&&o.created_by===n&&(o.hidden||$(o,a)&&(s&&o.branch===s||(!r||o.updated_at>r.updated_at)&&(r=o)));return r}function fe(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&$(s,a))}function z(t,e,n,a,s,r){return s?j(t,e,n,a,r?.baseBranch)??void 0:j(t,e,n,a)??void 0}const J=6e4,O=3e4;function q(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function W(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function U(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:r}=t;return{queryKey:E.githubPrState(e,_(n),a,s,r),queryFn:()=>P(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&N(n)&&!!a&&!!s,refetchInterval:J,refetchIntervalInBackground:!1,staleTime:O}}function M(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],S(a)}function ee(t){return t.changeRequest?q(t.changeRequest):null}function he(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],S(a)}function te(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(W):[]}const ne=5*6e4;function ge(t){const e=b.c(20),{orgSlug:n,target:a,owner:s,repo:r,base:o}=t;let i;e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==r||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,r,o),e[0]=o,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n||e[8]!==a?(u=()=>P(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:o}),e[6]=o,e[7]=n,e[8]=a,e[9]=u):u=e[9];let c;e[10]!==t.enabled||e[11]!==o||e[12]!==s||e[13]!==r||e[14]!==a?(c=(t.enabled??!0)&&!!o&&N(a)&&!!s&&!!r,e[10]=t.enabled,e[11]=o,e[12]=s,e[13]=r,e[14]=a,e[15]=c):c=e[15];let h;return e[16]!==i||e[17]!==u||e[18]!==c?(h={queryKey:i,queryFn:u,enabled:c,staleTime:ne,select:ae},e[16]=i,e[17]=u,e[18]=c,e[19]=h):h=e[19],S(h)}function ae(t){return t.changeRequest?q(t.changeRequest):null}const se=50;function me(t){const e=b.c(17),{orgSlug:n,target:a,owner:s,repo:r}=t;let o;e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==a?(o=E.githubOpenPrs(n,_(a),s,r),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>P(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==r||e[11]!==a?(u=(t.enabled??!0)&&N(a)&&!!s&&!!r,e[8]=t.enabled,e[9]=s,e[10]=r,e[11]=a,e[12]=u):u=e[12];let c;return e[13]!==o||e[14]!==i||e[15]!==u?(c={queryKey:o,queryFn:i,enabled:u,staleTime:O,select:re},e[13]=o,e[14]=i,e[15]=u,e[16]=c):c=e[16],S(c)}function re(t){return t.changeRequests.map(q)}function oe(t,e){const{org:n}=A(),a=B(t);return M({orgId:n.id,orgSlug:n.slug,target:I(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ie=[];function be(){const t=b.c(14),e=Q(),{org:n,locator:a}=A(),s=G(),r=V(),{data:o}=H.useSession(),i=Z(),u=oe(void 0,null),c=k();let h;t[0]!==u||t[1]!==r||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==c||t[7]!==o?.user?.id?(h=(d,l,T)=>{if(c&&!l?.panel){e({to:"/$org/projects",params:{org:n.slug},search:y=>({...y,project:d,virtualmcpid:void 0,view:void 0})});return}const f=l?.panel??"overview";if(C(f).kind==="org-destination"){F(e,{tabId:f,org:n.slug,agentId:d,replace:!1});return}const m=(r??[]).find(y=>y.id===d),K=!!(m&&B(m)),w=!l?.runtime,L=w?void 0:z(i?.threads.get()??ie,d,o?.user?.id,T??(m?v(m.metadata):void 0),K,{baseBranch:u}),R=w?void 0:L?.id??crypto.randomUUID();R&&!L&&l?.runtime&&x(sessionStorage,a,R,{runtime:l.runtime}),F(e,{tabId:f,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=r,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=c,t[7]=o?.user?.id,t[8]=h):h=t[8];const g=h;let p;return t[9]!==r||t[10]!==g||t[11]!==n||t[12]!==s?(p=(d,l)=>{if(C(l?.panel??"overview").kind==="org-destination")return g(d,l,void 0);const T=r.find(f=>f.id===d);if(l?.runtime)return g(d,l,l.runtime);if(T)return g(d,l,v(T.metadata));Y(s,n).then(f=>f.find(m=>m.id===d)).catch(ue).then(f=>g(d,l,f?v(f.metadata):void 0))},t[9]=r,t[10]=g,t[11]=n,t[12]=s,t[13]=p):p=t[13],p}function ue(){}function pe(){const t=b.c(3),{org:e}=A(),n=k();let a;return t[0]!==e.slug||t[1]!==n?(a=(s,r)=>{if(n&&!r)return{to:"/$org/projects",params:{org:e.slug},search:i=>({...i,project:s,virtualmcpid:void 0,view:void 0})};const o=D({tabId:r??"overview",org:e.slug,agentId:s});return{to:o.to,params:o.params,search:o.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{pe as a,oe as b,z as c,me as d,M as e,fe as f,ge as g,he as h,U as p,be as u};
1
+ import{c as b,m as S,K as E,af as P,X as A,d as Q,o as G,a as H,Y as k,cZ as C,c_ as F,d4 as D}from"./index-BAhcg2K-.js";import{r as _,h as N,g as B,d as I,i as V,j as Y}from"./repository-binding-Dvarn2QQ.js";import{i as X,u as Z,d as v,w as x}from"./thread-intent-DVUhGxKs.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=X(t.metadata?.runtime);return n===null||n===e}function j(t,e,n,a,s){let r=null;for(const o of t)o.virtual_mcp_id===e&&o.created_by===n&&(o.hidden||$(o,a)&&(s&&o.branch===s||(!r||o.updated_at>r.updated_at)&&(r=o)));return r}function fe(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&$(s,a))}function z(t,e,n,a,s,r){return s?j(t,e,n,a,r?.baseBranch)??void 0:j(t,e,n,a)??void 0}const J=6e4,O=3e4;function q(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function W(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function U(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:r}=t;return{queryKey:E.githubPrState(e,_(n),a,s,r),queryFn:()=>P(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&N(n)&&!!a&&!!s,refetchInterval:J,refetchIntervalInBackground:!1,staleTime:O}}function M(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],S(a)}function ee(t){return t.changeRequest?q(t.changeRequest):null}function he(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],S(a)}function te(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(W):[]}const ne=5*6e4;function ge(t){const e=b.c(20),{orgSlug:n,target:a,owner:s,repo:r,base:o}=t;let i;e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==r||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,r,o),e[0]=o,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n||e[8]!==a?(u=()=>P(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:o}),e[6]=o,e[7]=n,e[8]=a,e[9]=u):u=e[9];let c;e[10]!==t.enabled||e[11]!==o||e[12]!==s||e[13]!==r||e[14]!==a?(c=(t.enabled??!0)&&!!o&&N(a)&&!!s&&!!r,e[10]=t.enabled,e[11]=o,e[12]=s,e[13]=r,e[14]=a,e[15]=c):c=e[15];let h;return e[16]!==i||e[17]!==u||e[18]!==c?(h={queryKey:i,queryFn:u,enabled:c,staleTime:ne,select:ae},e[16]=i,e[17]=u,e[18]=c,e[19]=h):h=e[19],S(h)}function ae(t){return t.changeRequest?q(t.changeRequest):null}const se=50;function me(t){const e=b.c(17),{orgSlug:n,target:a,owner:s,repo:r}=t;let o;e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==a?(o=E.githubOpenPrs(n,_(a),s,r),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>P(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==r||e[11]!==a?(u=(t.enabled??!0)&&N(a)&&!!s&&!!r,e[8]=t.enabled,e[9]=s,e[10]=r,e[11]=a,e[12]=u):u=e[12];let c;return e[13]!==o||e[14]!==i||e[15]!==u?(c={queryKey:o,queryFn:i,enabled:u,staleTime:O,select:re},e[13]=o,e[14]=i,e[15]=u,e[16]=c):c=e[16],S(c)}function re(t){return t.changeRequests.map(q)}function oe(t,e){const{org:n}=A(),a=B(t);return M({orgId:n.id,orgSlug:n.slug,target:I(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ie=[];function be(){const t=b.c(14),e=Q(),{org:n,locator:a}=A(),s=G(),r=V(),{data:o}=H.useSession(),i=Z(),u=oe(void 0,null),c=k();let h;t[0]!==u||t[1]!==r||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==c||t[7]!==o?.user?.id?(h=(d,l,T)=>{if(c&&!l?.panel){e({to:"/$org/projects",params:{org:n.slug},search:y=>({...y,project:d,virtualmcpid:void 0,view:void 0})});return}const f=l?.panel??"overview";if(C(f).kind==="org-destination"){F(e,{tabId:f,org:n.slug,agentId:d,replace:!1});return}const m=(r??[]).find(y=>y.id===d),K=!!(m&&B(m)),w=!l?.runtime,L=w?void 0:z(i?.threads.get()??ie,d,o?.user?.id,T??(m?v(m.metadata):void 0),K,{baseBranch:u}),R=w?void 0:L?.id??crypto.randomUUID();R&&!L&&l?.runtime&&x(sessionStorage,a,R,{runtime:l.runtime}),F(e,{tabId:f,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=r,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=c,t[7]=o?.user?.id,t[8]=h):h=t[8];const g=h;let p;return t[9]!==r||t[10]!==g||t[11]!==n||t[12]!==s?(p=(d,l)=>{if(C(l?.panel??"overview").kind==="org-destination")return g(d,l,void 0);const T=r.find(f=>f.id===d);if(l?.runtime)return g(d,l,l.runtime);if(T)return g(d,l,v(T.metadata));Y(s,n).then(f=>f.find(m=>m.id===d)).catch(ue).then(f=>g(d,l,f?v(f.metadata):void 0))},t[9]=r,t[10]=g,t[11]=n,t[12]=s,t[13]=p):p=t[13],p}function ue(){}function pe(){const t=b.c(3),{org:e}=A(),n=k();let a;return t[0]!==e.slug||t[1]!==n?(a=(s,r)=>{if(n&&!r)return{to:"/$org/projects",params:{org:e.slug},search:i=>({...i,project:s,virtualmcpid:void 0,view:void 0})};const o=D({tabId:r??"overview",org:e.slug,agentId:s});return{to:o.to,params:o.params,search:o.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{pe as a,oe as b,z as c,me as d,M as e,fe as f,ge as g,he as h,U as p,be as u};
@@ -0,0 +1 @@
1
+ import{a as o}from"./use-organization-settings-D4Byt2gj.js";function e(){return o("new_blocks_editor")}export{e as u};
@@ -1 +1 @@
1
- import{c as l,a2 as f,b as p,e as T,t as m}from"./index-C4wOv8VD.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
1
+ import{c as l,a2 as f,b as p,e as T,t as m}from"./index-BAhcg2K-.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
@@ -1 +1 @@
1
- import{c as x,X as j,a as i}from"./index-C4wOv8VD.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,X as j,a as i}from"./index-BAhcg2K-.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
@@ -1 +1 @@
1
- import{c as p,X as w,K as y,m as $,o as O,e as P}from"./index-C4wOv8VD.js";import{u as _}from"./useInfiniteQuery-CWQU9XP-.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Z(n,e,t){const s=p.c(16),{org:r}=w(),i=t?.enabled??!0;let a;s[0]!==r.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(r.id,n,e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==r.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===r.id&&u.queryKey[2]===n?f:void 0,s[4]=r.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==r.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(r.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=r.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==i||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:i,queryKey:a,placeholderData:o,queryFn:c},s[11]=i,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function E(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=p.c(16),{org:r}=w();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==r.slug||s[7]!==e||s[8]!==n?(l=()=>E(r.slug,n??"",e),s[6]=r.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:i,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=p.c(9),s=n===void 0?60:n,{org:r}=w();let i;t[0]!==r.id?(i=y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=p.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,initialPageParam:null,queryFn:r,getNextPageParam:C},e[6]=s,e[7]=r,e[8]=i):i=e[8],_(i)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=p.c(16),{org:s}=w();let r;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(r=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=r):r=t[4];const i=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==r||t[12]!==i||t[13]!==a||t[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},t[11]=r,t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=p.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function re(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}async function M(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ie(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const r=e?.enabled!==!1&&n!=="";let i;t[2]!==n?(i=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==s||t[5]!==r||t[6]!==i?(a={queryKey:s,enabled:r,staleTime:6e4,retry:!1,queryFn:i},t[4]=s,t[5]=r,t[6]=i,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,X=4;function V(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<X&&o.push({path:d.path,depth:u.depth+1});continue}V(d.path)&&d.size<=N&&i.length<D?i.push(d.path):a.push(r(d.path))}}const c=await Promise.all(i.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return i.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(r(u));return}f+=d.length,l.push({relPath:r(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}function le(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>F(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=p.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,r)=>F(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await h(F(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,r){const i={"content-type":"text/markdown; charset=utf-8"};r&&"absent"in r?i["if-none-match"]="*":r&&(i["if-match"]=`"${r.contentHash}"`);const a=await fetch(F(n,e,"file",{path:t}),{method:"PUT",headers:i,body:s});if(a.status===412)return{ok:!1,reason:"conflict"};if(a.status===403)return{ok:!1,reason:"forbidden"};if(!a.ok)throw new Error(`HTTP ${a.status}`);return{ok:!0,entry:(await a.json()).entry}}function de(n){const e=p.c(18),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==n?(r=async l=>(await(await h(F(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function W(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=p.c(33),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>W(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async S=>{const L=(await Promise.allSettled(S.files.map(T=>{const q=S.dir?`${S.dir}/${T.name}`:T.name;return h(F(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(Y);if(L)throw L.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(F(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==i||e[14]!==l?(f={mutationFn:l,onSuccess:i},e[13]=i,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(F(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==i||e[20]!==g?(d={mutationFn:g,onSuccess:i},e[19]=i,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==i||e[26]!==m?(I={mutationFn:m,onSuccess:i},e[25]=i,e[26]=m,e[27]=I):I=e[27];const k=P(I);let K;return e[28]!==u||e[29]!==k||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:k},e[28]=u,e[29]=k,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{Q as a,le as b,ue as c,de as d,G as e,ae as f,ie as g,ce as h,ge as i,Z as j,se as k,oe as l,te as m,ee as n,W as o,re as p,ne as q,E as r,M as s,v as u,fe as w};
1
+ import{c as p,X as w,K as y,m as $,o as O,e as P}from"./index-BAhcg2K-.js";import{u as _}from"./useInfiniteQuery-DXwFDh0j.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Z(n,e,t){const s=p.c(16),{org:r}=w(),i=t?.enabled??!0;let a;s[0]!==r.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(r.id,n,e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==r.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===r.id&&u.queryKey[2]===n?f:void 0,s[4]=r.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==r.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(r.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=r.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==i||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:i,queryKey:a,placeholderData:o,queryFn:c},s[11]=i,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function E(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=p.c(16),{org:r}=w();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==r.slug||s[7]!==e||s[8]!==n?(l=()=>E(r.slug,n??"",e),s[6]=r.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:i,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=p.c(9),s=n===void 0?60:n,{org:r}=w();let i;t[0]!==r.id?(i=y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=p.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,initialPageParam:null,queryFn:r,getNextPageParam:C},e[6]=s,e[7]=r,e[8]=i):i=e[8],_(i)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=p.c(16),{org:s}=w();let r;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(r=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=r):r=t[4];const i=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==r||t[12]!==i||t[13]!==a||t[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},t[11]=r,t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=p.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function re(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}async function M(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ie(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const r=e?.enabled!==!1&&n!=="";let i;t[2]!==n?(i=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==s||t[5]!==r||t[6]!==i?(a={queryKey:s,enabled:r,staleTime:6e4,retry:!1,queryFn:i},t[4]=s,t[5]=r,t[6]=i,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,X=4;function V(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<X&&o.push({path:d.path,depth:u.depth+1});continue}V(d.path)&&d.size<=N&&i.length<D?i.push(d.path):a.push(r(d.path))}}const c=await Promise.all(i.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return i.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(r(u));return}f+=d.length,l.push({relPath:r(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}function le(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>F(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=p.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,r)=>F(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await h(F(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,r){const i={"content-type":"text/markdown; charset=utf-8"};r&&"absent"in r?i["if-none-match"]="*":r&&(i["if-match"]=`"${r.contentHash}"`);const a=await fetch(F(n,e,"file",{path:t}),{method:"PUT",headers:i,body:s});if(a.status===412)return{ok:!1,reason:"conflict"};if(a.status===403)return{ok:!1,reason:"forbidden"};if(!a.ok)throw new Error(`HTTP ${a.status}`);return{ok:!0,entry:(await a.json()).entry}}function de(n){const e=p.c(18),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==n?(r=async l=>(await(await h(F(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function W(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=p.c(33),{org:t}=w(),s=O();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>W(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async S=>{const L=(await Promise.allSettled(S.files.map(T=>{const q=S.dir?`${S.dir}/${T.name}`:T.name;return h(F(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(Y);if(L)throw L.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(F(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==i||e[14]!==l?(f={mutationFn:l,onSuccess:i},e[13]=i,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(F(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==i||e[20]!==g?(d={mutationFn:g,onSuccess:i},e[19]=i,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==i||e[26]!==m?(I={mutationFn:m,onSuccess:i},e[25]=i,e[26]=m,e[27]=I):I=e[27];const k=P(I);let K;return e[28]!==u||e[29]!==k||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:k},e[28]=u,e[29]=k,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{Q as a,le as b,ue as c,de as d,G as e,ae as f,ie as g,ce as h,ge as i,Z as j,se as k,oe as l,te as m,ee as n,W as o,re as p,ne as q,E as r,M as s,v as u,fe as w};
@@ -1 +1 @@
1
- import{c as r,X as f,a2 as y,K as S,m as _,o as d,e as R}from"./index-C4wOv8VD.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{g as a,q as b,T as c,P as u};
1
+ import{c as r,X as f,a2 as y,K as S,m as _,o as d,e as R}from"./index-BAhcg2K-.js";const m=5e3;function p(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return p(e.state.data)?m:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{g as a,q as b,T as c,P as u};
@@ -1 +1 @@
1
- import{c as u,m as S,o as r,e as y,K as c}from"./index-C4wOv8VD.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
1
+ import{c as u,m as S,o as r,e as y,K as c}from"./index-BAhcg2K-.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-D4VGJEAN.js";import{X as b,m as P,K as y}from"./index-C4wOv8VD.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-B5FQgswR.js";import{X as b,m as P,K as y}from"./index-BAhcg2K-.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -1 +1 @@
1
- import{a as T,c as u,aT as A,X as E,m as M,af as $,K as b,a2 as O,o as C,e as I}from"./index-C4wOv8VD.js";import{D as z,o as D,a as P}from"./schema-CrhsNm55.js";import{r as R}from"./task-board-JGCJaP3X.js";const G={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},x={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function k(t,e){return{queryKey:b.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...G,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(6),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=k(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let a;return e[3]!==s||e[4]!==o?(a={...s,select:o},e[3]=s,e[4]=o,e[5]=a):a=e[5],M(a)}function _(){const t=u.c(9),{org:e}=E(),n=O(),s=C();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(b.organizationSettings(e.id),r=>({...r??G,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],I(i)}function L(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:x}function B(){const{data:t}=d(Q);return t??x}function Q(t){return L(t.simple_mode)}function V(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function W(){return c("reports_only")}function c(t){const e=u.c(5);let n;e[0]!==t?(n=a=>D(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??z.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function X(){const t=c("chat_harness_sandbox_only");return A().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=E(),n=O(),s=C();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(b.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],I(i)}function N(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const{data:t}=T.useSession();return N(t?.user?.email)}function tt(){const t=u.c(9),{data:e}=T.useSession(),n=A();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||N(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=c("hosting_enabled"),r=c("deco_analytics_enabled"),m=c("e2e_enabled"),w=c("monitor_enabled"),F=c("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||a||m,y=o||i||w,h=o||a||F;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==y||t[7]!==h?(f={hosting:g,analytics:S,e2e:p,monitor:y,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=y,t[7]=h,t[8]=f):f=t[8],f}function et(){const{data:t}=d(U);return t??!1}function U(t){return P(t.flags)}function nt(){const{data:t}=d(q);return t??!0}function q(t){return R(t.flags)}function st(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function ot(){const t=u.c(2),{data:e}=d(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function at(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function it(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.submodule_credentials}function lt(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{c as a,X as b,tt as c,B as d,nt as e,H as f,et as g,st as h,ot as i,at as j,V as k,it as l,lt as m,J as n,W as u};
1
+ import{a as T,c as u,aT as A,X as E,m as M,af as $,K as b,a2 as O,o as C,e as I}from"./index-BAhcg2K-.js";import{D as z,o as D,a as P}from"./schema-BWozGVyy.js";import{r as R}from"./task-board-ZQVJfgC6.js";const G={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},x={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function k(t,e){return{queryKey:b.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...G,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(6),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=k(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let a;return e[3]!==s||e[4]!==o?(a={...s,select:o},e[3]=s,e[4]=o,e[5]=a):a=e[5],M(a)}function _(){const t=u.c(9),{org:e}=E(),n=O(),s=C();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(b.organizationSettings(e.id),r=>({...r??G,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],I(i)}function L(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:x}function B(){const{data:t}=d(Q);return t??x}function Q(t){return L(t.simple_mode)}function V(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function W(){return c("reports_only")}function c(t){const e=u.c(5);let n;e[0]!==t?(n=a=>D(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??z.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function X(){const t=c("chat_harness_sandbox_only");return A().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=E(),n=O(),s=C();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(b.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],I(i)}function N(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const{data:t}=T.useSession();return N(t?.user?.email)}function tt(){const t=u.c(9),{data:e}=T.useSession(),n=A();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||N(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=c("hosting_enabled"),r=c("deco_analytics_enabled"),m=c("e2e_enabled"),w=c("monitor_enabled"),F=c("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||a||m,y=o||i||w,h=o||a||F;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==y||t[7]!==h?(f={hosting:g,analytics:S,e2e:p,monitor:y,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=y,t[7]=h,t[8]=f):f=t[8],f}function et(){const{data:t}=d(U);return t??!1}function U(t){return P(t.flags)}function nt(){const{data:t}=d(q);return t??!0}function q(t){return R(t.flags)}function st(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function ot(){const t=u.c(2),{data:e}=d(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function at(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function it(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.submodule_credentials}function lt(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{c as a,X as b,tt as c,B as d,nt as e,H as f,et as g,st as h,ot as i,at as j,V as k,it as l,lt as m,J as n,W as u};
@@ -1 +1 @@
1
- import{c as p,f as g,u as S,cY as _,d as k,k as b,cZ as P,c_ as E}from"./index-C4wOv8VD.js";import{b as I}from"./thread-route-B8tWsziC.js";import{a as R}from"./use-project-scope-B6u3BQm-.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],b(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(d,c)=>{const h=P(d),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:d,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=d=>t({to:".",search:z,replace:d?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let u;return e[8]!==f||e[9]!==m?(u={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=u):u=e[10],u}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
1
+ import{c as p,f as g,u as S,cY as _,d as k,k as b,cZ as P,c_ as E}from"./index-BAhcg2K-.js";import{b as I}from"./thread-route-CYefGjgy.js";import{a as R}from"./use-project-scope-G-Gyk-m5.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],b(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(d,c)=>{const h=P(d),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:d,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=d=>t({to:".",search:z,replace:d?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let u;return e[8]!==f||e[9]!==m?(u={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=u):u=e[10],u}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
@@ -1 +1 @@
1
- import{c as A,f as _,u as R,d as T,a9 as k,c$ as C,d0 as N,d1 as j,c_ as E,a6 as S}from"./index-C4wOv8VD.js";import{e as b,i as w,c as D,p as H}from"./repository-binding-C1oHgnyD.js";function F(t){if(typeof t!="object"||t===null)return!1;const s=t.repository?.url;return typeof s=="string"&&s.length>0}function J(t){return b(t).status==="attached"}function K(t){const e=b(t).status;return e==="attached"||e==="detached"}function O(t){const e=new Set;for(const s of t??[]){const n=s.metadata?.liveAgentId;typeof n=="string"&&n&&e.add(s.id)}return e}function L(t,e){if(!t)return null;const s=t.metadata?.liveAgentId;if(typeof s=="string"&&s)return(e??[]).find(a=>a.id===s)?{mode:"dev",targetId:s}:null;const n=(e??[]).find(o=>o.metadata?.liveAgentId===t.id);return n?{mode:"live",targetId:n.id}:null}const M=1;function y(t){const e=t??[],s=O(e);return e.filter(n=>!s.has(n.id)&&!C(n.id)&&!N(n.id)&&!j(n.id))}function V(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=_(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[1]=n):n=t[1];const o=R(n);if(s.agentId)return s.agentId;let a;return t[2]!==o?(a="virtualmcpid"in o&&typeof o.virtualmcpid=="string"?o.virtualmcpid.trim():void 0,t[2]=o,t[3]=a):a=t[3],a||null}function U(){const t=A.c(16),e=T();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=_(s),o=k(),a=w(),c=y(a),i=V(),P=c.find(r=>r.id===i)??null;let l;t[1]!==a||t[2]!==i?(l=i&&a.length>0&&!a.some(r=>r.id===i)?i:null,t[1]=a,t[2]=i,t[3]=l):l=t[3];const h=D(l),d=P??y(h?[h]:[])[0]??null;let u;t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i?(u=r=>{if(r===i&&o!==void 0)return;const v=n.org??"",I=$;if(r){E(e,{org:v,agentId:r,tabId:o==="board"||o==="reports"?o:"overview",search:I,replace:!1});return}if(o==="board"){e({to:S.tasks,params:{org:v,taskKey:void 0},search:I});return}e({to:S.home,params:{org:v},search:I})},t[4]=o,t[5]=e,t[6]=n,t[7]=i,t[8]=u):u=t[8];const m=u,p=H(d),g=c.length>=M;let f;return t[9]!==d||t[10]!==c||t[11]!==i||t[12]!==m||t[13]!==p||t[14]!==g?(f={scopeId:i,project:d,repo:p,projects:c,hasProjects:g,setScope:m},t[9]=d,t[10]=c,t[11]=i,t[12]=m,t[13]=p,t[14]=g,t[15]=f):f=t[15],f}function $(t){return{...t,virtualmcpid:void 0,thread:void 0,mainpanel:void 0}}export{V as a,F as b,K as c,J as d,L as f,O as g,y as s,U as u};
1
+ import{c as A,f as _,u as R,d as T,a9 as k,c$ as C,d0 as N,d1 as j,c_ as E,a6 as S}from"./index-BAhcg2K-.js";import{e as b,i as w,c as D,p as H}from"./repository-binding-Dvarn2QQ.js";function F(t){if(typeof t!="object"||t===null)return!1;const s=t.repository?.url;return typeof s=="string"&&s.length>0}function J(t){return b(t).status==="attached"}function K(t){const e=b(t).status;return e==="attached"||e==="detached"}function O(t){const e=new Set;for(const s of t??[]){const n=s.metadata?.liveAgentId;typeof n=="string"&&n&&e.add(s.id)}return e}function L(t,e){if(!t)return null;const s=t.metadata?.liveAgentId;if(typeof s=="string"&&s)return(e??[]).find(a=>a.id===s)?{mode:"dev",targetId:s}:null;const n=(e??[]).find(o=>o.metadata?.liveAgentId===t.id);return n?{mode:"live",targetId:n.id}:null}const M=1;function y(t){const e=t??[],s=O(e);return e.filter(n=>!s.has(n.id)&&!C(n.id)&&!N(n.id)&&!j(n.id))}function V(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=_(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[1]=n):n=t[1];const o=R(n);if(s.agentId)return s.agentId;let a;return t[2]!==o?(a="virtualmcpid"in o&&typeof o.virtualmcpid=="string"?o.virtualmcpid.trim():void 0,t[2]=o,t[3]=a):a=t[3],a||null}function U(){const t=A.c(16),e=T();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=_(s),o=k(),a=w(),c=y(a),i=V(),P=c.find(r=>r.id===i)??null;let l;t[1]!==a||t[2]!==i?(l=i&&a.length>0&&!a.some(r=>r.id===i)?i:null,t[1]=a,t[2]=i,t[3]=l):l=t[3];const h=D(l),d=P??y(h?[h]:[])[0]??null;let u;t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i?(u=r=>{if(r===i&&o!==void 0)return;const v=n.org??"",I=$;if(r){E(e,{org:v,agentId:r,tabId:o==="board"||o==="reports"?o:"overview",search:I,replace:!1});return}if(o==="board"){e({to:S.tasks,params:{org:v,taskKey:void 0},search:I});return}e({to:S.home,params:{org:v},search:I})},t[4]=o,t[5]=e,t[6]=n,t[7]=i,t[8]=u):u=t[8];const m=u,p=H(d),g=c.length>=M;let f;return t[9]!==d||t[10]!==c||t[11]!==i||t[12]!==m||t[13]!==p||t[14]!==g?(f={scopeId:i,project:d,repo:p,projects:c,hasProjects:g,setScope:m},t[9]=d,t[10]=c,t[11]=i,t[12]=m,t[13]=p,t[14]=g,t[15]=f):f=t[15],f}function $(t){return{...t,virtualmcpid:void 0,thread:void 0,mainpanel:void 0}}export{V as a,F as b,K as c,J as d,L as f,O as g,y as s,U as u};
@@ -1 +1 @@
1
- import{c as N,X as Q,o as k}from"./index-C4wOv8VD.js";import{a as E,f as P}from"./repository-binding-C1oHgnyD.js";import{r as z}from"./serial-task-queue-CGOeQgpr.js";function O(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function B(t){return t?.name||t?.email?.split("@")[0]||void 0}function F(t){const e=O(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function T(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function V(t,e){return t.filter(s=>s.branch!==e)}function _(t,e,s){return t.map(o=>o.branch===e?{...o,name:s}:o)}const S=["orange","violet","blue","pink","amber","teal"];function K(t){return S[t%S.length]}function W(t,e){const s=`${e} `,o=t.reduce((u,n)=>{if(!n.name.startsWith(s))return u;const l=Number(n.name.slice(s.length));return Number.isInteger(l)&&l>u?l:u},0);return`${e} ${o+1}`}const j={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function X(t){return t&&j[t]||"bg-muted-foreground"}function G(t){const e=N.c(26),s=E(t),o=P(),{org:u}=Q(),n=k();let l;e[0]!==s?.metadata?.releases?(l=s?.metadata?.releases??[],e[0]=s?.metadata?.releases,e[1]=l):l=e[1];const f=l;let b;e[2]!==u||e[3]!==t?(b=a=>a[1]===u.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"&&a[5]===t,e[2]=u,e[3]=t,e[4]=b):b=e[4];const m=b;let d;e[5]!==m||e[6]!==n||e[7]!==f?(d=()=>{for(const[,a]of n.getQueriesData({predicate:r=>m(r.queryKey)}))if(a?.item)return a.item.metadata?.releases??[];return f},e[5]=m,e[6]=n,e[7]=f,e[8]=d):d=e[8];const $=d;let p;e[9]!==o||e[10]!==m||e[11]!==n||e[12]!==$||e[13]!==t?(p=a=>z(`vm-releases:${t}`,async()=>{const r=$(),g=a(r);if(g!==r){n.setQueriesData({predicate:c=>m(c.queryKey)},c=>c?.item?{item:{...c.item,metadata:{...c.item.metadata,releases:g}}}:c);try{await o.update.mutateAsync({id:t,data:{metadata:{releases:g}}})}catch(c){const w=c;throw n.invalidateQueries({predicate:A=>m(A.queryKey)}),w}}}),e[9]=o,e[10]=m,e[11]=n,e[12]=$,e[13]=t,e[14]=p):p=e[14];const i=p;let R;e[15]!==i?(R=a=>i(r=>T(r,a)),e[15]=i,e[16]=R):R=e[16];const y=R;let h;e[17]!==i?(h=(a,r)=>i(g=>_(g,a,r)),e[17]=i,e[18]=h):h=e[18];const D=h;let C;e[19]!==i?(C=a=>i(r=>V(r,a)),e[19]=i,e[20]=C):C=e[20];const L=C;let x;return e[21]!==y||e[22]!==L||e[23]!==f||e[24]!==D?(x={releases:f,createRelease:y,renameRelease:D,deleteRelease:L},e[21]=y,e[22]=L,e[23]=f,e[24]=D,e[25]=x):x=e[25],x}export{W as a,B as b,F as g,K as n,X as r,G as u};
1
+ import{c as N,X as Q,o as k}from"./index-BAhcg2K-.js";import{a as E,f as P}from"./repository-binding-Dvarn2QQ.js";import{r as z}from"./serial-task-queue-CGOeQgpr.js";function O(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function B(t){return t?.name||t?.email?.split("@")[0]||void 0}function F(t){const e=O(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function T(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function V(t,e){return t.filter(s=>s.branch!==e)}function _(t,e,s){return t.map(o=>o.branch===e?{...o,name:s}:o)}const S=["orange","violet","blue","pink","amber","teal"];function K(t){return S[t%S.length]}function W(t,e){const s=`${e} `,o=t.reduce((u,n)=>{if(!n.name.startsWith(s))return u;const l=Number(n.name.slice(s.length));return Number.isInteger(l)&&l>u?l:u},0);return`${e} ${o+1}`}const j={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function X(t){return t&&j[t]||"bg-muted-foreground"}function G(t){const e=N.c(26),s=E(t),o=P(),{org:u}=Q(),n=k();let l;e[0]!==s?.metadata?.releases?(l=s?.metadata?.releases??[],e[0]=s?.metadata?.releases,e[1]=l):l=e[1];const f=l;let b;e[2]!==u||e[3]!==t?(b=a=>a[1]===u.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"&&a[5]===t,e[2]=u,e[3]=t,e[4]=b):b=e[4];const m=b;let d;e[5]!==m||e[6]!==n||e[7]!==f?(d=()=>{for(const[,a]of n.getQueriesData({predicate:r=>m(r.queryKey)}))if(a?.item)return a.item.metadata?.releases??[];return f},e[5]=m,e[6]=n,e[7]=f,e[8]=d):d=e[8];const $=d;let p;e[9]!==o||e[10]!==m||e[11]!==n||e[12]!==$||e[13]!==t?(p=a=>z(`vm-releases:${t}`,async()=>{const r=$(),g=a(r);if(g!==r){n.setQueriesData({predicate:c=>m(c.queryKey)},c=>c?.item?{item:{...c.item,metadata:{...c.item.metadata,releases:g}}}:c);try{await o.update.mutateAsync({id:t,data:{metadata:{releases:g}}})}catch(c){const w=c;throw n.invalidateQueries({predicate:A=>m(A.queryKey)}),w}}}),e[9]=o,e[10]=m,e[11]=n,e[12]=$,e[13]=t,e[14]=p):p=e[14];const i=p;let R;e[15]!==i?(R=a=>i(r=>T(r,a)),e[15]=i,e[16]=R):R=e[16];const y=R;let h;e[17]!==i?(h=(a,r)=>i(g=>_(g,a,r)),e[17]=i,e[18]=h):h=e[18];const D=h;let C;e[19]!==i?(C=a=>i(r=>V(r,a)),e[19]=i,e[20]=C):C=e[20];const L=C;let x;return e[21]!==y||e[22]!==L||e[23]!==f||e[24]!==D?(x={releases:f,createRelease:y,renameRelease:D,deleteRelease:L},e[21]=y,e[22]=L,e[23]=f,e[24]=D,e[25]=x):x=e[25],x}export{W as a,B as b,F as g,K as n,X as r,G as u};
@@ -1 +1 @@
1
- import{c as N,X as Q,W as F,z as A,m as f,K as T,e3 as L,J as K,C as D}from"./index-C4wOv8VD.js";import{m as O}from"./use-mcp-client-CeUgeePg.js";import{u as h}from"./companions-core-DzyeM-yJ.js";function M(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function U(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:T.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const R=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(R)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=T.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const R=await s.callTool({name:L,arguments:{}});return h(R).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=U({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const _=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==_||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:_},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=_,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&M(n.state.data)==="generating"?b:!1}function z(n,e){return{to:K.app,params:{org:n.slug,agentId:D(n.id),connectionId:e,toolName:L},search:{}}}export{M as d,z as r,j as u};
1
+ import{c as N,X as Q,W as F,z as A,m as f,K as T,e3 as L,J as K,C as D}from"./index-BAhcg2K-.js";import{m as O}from"./use-mcp-client-C80Rcg0W.js";import{u as h}from"./companions-core-DzyeM-yJ.js";function M(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function U(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:T.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const R=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(R)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=T.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const R=await s.callTool({name:L,arguments:{}});return h(R).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=U({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const _=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==_||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:_},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=_,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&M(n.state.data)==="generating"?b:!1}function z(n,e){return{to:K.app,params:{org:n.slug,agentId:D(n.id),connectionId:e,toolName:L},search:{}}}export{M as d,z as r,j as u};
@@ -1 +1 @@
1
- import{c as u,X as c,a2 as r,K as l,D as d,o as f,e as S}from"./index-C4wOv8VD.js";function C(){const e=u.c(7),{org:o}=c(),a=r();let i;e[0]!==o.id?(i=l.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=d(s);return n.secrets}function m(){const e=u.c(8),{org:o}=c(),a=r(),i=f();let t;e[0]!==a?(t=async y=>await a.call("SECRET_CREATE",{...y}),e[0]=a,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{m as a,C as u};
1
+ import{c as u,X as c,a2 as r,K as l,D as d,o as f,e as S}from"./index-BAhcg2K-.js";function C(){const e=u.c(7),{org:o}=c(),a=r();let i;e[0]!==o.id?(i=l.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=d(s);return n.secrets}function m(){const e=u.c(8),{org:o}=c(),a=r(),i=f();let t;e[0]!==a?(t=async y=>await a.call("SECRET_CREATE",{...y}),e[0]=a,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{m as a,C as u};