decocms 4.197.2 → 4.197.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 (225) hide show
  1. package/dist/client/assets/{AlertCircle-DpL6Tscn.js → AlertCircle-NmzMAVmw.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CoEemB4J.js → AreaChart-BYIjl3rJ.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BYRvhhFt.js → ArrowLeft-BqZUEXyW.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-C_q46EO5.js → ArrowUp-BCLzfiqW.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-CFDR0g1M.js → ArrowUpRight-D-fudPAG.js} +1 -1
  6. package/dist/client/assets/{Check-BChGvAW3.js → Check-BbUMdtEB.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BZAw7ZLj.js → CheckCircle-lND4am43.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-DfMtmSgR.js → ChevronDown-YEIbEaB9.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-PJs7Wj1v.js → ChevronRight-9kiQe2lI.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-Dr2YqthP.js → ChevronUp-FpLPjlDC.js} +1 -1
  11. package/dist/client/assets/{Copy01-pcUw8cKn.js → Copy01-PdeOevpD.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-CZAfbu8J.js → CpuChip01-BZKujEOv.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-Be_a0Hl3.js → CreditCard01-Bk-xZKkR.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-BuQlhNri.js → DotsVertical-C0mf2jrr.js} +1 -1
  15. package/dist/client/assets/{Eye-Cb8Ttsk7.js → Eye-DfD6NVFe.js} +1 -1
  16. package/dist/client/assets/{FilterLines-d91RyRXM.js → FilterLines-77Y_Gb6y.js} +1 -1
  17. package/dist/client/assets/{Globe01-B5iAXvY9.js → Globe01-fsAq-haQ.js} +1 -1
  18. package/dist/client/assets/{Globe04-CUj3yJ4H.js → Globe04-B0H6Y3Uk.js} +1 -1
  19. package/dist/client/assets/{HardDrive-C5Gg1Zd2.js → HardDrive-O4nUj4Zw.js} +1 -1
  20. package/dist/client/assets/{Key01-fVtj4fXs.js → Key01-Cq62OMyn.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-BL44UyAD.js → LayoutLeft-BZ_ZTxll.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-L9JYsRrc.js → LinkExternal01-Rkx-LjZW.js} +1 -1
  23. package/dist/client/assets/{LogOut01-BSEcdW7a.js → LogOut01-gn4PUPfe.js} +1 -1
  24. package/dist/client/assets/{Monitor01-0j7xzNTu.js → Monitor01-DF0X4J-5.js} +1 -1
  25. package/dist/client/assets/{Palette-DxEDEmZD.js → Palette-CnDXf6QD.js} +1 -1
  26. package/dist/client/assets/{Play-Ce3PIPIz.js → Play-C0pNXd5X.js} +1 -1
  27. package/dist/client/assets/{Plus-BshesZK9.js → Plus-hVnhGY-F.js} +1 -1
  28. package/dist/client/assets/{SearchLg-Bibw1E-2.js → SearchLg-DUdOPJQb.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DuGOSj9Q.js → SearchMd-4jvTAx2B.js} +1 -1
  30. package/dist/client/assets/{Settings02-BO8Tyy4j.js → Settings02-B5vCwAEe.js} +1 -1
  31. package/dist/client/assets/{Share07-B90wnNYq.js → Share07-BN2A5BrW.js} +1 -1
  32. package/dist/client/assets/{Shield01-BEvfydMk.js → Shield01-DXJGXMRv.js} +1 -1
  33. package/dist/client/assets/{Star01-Cb4QEb-Y.js → Star01-zppHselX.js} +1 -1
  34. package/dist/client/assets/{Stars01-BbZWvgRz.js → Stars01-CWJsS_RV.js} +1 -1
  35. package/dist/client/assets/{Stars02-DnEwCMW-.js → Stars02-CgqBxehC.js} +1 -1
  36. package/dist/client/assets/{Sun-DqJVcwP1.js → Sun-CPlC65Hb.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-BEcRH-iW.js → SwitchHorizontal01-PbA2uiCK.js} +1 -1
  38. package/dist/client/assets/{Tool01-BhAPypFm.js → Tool01-D9J2oKvi.js} +1 -1
  39. package/dist/client/assets/{Tool02-C1_VEvRQ.js → Tool02-DscIvHO8.js} +1 -1
  40. package/dist/client/assets/{Trash01-CqgwN4Ls.js → Trash01-Bsg8eBAz.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-CgrsvLX5.js → TrendUp01-D2lvo_zP.js} +1 -1
  42. package/dist/client/assets/{Upload01-CuT2JdpQ.js → Upload01-jDZe8JbX.js} +1 -1
  43. package/dist/client/assets/{User01-Bv6oogoE.js → User01-B4kEYeVJ.js} +1 -1
  44. package/dist/client/assets/{Users01-mJuxxn4S.js → Users01-DeYOhjN1.js} +1 -1
  45. package/dist/client/assets/{Users03-Y9NuGIXU.js → Users03-DDLMQhsJ.js} +1 -1
  46. package/dist/client/assets/{X-Da1aH-NS.js → X-B6DUdYtn.js} +1 -1
  47. package/dist/client/assets/{XCircle-Bn-kiykC.js → XCircle-BoTs_6EA.js} +1 -1
  48. package/dist/client/assets/{XClose-DLc2n8Qt.js → XClose-CrUkr1eN.js} +1 -1
  49. package/dist/client/assets/{Zap-BZPI5EwL.js → Zap-B90JGMkV.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-DjVa6YMe.js → ZapSquare-CQ4MGJc2.js} +1 -1
  51. package/dist/client/assets/{access-gate-CTmGk4ny.js → access-gate-DVICVaSr.js} +1 -1
  52. package/dist/client/assets/{agent-icon-BQVVDebW.js → agent-icon-rrdJQccN.js} +1 -1
  53. package/dist/client/assets/{agents-list-BtAmOQCg.js → agents-list-CVVvgAgq.js} +1 -1
  54. package/dist/client/assets/{ai-providers-DJEkLj9J.js → ai-providers-LSnRJVlw.js} +1 -1
  55. package/dist/client/assets/{alert-BVAzECwh.js → alert-BBviNjZY.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-COu8iXMQ.js → alert-dialog-Qc4zz2Z8.js} +1 -1
  57. package/dist/client/assets/{app-editor-BGcVa7eq.js → app-editor-CeMGYFVY.js} +1 -1
  58. package/dist/client/assets/{auth-B6pkXjQ7.js → auth-C7PFvTm5.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-DK_xsJXJ.js → auth-catchall-B_M0Frdg.js} +1 -1
  60. package/dist/client/assets/{auth-entry-Bhlelf2G.js → auth-entry-BzzzfVu6.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-CwgyRcqb.js → auth-split-layout-Nm9rRyUy.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-BpVUvoKT.js → authenticate-and-persist-oauth-CUxWEHdi.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-B5UmktTU.js → automation-list-row-qrwIBo6n.js} +1 -1
  64. package/dist/client/assets/{automation-runs-9N6MOCSR.js → automation-runs-LNOdIOCC.js} +1 -1
  65. package/dist/client/assets/{automations-DhiUYcZJ.js → automations-CWBrNo-2.js} +1 -1
  66. package/dist/client/assets/{avatar-BewHuBZX.js → avatar-BIsdsBfg.js} +1 -1
  67. package/dist/client/assets/{badge-D2xVGCkQ.js → badge-BaqFEabe.js} +1 -1
  68. package/dist/client/assets/{billing-CmQ4_F49.js → billing-iR0Qpm8u.js} +1 -1
  69. package/dist/client/assets/{block-document-5eKtIwrA.js → block-document-CJilFLE_.js} +1 -1
  70. package/dist/client/assets/{brand-context-CQOR1JRF.js → brand-context-DEFxmPjL.js} +1 -1
  71. package/dist/client/assets/{buckets-CbWh9tHL.js → buckets-DVdl44fu.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-vw_UiCK9.js → bulk-category-panel-DMBLomYn.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-ChNs0ivS.js → capability-load-error-DYLpe5fS.js} +1 -1
  74. package/dist/client/assets/{card-BSXmZFDc.js → card-CM5akYHG.js} +1 -1
  75. package/dist/client/assets/{cards-C_ZfN-TN.js → cards-BWDL4nGv.js} +1 -1
  76. package/dist/client/assets/{category-editor-BvO3r5Uv.js → category-editor-CtvGxP-l.js} +1 -1
  77. package/dist/client/assets/{chat-context-IT6-9MAd.js → chat-context-C_h408Ww.js} +1 -1
  78. package/dist/client/assets/{checkbox-BgjJh_IR.js → checkbox-Cs-HHM5S.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-C7XkmqSU.js → cli-auth-success-B8HSyMMz.js} +1 -1
  80. package/dist/client/assets/{collection-detail-BEWtP7VK.js → collection-detail-DXhdRjWR.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-7li8NxCF.js → collection-display-button-CUZ2_1xA.js} +1 -1
  82. package/dist/client/assets/{collection-search-Cs9k9yDL.js → collection-search-K3lEMJU7.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-DmrgVBtr.js → collection-table-wrapper-DNsVZLQE.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-CKgPXLEH.js → collection-tabs-xM4oM7Vs.js} +1 -1
  85. package/dist/client/assets/{command-5Lnlz65r.js → command-DUnvCxMJ.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-DB4wxRkI.js → commerce-onboarding-C_8EdxKm.js} +1 -1
  87. package/dist/client/assets/{connect-DLLr0eli.js → connect-DoJXU7Sy.js} +1 -1
  88. package/dist/client/assets/{connection-BeaSWl0G.js → connection-BSt_UeoK.js} +1 -1
  89. package/dist/client/assets/{connection-card-B4imN2NA.js → connection-card-gs2UtwYH.js} +1 -1
  90. package/dist/client/assets/{connection-detail-jZf8lrsJ.js → connection-detail-BGxlHhxK.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-BL4WThpd.js → connection-form-helpers-D_Pjxbna.js} +1 -1
  92. package/dist/client/assets/{connections-Daze9dwe.js → connections-Br2j8vr6.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-DzGiYipX.js → decopilot-sse-pool-D9Pqy2Fl.js} +1 -1
  94. package/dist/client/assets/{dialog-BJziDe4N.js → dialog-DxaaeVaW.js} +1 -1
  95. package/dist/client/assets/{domain-settings-CNlG2fTt.js → domain-settings-RwNQmaxT.js} +1 -1
  96. package/dist/client/assets/{drawer-CuRFEVgy.js → drawer-Crvh4X-Y.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-B0uYlxff.js → dropdown-menu-RvBTITp-.js} +1 -1
  98. package/dist/client/assets/{empty-state-uZ77Jd0v.js → empty-state-DEUcFsmC.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-CTTtSTKN.js → extract-connection-data-S1oM80Ui.js} +1 -1
  100. package/dist/client/assets/{file-explorer-B1hKgrle.js → file-explorer-BciDFjBB.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-DRHukJhb.js → file-type-icon-9XYnFs3i.js} +1 -1
  102. package/dist/client/assets/{form-BLZEj5M6.js → form-DTJo1d1H.js} +1 -1
  103. package/dist/client/assets/{general-C9-Gh9Un.js → general-Bf93sGPR.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-DDtjb7BS.js → github-repo-picker-CXlStJdI.js} +1 -1
  105. package/dist/client/assets/{hooks-8AOqxrL3.js → hooks-DSfiEzV1.js} +1 -1
  106. package/dist/client/assets/{index-BXi8XGVO.js → index-9A9eMIPG.js} +5 -5
  107. package/dist/client/assets/{index-D-mYizx7.js → index-BEgZFoIS.js} +1 -1
  108. package/dist/client/assets/{index-COtjVgHq.js → index-BKEqC31Z.js} +1 -1
  109. package/dist/client/assets/{index-BrfCenfw.js → index-BTJaLrMk.js} +1 -1
  110. package/dist/client/assets/{index-CFP6oHuE.js → index-Bj5hhYPs.js} +1 -1
  111. package/dist/client/assets/{index-a0gG7b2j.js → index-BtcO4zl9.js} +1 -1
  112. package/dist/client/assets/{index-BbwXrbtX.js → index-DZ8xGwLm.js} +1 -1
  113. package/dist/client/assets/{index-iB09S4ZI.js → index-DjImUJDm.js} +24 -24
  114. package/dist/client/assets/{index-BBVhZ0nf.js → index-QHL1p3mq.js} +1 -1
  115. package/dist/client/assets/{index-BJ_5870q.js → index-q1EqeeiP.js} +1 -1
  116. package/dist/client/assets/{index-redirect-BF972uE7.js → index-redirect-Bks4SJMt.js} +1 -1
  117. package/dist/client/assets/{input-DuPzhhSH.js → input-CV7dIBST.js} +1 -1
  118. package/dist/client/assets/{integration-icon-oWKr_bxS.js → integration-icon-ZFpGJDaw.js} +1 -1
  119. package/dist/client/assets/{invite-member-dialog-CtMeBe4Q.js → invite-member-dialog-CVPAbQsL.js} +1 -1
  120. package/dist/client/assets/{label-BEZ9ozrm.js → label-Cnu4EpS3.js} +1 -1
  121. package/dist/client/assets/{layout-Dob62ohh.js → layout-BzcHaHp3.js} +1 -1
  122. package/dist/client/assets/{login-Cps8QMpx.js → login-CUjCa53F.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-DznHTp7Q.js → mcp-oauth-DBDKHwqh.js} +1 -1
  124. package/dist/client/assets/{members-CAYkzsAC.js → members-DGYu-lnf.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-Dtn0c3c0.js → monaco-editor-BNxhoyLv.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-C1iTJegD.js → monitoring-stats-row-4XZUJ0h4.js} +1 -1
  127. package/dist/client/assets/{multi-select-CReOgu2V.js → multi-select-DYfViK-H.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-CfZVz1X4.js → oauth-callback-DvuCS9gx.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-B1dx_9ZA.js → oauth-callback-ai-provider-o2E_L7gO.js} +1 -1
  130. package/dist/client/assets/{onboarding-DknY2NdT.js → onboarding-CdYaPyDm.js} +1 -1
  131. package/dist/client/assets/{org-layout-KBNyDeMT.js → org-layout-B4XLNJ44.js} +1 -1
  132. package/dist/client/assets/{organization-choice-ybvzTqcR.js → organization-choice-DB4SE33o.js} +1 -1
  133. package/dist/client/assets/{orgs-COLTkKC_.js → orgs-C5kTAC3i.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-1U1qn7k0.js → page-seo-form-ByzIv7Xf.js} +1 -1
  135. package/dist/client/assets/{popover-CIeMy6Tl.js → popover-BUkmTztD.js} +1 -1
  136. package/dist/client/assets/{post-editor-CkHk9dRs.js → post-editor-CeZtdlkU.js} +1 -1
  137. package/dist/client/assets/{primitives-DGQ7OHkr.js → primitives-DMyHwQnc.js} +1 -1
  138. package/dist/client/assets/{profile-BRNaLNV6.js → profile-CRQfWAuq.js} +1 -1
  139. package/dist/client/assets/{project-app-view-C5RyuF-3.js → project-app-view-CzFjbHfi.js} +1 -1
  140. package/dist/client/assets/record-editor-efUDvpNx.js +1 -0
  141. package/dist/client/assets/{redirect-editor-8_yPdNmf.js → redirect-editor-sr-hqzhn.js} +1 -1
  142. package/dist/client/assets/registry-BF43gjsG.js +2 -0
  143. package/dist/client/assets/{registry-layout-C7e1ipww.js → registry-layout-Cq_VEsC7.js} +1 -1
  144. package/dist/client/assets/{reports-DCysDfGk.js → reports-DVU4FZBp.js} +1 -1
  145. package/dist/client/assets/{require-capability-Bmfc_FY6.js → require-capability-CwYRgphU.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-Km00f7IG.js → required-auth-layout-Bj3pqIWj.js} +1 -1
  147. package/dist/client/assets/{reset-password-D4fQnma9.js → reset-password-B-2GF1bi.js} +1 -1
  148. package/dist/client/assets/{roles-BqFKhya9.js → roles-CDgCG57q.js} +1 -1
  149. package/dist/client/assets/{search-input-DCThR-Dd.js → search-input-DYD8oTKQ.js} +1 -1
  150. package/dist/client/assets/{secrets-BRNaisMH.js → secrets-DPQAtetn.js} +1 -1
  151. package/dist/client/assets/sections-editor-BUWGlbBj.js +2 -0
  152. package/dist/client/assets/{select-C2aLiaQD.js → select-CRyQr4Bi.js} +1 -1
  153. package/dist/client/assets/{select-model-DnRANcdl.js → select-model-sEJXJ6Gh.js} +1 -1
  154. package/dist/client/assets/{self-tool-result-BWr3V3Nr.js → self-tool-result-VNMlGhqz.js} +1 -1
  155. package/dist/client/assets/{seo-editor-DcJ6zdOl.js → seo-editor-Dpq-M7Hw.js} +1 -1
  156. package/dist/client/assets/{settings-layout-BaMialle.js → settings-layout-B2nIXCpF.js} +1 -1
  157. package/dist/client/assets/{settings-section-CSObNV42.js → settings-section-kT-Vq-X_.js} +1 -1
  158. package/dist/client/assets/{shell-controls-smJY73O8.js → shell-controls-j2gFECu2.js} +1 -1
  159. package/dist/client/assets/{shell-layout-uIkLH9Oh.js → shell-layout-zs-DlKJl.js} +1 -1
  160. package/dist/client/assets/{sidebar-Bo-R194o.js → sidebar-BN3tYOOR.js} +1 -1
  161. package/dist/client/assets/{skeleton-BwgcAM0S.js → skeleton-BPiULN8t.js} +1 -1
  162. package/dist/client/assets/{spinner-DEPr-FcG.js → spinner-D9ZfyuOI.js} +1 -1
  163. package/dist/client/assets/{sso-CoqOt_Zo.js → sso-Cq8NWYnm.js} +1 -1
  164. package/dist/client/assets/{store-w2v-rh3j.js → store-BzFx41PG.js} +1 -1
  165. package/dist/client/assets/store-registry-B4Tc43a_.js +2 -0
  166. package/dist/client/assets/{studio-tools-CIwEdQH6.js → studio-tools-BNxc8tj7.js} +1 -1
  167. package/dist/client/assets/{switch-BPqfZ-jC.js → switch-BQlFrW26.js} +1 -1
  168. package/dist/client/assets/{synced-repos-ZOIM6muH.js → synced-repos-D7AUfeav.js} +1 -1
  169. package/dist/client/assets/{tab-id-DepDDA9_.js → tab-id-CToDOy87.js} +1 -1
  170. package/dist/client/assets/{table-K5tRinKE.js → table-B-vhdRxV.js} +1 -1
  171. package/dist/client/assets/{tabs-BI2WYCWM.js → tabs-ZwxS9voP.js} +1 -1
  172. package/dist/client/assets/{textarea-D00WtAVC.js → textarea-0VMzjCIH.js} +1 -1
  173. package/dist/client/assets/{toggle-group-BQuU-V-J.js → toggle-group-GZ83mK8H.js} +1 -1
  174. package/dist/client/assets/{toolbar-2JK6-CKe.js → toolbar-ChM83MHl.js} +1 -1
  175. package/dist/client/assets/{tooltip-dxFFf5TO.js → tooltip-DDHv7YBT.js} +1 -1
  176. package/dist/client/assets/{use-ai-providers-pOnoTtq9.js → use-ai-providers-Cmy5m9BE.js} +1 -1
  177. package/dist/client/assets/{use-automations-BhU30_ns.js → use-automations-DSiziGjM.js} +1 -1
  178. package/dist/client/assets/{use-autosave-DVVHS6oi.js → use-autosave-CC9da1mt.js} +1 -1
  179. package/dist/client/assets/{use-capability-DtqmBc0p.js → use-capability-B70fP-uk.js} +1 -1
  180. package/dist/client/assets/{use-clock-tick-B7KDRjlj.js → use-clock-tick-BF_YS7rZ.js} +1 -1
  181. package/dist/client/assets/{use-connection-1XceIaVt.js → use-connection-Cv7J3nQV.js} +1 -1
  182. package/dist/client/assets/{use-copy-D6dj3bWn.js → use-copy-1XKrNDn3.js} +1 -1
  183. package/dist/client/assets/{use-create-virtual-mcp-CzcLHs5g.js → use-create-virtual-mcp-DYcDcbrT.js} +1 -1
  184. package/dist/client/assets/{use-debounced-autosave-DlgUqdX2.js → use-debounced-autosave-DV0Zu4T5.js} +1 -1
  185. package/dist/client/assets/{use-debounced-value-sAF9FOgW.js → use-debounced-value-CqN3VgOq.js} +1 -1
  186. package/dist/client/assets/{use-deco-credits-D-5thmbQ.js → use-deco-credits-BSkPgBRZ.js} +1 -1
  187. package/dist/client/assets/{use-decopilot-events-CL16kVza.js → use-decopilot-events-DDG-UPLr.js} +1 -1
  188. package/dist/client/assets/{use-delete-connection-BAO101Zg.js → use-delete-connection-CB2zp0UH.js} +1 -1
  189. package/dist/client/assets/{use-deployment-admin-QIdZGKie.js → use-deployment-admin-Ctzgip_0.js} +1 -1
  190. package/dist/client/assets/{use-file-configs-CCGLmbGB.js → use-file-configs-Da8of_iX.js} +1 -1
  191. package/dist/client/assets/{use-infinite-scroll-0GwuWQ18.js → use-infinite-scroll-DwOI82m8.js} +1 -1
  192. package/dist/client/assets/{use-join-requests-bV_612yf.js → use-join-requests-DmauPIK2.js} +1 -1
  193. package/dist/client/assets/{use-mcp-client-XuHEw0sL.js → use-mcp-client-Qf3XY9OZ.js} +1 -1
  194. package/dist/client/assets/{use-mcp-tools-DMU5G4E6.js → use-mcp-tools-COTN4Z-p.js} +1 -1
  195. package/dist/client/assets/{use-members-B17dnJUi.js → use-members-BRjfo-wQ.js} +1 -1
  196. package/dist/client/assets/{use-mobile-CLmBmZlL.js → use-mobile-yusI84yr.js} +1 -1
  197. package/dist/client/assets/{use-navigate-to-agent-CesLlenP.js → use-navigate-to-agent-VUgYmVoK.js} +1 -1
  198. package/dist/client/assets/{use-open-billing-url-CqXZzDqc.js → use-open-billing-url-C5gQmJFw.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-DK9eV4Q0.js → use-org-auth-client-Dzta_o-v.js} +1 -1
  200. package/dist/client/assets/{use-org-sso-BXikBwjB.js → use-org-sso-fgbvUmJ5.js} +1 -1
  201. package/dist/client/assets/{use-organization-roles-B2laqgqT.js → use-organization-roles-BZGiirNU.js} +1 -1
  202. package/dist/client/assets/{use-organization-settings-DYNBSfY0.js → use-organization-settings-ONWmb3c4.js} +1 -1
  203. package/dist/client/assets/{use-registry-connections-dmTn3QTb.js → use-registry-connections-BcIrFS3a.js} +1 -1
  204. package/dist/client/assets/{use-secrets-hMAD_KTZ.js → use-secrets-M1IUHhPg.js} +1 -1
  205. package/dist/client/assets/{use-section-preview-base-PhK7SdcU.js → use-section-preview-base-Df-cVhqN.js} +1 -1
  206. package/dist/client/assets/{use-status-sounds-DwKPBF6E.js → use-status-sounds-DlCodNQH.js} +1 -1
  207. package/dist/client/assets/{use-tags-L_TWFhNu.js → use-tags-CrJi53YY.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-DqkubEXN.js → use-view-mode-BBSZ7d_G.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-DF86UjN0.js → use-virtual-mcp-Cl0SjVCh.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-ByPwT01F.js +1 -0
  211. package/dist/client/assets/{useRouterState-D2ZtXguJ.js → useRouterState-uHirJO7Y.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-CF3hhGhm.js +1 -0
  213. package/dist/client/assets/{users-CvU9p_s9.js → users-CZLtaBwI.js} +1 -1
  214. package/dist/client/assets/{variant-calendar-_7CExyc2.js → variant-calendar-BtdRJ2T6.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-CpJaPhlH.js → view-mode-toggle-CrD48-Do.js} +1 -1
  216. package/dist/client/index.html +1 -1
  217. package/dist/server/cli.js +2 -2
  218. package/dist/server/server.js +2 -2
  219. package/package.json +1 -1
  220. package/dist/client/assets/record-editor-COdvBBun.js +0 -1
  221. package/dist/client/assets/registry-rkWiCYrV.js +0 -2
  222. package/dist/client/assets/sections-editor-DW1awDYx.js +0 -2
  223. package/dist/client/assets/store-registry-DqEl1DEk.js +0 -2
  224. package/dist/client/assets/useInfiniteQuery-CaMxVBWb.js +0 -1
  225. package/dist/client/assets/useSuspenseInfiniteQuery-CGDHD714.js +0 -1
@@ -1332,7 +1332,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var Cc1=O(()=>{kx()});f
1332
1332
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await Xb`
1333
1333
  DELETE FROM kysely_migration WHERE name = ${X}
1334
1334
  `.execute($)}}async function pi1($){await zc6($),await jc6($);let Z=new ii1({db:$,provider:{getMigrations:()=>Promise.resolve(hl0)}}),{error:X,results:Q}=await Z.migrateToLatest(),Y=0;if(Q?.forEach((G)=>{if(G.status==="Success")Y++;else if(G.status==="Error")console.error(`Failed to execute migration "${G.migrationName}"`)}),X)throw console.error("Failed to migrate"),console.error(X),X;return Y}async function Pc6($){let{keepOpen:Z=!1,database:X,skipBetterAuth:Q=!1}=$??{},Y="skipped";if(!Q&&!X)Y=await Fh0();let G=X??U6(),J=async()=>{if(!Z&&!X)await Bw(G).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await pi1(G.db);return await J(),{betterAuth:Y,kysely:K}}catch(K){throw await J(),K}}async function Ac6(){let $=U6(),Z=new ii1({db:$.db,provider:{getMigrations:()=>Promise.resolve(hl0)}}),{error:X,results:Q}=await Z.migrateDown();if(Q?.forEach((Y)=>{if(Y.status==="Success")console.log(`\u2705 Migration "${Y.migrationName}" rolled back successfully`);else if(Y.status==="Error")console.error(`\u274C Failed to rollback migration "${Y.migrationName}"`)}),X)throw console.error("Failed to rollback migration"),console.error(X),X}var oi1=O(()=>{mi1();wh0();o7()});async function i50($){let Z={...process.env},X=h00($,Z);console.log(NF1(X.settings.encryptionKey));let Q=X.settings.betterAuthSecret||(X.settings.localMode?Wd1(X.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (X50(),Z50)),{outputs:G,services:J}=await Y({home:X.settings.dataDir,externalDatabaseUrl:X.externalDatabaseUrl,externalNatsUrl:X.externalNatsUrl});if(!X.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (wh0(),Ud1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (o7(),ql1)),{migrateToLatest:U}=await Promise.resolve().then(() => (oi1(),ti1)),N=H(G.databaseUrl);await U({keepOpen:!0,database:N,skipBetterAuth:!0})}let K={...X.settings,betterAuthSecret:Q,databaseUrl:G.databaseUrl,natsUrls:G.natsUrls,...G.s3?{s3Endpoint:G.s3.endpoint,s3Bucket:G.s3.bucket,s3AccessKeyId:G.s3.accessKeyId,s3SecretAccessKey:G.s3.secretAccessKey,s3ForcePathStyle:G.s3.forcePathStyle}:{},...G.natsTunnel?{natsPublicUrl:G.natsTunnel.publicUrl,natsAccountJwt:G.natsTunnel.accountJwt,natsAccountSigningKey:G.natsTunnel.accountSigningKey,natsOperatorJwt:G.natsTunnel.operatorJwt,natsTunnelPublicEnabled:!0,natsCredsPath:G.natsTunnel.credsPath}:{}};return _c1(K),{settings:K,services:J.map((W)=>({name:W.name==="PostgreSQL"?"Postgres":W.name,port:W.port})),managedServiceNames:J.filter((W)=>W.owner==="managed").map((W)=>W.name)}}var ul0=O(()=>{kx();Hd1();b8()});var si1={};w0(si1,{updateService:()=>pD,subscribeCliState:()=>dl0,setTuiConsoleIntercepted:()=>n50,setServerUrl:()=>km,setMigrationsDone:()=>Mm,setDevMode:()=>Ic6,resetCliStateForTests:()=>Tc6,isTuiConsoleIntercepted:()=>p50,getCliState:()=>ll0,addLogEntry:()=>zw});function ri1(){return{services:[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}],migrationsStatus:"pending",serverUrl:null,logs:[]}}function Tc6(){SQ=ri1()}function Rc6(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function qm(){for(let $ of cl0)$()}function ll0(){return SQ}function dl0($){return cl0.add($),()=>cl0.delete($)}function pD($){SQ={...SQ,services:SQ.services.map((Z)=>Z.name===$.name?$:Z)},qm()}function Mm(){SQ={...SQ,migrationsStatus:"done"},qm()}function km($){SQ={...SQ,serverUrl:$},qm()}function zw($){let Z=[...SQ.logs,$];SQ={...SQ,logs:Z.length>500?Z.slice(-500):Z},qm()}function Ic6(){SQ={...SQ,services:[...Rc6(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},qm()}function n50($){ai1=$}function p50(){return ai1}var SQ,cl0,ai1=!1;var tD=O(()=>{SQ=ri1();cl0=new Set});import{createServer as ei1}from"net";function qc6($){return new Promise((Z)=>{let X=ei1();X.once("error",()=>Z(!1)),X.listen($,"0.0.0.0",()=>{X.close(()=>Z(!0))})})}async function Vm($){if(await qc6($))return $;let Z=await new Promise((X,Q)=>{let Y=ei1();Y.once("error",Q),Y.listen(0,"0.0.0.0",()=>{let G=Y.address(),J=typeof G==="object"&&G?G.port:0;Y.close(()=>X(J))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var ml0=()=>{};function Sm($){return $.replace(/\x1b\[[0-9;]*m/g,"")}var il0={};w0(il0,{startDevServer:()=>kc6});import{join as Mc6}from"path";function $n1($){let Z=$.getReader(),X=new TextDecoder,Q="";function Y(){let G=Q.split(`
1335
- `);Q=G.pop()??"";for(let J of G){let K=Sm(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;zw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{for(;;){let{done:G,value:J}=await Z.read();if(G)break;Q+=X.decode(J,{stream:!0}),Y()}if(Q.trim()){let G=Sm(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)zw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function kc6($){let{baseUrl:Z,noTui:X}=$,Q=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=Q?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=Q?await Vm(Number(Y)+1):await Vm(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await i50({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)pD({name:L.name,status:"ready",port:L.port});Mm();let U=Mc6(import.meta.dir,"..","..","..","..",".."),N=X===!0,F=Bun.spawn(["bun","run","dev:servers"],{cwd:U,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:G,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsPublicUrl&&K.natsAccountJwt&&K.natsAccountSigningKey?{NATS_PUBLIC_URL:K.natsPublicUrl,NATS_ACCOUNT_JWT:K.natsAccountJwt,NATS_ACCOUNT_SIGNING_KEY:K.natsAccountSigningKey,NATS_OPERATOR_JWT:K.natsOperatorJwt??"",NATS_TUNNEL_PUBLIC_ENABLED:"true",...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)$n1(F.stdout),$n1(F.stderr);km(G),pD({name:"Vite",status:"ready",port:Number(Y)}),pD({name:"API",status:"ready",port:Number(K.port)});let B=async(L)=>{if(F.kill(L),await F.exited,H.length>0){let{stopServices:D}=await Promise.resolve().then(() => (X50(),Z50));await D(K.dataDir)}};return process.on("SIGINT",()=>B("SIGINT")),process.on("SIGTERM",()=>B("SIGTERM")),{port:Number(Y),process:F}}var nl0=O(()=>{ul0();tD();ml0()});var t50;var pl0=O(()=>{t50={name:"decocms",version:"4.197.2",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as Sc6,Text as Zn1}from"ink";import{jsx as Cc6,jsxs as Xn1}from"react/jsx-runtime";function Qn1({version:$}){return Xn1(Sc6,{flexDirection:"column",marginTop:1,children:[T50.map((Z,X)=>Cc6(Zn1,{color:R50[X],children:Z},X)),Xn1(Zn1,{dimColor:!0,children:[" v",$]})]})}var Yn1=O(()=>{Om()});import{Box as oD,Text as jw}from"ink";import{Spinner as _c6}from"@inkjs/ui";import{jsx as hY,jsxs as Qb}from"react/jsx-runtime";function Gn1({status:$}){if($==="pending")return hY(_c6,{label:""});return hY(jw,{color:"green",children:"\u2713"})}function vc6($){return`${$.name}: ${$.port||"...."}`}function Jn1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return Qb(oD,{flexDirection:"column",paddingBottom:1,children:[hY(Qn1,{version:t50.version}),hY(oD,{marginBottom:1,children:hY(jw,{dimColor:!0,children:"\u2500".repeat(80)})}),hY(oD,{children:Qb(jw,{dimColor:!0,children:["Home: ",X]})}),Qb(oD,{gap:2,children:[$.map((Y)=>Qb(oD,{gap:1,children:[hY(jw,{children:vc6(Y)}),hY(Gn1,{status:Y.status})]},Y.name)),Qb(oD,{gap:1,children:[hY(jw,{children:"Migrations"}),hY(Gn1,{status:Z})]})]}),hY(oD,{children:Q?Qb(jw,{children:["Open in browser: ",hY(jw,{color:"cyan",children:Q})]}):hY(jw,{dimColor:!0,children:"Starting..."})})]})}var Kn1=O(()=>{pl0();Yn1()});import{Box as xc6,Text as Cm}from"ink";import{jsx as tl0,jsxs as ol0}from"react/jsx-runtime";function fc6($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function Wn1({logs:$}){return tl0(xc6,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return tl0(Cm,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return ol0(Cm,{children:[ol0(Cm,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),tl0(Cm,{color:fc6(Z.status),children:Z.status}),ol0(Cm,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var Hn1=()=>{};var rl0={};w0(rl0,{App:()=>gc6});import{Box as bc6}from"ink";import{useSyncExternalStore as yc6}from"react";import{jsx as Un1,jsxs as hc6}from"react/jsx-runtime";function gc6({home:$}){let Z=yc6(dl0,ll0);return hc6(bc6,{flexDirection:"column",children:[Un1(Jn1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Un1(Wn1,{logs:Z.logs})]})}var al0=O(()=>{Kn1();Hn1();tD()});var NJ="thread-gate",_U="decopilot-hosted-harness",nG="automations",Pw="background-tools";var Nn1="7";function Fn1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Nn1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var wn1=()=>{};function uc6(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function sl0($,Z){for(let X=0;X<$.length;X++){let Q=$[X];if(Q===void 0)continue;if(Q===Z)return $[X+1];if(Q.startsWith(`${Z}=`))return Q.slice(Z.length+1)}return}function Bn1(){let $=uc6();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:sl0($,"--cpu-prof-dir")??process.cwd(),name:sl0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(sl0($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function On1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=dD();if(!X)return;let Q={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);Q={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:X.rss,heapUsed:X.heapUsed,heapTotal:X.heapTotal,external:X.external,arrayBuffers:X.arrayBuffers,...Q}))};return Z().catch(()=>{}),o50=setInterval(()=>void Z().catch(()=>{}),$),o50.unref?.(),process.on("SIGUSR2",()=>{try{let X=Bun.generateHeapSnapshot("v8"),Q=typeof X==="string"?X:JSON.stringify(X),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,Q),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(X){console.error("[heap-watch] snapshot failed:",X)}}),()=>{if(o50)clearInterval(o50)}}var o50;var Ln1=()=>{};import*as cc6 from"bun:jsc";function Dn1(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{lc6()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let X,Q=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-Q;Q=G+Z;let K=[];try{K=dc6()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let U of K){let N=U.frames.find((B)=>B.sourceURL&&!/Unknown Executable/.test(B.category??""))??U.frames[0];if(!N)continue;let F=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),w=`${N.name??"?"} @ ${F}:${N.line??"?"}`;W.set(w,(W.get(w)??0)+1)}let H=[...W.entries()].sort((U,N)=>N[1]-U[1]).slice(0,8).map(([U,N])=>({frame:U,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}X=setTimeout(Y,Z),X.unref?.()};return X=setTimeout(Y,Z),X.unref?.(),()=>{if(X)clearTimeout(X)}}var lc6,dc6;var En1=O(()=>{({startSamplingProfiler:lc6,samplingProfilerStackTraces:dc6}=cc6)});function zn1(){Bn1();let $=[On1(),El1(),Dn1()];return()=>{for(let Z of $)Z()}}var jn1=O(()=>{Xh0();Ln1();En1()});var rD=_((Pn1)=>{Object.defineProperty(Pn1,"__esModule",{value:!0});Pn1.RepublishHeaders=Pn1.DirectMsgHeaders=Pn1.JsHeaders=Pn1.AdvisoryKind=void 0;Pn1.isOrderedPushConsumerOptions=mc6;Pn1.isPullConsumer=ic6;Pn1.isPushConsumer=nc6;Pn1.isBoundPushConsumerOptions=pc6;function mc6($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function ic6($){return $.isPullConsumer()}function nc6($){return $.isPushConsumer()}function pc6($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Pn1.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};Pn1.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};Pn1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Pn1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var uY=_((Tn1)=>{Object.defineProperty(Tn1,"__esModule",{value:!0});Tn1.TD=Tn1.TE=Tn1.Empty=void 0;Tn1.encode=Xl6;Tn1.decode=Ql6;Tn1.Empty=new Uint8Array(0);Tn1.TE=new TextEncoder;Tn1.TD=new TextDecoder;function Zl6(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}function Xl6(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(Tn1.TE.encode($[X]));if(Z.length===0)return Tn1.Empty;if(Z.length===1)return Z[0];return Zl6(...Z)}function Ql6($){if(!$||$.length===0)return"";return Tn1.TD.decode($)}});var cY=_((qn1)=>{Object.defineProperty(qn1,"__esModule",{value:!0});qn1.errors=qn1.PermissionViolationError=qn1.NoRespondersError=qn1.TimeoutError=qn1.RequestError=qn1.ProtocolError=qn1.ConnectionError=qn1.DrainingConnectionError=qn1.ClosedConnectionError=qn1.AuthorizationError=qn1.UserAuthenticationExpiredError=qn1.InvalidOperationError=qn1.InvalidArgumentError=qn1.InvalidSubjectError=void 0;class $d0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}qn1.InvalidSubjectError=$d0;class r50 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,X){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((Q)=>`'${Q}'`),$=$.join(",");else $=`'${$}'`;return new r50(`${$} ${Z}`,X)}}qn1.InvalidArgumentError=r50;class Zd0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}qn1.InvalidOperationError=Zd0;class a50 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new a50($);return null}}qn1.UserAuthenticationExpiredError=a50;class s50 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],X=$.toLowerCase();for(let Q=0;Q<Z.length;Q++)if(X.indexOf(Z[Q])!==-1)return new s50($);return null}}qn1.AuthorizationError=s50;class Xd0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}qn1.ClosedConnectionError=Xd0;class Qd0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}qn1.DrainingConnectionError=Qd0;class Yd0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}qn1.ConnectionError=Yd0;class Gd0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}qn1.ProtocolError=Gd0;class Jd0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof e50}}qn1.RequestError=Jd0;class Kd0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}qn1.TimeoutError=Kd0;class e50 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}qn1.NoRespondersError=e50;class $90 extends Error{operation;subject;queue;constructor($,Z,X,Q,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=X,this.queue=Q}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let X="publish",Q="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(X=G[1].toLowerCase(),Q=G[2],X==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new $90($,X,Q,Y)}}qn1.PermissionViolationError=$90;qn1.errors={AuthorizationError:s50,ClosedConnectionError:Xd0,ConnectionError:Yd0,DrainingConnectionError:Qd0,InvalidArgumentError:r50,InvalidOperationError:Zd0,InvalidSubjectError:$d0,NoRespondersError:e50,PermissionViolationError:$90,ProtocolError:Gd0,RequestError:Jd0,TimeoutError:Kd0,UserAuthenticationExpiredError:a50}});var FJ=_((Cn1)=>{Object.defineProperty(Cn1,"__esModule",{value:!0});Cn1.SimpleMutex=Cn1.Perf=void 0;Cn1.extend=jl6;Cn1.render=Pl6;Cn1.timeout=Al6;Cn1.delay=Tl6;Cn1.deadline=Rl6;Cn1.deferred=Hd0;Cn1.debugDeferred=Il6;Cn1.shuffle=ql6;Cn1.collect=Ml6;Cn1.jitter=Sn1;Cn1.backoff=kl6;Cn1.nanos=Vl6;Cn1.millis=Sl6;Cn1.randomToken=vl6;var zl6=uY(),Wd0=cY();function jl6($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function Pl6($){return zl6.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function Al6($,Z=!0){let X=Z?new Wd0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new Wd0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function Tl6($=0){let Z,X=new Promise((Q)=>{let Y=setTimeout(()=>{Q()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),Q()}}});return Object.assign(X,Z)}async function Rl6($,Z=1000){let X=Hd0(),Q=setTimeout(()=>{X.reject(new Wd0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function Hd0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function Il6(){let $={},Z=new Promise((X,Q)=>{$={resolve:(Y)=>{console.trace("resolve",Y),X(Y)},reject:(Y)=>{console.trace("reject"),Q(Y)}}});return Object.assign(Z,$)}function ql6($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function Ml6($){let Z=[];for await(let X of $)Z.push(X);return Z}class kn1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,X){let Q=this.timers.get(Z);if(Q===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(X);if(Y===void 0)throw Error(`${X} is not defined`);this.measures.set($,Y-Q)}getEntries(){let $=[];return this.measures.forEach((Z,X)=>{$.push({name:X,duration:Z})}),$}}Cn1.Perf=kn1;class Vn1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Hd0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}Cn1.SimpleMutex=Vn1;function Sn1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function kl6($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(X){return Sn1(X>Z?$[Z]:$[X])}}}function Vl6($){return $*1e6}function Sl6($){return Math.floor($/1e6)}var Cl6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",vU=new Uint8Array(62);for(let $=0;$<62;$++)vU[$]=Cl6.charCodeAt($);var _l6=218340105584896;function vl6(){let $=Math.floor(Math.random()*_l6),Z=$%62,X=vU[Z];$=($-Z)/62,Z=$%62;let Q=vU[Z];$=($-Z)/62,Z=$%62;let Y=vU[Z];$=($-Z)/62,Z=$%62;let G=vU[Z];$=($-Z)/62,Z=$%62;let J=vU[Z];$=($-Z)/62,Z=$%62;let K=vU[Z];$=($-Z)/62,Z=$%62;let W=vU[Z];$=($-Z)/62;let H=vU[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var hn1=_((yn1)=>{Object.defineProperty(yn1,"__esModule",{value:!0});yn1.nuid=yn1.NuidImpl=void 0;var ol6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Aw=62,X90=12,fn1=10,vn1=33,rl6=333,xn1=X90+fn1,Nd0=new Uint8Array(Aw);for(let $=0;$<Aw;$++)Nd0[$]=ol6.charCodeAt($);var Z90=4294967296,bn1=BigInt(Aw)**BigInt(fn1),_m=Number(bn1/(1n<<32n)),Ud0=Number(bn1%(1n<<32n));function al6($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function sl6($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else al6($)}class Fd0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(xn1),this.cbuf=new Uint8Array(X90),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(_m+1)),this.seqLo=Math.floor(Math.random()*Z90);while($++<8&&this.seqHi===_m&&this.seqLo>=Ud0);if(this.seqHi===_m&&this.seqLo>=Ud0)this.seqLo=0;this.inc=Math.random()*(rl6-vn1)+vn1|0}setPre(){sl6(this.cbuf);for(let $=0;$<X90;$++)this.buf[$]=Nd0[this.cbuf[$]%Aw]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=xn1-1;X>=X90;X--){let Q=Math.floor($/Aw),G=($-Q*Aw)*Z90+Z,J=Math.floor(G/Aw),K=G-J*Aw;this.buf[X]=Nd0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=Z90)this.seqLo-=Z90,this.seqHi+=1;if(this.seqHi>_m||this.seqHi===_m&&this.seqLo>=Ud0)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}yn1.NuidImpl=Fd0;yn1.nuid=new Fd0});var dn1=_((cn1)=>{Object.defineProperty(cn1,"__esModule",{value:!0});cn1.nuid=cn1.Nuid=void 0;var un1=hn1();cn1.Nuid=un1.NuidImpl;cn1.nuid=un1.nuid});var Y90=_((Q90)=>{Object.defineProperty(Q90,"__esModule",{value:!0});Q90.nuid=Q90.Nuid=void 0;var mn1=dn1();Object.defineProperty(Q90,"Nuid",{enumerable:!0,get:function(){return mn1.Nuid}});Object.defineProperty(Q90,"nuid",{enumerable:!0,get:function(){return mn1.nuid}})});var Tw=_((in1)=>{Object.defineProperty(in1,"__esModule",{value:!0});in1.DEFAULT_HOST=in1.DEFAULT_PORT=in1.Match=void 0;in1.syncIterator=Yd6;in1.createInbox=Gd6;var Xd6=Y90(),Qd6=cY();in1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function Yd6($){let Z=$[Symbol.asyncIterator]();return{async next(){let X=await Z.next();if(X.done)return Promise.resolve(null);return Promise.resolve(X.value)}}}function Gd6($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw Qd6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${Xd6.nuid.next()}`}in1.DEFAULT_PORT=4222;in1.DEFAULT_HOST="127.0.0.1"});var vm=_((on1)=>{Object.defineProperty(on1,"__esModule",{value:!0});on1.DataBuffer=void 0;var pn1=uY();class tn1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}static fromAscii($){if(!$)$="";return pn1.TE.encode($)}static toAscii($){return pn1.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let X=0;X<this.buffers.length;X++)$.set(this.buffers[X],Z),Z+=this.buffers[X].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let X=this.byteLength;if($===void 0||$>X)$=X;let Q=Z.subarray(0,$);if(X>$)this.buffers.push(Z.subarray($));return this.byteLength=X-$,Q}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let X=0;X<Z.length;X++)if(Z[X]&&Z[X].length)this.buffers.push(Z[X]),this.byteLength+=Z[X].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}on1.DataBuffer=tn1});var aD=_((sn1)=>{Object.defineProperty(sn1,"__esModule",{value:!0});sn1.LF=sn1.CR=sn1.CRLF=sn1.CR_LF_LEN=sn1.CR_LF=void 0;sn1.setTransportFactory=wd6;sn1.defaultPort=Bd6;sn1.getUrlParseFn=Od6;sn1.newTransport=Ld6;sn1.getResolveFn=Dd6;sn1.protoLen=an1;sn1.extractProtocolMessage=Ed6;var Ud6=uY(),Nd6=Tw(),Fd6=vm(),lY;function wd6($){lY=$}function Bd6(){return lY!==void 0&&lY.defaultPort!==void 0?lY.defaultPort:Nd6.DEFAULT_PORT}function Od6(){return lY!==void 0&&lY.urlParseFn?lY.urlParseFn:void 0}function Ld6(){if(!lY||typeof lY.factory!=="function")throw Error("transport fn is not set");return lY.factory()}function Dd6(){return lY!==void 0&&lY.dnsResolveFn?lY.dnsResolveFn:void 0}sn1.CR_LF=`\r
1335
+ `);Q=G.pop()??"";for(let J of G){let K=Sm(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;zw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{for(;;){let{done:G,value:J}=await Z.read();if(G)break;Q+=X.decode(J,{stream:!0}),Y()}if(Q.trim()){let G=Sm(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)zw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function kc6($){let{baseUrl:Z,noTui:X}=$,Q=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=Q?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=Q?await Vm(Number(Y)+1):await Vm(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await i50({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)pD({name:L.name,status:"ready",port:L.port});Mm();let U=Mc6(import.meta.dir,"..","..","..","..",".."),N=X===!0,F=Bun.spawn(["bun","run","dev:servers"],{cwd:U,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:G,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsPublicUrl&&K.natsAccountJwt&&K.natsAccountSigningKey?{NATS_PUBLIC_URL:K.natsPublicUrl,NATS_ACCOUNT_JWT:K.natsAccountJwt,NATS_ACCOUNT_SIGNING_KEY:K.natsAccountSigningKey,NATS_OPERATOR_JWT:K.natsOperatorJwt??"",NATS_TUNNEL_PUBLIC_ENABLED:"true",...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)$n1(F.stdout),$n1(F.stderr);km(G),pD({name:"Vite",status:"ready",port:Number(Y)}),pD({name:"API",status:"ready",port:Number(K.port)});let B=async(L)=>{if(F.kill(L),await F.exited,H.length>0){let{stopServices:D}=await Promise.resolve().then(() => (X50(),Z50));await D(K.dataDir)}};return process.on("SIGINT",()=>B("SIGINT")),process.on("SIGTERM",()=>B("SIGTERM")),{port:Number(Y),process:F}}var nl0=O(()=>{ul0();tD();ml0()});var t50;var pl0=O(()=>{t50={name:"decocms",version:"4.197.4",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as Sc6,Text as Zn1}from"ink";import{jsx as Cc6,jsxs as Xn1}from"react/jsx-runtime";function Qn1({version:$}){return Xn1(Sc6,{flexDirection:"column",marginTop:1,children:[T50.map((Z,X)=>Cc6(Zn1,{color:R50[X],children:Z},X)),Xn1(Zn1,{dimColor:!0,children:[" v",$]})]})}var Yn1=O(()=>{Om()});import{Box as oD,Text as jw}from"ink";import{Spinner as _c6}from"@inkjs/ui";import{jsx as hY,jsxs as Qb}from"react/jsx-runtime";function Gn1({status:$}){if($==="pending")return hY(_c6,{label:""});return hY(jw,{color:"green",children:"\u2713"})}function vc6($){return`${$.name}: ${$.port||"...."}`}function Jn1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return Qb(oD,{flexDirection:"column",paddingBottom:1,children:[hY(Qn1,{version:t50.version}),hY(oD,{marginBottom:1,children:hY(jw,{dimColor:!0,children:"\u2500".repeat(80)})}),hY(oD,{children:Qb(jw,{dimColor:!0,children:["Home: ",X]})}),Qb(oD,{gap:2,children:[$.map((Y)=>Qb(oD,{gap:1,children:[hY(jw,{children:vc6(Y)}),hY(Gn1,{status:Y.status})]},Y.name)),Qb(oD,{gap:1,children:[hY(jw,{children:"Migrations"}),hY(Gn1,{status:Z})]})]}),hY(oD,{children:Q?Qb(jw,{children:["Open in browser: ",hY(jw,{color:"cyan",children:Q})]}):hY(jw,{dimColor:!0,children:"Starting..."})})]})}var Kn1=O(()=>{pl0();Yn1()});import{Box as xc6,Text as Cm}from"ink";import{jsx as tl0,jsxs as ol0}from"react/jsx-runtime";function fc6($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function Wn1({logs:$}){return tl0(xc6,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return tl0(Cm,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return ol0(Cm,{children:[ol0(Cm,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),tl0(Cm,{color:fc6(Z.status),children:Z.status}),ol0(Cm,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var Hn1=()=>{};var rl0={};w0(rl0,{App:()=>gc6});import{Box as bc6}from"ink";import{useSyncExternalStore as yc6}from"react";import{jsx as Un1,jsxs as hc6}from"react/jsx-runtime";function gc6({home:$}){let Z=yc6(dl0,ll0);return hc6(bc6,{flexDirection:"column",children:[Un1(Jn1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Un1(Wn1,{logs:Z.logs})]})}var al0=O(()=>{Kn1();Hn1();tD()});var NJ="thread-gate",_U="decopilot-hosted-harness",nG="automations",Pw="background-tools";var Nn1="7";function Fn1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Nn1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var wn1=()=>{};function uc6(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function sl0($,Z){for(let X=0;X<$.length;X++){let Q=$[X];if(Q===void 0)continue;if(Q===Z)return $[X+1];if(Q.startsWith(`${Z}=`))return Q.slice(Z.length+1)}return}function Bn1(){let $=uc6();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:sl0($,"--cpu-prof-dir")??process.cwd(),name:sl0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(sl0($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function On1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=dD();if(!X)return;let Q={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);Q={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:X.rss,heapUsed:X.heapUsed,heapTotal:X.heapTotal,external:X.external,arrayBuffers:X.arrayBuffers,...Q}))};return Z().catch(()=>{}),o50=setInterval(()=>void Z().catch(()=>{}),$),o50.unref?.(),process.on("SIGUSR2",()=>{try{let X=Bun.generateHeapSnapshot("v8"),Q=typeof X==="string"?X:JSON.stringify(X),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,Q),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(X){console.error("[heap-watch] snapshot failed:",X)}}),()=>{if(o50)clearInterval(o50)}}var o50;var Ln1=()=>{};import*as cc6 from"bun:jsc";function Dn1(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{lc6()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let X,Q=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-Q;Q=G+Z;let K=[];try{K=dc6()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let U of K){let N=U.frames.find((B)=>B.sourceURL&&!/Unknown Executable/.test(B.category??""))??U.frames[0];if(!N)continue;let F=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),w=`${N.name??"?"} @ ${F}:${N.line??"?"}`;W.set(w,(W.get(w)??0)+1)}let H=[...W.entries()].sort((U,N)=>N[1]-U[1]).slice(0,8).map(([U,N])=>({frame:U,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}X=setTimeout(Y,Z),X.unref?.()};return X=setTimeout(Y,Z),X.unref?.(),()=>{if(X)clearTimeout(X)}}var lc6,dc6;var En1=O(()=>{({startSamplingProfiler:lc6,samplingProfilerStackTraces:dc6}=cc6)});function zn1(){Bn1();let $=[On1(),El1(),Dn1()];return()=>{for(let Z of $)Z()}}var jn1=O(()=>{Xh0();Ln1();En1()});var rD=_((Pn1)=>{Object.defineProperty(Pn1,"__esModule",{value:!0});Pn1.RepublishHeaders=Pn1.DirectMsgHeaders=Pn1.JsHeaders=Pn1.AdvisoryKind=void 0;Pn1.isOrderedPushConsumerOptions=mc6;Pn1.isPullConsumer=ic6;Pn1.isPushConsumer=nc6;Pn1.isBoundPushConsumerOptions=pc6;function mc6($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function ic6($){return $.isPullConsumer()}function nc6($){return $.isPushConsumer()}function pc6($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Pn1.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};Pn1.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};Pn1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Pn1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var uY=_((Tn1)=>{Object.defineProperty(Tn1,"__esModule",{value:!0});Tn1.TD=Tn1.TE=Tn1.Empty=void 0;Tn1.encode=Xl6;Tn1.decode=Ql6;Tn1.Empty=new Uint8Array(0);Tn1.TE=new TextEncoder;Tn1.TD=new TextDecoder;function Zl6(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}function Xl6(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(Tn1.TE.encode($[X]));if(Z.length===0)return Tn1.Empty;if(Z.length===1)return Z[0];return Zl6(...Z)}function Ql6($){if(!$||$.length===0)return"";return Tn1.TD.decode($)}});var cY=_((qn1)=>{Object.defineProperty(qn1,"__esModule",{value:!0});qn1.errors=qn1.PermissionViolationError=qn1.NoRespondersError=qn1.TimeoutError=qn1.RequestError=qn1.ProtocolError=qn1.ConnectionError=qn1.DrainingConnectionError=qn1.ClosedConnectionError=qn1.AuthorizationError=qn1.UserAuthenticationExpiredError=qn1.InvalidOperationError=qn1.InvalidArgumentError=qn1.InvalidSubjectError=void 0;class $d0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}qn1.InvalidSubjectError=$d0;class r50 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,X){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((Q)=>`'${Q}'`),$=$.join(",");else $=`'${$}'`;return new r50(`${$} ${Z}`,X)}}qn1.InvalidArgumentError=r50;class Zd0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}qn1.InvalidOperationError=Zd0;class a50 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new a50($);return null}}qn1.UserAuthenticationExpiredError=a50;class s50 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],X=$.toLowerCase();for(let Q=0;Q<Z.length;Q++)if(X.indexOf(Z[Q])!==-1)return new s50($);return null}}qn1.AuthorizationError=s50;class Xd0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}qn1.ClosedConnectionError=Xd0;class Qd0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}qn1.DrainingConnectionError=Qd0;class Yd0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}qn1.ConnectionError=Yd0;class Gd0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}qn1.ProtocolError=Gd0;class Jd0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof e50}}qn1.RequestError=Jd0;class Kd0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}qn1.TimeoutError=Kd0;class e50 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}qn1.NoRespondersError=e50;class $90 extends Error{operation;subject;queue;constructor($,Z,X,Q,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=X,this.queue=Q}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let X="publish",Q="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(X=G[1].toLowerCase(),Q=G[2],X==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new $90($,X,Q,Y)}}qn1.PermissionViolationError=$90;qn1.errors={AuthorizationError:s50,ClosedConnectionError:Xd0,ConnectionError:Yd0,DrainingConnectionError:Qd0,InvalidArgumentError:r50,InvalidOperationError:Zd0,InvalidSubjectError:$d0,NoRespondersError:e50,PermissionViolationError:$90,ProtocolError:Gd0,RequestError:Jd0,TimeoutError:Kd0,UserAuthenticationExpiredError:a50}});var FJ=_((Cn1)=>{Object.defineProperty(Cn1,"__esModule",{value:!0});Cn1.SimpleMutex=Cn1.Perf=void 0;Cn1.extend=jl6;Cn1.render=Pl6;Cn1.timeout=Al6;Cn1.delay=Tl6;Cn1.deadline=Rl6;Cn1.deferred=Hd0;Cn1.debugDeferred=Il6;Cn1.shuffle=ql6;Cn1.collect=Ml6;Cn1.jitter=Sn1;Cn1.backoff=kl6;Cn1.nanos=Vl6;Cn1.millis=Sl6;Cn1.randomToken=vl6;var zl6=uY(),Wd0=cY();function jl6($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function Pl6($){return zl6.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function Al6($,Z=!0){let X=Z?new Wd0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new Wd0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function Tl6($=0){let Z,X=new Promise((Q)=>{let Y=setTimeout(()=>{Q()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),Q()}}});return Object.assign(X,Z)}async function Rl6($,Z=1000){let X=Hd0(),Q=setTimeout(()=>{X.reject(new Wd0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function Hd0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function Il6(){let $={},Z=new Promise((X,Q)=>{$={resolve:(Y)=>{console.trace("resolve",Y),X(Y)},reject:(Y)=>{console.trace("reject"),Q(Y)}}});return Object.assign(Z,$)}function ql6($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function Ml6($){let Z=[];for await(let X of $)Z.push(X);return Z}class kn1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,X){let Q=this.timers.get(Z);if(Q===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(X);if(Y===void 0)throw Error(`${X} is not defined`);this.measures.set($,Y-Q)}getEntries(){let $=[];return this.measures.forEach((Z,X)=>{$.push({name:X,duration:Z})}),$}}Cn1.Perf=kn1;class Vn1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Hd0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}Cn1.SimpleMutex=Vn1;function Sn1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function kl6($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(X){return Sn1(X>Z?$[Z]:$[X])}}}function Vl6($){return $*1e6}function Sl6($){return Math.floor($/1e6)}var Cl6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",vU=new Uint8Array(62);for(let $=0;$<62;$++)vU[$]=Cl6.charCodeAt($);var _l6=218340105584896;function vl6(){let $=Math.floor(Math.random()*_l6),Z=$%62,X=vU[Z];$=($-Z)/62,Z=$%62;let Q=vU[Z];$=($-Z)/62,Z=$%62;let Y=vU[Z];$=($-Z)/62,Z=$%62;let G=vU[Z];$=($-Z)/62,Z=$%62;let J=vU[Z];$=($-Z)/62,Z=$%62;let K=vU[Z];$=($-Z)/62,Z=$%62;let W=vU[Z];$=($-Z)/62;let H=vU[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var hn1=_((yn1)=>{Object.defineProperty(yn1,"__esModule",{value:!0});yn1.nuid=yn1.NuidImpl=void 0;var ol6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Aw=62,X90=12,fn1=10,vn1=33,rl6=333,xn1=X90+fn1,Nd0=new Uint8Array(Aw);for(let $=0;$<Aw;$++)Nd0[$]=ol6.charCodeAt($);var Z90=4294967296,bn1=BigInt(Aw)**BigInt(fn1),_m=Number(bn1/(1n<<32n)),Ud0=Number(bn1%(1n<<32n));function al6($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function sl6($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else al6($)}class Fd0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(xn1),this.cbuf=new Uint8Array(X90),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(_m+1)),this.seqLo=Math.floor(Math.random()*Z90);while($++<8&&this.seqHi===_m&&this.seqLo>=Ud0);if(this.seqHi===_m&&this.seqLo>=Ud0)this.seqLo=0;this.inc=Math.random()*(rl6-vn1)+vn1|0}setPre(){sl6(this.cbuf);for(let $=0;$<X90;$++)this.buf[$]=Nd0[this.cbuf[$]%Aw]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=xn1-1;X>=X90;X--){let Q=Math.floor($/Aw),G=($-Q*Aw)*Z90+Z,J=Math.floor(G/Aw),K=G-J*Aw;this.buf[X]=Nd0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=Z90)this.seqLo-=Z90,this.seqHi+=1;if(this.seqHi>_m||this.seqHi===_m&&this.seqLo>=Ud0)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}yn1.NuidImpl=Fd0;yn1.nuid=new Fd0});var dn1=_((cn1)=>{Object.defineProperty(cn1,"__esModule",{value:!0});cn1.nuid=cn1.Nuid=void 0;var un1=hn1();cn1.Nuid=un1.NuidImpl;cn1.nuid=un1.nuid});var Y90=_((Q90)=>{Object.defineProperty(Q90,"__esModule",{value:!0});Q90.nuid=Q90.Nuid=void 0;var mn1=dn1();Object.defineProperty(Q90,"Nuid",{enumerable:!0,get:function(){return mn1.Nuid}});Object.defineProperty(Q90,"nuid",{enumerable:!0,get:function(){return mn1.nuid}})});var Tw=_((in1)=>{Object.defineProperty(in1,"__esModule",{value:!0});in1.DEFAULT_HOST=in1.DEFAULT_PORT=in1.Match=void 0;in1.syncIterator=Yd6;in1.createInbox=Gd6;var Xd6=Y90(),Qd6=cY();in1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function Yd6($){let Z=$[Symbol.asyncIterator]();return{async next(){let X=await Z.next();if(X.done)return Promise.resolve(null);return Promise.resolve(X.value)}}}function Gd6($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw Qd6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${Xd6.nuid.next()}`}in1.DEFAULT_PORT=4222;in1.DEFAULT_HOST="127.0.0.1"});var vm=_((on1)=>{Object.defineProperty(on1,"__esModule",{value:!0});on1.DataBuffer=void 0;var pn1=uY();class tn1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}static fromAscii($){if(!$)$="";return pn1.TE.encode($)}static toAscii($){return pn1.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let X=0;X<this.buffers.length;X++)$.set(this.buffers[X],Z),Z+=this.buffers[X].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let X=this.byteLength;if($===void 0||$>X)$=X;let Q=Z.subarray(0,$);if(X>$)this.buffers.push(Z.subarray($));return this.byteLength=X-$,Q}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let X=0;X<Z.length;X++)if(Z[X]&&Z[X].length)this.buffers.push(Z[X]),this.byteLength+=Z[X].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}on1.DataBuffer=tn1});var aD=_((sn1)=>{Object.defineProperty(sn1,"__esModule",{value:!0});sn1.LF=sn1.CR=sn1.CRLF=sn1.CR_LF_LEN=sn1.CR_LF=void 0;sn1.setTransportFactory=wd6;sn1.defaultPort=Bd6;sn1.getUrlParseFn=Od6;sn1.newTransport=Ld6;sn1.getResolveFn=Dd6;sn1.protoLen=an1;sn1.extractProtocolMessage=Ed6;var Ud6=uY(),Nd6=Tw(),Fd6=vm(),lY;function wd6($){lY=$}function Bd6(){return lY!==void 0&&lY.defaultPort!==void 0?lY.defaultPort:Nd6.DEFAULT_PORT}function Od6(){return lY!==void 0&&lY.urlParseFn?lY.urlParseFn:void 0}function Ld6(){if(!lY||typeof lY.factory!=="function")throw Error("transport fn is not set");return lY.factory()}function Dd6(){return lY!==void 0&&lY.dnsResolveFn?lY.dnsResolveFn:void 0}sn1.CR_LF=`\r
1336
1336
  `;sn1.CR_LF_LEN=sn1.CR_LF.length;sn1.CRLF=Fd6.DataBuffer.fromAscii(sn1.CR_LF);sn1.CR=new Uint8Array(sn1.CRLF)[0];sn1.LF=new Uint8Array(sn1.CRLF)[1];function an1($){for(let Z=0;Z<$.length;Z++){let X=Z+1;if($.byteLength>X&&$[Z]===sn1.CR&&$[X]===sn1.LF)return X+1}return 0}function Ed6($){let Z=an1($);if(Z>0){let Q=new Uint8Array($).slice(0,Z);return Ud6.TD.decode(Q)}return""}});var Dd0=_((Jp1)=>{Object.defineProperty(Jp1,"__esModule",{value:!0});Jp1.ipV4=Qp1;Jp1.isIP=Vd6;Jp1.parseIP=Yp1;var xm=4,sD=16,G90=48,Xp1=57,$p1=65,Md6=70,Zp1=97,kd6=102,Ld0=16777215;function Qp1($,Z,X,Q){let Y=new Uint8Array(sD);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((J,K)=>{Y[K]=J}),Y[12]=$,Y[13]=Z,Y[14]=X,Y[15]=Q,Y}function Vd6($){return Yp1($)!==void 0}function Yp1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return Gp1($);case":":return Sd6($)}return}function Gp1($){let Z=new Uint8Array(xm);for(let X=0;X<xm;X++){if($.length===0)return;if(X>0){if($[0]!==".")return;$=$.substring(1)}let{n:Q,c:Y,ok:G}=Cd6($);if(!G||Q>255)return;$=$.substring(Y),Z[X]=Q}return Qp1(Z[0],Z[1],Z[2],Z[3])}function Sd6($){let Z=new Uint8Array(sD),X=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(X=0,$=$.substring(2),$.length===0)return Z}let Q=0;while(Q<sD){let{n:Y,c:G,ok:J}=_d6($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(X<0&&Q!=sD-xm)return;if(Q+xm>sD)return;let K=Gp1($);if(K===void 0)return;Z[Q]=K[12],Z[Q+1]=K[13],Z[Q+2]=K[14],Z[Q+3]=K[15],$="",Q+=xm;break}if(Z[Q]=Y>>8,Z[Q+1]=Y,Q+=2,$=$.substring(G),$.length===0)break;if($[0]!==":"||$.length==1)return;if($=$.substring(1),$[0]===":"){if(X>=0)return;if(X=Q,$=$.substring(1),$.length===0)break}}if($.length!==0)return;if(Q<sD){if(X<0)return;let Y=sD-Q;for(let G=Q-1;G>=X;G--)Z[G+Y]=Z[G];for(let G=X+Y-1;G>=X;G--)Z[G]=0}else if(X>=0)return;return Z}function Cd6($){let Z=0,X=0;for(Z=0;Z<$.length&&G90<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=Xp1;Z++)if(X=X*10+($.charCodeAt(Z)-G90),X>=Ld0)return{n:Ld0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:X,c:Z,ok:!0}}function _d6($){let Z=0,X=0;for(X=0;X<$.length;X++){if(G90<=$.charCodeAt(X)&&$.charCodeAt(X)<=Xp1)Z*=16,Z+=$.charCodeAt(X)-G90;else if(Zp1<=$.charCodeAt(X)&&$.charCodeAt(X)<=kd6)Z*=16,Z+=$.charCodeAt(X)-Zp1+10;else if($p1<=$.charCodeAt(X)&&$.charCodeAt(X)<=Md6)Z*=16,Z+=$.charCodeAt(X)-$p1+10;else break;if(Z>=Ld0)return{n:0,c:X,ok:!1}}if(X===0)return{n:0,c:X,ok:!1};return{n:Z,c:X,ok:!0}}});var Td0=_((Wp1)=>{Object.defineProperty(Wp1,"__esModule",{value:!0});Wp1.Servers=Wp1.ServerImpl=void 0;Wp1.isIPV4OrHostname=Kp1;Wp1.hostPort=Ad0;var Ed0=aD(),zd0=FJ(),jd0=Dd0(),bd6=Tw(),yd6=cY();function Kp1($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function Pd0($){return!Kp1($)}function gd6($){let X=$.toUpperCase().indexOf("::FFFF:");if(X!==-1&&$.indexOf(".")!==-1){let Q=$.substring(X+7);return Q=Q.replace("[",""),Q.replace("]","")}return $}function Ad0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=gd6($),Pd0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=Pd0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),X=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):bd6.DEFAULT_PORT,Y=new URL(`${X===80?"https":"http"}://${$}`);Y.port=`${X}`;let G=Y.hostname;if(G.charAt(0)==="[")G=G.substring(1,G.length-1);return{listen:Y.host,hostname:G,port:X}}class Yb{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let X=Ad0($);this.listen=X.listen,this.hostname=X.hostname,this.port=X.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=Z}toString(){return this.listen}async resolve($){if(!$.fn||$.resolve===!1)return[this];let Z=[];if((0,jd0.isIP)(this.hostname))return[this];else{let X=await $.fn(this.hostname);if($.debug)console.log(`resolve ${this.hostname} = ${X.join(",")}`);for(let Q of X){let Y=this.port===80?"https":"http",G=new URL(`${Y}://${Pd0(Q)?"["+Q+"]":Q}`);G.port=`${this.port}`;let J=new Yb(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,zd0.shuffle)(Z);return this.resolves=Z,Z}}Wp1.ServerImpl=Yb;class J90{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw yd6.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,Ed0.getUrlParseFn)(),X=new Map;for(let Y of this.servers)X.set(Y.listen,Y);let Q=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:G}=Ad0(Y),J=X.get(G);if(J)J.gossiped=!1,Q.push(J);else Q.push(new Yb(Y))}if(this.randomize)(0,zd0.shuffle)(Q);if(this.servers=Q,this.currentServer===void 0||!Q.includes(this.currentServer))this.currentServer=Q[0],this.firstSelect=!0}clear(){this.servers.length=0}updateTLSName(){let $=this.getCurrentServer();if(!(0,jd0.isIP)($.hostname))this.tlsName=$.hostname,this.servers.forEach((Z)=>{if(Z.gossiped)Z.tlsName=this.tlsName})}getCurrentServer(){return this.currentServer}addServer($,Z=!1){let X=(0,Ed0.getUrlParseFn)();$=X?X($):$;let Q=new Yb($,Z);if((0,jd0.isIP)(Q.hostname))Q.tlsName=this.tlsName;this.servers.push(Q)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;let $=this.servers.shift();if($)this.servers.push($),this.currentServer=$;return $}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer($){if($){let Z=this.servers.indexOf($);this.servers.splice(Z,1)}}snapshot(){return J90.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return J90.freezeAll([$,...this.servers.slice(0,Z),...this.servers.slice(Z+1)])}static freezeAll($){return $.map((Z)=>Object.freeze({hostname:Z.hostname,port:Z.port,listen:Z.listen,src:Z.src,tlsName:Z.tlsName,reconnects:Z.reconnects,lastConnect:Z.lastConnect,gossiped:Z.gossiped,didConnect:Z.didConnect}))}find($){return this.servers.find((Z)=>Z.listen===$.listen)}setCurrent($){this.currentServer=$}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update($,Z){let X=[],Q=[],Y=(0,Ed0.getUrlParseFn)(),G=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Yb(K,!0);G.set(K,W)});let J=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&G.get(H)===void 0)J.push(W);G.delete(H)}),J.reverse(),J.forEach((K)=>{let W=this.servers.splice(K,1);Q=Q.concat(W[0].listen)}),G.forEach((K,W)=>{this.servers.push(K),X.push(W)}),this.randomize&&X.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,zd0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:X,deleted:Q}}}Wp1.Servers=J90});var K90=_((Fp1)=>{Object.defineProperty(Fp1,"__esModule",{value:!0});Fp1.QueuedIteratorImpl=void 0;var Rd0=FJ(),Up1=cY();class Np1{inflight;processed;received;noIterator;iterClosed;done;signal;yields;filtered;pendingFiltered;ctx;_data;err;time;profile;yielding;didBreak;constructor(){this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=(0,Rd0.deferred)(),this.yields=[],this.iterClosed=(0,Rd0.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push($){if(this.done)return;if(this.didBreak){if(typeof $==="function"){let Z=$;try{Z()}catch(X){}}return}if(typeof $==="function")this.pendingFiltered++;this.yields.push($),this.signal.resolve()}async*iterate(){if(this.noIterator)throw new Up1.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Up1.InvalidOperationError("iterator is already yielding");this.yielding=!0;try{while(!0){if(this.yields.length===0)await this.signal;if(this.err)throw this.err;let $=this.yields;this.inflight=$.length,this.yields=[];for(let Z=0;Z<$.length;Z++){if(typeof $[Z]==="function"){this.pendingFiltered--;let Q=$[Z];try{Q()}catch(Y){throw Y}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let X=this.profile?Date.now():0;yield $[Z],this.time=this.profile?Date.now()-X:0}if(this.done)break;else if(this.yields.length===0)$.length=0,this.yields=$,this.signal=(0,Rd0.deferred)()}}finally{this.didBreak=!0,this.stop()}}stop($){if(this.done)return;this.err=$,this.done=!0,this.signal.resolve(),this.iterClosed.resolve($)}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}Fp1.QueuedIteratorImpl=Np1});var Id0=_((Lp1)=>{Object.defineProperty(Lp1,"__esModule",{value:!0});Lp1.MuxSubscription=void 0;var ld6=Tw(),Bp1=cY();class Op1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,ld6.createInbox)($)}.`,this.baseInbox}add($){if(!isNaN($.received))$.received=0;this.reqs.set($.token,$)}get($){return this.reqs.get($)}cancel($){this.reqs.delete($.token)}getToken($){let Z=$.subject||"";if(Z.indexOf(this.baseInbox)===0)return Z.substring(this.baseInbox.length);return null}all(){return Array.from(this.reqs.values())}handleError($,Z){if($)return this.all().forEach((X)=>{X.resolver(Z,{})}),!0;if(Z.operation==="publish"){let X=this.all().find((Q)=>{return Q.requestSubject===Z.subject});if(X)return X.resolver(Z,{}),!0}return!1}dispatcher(){return($,Z)=>{let X=this.getToken(Z);if(X){let Q=this.get(X);if(Q){if($===null)$=Z?.data?.length===0&&Z.headers?.code===503?new Bp1.NoRespondersError(Q.requestSubject):null;Q.resolver($,Z)}}}}close(){let $=new Bp1.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}Lp1.MuxSubscription=Op1});var qd0=_((zp1)=>{Object.defineProperty(zp1,"__esModule",{value:!0});zp1.Heartbeat=void 0;var dd6=FJ();class Ep1{ph;interval;maxOut;timer;pendings;constructor($,Z,X){this.ph=$,this.interval=Z,this.maxOut=X,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel($){if(this.timer)clearTimeout(this.timer),this.timer=void 0;if(this._reset(),$)this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:"ping",pendingPings:this.pendings.length+1}),this.pendings.length===this.maxOut){this.cancel(!0);return}let $=(0,dd6.deferred)();this.ph.flush($).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push($),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(($)=>{return $.resolve(),!1})}}zp1.Heartbeat=Ep1});var Vd0=_((Rp1)=>{Object.defineProperty(Rp1,"__esModule",{value:!0});Rp1.DenoBuffer=Rp1.MAX_SIZE=Rp1.AssertionError=void 0;Rp1.assert=Ap1;Rp1.concat=Tp1;Rp1.append=id6;Rp1.readAll=nd6;Rp1.writeAll=pd6;var md6=uY();class Md0 extends Error{constructor($){super($);this.name="AssertionError"}}Rp1.AssertionError=Md0;function Ap1($,Z="Assertion failed."){if(!$)throw new Md0(Z)}var Pp1=32768;Rp1.MAX_SIZE=4294967294;function W90($,Z,X=0){let Q=Z.byteLength-X;if($.byteLength>Q)$=$.subarray(0,Q);return Z.set($,X),$.byteLength}function Tp1($,Z){if($===void 0&&Z===void 0)return new Uint8Array(0);if($===void 0)return Z;if(Z===void 0)return $;let X=new Uint8Array($.length+Z.length);return X.set($,0),X.set(Z,$.length),X}function id6($,Z){return Tp1($,Uint8Array.of(Z))}class kd0{_buf;_off;constructor($){if(this._off=0,$==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array($)}bytes($={copy:!0}){if($.copy===!1)return this._buf.subarray(this._off);return this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate($){if($===0){this.reset();return}if($<0||$>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+$)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice($){let Z=this._buf.byteLength;if($<=this.capacity-Z)return this._reslice(Z+$),Z;return-1}_reslice($){Ap1($<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,$)}readByte(){let $=new Uint8Array(1);if(this.read($))return $[0];return null}read($){if(this.empty()){if(this.reset(),$.byteLength===0)return 0;return null}let Z=W90(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(md6.TE.encode($))}write($){let Z=this._grow($.byteLength);return W90($,this._buf,Z)}_grow($){let Z=this.length;if(Z===0&&this._off!==0)this.reset();let X=this._tryGrowByReslice($);if(X>=0)return X;let Q=this.capacity;if($<=Math.floor(Q/2)-Z)W90(this._buf.subarray(this._off),this._buf);else if(Q+$>Rp1.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*Q+$,Rp1.MAX_SIZE));W90(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,Rp1.MAX_SIZE)),Z}grow($){if($<0)throw Error("Buffer._grow: negative count");let Z=this._grow($);this._reslice(Z)}readFrom($){let Z=0,X=new Uint8Array(Pp1);while(!0){let Q=this.capacity-this.length<Pp1,Y=Q?X:new Uint8Array(this._buf.buffer,this.length),G=$.read(Y);if(G===null)return Z;if(Q)this.write(Y.subarray(0,G));else this._reslice(this.length+G);Z+=G}}}Rp1.DenoBuffer=kd0;function nd6($){let Z=new kd0;return Z.readFrom($),Z.bytes()}function pd6($,Z){let X=0;while(X<Z.length)X+=$.write(Z.subarray(X))}});var _d0=_((Vp1)=>{Object.defineProperty(Vp1,"__esModule",{value:!0});Vp1.cc=Vp1.State=Vp1.Parser=Vp1.Kind=void 0;Vp1.describe=$m6;var Sd0=Vd0(),Cd0=uY();Vp1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function $m6($){let Z,X="";switch($.kind){case Vp1.Kind.MSG:Z="MSG";break;case Vp1.Kind.OK:Z="OK";break;case Vp1.Kind.ERR:Z="ERR",X=Cd0.TD.decode($.data);break;case Vp1.Kind.PING:Z="PING";break;case Vp1.Kind.PONG:Z="PONG";break;case Vp1.Kind.INFO:Z="INFO",X=Cd0.TD.decode($.data)}return`${Z}: ${X}`}function qp1(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var Mp1=48,Zm6=57,Gb=67108864;class kp1{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=Vp1.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse($){let Z;for(Z=0;Z<$.length;Z++){let X=$[Z];switch(this.state){case Vp1.State.OP_START:switch(X){case Vp1.cc.M:case Vp1.cc.m:this.state=Vp1.State.OP_M,this.hdr=-1,this.ma=qp1();break;case Vp1.cc.H:case Vp1.cc.h:this.state=Vp1.State.OP_H,this.hdr=0,this.ma=qp1();break;case Vp1.cc.P:case Vp1.cc.p:this.state=Vp1.State.OP_P;break;case Vp1.cc.PLUS:this.state=Vp1.State.OP_PLUS;break;case Vp1.cc.MINUS:this.state=Vp1.State.OP_MINUS;break;case Vp1.cc.I:case Vp1.cc.i:this.state=Vp1.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_H:switch(X){case Vp1.cc.M:case Vp1.cc.m:this.state=Vp1.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_M:switch(X){case Vp1.cc.S:case Vp1.cc.s:this.state=Vp1.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_MS:switch(X){case Vp1.cc.G:case Vp1.cc.g:this.state=Vp1.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_MSG:switch(X){case Vp1.cc.SPACE:case Vp1.cc.TAB:this.state=Vp1.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_MSG_SPC:switch(X){case Vp1.cc.SPACE:case Vp1.cc.TAB:continue;default:this.state=Vp1.State.MSG_ARG,this.as=Z}break;case Vp1.State.MSG_ARG:switch(X){case Vp1.cc.CR:this.drop=1;break;case Vp1.cc.NL:{let Q=this.argBuf?this.argBuf.bytes():$.subarray(this.as,Z-this.drop);this.processMsgArgs(Q),this.drop=0,this.as=Z+1,this.state=Vp1.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;case Vp1.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let Q=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:Vp1.Kind.MSG,msg:this.ma,data:Q}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Vp1.State.MSG_END}else{let Q=this.ma.size-this.msgBuf.length,Y=$.length-Z;if(Y<Q)Q=Y;if(Q>0)this.msgBuf.write($.subarray(Z,Z+Q)),Z=Z+Q-1;else this.msgBuf.writeByte(X)}else if(Z-this.as>=this.ma.size)this.dispatcher.push({kind:Vp1.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Vp1.State.MSG_END;break;case Vp1.State.MSG_END:switch(X){case Vp1.cc.NL:this.drop=0,this.as=Z+1,this.state=Vp1.State.OP_START;break;default:continue}break;case Vp1.State.OP_PLUS:switch(X){case Vp1.cc.O:case Vp1.cc.o:this.state=Vp1.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_PLUS_O:switch(X){case Vp1.cc.K:case Vp1.cc.k:this.state=Vp1.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_PLUS_OK:switch(X){case Vp1.cc.NL:this.dispatcher.push({kind:Vp1.Kind.OK}),this.drop=0,this.state=Vp1.State.OP_START;break}break;case Vp1.State.OP_MINUS:switch(X){case Vp1.cc.E:case Vp1.cc.e:this.state=Vp1.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_MINUS_E:switch(X){case Vp1.cc.R:case Vp1.cc.r:this.state=Vp1.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_MINUS_ER:switch(X){case Vp1.cc.R:case Vp1.cc.r:this.state=Vp1.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_MINUS_ERR:switch(X){case Vp1.cc.SPACE:case Vp1.cc.TAB:this.state=Vp1.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_MINUS_ERR_SPC:switch(X){case Vp1.cc.SPACE:case Vp1.cc.TAB:continue;default:this.state=Vp1.State.MINUS_ERR_ARG,this.as=Z}break;case Vp1.State.MINUS_ERR_ARG:switch(X){case Vp1.cc.CR:this.drop=1;break;case Vp1.cc.NL:{let Q;if(this.argBuf)Q=this.argBuf.bytes(),this.argBuf=void 0;else Q=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:Vp1.Kind.ERR,data:Q}),this.drop=0,this.as=Z+1,this.state=Vp1.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(X))}break;case Vp1.State.OP_P:switch(X){case Vp1.cc.I:case Vp1.cc.i:this.state=Vp1.State.OP_PI;break;case Vp1.cc.O:case Vp1.cc.o:this.state=Vp1.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_PO:switch(X){case Vp1.cc.N:case Vp1.cc.n:this.state=Vp1.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_PON:switch(X){case Vp1.cc.G:case Vp1.cc.g:this.state=Vp1.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_PONG:switch(X){case Vp1.cc.NL:this.dispatcher.push({kind:Vp1.Kind.PONG}),this.drop=0,this.state=Vp1.State.OP_START;break}break;case Vp1.State.OP_PI:switch(X){case Vp1.cc.N:case Vp1.cc.n:this.state=Vp1.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_PIN:switch(X){case Vp1.cc.G:case Vp1.cc.g:this.state=Vp1.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_PING:switch(X){case Vp1.cc.NL:this.dispatcher.push({kind:Vp1.Kind.PING}),this.drop=0,this.state=Vp1.State.OP_START;break}break;case Vp1.State.OP_I:switch(X){case Vp1.cc.N:case Vp1.cc.n:this.state=Vp1.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_IN:switch(X){case Vp1.cc.F:case Vp1.cc.f:this.state=Vp1.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_INF:switch(X){case Vp1.cc.O:case Vp1.cc.o:this.state=Vp1.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_INFO:switch(X){case Vp1.cc.SPACE:case Vp1.cc.TAB:this.state=Vp1.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case Vp1.State.OP_INFO_SPC:switch(X){case Vp1.cc.SPACE:case Vp1.cc.TAB:continue;default:this.state=Vp1.State.INFO_ARG,this.as=Z}break;case Vp1.State.INFO_ARG:switch(X){case Vp1.cc.CR:this.drop=1;break;case Vp1.cc.NL:{let Q;if(this.argBuf)Q=this.argBuf.bytes(),this.argBuf=void 0;else Q=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:Vp1.Kind.INFO,data:Q}),this.drop=0,this.as=Z+1,this.state=Vp1.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;default:throw this.fail($.subarray(Z))}}if((this.state===Vp1.State.MSG_ARG||this.state===Vp1.State.MINUS_ERR_ARG||this.state===Vp1.State.INFO_ARG)&&!this.argBuf)this.argBuf=new Sd0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===Vp1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new Sd0.DenoBuffer($.subarray(this.as))}}cloneMsgArg(){let $=this.ma.subject.length,Z=this.ma.reply?this.ma.reply.length:0,X=new Uint8Array($+Z);if(X.set(this.ma.subject),this.ma.reply)X.set(this.ma.reply,$);if(this.argBuf=new Sd0.DenoBuffer(X),this.ma.subject=X.subarray(0,$),this.ma.reply)this.ma.reply=X.subarray($)}processMsgArgs($){if(this.hdr>=0)return this.processHeaderMsgArgs($);let Z=[],X=-1;for(let Q=0;Q<$.length;Q++)switch($[Q]){case Vp1.cc.SPACE:case Vp1.cc.TAB:case Vp1.cc.CR:case Vp1.cc.NL:if(X>=0)Z.push($.subarray(X,Q)),X=-1;break;default:if(X<0)X=Q}if(X>=0)Z.push($.subarray(X));switch(Z.length){case 3:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(Z[2],Gb);break;case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.size=this.protoParseInt(Z[3],Gb);break;default:throw this.fail($,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail($,"processMsgArgs Bad or Missing Size Error")}fail($,Z=""){if(!Z)Z=`parse error [${this.state}]`;else Z=`${Z} [${this.state}]`;return Error(`${Z}: ${Cd0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],X=-1;for(let Q=0;Q<$.length;Q++)switch($[Q]){case Vp1.cc.SPACE:case Vp1.cc.TAB:case Vp1.cc.CR:case Vp1.cc.NL:if(X>=0)Z.push($.subarray(X,Q)),X=-1;break;default:if(X<0)X=Q}if(X>=0)Z.push($.subarray(X));switch(Z.length){case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(Z[2],Gb),this.ma.size=this.protoParseInt(Z[3],Gb);break;case 5:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.hdr=this.protoParseInt(Z[3],Gb),this.ma.size=this.protoParseInt(Z[4],Gb);break;default:throw this.fail($,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail($,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt($,Z){if($.length===0||$.length>15)return-1;let X=0;for(let Q=0;Q<$.length;Q++){if($[Q]<Mp1||$[Q]>Zm6)return-1;X=X*10+($[Q]-Mp1)}return Z!==void 0&&X>Z?-1:X}}Vp1.Parser=kp1;Vp1.State={OP_START:0,OP_PLUS:1,OP_PLUS_O:2,OP_PLUS_OK:3,OP_MINUS:4,OP_MINUS_E:5,OP_MINUS_ER:6,OP_MINUS_ERR:7,OP_MINUS_ERR_SPC:8,MINUS_ERR_ARG:9,OP_M:10,OP_MS:11,OP_MSG:12,OP_MSG_SPC:13,MSG_ARG:14,MSG_PAYLOAD:15,MSG_END:16,OP_H:17,OP_P:18,OP_PI:19,OP_PIN:20,OP_PING:21,OP_PO:22,OP_PON:23,OP_PONG:24,OP_I:25,OP_IN:26,OP_INF:27,OP_INFO:28,OP_INFO_SPC:29,INFO_ARG:30};Vp1.cc={CR:13,E:69,e:101,F:70,f:102,G:71,g:103,H:72,h:104,I:73,i:105,K:75,k:107,M:77,m:109,MINUS:45,N:78,n:110,NL:10,O:79,o:111,P:80,p:112,PLUS:43,R:82,r:114,S:83,s:115,SPACE:32,TAB:9}});var N90=_((Cp1)=>{Object.defineProperty(Cp1,"__esModule",{value:!0});Cp1.MsgHdrsImpl=void 0;Cp1.canonicalMIMEHeaderKey=xd0;Cp1.headers=Ym6;var Sp1=uY(),wJ=Tw(),U90=cY();function xd0($){let U=!0,N=Array($.length);for(let F=0;F<$.length;F++){let w=$.charCodeAt(F);if(w===58||w<33||w>126)throw U90.InvalidArgumentError.format("header",`'${$[F]}' is not a valid character in a header name`);if(U&&97<=w&&w<=122)w-=32;else if(!U&&65<=w&&w<=90)w+=32;N[F]=w,U=w==45}return String.fromCharCode(...N)}function Ym6($=0,Z=""){if($===0&&Z!=="")throw U90.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw U90.InvalidArgumentError.format("description","is required");return new Jb($,Z)}var vd0="NATS/1.0";class Jb{_code;headers;_description;constructor($=0,Z=""){this._code=$,this._description=Z,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals($){if($&&this.headers.size===$.headers.size&&this._code===$._code){for(let[Z,X]of this.headers){let Q=$.values(Z);if(X.length!==Q.length)return!1;let Y=[...X].sort(),G=[...Q].sort();for(let J=0;J<Y.length;J++)if(Y[J]!==G[J])return!1}return!0}return!1}static decode($){let Z=new Jb,Q=Sp1.TD.decode($).split(`\r
1337
1337
  `),Y=Q[0];if(Y!==vd0){let G=Y.replace(vd0,"").trim();if(G.length>0){if(Z._code=parseInt(G,10),isNaN(Z._code))Z._code=0;let J=Z._code.toString();G=G.replace(J,""),Z._description=G.trim()}}if(Q.length>=1)Q.slice(1).map((G)=>{if(G){let J=G.indexOf(":");if(J>-1){let K=G.slice(0,J),W=G.slice(J+1).trim();Z.append(K,W)}}});return Z}toString(){if(this.headers.size===0&&this._code===0)return"";let $=vd0;if(this._code>0&&this._description!=="")$+=` ${this._code} ${this._description}`;for(let[Z,X]of this.headers)for(let Q=0;Q<X.length;Q++)$=`${$}\r
1338
1338
  ${Z}: ${X[Q]}`;return`${$}\r
@@ -2782,7 +2782,7 @@ Use this to continue with the user's request \u2014 do NOT call subtask again fo
2782
2782
  Task description:
2783
2783
  ${Z.description}
2784
2784
  `:"","How to work:",`- Call \`${W}\` with the task id below to find the pull request under review.`,J?`- The repository ${J.owner}/${J.name} is already cloned at your working directory and \`git\` and \`gh\` are authenticated \u2014 check the PR's branch out there to inspect / exercise the change.`:K?"- Your working directory is EMPTY. Call `mcp__studio__TASK_ADD_REPO` with the connectionId of the PR's repository FIRST; it clones the repository and waits for the checkout, and `git` and `gh` are authenticated once it returns.":"- Load the PR's repository to inspect / exercise the change.",`- End the run by calling \`${H}\` exactly once with the task id, reviewer "${X}", the reviewToken below, and your decision:`," - `approve` when it's good to ship. Include a short summary of what you verified."," - `request_changes` when something is wrong or missing. Include specific, actionable notes \u2014 the task goes back to the Super Agent with your notes.","- The reviewToken proves you are this reviewer \u2014 pass it through EXACTLY as given. Without it your approval won't count toward an automatic merge.",`- \`${H}\` is how the verdict is recorded. A review that ends without it is thrown away and the task stays stuck In Review, so call it even when your notes are short.`,"",`(task id: ${Z.id})`,`(reviewToken: ${Q})`].join(`
2785
- `);await Er($,Z,{runClass:"reviewer",title:`${vt[X]}: ${Z.title}`,prompt:N,temperature:0.3,...K?{harnessId:"claude-code",agent:{instructions:U,disallowedTools:Xl4[X]}}:{},...J?{repo:J}:{}}),await sZ($,{taskBoardItemId:Z.id,action:"review_requested",actorId:null,data:{reviewer:X}});let F=await $.storage.taskBoard.getById(Z.id,Y);if(F)u$(Y,F)}var fV8,Xl4,Ql4,Yl4=2;var H51=O(()=>{j7();EH();aZ();J51();W51();fV8=new Set(["completed","failed","expired"]),Xl4={qa:["Edit","NotebookEdit"],code_review:["Write","Edit","NotebookEdit"]},Ql4={qa:"You are the QA Agent. Your job is to confirm the task ACTUALLY SOLVED THE "+"PROBLEM \u2014 not to review code style. Exercise the feature/behavior the task "+"describes (use the PR's preview / dev server when available), check the acceptance criteria implied by the title and description, and look for regressions in the affected flow. Judge outcomes, not the diff.",code_review:"You are the Code Reviewer. Review the code changes for correctness, security, and quality. FIRST look for a review skill/command appropriate to this repository's stack (e.g. a `/review`, `code-review`, or `security-review` skill, or the repo's CONTRIBUTING/review guidelines) and use it. Read the diff critically and flag concrete issues with file/line references."}});function Hl4($){return $.filter((X)=>X.action==="merge_conflict_resolution").length>=bV8}async function oj0($,Z,X,Q){if(X.status!=="in_review")return!1;if(X.assigneeId!==J$)return!1;if(Q.conflict!==!0)return!1;let G=(await $.storage.organizationSettings.get(Z))?.flags??{};if(G.auto_merge!==!0)return!1;let J=aJ.filter((U)=>G[rB[U]]===!0),K=await $.storage.taskBoard.listActivity(X.id,Z);if(!fg(K,J,{verifiedOnly:!0}))return!1;if(Hl4(K))return console.warn(`[task-board] conflict auto-resolve cap (${bV8}) reached on task ${X.id} \u2014 leaving the PR for a human`),!1;let W=Q.pr,H=await $.storage.taskBoard.claimConflictResolution(X.id,Z,X.updatedBy);if(!H)return!1;await sZ($,{taskBoardItemId:X.id,action:"merge_conflict_resolution",actorId:null,data:{prNumber:W.number}}),u$(Z,H);try{await mN($,H,{pr:{number:W.number,url:W.url},resolveConflict:!0})}catch(U){throw await $.storage.taskBoard.update(H.id,Z,{status:"in_review"},"system").then((N)=>u$(Z,N)).catch((N)=>console.error("[task-board] conflict-resolution status revert failed",N)),U}return!0}var bV8=3;var U51=O(()=>{j7();EH();aZ();dO()});import{z as rj0}from"zod";function Ul4($){let Z=$ instanceof Error?$.message:String($);return/too many requests|rate limit|\b429\b/i.test(Z)}function gV8($){yV8.invalidate($)}async function O51($,Z,X,Q,Y,G){try{let J=await yV8.fetch({type:"tools/call",connectionId:Z,scope:{kind:"org"},params:{name:X,arguments:Q},fetchLive:()=>j9(async()=>{let K=await $.callTool({name:X,arguments:Q},void 0,{timeout:aj0});if(K&&typeof K==="object"&&K.isError)throw Error(K.content?.[0]?.text??`${X} returned isError`);return K},{maxAttempts:3,minTimeout:300,maxTimeout:3000,jitter:1,isRetriable:(K)=>!Ul4(K)}),onRevalidation:(K)=>G.push(K)});return sj0(J)}catch(J){let K=J instanceof kY?J.cause:J;return console.error(`[task-board] ${X} failed for ${Y}:`,K),null}}async function fh($,Z,X,Q){if(X){let J=await $.storage.connections.findById(X,Z);if(J&&J.status==="active")return J}let{items:Y}=await $.storage.connections.list(Z,{slug:"mcp-github"}),G=Y.filter((J)=>J.status==="active");if(Q){let J=G.find((K)=>{let W=i9(K);return W?.owner===Q.owner&&W?.repo===Q.name});if(J)return J}return G.find((J)=>i9(J)===null)??G[0]??null}function sj0($){if(!$||typeof $!=="object")return null;let Z=$;if(Z.isError)return null;if(Z.structuredContent&&typeof Z.structuredContent==="object"&&Object.keys(Z.structuredContent).length>0)return Z.structuredContent;let X=Z.content?.find((Q)=>Q.type==="text")?.text;if(!X)return null;try{return JSON.parse(X)}catch{return null}}function w51($){let Z;try{Z=new URL($).hostname.toLowerCase()}catch{return!1}return Z==="deco.site"||Z.endsWith(".decocdn.com")||Z.endsWith(".deco-cx.workers.dev")||Z.endsWith(".deco.site")||Z.endsWith(".vercel.app")||Z.endsWith(".preview.vtex.app")}function Nl4($){if(!$||!Array.isArray($.statuses))return null;let Z=$.statuses.map((X)=>X&&typeof X==="object"?X:null).filter((X)=>!!X&&typeof X.target_url==="string"&&w51(X.target_url));if(Z.length===0)return null;return Z.find((X)=>X.state==="success")?.target_url??Z[0].target_url}function Fl4($){let Z=Array.isArray($)?$:Array.isArray($?.comments)?$.comments:Array.isArray($?.items)?$.items:[],X=(Y)=>{let G=Y;return Date.parse(G?.updated_at)||Date.parse(G?.created_at)},Q=Z.map((Y,G)=>({c:Y,index:G})).sort((Y,G)=>{let J=X(Y.c),K=X(G.c);if(Number.isNaN(J)||Number.isNaN(K))return Y.index-G.index;return K-J}).map(({c:Y})=>Y);for(let Y of Q){let G=Y&&typeof Y.body==="string"?Y.body:"";if(!G)continue;let J=G.match(/href=['"]([^'"]+)['"][^>]*>\s*Branch Preview/i);if(J?.[1]&&w51(J[1]))return J[1];let K=(G.match(/https?:\/\/[^\s"'<>)\]]+/g)??[]).find((W)=>w51(W));if(K)return K}return null}function hV8($){if(!$)return null;if((typeof $.total_count==="number"?$.total_count:null)===0)return null;switch($.state){case"success":return"passing";case"failure":case"error":return"failing";case"pending":return"pending";default:return null}}function cV8($){let Z=Array.isArray($)?$:Array.isArray($?.check_runs)?$.check_runs:[];if(Z.length===0)return null;let X=!1,Q=!1;for(let Y of Z){if(!Y||typeof Y!=="object")continue;let{status:G,conclusion:J}=Y;if(G!=="completed")Q=!0;else if(typeof J==="string"&&uV8.has(J))X=!0}if(X)return"failing";if(Q)return"pending";return"passing"}function lV8($,Z){if($==="failing"||Z==="failing")return"failing";if($==="pending"||Z==="pending")return"pending";if($==="passing"||Z==="passing")return"passing";return null}function wl4($){let Z=Array.isArray($)?$:Array.isArray($?.check_runs)?$.check_runs:[],X=[];for(let Q of Z){if(!Q||typeof Q!=="object")continue;let Y=Q;X.push({id:typeof Y.id==="number"?Y.id:null,name:typeof Y.name==="string"?Y.name:"",status:typeof Y.status==="string"?Y.status:"completed",conclusion:typeof Y.conclusion==="string"?Y.conclusion:null,detailsUrl:typeof Y.html_url==="string"?Y.html_url:typeof Y.details_url==="string"?Y.details_url:null})}return X}function Bl4($){return $.status==="completed"&&$.conclusion!=null&&uV8.has($.conclusion)}async function Ol4($,Z,X,Q,Y){let J=(await O51($,Z,"GET_CHECK_RUN",{owner:X.repoOwner,repo:X.repoName,checkRunId:Q},`${B51(X)} check-run ${Q}`,Y))?.output,K=typeof J?.summary==="string"?J.summary:null,W=typeof J?.text==="string"?J.text:null;return K??W??null}async function dV8($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await _5(Q,$,!0),G=async(J)=>sj0(await Y.callTool({name:"pull_request_read",arguments:{method:J,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aj0}));try{let J=null;try{J=hV8(await G("get_status"))}catch{}try{J=lV8(J,cV8(await G("get_check_runs")))}catch{}return J}finally{await Y.close().catch(()=>{})}}function mV8($){if(!$)return null;if($.state!=="open")return!1;return typeof $.mergeable==="boolean"?!$.mergeable:null}async function iV8($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await _5(Q,$,!0);try{return mV8(sj0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aj0})))}catch{return null}finally{await Y.close().catch(()=>{})}}async function Ll4($,Z,X,Q){let Y=(N)=>O51($,Z,"pull_request_read",{method:N,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${B51(X)} (${N})`,Q),[G,J,K]=await Promise.all([Y("get_status"),Y("get_check_runs"),Y("get_comments")]),W=lV8(hV8(G),cV8(J)),H=Nl4(G)??Fl4(K),U=await Promise.all(wl4(J).map(async(N)=>({name:N.name,status:N.status,conclusion:N.conclusion,detailsUrl:N.detailsUrl,summary:Bl4(N)&&N.id!=null?await Ol4($,Z,X,N.id,Q):null})));return{checksStatus:W,checks:U,previewUrl:H}}async function D51($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return F51;let Y=await _5(Q,$,!0),G=[];try{let[J,K]=await Promise.all([O51(Y,Q.id,"pull_request_read",{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${B51(X)} (get)`,G),Ll4(Y,Q.id,X,G)]);if(!J)return F51;let W=J.state,H=W==="open";return{title:typeof J.title==="string"?J.title:null,body:typeof J.body==="string"?J.body:null,state:W==="closed"?"closed":H?"open":null,draft:typeof J.draft==="boolean"?J.draft:null,merged:typeof J.merged==="boolean"?J.merged:null,mergeable:H&&typeof J.mergeable==="boolean"?J.mergeable:null,checksStatus:H?K.checksStatus:null,checks:H?K.checks:[],previewUrl:H?K.previewUrl:null}}catch{return F51}finally{Promise.allSettled(G).then(()=>Y.close().catch(()=>{}))}}async function nV8($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await _5(Q,$,!0);try{let G=sj0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aj0}));if(!G||G.state!=="open")return null;let J=G.head?.ref;return typeof J==="string"&&J.length>0?J:null}catch{return null}finally{await Y.close().catch(()=>{})}}var aj0=8000,N51,yV8,B51=($)=>`${$.repoOwner}/${$.repoName}#${$.number}`,F51,uV8,L51=($)=>{let Z=$.find((X)=>X.state!=="closed"&&X.merged!==!0);return Z!=null&&Z.checksStatus!=="pending"&&Z.checksStatus!=="failing"},E51;var bh=O(()=>{t0();HN();U3();j7();N$();Et();KH();EH();aZ();H51();U51();N51={revalidateAfterMs:55000,maxStaleMs:1800000,maxValueBytes:524288},yV8=new gY0({"tools/call":N51,"resources/read":N51,"prompts/get":N51});F51={title:null,body:null,state:null,draft:null,merged:null,mergeable:null,checksStatus:null,checks:[],previewUrl:null};uV8=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);E51=t({name:"TASK_BOARD_ITEM_PRS_GET",description:"Get the GitHub pull requests linked to a task board item, each enriched with live state (title, open/closed, draft, merged) fetched from GitHub.",annotations:{title:"Get Task Board Item Pull Requests",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:rj0.object({taskBoardItemId:rj0.string()}),outputSchema:rj0.object({prs:rj0.array(cT8)}),handler:async({taskBoardItemId:$},Z)=>{W0(Z),await Z.access.check();let X=Z.organization?.id;if(!X)throw Error("Organization ID required (no active organization in context)");let Q=await Z.storage.taskBoard.getById($,X),Y=await Z.storage.taskBoard.listPrs($,X),G=await Promise.all(Y.map(async(W)=>{let H=await D51(Z,X,W);return{url:W.url,number:W.number,repoOwner:W.repoOwner,repoName:W.repoName,createdAt:W.createdAt,...H}})),J=G.find((W)=>W.state==="open"&&!W.merged);if(Q&&Q.status==="in_review"&&Q.assigneeId===J$&&L51(G))await tj0(Z,Q).catch((W)=>{console.error("[task-board] reviewer auto-handoff failed",W)});let K=J?mV8({state:J.state,mergeable:J.mergeable}):null;if(Q&&Q.status==="in_review"&&Q.assigneeId===J$&&J&&K===!0)await oj0(Z,X,Q,{pr:{number:J.number,url:J.url},conflict:!0}).catch((W)=>{console.error("[task-board] conflict auto-resolve failed",W)});if(G.some((W)=>W.merged))try{if(Q&&Q.status!=="done"){let W=await Z.storage.taskBoard.update($,X,{status:"done"},Q.updatedBy);await sZ(Z,{taskBoardItemId:$,action:"status_changed",actorId:null,data:{from:Q.status,to:"done"}}),u$(X,W)}}catch(W){console.error("[task-board] merge\u2192done reconcile failed",W)}return{prs:G}}})});async function yh($,Z){if(Z.assigneeId!==J$)return;await mN($,Z).catch((X)=>{if(X instanceof B3)throw X;console.error("[task-board] Super Agent enqueue failed",X)})}function Dl4($,Z){return["You've been assigned this task. Complete it.","","You are running AUTONOMOUSLY \u2014 no human is watching this run, so drive it "+"to completion on your own. Use `user_ask` ONLY for a genuine, unresolvable blocker a human must clear (a missing credential/secret, or "+"a decision so ambiguous you truly cannot proceed) \u2014 that should be rare. "+"Do not ask for confirmation of a reasonable choice; make it and move on.","",`Title: ${$.title}`,$.description?`
2785
+ `);await Er($,Z,{runClass:"reviewer",title:`${vt[X]}: ${Z.title}`,prompt:N,temperature:0.3,...K?{harnessId:"claude-code",agent:{instructions:U,disallowedTools:Xl4[X]}}:{},...J?{repo:J}:{}}),await sZ($,{taskBoardItemId:Z.id,action:"review_requested",actorId:null,data:{reviewer:X}});let F=await $.storage.taskBoard.getById(Z.id,Y);if(F)u$(Y,F)}var fV8,Xl4,Ql4,Yl4=2;var H51=O(()=>{j7();EH();aZ();J51();W51();fV8=new Set(["completed","failed","expired"]),Xl4={qa:["Edit","NotebookEdit"],code_review:["Write","Edit","NotebookEdit"]},Ql4={qa:"You are the QA Agent. Your job is to confirm the task ACTUALLY SOLVED THE "+"PROBLEM \u2014 not to review code style. Exercise the feature/behavior the task "+"describes (use the PR's preview / dev server when available), check the acceptance criteria implied by the title and description, and look for regressions in the affected flow. Judge outcomes, not the diff.",code_review:"You are the Code Reviewer. Review the code changes for correctness, security, and quality. FIRST look for a review skill/command appropriate to this repository's stack (e.g. a `/review`, `code-review`, or `security-review` skill, or the repo's CONTRIBUTING/review guidelines) and use it. Read the diff critically and flag concrete issues with file/line references."}});function Hl4($){return $.filter((X)=>X.action==="merge_conflict_resolution").length>=bV8}async function oj0($,Z,X,Q){if(X.status!=="in_review")return!1;if(X.assigneeId!==J$)return!1;if(Q.conflict!==!0)return!1;let G=(await $.storage.organizationSettings.get(Z))?.flags??{};if(G.auto_merge!==!0)return!1;let J=aJ.filter((U)=>G[rB[U]]===!0),K=await $.storage.taskBoard.listActivity(X.id,Z);if(!fg(K,J,{verifiedOnly:!0}))return!1;if(Hl4(K))return console.warn(`[task-board] conflict auto-resolve cap (${bV8}) reached on task ${X.id} \u2014 leaving the PR for a human`),!1;let W=Q.pr,H=await $.storage.taskBoard.claimConflictResolution(X.id,Z,X.updatedBy);if(!H)return!1;await sZ($,{taskBoardItemId:X.id,action:"merge_conflict_resolution",actorId:null,data:{prNumber:W.number}}),u$(Z,H);try{await mN($,H,{pr:{number:W.number,url:W.url},resolveConflict:!0})}catch(U){throw await $.storage.taskBoard.update(H.id,Z,{status:"in_review"},"system").then((N)=>u$(Z,N)).catch((N)=>console.error("[task-board] conflict-resolution status revert failed",N)),U}return!0}var bV8=3;var U51=O(()=>{j7();EH();aZ();dO()});import{z as rj0}from"zod";function Ul4($){let Z=$ instanceof Error?$.message:String($);return/too many requests|rate limit|\b429\b/i.test(Z)}function gV8($){yV8.invalidate($)}async function O51($,Z,X,Q,Y,G){try{let J=await yV8.fetch({type:"tools/call",connectionId:Z,scope:{kind:"org"},params:{name:X,arguments:Q},fetchLive:()=>j9(async()=>{let K=await $.callTool({name:X,arguments:Q},void 0,{timeout:aj0});if(K&&typeof K==="object"&&K.isError)throw Error(K.content?.[0]?.text??`${X} returned isError`);return K},{maxAttempts:3,minTimeout:300,maxTimeout:3000,jitter:1,isRetriable:(K)=>!Ul4(K)}),onRevalidation:(K)=>G.push(K)});return sj0(J)}catch(J){let K=J instanceof kY?J.cause:J;return console.error(`[task-board] ${X} failed for ${Y}:`,K),null}}async function fh($,Z,X,Q){if(X){let J=await $.storage.connections.findById(X,Z);if(J&&J.status==="active")return J}let{items:Y}=await $.storage.connections.list(Z,{slug:"mcp-github"}),G=Y.filter((J)=>J.status==="active");if(Q){let J=G.find((K)=>{let W=i9(K);return W?.owner===Q.owner&&W?.repo===Q.name});if(J)return J}return G.find((J)=>i9(J)===null)??null}function sj0($){if(!$||typeof $!=="object")return null;let Z=$;if(Z.isError)return null;if(Z.structuredContent&&typeof Z.structuredContent==="object"&&Object.keys(Z.structuredContent).length>0)return Z.structuredContent;let X=Z.content?.find((Q)=>Q.type==="text")?.text;if(!X)return null;try{return JSON.parse(X)}catch{return null}}function w51($){let Z;try{Z=new URL($).hostname.toLowerCase()}catch{return!1}return Z==="deco.site"||Z.endsWith(".decocdn.com")||Z.endsWith(".deco-cx.workers.dev")||Z.endsWith(".deco.site")||Z.endsWith(".vercel.app")||Z.endsWith(".preview.vtex.app")}function Nl4($){if(!$||!Array.isArray($.statuses))return null;let Z=$.statuses.map((X)=>X&&typeof X==="object"?X:null).filter((X)=>!!X&&typeof X.target_url==="string"&&w51(X.target_url));if(Z.length===0)return null;return Z.find((X)=>X.state==="success")?.target_url??Z[0].target_url}function Fl4($){let Z=Array.isArray($)?$:Array.isArray($?.comments)?$.comments:Array.isArray($?.items)?$.items:[],X=(Y)=>{let G=Y;return Date.parse(G?.updated_at)||Date.parse(G?.created_at)},Q=Z.map((Y,G)=>({c:Y,index:G})).sort((Y,G)=>{let J=X(Y.c),K=X(G.c);if(Number.isNaN(J)||Number.isNaN(K))return Y.index-G.index;return K-J}).map(({c:Y})=>Y);for(let Y of Q){let G=Y&&typeof Y.body==="string"?Y.body:"";if(!G)continue;let J=G.match(/href=['"]([^'"]+)['"][^>]*>\s*Branch Preview/i);if(J?.[1]&&w51(J[1]))return J[1];let K=(G.match(/https?:\/\/[^\s"'<>)\]]+/g)??[]).find((W)=>w51(W));if(K)return K}return null}function hV8($){if(!$)return null;if((typeof $.total_count==="number"?$.total_count:null)===0)return null;switch($.state){case"success":return"passing";case"failure":case"error":return"failing";case"pending":return"pending";default:return null}}function cV8($){let Z=Array.isArray($)?$:Array.isArray($?.check_runs)?$.check_runs:[];if(Z.length===0)return null;let X=!1,Q=!1;for(let Y of Z){if(!Y||typeof Y!=="object")continue;let{status:G,conclusion:J}=Y;if(G!=="completed")Q=!0;else if(typeof J==="string"&&uV8.has(J))X=!0}if(X)return"failing";if(Q)return"pending";return"passing"}function lV8($,Z){if($==="failing"||Z==="failing")return"failing";if($==="pending"||Z==="pending")return"pending";if($==="passing"||Z==="passing")return"passing";return null}function wl4($){let Z=Array.isArray($)?$:Array.isArray($?.check_runs)?$.check_runs:[],X=[];for(let Q of Z){if(!Q||typeof Q!=="object")continue;let Y=Q;X.push({id:typeof Y.id==="number"?Y.id:null,name:typeof Y.name==="string"?Y.name:"",status:typeof Y.status==="string"?Y.status:"completed",conclusion:typeof Y.conclusion==="string"?Y.conclusion:null,detailsUrl:typeof Y.html_url==="string"?Y.html_url:typeof Y.details_url==="string"?Y.details_url:null})}return X}function Bl4($){return $.status==="completed"&&$.conclusion!=null&&uV8.has($.conclusion)}async function Ol4($,Z,X,Q,Y){let J=(await O51($,Z,"GET_CHECK_RUN",{owner:X.repoOwner,repo:X.repoName,checkRunId:Q},`${B51(X)} check-run ${Q}`,Y))?.output,K=typeof J?.summary==="string"?J.summary:null,W=typeof J?.text==="string"?J.text:null;return K??W??null}async function dV8($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await _5(Q,$,!0),G=async(J)=>sj0(await Y.callTool({name:"pull_request_read",arguments:{method:J,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aj0}));try{let J=null;try{J=hV8(await G("get_status"))}catch{}try{J=lV8(J,cV8(await G("get_check_runs")))}catch{}return J}finally{await Y.close().catch(()=>{})}}function mV8($){if(!$)return null;if($.state!=="open")return!1;return typeof $.mergeable==="boolean"?!$.mergeable:null}async function iV8($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await _5(Q,$,!0);try{return mV8(sj0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aj0})))}catch{return null}finally{await Y.close().catch(()=>{})}}async function Ll4($,Z,X,Q){let Y=(N)=>O51($,Z,"pull_request_read",{method:N,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${B51(X)} (${N})`,Q),[G,J,K]=await Promise.all([Y("get_status"),Y("get_check_runs"),Y("get_comments")]),W=lV8(hV8(G),cV8(J)),H=Nl4(G)??Fl4(K),U=await Promise.all(wl4(J).map(async(N)=>({name:N.name,status:N.status,conclusion:N.conclusion,detailsUrl:N.detailsUrl,summary:Bl4(N)&&N.id!=null?await Ol4($,Z,X,N.id,Q):null})));return{checksStatus:W,checks:U,previewUrl:H}}async function D51($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return F51;let Y=await _5(Q,$,!0),G=[];try{let[J,K]=await Promise.all([O51(Y,Q.id,"pull_request_read",{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${B51(X)} (get)`,G),Ll4(Y,Q.id,X,G)]);if(!J)return F51;let W=J.state,H=W==="open";return{title:typeof J.title==="string"?J.title:null,body:typeof J.body==="string"?J.body:null,state:W==="closed"?"closed":H?"open":null,draft:typeof J.draft==="boolean"?J.draft:null,merged:typeof J.merged==="boolean"?J.merged:null,mergeable:H&&typeof J.mergeable==="boolean"?J.mergeable:null,checksStatus:H?K.checksStatus:null,checks:H?K.checks:[],previewUrl:H?K.previewUrl:null}}catch{return F51}finally{Promise.allSettled(G).then(()=>Y.close().catch(()=>{}))}}async function nV8($,Z,X){let Q=await fh($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await _5(Q,$,!0);try{let G=sj0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aj0}));if(!G||G.state!=="open")return null;let J=G.head?.ref;return typeof J==="string"&&J.length>0?J:null}catch{return null}finally{await Y.close().catch(()=>{})}}var aj0=8000,N51,yV8,B51=($)=>`${$.repoOwner}/${$.repoName}#${$.number}`,F51,uV8,L51=($)=>{let Z=$.find((X)=>X.state!=="closed"&&X.merged!==!0);return Z!=null&&Z.checksStatus!=="pending"&&Z.checksStatus!=="failing"},E51;var bh=O(()=>{t0();HN();U3();j7();N$();Et();KH();EH();aZ();H51();U51();N51={revalidateAfterMs:55000,maxStaleMs:1800000,maxValueBytes:524288},yV8=new gY0({"tools/call":N51,"resources/read":N51,"prompts/get":N51});F51={title:null,body:null,state:null,draft:null,merged:null,mergeable:null,checksStatus:null,checks:[],previewUrl:null};uV8=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);E51=t({name:"TASK_BOARD_ITEM_PRS_GET",description:"Get the GitHub pull requests linked to a task board item, each enriched with live state (title, open/closed, draft, merged) fetched from GitHub.",annotations:{title:"Get Task Board Item Pull Requests",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:rj0.object({taskBoardItemId:rj0.string()}),outputSchema:rj0.object({prs:rj0.array(cT8)}),handler:async({taskBoardItemId:$},Z)=>{W0(Z),await Z.access.check();let X=Z.organization?.id;if(!X)throw Error("Organization ID required (no active organization in context)");let Q=await Z.storage.taskBoard.getById($,X),Y=await Z.storage.taskBoard.listPrs($,X),G=await Promise.all(Y.map(async(W)=>{let H=await D51(Z,X,W);return{url:W.url,number:W.number,repoOwner:W.repoOwner,repoName:W.repoName,createdAt:W.createdAt,...H}})),J=G.find((W)=>W.state==="open"&&!W.merged);if(Q&&Q.status==="in_review"&&Q.assigneeId===J$&&L51(G))await tj0(Z,Q).catch((W)=>{console.error("[task-board] reviewer auto-handoff failed",W)});let K=J?mV8({state:J.state,mergeable:J.mergeable}):null;if(Q&&Q.status==="in_review"&&Q.assigneeId===J$&&J&&K===!0)await oj0(Z,X,Q,{pr:{number:J.number,url:J.url},conflict:!0}).catch((W)=>{console.error("[task-board] conflict auto-resolve failed",W)});if(G.some((W)=>W.merged))try{if(Q&&Q.status!=="done"){let W=await Z.storage.taskBoard.update($,X,{status:"done"},Q.updatedBy);await sZ(Z,{taskBoardItemId:$,action:"status_changed",actorId:null,data:{from:Q.status,to:"done"}}),u$(X,W)}}catch(W){console.error("[task-board] merge\u2192done reconcile failed",W)}return{prs:G}}})});async function yh($,Z){if(Z.assigneeId!==J$)return;await mN($,Z).catch((X)=>{if(X instanceof B3)throw X;console.error("[task-board] Super Agent enqueue failed",X)})}function Dl4($,Z){return["You've been assigned this task. Complete it.","","You are running AUTONOMOUSLY \u2014 no human is watching this run, so drive it "+"to completion on your own. Use `user_ask` ONLY for a genuine, unresolvable blocker a human must clear (a missing credential/secret, or "+"a decision so ambiguous you truly cannot proceed) \u2014 that should be rare. "+"Do not ask for confirmation of a reasonable choice; make it and move on.","",`Title: ${$.title}`,$.description?`
2786
2786
  Description:
2787
2787
  ${$.description}
2788
2788
  `:"",Z?.resolveConflict&&Z.pr?[`Your pull request #${Z.pr.number} (${Z.pr.url}) is approved but can't be merged \u2014 it has a MERGE CONFLICT with its base branch.`,`Load the repo, CHECK OUT that PR's branch (e.g. \`gh pr checkout ${Z.pr.number}\`), then merge (or rebase) the base branch into it and resolve the conflicts, and push to update the SAME pull request \u2014 do NOT open a new one or start a new branch. Resolve conflicts by preserving BOTH sides' intent; never blindly discard either side. Change only what resolving the conflict requires.`,""].join(`