decocms 4.214.1 → 4.214.2

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 (226) hide show
  1. package/dist/client/assets/{AlertCircle-C-Q5FvBC.js → AlertCircle-BsSIeM74.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CXO6rIpy.js → AreaChart-BNacPNiu.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DSnBCsVs.js → ArrowLeft-5tV722KZ.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Bf9Vxvyd.js → ArrowUp-BgPjCFzS.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-DXrusE9r.js → ArrowUpRight-CqQ-eR1a.js} +1 -1
  6. package/dist/client/assets/{Check-Bv1QLovy.js → Check-CjZQ1fxj.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-Dcle0kYd.js → CheckCircle-R1e_9MrF.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BzuKwYR-.js → ChevronDown-BgiuAled.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-BoBkNqAA.js → ChevronRight-WnXAR36y.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DsY1P-qW.js → ChevronUp-BVyfuiQ9.js} +1 -1
  11. package/dist/client/assets/{Copy01-rMlbfVLN.js → Copy01-BMNhrQHF.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-DQ-h7uSN.js → CpuChip01-OhJG8Y3N.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DEwSFIxs.js → CreditCard01-Borqkdnw.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-BDf9H1Z1.js → DotsVertical-BVYb7Txy.js} +1 -1
  15. package/dist/client/assets/{Eye-BGg9pENP.js → Eye-CkVo8evT.js} +1 -1
  16. package/dist/client/assets/{FilterLines-DG4s25qh.js → FilterLines-DNbgzwzz.js} +1 -1
  17. package/dist/client/assets/{Globe01-C6L81Hz8.js → Globe01-D53Bin3K.js} +1 -1
  18. package/dist/client/assets/{Globe04-CtTzBEnf.js → Globe04-m-3S2YX0.js} +1 -1
  19. package/dist/client/assets/{HardDrive-6JjtQUi3.js → HardDrive-DawsXPkP.js} +1 -1
  20. package/dist/client/assets/{Key01-l_Q5BfVr.js → Key01-BWy2c3hx.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-BWXVEPFQ.js → LayoutLeft-DGHgpCnw.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-C-4mB7F4.js → LinkExternal01-Cw7h07U3.js} +1 -1
  23. package/dist/client/assets/{LogOut01-BH2d3IaU.js → LogOut01-Be35CrII.js} +1 -1
  24. package/dist/client/assets/{Monitor01-WcmbOpaM.js → Monitor01-C-5ochHz.js} +1 -1
  25. package/dist/client/assets/{Palette-CA9GgQW8.js → Palette-Cw7P1Ej1.js} +1 -1
  26. package/dist/client/assets/{Play-D7Gil5g6.js → Play-BqgEZb63.js} +1 -1
  27. package/dist/client/assets/{Plus-CWzMrWmv.js → Plus-zyzoueDA.js} +1 -1
  28. package/dist/client/assets/{SearchLg-CP5T38T4.js → SearchLg-BVVfecLQ.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DgMMeVDw.js → SearchMd-B4KFnOWp.js} +1 -1
  30. package/dist/client/assets/{Settings02-DNthSMZc.js → Settings02-DdrYCa6h.js} +1 -1
  31. package/dist/client/assets/{Share07-CJ5L0mT9.js → Share07-Df66YqkV.js} +1 -1
  32. package/dist/client/assets/{Shield01-C5NHTKl8.js → Shield01-hWotU_hR.js} +1 -1
  33. package/dist/client/assets/{Star01-B7Htd5C4.js → Star01-Duq9V7lZ.js} +1 -1
  34. package/dist/client/assets/{Stars01-C9981xAX.js → Stars01-BWTtNtj3.js} +1 -1
  35. package/dist/client/assets/{Stars02-CWeiqPd-.js → Stars02-DE-LXLWj.js} +1 -1
  36. package/dist/client/assets/{Sun-JTbDw04X.js → Sun-CTyym6yL.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-DkmWUnZN.js → SwitchHorizontal01-DDWYXcv-.js} +1 -1
  38. package/dist/client/assets/{Tool01-C936Ee21.js → Tool01-CzJUPFsT.js} +1 -1
  39. package/dist/client/assets/{Tool02-DXitDFTe.js → Tool02-BiMVq5jR.js} +1 -1
  40. package/dist/client/assets/{Trash01-DFjipCuk.js → Trash01-BWuSaae_.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-B0j34Wzk.js → TrendUp01-DfCBpD87.js} +1 -1
  42. package/dist/client/assets/{Upload01-BfWE5rr_.js → Upload01-Cp4rvfN3.js} +1 -1
  43. package/dist/client/assets/{User01-DrUKeQHD.js → User01-BF-sTnEL.js} +1 -1
  44. package/dist/client/assets/{Users01-J0gbT70X.js → Users01-jx4IRVsm.js} +1 -1
  45. package/dist/client/assets/{Users03-DTAdJVzA.js → Users03-DD13tf3l.js} +1 -1
  46. package/dist/client/assets/{X-CjKmFgcH.js → X-CtnQpAls.js} +1 -1
  47. package/dist/client/assets/{XCircle-gu4fRLje.js → XCircle-BY8XrEjo.js} +1 -1
  48. package/dist/client/assets/{XClose-C4Me5xS9.js → XClose-Csg83d3Z.js} +1 -1
  49. package/dist/client/assets/{Zap-D2SD4cNE.js → Zap-B51LTWyw.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-D1cyLPJZ.js → ZapSquare-mft67z5P.js} +1 -1
  51. package/dist/client/assets/{access-gate-D-FbwLID.js → access-gate-Beb6RxwA.js} +1 -1
  52. package/dist/client/assets/{agent-icon-DrUrkhe6.js → agent-icon-C-jSQ5na.js} +1 -1
  53. package/dist/client/assets/{agents-list-C-Q2Luv2.js → agents-list-BgkVGNEi.js} +1 -1
  54. package/dist/client/assets/{ai-providers-DEU0NPoL.js → ai-providers-CznuYbup.js} +1 -1
  55. package/dist/client/assets/{alert-DFfPG0Z2.js → alert-61uvXXZJ.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-DWZuaK8I.js → alert-dialog-CYBdw70O.js} +1 -1
  57. package/dist/client/assets/{app-editor-CGMMgscK.js → app-editor-XfjitpNn.js} +1 -1
  58. package/dist/client/assets/{auth--tm9bCVC.js → auth-BDILfgAW.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-BufjjqmR.js → auth-catchall-CR9lnU02.js} +1 -1
  60. package/dist/client/assets/{auth-entry-cse0V0Ss.js → auth-entry-DmfxhCV3.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-Bg0G4CPN.js → auth-split-layout-iDn2Gy30.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-C0Exkm5e.js → authenticate-and-persist-oauth-DLbV2X4X.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-C2wf5bYW.js → automation-list-row-C-cuDujW.js} +1 -1
  64. package/dist/client/assets/{automation-runs-DAN4OwX1.js → automation-runs-BbyS7guw.js} +1 -1
  65. package/dist/client/assets/{automations-CLTQtKzY.js → automations-BzGPaxSn.js} +1 -1
  66. package/dist/client/assets/{avatar-CnzC-xyP.js → avatar-WYWIIsNL.js} +1 -1
  67. package/dist/client/assets/{badge-aLvlAbI8.js → badge-DzS1tYrV.js} +1 -1
  68. package/dist/client/assets/{billing-CHoSxKXW.js → billing-CI_8gSde.js} +1 -1
  69. package/dist/client/assets/{block-document-LtI-OnCR.js → block-document-CKfQ7EPL.js} +1 -1
  70. package/dist/client/assets/{brand-context-CQ8T72Ml.js → brand-context-DeJ-mwvN.js} +1 -1
  71. package/dist/client/assets/{buckets-CWI6D5s9.js → buckets-wwEFu59U.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-CxDUGuCW.js → bulk-category-panel-DPZyvqLd.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-Cq1UtDaY.js → capability-load-error-D7nPEFlh.js} +1 -1
  74. package/dist/client/assets/{card-Be95OgoJ.js → card-BCAkKfmH.js} +1 -1
  75. package/dist/client/assets/{cards-BGFq-dY2.js → cards-R88fjbQ6.js} +1 -1
  76. package/dist/client/assets/{category-editor-iXMX5WVK.js → category-editor-DLOPOiTi.js} +1 -1
  77. package/dist/client/assets/{chat-context-BsuvyX6k.js → chat-context-et5Hu8c1.js} +1 -1
  78. package/dist/client/assets/{checkbox-Baov0rWD.js → checkbox-BPEPZaS_.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-DvYMEjVA.js → cli-auth-success-B9kaRYT8.js} +1 -1
  80. package/dist/client/assets/{collection-detail-DyzZw-Ng.js → collection-detail-B8c7skni.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-CDaMQQGp.js → collection-display-button-BcTzQDu3.js} +1 -1
  82. package/dist/client/assets/{collection-search-BrfCWqVZ.js → collection-search-B9iKxOGU.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-DA1Sv76p.js → collection-table-wrapper-CAV9XCrc.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-Bxg4AqWv.js → collection-tabs-CwUfPCt1.js} +1 -1
  85. package/dist/client/assets/{command-wblXHsVH.js → command-BlU-LCp8.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-BIwNIM3K.js → commerce-onboarding-C8aZKgQL.js} +1 -1
  87. package/dist/client/assets/{connect-C1xfUDor.js → connect-ODIOL1Ni.js} +1 -1
  88. package/dist/client/assets/{connection-gkQW0H6w.js → connection-C1KBcsL0.js} +1 -1
  89. package/dist/client/assets/{connection-card-Bj44awTs.js → connection-card-DPtGNfyh.js} +1 -1
  90. package/dist/client/assets/{connection-detail-Cf4ZepQd.js → connection-detail-q2I29VFe.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-D8eGeLMF.js → connection-form-helpers-CLihksRG.js} +1 -1
  92. package/dist/client/assets/{connections-DeMRC-16.js → connections-D4MbUwYz.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-5C4bdI3H.js → decopilot-sse-pool-BpR7ZbbQ.js} +1 -1
  94. package/dist/client/assets/{dialog-B9q3iv3g.js → dialog-Ck75PYu2.js} +1 -1
  95. package/dist/client/assets/{domain-settings-B-nMydaQ.js → domain-settings-D0y0Vl_M.js} +1 -1
  96. package/dist/client/assets/{drawer-B3Ox1_lQ.js → drawer-D3gyLNyG.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-alyBkCa0.js → dropdown-menu-BK8UM22e.js} +1 -1
  98. package/dist/client/assets/{empty-state-D-z5hxuF.js → empty-state-DcYnayz2.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-DJoabmII.js → extract-connection-data-j12skE4h.js} +1 -1
  100. package/dist/client/assets/{file-explorer-BUGn6Hw-.js → file-explorer-JCg7NEll.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-Cds3zG3Y.js → file-type-icon-u7eaq5io.js} +1 -1
  102. package/dist/client/assets/{form-CSnrn2N6.js → form-CMzKe4VI.js} +1 -1
  103. package/dist/client/assets/{general-LqWRk_6p.js → general-5d2s9ysV.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-DdBirXEe.js → github-repo-picker-CJYjCCfq.js} +1 -1
  105. package/dist/client/assets/{hooks-Bdfhd1nY.js → hooks-BMseDKuX.js} +1 -1
  106. package/dist/client/assets/{index-Cw6X3dkt.js → index-C02864TA.js} +3 -3
  107. package/dist/client/assets/{index-CtjCHirP.js → index-C15X56K3.js} +1 -1
  108. package/dist/client/assets/{index-BDWaS3wJ.js → index-C3-_lGCM.js} +1 -1
  109. package/dist/client/assets/{index-CUnvt7Qz.js → index-CBZgbrxw.js} +1 -1
  110. package/dist/client/assets/{index-DpO2M7aV.js → index-CSrynco3.js} +1 -1
  111. package/dist/client/assets/{index-B2rHtP5f.js → index-CXUh9IAc.js} +5 -5
  112. package/dist/client/assets/{index-UInDjVLE.js → index-DVEW-7dp.js} +1 -1
  113. package/dist/client/assets/{index-DqsbKnXe.js → index-DWtPjOIc.js} +1 -1
  114. package/dist/client/assets/{index-DUOxnAEk.js → index-DsJmX5jt.js} +1 -1
  115. package/dist/client/assets/{index-CQQHMee7.js → index-V2hAdu9H.js} +1 -1
  116. package/dist/client/assets/{index-redirect-5vwH_yNL.js → index-redirect-8uK5P7k4.js} +1 -1
  117. package/dist/client/assets/{input-BMI7sy0P.js → input--o85lWXP.js} +1 -1
  118. package/dist/client/assets/{integration-icon-E1ocII3D.js → integration-icon-CYv0-4bb.js} +1 -1
  119. package/dist/client/assets/{invite-member-dialog-Rj-Tj1zK.js → invite-member-dialog-9vlfPthH.js} +1 -1
  120. package/dist/client/assets/{label-DKyumRgF.js → label-BvYguadN.js} +1 -1
  121. package/dist/client/assets/{layout-CjXju09r.js → layout-BeFtajlM.js} +1 -1
  122. package/dist/client/assets/{login-C59J5QJR.js → login-DF5ITzDd.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-DGynsxkq.js → mcp-oauth-DpxNaSV2.js} +1 -1
  124. package/dist/client/assets/{members-flvExcuF.js → members-BUxAOqqu.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-NHE1hAhj.js → monaco-editor-D8rt-Qj7.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BRPn86IA.js → monitoring-stats-row-BvkL2lpu.js} +1 -1
  127. package/dist/client/assets/{multi-select-CIbBKc4q.js → multi-select-Dt6IxzBk.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-C_kI3u0-.js → oauth-callback-ai-provider-BR1fgxU0.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-BYbE8-3P.js → oauth-callback-yBoF8Lj6.js} +1 -1
  130. package/dist/client/assets/{onboarding-zNQh391l.js → onboarding-CzosdS4K.js} +1 -1
  131. package/dist/client/assets/{org-layout-IiyY6ta2.js → org-layout-CWB-qSbW.js} +1 -1
  132. package/dist/client/assets/{organization-choice-Bi4DpjuI.js → organization-choice-CnlE-3mm.js} +1 -1
  133. package/dist/client/assets/{orgs-DJhOIO2X.js → orgs-w7Tc77GA.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-DyDsIl2Q.js → page-seo-form-DGUAYihy.js} +1 -1
  135. package/dist/client/assets/{popover-m6RPBuGe.js → popover-D7_r7LD9.js} +1 -1
  136. package/dist/client/assets/{post-editor-C0_Jki_E.js → post-editor-CwE5YNJ-.js} +1 -1
  137. package/dist/client/assets/{primitives-DNu3pUMl.js → primitives-CTU8HbNQ.js} +1 -1
  138. package/dist/client/assets/{profile-BWw6Sd_f.js → profile-CwrR0s_o.js} +1 -1
  139. package/dist/client/assets/{project-app-view-DJV_OLLe.js → project-app-view-jzz32HtP.js} +1 -1
  140. package/dist/client/assets/record-editor-COHj7xyr.js +1 -0
  141. package/dist/client/assets/redirect-editor-DTM9W4rQ.js +1 -0
  142. package/dist/client/assets/registry-C4fRWMXj.js +2 -0
  143. package/dist/client/assets/{registry-layout-Cidvga7O.js → registry-layout-D9jsnDAn.js} +1 -1
  144. package/dist/client/assets/{reports-Ch82XuVg.js → reports-FxPq8ybF.js} +1 -1
  145. package/dist/client/assets/{require-capability-DsdnQdRJ.js → require-capability-D69UcUMk.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-Bdan642o.js → required-auth-layout-BJSE9ZHz.js} +1 -1
  147. package/dist/client/assets/{reset-password-YRS01L7H.js → reset-password-DlPAbZsB.js} +1 -1
  148. package/dist/client/assets/{roles-C13zxsqD.js → roles-kTA-6bE0.js} +1 -1
  149. package/dist/client/assets/{search-input-BY5NcAG5.js → search-input-D2UVK1hB.js} +1 -1
  150. package/dist/client/assets/{secrets-BRCqBJzn.js → secrets-C4gmqkn3.js} +1 -1
  151. package/dist/client/assets/{sections-editor-986DPDzX.js → sections-editor-B-xzConU.js} +1 -1
  152. package/dist/client/assets/{select-C9xcbH-E.js → select-D_LaA7Zt.js} +1 -1
  153. package/dist/client/assets/{select-model-BjjS3EDC.js → select-model-Bpzda5LR.js} +1 -1
  154. package/dist/client/assets/{self-tool-result-WknO6REq.js → self-tool-result-DGwlA63Y.js} +1 -1
  155. package/dist/client/assets/{seo-editor-Y0O17g58.js → seo-editor-DLWz2YVI.js} +1 -1
  156. package/dist/client/assets/{settings-layout-BjbFkqZs.js → settings-layout-DBGcSOzp.js} +1 -1
  157. package/dist/client/assets/{settings-section-BHgAovn_.js → settings-section-D990Bbsb.js} +1 -1
  158. package/dist/client/assets/{shell-controls-DXpoa89_.js → shell-controls-BEIYOUWo.js} +1 -1
  159. package/dist/client/assets/{shell-layout-DZixRapy.js → shell-layout-D8weoRRD.js} +1 -1
  160. package/dist/client/assets/{sidebar-CyFPwMhC.js → sidebar-C0kOAs4D.js} +1 -1
  161. package/dist/client/assets/{skeleton-DJb3aaGz.js → skeleton-C2Oc9Dkb.js} +1 -1
  162. package/dist/client/assets/{spinner-DVcg_-Cv.js → spinner-Ssg6962s.js} +1 -1
  163. package/dist/client/assets/{sso-C1JCEZ87.js → sso-ZqmHeFbw.js} +1 -1
  164. package/dist/client/assets/{store-ClPWmhiD.js → store-4ov4zSi2.js} +1 -1
  165. package/dist/client/assets/store-registry-CkOULGfX.js +2 -0
  166. package/dist/client/assets/{studio-tools-CP3xCItZ.js → studio-tools-BYUzmUea.js} +1 -1
  167. package/dist/client/assets/{switch-CZJ7HE3w.js → switch-BFIiAvo3.js} +1 -1
  168. package/dist/client/assets/{synced-repos-BAVqiXJx.js → synced-repos-D8dOOxmd.js} +1 -1
  169. package/dist/client/assets/{tab-id-U8x84WMI.js → tab-id-BYacfgvY.js} +1 -1
  170. package/dist/client/assets/{table-BIEFFUNo.js → table-D9C5SZFi.js} +1 -1
  171. package/dist/client/assets/{tabs-PJiAduqL.js → tabs-P-XNIpgH.js} +1 -1
  172. package/dist/client/assets/{textarea-H0WykNWG.js → textarea-klKop_2H.js} +1 -1
  173. package/dist/client/assets/{toggle-group-RM1nES4o.js → toggle-group-BQJ8FjDB.js} +1 -1
  174. package/dist/client/assets/{toolbar-BQaiABV_.js → toolbar-yY1Yl8m5.js} +1 -1
  175. package/dist/client/assets/{tooltip-DXelSitz.js → tooltip-CVO3N7-N.js} +1 -1
  176. package/dist/client/assets/{track-CY5ZMl6H.js → track-grIApihe.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-EuhLPffl.js → use-ai-providers-xqrjYAUs.js} +1 -1
  178. package/dist/client/assets/{use-automations-CZEATS3Z.js → use-automations-DYNa7hMo.js} +1 -1
  179. package/dist/client/assets/{use-autosave-DFCBrWPo.js → use-autosave-B54cDZBf.js} +1 -1
  180. package/dist/client/assets/{use-capability-BykgYm9c.js → use-capability-BuDfivDO.js} +1 -1
  181. package/dist/client/assets/{use-clock-tick-VVMnnBbl.js → use-clock-tick-ChNqYpSq.js} +1 -1
  182. package/dist/client/assets/{use-connection-JK88cNLE.js → use-connection-BeuQWv43.js} +1 -1
  183. package/dist/client/assets/{use-copy-DaioDYGx.js → use-copy-Cv4rHVI1.js} +1 -1
  184. package/dist/client/assets/{use-create-virtual-mcp-91kxbBVu.js → use-create-virtual-mcp-CqV7j4fR.js} +1 -1
  185. package/dist/client/assets/{use-debounced-autosave-C8dmZjR6.js → use-debounced-autosave-X1RPSwft.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-CQ9n5OvI.js → use-debounced-value-InAeuCgK.js} +1 -1
  187. package/dist/client/assets/{use-deco-credits-gi_MymzL.js → use-deco-credits-DhLTEwNV.js} +1 -1
  188. package/dist/client/assets/{use-decopilot-events-Cxs1YWP7.js → use-decopilot-events-DYnCHFkr.js} +1 -1
  189. package/dist/client/assets/{use-delete-connection-DRJJFc88.js → use-delete-connection-BUalfdU0.js} +1 -1
  190. package/dist/client/assets/{use-deployment-admin-Om2ltZrc.js → use-deployment-admin-q-0naChL.js} +1 -1
  191. package/dist/client/assets/{use-file-configs-852wnDwu.js → use-file-configs-DLsWgjeK.js} +1 -1
  192. package/dist/client/assets/{use-infinite-scroll-C0GAtyD2.js → use-infinite-scroll-B8QM__1P.js} +1 -1
  193. package/dist/client/assets/{use-join-requests-Dc1eJnuw.js → use-join-requests-CRsKhbk9.js} +1 -1
  194. package/dist/client/assets/{use-mcp-client-D4LZPG6h.js → use-mcp-client-C--hxpN_.js} +1 -1
  195. package/dist/client/assets/{use-mcp-tools-C9HhUXbr.js → use-mcp-tools-CzWP_ziY.js} +1 -1
  196. package/dist/client/assets/{use-members-CTwpCvCb.js → use-members-DQKDTqpi.js} +1 -1
  197. package/dist/client/assets/{use-mobile-D2z4Y_ya.js → use-mobile-BXxNbAJx.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-BBhM0Vmr.js → use-navigate-to-agent-DhMdFxy6.js} +1 -1
  199. package/dist/client/assets/{use-open-billing-url-CXQZwREN.js → use-open-billing-url-C9cff-wF.js} +1 -1
  200. package/dist/client/assets/{use-org-auth-client-CGBqXXoZ.js → use-org-auth-client-C_hVO9yn.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-D6LJVU9o.js → use-org-sso-KaVeKFzK.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-wah2ZKGd.js → use-organization-roles-CIxzsW9q.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-DYKvJrFn.js → use-organization-settings-D3XeRHm9.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-CT74HqKu.js → use-registry-connections-cERWxPbr.js} +1 -1
  205. package/dist/client/assets/{use-secrets-DqYa04tO.js → use-secrets-BP_VVQGj.js} +1 -1
  206. package/dist/client/assets/{use-section-preview-base-BWMLBuql.js → use-section-preview-base-uvYPvyEv.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-D8s7dVjj.js → use-status-sounds-C8Z8Qj8h.js} +1 -1
  208. package/dist/client/assets/{use-tags-D6plArQy.js → use-tags-CHtfB34Z.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-Cx1z2NzD.js → use-view-mode-BCMGKP8x.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-Bwm6g-Vg.js → use-virtual-mcp-DZ9v19jI.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-ByMZwOd9.js +1 -0
  212. package/dist/client/assets/{useRouterState-B1BIGlgL.js → useRouterState-c_iapPPx.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-Dt7mX6sE.js +1 -0
  214. package/dist/client/assets/{users-CHMij7Em.js → users-BsKC_Zoi.js} +1 -1
  215. package/dist/client/assets/{variant-calendar-B7YFB8lh.js → variant-calendar-hjd11wgk.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-CekKDEJh.js → view-mode-toggle-kSjusEu0.js} +1 -1
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +2 -2
  219. package/dist/server/server.js +2 -2
  220. package/package.json +1 -1
  221. package/dist/client/assets/record-editor-BAyPxO0m.js +0 -1
  222. package/dist/client/assets/redirect-editor-D-7AVgII.js +0 -1
  223. package/dist/client/assets/registry-BTaUnI73.js +0 -2
  224. package/dist/client/assets/store-registry-B148kuy_.js +0 -2
  225. package/dist/client/assets/useInfiniteQuery-D4yzT25a.js +0 -1
  226. package/dist/client/assets/useSuspenseInfiniteQuery-DBMaGUmM.js +0 -1
@@ -1332,7 +1332,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var Rd1=O(()=>{nx()});f
1332
1332
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await jb`
1333
1333
  DELETE FROM kysely_migration WHERE name = ${X}
1334
1334
  `.execute($)}}async function lp1($){await vm6($),await xm6($);let Z=new up1({db:$,provider:{getMigrations:()=>Promise.resolve(Hm0)}}),{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 fm6($){let{keepOpen:Z=!1,database:X,skipBetterAuth:Q=!1}=$??{},Y="skipped";if(!Q&&!X)Y=await vu0();let G=X??N6(),J=async()=>{if(!Z&&!X)await jw(G).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await lp1(G.db);return await J(),{betterAuth:Y,kysely:K}}catch(K){throw await J(),K}}async function bm6(){let $=N6(),Z=new up1({db:$.db,provider:{getMigrations:()=>Promise.resolve(Hm0)}}),{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 mp1=O(()=>{hp1();xu0();$X()});async function b90($){let Z={...process.env},X=k10($,Z);console.log(YB1(X.settings.encryptionKey));let Q=X.settings.betterAuthSecret||(X.settings.localMode?Zi1(X.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (n50(),i50)),{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(() => (xu0(),Qi1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => ($X(),zm1)),{migrateToLatest:U}=await Promise.resolve().then(() => (mp1(),dp1)),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 Id1(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 Um0=O(()=>{nx();Xi1();k8()});var pp1={};B0(pp1,{updateService:()=>QE,subscribeCliState:()=>wm0,setTuiConsoleIntercepted:()=>y90,setServerUrl:()=>$i,setMigrationsDone:()=>em,setDevMode:()=>hm6,resetCliStateForTests:()=>ym6,isTuiConsoleIntercepted:()=>g90,getCliState:()=>Fm0,addLogEntry:()=>Iw});function ip1(){return{services:[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}],migrationsStatus:"pending",serverUrl:null,logs:[]}}function ym6(){fQ=ip1()}function gm6(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function sm(){for(let $ of Nm0)$()}function Fm0(){return fQ}function wm0($){return Nm0.add($),()=>Nm0.delete($)}function QE($){fQ={...fQ,services:fQ.services.map((Z)=>Z.name===$.name?$:Z)},sm()}function em(){fQ={...fQ,migrationsStatus:"done"},sm()}function $i($){fQ={...fQ,serverUrl:$},sm()}function Iw($){let Z=[...fQ.logs,$];fQ={...fQ,logs:Z.length>500?Z.slice(-500):Z},sm()}function hm6(){fQ={...fQ,services:[...gm6(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},sm()}function y90($){np1=$}function g90(){return np1}var fQ,Nm0,np1=!1;var YE=O(()=>{fQ=ip1();Nm0=new Set});import{createServer as tp1}from"net";function um6($){return new Promise((Z)=>{let X=tp1();X.once("error",()=>Z(!1)),X.listen($,"0.0.0.0",()=>{X.close(()=>Z(!0))})})}async function Zi($){if(await um6($))return $;let Z=await new Promise((X,Q)=>{let Y=tp1();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 Bm0=()=>{};function Xi($){return $.replace(/\x1b\[[0-9;]*m/g,"")}var Om0={};B0(Om0,{startDevServer:()=>lm6});import{join as cm6}from"path";function op1($){let Z=$.getReader(),X=new TextDecoder,Q="";function Y(){let G=Q.split(`
1335
- `);Q=G.pop()??"";for(let J of G){let K=Xi(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;Iw({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=Xi(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)Iw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function lm6($){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 Zi(Number(Y)+1):await Zi(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await b90({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)QE({name:L.name,status:"ready",port:L.port});em();let U=cm6(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)op1(F.stdout),op1(F.stderr);$i(G),QE({name:"Vite",status:"ready",port:Number(Y)}),QE({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(() => (n50(),i50));await D(K.dataDir)}};return process.on("SIGINT",()=>B("SIGINT")),process.on("SIGTERM",()=>B("SIGTERM")),{port:Number(Y),process:F}}var Lm0=O(()=>{Um0();YE();Bm0()});var h90;var Dm0=O(()=>{h90={name:"decocms",version:"4.214.1",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 mm6,Text as rp1}from"ink";import{jsx as im6,jsxs as ap1}from"react/jsx-runtime";function sp1({version:$}){return ap1(mm6,{flexDirection:"column",marginTop:1,children:[w90.map((Z,X)=>im6(rp1,{color:B90[X],children:Z},X)),ap1(rp1,{dimColor:!0,children:[" v",$]})]})}var ep1=O(()=>{cm()});import{Box as GE,Text as qw}from"ink";import{Spinner as nm6}from"@inkjs/ui";import{jsx as nY,jsxs as Pb}from"react/jsx-runtime";function $t1({status:$}){if($==="pending")return nY(nm6,{label:""});return nY(qw,{color:"green",children:"\u2713"})}function pm6($){return`${$.name}: ${$.port||"...."}`}function Zt1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return Pb(GE,{flexDirection:"column",paddingBottom:1,children:[nY(sp1,{version:h90.version}),nY(GE,{marginBottom:1,children:nY(qw,{dimColor:!0,children:"\u2500".repeat(80)})}),nY(GE,{children:Pb(qw,{dimColor:!0,children:["Home: ",X]})}),Pb(GE,{gap:2,children:[$.map((Y)=>Pb(GE,{gap:1,children:[nY(qw,{children:pm6(Y)}),nY($t1,{status:Y.status})]},Y.name)),Pb(GE,{gap:1,children:[nY(qw,{children:"Migrations"}),nY($t1,{status:Z})]})]}),nY(GE,{children:Q?Pb(qw,{children:["Open in browser: ",nY(qw,{color:"cyan",children:Q})]}):nY(qw,{dimColor:!0,children:"Starting..."})})]})}var Xt1=O(()=>{Dm0();ep1()});import{Box as tm6,Text as Qi}from"ink";import{jsx as Em0,jsxs as zm0}from"react/jsx-runtime";function om6($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function Qt1({logs:$}){return Em0(tm6,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return Em0(Qi,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return zm0(Qi,{children:[zm0(Qi,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Em0(Qi,{color:om6(Z.status),children:Z.status}),zm0(Qi,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var Yt1=()=>{};var jm0={};B0(jm0,{App:()=>sm6});import{Box as rm6}from"ink";import{useSyncExternalStore as am6}from"react";import{jsx as Gt1,jsxs as em6}from"react/jsx-runtime";function sm6({home:$}){let Z=am6(wm0,Fm0);return em6(rm6,{flexDirection:"column",children:[Gt1(Zt1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Gt1(Qt1,{logs:Z.logs})]})}var Pm0=O(()=>{Xt1();Yt1();YE()});var AJ="thread-gate",yU="decopilot-hosted-harness",Z3="automations",Mw="background-tools",JE="task-board-github-reads";var Jt1="7";function Kt1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Jt1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var Wt1=()=>{};function $i6(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Am0($,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 Ht1(){let $=$i6();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Am0($,"--cpu-prof-dir")??process.cwd(),name:Am0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Am0($,"--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 Ut1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=eD();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(()=>{}),u90=setInterval(()=>void Z().catch(()=>{}),$),u90.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(u90)clearInterval(u90)}}var u90;var Nt1=()=>{};import*as Zi6 from"bun:jsc";function Ft1(){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{Xi6()}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=Qi6()?.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 Xi6,Qi6;var wt1=O(()=>{({startSamplingProfiler:Xi6,samplingProfilerStackTraces:Qi6}=Zi6)});function Bt1(){Ht1();let $=[Ut1(),Nm1(),Ft1()];return()=>{for(let Z of $)Z()}}var Ot1=O(()=>{Tu0();Nt1();wt1()});var KE=_((Lt1)=>{Object.defineProperty(Lt1,"__esModule",{value:!0});Lt1.RepublishHeaders=Lt1.DirectMsgHeaders=Lt1.JsHeaders=Lt1.AdvisoryKind=void 0;Lt1.isOrderedPushConsumerOptions=Yi6;Lt1.isPullConsumer=Gi6;Lt1.isPushConsumer=Ji6;Lt1.isBoundPushConsumerOptions=Ki6;function Yi6($){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 Gi6($){return $.isPullConsumer()}function Ji6($){return $.isPushConsumer()}function Ki6($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Lt1.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"};Lt1.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"};Lt1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Lt1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var pY=_((Et1)=>{Object.defineProperty(Et1,"__esModule",{value:!0});Et1.TD=Et1.TE=Et1.Empty=void 0;Et1.encode=Li6;Et1.decode=Di6;Et1.Empty=new Uint8Array(0);Et1.TE=new TextEncoder;Et1.TD=new TextDecoder;function Oi6(...$){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 Li6(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(Et1.TE.encode($[X]));if(Z.length===0)return Et1.Empty;if(Z.length===1)return Z[0];return Oi6(...Z)}function Di6($){if(!$||$.length===0)return"";return Et1.TD.decode($)}});var tY=_((Pt1)=>{Object.defineProperty(Pt1,"__esModule",{value:!0});Pt1.errors=Pt1.PermissionViolationError=Pt1.NoRespondersError=Pt1.TimeoutError=Pt1.RequestError=Pt1.ProtocolError=Pt1.ConnectionError=Pt1.DrainingConnectionError=Pt1.ClosedConnectionError=Pt1.AuthorizationError=Pt1.UserAuthenticationExpiredError=Pt1.InvalidOperationError=Pt1.InvalidArgumentError=Pt1.InvalidSubjectError=void 0;class Rm0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Pt1.InvalidSubjectError=Rm0;class c90 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 c90(`${$} ${Z}`,X)}}Pt1.InvalidArgumentError=c90;class Im0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Pt1.InvalidOperationError=Im0;class l90 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new l90($);return null}}Pt1.UserAuthenticationExpiredError=l90;class d90 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 d90($);return null}}Pt1.AuthorizationError=d90;class qm0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Pt1.ClosedConnectionError=qm0;class Mm0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Pt1.DrainingConnectionError=Mm0;class Vm0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Pt1.ConnectionError=Vm0;class km0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Pt1.ProtocolError=km0;class Sm0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof m90}}Pt1.RequestError=Sm0;class Cm0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Pt1.TimeoutError=Cm0;class m90 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Pt1.NoRespondersError=m90;class i90 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 i90($,X,Q,Y)}}Pt1.PermissionViolationError=i90;Pt1.errors={AuthorizationError:d90,ClosedConnectionError:qm0,ConnectionError:Vm0,DrainingConnectionError:Mm0,InvalidArgumentError:c90,InvalidOperationError:Im0,InvalidSubjectError:Rm0,NoRespondersError:m90,PermissionViolationError:i90,ProtocolError:km0,RequestError:Sm0,TimeoutError:Cm0,UserAuthenticationExpiredError:l90}});var TJ=_((qt1)=>{Object.defineProperty(qt1,"__esModule",{value:!0});qt1.SimpleMutex=qt1.Perf=void 0;qt1.extend=xi6;qt1.render=fi6;qt1.timeout=bi6;qt1.delay=yi6;qt1.deadline=gi6;qt1.deferred=vm0;qt1.debugDeferred=hi6;qt1.shuffle=ui6;qt1.collect=ci6;qt1.jitter=It1;qt1.backoff=li6;qt1.nanos=di6;qt1.millis=mi6;qt1.randomToken=pi6;var vi6=pY(),_m0=tY();function xi6($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function fi6($){return vi6.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function bi6($,Z=!0){let X=Z?new _m0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new _m0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function yi6($=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 gi6($,Z=1000){let X=vm0(),Q=setTimeout(()=>{X.reject(new _m0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function vm0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function hi6(){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 ui6($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function ci6($){let Z=[];for await(let X of $)Z.push(X);return Z}class Tt1{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})}),$}}qt1.Perf=Tt1;class Rt1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=vm0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}qt1.SimpleMutex=Rt1;function It1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function li6($=[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 It1(X>Z?$[Z]:$[X])}}}function di6($){return $*1e6}function mi6($){return Math.floor($/1e6)}var ii6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",gU=new Uint8Array(62);for(let $=0;$<62;$++)gU[$]=ii6.charCodeAt($);var ni6=218340105584896;function pi6(){let $=Math.floor(Math.random()*ni6),Z=$%62,X=gU[Z];$=($-Z)/62,Z=$%62;let Q=gU[Z];$=($-Z)/62,Z=$%62;let Y=gU[Z];$=($-Z)/62,Z=$%62;let G=gU[Z];$=($-Z)/62,Z=$%62;let J=gU[Z];$=($-Z)/62,Z=$%62;let K=gU[Z];$=($-Z)/62,Z=$%62;let W=gU[Z];$=($-Z)/62;let H=gU[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var xt1=_((_t1)=>{Object.defineProperty(_t1,"__esModule",{value:!0});_t1.nuid=_t1.NuidImpl=void 0;var Hn6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Vw=62,p90=12,St1=10,Vt1=33,Un6=333,kt1=p90+St1,fm0=new Uint8Array(Vw);for(let $=0;$<Vw;$++)fm0[$]=Hn6.charCodeAt($);var n90=4294967296,Ct1=BigInt(Vw)**BigInt(St1),Yi=Number(Ct1/(1n<<32n)),xm0=Number(Ct1%(1n<<32n));function Nn6($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function Fn6($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else Nn6($)}class bm0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(kt1),this.cbuf=new Uint8Array(p90),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Yi+1)),this.seqLo=Math.floor(Math.random()*n90);while($++<8&&this.seqHi===Yi&&this.seqLo>=xm0);if(this.seqHi===Yi&&this.seqLo>=xm0)this.seqLo=0;this.inc=Math.random()*(Un6-Vt1)+Vt1|0}setPre(){Fn6(this.cbuf);for(let $=0;$<p90;$++)this.buf[$]=fm0[this.cbuf[$]%Vw]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=kt1-1;X>=p90;X--){let Q=Math.floor($/Vw),G=($-Q*Vw)*n90+Z,J=Math.floor(G/Vw),K=G-J*Vw;this.buf[X]=fm0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=n90)this.seqLo-=n90,this.seqHi+=1;if(this.seqHi>Yi||this.seqHi===Yi&&this.seqLo>=xm0)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()}}_t1.NuidImpl=bm0;_t1.nuid=new bm0});var gt1=_((bt1)=>{Object.defineProperty(bt1,"__esModule",{value:!0});bt1.nuid=bt1.Nuid=void 0;var ft1=xt1();bt1.Nuid=ft1.NuidImpl;bt1.nuid=ft1.nuid});var o90=_((t90)=>{Object.defineProperty(t90,"__esModule",{value:!0});t90.nuid=t90.Nuid=void 0;var ht1=gt1();Object.defineProperty(t90,"Nuid",{enumerable:!0,get:function(){return ht1.Nuid}});Object.defineProperty(t90,"nuid",{enumerable:!0,get:function(){return ht1.nuid}})});var kw=_((ut1)=>{Object.defineProperty(ut1,"__esModule",{value:!0});ut1.DEFAULT_HOST=ut1.DEFAULT_PORT=ut1.Match=void 0;ut1.syncIterator=En6;ut1.createInbox=zn6;var Ln6=o90(),Dn6=tY();ut1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function En6($){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 zn6($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw Dn6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${Ln6.nuid.next()}`}ut1.DEFAULT_PORT=4222;ut1.DEFAULT_HOST="127.0.0.1"});var Gi=_((mt1)=>{Object.defineProperty(mt1,"__esModule",{value:!0});mt1.DataBuffer=void 0;var lt1=pY();class dt1{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 lt1.TE.encode($)}static toAscii($){return lt1.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}}mt1.DataBuffer=dt1});var WE=_((pt1)=>{Object.defineProperty(pt1,"__esModule",{value:!0});pt1.LF=pt1.CR=pt1.CRLF=pt1.CR_LF_LEN=pt1.CR_LF=void 0;pt1.setTransportFactory=Mn6;pt1.defaultPort=Vn6;pt1.getUrlParseFn=kn6;pt1.newTransport=Sn6;pt1.getResolveFn=Cn6;pt1.protoLen=nt1;pt1.extractProtocolMessage=_n6;var Rn6=pY(),In6=kw(),qn6=Gi(),oY;function Mn6($){oY=$}function Vn6(){return oY!==void 0&&oY.defaultPort!==void 0?oY.defaultPort:In6.DEFAULT_PORT}function kn6(){return oY!==void 0&&oY.urlParseFn?oY.urlParseFn:void 0}function Sn6(){if(!oY||typeof oY.factory!=="function")throw Error("transport fn is not set");return oY.factory()}function Cn6(){return oY!==void 0&&oY.dnsResolveFn?oY.dnsResolveFn:void 0}pt1.CR_LF=`\r
1335
+ `);Q=G.pop()??"";for(let J of G){let K=Xi(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;Iw({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=Xi(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)Iw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function lm6($){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 Zi(Number(Y)+1):await Zi(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await b90({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)QE({name:L.name,status:"ready",port:L.port});em();let U=cm6(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)op1(F.stdout),op1(F.stderr);$i(G),QE({name:"Vite",status:"ready",port:Number(Y)}),QE({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(() => (n50(),i50));await D(K.dataDir)}};return process.on("SIGINT",()=>B("SIGINT")),process.on("SIGTERM",()=>B("SIGTERM")),{port:Number(Y),process:F}}var Lm0=O(()=>{Um0();YE();Bm0()});var h90;var Dm0=O(()=>{h90={name:"decocms",version:"4.214.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 mm6,Text as rp1}from"ink";import{jsx as im6,jsxs as ap1}from"react/jsx-runtime";function sp1({version:$}){return ap1(mm6,{flexDirection:"column",marginTop:1,children:[w90.map((Z,X)=>im6(rp1,{color:B90[X],children:Z},X)),ap1(rp1,{dimColor:!0,children:[" v",$]})]})}var ep1=O(()=>{cm()});import{Box as GE,Text as qw}from"ink";import{Spinner as nm6}from"@inkjs/ui";import{jsx as nY,jsxs as Pb}from"react/jsx-runtime";function $t1({status:$}){if($==="pending")return nY(nm6,{label:""});return nY(qw,{color:"green",children:"\u2713"})}function pm6($){return`${$.name}: ${$.port||"...."}`}function Zt1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return Pb(GE,{flexDirection:"column",paddingBottom:1,children:[nY(sp1,{version:h90.version}),nY(GE,{marginBottom:1,children:nY(qw,{dimColor:!0,children:"\u2500".repeat(80)})}),nY(GE,{children:Pb(qw,{dimColor:!0,children:["Home: ",X]})}),Pb(GE,{gap:2,children:[$.map((Y)=>Pb(GE,{gap:1,children:[nY(qw,{children:pm6(Y)}),nY($t1,{status:Y.status})]},Y.name)),Pb(GE,{gap:1,children:[nY(qw,{children:"Migrations"}),nY($t1,{status:Z})]})]}),nY(GE,{children:Q?Pb(qw,{children:["Open in browser: ",nY(qw,{color:"cyan",children:Q})]}):nY(qw,{dimColor:!0,children:"Starting..."})})]})}var Xt1=O(()=>{Dm0();ep1()});import{Box as tm6,Text as Qi}from"ink";import{jsx as Em0,jsxs as zm0}from"react/jsx-runtime";function om6($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function Qt1({logs:$}){return Em0(tm6,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return Em0(Qi,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return zm0(Qi,{children:[zm0(Qi,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Em0(Qi,{color:om6(Z.status),children:Z.status}),zm0(Qi,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var Yt1=()=>{};var jm0={};B0(jm0,{App:()=>sm6});import{Box as rm6}from"ink";import{useSyncExternalStore as am6}from"react";import{jsx as Gt1,jsxs as em6}from"react/jsx-runtime";function sm6({home:$}){let Z=am6(wm0,Fm0);return em6(rm6,{flexDirection:"column",children:[Gt1(Zt1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Gt1(Qt1,{logs:Z.logs})]})}var Pm0=O(()=>{Xt1();Yt1();YE()});var AJ="thread-gate",yU="decopilot-hosted-harness",Z3="automations",Mw="background-tools",JE="task-board-github-reads";var Jt1="7";function Kt1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Jt1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var Wt1=()=>{};function $i6(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Am0($,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 Ht1(){let $=$i6();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Am0($,"--cpu-prof-dir")??process.cwd(),name:Am0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Am0($,"--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 Ut1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=eD();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(()=>{}),u90=setInterval(()=>void Z().catch(()=>{}),$),u90.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(u90)clearInterval(u90)}}var u90;var Nt1=()=>{};import*as Zi6 from"bun:jsc";function Ft1(){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{Xi6()}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=Qi6()?.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 Xi6,Qi6;var wt1=O(()=>{({startSamplingProfiler:Xi6,samplingProfilerStackTraces:Qi6}=Zi6)});function Bt1(){Ht1();let $=[Ut1(),Nm1(),Ft1()];return()=>{for(let Z of $)Z()}}var Ot1=O(()=>{Tu0();Nt1();wt1()});var KE=_((Lt1)=>{Object.defineProperty(Lt1,"__esModule",{value:!0});Lt1.RepublishHeaders=Lt1.DirectMsgHeaders=Lt1.JsHeaders=Lt1.AdvisoryKind=void 0;Lt1.isOrderedPushConsumerOptions=Yi6;Lt1.isPullConsumer=Gi6;Lt1.isPushConsumer=Ji6;Lt1.isBoundPushConsumerOptions=Ki6;function Yi6($){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 Gi6($){return $.isPullConsumer()}function Ji6($){return $.isPushConsumer()}function Ki6($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Lt1.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"};Lt1.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"};Lt1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Lt1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var pY=_((Et1)=>{Object.defineProperty(Et1,"__esModule",{value:!0});Et1.TD=Et1.TE=Et1.Empty=void 0;Et1.encode=Li6;Et1.decode=Di6;Et1.Empty=new Uint8Array(0);Et1.TE=new TextEncoder;Et1.TD=new TextDecoder;function Oi6(...$){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 Li6(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(Et1.TE.encode($[X]));if(Z.length===0)return Et1.Empty;if(Z.length===1)return Z[0];return Oi6(...Z)}function Di6($){if(!$||$.length===0)return"";return Et1.TD.decode($)}});var tY=_((Pt1)=>{Object.defineProperty(Pt1,"__esModule",{value:!0});Pt1.errors=Pt1.PermissionViolationError=Pt1.NoRespondersError=Pt1.TimeoutError=Pt1.RequestError=Pt1.ProtocolError=Pt1.ConnectionError=Pt1.DrainingConnectionError=Pt1.ClosedConnectionError=Pt1.AuthorizationError=Pt1.UserAuthenticationExpiredError=Pt1.InvalidOperationError=Pt1.InvalidArgumentError=Pt1.InvalidSubjectError=void 0;class Rm0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Pt1.InvalidSubjectError=Rm0;class c90 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 c90(`${$} ${Z}`,X)}}Pt1.InvalidArgumentError=c90;class Im0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Pt1.InvalidOperationError=Im0;class l90 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new l90($);return null}}Pt1.UserAuthenticationExpiredError=l90;class d90 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 d90($);return null}}Pt1.AuthorizationError=d90;class qm0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Pt1.ClosedConnectionError=qm0;class Mm0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Pt1.DrainingConnectionError=Mm0;class Vm0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Pt1.ConnectionError=Vm0;class km0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Pt1.ProtocolError=km0;class Sm0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof m90}}Pt1.RequestError=Sm0;class Cm0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Pt1.TimeoutError=Cm0;class m90 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Pt1.NoRespondersError=m90;class i90 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 i90($,X,Q,Y)}}Pt1.PermissionViolationError=i90;Pt1.errors={AuthorizationError:d90,ClosedConnectionError:qm0,ConnectionError:Vm0,DrainingConnectionError:Mm0,InvalidArgumentError:c90,InvalidOperationError:Im0,InvalidSubjectError:Rm0,NoRespondersError:m90,PermissionViolationError:i90,ProtocolError:km0,RequestError:Sm0,TimeoutError:Cm0,UserAuthenticationExpiredError:l90}});var TJ=_((qt1)=>{Object.defineProperty(qt1,"__esModule",{value:!0});qt1.SimpleMutex=qt1.Perf=void 0;qt1.extend=xi6;qt1.render=fi6;qt1.timeout=bi6;qt1.delay=yi6;qt1.deadline=gi6;qt1.deferred=vm0;qt1.debugDeferred=hi6;qt1.shuffle=ui6;qt1.collect=ci6;qt1.jitter=It1;qt1.backoff=li6;qt1.nanos=di6;qt1.millis=mi6;qt1.randomToken=pi6;var vi6=pY(),_m0=tY();function xi6($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function fi6($){return vi6.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function bi6($,Z=!0){let X=Z?new _m0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new _m0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function yi6($=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 gi6($,Z=1000){let X=vm0(),Q=setTimeout(()=>{X.reject(new _m0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function vm0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function hi6(){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 ui6($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function ci6($){let Z=[];for await(let X of $)Z.push(X);return Z}class Tt1{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})}),$}}qt1.Perf=Tt1;class Rt1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=vm0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}qt1.SimpleMutex=Rt1;function It1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function li6($=[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 It1(X>Z?$[Z]:$[X])}}}function di6($){return $*1e6}function mi6($){return Math.floor($/1e6)}var ii6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",gU=new Uint8Array(62);for(let $=0;$<62;$++)gU[$]=ii6.charCodeAt($);var ni6=218340105584896;function pi6(){let $=Math.floor(Math.random()*ni6),Z=$%62,X=gU[Z];$=($-Z)/62,Z=$%62;let Q=gU[Z];$=($-Z)/62,Z=$%62;let Y=gU[Z];$=($-Z)/62,Z=$%62;let G=gU[Z];$=($-Z)/62,Z=$%62;let J=gU[Z];$=($-Z)/62,Z=$%62;let K=gU[Z];$=($-Z)/62,Z=$%62;let W=gU[Z];$=($-Z)/62;let H=gU[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var xt1=_((_t1)=>{Object.defineProperty(_t1,"__esModule",{value:!0});_t1.nuid=_t1.NuidImpl=void 0;var Hn6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Vw=62,p90=12,St1=10,Vt1=33,Un6=333,kt1=p90+St1,fm0=new Uint8Array(Vw);for(let $=0;$<Vw;$++)fm0[$]=Hn6.charCodeAt($);var n90=4294967296,Ct1=BigInt(Vw)**BigInt(St1),Yi=Number(Ct1/(1n<<32n)),xm0=Number(Ct1%(1n<<32n));function Nn6($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function Fn6($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else Nn6($)}class bm0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(kt1),this.cbuf=new Uint8Array(p90),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Yi+1)),this.seqLo=Math.floor(Math.random()*n90);while($++<8&&this.seqHi===Yi&&this.seqLo>=xm0);if(this.seqHi===Yi&&this.seqLo>=xm0)this.seqLo=0;this.inc=Math.random()*(Un6-Vt1)+Vt1|0}setPre(){Fn6(this.cbuf);for(let $=0;$<p90;$++)this.buf[$]=fm0[this.cbuf[$]%Vw]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=kt1-1;X>=p90;X--){let Q=Math.floor($/Vw),G=($-Q*Vw)*n90+Z,J=Math.floor(G/Vw),K=G-J*Vw;this.buf[X]=fm0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=n90)this.seqLo-=n90,this.seqHi+=1;if(this.seqHi>Yi||this.seqHi===Yi&&this.seqLo>=xm0)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()}}_t1.NuidImpl=bm0;_t1.nuid=new bm0});var gt1=_((bt1)=>{Object.defineProperty(bt1,"__esModule",{value:!0});bt1.nuid=bt1.Nuid=void 0;var ft1=xt1();bt1.Nuid=ft1.NuidImpl;bt1.nuid=ft1.nuid});var o90=_((t90)=>{Object.defineProperty(t90,"__esModule",{value:!0});t90.nuid=t90.Nuid=void 0;var ht1=gt1();Object.defineProperty(t90,"Nuid",{enumerable:!0,get:function(){return ht1.Nuid}});Object.defineProperty(t90,"nuid",{enumerable:!0,get:function(){return ht1.nuid}})});var kw=_((ut1)=>{Object.defineProperty(ut1,"__esModule",{value:!0});ut1.DEFAULT_HOST=ut1.DEFAULT_PORT=ut1.Match=void 0;ut1.syncIterator=En6;ut1.createInbox=zn6;var Ln6=o90(),Dn6=tY();ut1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function En6($){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 zn6($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw Dn6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${Ln6.nuid.next()}`}ut1.DEFAULT_PORT=4222;ut1.DEFAULT_HOST="127.0.0.1"});var Gi=_((mt1)=>{Object.defineProperty(mt1,"__esModule",{value:!0});mt1.DataBuffer=void 0;var lt1=pY();class dt1{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 lt1.TE.encode($)}static toAscii($){return lt1.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}}mt1.DataBuffer=dt1});var WE=_((pt1)=>{Object.defineProperty(pt1,"__esModule",{value:!0});pt1.LF=pt1.CR=pt1.CRLF=pt1.CR_LF_LEN=pt1.CR_LF=void 0;pt1.setTransportFactory=Mn6;pt1.defaultPort=Vn6;pt1.getUrlParseFn=kn6;pt1.newTransport=Sn6;pt1.getResolveFn=Cn6;pt1.protoLen=nt1;pt1.extractProtocolMessage=_n6;var Rn6=pY(),In6=kw(),qn6=Gi(),oY;function Mn6($){oY=$}function Vn6(){return oY!==void 0&&oY.defaultPort!==void 0?oY.defaultPort:In6.DEFAULT_PORT}function kn6(){return oY!==void 0&&oY.urlParseFn?oY.urlParseFn:void 0}function Sn6(){if(!oY||typeof oY.factory!=="function")throw Error("transport fn is not set");return oY.factory()}function Cn6(){return oY!==void 0&&oY.dnsResolveFn?oY.dnsResolveFn:void 0}pt1.CR_LF=`\r
1336
1336
  `;pt1.CR_LF_LEN=pt1.CR_LF.length;pt1.CRLF=qn6.DataBuffer.fromAscii(pt1.CR_LF);pt1.CR=new Uint8Array(pt1.CRLF)[0];pt1.LF=new Uint8Array(pt1.CRLF)[1];function nt1($){for(let Z=0;Z<$.length;Z++){let X=Z+1;if($.byteLength>X&&$[Z]===pt1.CR&&$[X]===pt1.LF)return X+1}return 0}function _n6($){let Z=nt1($);if(Z>0){let Q=new Uint8Array($).slice(0,Z);return Rn6.TD.decode(Q)}return""}});var cm0=_((Zo1)=>{Object.defineProperty(Zo1,"__esModule",{value:!0});Zo1.ipV4=st1;Zo1.isIP=dn6;Zo1.parseIP=et1;var Ji=4,HE=16,r90=48,at1=57,ot1=65,cn6=70,rt1=97,ln6=102,um0=16777215;function st1($,Z,X,Q){let Y=new Uint8Array(HE);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 dn6($){return et1($)!==void 0}function et1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return $o1($);case":":return mn6($)}return}function $o1($){let Z=new Uint8Array(Ji);for(let X=0;X<Ji;X++){if($.length===0)return;if(X>0){if($[0]!==".")return;$=$.substring(1)}let{n:Q,c:Y,ok:G}=in6($);if(!G||Q>255)return;$=$.substring(Y),Z[X]=Q}return st1(Z[0],Z[1],Z[2],Z[3])}function mn6($){let Z=new Uint8Array(HE),X=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(X=0,$=$.substring(2),$.length===0)return Z}let Q=0;while(Q<HE){let{n:Y,c:G,ok:J}=nn6($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(X<0&&Q!=HE-Ji)return;if(Q+Ji>HE)return;let K=$o1($);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+=Ji;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<HE){if(X<0)return;let Y=HE-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 in6($){let Z=0,X=0;for(Z=0;Z<$.length&&r90<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=at1;Z++)if(X=X*10+($.charCodeAt(Z)-r90),X>=um0)return{n:um0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:X,c:Z,ok:!0}}function nn6($){let Z=0,X=0;for(X=0;X<$.length;X++){if(r90<=$.charCodeAt(X)&&$.charCodeAt(X)<=at1)Z*=16,Z+=$.charCodeAt(X)-r90;else if(rt1<=$.charCodeAt(X)&&$.charCodeAt(X)<=ln6)Z*=16,Z+=$.charCodeAt(X)-rt1+10;else if(ot1<=$.charCodeAt(X)&&$.charCodeAt(X)<=cn6)Z*=16,Z+=$.charCodeAt(X)-ot1+10;else break;if(Z>=um0)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 pm0=_((Qo1)=>{Object.defineProperty(Qo1,"__esModule",{value:!0});Qo1.Servers=Qo1.ServerImpl=void 0;Qo1.isIPV4OrHostname=Xo1;Qo1.hostPort=nm0;var lm0=WE(),dm0=TJ(),mm0=cm0(),rn6=kw(),an6=tY();function Xo1($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function im0($){return!Xo1($)}function sn6($){let X=$.toUpperCase().indexOf("::FFFF:");if(X!==-1&&$.indexOf(".")!==-1){let Q=$.substring(X+7);return Q=Q.replace("[",""),Q.replace("]","")}return $}function nm0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=sn6($),im0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=im0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),X=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):rn6.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 Ab{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let X=nm0($);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,mm0.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}://${im0(Q)?"["+Q+"]":Q}`);G.port=`${this.port}`;let J=new Ab(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,dm0.shuffle)(Z);return this.resolves=Z,Z}}Qo1.ServerImpl=Ab;class a90{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw an6.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,lm0.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}=nm0(Y),J=X.get(G);if(J)J.gossiped=!1,Q.push(J);else Q.push(new Ab(Y))}if(this.randomize)(0,dm0.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,mm0.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,lm0.getUrlParseFn)();$=X?X($):$;let Q=new Ab($,Z);if((0,mm0.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 a90.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return a90.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,lm0.getUrlParseFn)(),G=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Ab(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,dm0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:X,deleted:Q}}}Qo1.Servers=a90});var s90=_((Ko1)=>{Object.defineProperty(Ko1,"__esModule",{value:!0});Ko1.QueuedIteratorImpl=void 0;var tm0=TJ(),Go1=tY();class Jo1{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,tm0.deferred)(),this.yields=[],this.iterClosed=(0,tm0.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 Go1.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Go1.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,tm0.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}}Ko1.QueuedIteratorImpl=Jo1});var om0=_((No1)=>{Object.defineProperty(No1,"__esModule",{value:!0});No1.MuxSubscription=void 0;var Xp6=kw(),Ho1=tY();class Uo1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,Xp6.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 Ho1.NoRespondersError(Q.requestSubject):null;Q.resolver($,Z)}}}}close(){let $=new Ho1.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}No1.MuxSubscription=Uo1});var rm0=_((Bo1)=>{Object.defineProperty(Bo1,"__esModule",{value:!0});Bo1.Heartbeat=void 0;var Qp6=TJ();class wo1{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,Qp6.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})}}Bo1.Heartbeat=wo1});var em0=_((zo1)=>{Object.defineProperty(zo1,"__esModule",{value:!0});zo1.DenoBuffer=zo1.MAX_SIZE=zo1.AssertionError=void 0;zo1.assert=Do1;zo1.concat=Eo1;zo1.append=Gp6;zo1.readAll=Jp6;zo1.writeAll=Kp6;var Yp6=pY();class am0 extends Error{constructor($){super($);this.name="AssertionError"}}zo1.AssertionError=am0;function Do1($,Z="Assertion failed."){if(!$)throw new am0(Z)}var Lo1=32768;zo1.MAX_SIZE=4294967294;function e90($,Z,X=0){let Q=Z.byteLength-X;if($.byteLength>Q)$=$.subarray(0,Q);return Z.set($,X),$.byteLength}function Eo1($,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 Gp6($,Z){return Eo1($,Uint8Array.of(Z))}class sm0{_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($){Do1($<=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=e90(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(Yp6.TE.encode($))}write($){let Z=this._grow($.byteLength);return e90($,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)e90(this._buf.subarray(this._off),this._buf);else if(Q+$>zo1.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*Q+$,zo1.MAX_SIZE));e90(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,zo1.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(Lo1);while(!0){let Q=this.capacity-this.length<Lo1,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}}}zo1.DenoBuffer=sm0;function Jp6($){let Z=new sm0;return Z.readFrom($),Z.bytes()}function Kp6($,Z){let X=0;while(X<Z.length)X+=$.write(Z.subarray(X))}});var Xi0=_((Ro1)=>{Object.defineProperty(Ro1,"__esModule",{value:!0});Ro1.cc=Ro1.State=Ro1.Parser=Ro1.Kind=void 0;Ro1.describe=Bp6;var $i0=em0(),Zi0=pY();Ro1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function Bp6($){let Z,X="";switch($.kind){case Ro1.Kind.MSG:Z="MSG";break;case Ro1.Kind.OK:Z="OK";break;case Ro1.Kind.ERR:Z="ERR",X=Zi0.TD.decode($.data);break;case Ro1.Kind.PING:Z="PING";break;case Ro1.Kind.PONG:Z="PONG";break;case Ro1.Kind.INFO:Z="INFO",X=Zi0.TD.decode($.data)}return`${Z}: ${X}`}function Po1(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var Ao1=48,Op6=57,Tb=67108864;class To1{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=Ro1.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 Ro1.State.OP_START:switch(X){case Ro1.cc.M:case Ro1.cc.m:this.state=Ro1.State.OP_M,this.hdr=-1,this.ma=Po1();break;case Ro1.cc.H:case Ro1.cc.h:this.state=Ro1.State.OP_H,this.hdr=0,this.ma=Po1();break;case Ro1.cc.P:case Ro1.cc.p:this.state=Ro1.State.OP_P;break;case Ro1.cc.PLUS:this.state=Ro1.State.OP_PLUS;break;case Ro1.cc.MINUS:this.state=Ro1.State.OP_MINUS;break;case Ro1.cc.I:case Ro1.cc.i:this.state=Ro1.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_H:switch(X){case Ro1.cc.M:case Ro1.cc.m:this.state=Ro1.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_M:switch(X){case Ro1.cc.S:case Ro1.cc.s:this.state=Ro1.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_MS:switch(X){case Ro1.cc.G:case Ro1.cc.g:this.state=Ro1.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_MSG:switch(X){case Ro1.cc.SPACE:case Ro1.cc.TAB:this.state=Ro1.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_MSG_SPC:switch(X){case Ro1.cc.SPACE:case Ro1.cc.TAB:continue;default:this.state=Ro1.State.MSG_ARG,this.as=Z}break;case Ro1.State.MSG_ARG:switch(X){case Ro1.cc.CR:this.drop=1;break;case Ro1.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=Ro1.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;case Ro1.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let Q=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:Ro1.Kind.MSG,msg:this.ma,data:Q}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Ro1.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:Ro1.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Ro1.State.MSG_END;break;case Ro1.State.MSG_END:switch(X){case Ro1.cc.NL:this.drop=0,this.as=Z+1,this.state=Ro1.State.OP_START;break;default:continue}break;case Ro1.State.OP_PLUS:switch(X){case Ro1.cc.O:case Ro1.cc.o:this.state=Ro1.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_PLUS_O:switch(X){case Ro1.cc.K:case Ro1.cc.k:this.state=Ro1.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_PLUS_OK:switch(X){case Ro1.cc.NL:this.dispatcher.push({kind:Ro1.Kind.OK}),this.drop=0,this.state=Ro1.State.OP_START;break}break;case Ro1.State.OP_MINUS:switch(X){case Ro1.cc.E:case Ro1.cc.e:this.state=Ro1.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_MINUS_E:switch(X){case Ro1.cc.R:case Ro1.cc.r:this.state=Ro1.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_MINUS_ER:switch(X){case Ro1.cc.R:case Ro1.cc.r:this.state=Ro1.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_MINUS_ERR:switch(X){case Ro1.cc.SPACE:case Ro1.cc.TAB:this.state=Ro1.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_MINUS_ERR_SPC:switch(X){case Ro1.cc.SPACE:case Ro1.cc.TAB:continue;default:this.state=Ro1.State.MINUS_ERR_ARG,this.as=Z}break;case Ro1.State.MINUS_ERR_ARG:switch(X){case Ro1.cc.CR:this.drop=1;break;case Ro1.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:Ro1.Kind.ERR,data:Q}),this.drop=0,this.as=Z+1,this.state=Ro1.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(X))}break;case Ro1.State.OP_P:switch(X){case Ro1.cc.I:case Ro1.cc.i:this.state=Ro1.State.OP_PI;break;case Ro1.cc.O:case Ro1.cc.o:this.state=Ro1.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_PO:switch(X){case Ro1.cc.N:case Ro1.cc.n:this.state=Ro1.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_PON:switch(X){case Ro1.cc.G:case Ro1.cc.g:this.state=Ro1.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_PONG:switch(X){case Ro1.cc.NL:this.dispatcher.push({kind:Ro1.Kind.PONG}),this.drop=0,this.state=Ro1.State.OP_START;break}break;case Ro1.State.OP_PI:switch(X){case Ro1.cc.N:case Ro1.cc.n:this.state=Ro1.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_PIN:switch(X){case Ro1.cc.G:case Ro1.cc.g:this.state=Ro1.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_PING:switch(X){case Ro1.cc.NL:this.dispatcher.push({kind:Ro1.Kind.PING}),this.drop=0,this.state=Ro1.State.OP_START;break}break;case Ro1.State.OP_I:switch(X){case Ro1.cc.N:case Ro1.cc.n:this.state=Ro1.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_IN:switch(X){case Ro1.cc.F:case Ro1.cc.f:this.state=Ro1.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_INF:switch(X){case Ro1.cc.O:case Ro1.cc.o:this.state=Ro1.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_INFO:switch(X){case Ro1.cc.SPACE:case Ro1.cc.TAB:this.state=Ro1.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case Ro1.State.OP_INFO_SPC:switch(X){case Ro1.cc.SPACE:case Ro1.cc.TAB:continue;default:this.state=Ro1.State.INFO_ARG,this.as=Z}break;case Ro1.State.INFO_ARG:switch(X){case Ro1.cc.CR:this.drop=1;break;case Ro1.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:Ro1.Kind.INFO,data:Q}),this.drop=0,this.as=Z+1,this.state=Ro1.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;default:throw this.fail($.subarray(Z))}}if((this.state===Ro1.State.MSG_ARG||this.state===Ro1.State.MINUS_ERR_ARG||this.state===Ro1.State.INFO_ARG)&&!this.argBuf)this.argBuf=new $i0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===Ro1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new $i0.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 $i0.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 Ro1.cc.SPACE:case Ro1.cc.TAB:case Ro1.cc.CR:case Ro1.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],Tb);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],Tb);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}: ${Zi0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],X=-1;for(let Q=0;Q<$.length;Q++)switch($[Q]){case Ro1.cc.SPACE:case Ro1.cc.TAB:case Ro1.cc.CR:case Ro1.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],Tb),this.ma.size=this.protoParseInt(Z[3],Tb);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],Tb),this.ma.size=this.protoParseInt(Z[4],Tb);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]<Ao1||$[Q]>Op6)return-1;X=X*10+($[Q]-Ao1)}return Z!==void 0&&X>Z?-1:X}}Ro1.Parser=To1;Ro1.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};Ro1.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 XZ0=_((qo1)=>{Object.defineProperty(qo1,"__esModule",{value:!0});qo1.MsgHdrsImpl=void 0;qo1.canonicalMIMEHeaderKey=Yi0;qo1.headers=Ep6;var Io1=pY(),RJ=kw(),ZZ0=tY();function Yi0($){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 ZZ0.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 Ep6($=0,Z=""){if($===0&&Z!=="")throw ZZ0.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw ZZ0.InvalidArgumentError.format("description","is required");return new Rb($,Z)}var Qi0="NATS/1.0";class Rb{_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 Rb,Q=Io1.TD.decode($).split(`\r
1337
1337
  `),Y=Q[0];if(Y!==Qi0){let G=Y.replace(Qi0,"").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 $=Qi0;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
@@ -2789,7 +2789,7 @@ ${Z.description}
2789
2789
  `),L=si4(Z.id,X,Q,Y),D=ei4(L),{isNew:E}=await tr($,Z,{runClass:"reviewer",title:`${eg[X]}: ${Z.title}`,prompt:B,temperature:0.3,...H?{harnessId:"claude-code",agent:{instructions:w,disallowedTools:ni4[X]}}:{},...W?{repo:W}:{},fence:{threadId:D,workflowID:L}}).catch(async(j)=>{throw await $.storage.threads.delete(D).catch((A)=>console.error(`[task-board] ${X} fence thread cleanup failed`,A)),j});if(!E)return;await g5($,{taskBoardItemId:Z.id,action:"review_requested",actorId:null,data:{reviewer:X}});let z=await $.storage.taskBoard.getById(Z.id,G);if(z)k4(G,z)}var fC8,ni4,pi4,l91=2;var m91=O(()=>{rZ();PG();s9();y91();g91();u91();fC8=new Set(["completed","failed","expired"]);ni4={qa:["Edit","NotebookEdit"],code_review:["Write","Edit","NotebookEdit"]},pi4={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, check the acceptance criteria implied by the title and description, and look for regressions in the affected flow. Judge outcomes, "+"not the diff \u2014 and NEVER approve on inspection alone: an approval must be "+`backed by evidence you actually exercised the change.
2790
2790
  Exercise the change on the PR's deploy preview, deep-linked to the specific page/route the task affects (not just its root). For any VISUAL change, capture the affected view BEFORE (the current production / base-branch site) and AFTER (the preview) so the two can be compared, and for a responsive change capture BOTH a desktop and a real mobile view (a phone viewport AND a `+"mobile user-agent \u2014 not a narrowed desktop). The How-to steps below name the "+`exact screenshot tool for your run.
2791
2791
  If the preview will not render (303s, hangs, blank) or you otherwise cannot exercise the change, do NOT approve: request changes stating what is blocking and what is needed to unblock. An unverified preview is not a pass.
2792
- `+"RECORD your QA pass as a task comment BEFORE the decision \u2014 a durable record, "+"separate from the short decision summary. Structure it: the acceptance "+"criteria / scenarios you checked with a pass/fail on each, a before\u2192after "+"pointer to the screenshots, the exact URL(s) and viewport you exercised, and anything you could not verify and why.",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 Zn4($){return $.filter((X)=>X.action==="merge_conflict_resolution").length>=yC8}async function Qu($,Z,X,Q){if(X.status!=="in_review")return!1;if(X.assigneeId!==g4)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=jN(G),K=await $.storage.taskBoard.listActivity(X.id,Z);if(!XO(K,J,{verifiedOnly:!0}))return!1;if(Zn4(K))return console.warn(`[task-board] conflict auto-resolve cap (${yC8}) 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 g5($,{taskBoardItemId:X.id,action:"merge_conflict_resolution",actorId:null,data:{prNumber:W.number}}),k4(Z,H);try{await pN($,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)=>k4(Z,N)).catch((N)=>console.error("[task-board] conflict-resolution status revert failed",N)),U}return!0}var yC8=3;var nP0=O(()=>{rZ();PG();s9();aO()});async function pP0($,Z){let X=await $.selectFrom("organization").select(["id","slug","name"]).where("id","=",Z).executeTakeFirst();if(!X)return null;let Q=await f3.create();return Q.organization={id:X.id,slug:X.slug,name:X.name},sO(Q,{id:X.id,slug:X.slug}),Q}var i91=O(()=>{a_()});import{DBOS as t91}from"@dbos-inc/dbos-sdk";function hC8($){n91=$}async function Gn4($,Z){if(!n91)throw Error("[task-board-github-read] runtime not initialized \u2014 setTaskBoardGithubReadRuntime() must run before the workflow fires");let X=await pP0(n91.db,$);if(!X)return p91;return await cC8(X,$,Z)}async function Jn4($,Z){return await t91.runStep(()=>Gn4($,Z),{name:"readPrState"})}function uC8(){if(tP0)return;tP0=t91.registerWorkflow(Jn4,{name:"taskBoardGithubReadWorkflow"})}async function Yu($,Z){if(!tP0)return p91;try{return await(await t91.startWorkflow(tP0,{queueName:JE,timeoutMS:Yn4})($,Z)).getResult()}catch(X){return console.error("[task-board-github-read] throttled PR read failed",X),p91}}var Xn4=20,Qn4=4,Yn4=60000,gC8,n91=null,p91,tP0=null;var or=O(()=>{i91();eO();gC8={concurrency:Qn4,rateLimit:{limitPerPeriod:Xn4,periodSec:60}};p91={state:null,merged:null}});import{z as oP0}from"zod";function sP0($){let Z=$ instanceof Error?$.message:String($);return/too many requests|rate limit|\b429\b/i.test(Z)}function dC8($){lC8.invalidate($)}async function ar($,Z,X,Q,Y,G){try{let J=await lC8.fetch({type:"tools/call",connectionId:Z,scope:{kind:"org"},params:{name:X,arguments:Q},fetchLive:()=>R9(async()=>{let K=await $.callTool({name:X,arguments:Q},void 0,{timeout:aP0});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)=>!sP0(K)}),onRevalidation:(K)=>G.push(K)});return eP0(J)}catch(J){let K=J instanceof fY?J.cause:J;return console.error(`[task-board] ${X} failed for ${Y}:`,K),null}}async function s_($,Z,X,Q){if(X){let G=await $.storage.connections.findById(X,Z);if(G&&G.status==="active")return G}let{items:Y}=await $.storage.connections.list(Z,{slug:"mcp-github"});return Kn4(Y.filter((G)=>G.status==="active"),Q)}function Kn4($,Z){let X=$.find((Y)=>x5(Y)===null)??null;if(!Z)return X??$[0]??null;return $.find((Y)=>{let G=x5(Y);return G?.owner===Z.owner&&G?.repo===Z.name})??X}function eP0($){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 rP0($){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 Wn4($){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"&&rP0(X.target_url));if(Z.length===0)return null;return Z.find((X)=>X.state==="success")?.target_url??Z[0].target_url}function Hn4($){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]&&rP0(J[1]))return J[1];let K=(G.match(/https?:\/\/[^\s"'<>)\]]+/g)??[]).find((W)=>rP0(W));if(K)return K}return null}function Un4($){let Z=$&&typeof $.environmentUrl==="string"?$.environmentUrl:null;return Z&&rP0(Z)?Z:null}function mC8($){return typeof $==="string"&&/^[0-9a-fA-F]{7,40}$/.test($)?$:null}function Nn4($){let Z=$?.head;return mC8(Z?.sha)}function Fn4($){return mC8($?.sha)}function iC8($){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 pC8($){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"&&nC8.has(J))X=!0}if(X)return"failing";if(Q)return"pending";return"passing"}function tC8($,Z){if($==="failing"||Z==="failing")return"failing";if($==="pending"||Z==="pending")return"pending";if($==="passing"||Z==="passing")return"passing";return null}function wn4($){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 Bn4($){return $.status==="completed"&&$.conclusion!=null&&nC8.has($.conclusion)}async function On4($,Z,X,Q,Y){let J=(await ar($,Z,"GET_CHECK_RUN",{owner:X.repoOwner,repo:X.repoName,checkRunId:Q},`${rr(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 oC8($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await P5(Q,$,!0),G=async(J)=>eP0(await Y.callTool({name:"pull_request_read",arguments:{method:J,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aP0}));try{let J=null;try{J=iC8(await G("get_status"))}catch{}try{J=tC8(J,pC8(await G("get_check_runs")))}catch{}return J}finally{await Y.close().catch(()=>{})}}function rC8($){if(!$)return null;if($.state!=="open")return!1;return typeof $.mergeable==="boolean"?!$.mergeable:null}async function $A0($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await P5(Q,$,!0);try{return rC8(eP0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aP0})))}catch{return null}finally{await Y.close().catch(()=>{})}}async function Ln4($,Z,X,Q,Y){let G=(F)=>ar($,Z,"pull_request_read",{method:F,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${rr(X)} (${F})`,Q),[J,K,W]=await Promise.all([G("get_status"),G("get_check_runs"),G("get_comments")]),H=tC8(iC8(J),pC8(K)),U=Wn4(J)??Hn4(W);if(!U){let F=Nn4(await Y)??Fn4(J);if(F)U=Un4(await ar($,Z,"GET_PREVIEW_DEPLOYMENT",{owner:X.repoOwner,repo:X.repoName,sha:F},`${rr(X)} (deployment preview)`,Q))}let N=await Promise.all(wn4(K).map(async(F)=>({name:F.name,status:F.status,conclusion:F.conclusion,detailsUrl:F.detailsUrl,summary:Bn4(F)&&F.id!=null?await On4($,Z,X,F.id,Q):null})));return{checksStatus:H,checks:N,previewUrl:U}}async function Dn4($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return r91;let Y=await P5(Q,$,!0),G=[];try{let J=ar(Y,Q.id,"pull_request_read",{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${rr(X)} (get)`,G),[K,W]=await Promise.all([J,Ln4(Y,Q.id,X,G,J)]);if(!K)return r91;let H=K.state,U=H==="open";return{title:typeof K.title==="string"?K.title:null,body:typeof K.body==="string"?K.body:null,state:H==="closed"?"closed":U?"open":null,draft:typeof K.draft==="boolean"?K.draft:null,merged:typeof K.merged==="boolean"?K.merged:null,mergeable:U&&typeof K.mergeable==="boolean"?K.mergeable:null,checksStatus:U?W.checksStatus:null,checks:U?W.checks:[],previewUrl:U?W.previewUrl:null}}catch{return r91}finally{Promise.allSettled(G).then(()=>Y.close().catch(()=>{}))}}async function aC8($,Z,X,Q){let Y=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Y)return null;let G=await P5(Y,$,!0),J=[];try{return await ar(G,Y.id,"pull_request_read",{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${rr(X)} (${Q})`,J)}catch{return null}finally{Promise.allSettled(J).then(()=>G.close().catch(()=>{}))}}async function sC8($,Z,X){let Q=await aC8($,Z,X,"merged");return typeof Q?.merged==="boolean"?Q.merged:null}async function cC8($,Z,X){let Q=await aC8($,Z,X,"candidate");return{state:Q?.state==="closed"?"closed":Q?.state==="open"?"open":null,merged:typeof Q?.merged==="boolean"?Q.merged:null}}function En4($){let Z=$.findIndex((X)=>X!=="closed");return Z===-1?0:Z}async function Gu($,Z,X){if(X.length<=1)return X[0];let Q=[];for(let Y of X){let{state:G}=await Yu(Z,Y);if(Q.push(G),G!=="closed")break}return X[En4(Q)]}async function eC8($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await P5(Q,$,!0);try{let G=eP0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aP0}));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 aP0=8000,o91,lC8,rr=($)=>`${$.repoOwner}/${$.repoName}#${$.number}`,r91,nC8,a91=($)=>$.some((Z)=>Z.state!=="closed"&&Z.merged!==!0),s91;var eO=O(()=>{p0();wN();oQ();rZ();t4();it();OH();PG();s9();m91();nP0();or();o91={revalidateAfterMs:55000,maxStaleMs:1800000,maxValueBytes:524288},lC8=new kG0({"tools/call":o91,"resources/read":o91,"prompts/get":o91});r91={title:null,body:null,state:null,draft:null,merged:null,mergeable:null,checksStatus:null,checks:[],previewUrl:null};nC8=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);s91=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:oP0.object({taskBoardItemId:oP0.string()}),outputSchema:oP0.object({prs:oP0.array(f28)}),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 Dn4(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===g4&&a91(G))await iP0(Z,Q).catch((W)=>{console.error("[task-board] reviewer auto-handoff failed",W)});let K=J?rC8({state:J.state,mergeable:J.mergeable}):null;if(Q&&Q.status==="in_review"&&Q.assigneeId===g4&&J&&K===!0)await Qu(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"&&Q.status!=="archived"){let W=await Z.storage.taskBoard.update($,X,{status:"done"},Q.updatedBy);await g5(Z,{taskBoardItemId:$,action:"status_changed",actorId:null,data:{from:Q.status,to:"done"}}),k4(X,W)}}catch(W){console.error("[task-board] merge\u2192done reconcile failed",W)}return{prs:G}}})});async function Ju($,Z,X){if(Z.assigneeId!==g4)return;await pN($,Z,X).catch((Q)=>{if(Q instanceof $Y)throw Q;console.error("[task-board] Super Agent enqueue failed",Q)})}function zn4($,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?`
2792
+ `+"RECORD your QA pass as a task comment BEFORE the decision \u2014 a durable record, "+"separate from the short decision summary. Structure it: the acceptance "+"criteria / scenarios you checked with a pass/fail on each, a before\u2192after "+"pointer to the screenshots, the exact URL(s) and viewport you exercised, and anything you could not verify and why.",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 Zn4($){return $.filter((X)=>X.action==="merge_conflict_resolution").length>=yC8}async function Qu($,Z,X,Q){if(X.status!=="in_review")return!1;if(X.assigneeId!==g4)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=jN(G),K=await $.storage.taskBoard.listActivity(X.id,Z);if(!XO(K,J,{verifiedOnly:!0}))return!1;if(Zn4(K))return console.warn(`[task-board] conflict auto-resolve cap (${yC8}) 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 g5($,{taskBoardItemId:X.id,action:"merge_conflict_resolution",actorId:null,data:{prNumber:W.number}}),k4(Z,H);try{await pN($,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)=>k4(Z,N)).catch((N)=>console.error("[task-board] conflict-resolution status revert failed",N)),U}return!0}var yC8=3;var nP0=O(()=>{rZ();PG();s9();aO()});async function pP0($,Z){let X=await $.selectFrom("organization").select(["id","slug","name"]).where("id","=",Z).executeTakeFirst();if(!X)return null;let Q=await f3.create();return Q.organization={id:X.id,slug:X.slug,name:X.name},sO(Q,{id:X.id,slug:X.slug}),Q}var i91=O(()=>{a_()});import{DBOS as t91}from"@dbos-inc/dbos-sdk";function hC8($){n91=$}async function Gn4($,Z){if(!n91)throw Error("[task-board-github-read] runtime not initialized \u2014 setTaskBoardGithubReadRuntime() must run before the workflow fires");let X=await pP0(n91.db,$);if(!X)return p91;return await cC8(X,$,Z)}async function Jn4($,Z){return await t91.runStep(()=>Gn4($,Z),{name:"readPrState"})}function uC8(){if(tP0)return;tP0=t91.registerWorkflow(Jn4,{name:"taskBoardGithubReadWorkflow"})}async function Yu($,Z){if(!tP0)return p91;try{return await(await t91.startWorkflow(tP0,{queueName:JE,timeoutMS:Yn4})($,Z)).getResult()}catch(X){return console.error("[task-board-github-read] throttled PR read failed",X),p91}}var Xn4=20,Qn4=4,Yn4=60000,gC8,n91=null,p91,tP0=null;var or=O(()=>{i91();eO();gC8={concurrency:Qn4,rateLimit:{limitPerPeriod:Xn4,periodSec:60}};p91={state:null,merged:null}});import{z as oP0}from"zod";function sP0($){let X=($ instanceof Error?$.message:String($)).replace(/https?:\/\/\S+/gi," ");return/too many requests|rate limit|\b429\b/i.test(X)}function dC8($){lC8.invalidate($)}async function ar($,Z,X,Q,Y,G){try{let J=await lC8.fetch({type:"tools/call",connectionId:Z,scope:{kind:"org"},params:{name:X,arguments:Q},fetchLive:()=>R9(async()=>{let K=await $.callTool({name:X,arguments:Q},void 0,{timeout:aP0});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)=>!sP0(K)}),onRevalidation:(K)=>G.push(K)});return eP0(J)}catch(J){let K=J instanceof fY?J.cause:J;return console.error(`[task-board] ${X} failed for ${Y}:`,K),null}}async function s_($,Z,X,Q){if(X){let G=await $.storage.connections.findById(X,Z);if(G&&G.status==="active")return G}let{items:Y}=await $.storage.connections.list(Z,{slug:"mcp-github"});return Kn4(Y.filter((G)=>G.status==="active"),Q)}function Kn4($,Z){let X=$.find((Y)=>x5(Y)===null)??null;if(!Z)return X??$[0]??null;return $.find((Y)=>{let G=x5(Y);return G?.owner===Z.owner&&G?.repo===Z.name})??X}function eP0($){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 rP0($){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 Wn4($){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"&&rP0(X.target_url));if(Z.length===0)return null;return Z.find((X)=>X.state==="success")?.target_url??Z[0].target_url}function Hn4($){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]&&rP0(J[1]))return J[1];let K=(G.match(/https?:\/\/[^\s"'<>)\]]+/g)??[]).find((W)=>rP0(W));if(K)return K}return null}function Un4($){let Z=$&&typeof $.environmentUrl==="string"?$.environmentUrl:null;return Z&&rP0(Z)?Z:null}function mC8($){return typeof $==="string"&&/^[0-9a-fA-F]{7,40}$/.test($)?$:null}function Nn4($){let Z=$?.head;return mC8(Z?.sha)}function Fn4($){return mC8($?.sha)}function iC8($){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 pC8($){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"&&nC8.has(J))X=!0}if(X)return"failing";if(Q)return"pending";return"passing"}function tC8($,Z){if($==="failing"||Z==="failing")return"failing";if($==="pending"||Z==="pending")return"pending";if($==="passing"||Z==="passing")return"passing";return null}function wn4($){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 Bn4($){return $.status==="completed"&&$.conclusion!=null&&nC8.has($.conclusion)}async function On4($,Z,X,Q,Y){let J=(await ar($,Z,"GET_CHECK_RUN",{owner:X.repoOwner,repo:X.repoName,checkRunId:Q},`${rr(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 oC8($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await P5(Q,$,!0),G=async(J)=>eP0(await Y.callTool({name:"pull_request_read",arguments:{method:J,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aP0}));try{let J=null;try{J=iC8(await G("get_status"))}catch{}try{J=tC8(J,pC8(await G("get_check_runs")))}catch{}return J}finally{await Y.close().catch(()=>{})}}function rC8($){if(!$)return null;if($.state!=="open")return!1;return typeof $.mergeable==="boolean"?!$.mergeable:null}async function $A0($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await P5(Q,$,!0);try{return rC8(eP0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aP0})))}catch{return null}finally{await Y.close().catch(()=>{})}}async function Ln4($,Z,X,Q,Y){let G=(F)=>ar($,Z,"pull_request_read",{method:F,owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${rr(X)} (${F})`,Q),[J,K,W]=await Promise.all([G("get_status"),G("get_check_runs"),G("get_comments")]),H=tC8(iC8(J),pC8(K)),U=Wn4(J)??Hn4(W);if(!U){let F=Nn4(await Y)??Fn4(J);if(F)U=Un4(await ar($,Z,"GET_PREVIEW_DEPLOYMENT",{owner:X.repoOwner,repo:X.repoName,sha:F},`${rr(X)} (deployment preview)`,Q))}let N=await Promise.all(wn4(K).map(async(F)=>({name:F.name,status:F.status,conclusion:F.conclusion,detailsUrl:F.detailsUrl,summary:Bn4(F)&&F.id!=null?await On4($,Z,X,F.id,Q):null})));return{checksStatus:H,checks:N,previewUrl:U}}async function Dn4($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return r91;let Y=await P5(Q,$,!0),G=[];try{let J=ar(Y,Q.id,"pull_request_read",{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${rr(X)} (get)`,G),[K,W]=await Promise.all([J,Ln4(Y,Q.id,X,G,J)]);if(!K)return r91;let H=K.state,U=H==="open";return{title:typeof K.title==="string"?K.title:null,body:typeof K.body==="string"?K.body:null,state:H==="closed"?"closed":U?"open":null,draft:typeof K.draft==="boolean"?K.draft:null,merged:typeof K.merged==="boolean"?K.merged:null,mergeable:U&&typeof K.mergeable==="boolean"?K.mergeable:null,checksStatus:U?W.checksStatus:null,checks:U?W.checks:[],previewUrl:U?W.previewUrl:null}}catch{return r91}finally{Promise.allSettled(G).then(()=>Y.close().catch(()=>{}))}}async function aC8($,Z,X,Q){let Y=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Y)return null;let G=await P5(Y,$,!0),J=[];try{return await ar(G,Y.id,"pull_request_read",{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number},`${rr(X)} (${Q})`,J)}catch{return null}finally{Promise.allSettled(J).then(()=>G.close().catch(()=>{}))}}async function sC8($,Z,X){let Q=await aC8($,Z,X,"merged");return typeof Q?.merged==="boolean"?Q.merged:null}async function cC8($,Z,X){let Q=await aC8($,Z,X,"candidate");return{state:Q?.state==="closed"?"closed":Q?.state==="open"?"open":null,merged:typeof Q?.merged==="boolean"?Q.merged:null}}function En4($){let Z=$.findIndex((X)=>X!=="closed");return Z===-1?0:Z}async function Gu($,Z,X){if(X.length<=1)return X[0];let Q=[];for(let Y of X){let{state:G}=await Yu(Z,Y);if(Q.push(G),G!=="closed")break}return X[En4(Q)]}async function eC8($,Z,X){let Q=await s_($,Z,X.connectionId,{owner:X.repoOwner,name:X.repoName});if(!Q)return null;let Y=await P5(Q,$,!0);try{let G=eP0(await Y.callTool({name:"pull_request_read",arguments:{method:"get",owner:X.repoOwner,repo:X.repoName,pullNumber:X.number}},void 0,{timeout:aP0}));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 aP0=8000,o91,lC8,rr=($)=>`${$.repoOwner}/${$.repoName}#${$.number}`,r91,nC8,a91=($)=>$.some((Z)=>Z.state!=="closed"&&Z.merged!==!0),s91;var eO=O(()=>{p0();wN();oQ();rZ();t4();it();OH();PG();s9();m91();nP0();or();o91={revalidateAfterMs:55000,maxStaleMs:1800000,maxValueBytes:524288},lC8=new kG0({"tools/call":o91,"resources/read":o91,"prompts/get":o91});r91={title:null,body:null,state:null,draft:null,merged:null,mergeable:null,checksStatus:null,checks:[],previewUrl:null};nC8=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);s91=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:oP0.object({taskBoardItemId:oP0.string()}),outputSchema:oP0.object({prs:oP0.array(f28)}),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 Dn4(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===g4&&a91(G))await iP0(Z,Q).catch((W)=>{console.error("[task-board] reviewer auto-handoff failed",W)});let K=J?rC8({state:J.state,mergeable:J.mergeable}):null;if(Q&&Q.status==="in_review"&&Q.assigneeId===g4&&J&&K===!0)await Qu(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"&&Q.status!=="archived"){let W=await Z.storage.taskBoard.update($,X,{status:"done"},Q.updatedBy);await g5(Z,{taskBoardItemId:$,action:"status_changed",actorId:null,data:{from:Q.status,to:"done"}}),k4(X,W)}}catch(W){console.error("[task-board] merge\u2192done reconcile failed",W)}return{prs:G}}})});async function Ju($,Z,X){if(Z.assigneeId!==g4)return;await pN($,Z,X).catch((Q)=>{if(Q instanceof $Y)throw Q;console.error("[task-board] Super Agent enqueue failed",Q)})}function zn4($,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?`
2793
2793
  Description:
2794
2794
  ${$.description}
2795
2795
  `:"",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(`