decocms 4.305.7 → 4.305.9

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 (228) hide show
  1. package/dist/client/assets/{AlertCircle-DSEb3qWj.js → AlertCircle-BGJNJ8jR.js} +1 -1
  2. package/dist/client/assets/{AreaChart-xxxXT_V7.js → AreaChart-ePQ68UV-.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BRYoQykq.js → ArrowLeft-vStnf-9n.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DBslL4md.js → ArrowUp-DPWNHKMD.js} +1 -1
  5. package/dist/client/assets/{Check-ywOUjxNZ.js → Check-Cl4dPY-m.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-BYMziWRm.js → CheckCircle-meV6cQbM.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BK2x9ktj.js → ChevronDown-BQONwVDk.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-C_5VGoy2.js → ChevronRight-Djke9iFl.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CjacNUaW.js → ChevronSelectorVertical-B7QJMaL_.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-s-yNPAnM.js → ChevronUp-Ct2QooGc.js} +1 -1
  11. package/dist/client/assets/{Copy01-y7XLTRKL.js → Copy01-WTofvHOn.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-CwnCPsZ_.js → CreditCard01-L84SI4a2.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-DTh19B0M.js → DotsVertical-CDuHkoBW.js} +1 -1
  14. package/dist/client/assets/{Download01-DC3Ut705.js → Download01-BeBUScju.js} +1 -1
  15. package/dist/client/assets/{Eye-Bq4EvBN4.js → Eye-BfjfxUqI.js} +1 -1
  16. package/dist/client/assets/{FilterLines-kvH9nYL6.js → FilterLines-CniID4FB.js} +1 -1
  17. package/dist/client/assets/{Globe01-DDr24BXY.js → Globe01-W3yWLLY-.js} +1 -1
  18. package/dist/client/assets/{Globe04-LmJhN0rZ.js → Globe04-C2AZPxqA.js} +1 -1
  19. package/dist/client/assets/{HardDrive-WhGpNPAy.js → HardDrive-DfGeT-m5.js} +1 -1
  20. package/dist/client/assets/{Key01-Dg2sg5rz.js → Key01-BT7T6I5X.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-DyHtiNxh.js → LinkExternal01-MJK3arz8.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-CI3k-VhI.js → LockUnlocked01-CimFA6vb.js} +1 -1
  23. package/dist/client/assets/{LogOut01-aW67KTqT.js → LogOut01-C420hUda.js} +1 -1
  24. package/dist/client/assets/{Monitor01-Jt4z_8se.js → Monitor01-DV4Ti2oc.js} +1 -1
  25. package/dist/client/assets/{Palette-B5AcVGnL.js → Palette-iuPBvzmT.js} +1 -1
  26. package/dist/client/assets/{Play-D5QeWHJJ.js → Play-C8X_8kI9.js} +1 -1
  27. package/dist/client/assets/{Plus-mJn_Nxno.js → Plus-DNcBNQ1l.js} +1 -1
  28. package/dist/client/assets/{SearchLg-DQVNdazF.js → SearchLg-CAnKh_IM.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CA5QSRSu.js → SearchMd-FU3ns_GC.js} +1 -1
  30. package/dist/client/assets/{Settings02-BDGO8rsE.js → Settings02-DSLBrgLe.js} +1 -1
  31. package/dist/client/assets/{Share07-DdLPVTmm.js → Share07-BVpDrepm.js} +1 -1
  32. package/dist/client/assets/{Shield01-BuZDakJI.js → Shield01-QKo9WGDz.js} +1 -1
  33. package/dist/client/assets/{Stars01-C0yG0Boi.js → Stars01-C1erc6ah.js} +1 -1
  34. package/dist/client/assets/{Stars02-BWMFvrRy.js → Stars02-77hFJHHr.js} +1 -1
  35. package/dist/client/assets/{Sun-sHmUBh-g.js → Sun-4GVJIdW6.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-C7vWO3Ij.js → SwitchHorizontal01-04goZTrS.js} +1 -1
  37. package/dist/client/assets/{Tool01-CtTJatwB.js → Tool01-DYZY4PWQ.js} +1 -1
  38. package/dist/client/assets/{Tool02-CI1ngiBE.js → Tool02-D1zDKM8b.js} +1 -1
  39. package/dist/client/assets/{Trash01-BsbNvzGz.js → Trash01-CxHcJ7-U.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-C6YIwZxp.js → TrendUp01-CEcTLCyA.js} +1 -1
  41. package/dist/client/assets/{Upload01-DGnwEqTw.js → Upload01-DnsFJ-yt.js} +1 -1
  42. package/dist/client/assets/{User01-Cw7EJsEI.js → User01-Dz7f_Ahs.js} +1 -1
  43. package/dist/client/assets/{UserSquare-Dtt8ddXt.js → UserSquare-ByG5LB2_.js} +1 -1
  44. package/dist/client/assets/{Users01-DrTgyK21.js → Users01-CsGr7tcB.js} +1 -1
  45. package/dist/client/assets/{Users03-gl1W5v2R.js → Users03-DwYlrHUE.js} +1 -1
  46. package/dist/client/assets/{XCircle-Dchlyhpq.js → XCircle-NTKYCotd.js} +1 -1
  47. package/dist/client/assets/{XClose-wLflqNdC.js → XClose-BjQgKIJg.js} +1 -1
  48. package/dist/client/assets/{YAxis-BbFaGwwq.js → YAxis-CdB9ibAT.js} +1 -1
  49. package/dist/client/assets/{Zap-BTW1wVdi.js → Zap-B_ptvG3q.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-DN2zBn7q.js → ZapSquare-DrcK-GLv.js} +1 -1
  51. package/dist/client/assets/{access-gate-D_nHd9kZ.js → access-gate-D5qE5E9B.js} +1 -1
  52. package/dist/client/assets/{agent-icon-BXDF6jAs.js → agent-icon-BBgMYn0a.js} +1 -1
  53. package/dist/client/assets/{agents-list-DE1iHhJo.js → agents-list-oisyQiaB.js} +1 -1
  54. package/dist/client/assets/{ai-providers-B6cfkcKh.js → ai-providers-Dwj1233E.js} +1 -1
  55. package/dist/client/assets/{alert-zqjhFucc.js → alert-CTzGpEI7.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-C-FW104j.js → alert-dialog-C2_FgYiY.js} +1 -1
  57. package/dist/client/assets/{api-keys-BgIAzbqy.js → api-keys-B0hlKogI.js} +1 -1
  58. package/dist/client/assets/{app-editor-BDlGerkt.js → app-editor-Ctmj8XFg.js} +1 -1
  59. package/dist/client/assets/{auth-DAMl9I_M.js → auth-4ioXbjAd.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-BPhhy6Y8.js → auth-catchall-D9oT_tOB.js} +1 -1
  61. package/dist/client/assets/{auth-entry-ByrwV67A.js → auth-entry-CXT-Oe4X.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-DMEBIZZH.js → auth-split-layout-mW5USr7V.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-DJnDwtZ0.js → authenticate-and-persist-oauth-DuZBQbUo.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-Dz9K3sHJ.js → automation-list-row-CNq4-XOc.js} +1 -1
  65. package/dist/client/assets/{automation-runs-Cr86E5bI.js → automation-runs-BhNbIJHf.js} +1 -1
  66. package/dist/client/assets/{automations-heEedgSM.js → automations-DEEJvUuH.js} +1 -1
  67. package/dist/client/assets/{avatar-Bmi9nn5Q.js → avatar-Dc2-4I8x.js} +1 -1
  68. package/dist/client/assets/{badge-Dx-g1IRA.js → badge-Duwq86qG.js} +1 -1
  69. package/dist/client/assets/{block-document-CbWzMrnv.js → block-document-D0VzUDn8.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-BhiXRN_C.js → breadcrumb-CtON9MYJ.js} +1 -1
  71. package/dist/client/assets/{buckets-S6wmAfoP.js → buckets-Yna-Mzwa.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-BOUad0Ic.js → bulk-category-panel-Dce-Jit4.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-wvfmmFky.js → capability-load-error-C9ifRrqL.js} +1 -1
  74. package/dist/client/assets/{cards-C5jYd8PO.js → cards-C8hPm_fD.js} +1 -1
  75. package/dist/client/assets/{category-editor-BtMrynMk.js → category-editor-D7mI8oKi.js} +1 -1
  76. package/dist/client/assets/{chart-TRxDCRUN.js → chart-A8qwSRT_.js} +1 -1
  77. package/dist/client/assets/{chat-context-BHDvq6YJ.js → chat-context-Comw2HiZ.js} +1 -1
  78. package/dist/client/assets/{checkbox-BCQz9JK-.js → checkbox-B51dKSaD.js} +1 -1
  79. package/dist/client/assets/{choose-editor-B9fUMfSk.js → choose-editor-Bw9-fJeL.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-B6f2vNgq.js → cli-auth-success-zS7YcOHm.js} +1 -1
  81. package/dist/client/assets/{collection-detail-DsC_wszt.js → collection-detail-DqdASUGq.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-B-1h_FnE.js → collection-display-button-DJ5UzFNW.js} +1 -1
  83. package/dist/client/assets/{collection-search-BDsKGK66.js → collection-search-BLsM4mlF.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-BbaoSfk6.js → collection-table-wrapper-RuNkzwWt.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-cZ0YSsgw.js → collection-tabs-CxApR68U.js} +1 -1
  86. package/dist/client/assets/{command-CqKVyCcu.js → command-DjvPjG5c.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-VbRzorHv.js → commerce-onboarding-Dnx2wY6F.js} +1 -1
  88. package/dist/client/assets/{config-BmMLvbUI.js → config-v0vr5A_6.js} +1 -1
  89. package/dist/client/assets/{connect-CmGs-YTv.js → connect-B7Hy_TT5.js} +1 -1
  90. package/dist/client/assets/{connection-BvxQAhIP.js → connection-CCt_Awqu.js} +1 -1
  91. package/dist/client/assets/{connection-card-BKCyxqwA.js → connection-card-CaXhic63.js} +1 -1
  92. package/dist/client/assets/{connection-detail-D8meM06x.js → connection-detail-CqAD3FGA.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-CSHFbl4L.js → connection-form-helpers-BUhNk8qN.js} +1 -1
  94. package/dist/client/assets/{connections-CZ5YjvrY.js → connections-BoaC4Bvv.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-BMCo6sxg.js → decopilot-sse-pool-DOnj3AhO.js} +1 -1
  96. package/dist/client/assets/{dialog-Z535A6nv.js → dialog-CQ0pLTgh.js} +1 -1
  97. package/dist/client/assets/{domain-settings-C4EqseBr.js → domain-settings-BuG09AGx.js} +1 -1
  98. package/dist/client/assets/{drawer-DWWJb1tp.js → drawer-Cj6wrBRI.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-DU7gtqVb.js → dropdown-menu-COfkZrIK.js} +1 -1
  100. package/dist/client/assets/{empty-state-BA02z1BK.js → empty-state-CEazQL4O.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-B8WC6by7.js → extract-connection-data-DNJQzhsg.js} +1 -1
  102. package/dist/client/assets/{file-explorer-DKtnVGna.js → file-explorer-tLrW3tQk.js} +1 -1
  103. package/dist/client/assets/{file-type-icon-9GxaTea7.js → file-type-icon-DYVp64k_.js} +1 -1
  104. package/dist/client/assets/{form-nXCjVrjt.js → form-BkQvNaLS.js} +1 -1
  105. package/dist/client/assets/{general-xL8b4Jab.js → general-DGounGkQ.js} +1 -1
  106. package/dist/client/assets/{github-repo-picker-C8QCEF3h.js → github-repo-picker-D5LSQ8pG.js} +1 -1
  107. package/dist/client/assets/{hooks-L_k6z2XC.js → hooks-DKlT0sot.js} +1 -1
  108. package/dist/client/assets/{index-CtLjIqRa.js → index-BDeugpUN.js} +1 -1
  109. package/dist/client/assets/{index-CAGTKaXv.js → index-BpOSKlT4.js} +1 -1
  110. package/dist/client/assets/{index-cIZLGtur.js → index-CCQTBfN2.js} +1 -1
  111. package/dist/client/assets/{index-BOPZQ8hA.js → index-CHsWxVcj.js} +1 -1
  112. package/dist/client/assets/{index-4gvmNNiv.js → index-Cg56QeyX.js} +8 -8
  113. package/dist/client/assets/{index-tl25Irbv.js → index-CnK6Bta1.js} +1 -1
  114. package/dist/client/assets/{index-BwvZM0Qi.js → index-DRWf7PV5.js} +1 -1
  115. package/dist/client/assets/{index-CTiqW6T5.js → index-hfDwwcVR.js} +3 -3
  116. package/dist/client/assets/{index-ieDA8V0R.js → index-qKZoy0Cc.js} +1 -1
  117. package/dist/client/assets/{index-redirect-DCpZf1jp.js → index-redirect-CgMeWVei.js} +1 -1
  118. package/dist/client/assets/{infra-billing-BRwO_F24.js → infra-billing-VqtXozJT.js} +1 -1
  119. package/dist/client/assets/{input-Dp8J2fC8.js → input-CNzY_Rzb.js} +1 -1
  120. package/dist/client/assets/{integration-icon-dl7iv7JV.js → integration-icon-CNdBS28K.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-B5TmBV0Y.js → invite-member-dialog-F1_Y0fXH.js} +1 -1
  122. package/dist/client/assets/{label-Dno3asie.js → label-r4xmFMU4.js} +1 -1
  123. package/dist/client/assets/{layout-CkOOMrXF.js → layout-CiAJueg3.js} +1 -1
  124. package/dist/client/assets/{login-vo1Gq_Tc.js → login-BENpyEq3.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-C5jX3Cy_.js → mcp-oauth-DGFuWfS5.js} +1 -1
  126. package/dist/client/assets/{members-Bos2830K.js → members-YzFtO5ev.js} +1 -1
  127. package/dist/client/assets/{monaco-editor-CJAsriQi.js → monaco-editor-CU-OmsML.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-DgJkPlic.js → monitoring-stats-row-Bt-VLWZw.js} +1 -1
  129. package/dist/client/assets/{multi-select-CNfsZGpL.js → multi-select-CzjEpN0G.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-D3HNYpGO.js → oauth-callback-X_dU3KI2.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-CZz7YNZM.js → oauth-callback-ai-provider-CxZ14Ri9.js} +1 -1
  132. package/dist/client/assets/{onboarding-DG4Z9JKo.js → onboarding-BFzzXCcd.js} +1 -1
  133. package/dist/client/assets/{org-layout-B0qDG6By.js → org-layout-ex1XDS-o.js} +1 -1
  134. package/dist/client/assets/{organization-choice-Dr7wW99C.js → organization-choice-D9FPRSRE.js} +1 -1
  135. package/dist/client/assets/{orgs-DL1YEtHB.js → orgs-DxbN3zJC.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-Zr2iREPb.js → page-seo-form-Cf-ViKMH.js} +1 -1
  137. package/dist/client/assets/{popover-Ds3T6--V.js → popover-BcyVmC4y.js} +1 -1
  138. package/dist/client/assets/{post-calendar-BJ_f4DAS.js → post-calendar-CF1hlOsr.js} +1 -1
  139. package/dist/client/assets/{post-editor-B3hTvXPC.js → post-editor-DHZ_d4SK.js} +1 -1
  140. package/dist/client/assets/{primitives-CMDJmofX.js → primitives-Dg3IRLzD.js} +1 -1
  141. package/dist/client/assets/{profile-DD7GQaX9.js → profile-DLSfSX_k.js} +1 -1
  142. package/dist/client/assets/{project-app-view-Crk_CR6j.js → project-app-view-BMNndfeL.js} +1 -1
  143. package/dist/client/assets/{prompts-ScoZUpLz.js → prompts-BmDVh0ws.js} +1 -1
  144. package/dist/client/assets/record-editor-NKcg5qie.js +1 -0
  145. package/dist/client/assets/{redirect-editor-D5fXCjJy.js → redirect-editor-C9MEK5tP.js} +1 -1
  146. package/dist/client/assets/registry-BnAXvc90.js +2 -0
  147. package/dist/client/assets/{registry-layout-D-b0cevb.js → registry-layout-BwbYxm9N.js} +1 -1
  148. package/dist/client/assets/{reports-CJj3Hm69.js → reports-Cv6JOAjH.js} +1 -1
  149. package/dist/client/assets/{require-capability-DFKelUky.js → require-capability-DA7XolK0.js} +1 -1
  150. package/dist/client/assets/{required-auth-layout-B4JxhFBD.js → required-auth-layout-DXGcUdi_.js} +1 -1
  151. package/dist/client/assets/{reset-password-DTjx8w1B.js → reset-password-CoN2XsO_.js} +1 -1
  152. package/dist/client/assets/{review-settings-ByTfD_63.js → review-settings-BXB-kVRj.js} +1 -1
  153. package/dist/client/assets/{roles-XM76GywL.js → roles-BEJRnhQu.js} +1 -1
  154. package/dist/client/assets/{scroll-area-BUItoJEw.js → scroll-area-DSK1yo1K.js} +1 -1
  155. package/dist/client/assets/{search-input-hSw7dEtg.js → search-input-DSr8mH-h.js} +1 -1
  156. package/dist/client/assets/{secrets-D34pfXGD.js → secrets-BbCMl_jC.js} +1 -1
  157. package/dist/client/assets/{sections-editor-jbHjNR1Q.js → sections-editor-DHI7AjTJ.js} +1 -1
  158. package/dist/client/assets/{select-BluEJ-cn.js → select-BnyV_0sM.js} +1 -1
  159. package/dist/client/assets/{select-model-BrrHMjHe.js → select-model-CBk9Q6g5.js} +1 -1
  160. package/dist/client/assets/{self-tool-result-DJpKIhD5.js → self-tool-result-CStbNEHg.js} +1 -1
  161. package/dist/client/assets/{seo-editor-BXk0FKJX.js → seo-editor-CQ376UNH.js} +1 -1
  162. package/dist/client/assets/{settings-layout-DJ3jEMwN.js → settings-layout-C8CCSUXW.js} +1 -1
  163. package/dist/client/assets/{shell-controls-DLC4wR-6.js → shell-controls-C5XPMPiB.js} +1 -1
  164. package/dist/client/assets/{shell-layout-BF97Kq7E.js → shell-layout-Cr8518wI.js} +1 -1
  165. package/dist/client/assets/{spinner-CfrbBhFL.js → spinner-lHweHuof.js} +1 -1
  166. package/dist/client/assets/{sso-Cy7qzErS.js → sso-CfG3Ejec.js} +1 -1
  167. package/dist/client/assets/{store-5ghpgyo9.js → store-DThii_RR.js} +1 -1
  168. package/dist/client/assets/store-registry-DWWnnuAx.js +2 -0
  169. package/dist/client/assets/{super-agent-icon-Clobw7s_.js → super-agent-icon-D2DtHRDf.js} +1 -1
  170. package/dist/client/assets/{switch-BU-l4Vi7.js → switch-BhMxhcPM.js} +1 -1
  171. package/dist/client/assets/{synced-repos-CtxYL0gz.js → synced-repos-DF74zA57.js} +1 -1
  172. package/dist/client/assets/{table-BHfpUU6y.js → table-CDFqt05Z.js} +1 -1
  173. package/dist/client/assets/{tabs-BL-ugAf6.js → tabs-B1WEfvwd.js} +1 -1
  174. package/dist/client/assets/{task-board-CHB4pbGC.js → task-board-B3hQ2-7o.js} +1 -1
  175. package/dist/client/assets/{tasks-LgxAgmVX.js → tasks-Ca1RFPOJ.js} +1 -1
  176. package/dist/client/assets/{textarea-BEDEvYRN.js → textarea-BKFGUGa9.js} +1 -1
  177. package/dist/client/assets/{toggle-group-BTI8QMeu.js → toggle-group-CzT0EFso.js} +1 -1
  178. package/dist/client/assets/{toolbar-DiqlKDY8.js → toolbar-BHf98zv5.js} +1 -1
  179. package/dist/client/assets/{track-DV9bbh3X.js → track-CGZ8PcXb.js} +1 -1
  180. package/dist/client/assets/{types-tIfbQvV_.js → types-Cw8IciA1.js} +1 -1
  181. package/dist/client/assets/{use-ai-providers-B6CaG5e4.js → use-ai-providers-BcjtqdRe.js} +1 -1
  182. package/dist/client/assets/{use-api-keys-B_sBVgET.js → use-api-keys-Bv_V9OQp.js} +1 -1
  183. package/dist/client/assets/{use-automations-B86nzDTz.js → use-automations-DvkmJs6u.js} +1 -1
  184. package/dist/client/assets/{use-autosave-DYn8UvUQ.js → use-autosave-cLlBhZX1.js} +1 -1
  185. package/dist/client/assets/{use-connection-CoU1moPO.js → use-connection-E8wwoXqr.js} +1 -1
  186. package/dist/client/assets/{use-copy-BTrdmL3y.js → use-copy-CW6MpO_Z.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-DSRjLnRq.js → use-create-virtual-mcp-BrDVXE7b.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-C8flEp1c.js → use-debounced-autosave-BQYTx2cc.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-BkGdyQQ5.js → use-debounced-value-jsp3NYfQ.js} +1 -1
  190. package/dist/client/assets/{use-decopilot-events-Cmx0OsaP.js → use-decopilot-events-DdCPeT8U.js} +1 -1
  191. package/dist/client/assets/{use-delete-connection-Dr76rgJg.js → use-delete-connection-xfnplKBh.js} +1 -1
  192. package/dist/client/assets/{use-deployment-admin-7X-icz8I.js → use-deployment-admin-kmJZXW93.js} +1 -1
  193. package/dist/client/assets/{use-destination-route-DwnTc7tC.js → use-destination-route-CE6d1N2I.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-BXqm5fZL.js → use-file-configs-CS4n67ai.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-CVvkug7E.js → use-infinite-scroll-BmvPUQAy.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-Ts3dSZxw.js → use-join-requests-BlAEr0Mo.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-BEWd4EQt.js → use-mcp-auth-status-DCVPcleM.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-DxnVRIWY.js → use-mcp-client-GFBol204.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-ByscarpO.js → use-mcp-tools-CHBJSZcu.js} +1 -1
  200. package/dist/client/assets/{use-members-Cq_pLKT9.js → use-members-Crk_fj-y.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-BYcWt6Vd.js → use-navigate-to-agent-BSvEJ7Wi.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-CR-BeSyC.js → use-org-auth-client-BZdGD8y7.js} +1 -1
  203. package/dist/client/assets/{use-org-repo-syncs-DvO0RfOI.js → use-org-repo-syncs-ST79VX7T.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-D2yChpte.js → use-org-sso-C52_96eV.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-B1v2_nX5.js → use-organization-roles-WzTUS6XK.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-BCm5JttM.js → use-organization-settings-BkAx5o44.js} +1 -1
  207. package/dist/client/assets/{use-panel-navigate-Dl0rAqWo.js → use-panel-navigate-Ea0dXsnr.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-BkyFmAuG.js → use-registry-connections-D36B4ENk.js} +1 -1
  209. package/dist/client/assets/{use-secrets-CcZMbMn6.js → use-secrets-oOa_12QZ.js} +1 -1
  210. package/dist/client/assets/{use-section-preview-base-BIfEUNvz.js → use-section-preview-base-CrIqtEHX.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-BleJjCww.js → use-status-sounds-DjDJh6pM.js} +1 -1
  212. package/dist/client/assets/{use-tags-CIfQ8rYG.js → use-tags-5r-oBP4s.js} +1 -1
  213. package/dist/client/assets/{use-view-mode-CSmXRXsY.js → use-view-mode-DPrUKWec.js} +1 -1
  214. package/dist/client/assets/{use-virtual-mcp-l6_pBHi7.js → use-virtual-mcp-_p4l4e2k.js} +1 -1
  215. package/dist/client/assets/useInfiniteQuery-3deRYuPO.js +1 -0
  216. package/dist/client/assets/useSuspenseInfiniteQuery-BVsdxvmi.js +1 -0
  217. package/dist/client/assets/{users-BN92pmnc.js → users-CXruwu_K.js} +1 -1
  218. package/dist/client/assets/{variant-calendar-CTIX2z1j.js → variant-calendar-BbDc8oLp.js} +1 -1
  219. package/dist/client/assets/{view-mode-toggle-BkV6Wd95.js → view-mode-toggle-Dj_-j0fe.js} +1 -1
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +2 -2
  222. package/dist/server/server.js +2 -2
  223. package/package.json +1 -1
  224. package/dist/client/assets/record-editor-DxN_s97_.js +0 -1
  225. package/dist/client/assets/registry-Cq711che.js +0 -2
  226. package/dist/client/assets/store-registry-D58RvhNi.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-Ch0H7Whz.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-C-qEcz5m.js +0 -1
@@ -1 +1 @@
1
- import{c as K,b as X,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-CTiqW6T5.js";import{r as gt,W as at,aE as bt}from"./agent-icon-BXDF6jAs.js";import{i as vt}from"./ChevronRight-C_5VGoy2.js";import{L as yt}from"./label-Dno3asie.js";import{S as lt}from"./scroll-area-BUItoJEw.js";import{S as jt}from"./switch-BU-l4Vi7.js";import{V as Tt}from"./view-mode-toggle-BkV6Wd95.js";import{bQ as ct,bR as mt,bS as Nt,bT as _t,bU as kt,bV as U,bW as wt}from"./index-4gvmNNiv.js";import"./AlertCircle-DSEb3qWj.js";import"./UserSquare-Dtt8ddXt.js";import"./Tool01-CtTJatwB.js";import"./ArrowUp-DBslL4md.js";import"./ArrowLeft-BRYoQykq.js";import"./Tool02-CI1ngiBE.js";import"./XCircle-Dchlyhpq.js";import"./TrendUp01-C6YIwZxp.js";import"./ZapSquare-DN2zBn7q.js";import"./Users03-gl1W5v2R.js";import"./CheckCircle-BYMziWRm.js";import"./Check-ywOUjxNZ.js";import"./ChevronDown-BK2x9ktj.js";import"./ChevronSelectorVertical-CjacNUaW.js";import"./ChevronUp-s-yNPAnM.js";import"./DotsVertical-DTh19B0M.js";import"./Stars02-BWMFvrRy.js";import"./Copy01-y7XLTRKL.js";import"./CreditCard01-CwnCPsZ_.js";import"./Download01-DC3Ut705.js";import"./Settings02-BDGO8rsE.js";import"./Eye-Bq4EvBN4.js";import"./FilterLines-kvH9nYL6.js";import"./Share07-DdLPVTmm.js";import"./Globe01-DDr24BXY.js";import"./Globe04-LmJhN0rZ.js";import"./SwitchHorizontal01-C7vWO3Ij.js";import"./HardDrive-WhGpNPAy.js";import"./Key01-Dg2sg5rz.js";import"./LinkExternal01-DyHtiNxh.js";import"./LockUnlocked01-CI3k-VhI.js";import"./LogOut01-aW67KTqT.js";import"./Monitor01-Jt4z_8se.js";import"./Sun-sHmUBh-g.js";import"./Palette-B5AcVGnL.js";import"./Play-D5QeWHJJ.js";import"./Plus-mJn_Nxno.js";import"./SearchLg-DQVNdazF.js";import"./SearchMd-CA5QSRSu.js";import"./Shield01-BuZDakJI.js";import"./Stars01-C0yG0Boi.js";import"./Trash01-BsbNvzGz.js";import"./Upload01-DGnwEqTw.js";import"./User01-Cw7EJsEI.js";import"./Users01-DrTgyK21.js";import"./XClose-wLflqNdC.js";import"./Zap-BTW1wVdi.js";import"./select-BluEJ-cn.js";import"./chat-context-BHDvq6YJ.js";import"./use-panel-navigate-Dl0rAqWo.js";import"./dialog-Z535A6nv.js";import"./use-destination-route-DwnTc7tC.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-L_k6z2XC.js";import"./use-mcp-client-DxnVRIWY.js";import"./auth-DAMl9I_M.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BMCo6sxg.js";import"./task-board-CHB4pbGC.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-l6_pBHi7.js";import"./use-ai-providers-B6CaG5e4.js";import"./use-decopilot-events-Cmx0OsaP.js";import"./use-organization-settings-BCm5JttM.js";import"./automation-runs-Cr86E5bI.js";import"./useInfiniteQuery-Ch0H7Whz.js";import"./use-infinite-scroll-CVvkug7E.js";import"./use-connection-CoU1moPO.js";import"./table-BHfpUU6y.js";import"./empty-state-BA02z1BK.js";import"./use-members-Cq_pLKT9.js";import"./use-org-auth-client-CR-BeSyC.js";import"./use-automations-B86nzDTz.js";import"./useSuspenseInfiniteQuery-C-qEcz5m.js";import"./avatar-Bmi9nn5Q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BTrdmL3y.js";import"./monaco-editor-CJAsriQi.js";import"./spinner-CfrbBhFL.js";import"./types-tIfbQvV_.js";import"./shell-layout-BF97Kq7E.js";import"./required-auth-layout-B4JxhFBD.js";import"./use-org-sso-D2yChpte.js";import"./integration-icon-dl7iv7JV.js";import"./use-navigate-to-agent-BYcWt6Vd.js";import"./chart-TRxDCRUN.js";import"./index-cIZLGtur.js";import"./form-nXCjVrjt.js";import"./input-Dp8J2fC8.js";import"./file-type-icon-9GxaTea7.js";import"./drawer-DWWJb1tp.js";import"./collection-search-BDsKGK66.js";import"./tabs-BL-ugAf6.js";import"./toggle-group-BTI8QMeu.js";import"./super-agent-icon-Clobw7s_.js";import"./self-tool-result-DJpKIhD5.js";import"./alert-dialog-C-FW104j.js";import"./extract-connection-data-B8WC6by7.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BkGdyQQ5.js";import"./authenticate-and-persist-oauth-DJnDwtZ0.js";import"./mcp-oauth-C5jX3Cy_.js";import"./track-DV9bbh3X.js";import"./popover-Ds3T6--V.js";import"./toolbar-DiqlKDY8.js";import"./github-repo-picker-C8QCEF3h.js";import"./use-mcp-tools-ByscarpO.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-BKCyxqwA.js";import"./use-registry-connections-BkyFmAuG.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BEDEvYRN.js";import"./connection-form-helpers-CSHFbl4L.js";import"./collection-tabs-cZ0YSsgw.js";import"./badge-Dx-g1IRA.js";import"./select-model-BrrHMjHe.js";import"./checkbox-BCQz9JK-.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-C5jYd8PO.js";import"./dropdown-menu-DU7gtqVb.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BleJjCww.js";import"./use-file-configs-BXqm5fZL.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-C8flEp1c.js";import"./search-input-hSw7dEtg.js";import"./use-mcp-auth-status-BEWd4EQt.js";import"./use-secrets-CcZMbMn6.js";import"./AreaChart-xxxXT_V7.js";import"./config-BmMLvbUI.js";import"./command-CqKVyCcu.js";import"./index-CtLjIqRa.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-BhiXRN_C.js";import"./use-tags-CIfQ8rYG.js";import"./automation-list-row-Dz9K3sHJ.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-DvO0RfOI.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Rt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Lt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",s=typeof r=="string";if(!n&&!s)return null;const i=n?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||n&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!n,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const n=Lt(e);n&&t.push(n);return}if(St.has(r)){const n=e.matchers;if(Array.isArray(n))for(const s of n)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function J(e,t,r,n,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(n);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&J(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)J(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&J(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))J(n,r,Rt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=X();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Bt(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function Wt(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${ot}px, #000 calc(100% - ${ot}px), ${n})`}function ft(e){const t=K.c(26),{variant:r,color:n,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=Wt(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==n.bg||t[10]!==n.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:n.bg,color:n.text,borderRadius:4,...f,...g,...u,...s},t[9]=n.bg,t[10]=n.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=o.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=o.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=o.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function Qn(e){const t=K.c(72),{decofile:r}=e,n=X(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(zt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(V=>s==="calendar"?U(V,-1):U(V,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(V=>s==="calendar"?U(V,1):U(V,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==n?(v=n("sandbox.variantCalendar.today"),t[10]=n,t[11]=v):v=t[11];let y;t[12]!==v?(y=o.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==n?(N=n("sandbox.variantCalendar.previous"),t[14]=n,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==n?(k=n("sandbox.variantCalendar.next"),t[20]=n,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const R=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==R||t[29]!==M?(w=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[R," ",M]}),t[28]=R,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let L;t[36]!==p||t[37]!==l||t[38]!==n?(L=p>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),o.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:n("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=n,t[39]=L):L=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx(at,{}),t[40]=B):B=t[40];let I;t[41]!==n?(I=n("sandbox.variantCalendar.calendarMode"),t[41]=n,t[42]=I):I=t[42];let S;t[43]!==I?(S={value:"calendar",icon:B,label:I},t[43]=I,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==n?(D=n("sandbox.variantCalendar.timelineMode"),t[46]=n,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:F,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let H;t[53]!==P||t[54]!==s?(H=o.jsx(Tt,{value:s,onValueChange:i,options:P}),t[53]=P,t[54]=s,t[55]=H):H=t[55];let W;t[56]!==L||t[57]!==H?(W=o.jsxs("div",{className:"flex items-center gap-4",children:[L,H]}),t[56]=L,t[57]=H,t[58]=W):W=t[58];let z;t[59]!==j||t[60]!==W?(z=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,W]}),t[59]=j,t[60]=W,t[61]=z):z=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?o.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?o.jsx(qt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let Q;return t[69]!==z||t[70]!==G?(Q=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[z,G]}),t[69]=z,t[70]=G,t[71]=Q):Q=t[71],Q}function zt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,n=r===void 0?0:r,s=X();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Qt=6;function qt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(Jt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Jt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,q),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:q},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,L]=w,B=dt(s,j),I=L[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:Y},children:I})}),L.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),H=h(new Date(O))-P;return o.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let R;t[16]!==k||t[17]!==C||t[18]!==$?(R=o.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=R):R=t[19];let M;return t[20]!==b||t[21]!==R?(M=o.jsx(b,{className:E,children:R}),t[20]=b,t[21]=R,t[22]=M):M=t[22],M}function ee(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function ne(e,t){return e[0].localeCompare(t[0])}export{Qn as VariantCalendar};
1
+ import{c as K,b as X,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-hfDwwcVR.js";import{r as gt,W as at,aE as bt}from"./agent-icon-BBgMYn0a.js";import{i as vt}from"./ChevronRight-Djke9iFl.js";import{L as yt}from"./label-r4xmFMU4.js";import{S as lt}from"./scroll-area-DSK1yo1K.js";import{S as jt}from"./switch-BhMxhcPM.js";import{V as Tt}from"./view-mode-toggle-Dj_-j0fe.js";import{bQ as ct,bR as mt,bS as Nt,bT as _t,bU as kt,bV as U,bW as wt}from"./index-Cg56QeyX.js";import"./AlertCircle-BGJNJ8jR.js";import"./UserSquare-ByG5LB2_.js";import"./Tool01-DYZY4PWQ.js";import"./ArrowUp-DPWNHKMD.js";import"./ArrowLeft-vStnf-9n.js";import"./Tool02-D1zDKM8b.js";import"./XCircle-NTKYCotd.js";import"./TrendUp01-CEcTLCyA.js";import"./ZapSquare-DrcK-GLv.js";import"./Users03-DwYlrHUE.js";import"./CheckCircle-meV6cQbM.js";import"./Check-Cl4dPY-m.js";import"./ChevronDown-BQONwVDk.js";import"./ChevronSelectorVertical-B7QJMaL_.js";import"./ChevronUp-Ct2QooGc.js";import"./DotsVertical-CDuHkoBW.js";import"./Stars02-77hFJHHr.js";import"./Copy01-WTofvHOn.js";import"./CreditCard01-L84SI4a2.js";import"./Download01-BeBUScju.js";import"./Settings02-DSLBrgLe.js";import"./Eye-BfjfxUqI.js";import"./FilterLines-CniID4FB.js";import"./Share07-BVpDrepm.js";import"./Globe01-W3yWLLY-.js";import"./Globe04-C2AZPxqA.js";import"./SwitchHorizontal01-04goZTrS.js";import"./HardDrive-DfGeT-m5.js";import"./Key01-BT7T6I5X.js";import"./LinkExternal01-MJK3arz8.js";import"./LockUnlocked01-CimFA6vb.js";import"./LogOut01-C420hUda.js";import"./Monitor01-DV4Ti2oc.js";import"./Sun-4GVJIdW6.js";import"./Palette-iuPBvzmT.js";import"./Play-C8X_8kI9.js";import"./Plus-DNcBNQ1l.js";import"./SearchLg-CAnKh_IM.js";import"./SearchMd-FU3ns_GC.js";import"./Shield01-QKo9WGDz.js";import"./Stars01-C1erc6ah.js";import"./Trash01-CxHcJ7-U.js";import"./Upload01-DnsFJ-yt.js";import"./User01-Dz7f_Ahs.js";import"./Users01-CsGr7tcB.js";import"./XClose-BjQgKIJg.js";import"./Zap-B_ptvG3q.js";import"./select-BnyV_0sM.js";import"./chat-context-Comw2HiZ.js";import"./use-panel-navigate-Ea0dXsnr.js";import"./dialog-CQ0pLTgh.js";import"./use-destination-route-CE6d1N2I.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DKlT0sot.js";import"./use-mcp-client-GFBol204.js";import"./auth-4ioXbjAd.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DOnj3AhO.js";import"./task-board-B3hQ2-7o.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-_p4l4e2k.js";import"./use-ai-providers-BcjtqdRe.js";import"./use-decopilot-events-DdCPeT8U.js";import"./use-organization-settings-BkAx5o44.js";import"./automation-runs-BhNbIJHf.js";import"./useInfiniteQuery-3deRYuPO.js";import"./use-infinite-scroll-BmvPUQAy.js";import"./use-connection-E8wwoXqr.js";import"./table-CDFqt05Z.js";import"./empty-state-CEazQL4O.js";import"./use-members-Crk_fj-y.js";import"./use-org-auth-client-BZdGD8y7.js";import"./use-automations-DvkmJs6u.js";import"./useSuspenseInfiniteQuery-BVsdxvmi.js";import"./avatar-Dc2-4I8x.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CW6MpO_Z.js";import"./monaco-editor-CU-OmsML.js";import"./spinner-lHweHuof.js";import"./types-Cw8IciA1.js";import"./shell-layout-Cr8518wI.js";import"./required-auth-layout-DXGcUdi_.js";import"./use-org-sso-C52_96eV.js";import"./integration-icon-CNdBS28K.js";import"./use-navigate-to-agent-BSvEJ7Wi.js";import"./chart-A8qwSRT_.js";import"./index-CCQTBfN2.js";import"./form-BkQvNaLS.js";import"./input-CNzY_Rzb.js";import"./file-type-icon-DYVp64k_.js";import"./drawer-Cj6wrBRI.js";import"./collection-search-BLsM4mlF.js";import"./tabs-B1WEfvwd.js";import"./toggle-group-CzT0EFso.js";import"./super-agent-icon-D2DtHRDf.js";import"./self-tool-result-CStbNEHg.js";import"./alert-dialog-C2_FgYiY.js";import"./extract-connection-data-DNJQzhsg.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-jsp3NYfQ.js";import"./authenticate-and-persist-oauth-DuZBQbUo.js";import"./mcp-oauth-DGFuWfS5.js";import"./track-CGZ8PcXb.js";import"./popover-BcyVmC4y.js";import"./toolbar-BHf98zv5.js";import"./github-repo-picker-D5LSQ8pG.js";import"./use-mcp-tools-CHBJSZcu.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-CaXhic63.js";import"./use-registry-connections-D36B4ENk.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BKFGUGa9.js";import"./connection-form-helpers-BUhNk8qN.js";import"./collection-tabs-CxApR68U.js";import"./badge-Duwq86qG.js";import"./select-model-CBk9Q6g5.js";import"./checkbox-B51dKSaD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-C8hPm_fD.js";import"./dropdown-menu-COfkZrIK.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DjDJh6pM.js";import"./use-file-configs-CS4n67ai.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-BQYTx2cc.js";import"./search-input-DSr8mH-h.js";import"./use-mcp-auth-status-DCVPcleM.js";import"./use-secrets-oOa_12QZ.js";import"./AreaChart-ePQ68UV-.js";import"./config-v0vr5A_6.js";import"./command-DjvPjG5c.js";import"./index-BDeugpUN.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-CtON9MYJ.js";import"./use-tags-5r-oBP4s.js";import"./automation-list-row-CNq4-XOc.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-ST79VX7T.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Rt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Lt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",s=typeof r=="string";if(!n&&!s)return null;const i=n?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||n&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!n,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const n=Lt(e);n&&t.push(n);return}if(St.has(r)){const n=e.matchers;if(Array.isArray(n))for(const s of n)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function J(e,t,r,n,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(n);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&J(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)J(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&J(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))J(n,r,Rt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=X();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Bt(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function Wt(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${ot}px, #000 calc(100% - ${ot}px), ${n})`}function ft(e){const t=K.c(26),{variant:r,color:n,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=Wt(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==n.bg||t[10]!==n.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:n.bg,color:n.text,borderRadius:4,...f,...g,...u,...s},t[9]=n.bg,t[10]=n.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=o.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=o.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=o.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function Qn(e){const t=K.c(72),{decofile:r}=e,n=X(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(zt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(V=>s==="calendar"?U(V,-1):U(V,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(V=>s==="calendar"?U(V,1):U(V,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==n?(v=n("sandbox.variantCalendar.today"),t[10]=n,t[11]=v):v=t[11];let y;t[12]!==v?(y=o.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==n?(N=n("sandbox.variantCalendar.previous"),t[14]=n,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==n?(k=n("sandbox.variantCalendar.next"),t[20]=n,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const R=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==R||t[29]!==M?(w=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[R," ",M]}),t[28]=R,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let L;t[36]!==p||t[37]!==l||t[38]!==n?(L=p>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),o.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:n("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=n,t[39]=L):L=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx(at,{}),t[40]=B):B=t[40];let I;t[41]!==n?(I=n("sandbox.variantCalendar.calendarMode"),t[41]=n,t[42]=I):I=t[42];let S;t[43]!==I?(S={value:"calendar",icon:B,label:I},t[43]=I,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==n?(D=n("sandbox.variantCalendar.timelineMode"),t[46]=n,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:F,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let H;t[53]!==P||t[54]!==s?(H=o.jsx(Tt,{value:s,onValueChange:i,options:P}),t[53]=P,t[54]=s,t[55]=H):H=t[55];let W;t[56]!==L||t[57]!==H?(W=o.jsxs("div",{className:"flex items-center gap-4",children:[L,H]}),t[56]=L,t[57]=H,t[58]=W):W=t[58];let z;t[59]!==j||t[60]!==W?(z=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,W]}),t[59]=j,t[60]=W,t[61]=z):z=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?o.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?o.jsx(qt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let Q;return t[69]!==z||t[70]!==G?(Q=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[z,G]}),t[69]=z,t[70]=G,t[71]=Q):Q=t[71],Q}function zt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,n=r===void 0?0:r,s=X();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Qt=6;function qt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(Jt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Jt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,q),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:q},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,L]=w,B=dt(s,j),I=L[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:Y},children:I})}),L.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),H=h(new Date(O))-P;return o.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let R;t[16]!==k||t[17]!==C||t[18]!==$?(R=o.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=R):R=t[19];let M;return t[20]!==b||t[21]!==R?(M=o.jsx(b,{className:E,children:R}),t[20]=b,t[21]=R,t[22]=M):M=t[22],M}function ee(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function ne(e,t){return e[0].localeCompare(t[0])}export{Qn as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as C,n as f,j as i,ab as k,a8 as I,a9 as P}from"./index-CTiqW6T5.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function A(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:L,fullWidth:R,className:z}=E,_=L===void 0?"sm":L,m=R===void 0?!1:R;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const T=C.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=C.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),b=T.current[e];b&&S({left:b.offsetLeft,width:b.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),C.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==m||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,b)=>{const j=i.jsxs("button",{ref:V=>{T.current[b]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",m?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=m,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=m?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{A as V};
1
+ import{c as $,r as C,n as f,j as i,ab as k,a8 as I,a9 as P}from"./index-hfDwwcVR.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function A(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:L,fullWidth:R,className:z}=E,_=L===void 0?"sm":L,m=R===void 0?!1:R;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const T=C.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=C.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),b=T.current[e];b&&S({left:b.offsetLeft,width:b.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),C.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==m||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,b)=>{const j=i.jsxs("button",{ref:V=>{T.current[b]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",m?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=m,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=m?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{A as V};
@@ -50,7 +50,7 @@
50
50
  <meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
51
51
  <meta name="twitter:image" content="/og-image.png" />
52
52
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
53
- <script type="module" crossorigin src="/assets/index-CTiqW6T5.js"></script>
53
+ <script type="module" crossorigin src="/assets/index-hfDwwcVR.js"></script>
54
54
  <link rel="stylesheet" crossorigin href="/assets/index-DJSuP9VA.css">
55
55
  </head>
56
56
  <body>
@@ -1489,7 +1489,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var Yn1=L(()=>{sf()});f
1489
1489
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await Ty`
1490
1490
  DELETE FROM kysely_migration WHERE name = ${Q}
1491
1491
  `.execute($)}}async function Qs1($){await Ke8($),await We8($);let Z=new $s1({db:$,provider:{getMigrations:()=>Promise.resolve(Xn0)}}),{error:Q,results:X}=await Z.migrateToLatest(),Y=0;if(X?.forEach((G)=>{if(G.status==="Success")Y++;else if(G.status==="Error")console.error(`Failed to execute migration "${G.migrationName}"`)}),Q)throw console.error("Failed to migrate"),console.error(Q),Q;return Y}async function He8($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await tl0();let G=Q??F8(),J=async()=>{if(!Z&&!Q)await QO(G).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await Qs1(G.db);return await J(),{betterAuth:Y,kysely:K}}catch(K){throw await J(),K}}async function Fe8(){let $=F8(),Z=new $s1({db:$.db,provider:{getMigrations:()=>Promise.resolve(Xn0)}}),{error:Q,results:X}=await Z.migrateDown();if(X?.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}"`)}),Q)throw console.error("Failed to rollback migration"),console.error(Q),Q}var Ys1=L(()=>{ea1();ol0();GQ()});async function A70($){let Z={...process.env},Q=O80($,Z);console.log(JE1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?ft1(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (qZ0(),IZ0)),{outputs:G,services:J}=await Y({home:Q.settings.dataDir,externalDatabaseUrl:Q.externalDatabaseUrl,externalNatsUrl:Q.externalNatsUrl});if(!Q.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (ol0(),yt1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (GQ(),en1)),{migrateToLatest:F}=await Promise.resolve().then(() => (Ys1(),Xs1)),N=H(G.databaseUrl);await F({keepOpen:!0,database:N,skipBetterAuth:!0})}let K={...Q.settings,betterAuthSecret:X,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}:{}};return Gn1(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 Yn0=L(()=>{sf();bt1();R$()});var Ws1={};$0(Ws1,{updateService:()=>nE,subscribeCliState:()=>Kn0,setTuiConsoleIntercepted:()=>T70,setServerUrl:()=>Ep,setMigrationsDone:()=>wp,setDevMode:()=>Ue8,resetCliStateForTests:()=>Ne8,isTuiConsoleIntercepted:()=>R70,getCliState:()=>Jn0,addLogEntry:()=>HO});function Gs1(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function Js1(){return{services:Gs1(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function Ne8(){lX=Js1()}function Dp(){for(let $ of Gn0)$()}function Jn0(){return lX}function Kn0($){return Gn0.add($),()=>Gn0.delete($)}function nE($){lX={...lX,services:lX.services.map((Z)=>Z.name===$.name?$:Z)},Dp()}function wp(){lX={...lX,migrationsStatus:"done"},Dp()}function Ep($){lX={...lX,serverUrl:$},Dp()}function HO($){let Z=[...lX.logs,$];lX={...lX,logs:Z.length>500?Z.slice(-500):Z},Dp()}function Ue8(){lX={...lX,services:[...Gs1(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},Dp()}function T70($){Ks1=$}function R70(){return Ks1}var lX,Gn0,Ks1=!1;var tE=L(()=>{lX=Js1();Gn0=new Set});import{createServer as Hs1}from"net";function Be8($){return new Promise((Z)=>{let Q=Hs1();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function jp($){if(await Be8($))return $;let Z=await new Promise((Q,X)=>{let Y=Hs1();Y.once("error",X),Y.listen(0,"0.0.0.0",()=>{let G=Y.address(),J=typeof G==="object"&&G?G.port:0;Y.close(()=>Q(J))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var Wn0=()=>{};var Fn0={};$0(Fn0,{startDevServer:()=>Le8,pipeToLogStore:()=>Hn0});import{join as Oe8}from"path";function Hn0($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let G=X.split(`
1492
- `);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;HO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:G,value:J}=await Z.read();if(G)break;X+=Q.decode(J,{stream:!0}),Y()}}catch{}if(X.trim()){let G=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(G)HO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function Le8($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=X?await jp(Number(Y)+1):await jp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await A70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)nE({name:D.name,status:"ready",port:D.port});wp();let F=Oe8(import.meta.dir,"..","..","..","..",".."),N=Q===!0,U=Bun.spawn(["bun","run","dev:servers"],{cwd:F,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.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)Hn0(U.stdout),Hn0(U.stderr);Ep(G),nE({name:"Vite",status:"ready",port:Number(Y)}),nE({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(U.kill(D),await U.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (qZ0(),IZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var Nn0=L(()=>{Yn0();tE();Wn0()});var I70;var Un0=L(()=>{I70={name:"decocms",version:"4.305.7",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","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.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","@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 we8,Text as Fs1}from"ink";import{jsx as Ee8,jsxs as Ns1}from"react/jsx-runtime";function Us1({version:$}){return Ns1(we8,{flexDirection:"column",marginTop:1,children:[oZ0.map((Z,Q)=>Ee8(Fs1,{color:rZ0[Q],children:Z},Q)),Ns1(Fs1,{dimColor:!0,children:[" v",$]})]})}var Bs1=L(()=>{Yp()});import{Box as oE,Text as FO}from"ink";import{Spinner as je8}from"@inkjs/ui";import{jsx as YG,jsxs as Ry}from"react/jsx-runtime";function Os1({status:$}){if($==="pending")return YG(je8,{label:""});return YG(FO,{color:"green",children:"\u2713"})}function ze8($){return`${$.name}: ${$.port||"...."}`}function Ls1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Ry(oE,{flexDirection:"column",paddingBottom:1,children:[YG(Us1,{version:I70.version}),YG(oE,{marginBottom:1,children:YG(FO,{dimColor:!0,children:"\u2500".repeat(80)})}),YG(oE,{children:Ry(FO,{dimColor:!0,children:["Home: ",Q]})}),Ry(oE,{gap:2,children:[$.map((Y)=>Ry(oE,{gap:1,children:[YG(FO,{children:ze8(Y)}),YG(Os1,{status:Y.status})]},Y.name)),Ry(oE,{gap:1,children:[YG(FO,{children:"Migrations"}),YG(Os1,{status:Z})]})]}),YG(oE,{children:X?Ry(FO,{children:["Open in browser: ",YG(FO,{color:"cyan",children:X})]}):YG(FO,{dimColor:!0,children:"Starting..."})})]})}var Ds1=L(()=>{Un0();Bs1()});import{Box as Pe8,Text as zp}from"ink";import{jsx as Bn0,jsxs as On0}from"react/jsx-runtime";function Ae8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function ws1({logs:$}){return Bn0(Pe8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return Bn0(zp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return On0(zp,{children:[On0(zp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Bn0(zp,{color:Ae8(Z.status),children:Z.status}),On0(zp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Es1=()=>{};var Ln0={};$0(Ln0,{App:()=>Ie8});import{Box as Te8}from"ink";import{useSyncExternalStore as Re8}from"react";import{jsx as js1,jsxs as qe8}from"react/jsx-runtime";function Ie8({home:$}){let Z=Re8(Kn0,Jn0);return qe8(Te8,{flexDirection:"column",children:[js1(Ls1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),js1(ws1,{logs:Z.logs})]})}var Dn0=L(()=>{Ds1();Es1();tE()});var i3="thread-gate",BN="decopilot-hosted-harness",ON="decopilot-hosted-harness-sandboxed",EJ="automations",NO="background-tools",rE="task-board-github-reads",UO="jira-push";var zs1="10";function Ps1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:zs1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var As1=()=>{};import Me8 from"pg";async function Rs1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=Ve8}=$,Y=$.log??((W)=>console.log(W)),G=new Me8.Client({connectionString:Q});await G.connect();let J=Date.now(),K=!1;try{while(!K){if(K=(await G.query("SELECT pg_try_advisory_lock($1) AS locked",[Ts1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-J>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await H$(ke8)}let W=Date.now()-J;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await G.query("SELECT pg_advisory_unlock($1)",[Ts1.toString()])}catch{}await G.end().catch(()=>{})}}var Ts1=8314027461559302n,Ve8=600000,ke8=500;var Is1=L(()=>{J4()});function Se8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function wn0($,Z){for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X===Z)return $[Q+1];if(X.startsWith(`${Z}=`))return X.slice(Z.length+1)}return}function qs1(){let $=Se8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:wn0($,"--cpu-prof-dir")??process.cwd(),name:wn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(wn0($,"--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 Ms1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=mE();if(!Q)return;let X={};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);X={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:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),q70=setInterval(()=>void Z().catch(()=>{}),$),q70.unref?.(),process.on("SIGUSR2",()=>{try{let Q=Bun.generateHeapSnapshot("v8"),X=typeof Q==="string"?Q:JSON.stringify(Q),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,X),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(Q){console.error("[heap-watch] snapshot failed:",Q)}}),()=>{if(q70)clearInterval(q70)}}var q70;var Vs1=()=>{};import*as Ce8 from"bun:jsc";function ks1(){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{_e8()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-X;X=G+Z;let K=[];try{K=ve8()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let F of K){let N=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!N)continue;let U=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${U}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,N)=>N[1]-F[1]).slice(0,8).map(([F,N])=>({frame:F,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var _e8,ve8;var Ss1=L(()=>{({startSamplingProfiler:_e8,samplingProfilerStackTraces:ve8}=Ce8)});function Cs1(){qs1();let $=[Ms1(),in1(),ks1()];return()=>{for(let Z of $)Z()}}var _s1=L(()=>{hl0();Vs1();Ss1()});var aE=v((vs1)=>{Object.defineProperty(vs1,"__esModule",{value:!0});vs1.RepublishHeaders=vs1.DirectMsgHeaders=vs1.JsHeaders=vs1.AdvisoryKind=void 0;vs1.isOrderedPushConsumerOptions=xe8;vs1.isPullConsumer=fe8;vs1.isPushConsumer=be8;vs1.isBoundPushConsumerOptions=ye8;function xe8($){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 fe8($){return $.isPullConsumer()}function be8($){return $.isPushConsumer()}function ye8($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}vs1.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"};vs1.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"};vs1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};vs1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var GG=v((fs1)=>{Object.defineProperty(fs1,"__esModule",{value:!0});fs1.TD=fs1.TE=fs1.Empty=void 0;fs1.encode=pe8;fs1.decode=ne8;fs1.Empty=new Uint8Array(0);fs1.TE=new TextEncoder;fs1.TD=new TextDecoder;function ie8(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}function pe8(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(fs1.TE.encode($[Q]));if(Z.length===0)return fs1.Empty;if(Z.length===1)return Z[0];return ie8(...Z)}function ne8($){if(!$||$.length===0)return"";return fs1.TD.decode($)}});var JG=v((gs1)=>{Object.defineProperty(gs1,"__esModule",{value:!0});gs1.errors=gs1.PermissionViolationError=gs1.NoRespondersError=gs1.TimeoutError=gs1.RequestError=gs1.ProtocolError=gs1.ConnectionError=gs1.DrainingConnectionError=gs1.ClosedConnectionError=gs1.AuthorizationError=gs1.UserAuthenticationExpiredError=gs1.InvalidOperationError=gs1.InvalidArgumentError=gs1.InvalidSubjectError=void 0;class jn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}gs1.InvalidSubjectError=jn0;class M70 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,Q){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((X)=>`'${X}'`),$=$.join(",");else $=`'${$}'`;return new M70(`${$} ${Z}`,Q)}}gs1.InvalidArgumentError=M70;class zn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}gs1.InvalidOperationError=zn0;class V70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new V70($);return null}}gs1.UserAuthenticationExpiredError=V70;class k70 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],Q=$.toLowerCase();for(let X=0;X<Z.length;X++)if(Q.indexOf(Z[X])!==-1)return new k70($);return null}}gs1.AuthorizationError=k70;class Pn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}gs1.ClosedConnectionError=Pn0;class An0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}gs1.DrainingConnectionError=An0;class Tn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}gs1.ConnectionError=Tn0;class Rn0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}gs1.ProtocolError=Rn0;class In0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof S70}}gs1.RequestError=In0;class qn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}gs1.TimeoutError=qn0;class S70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}gs1.NoRespondersError=S70;class C70 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(Q=G[1].toLowerCase(),X=G[2],Q==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new C70($,Q,X,Y)}}gs1.PermissionViolationError=C70;gs1.errors={AuthorizationError:k70,ClosedConnectionError:Pn0,ConnectionError:Tn0,DrainingConnectionError:An0,InvalidArgumentError:M70,InvalidOperationError:zn0,InvalidSubjectError:jn0,NoRespondersError:S70,PermissionViolationError:C70,ProtocolError:Rn0,RequestError:In0,TimeoutError:qn0,UserAuthenticationExpiredError:V70}});var p3=v((ms1)=>{Object.defineProperty(ms1,"__esModule",{value:!0});ms1.SimpleMutex=ms1.Perf=void 0;ms1.extend=F04;ms1.render=N04;ms1.timeout=U04;ms1.delay=B04;ms1.deadline=O04;ms1.deferred=Vn0;ms1.debugDeferred=L04;ms1.shuffle=D04;ms1.collect=w04;ms1.jitter=ls1;ms1.backoff=E04;ms1.nanos=j04;ms1.millis=z04;ms1.randomToken=T04;var H04=GG(),Mn0=JG();function F04($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function N04($){return H04.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function U04($,Z=!0){let Q=Z?new Mn0.TimeoutError:null,X,Y,G=new Promise((J,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new Mn0.TimeoutError);else K(Q)},$)});return Object.assign(G,X)}function B04($=0){let Z,Q=new Promise((X)=>{let Y=setTimeout(()=>{X()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),X()}}});return Object.assign(Q,Z)}async function O04($,Z=1000){let Q=Vn0(),X=setTimeout(()=>{Q.reject(new Mn0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function Vn0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function L04(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function D04($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function w04($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class us1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,Q){let X=this.timers.get(Z);if(X===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(Q);if(Y===void 0)throw Error(`${Q} is not defined`);this.measures.set($,Y-X)}getEntries(){let $=[];return this.measures.forEach((Z,Q)=>{$.push({name:Q,duration:Z})}),$}}ms1.Perf=us1;class cs1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Vn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}ms1.SimpleMutex=cs1;function ls1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function E04($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(Q){return ls1(Q>Z?$[Z]:$[Q])}}}function j04($){return $*1e6}function z04($){return Math.floor($/1e6)}var P04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",LN=new Uint8Array(62);for(let $=0;$<62;$++)LN[$]=P04.charCodeAt($);var A04=218340105584896;function T04(){let $=Math.floor(Math.random()*A04),Z=$%62,Q=LN[Z];$=($-Z)/62,Z=$%62;let X=LN[Z];$=($-Z)/62,Z=$%62;let Y=LN[Z];$=($-Z)/62,Z=$%62;let G=LN[Z];$=($-Z)/62,Z=$%62;let J=LN[Z];$=($-Z)/62,Z=$%62;let K=LN[Z];$=($-Z)/62,Z=$%62;let W=LN[Z];$=($-Z)/62;let H=LN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var as1=v((os1)=>{Object.defineProperty(os1,"__esModule",{value:!0});os1.nuid=os1.NuidImpl=void 0;var h04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",BO=62,v70=12,ns1=10,is1=33,u04=333,ps1=v70+ns1,Sn0=new Uint8Array(BO);for(let $=0;$<BO;$++)Sn0[$]=h04.charCodeAt($);var _70=4294967296,ts1=BigInt(BO)**BigInt(ns1),Pp=Number(ts1/(1n<<32n)),kn0=Number(ts1%(1n<<32n));function c04($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function l04($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else c04($)}class Cn0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(ps1),this.cbuf=new Uint8Array(v70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Pp+1)),this.seqLo=Math.floor(Math.random()*_70);while($++<8&&this.seqHi===Pp&&this.seqLo>=kn0);if(this.seqHi===Pp&&this.seqLo>=kn0)this.seqLo=0;this.inc=Math.random()*(u04-is1)+is1|0}setPre(){l04(this.cbuf);for(let $=0;$<v70;$++)this.buf[$]=Sn0[this.cbuf[$]%BO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=ps1-1;Q>=v70;Q--){let X=Math.floor($/BO),G=($-X*BO)*_70+Z,J=Math.floor(G/BO),K=G-J*BO;this.buf[Q]=Sn0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=_70)this.seqLo-=_70,this.seqHi+=1;if(this.seqHi>Pp||this.seqHi===Pp&&this.seqLo>=kn0)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()}}os1.NuidImpl=Cn0;os1.nuid=new Cn0});var Ze1=v((es1)=>{Object.defineProperty(es1,"__esModule",{value:!0});es1.nuid=es1.Nuid=void 0;var ss1=as1();es1.Nuid=ss1.NuidImpl;es1.nuid=ss1.nuid});var f70=v((x70)=>{Object.defineProperty(x70,"__esModule",{value:!0});x70.nuid=x70.Nuid=void 0;var Qe1=Ze1();Object.defineProperty(x70,"Nuid",{enumerable:!0,get:function(){return Qe1.Nuid}});Object.defineProperty(x70,"nuid",{enumerable:!0,get:function(){return Qe1.nuid}})});var OO=v((Xe1)=>{Object.defineProperty(Xe1,"__esModule",{value:!0});Xe1.DEFAULT_HOST=Xe1.DEFAULT_PORT=Xe1.Match=void 0;Xe1.syncIterator=t04;Xe1.createInbox=o04;var p04=f70(),n04=JG();Xe1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function t04($){let Z=$[Symbol.asyncIterator]();return{async next(){let Q=await Z.next();if(Q.done)return Promise.resolve(null);return Promise.resolve(Q.value)}}}function o04($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw n04.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${p04.nuid.next()}`}Xe1.DEFAULT_PORT=4222;Xe1.DEFAULT_HOST="127.0.0.1"});var Ap=v((Ke1)=>{Object.defineProperty(Ke1,"__esModule",{value:!0});Ke1.DataBuffer=void 0;var Ge1=GG();class Je1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}static fromAscii($){if(!$)$="";return Ge1.TE.encode($)}static toAscii($){return Ge1.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 Q=0;Q<this.buffers.length;Q++)$.set(this.buffers[Q],Z),Z+=this.buffers[Q].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 Q=this.byteLength;if($===void 0||$>Q)$=Q;let X=Z.subarray(0,$);if(Q>$)this.buffers.push(Z.subarray($));return this.byteLength=Q-$,X}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let Q=0;Q<Z.length;Q++)if(Z[Q]&&Z[Q].length)this.buffers.push(Z[Q]),this.byteLength+=Z[Q].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}}Ke1.DataBuffer=Je1});var sE=v((Fe1)=>{Object.defineProperty(Fe1,"__esModule",{value:!0});Fe1.LF=Fe1.CR=Fe1.CRLF=Fe1.CR_LF_LEN=Fe1.CR_LF=void 0;Fe1.setTransportFactory=X14;Fe1.defaultPort=Y14;Fe1.getUrlParseFn=G14;Fe1.newTransport=J14;Fe1.getResolveFn=K14;Fe1.protoLen=He1;Fe1.extractProtocolMessage=W14;var $14=GG(),Z14=OO(),Q14=Ap(),KG;function X14($){KG=$}function Y14(){return KG!==void 0&&KG.defaultPort!==void 0?KG.defaultPort:Z14.DEFAULT_PORT}function G14(){return KG!==void 0&&KG.urlParseFn?KG.urlParseFn:void 0}function J14(){if(!KG||typeof KG.factory!=="function")throw Error("transport fn is not set");return KG.factory()}function K14(){return KG!==void 0&&KG.dnsResolveFn?KG.dnsResolveFn:void 0}Fe1.CR_LF=`\r
1492
+ `);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;HO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:G,value:J}=await Z.read();if(G)break;X+=Q.decode(J,{stream:!0}),Y()}}catch{}if(X.trim()){let G=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(G)HO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function Le8($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=X?await jp(Number(Y)+1):await jp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await A70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)nE({name:D.name,status:"ready",port:D.port});wp();let F=Oe8(import.meta.dir,"..","..","..","..",".."),N=Q===!0,U=Bun.spawn(["bun","run","dev:servers"],{cwd:F,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.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)Hn0(U.stdout),Hn0(U.stderr);Ep(G),nE({name:"Vite",status:"ready",port:Number(Y)}),nE({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(U.kill(D),await U.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (qZ0(),IZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var Nn0=L(()=>{Yn0();tE();Wn0()});var I70;var Un0=L(()=>{I70={name:"decocms",version:"4.305.9",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","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.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","@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 we8,Text as Fs1}from"ink";import{jsx as Ee8,jsxs as Ns1}from"react/jsx-runtime";function Us1({version:$}){return Ns1(we8,{flexDirection:"column",marginTop:1,children:[oZ0.map((Z,Q)=>Ee8(Fs1,{color:rZ0[Q],children:Z},Q)),Ns1(Fs1,{dimColor:!0,children:[" v",$]})]})}var Bs1=L(()=>{Yp()});import{Box as oE,Text as FO}from"ink";import{Spinner as je8}from"@inkjs/ui";import{jsx as YG,jsxs as Ry}from"react/jsx-runtime";function Os1({status:$}){if($==="pending")return YG(je8,{label:""});return YG(FO,{color:"green",children:"\u2713"})}function ze8($){return`${$.name}: ${$.port||"...."}`}function Ls1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Ry(oE,{flexDirection:"column",paddingBottom:1,children:[YG(Us1,{version:I70.version}),YG(oE,{marginBottom:1,children:YG(FO,{dimColor:!0,children:"\u2500".repeat(80)})}),YG(oE,{children:Ry(FO,{dimColor:!0,children:["Home: ",Q]})}),Ry(oE,{gap:2,children:[$.map((Y)=>Ry(oE,{gap:1,children:[YG(FO,{children:ze8(Y)}),YG(Os1,{status:Y.status})]},Y.name)),Ry(oE,{gap:1,children:[YG(FO,{children:"Migrations"}),YG(Os1,{status:Z})]})]}),YG(oE,{children:X?Ry(FO,{children:["Open in browser: ",YG(FO,{color:"cyan",children:X})]}):YG(FO,{dimColor:!0,children:"Starting..."})})]})}var Ds1=L(()=>{Un0();Bs1()});import{Box as Pe8,Text as zp}from"ink";import{jsx as Bn0,jsxs as On0}from"react/jsx-runtime";function Ae8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function ws1({logs:$}){return Bn0(Pe8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return Bn0(zp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return On0(zp,{children:[On0(zp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Bn0(zp,{color:Ae8(Z.status),children:Z.status}),On0(zp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Es1=()=>{};var Ln0={};$0(Ln0,{App:()=>Ie8});import{Box as Te8}from"ink";import{useSyncExternalStore as Re8}from"react";import{jsx as js1,jsxs as qe8}from"react/jsx-runtime";function Ie8({home:$}){let Z=Re8(Kn0,Jn0);return qe8(Te8,{flexDirection:"column",children:[js1(Ls1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),js1(ws1,{logs:Z.logs})]})}var Dn0=L(()=>{Ds1();Es1();tE()});var i3="thread-gate",BN="decopilot-hosted-harness",ON="decopilot-hosted-harness-sandboxed",EJ="automations",NO="background-tools",rE="task-board-github-reads",UO="jira-push";var zs1="10";function Ps1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:zs1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var As1=()=>{};import Me8 from"pg";async function Rs1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=Ve8}=$,Y=$.log??((W)=>console.log(W)),G=new Me8.Client({connectionString:Q});await G.connect();let J=Date.now(),K=!1;try{while(!K){if(K=(await G.query("SELECT pg_try_advisory_lock($1) AS locked",[Ts1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-J>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await H$(ke8)}let W=Date.now()-J;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await G.query("SELECT pg_advisory_unlock($1)",[Ts1.toString()])}catch{}await G.end().catch(()=>{})}}var Ts1=8314027461559302n,Ve8=600000,ke8=500;var Is1=L(()=>{J4()});function Se8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function wn0($,Z){for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X===Z)return $[Q+1];if(X.startsWith(`${Z}=`))return X.slice(Z.length+1)}return}function qs1(){let $=Se8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:wn0($,"--cpu-prof-dir")??process.cwd(),name:wn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(wn0($,"--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 Ms1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=mE();if(!Q)return;let X={};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);X={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:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),q70=setInterval(()=>void Z().catch(()=>{}),$),q70.unref?.(),process.on("SIGUSR2",()=>{try{let Q=Bun.generateHeapSnapshot("v8"),X=typeof Q==="string"?Q:JSON.stringify(Q),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,X),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(Q){console.error("[heap-watch] snapshot failed:",Q)}}),()=>{if(q70)clearInterval(q70)}}var q70;var Vs1=()=>{};import*as Ce8 from"bun:jsc";function ks1(){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{_e8()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-X;X=G+Z;let K=[];try{K=ve8()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let F of K){let N=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!N)continue;let U=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${U}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,N)=>N[1]-F[1]).slice(0,8).map(([F,N])=>({frame:F,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var _e8,ve8;var Ss1=L(()=>{({startSamplingProfiler:_e8,samplingProfilerStackTraces:ve8}=Ce8)});function Cs1(){qs1();let $=[Ms1(),in1(),ks1()];return()=>{for(let Z of $)Z()}}var _s1=L(()=>{hl0();Vs1();Ss1()});var aE=v((vs1)=>{Object.defineProperty(vs1,"__esModule",{value:!0});vs1.RepublishHeaders=vs1.DirectMsgHeaders=vs1.JsHeaders=vs1.AdvisoryKind=void 0;vs1.isOrderedPushConsumerOptions=xe8;vs1.isPullConsumer=fe8;vs1.isPushConsumer=be8;vs1.isBoundPushConsumerOptions=ye8;function xe8($){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 fe8($){return $.isPullConsumer()}function be8($){return $.isPushConsumer()}function ye8($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}vs1.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"};vs1.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"};vs1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};vs1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var GG=v((fs1)=>{Object.defineProperty(fs1,"__esModule",{value:!0});fs1.TD=fs1.TE=fs1.Empty=void 0;fs1.encode=pe8;fs1.decode=ne8;fs1.Empty=new Uint8Array(0);fs1.TE=new TextEncoder;fs1.TD=new TextDecoder;function ie8(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}function pe8(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(fs1.TE.encode($[Q]));if(Z.length===0)return fs1.Empty;if(Z.length===1)return Z[0];return ie8(...Z)}function ne8($){if(!$||$.length===0)return"";return fs1.TD.decode($)}});var JG=v((gs1)=>{Object.defineProperty(gs1,"__esModule",{value:!0});gs1.errors=gs1.PermissionViolationError=gs1.NoRespondersError=gs1.TimeoutError=gs1.RequestError=gs1.ProtocolError=gs1.ConnectionError=gs1.DrainingConnectionError=gs1.ClosedConnectionError=gs1.AuthorizationError=gs1.UserAuthenticationExpiredError=gs1.InvalidOperationError=gs1.InvalidArgumentError=gs1.InvalidSubjectError=void 0;class jn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}gs1.InvalidSubjectError=jn0;class M70 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,Q){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((X)=>`'${X}'`),$=$.join(",");else $=`'${$}'`;return new M70(`${$} ${Z}`,Q)}}gs1.InvalidArgumentError=M70;class zn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}gs1.InvalidOperationError=zn0;class V70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new V70($);return null}}gs1.UserAuthenticationExpiredError=V70;class k70 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],Q=$.toLowerCase();for(let X=0;X<Z.length;X++)if(Q.indexOf(Z[X])!==-1)return new k70($);return null}}gs1.AuthorizationError=k70;class Pn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}gs1.ClosedConnectionError=Pn0;class An0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}gs1.DrainingConnectionError=An0;class Tn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}gs1.ConnectionError=Tn0;class Rn0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}gs1.ProtocolError=Rn0;class In0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof S70}}gs1.RequestError=In0;class qn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}gs1.TimeoutError=qn0;class S70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}gs1.NoRespondersError=S70;class C70 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(Q=G[1].toLowerCase(),X=G[2],Q==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new C70($,Q,X,Y)}}gs1.PermissionViolationError=C70;gs1.errors={AuthorizationError:k70,ClosedConnectionError:Pn0,ConnectionError:Tn0,DrainingConnectionError:An0,InvalidArgumentError:M70,InvalidOperationError:zn0,InvalidSubjectError:jn0,NoRespondersError:S70,PermissionViolationError:C70,ProtocolError:Rn0,RequestError:In0,TimeoutError:qn0,UserAuthenticationExpiredError:V70}});var p3=v((ms1)=>{Object.defineProperty(ms1,"__esModule",{value:!0});ms1.SimpleMutex=ms1.Perf=void 0;ms1.extend=F04;ms1.render=N04;ms1.timeout=U04;ms1.delay=B04;ms1.deadline=O04;ms1.deferred=Vn0;ms1.debugDeferred=L04;ms1.shuffle=D04;ms1.collect=w04;ms1.jitter=ls1;ms1.backoff=E04;ms1.nanos=j04;ms1.millis=z04;ms1.randomToken=T04;var H04=GG(),Mn0=JG();function F04($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function N04($){return H04.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function U04($,Z=!0){let Q=Z?new Mn0.TimeoutError:null,X,Y,G=new Promise((J,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new Mn0.TimeoutError);else K(Q)},$)});return Object.assign(G,X)}function B04($=0){let Z,Q=new Promise((X)=>{let Y=setTimeout(()=>{X()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),X()}}});return Object.assign(Q,Z)}async function O04($,Z=1000){let Q=Vn0(),X=setTimeout(()=>{Q.reject(new Mn0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function Vn0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function L04(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function D04($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function w04($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class us1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,Q){let X=this.timers.get(Z);if(X===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(Q);if(Y===void 0)throw Error(`${Q} is not defined`);this.measures.set($,Y-X)}getEntries(){let $=[];return this.measures.forEach((Z,Q)=>{$.push({name:Q,duration:Z})}),$}}ms1.Perf=us1;class cs1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Vn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}ms1.SimpleMutex=cs1;function ls1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function E04($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(Q){return ls1(Q>Z?$[Z]:$[Q])}}}function j04($){return $*1e6}function z04($){return Math.floor($/1e6)}var P04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",LN=new Uint8Array(62);for(let $=0;$<62;$++)LN[$]=P04.charCodeAt($);var A04=218340105584896;function T04(){let $=Math.floor(Math.random()*A04),Z=$%62,Q=LN[Z];$=($-Z)/62,Z=$%62;let X=LN[Z];$=($-Z)/62,Z=$%62;let Y=LN[Z];$=($-Z)/62,Z=$%62;let G=LN[Z];$=($-Z)/62,Z=$%62;let J=LN[Z];$=($-Z)/62,Z=$%62;let K=LN[Z];$=($-Z)/62,Z=$%62;let W=LN[Z];$=($-Z)/62;let H=LN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var as1=v((os1)=>{Object.defineProperty(os1,"__esModule",{value:!0});os1.nuid=os1.NuidImpl=void 0;var h04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",BO=62,v70=12,ns1=10,is1=33,u04=333,ps1=v70+ns1,Sn0=new Uint8Array(BO);for(let $=0;$<BO;$++)Sn0[$]=h04.charCodeAt($);var _70=4294967296,ts1=BigInt(BO)**BigInt(ns1),Pp=Number(ts1/(1n<<32n)),kn0=Number(ts1%(1n<<32n));function c04($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function l04($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else c04($)}class Cn0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(ps1),this.cbuf=new Uint8Array(v70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Pp+1)),this.seqLo=Math.floor(Math.random()*_70);while($++<8&&this.seqHi===Pp&&this.seqLo>=kn0);if(this.seqHi===Pp&&this.seqLo>=kn0)this.seqLo=0;this.inc=Math.random()*(u04-is1)+is1|0}setPre(){l04(this.cbuf);for(let $=0;$<v70;$++)this.buf[$]=Sn0[this.cbuf[$]%BO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=ps1-1;Q>=v70;Q--){let X=Math.floor($/BO),G=($-X*BO)*_70+Z,J=Math.floor(G/BO),K=G-J*BO;this.buf[Q]=Sn0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=_70)this.seqLo-=_70,this.seqHi+=1;if(this.seqHi>Pp||this.seqHi===Pp&&this.seqLo>=kn0)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()}}os1.NuidImpl=Cn0;os1.nuid=new Cn0});var Ze1=v((es1)=>{Object.defineProperty(es1,"__esModule",{value:!0});es1.nuid=es1.Nuid=void 0;var ss1=as1();es1.Nuid=ss1.NuidImpl;es1.nuid=ss1.nuid});var f70=v((x70)=>{Object.defineProperty(x70,"__esModule",{value:!0});x70.nuid=x70.Nuid=void 0;var Qe1=Ze1();Object.defineProperty(x70,"Nuid",{enumerable:!0,get:function(){return Qe1.Nuid}});Object.defineProperty(x70,"nuid",{enumerable:!0,get:function(){return Qe1.nuid}})});var OO=v((Xe1)=>{Object.defineProperty(Xe1,"__esModule",{value:!0});Xe1.DEFAULT_HOST=Xe1.DEFAULT_PORT=Xe1.Match=void 0;Xe1.syncIterator=t04;Xe1.createInbox=o04;var p04=f70(),n04=JG();Xe1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function t04($){let Z=$[Symbol.asyncIterator]();return{async next(){let Q=await Z.next();if(Q.done)return Promise.resolve(null);return Promise.resolve(Q.value)}}}function o04($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw n04.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${p04.nuid.next()}`}Xe1.DEFAULT_PORT=4222;Xe1.DEFAULT_HOST="127.0.0.1"});var Ap=v((Ke1)=>{Object.defineProperty(Ke1,"__esModule",{value:!0});Ke1.DataBuffer=void 0;var Ge1=GG();class Je1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}static fromAscii($){if(!$)$="";return Ge1.TE.encode($)}static toAscii($){return Ge1.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 Q=0;Q<this.buffers.length;Q++)$.set(this.buffers[Q],Z),Z+=this.buffers[Q].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 Q=this.byteLength;if($===void 0||$>Q)$=Q;let X=Z.subarray(0,$);if(Q>$)this.buffers.push(Z.subarray($));return this.byteLength=Q-$,X}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let Q=0;Q<Z.length;Q++)if(Z[Q]&&Z[Q].length)this.buffers.push(Z[Q]),this.byteLength+=Z[Q].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}}Ke1.DataBuffer=Je1});var sE=v((Fe1)=>{Object.defineProperty(Fe1,"__esModule",{value:!0});Fe1.LF=Fe1.CR=Fe1.CRLF=Fe1.CR_LF_LEN=Fe1.CR_LF=void 0;Fe1.setTransportFactory=X14;Fe1.defaultPort=Y14;Fe1.getUrlParseFn=G14;Fe1.newTransport=J14;Fe1.getResolveFn=K14;Fe1.protoLen=He1;Fe1.extractProtocolMessage=W14;var $14=GG(),Z14=OO(),Q14=Ap(),KG;function X14($){KG=$}function Y14(){return KG!==void 0&&KG.defaultPort!==void 0?KG.defaultPort:Z14.DEFAULT_PORT}function G14(){return KG!==void 0&&KG.urlParseFn?KG.urlParseFn:void 0}function J14(){if(!KG||typeof KG.factory!=="function")throw Error("transport fn is not set");return KG.factory()}function K14(){return KG!==void 0&&KG.dnsResolveFn?KG.dnsResolveFn:void 0}Fe1.CR_LF=`\r
1493
1493
  `;Fe1.CR_LF_LEN=Fe1.CR_LF.length;Fe1.CRLF=Q14.DataBuffer.fromAscii(Fe1.CR_LF);Fe1.CR=new Uint8Array(Fe1.CRLF)[0];Fe1.LF=new Uint8Array(Fe1.CRLF)[1];function He1($){for(let Z=0;Z<$.length;Z++){let Q=Z+1;if($.byteLength>Q&&$[Z]===Fe1.CR&&$[Q]===Fe1.LF)return Q+1}return 0}function W14($){let Z=He1($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return $14.TD.decode(X)}return""}});var bn0=v((Ee1)=>{Object.defineProperty(Ee1,"__esModule",{value:!0});Ee1.ipV4=Le1;Ee1.isIP=j14;Ee1.parseIP=De1;var Tp=4,eE=16,b70=48,Oe1=57,Ue1=65,w14=70,Be1=97,E14=102,fn0=16777215;function Le1($,Z,Q,X){let Y=new Uint8Array(eE);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]=Q,Y[15]=X,Y}function j14($){return De1($)!==void 0}function De1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return we1($);case":":return z14($)}return}function we1($){let Z=new Uint8Array(Tp);for(let Q=0;Q<Tp;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:G}=P14($);if(!G||X>255)return;$=$.substring(Y),Z[Q]=X}return Le1(Z[0],Z[1],Z[2],Z[3])}function z14($){let Z=new Uint8Array(eE),Q=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(Q=0,$=$.substring(2),$.length===0)return Z}let X=0;while(X<eE){let{n:Y,c:G,ok:J}=A14($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(Q<0&&X!=eE-Tp)return;if(X+Tp>eE)return;let K=we1($);if(K===void 0)return;Z[X]=K[12],Z[X+1]=K[13],Z[X+2]=K[14],Z[X+3]=K[15],$="",X+=Tp;break}if(Z[X]=Y>>8,Z[X+1]=Y,X+=2,$=$.substring(G),$.length===0)break;if($[0]!==":"||$.length==1)return;if($=$.substring(1),$[0]===":"){if(Q>=0)return;if(Q=X,$=$.substring(1),$.length===0)break}}if($.length!==0)return;if(X<eE){if(Q<0)return;let Y=eE-X;for(let G=X-1;G>=Q;G--)Z[G+Y]=Z[G];for(let G=Q+Y-1;G>=Q;G--)Z[G]=0}else if(Q>=0)return;return Z}function P14($){let Z=0,Q=0;for(Z=0;Z<$.length&&b70<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=Oe1;Z++)if(Q=Q*10+($.charCodeAt(Z)-b70),Q>=fn0)return{n:fn0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function A14($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(b70<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=Oe1)Z*=16,Z+=$.charCodeAt(Q)-b70;else if(Be1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=E14)Z*=16,Z+=$.charCodeAt(Q)-Be1+10;else if(Ue1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=w14)Z*=16,Z+=$.charCodeAt(Q)-Ue1+10;else break;if(Z>=fn0)return{n:0,c:Q,ok:!1}}if(Q===0)return{n:0,c:Q,ok:!1};return{n:Z,c:Q,ok:!0}}});var ln0=v((ze1)=>{Object.defineProperty(ze1,"__esModule",{value:!0});ze1.Servers=ze1.ServerImpl=void 0;ze1.isIPV4OrHostname=je1;ze1.hostPort=cn0;var yn0=sE(),gn0=p3(),hn0=bn0(),q14=OO(),M14=JG();function je1($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function un0($){return!je1($)}function V14($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function cn0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=V14($),un0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=un0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):q14.DEFAULT_PORT,Y=new URL(`${Q===80?"https":"http"}://${$}`);Y.port=`${Q}`;let G=Y.hostname;if(G.charAt(0)==="[")G=G.substring(1,G.length-1);return{listen:Y.host,hostname:G,port:Q}}class Iy{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let Q=cn0($);this.listen=Q.listen,this.hostname=Q.hostname,this.port=Q.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,hn0.isIP)(this.hostname))return[this];else{let Q=await $.fn(this.hostname);if($.debug)console.log(`resolve ${this.hostname} = ${Q.join(",")}`);for(let X of Q){let Y=this.port===80?"https":"http",G=new URL(`${Y}://${un0(X)?"["+X+"]":X}`);G.port=`${this.port}`;let J=new Iy(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,gn0.shuffle)(Z);return this.resolves=Z,Z}}ze1.ServerImpl=Iy;class y70{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw M14.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,yn0.getUrlParseFn)(),Q=new Map;for(let Y of this.servers)Q.set(Y.listen,Y);let X=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:G}=cn0(Y),J=Q.get(G);if(J)J.gossiped=!1,X.push(J);else X.push(new Iy(Y))}if(this.randomize)(0,gn0.shuffle)(X);if(this.servers=X,this.currentServer===void 0||!X.includes(this.currentServer))this.currentServer=X[0],this.firstSelect=!0}clear(){this.servers.length=0}updateTLSName(){let $=this.getCurrentServer();if(!(0,hn0.isIP)($.hostname))this.tlsName=$.hostname,this.servers.forEach((Z)=>{if(Z.gossiped)Z.tlsName=this.tlsName})}getCurrentServer(){return this.currentServer}addServer($,Z=!1){let Q=(0,yn0.getUrlParseFn)();$=Q?Q($):$;let X=new Iy($,Z);if((0,hn0.isIP)(X.hostname))X.tlsName=this.tlsName;this.servers.push(X)}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 y70.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return y70.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 Q=[],X=[],Y=(0,yn0.getUrlParseFn)(),G=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Iy(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);X=X.concat(W[0].listen)}),G.forEach((K,W)=>{this.servers.push(K),Q.push(W)}),this.randomize&&Q.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,gn0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}ze1.Servers=y70});var g70=v((Re1)=>{Object.defineProperty(Re1,"__esModule",{value:!0});Re1.QueuedIteratorImpl=void 0;var mn0=p3(),Ae1=JG();class Te1{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,mn0.deferred)(),this.yields=[],this.iterClosed=(0,mn0.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(Q){}}return}if(typeof $==="function")this.pendingFiltered++;this.yields.push($),this.signal.resolve()}async*iterate(){if(this.noIterator)throw new Ae1.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Ae1.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 X=$[Z];try{X()}catch(Y){throw Y}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let Q=this.profile?Date.now():0;yield $[Z],this.time=this.profile?Date.now()-Q:0}if(this.done)break;else if(this.yields.length===0)$.length=0,this.yields=$,this.signal=(0,mn0.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}}Re1.QueuedIteratorImpl=Te1});var dn0=v((Ve1)=>{Object.defineProperty(Ve1,"__esModule",{value:!0});Ve1.MuxSubscription=void 0;var _14=OO(),qe1=JG();class Me1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,_14.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((Q)=>{Q.resolver(Z,{})}),!0;if(Z.operation==="publish"){let Q=this.all().find((X)=>{return X.requestSubject===Z.subject});if(Q)return Q.resolver(Z,{}),!0}return!1}dispatcher(){return($,Z)=>{let Q=this.getToken(Z);if(Q){let X=this.get(Q);if(X){if($===null)$=Z?.data?.length===0&&Z.headers?.code===503?new qe1.NoRespondersError(X.requestSubject):null;X.resolver($,Z)}}}}close(){let $=new qe1.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}Ve1.MuxSubscription=Me1});var in0=v((Ce1)=>{Object.defineProperty(Ce1,"__esModule",{value:!0});Ce1.Heartbeat=void 0;var v14=p3();class Se1{ph;interval;maxOut;timer;pendings;constructor($,Z,Q){this.ph=$,this.interval=Z,this.maxOut=Q,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,v14.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})}}Ce1.Heartbeat=Se1});var tn0=v((be1)=>{Object.defineProperty(be1,"__esModule",{value:!0});be1.DenoBuffer=be1.MAX_SIZE=be1.AssertionError=void 0;be1.assert=xe1;be1.concat=fe1;be1.append=f14;be1.readAll=b14;be1.writeAll=y14;var x14=GG();class pn0 extends Error{constructor($){super($);this.name="AssertionError"}}be1.AssertionError=pn0;function xe1($,Z="Assertion failed."){if(!$)throw new pn0(Z)}var ve1=32768;be1.MAX_SIZE=4294967294;function h70($,Z,Q=0){let X=Z.byteLength-Q;if($.byteLength>X)$=$.subarray(0,X);return Z.set($,Q),$.byteLength}function fe1($,Z){if($===void 0&&Z===void 0)return new Uint8Array(0);if($===void 0)return Z;if(Z===void 0)return $;let Q=new Uint8Array($.length+Z.length);return Q.set($,0),Q.set(Z,$.length),Q}function f14($,Z){return fe1($,Uint8Array.of(Z))}class nn0{_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($){xe1($<=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=h70(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(x14.TE.encode($))}write($){let Z=this._grow($.byteLength);return h70($,this._buf,Z)}_grow($){let Z=this.length;if(Z===0&&this._off!==0)this.reset();let Q=this._tryGrowByReslice($);if(Q>=0)return Q;let X=this.capacity;if($<=Math.floor(X/2)-Z)h70(this._buf.subarray(this._off),this._buf);else if(X+$>be1.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*X+$,be1.MAX_SIZE));h70(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,be1.MAX_SIZE)),Z}grow($){if($<0)throw Error("Buffer._grow: negative count");let Z=this._grow($);this._reslice(Z)}readFrom($){let Z=0,Q=new Uint8Array(ve1);while(!0){let X=this.capacity-this.length<ve1,Y=X?Q:new Uint8Array(this._buf.buffer,this.length),G=$.read(Y);if(G===null)return Z;if(X)this.write(Y.subarray(0,G));else this._reslice(this.length+G);Z+=G}}}be1.DenoBuffer=nn0;function b14($){let Z=new nn0;return Z.readFrom($),Z.bytes()}function y14($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var an0=v((ce1)=>{Object.defineProperty(ce1,"__esModule",{value:!0});ce1.cc=ce1.State=ce1.Parser=ce1.Kind=void 0;ce1.describe=d14;var on0=tn0(),rn0=GG();ce1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function d14($){let Z,Q="";switch($.kind){case ce1.Kind.MSG:Z="MSG";break;case ce1.Kind.OK:Z="OK";break;case ce1.Kind.ERR:Z="ERR",Q=rn0.TD.decode($.data);break;case ce1.Kind.PING:Z="PING";break;case ce1.Kind.PONG:Z="PONG";break;case ce1.Kind.INFO:Z="INFO",Q=rn0.TD.decode($.data)}return`${Z}: ${Q}`}function ge1(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var he1=48,i14=57,qy=67108864;class ue1{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=ce1.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse($){let Z;for(Z=0;Z<$.length;Z++){let Q=$[Z];switch(this.state){case ce1.State.OP_START:switch(Q){case ce1.cc.M:case ce1.cc.m:this.state=ce1.State.OP_M,this.hdr=-1,this.ma=ge1();break;case ce1.cc.H:case ce1.cc.h:this.state=ce1.State.OP_H,this.hdr=0,this.ma=ge1();break;case ce1.cc.P:case ce1.cc.p:this.state=ce1.State.OP_P;break;case ce1.cc.PLUS:this.state=ce1.State.OP_PLUS;break;case ce1.cc.MINUS:this.state=ce1.State.OP_MINUS;break;case ce1.cc.I:case ce1.cc.i:this.state=ce1.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_H:switch(Q){case ce1.cc.M:case ce1.cc.m:this.state=ce1.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_M:switch(Q){case ce1.cc.S:case ce1.cc.s:this.state=ce1.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_MS:switch(Q){case ce1.cc.G:case ce1.cc.g:this.state=ce1.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_MSG:switch(Q){case ce1.cc.SPACE:case ce1.cc.TAB:this.state=ce1.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_MSG_SPC:switch(Q){case ce1.cc.SPACE:case ce1.cc.TAB:continue;default:this.state=ce1.State.MSG_ARG,this.as=Z}break;case ce1.State.MSG_ARG:switch(Q){case ce1.cc.CR:this.drop=1;break;case ce1.cc.NL:{let X=this.argBuf?this.argBuf.bytes():$.subarray(this.as,Z-this.drop);this.processMsgArgs(X),this.drop=0,this.as=Z+1,this.state=ce1.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;case ce1.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let X=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:ce1.Kind.MSG,msg:this.ma,data:X}),this.argBuf=void 0,this.msgBuf=void 0,this.state=ce1.State.MSG_END}else{let X=this.ma.size-this.msgBuf.length,Y=$.length-Z;if(Y<X)X=Y;if(X>0)this.msgBuf.write($.subarray(Z,Z+X)),Z=Z+X-1;else this.msgBuf.writeByte(Q)}else if(Z-this.as>=this.ma.size)this.dispatcher.push({kind:ce1.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=ce1.State.MSG_END;break;case ce1.State.MSG_END:switch(Q){case ce1.cc.NL:this.drop=0,this.as=Z+1,this.state=ce1.State.OP_START;break;default:continue}break;case ce1.State.OP_PLUS:switch(Q){case ce1.cc.O:case ce1.cc.o:this.state=ce1.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_PLUS_O:switch(Q){case ce1.cc.K:case ce1.cc.k:this.state=ce1.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_PLUS_OK:switch(Q){case ce1.cc.NL:this.dispatcher.push({kind:ce1.Kind.OK}),this.drop=0,this.state=ce1.State.OP_START;break}break;case ce1.State.OP_MINUS:switch(Q){case ce1.cc.E:case ce1.cc.e:this.state=ce1.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_MINUS_E:switch(Q){case ce1.cc.R:case ce1.cc.r:this.state=ce1.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_MINUS_ER:switch(Q){case ce1.cc.R:case ce1.cc.r:this.state=ce1.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_MINUS_ERR:switch(Q){case ce1.cc.SPACE:case ce1.cc.TAB:this.state=ce1.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_MINUS_ERR_SPC:switch(Q){case ce1.cc.SPACE:case ce1.cc.TAB:continue;default:this.state=ce1.State.MINUS_ERR_ARG,this.as=Z}break;case ce1.State.MINUS_ERR_ARG:switch(Q){case ce1.cc.CR:this.drop=1;break;case ce1.cc.NL:{let X;if(this.argBuf)X=this.argBuf.bytes(),this.argBuf=void 0;else X=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:ce1.Kind.ERR,data:X}),this.drop=0,this.as=Z+1,this.state=ce1.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Q))}break;case ce1.State.OP_P:switch(Q){case ce1.cc.I:case ce1.cc.i:this.state=ce1.State.OP_PI;break;case ce1.cc.O:case ce1.cc.o:this.state=ce1.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_PO:switch(Q){case ce1.cc.N:case ce1.cc.n:this.state=ce1.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_PON:switch(Q){case ce1.cc.G:case ce1.cc.g:this.state=ce1.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_PONG:switch(Q){case ce1.cc.NL:this.dispatcher.push({kind:ce1.Kind.PONG}),this.drop=0,this.state=ce1.State.OP_START;break}break;case ce1.State.OP_PI:switch(Q){case ce1.cc.N:case ce1.cc.n:this.state=ce1.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_PIN:switch(Q){case ce1.cc.G:case ce1.cc.g:this.state=ce1.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_PING:switch(Q){case ce1.cc.NL:this.dispatcher.push({kind:ce1.Kind.PING}),this.drop=0,this.state=ce1.State.OP_START;break}break;case ce1.State.OP_I:switch(Q){case ce1.cc.N:case ce1.cc.n:this.state=ce1.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_IN:switch(Q){case ce1.cc.F:case ce1.cc.f:this.state=ce1.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_INF:switch(Q){case ce1.cc.O:case ce1.cc.o:this.state=ce1.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_INFO:switch(Q){case ce1.cc.SPACE:case ce1.cc.TAB:this.state=ce1.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case ce1.State.OP_INFO_SPC:switch(Q){case ce1.cc.SPACE:case ce1.cc.TAB:continue;default:this.state=ce1.State.INFO_ARG,this.as=Z}break;case ce1.State.INFO_ARG:switch(Q){case ce1.cc.CR:this.drop=1;break;case ce1.cc.NL:{let X;if(this.argBuf)X=this.argBuf.bytes(),this.argBuf=void 0;else X=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:ce1.Kind.INFO,data:X}),this.drop=0,this.as=Z+1,this.state=ce1.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;default:throw this.fail($.subarray(Z))}}if((this.state===ce1.State.MSG_ARG||this.state===ce1.State.MINUS_ERR_ARG||this.state===ce1.State.INFO_ARG)&&!this.argBuf)this.argBuf=new on0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===ce1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new on0.DenoBuffer($.subarray(this.as))}}cloneMsgArg(){let $=this.ma.subject.length,Z=this.ma.reply?this.ma.reply.length:0,Q=new Uint8Array($+Z);if(Q.set(this.ma.subject),this.ma.reply)Q.set(this.ma.reply,$);if(this.argBuf=new on0.DenoBuffer(Q),this.ma.subject=Q.subarray(0,$),this.ma.reply)this.ma.reply=Q.subarray($)}processMsgArgs($){if(this.hdr>=0)return this.processHeaderMsgArgs($);let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case ce1.cc.SPACE:case ce1.cc.TAB:case ce1.cc.CR:case ce1.cc.NL:if(Q>=0)Z.push($.subarray(Q,X)),Q=-1;break;default:if(Q<0)Q=X}if(Q>=0)Z.push($.subarray(Q));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],qy);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],qy);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}: ${rn0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case ce1.cc.SPACE:case ce1.cc.TAB:case ce1.cc.CR:case ce1.cc.NL:if(Q>=0)Z.push($.subarray(Q,X)),Q=-1;break;default:if(Q<0)Q=X}if(Q>=0)Z.push($.subarray(Q));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],qy),this.ma.size=this.protoParseInt(Z[3],qy);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],qy),this.ma.size=this.protoParseInt(Z[4],qy);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 Q=0;for(let X=0;X<$.length;X++){if($[X]<he1||$[X]>i14)return-1;Q=Q*10+($[X]-he1)}return Z!==void 0&&Q>Z?-1:Q}}ce1.Parser=ue1;ce1.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};ce1.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 l70=v((me1)=>{Object.defineProperty(me1,"__esModule",{value:!0});me1.MsgHdrsImpl=void 0;me1.canonicalMIMEHeaderKey=en0;me1.headers=t14;var le1=GG(),n3=OO(),c70=JG();function en0($){let F=!0,N=Array($.length);for(let U=0;U<$.length;U++){let B=$.charCodeAt(U);if(B===58||B<33||B>126)throw c70.InvalidArgumentError.format("header",`'${$[U]}' is not a valid character in a header name`);if(F&&97<=B&&B<=122)B-=32;else if(!F&&65<=B&&B<=90)B+=32;N[U]=B,F=B==45}return String.fromCharCode(...N)}function t14($=0,Z=""){if($===0&&Z!=="")throw c70.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw c70.InvalidArgumentError.format("description","is required");return new My($,Z)}var sn0="NATS/1.0";class My{_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,Q]of this.headers){let X=$.values(Z);if(Q.length!==X.length)return!1;let Y=[...Q].sort(),G=[...X].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 My,X=le1.TD.decode($).split(`\r
1494
1494
  `),Y=X[0];if(Y!==sn0){let G=Y.replace(sn0,"").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(X.length>=1)X.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 $=sn0;if(this._code>0&&this._description!=="")$+=` ${this._code} ${this._description}`;for(let[Z,Q]of this.headers)for(let X=0;X<Q.length;X++)$=`${$}\r
1495
1495
  ${Z}: ${Q[X]}`;return`${$}\r
@@ -4309,7 +4309,7 @@ Do NOT require review (requiresReview = false) when the changes are low-risk, su
4309
4309
 
4310
4310
  When unsure between the two, lean toward NOT requiring review for small frontend-only diffs, and toward requiring it for anything backend or large.
4311
4311
 
4312
- Respond with the structured verdict and a short reason.`,hY8;var cY8=L(()=>{p4();OU();RO1();Ki6=IO1.object({requiresReview:IO1.boolean().describe("true if the changes should go through pull-request review"),reason:IO1.string().describe("One short sentence explaining the decision (max ~120 chars)")});hY8={requiresReview:!1,reason:""}});async function Bk0($,Z,Q){if(!Q.connectionId)throw new m4(401,"AUTH","connection","Project's GitHub connection is missing \u2014 reconnect GitHub");let X=await $.storage.connections.findById(Q.connectionId,Z);if(!X)throw new m4(401,"AUTH","connection","Project's GitHub connection is missing \u2014 reconnect GitHub");let Y=await mz($,X);if(!Y)throw new m4(401,"AUTH","connection",w9);return jV0({owner:Q.owner,repo:Q.name,accessToken:Y})}var qO1=L(()=>{ju();nJ();kw()});function Fi6($){if(!$||$.includes("\\")||$.includes("..")||$.includes("\x00"))return!0;try{let Z=decodeURIComponent($);if(Z.includes("\\")||Z.includes("..")||Z.includes("\x00"))return!0;if(Z!==$&&Z.includes("/")){let Q=($.match(/\//g)??[]).length;if((Z.match(/\//g)??[]).length>Q)return!0}return!1}catch{return!0}}function Ok0($){if(Fi6($))throw Error(`Invalid block key: ${$||"(empty)"}`)}function MO1($){return/\.(?:tsx?|jsx?|mts|cts|mjs|cjs)$/.test($)}function Q$0($){try{return decodeURIComponent($)}catch{return $}}function VO1($){return Ok0($),encodeURIComponent($)}function X$0($){let Z=$.map((J)=>({file:J,name:`${J.stem}.json`})).sort((J,K)=>J.name<K.name?-1:J.name>K.name?1:0),Q=[],X=new Set,Y="{",G=!0;for(let{file:J}of Z){let K=J.content.trim();if(K.length===0)continue;let W=Q$0(J.stem);if(X.has(W)){Q.push({key:W,stem:J.stem,error:`duplicate block key "${W}" (another file already maps to it)`});continue}try{JSON.parse(K)}catch(H){Q.push({key:W,stem:J.stem,error:H instanceof Error?H.message:String(H)});continue}if(X.add(W),!G)Y+=",";G=!1,Y+=`${JSON.stringify(W)}:${K}`}return{decofile:`${Y}}`,skipped:Q}}var lY8=()=>{};var Lk0=L(()=>{lY8()});function Ni6($){return $.startsWith("merged/")?"merged":"blobs"}function kO1($,Z){let Q=new Map;for(let G of $){let J=Q.get(G.path);if(!J||G.mtimeMs>=J.mtimeMs)Q.set(G.path,{bytes:G.bytes,mtimeMs:G.mtimeMs})}let X=[...Q.entries()].sort((G,J)=>G[1].mtimeMs-J[1].mtimeMs),Y={config:Z,entries:new Map,totalBytes:0,areaBytes:{blobs:0,merged:0}};for(let[G,{bytes:J}]of X){let K=Ni6(G);Y.entries.set(G,{bytes:J,area:K}),Y.totalBytes+=J,Y.areaBytes[K]+=J}return Y}function mY8($,Z){let Q=$.entries.get(Z);if(!Q)return;$.entries.delete(Z),$.entries.set(Z,Q)}function xm($,Z){let Q=$.entries.get(Z);if(!Q)return;$.entries.delete(Z),$.totalBytes-=Q.bytes,$.areaBytes[Q.area]-=Q.bytes}function dY8($,Z){let{path:Q,bytes:X,area:Y}=Z,{config:G}=$;if(!Number.isFinite(X)||X<0||X>G.maxEntryBytes[Y]||X>G.maxTotalBytes||Y==="merged"&&X>G.maxMergedBytes)return{admitted:!1,evict:[]};let K=$.entries.get(Q),W=$.totalBytes-(K?.bytes??0),H=$.areaBytes.merged-(K?.area==="merged"?K.bytes:0),F=[],N=new Set;if(Y==="merged")for(let[U,B]of $.entries){if(H+X<=G.maxMergedBytes)break;if(U===Q||B.area!=="merged")continue;F.push(U),N.add(U),H-=B.bytes,W-=B.bytes}for(let[U,B]of $.entries){if(W+X<=G.maxTotalBytes)break;if(U===Q||N.has(U))continue;F.push(U),N.add(U),W-=B.bytes}for(let U of F)xm($,U);return xm($,Q),$.entries.set(Q,{bytes:X,area:Y}),$.totalBytes+=X,$.areaBytes[Y]+=X,{admitted:!0,evict:F}}function Y$0($){if($==="")throw TypeError("cache path segment must not be empty");let Z=$.toLowerCase(),Q="";for(let X of new TextEncoder().encode(Z)){let Y=String.fromCharCode(X);Q+=/[a-z0-9._-]/.test(Y)?Y:`%${X.toString(16).padStart(2,"0")}`}if(Q==="."||Q==="..")Q=Q.replaceAll(".","%2e");return Q}function SO1($){return/^[0-9a-f]{40}$/.test($)}import{randomUUID as rY8}from"crypto";import{mkdir as G$0,readdir as Ui6,readFile as Bi6,rename as Oi6,rm as aY8,stat as sY8,statfs as Li6,unlink as Di6,writeFile as wi6}from"fs/promises";import{tmpdir as Ei6}from"os";import{dirname as ji6,join as t7}from"path";function fm($,Z){let Q=Bun.env[$];if(Q===void 0||Q==="")return Z;let X=Number(Q);return Number.isFinite(X)&&X>=0?Math.floor(X):Z}function Ai6(){if(Dk0)return Dk0;let $=Bun.env.FAST_PREVIEW_CACHE_DIR,Z=$===void 0?t7(Ei6(),"studio-fast-preview-cache"):$;return Dk0={enabled:Z!=="",root:Z,index:{maxTotalBytes:fm("FAST_PREVIEW_CACHE_MAX_BYTES",2*iY8),maxMergedBytes:fm("FAST_PREVIEW_CACHE_MERGED_MAX_BYTES",512*wk0),maxEntryBytes:{blobs:fm("FAST_PREVIEW_CACHE_MAX_BLOB_BYTES",wk0),merged:fm("FAST_PREVIEW_CACHE_MAX_MERGED_BYTES",32*wk0)}},freeFloorBytes:fm("FAST_PREVIEW_CACHE_FREE_FLOOR_BYTES",iY8),sweepIntervalMs:fm("FAST_PREVIEW_CACHE_SWEEP_INTERVAL_MS",600000)},Dk0}function Ti6(){return{hits:{blobs:0,merged:0},misses:{blobs:0,merged:0},evictions:0,errors:0,floorSkips:0,invalidKeySkips:0,admissionRefusals:0}}function Ri6(){if(fw)return;fw={hits:U$.createCounter("fast_preview_cache_hits",{description:"Decofile disk cache hits by area",unit:"{reads}"}),misses:U$.createCounter("fast_preview_cache_misses",{description:"Decofile disk cache misses by area",unit:"{reads}"}),evictions:U$.createCounter("fast_preview_cache_evictions",{description:"Decofile disk cache entries evicted",unit:"{entries}"}),errors:U$.createCounter("fast_preview_cache_errors",{description:"Decofile disk cache swallowed errors by operation",unit:"{errors}"}),floorSkips:U$.createCounter("fast_preview_cache_floor_skips",{description:"Decofile disk cache writes skipped by the free-space floor",unit:"{writes}"})},U$.createObservableGauge("fast_preview_cache_bytes",{description:"Decofile disk cache bytes by area",unit:"By"}).addCallback(($)=>{if(!bm)return;$.observe(bm.index.areaBytes.blobs,{area:"blobs"}),$.observe(bm.index.areaBytes.merged,{area:"merged"})}),U$.createObservableGauge("fast_preview_cache_entries",{description:"Decofile disk cache entry count by area",unit:"{entries}"}).addCallback(($)=>{if(!bm)return;let Z={blobs:0,merged:0};for(let Q of bm.index.entries.values())Z[Q.area]+=1;$.observe(Z.blobs,{area:"blobs"}),$.observe(Z.merged,{area:"merged"})})}function Ii6($){Ef.hits[$]+=1,fw?.hits.add(1,{area:$})}function pY8($){Ef.misses[$]+=1,fw?.misses.add(1,{area:$})}function CO1(){Ef.evictions+=1,fw?.evictions.add(1)}function JB($){Ef.errors+=1,fw?.errors.add(1,{op:$})}function qi6($){Ef.invalidKeySkips+=1,fw?.errors.add(1,{op:`${$}_invalid_key`})}function _O1(){return nY8??=Vi6(),nY8}async function Vi6(){let $=Ai6();if(!$.enabled)return null;Ri6();try{await G$0(t7($.root,"blobs"),{recursive:!0}),await G$0(t7($.root,"merged"),{recursive:!0}),await G$0(t7($.root,"tmp"),{recursive:!0})}catch{return JB("init"),null}let Z=[];try{Z=await eY8($.root)}catch{JB("scan"),Z=[]}let Q={root:$.root,index:kO1(Z,$.index),cfg:$};return bm=Q,Ci6(Q),Q}async function Ek0($){try{return await Ui6($)}catch{return[]}}async function eY8($){let Z=[];for(let Q of["blobs","merged"]){let X=t7($,Q);for(let Y of await Ek0(X)){let G=t7(X,Y);for(let J of await Ek0(G)){let K=t7(G,J);for(let W of await Ek0(K))try{let H=await sY8(t7(K,W));if(!H.isFile())continue;Z.push({path:`${Q}/${Y}/${J}/${W}`,bytes:H.size,mtimeMs:H.mtimeMs})}catch{}}}}return Z}function $G8($,Z,Q){if(!SO1(Q))return null;try{return`blobs/${Y$0($)}/${Y$0(Z)}/${Q}`}catch{return null}}function ZG8($,Z,Q){if(!SO1(Q))return null;try{return`merged/${Y$0($)}/${Y$0(Z)}/${Q}.json`}catch{return null}}async function QG8($,Z){try{let Q=await _O1();if(!Q)return null;if(Z===null)return pY8($),null;try{let X=await Bi6(t7(Q.root,Z),"utf8");return mY8(Q.index,Z),Ii6($),X}catch{return pY8($),null}}catch{return JB(`get_${$}`),null}}function XG8($,Z,Q){return QG8("blobs",$G8($,Z,Q))}function YG8($,Z,Q){return QG8("merged",ZG8($,Z,Q))}async function ki6($){if($.cfg.freeFloorBytes<=0)return!0;try{let Z=await Li6($.root);return Z.bavail*Z.bsize>=$.cfg.freeFloorBytes}catch{return!0}}async function jk0($){try{await Di6($)}catch{}}async function Si6($){try{let Z=$.cfg.index.maxTotalBytes/2;while($.index.totalBytes>Z){let Q=$.index.entries.keys().next();if(Q.done)break;xm($.index,Q.value),await jk0(t7($.root,Q.value)),CO1()}}catch{JB("emergency_evict")}}async function GG8($,Z,Q,X){try{let Y=await _O1();if(!Y)return;if(Q===null){qi6(Z);return}if(!await ki6(Y)){Ef.floorSkips+=1,fw?.floorSkips.add(1);return}let G=Buffer.byteLength(X,"utf8"),J=dY8(Y.index,{path:Q,bytes:G,area:$});if(!J.admitted){Ef.admissionRefusals+=1;return}for(let W of J.evict)await jk0(t7(Y.root,W)),CO1();let K=t7(Y.root,"tmp",`stage-${rY8()}`);try{await wi6(K,X,"utf8");let W=t7(Y.root,Q);await G$0(ji6(W),{recursive:!0}),await Oi6(K,W)}catch(W){if(xm(Y.index,Q),await jk0(K),JB(Z),W?.code==="ENOSPC")await Si6(Y)}}catch{JB(Z)}}function zk0($,Z,Q,X){return GG8("blobs","put_blob",$G8($,Z,Q),X)}function JG8($,Z,Q,X){return GG8("merged","put_merged",ZG8($,Z,Q),X)}async function KG8(){try{let $=await _O1();if(!$)return null;let Z=t7($.root,"tmp",rY8());return await G$0(Z,{recursive:!0}),Z}catch{return JB("make_scratch"),null}}async function WG8($){try{await aY8($,{recursive:!0,force:!0})}catch{JB("remove_scratch")}}function Ci6($){let Z=$.cfg.sweepIntervalMs;if(Z<=0)return;tY8=new AbortController,H$(Math.random()*Z,{signal:tY8.signal}).then(()=>{oY8($);let Q=setInterval(()=>void oY8($),Z);Q.unref?.(),Mi6=Q}).catch(()=>{})}async function oY8($){try{let Z=kO1(await eY8($.root),$.cfg.index),Q=$.cfg.index;for(let[G,J]of Z.entries){let K=Z.totalBytes>Q.maxTotalBytes,W=Z.areaBytes.merged>Q.maxMergedBytes;if(!K&&!W)break;if(!K&&W&&J.area!=="merged")continue;xm(Z,G),await jk0(t7($.root,G)),CO1()}$.index=Z;let X=t7($.root,"tmp"),Y=Date.now();for(let G of await Ek0(X)){let J=t7(X,G);try{let K=await sY8(J);if(Y-K.mtimeMs>Pi6)await aY8(J,{recursive:!0,force:!0})}catch{}}}catch{JB("sweep")}}var zi6=1024,wk0,iY8,Pi6=3600000,Dk0=null,fw=null,Ef,nY8=null,bm=null,Mi6=null,tY8=null;var HG8=L(()=>{J4();A6();wk0=1024*zi6,iY8=1024*wk0;Ef=Ti6()});function FG8(){let $=new Map;return{run(Z,Q){let X=$.get(Z);if(X)return X;let Y=Promise.resolve().then(Q).finally(()=>{$.delete(Z)});return $.set(Z,Y),Y}}}import{readdir as _i6,stat as vi6}from"fs/promises";import{join as NG8}from"path";function xi6($,Z,Q){let X=["-xz","--strip-components=1","-C",Z];return $==="gnu"?[...X,"--wildcards",Q]:[...X,Q]}function fi6(){return UG8??=(async()=>{try{let $=Bun.spawn(["tar","--version"],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),Z=await new Response($.stdout).text();return await $.exited,Z.includes("GNU")?"gnu":"bsd"}catch{return"bsd"}})(),UG8}async function BG8($,Z,Q){let X=Q.replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");if(X===""||X.split("/").includes(".."))throw new J$0(`invalid blocks path prefix: ${Q}`);let Y=await fi6(),G=`*/${X}/*.json`,J=()=>Bun.spawn(["tar",...xi6(Y,Z,G)],{stdin:$,stdout:"ignore",stderr:"pipe"}),K;try{K=J()}catch(N){throw new J$0("failed to spawn tar",{cause:N})}let W=new Response(K.stderr).text().catch(()=>""),H=await K.exited;if(H!==0){let N=(await W).trim().slice(0,500);throw new J$0(`tar exited with code ${H}${N?`: ${N}`:""}`)}let F=await bi6(Z,X);if(F.length===0)throw new J$0(`tar extracted no ${G} members into ${Z}`);return F}async function bi6($,Z){let Q=NG8($,...Z.split("/")),X;try{X=await _i6(Q)}catch{return[]}let Y=[];for(let G of X){if(!G.endsWith(".json"))continue;let J=NG8(Q,G);try{if(!(await vi6(J)).isFile())continue}catch{continue}Y.push({path:`${Z}/${G}`,diskPath:J})}return Y.sort((G,J)=>G.path.localeCompare(J.path))}var J$0,UG8=null;var OG8=L(()=>{J$0=class J$0 extends Error{constructor($,Z){super($,Z);this.name="TarExtractError"}}});import{createHash as yi6}from"crypto";import{readFile as gi6}from"fs/promises";async function ym($,Z){try{return await $.getHeadSha(Z)}catch(X){if(!(X instanceof m4)||X.status!==404)throw X}let Q=await $.getHeadSha(await $.getDefaultBranch());try{return await $.createRef(Z,Q),Q}catch(X){if(X instanceof m4&&X.status===422)return $.getHeadSha(Z);throw X}}function ui6(){let $=Bun.env.FAST_PREVIEW_COLD_TARBALL_MAX_BYTES;if($===void 0||$==="")return DG8;let Z=Number($);return Number.isFinite(Z)&&Z>=0?Math.floor(Z):DG8}function ci6($){wG8??=U$.createCounter("decofile_cold_reads",{description:"Decofile cold snapshot reads by resolution path",unit:"{reads}"}),wG8.add(1,{path:$})}function li6($){EG8??=U$.createCounter("decofile_skipped_blocks",{description:"Decofile blocks dropped from a merge for not being valid JSON",unit:"{blocks}"}),EG8.add($)}async function Pk0($,Z,Q){let X=Array($.length),Y=0,G=Array.from({length:Math.min(Z,$.length)},async()=>{for(;;){let J=Y++;if(J>=$.length)return;X[J]=await Q($[J])}});return await Promise.all(G),X}function Ak0($){return $?`${$}/.deco/blocks`:".deco/blocks"}function vO1($,Z){let Q=`${Ak0(Z)}/`,X=[];for(let Y of $){if(Y.type!=="blob"||!Y.path.startsWith(Q))continue;let G=Y.path.slice(Q.length);if(G.includes("/"))continue;if(!G.toLowerCase().endsWith(".json"))continue;X.push({stem:G.slice(0,-5),sha:Y.sha,path:Y.path,size:Y.size})}return X}function xO1($,Z){return $.filter((Q)=>Q$0(Q.stem)===Z).map((Q)=>Q.path).sort()}function jG8($,Z,Q,X){return zk0($,Z,Q,X)}function di6($,Z){return yi6("sha1").update(`${mi6}:${$}:${Z??""}`).digest("hex")}async function zG8($,Z,Q,X){let Y=X?.createBranchIfMissing?await ym($,Z):await $.getHeadSha(Z);return ii6.run(`${$.owner}/${$.repo}@${Y}:${Q??""}`,()=>pi6($,Y,Q))}async function pi6($,Z,Q){let{owner:X,repo:Y}=$,G=di6(Z,Q),J=await YG8(X,Y,G);if(J!==null)return{sha:Z,decofile:J};let K=await $.getCommitTreeSha(Z),W=await $.getDecofileTree(K,Q),H=vO1(W,Q),F=new Map;if(await Pk0(H,LG8,async(D)=>{let w=await XG8(X,Y,D.sha);if(w!==null)F.set(D.path,w)}),H.length-F.size>hi6){let D=await ni6($,Z,Q,H);if(ci6(D!==null?"tarball":"blobs"),D!==null)for(let[w,E]of D)F.set(w,E)}let U=await Pk0(H,LG8,async(D)=>{let w=F.get(D.path);if(w!==void 0)return{stem:D.stem,content:w};let E=await $.getBlobText(D.sha);return await zk0(X,Y,D.sha,E),{stem:D.stem,content:E}}),{decofile:B,skipped:O}=X$0(U);if(O.length>0)li6(O.length),console.warn("decofile read: dropped blocks that were not valid JSON",{repo:`${X}/${Y}`,sha:Z,packagePath:Q,blocks:O.map((D)=>D.key)});return await JG8(X,Y,G,B),{sha:Z,decofile:B}}async function ni6($,Z,Q,X){let Y=`${$.owner}/${$.repo}`,G=ui6(),J=0;for(let W of X){if(W.size===void 0)return console.warn("decofile cold read: tarball skipped (tree entry missing size; cannot pre-validate)",{repo:Y,sha:Z,path:W.path}),null;J+=W.size}if(J>G)return console.warn("decofile cold read: tarball skipped (blocks over FAST_PREVIEW_COLD_TARBALL_MAX_BYTES)",{repo:Y,sha:Z,aggregateBytes:J,maxBytes:G}),null;let K=await KG8();if(K===null)return null;try{let W=await $.getTarballStream(Z),H=await BG8(W,K,Ak0(Q)),F=new Map(X.map((U)=>[U.path,U.sha])),N=new Map;for(let U of H){let B=F.get(U.path);if(B===void 0)continue;let O=await gi6(U.diskPath,"utf8");await zk0($.owner,$.repo,B,O),N.set(U.path,O)}return N}catch(W){return console.warn("decofile cold read: tarball path failed; falling back to blob fetches",{repo:Y,sha:Z,error:W instanceof Error?W.message:String(W)}),null}finally{await WG8(K)}}var LG8=12,hi6=50,DG8=134217728,wG8=null,EG8=null,mi6="3",ii6;var Tk0=L(()=>{Lk0();A6();HG8();kw();OG8();ii6=FG8()});function oi6($){if($==="added"||$==="copied")return"added";if($==="removed")return"removed";if($==="renamed")return"renamed";return"modified"}function PG8($){let{base:Z,branch:Q,headSha:X,compared:Y}=$,G=Y.files.slice(0,AG8).map((J)=>({path:J.filename,status:oi6(J.status),...J.previousFilename?{previousPath:J.previousFilename}:{}}));return{not_added:[],conflicted:[],created:[],deleted:[],modified:[],renamed:[],files:[],staged:[],ahead:0,behind:0,current:Q,tracking:`origin/${Q}`,detached:!1,base:Z,aheadOfBase:Y.aheadBy,behindBase:Y.behindBy,headSha:X,unpushed:0,changedFiles:G,changedFilesTotal:Y.files.length,changedFilesTruncated:Y.files.length>G.length}}async function ai6($,Z,Q,X){try{return await $.compareDetailed(Z,Q)}catch(Y){if(!(Y instanceof m4)||Y.status!==404)throw Y;return await X,$.compareDetailed(Z,Q)}}async function Rk0($,Z){let Q=await $.getDefaultBranch();if(Q===Z){let J=await ym($,Z);return PG8({base:Q,branch:Z,headSha:J,compared:ri6})}let X=ym($,Z),[Y,G]=await Promise.all([X,ai6($,Q,Z,X)]);return PG8({base:Q,branch:Z,headSha:Y,compared:G})}async function Ik0($,Z,Q){let X=Q??await $.getDefaultBranch(),Y=await $.compareDetailed(X,Z),G=Y.files.slice(0,AG8);if(G.length===0)return{diffs:{},mergeBaseSha:Y.mergeBaseSha};let J=await Pk0(G,ti6,async(K)=>{let W=K.previousFilename??K.filename,[H,F]=await Promise.all([K.status==="added"?null:$.getFileTextAtRef(Y.mergeBaseSha,W),K.status==="removed"?null:$.getBlobText(K.sha)]);return[K.filename,{from:H,to:F}]});return{diffs:Object.fromEntries(J),mergeBaseSha:Y.mergeBaseSha}}async function qk0($,Z,Q){for(let X=1;;X++){let[Y,G]=await Promise.all([$.getHeadSha(Z),$.compareDetailed(Q,Z)]);if(G.behindBy===0&&G.aheadBy<=1)return;let J=await $.getHeadSha(Q);if(G.aheadBy===0)try{await $.updateRef(Z,J);return}catch(N){if(!(N instanceof m4&&N.status===422))throw N;if(X>=fO1)throw N;continue}let K,W=!1,H=null;try{let N=await $.mergeBranch(Z,Q,`chore(decofile): merge ${Q} into ${Z}`);if(N===null)K=await $.getCommitTreeSha(Y);else K=await $.getCommitTreeSha(N),H=N}catch(N){if(!(N instanceof m4&&N.status===409))throw N;K=await Zp6($,G.files,Y,J),W=!0}let F=H??Y;try{let N=await $.createCommit({message:Xp6(Z,Q,W,G.commitMessages),treeSha:K,parentShas:[J]});if(await $.getHeadSha(Z)!==F){if(X<fO1)continue;throw new m4(409,"PATCH",`git/refs/heads/${Z}`,`${Z} kept changing while syncing with ${Q}; try again`)}await $.updateRef(Z,N,{force:!0});return}catch(N){throw await Qp6($,Z,H,Y),N}}}function ei6($,Z){let Q=new Map;for(let X of $){let Y=Z.get(X.filename);Q.set(X.filename,{path:X.filename,mode:Y?.mode??"100644",type:"blob",sha:X.status==="removed"||!Y?null:Y.sha})}for(let X of $)if(X.previousFilename&&X.previousFilename!==X.filename&&!Q.has(X.previousFilename))Q.set(X.previousFilename,{path:X.previousFilename,mode:"100644",type:"blob",sha:null});return[...Q.values()]}function $p6($,Z,Q){let X=[];for(let Y of $){let G=Z.get(Y),J=Q.get(Y);if(G?.sha===J?.sha)continue;if(!G&&!J)continue;X.push({path:Y,mode:G?.mode??"100644",type:"blob",sha:G?.sha??null})}return X}async function TG8($,Z,Q){if(Q.length===0)return;let X=await $.getDefaultBranch();for(let Y=1;;Y++){let G=await $.getHeadSha(Z),{mergeBaseSha:J}=await $.compareDetailed(X,Z),[K,W]=await Promise.all([$.getBlobsAtPaths(await $.getCommitTreeSha(J),Q),$.getBlobsAtPaths(await $.getCommitTreeSha(G),Q)]),H=$p6(Q,K,W);if(H.length===0)return;let F=await $.createTree(await $.getCommitTreeSha(G),H),N=await $.createCommit({message:`chore(decofile): discard changes to ${H.length} file(s)`,treeSha:F,parentShas:[G]});try{await $.updateRef(Z,N);return}catch(U){if(U instanceof m4&&U.status===422&&Y<fO1)continue;throw U}}}async function Zp6($,Z,Q,X){if(Z.length>=si6)throw new m4(409,"POST","merges",`Too many changed files on the branch to auto-merge (${Z.length}); resolve on GitHub`);let Y=await $.getBlobsAtPaths(await $.getCommitTreeSha(Q),Z.map((G)=>G.filename));return $.createTree(await $.getCommitTreeSha(X),ei6(Z,Y))}async function Qp6($,Z,Q,X){if(Q===null)return;try{if(await $.getHeadSha(Z)!==Q)return;await $.updateRef(Z,X,{force:!0})}catch{}}function Xp6($,Z,Q,X){let Y=Q?`chore(decofile): sync ${$} with ${Z} (branch content wins)`:`chore(decofile): sync ${$} with ${Z}`,G=Yp6(X);return G.length>0?`${Y}
4312
+ Respond with the structured verdict and a short reason.`,hY8;var cY8=L(()=>{p4();OU();RO1();Ki6=IO1.object({requiresReview:IO1.boolean().describe("true if the changes should go through pull-request review"),reason:IO1.string().describe("One short sentence explaining the decision (max ~120 chars)")});hY8={requiresReview:!1,reason:""}});async function Bk0($,Z,Q){if(!Q.connectionId)throw new m4(401,"AUTH","connection","Project's GitHub connection is missing \u2014 reconnect GitHub");let X=await $.storage.connections.findById(Q.connectionId,Z);if(!X)throw new m4(401,"AUTH","connection","Project's GitHub connection is missing \u2014 reconnect GitHub");let Y=await mz($,X);if(!Y)throw new m4(401,"AUTH","connection",w9);return jV0({owner:Q.owner,repo:Q.name,accessToken:Y})}var qO1=L(()=>{ju();nJ();kw()});function Fi6($){if(!$||$.includes("\\")||$.includes("..")||$.includes("\x00"))return!0;try{let Z=decodeURIComponent($);if(Z.includes("\\")||Z.includes("..")||Z.includes("\x00"))return!0;return!1}catch{return!0}}function Ok0($){if(Fi6($))throw Error(`Invalid block key: ${$||"(empty)"}`)}function MO1($){return/\.(?:tsx?|jsx?|mts|cts|mjs|cjs)$/.test($)}function Q$0($){try{return decodeURIComponent($)}catch{return $}}function VO1($){return Ok0($),encodeURIComponent($)}function X$0($){let Z=$.map((J)=>({file:J,name:`${J.stem}.json`})).sort((J,K)=>J.name<K.name?-1:J.name>K.name?1:0),Q=[],X=new Set,Y="{",G=!0;for(let{file:J}of Z){let K=J.content.trim();if(K.length===0)continue;let W=Q$0(J.stem);if(X.has(W)){Q.push({key:W,stem:J.stem,error:`duplicate block key "${W}" (another file already maps to it)`});continue}try{JSON.parse(K)}catch(H){Q.push({key:W,stem:J.stem,error:H instanceof Error?H.message:String(H)});continue}if(X.add(W),!G)Y+=",";G=!1,Y+=`${JSON.stringify(W)}:${K}`}return{decofile:`${Y}}`,skipped:Q}}var lY8=()=>{};var Lk0=L(()=>{lY8()});function Ni6($){return $.startsWith("merged/")?"merged":"blobs"}function kO1($,Z){let Q=new Map;for(let G of $){let J=Q.get(G.path);if(!J||G.mtimeMs>=J.mtimeMs)Q.set(G.path,{bytes:G.bytes,mtimeMs:G.mtimeMs})}let X=[...Q.entries()].sort((G,J)=>G[1].mtimeMs-J[1].mtimeMs),Y={config:Z,entries:new Map,totalBytes:0,areaBytes:{blobs:0,merged:0}};for(let[G,{bytes:J}]of X){let K=Ni6(G);Y.entries.set(G,{bytes:J,area:K}),Y.totalBytes+=J,Y.areaBytes[K]+=J}return Y}function mY8($,Z){let Q=$.entries.get(Z);if(!Q)return;$.entries.delete(Z),$.entries.set(Z,Q)}function xm($,Z){let Q=$.entries.get(Z);if(!Q)return;$.entries.delete(Z),$.totalBytes-=Q.bytes,$.areaBytes[Q.area]-=Q.bytes}function dY8($,Z){let{path:Q,bytes:X,area:Y}=Z,{config:G}=$;if(!Number.isFinite(X)||X<0||X>G.maxEntryBytes[Y]||X>G.maxTotalBytes||Y==="merged"&&X>G.maxMergedBytes)return{admitted:!1,evict:[]};let K=$.entries.get(Q),W=$.totalBytes-(K?.bytes??0),H=$.areaBytes.merged-(K?.area==="merged"?K.bytes:0),F=[],N=new Set;if(Y==="merged")for(let[U,B]of $.entries){if(H+X<=G.maxMergedBytes)break;if(U===Q||B.area!=="merged")continue;F.push(U),N.add(U),H-=B.bytes,W-=B.bytes}for(let[U,B]of $.entries){if(W+X<=G.maxTotalBytes)break;if(U===Q||N.has(U))continue;F.push(U),N.add(U),W-=B.bytes}for(let U of F)xm($,U);return xm($,Q),$.entries.set(Q,{bytes:X,area:Y}),$.totalBytes+=X,$.areaBytes[Y]+=X,{admitted:!0,evict:F}}function Y$0($){if($==="")throw TypeError("cache path segment must not be empty");let Z=$.toLowerCase(),Q="";for(let X of new TextEncoder().encode(Z)){let Y=String.fromCharCode(X);Q+=/[a-z0-9._-]/.test(Y)?Y:`%${X.toString(16).padStart(2,"0")}`}if(Q==="."||Q==="..")Q=Q.replaceAll(".","%2e");return Q}function SO1($){return/^[0-9a-f]{40}$/.test($)}import{randomUUID as rY8}from"crypto";import{mkdir as G$0,readdir as Ui6,readFile as Bi6,rename as Oi6,rm as aY8,stat as sY8,statfs as Li6,unlink as Di6,writeFile as wi6}from"fs/promises";import{tmpdir as Ei6}from"os";import{dirname as ji6,join as t7}from"path";function fm($,Z){let Q=Bun.env[$];if(Q===void 0||Q==="")return Z;let X=Number(Q);return Number.isFinite(X)&&X>=0?Math.floor(X):Z}function Ai6(){if(Dk0)return Dk0;let $=Bun.env.FAST_PREVIEW_CACHE_DIR,Z=$===void 0?t7(Ei6(),"studio-fast-preview-cache"):$;return Dk0={enabled:Z!=="",root:Z,index:{maxTotalBytes:fm("FAST_PREVIEW_CACHE_MAX_BYTES",2*iY8),maxMergedBytes:fm("FAST_PREVIEW_CACHE_MERGED_MAX_BYTES",512*wk0),maxEntryBytes:{blobs:fm("FAST_PREVIEW_CACHE_MAX_BLOB_BYTES",wk0),merged:fm("FAST_PREVIEW_CACHE_MAX_MERGED_BYTES",32*wk0)}},freeFloorBytes:fm("FAST_PREVIEW_CACHE_FREE_FLOOR_BYTES",iY8),sweepIntervalMs:fm("FAST_PREVIEW_CACHE_SWEEP_INTERVAL_MS",600000)},Dk0}function Ti6(){return{hits:{blobs:0,merged:0},misses:{blobs:0,merged:0},evictions:0,errors:0,floorSkips:0,invalidKeySkips:0,admissionRefusals:0}}function Ri6(){if(fw)return;fw={hits:U$.createCounter("fast_preview_cache_hits",{description:"Decofile disk cache hits by area",unit:"{reads}"}),misses:U$.createCounter("fast_preview_cache_misses",{description:"Decofile disk cache misses by area",unit:"{reads}"}),evictions:U$.createCounter("fast_preview_cache_evictions",{description:"Decofile disk cache entries evicted",unit:"{entries}"}),errors:U$.createCounter("fast_preview_cache_errors",{description:"Decofile disk cache swallowed errors by operation",unit:"{errors}"}),floorSkips:U$.createCounter("fast_preview_cache_floor_skips",{description:"Decofile disk cache writes skipped by the free-space floor",unit:"{writes}"})},U$.createObservableGauge("fast_preview_cache_bytes",{description:"Decofile disk cache bytes by area",unit:"By"}).addCallback(($)=>{if(!bm)return;$.observe(bm.index.areaBytes.blobs,{area:"blobs"}),$.observe(bm.index.areaBytes.merged,{area:"merged"})}),U$.createObservableGauge("fast_preview_cache_entries",{description:"Decofile disk cache entry count by area",unit:"{entries}"}).addCallback(($)=>{if(!bm)return;let Z={blobs:0,merged:0};for(let Q of bm.index.entries.values())Z[Q.area]+=1;$.observe(Z.blobs,{area:"blobs"}),$.observe(Z.merged,{area:"merged"})})}function Ii6($){Ef.hits[$]+=1,fw?.hits.add(1,{area:$})}function pY8($){Ef.misses[$]+=1,fw?.misses.add(1,{area:$})}function CO1(){Ef.evictions+=1,fw?.evictions.add(1)}function JB($){Ef.errors+=1,fw?.errors.add(1,{op:$})}function qi6($){Ef.invalidKeySkips+=1,fw?.errors.add(1,{op:`${$}_invalid_key`})}function _O1(){return nY8??=Vi6(),nY8}async function Vi6(){let $=Ai6();if(!$.enabled)return null;Ri6();try{await G$0(t7($.root,"blobs"),{recursive:!0}),await G$0(t7($.root,"merged"),{recursive:!0}),await G$0(t7($.root,"tmp"),{recursive:!0})}catch{return JB("init"),null}let Z=[];try{Z=await eY8($.root)}catch{JB("scan"),Z=[]}let Q={root:$.root,index:kO1(Z,$.index),cfg:$};return bm=Q,Ci6(Q),Q}async function Ek0($){try{return await Ui6($)}catch{return[]}}async function eY8($){let Z=[];for(let Q of["blobs","merged"]){let X=t7($,Q);for(let Y of await Ek0(X)){let G=t7(X,Y);for(let J of await Ek0(G)){let K=t7(G,J);for(let W of await Ek0(K))try{let H=await sY8(t7(K,W));if(!H.isFile())continue;Z.push({path:`${Q}/${Y}/${J}/${W}`,bytes:H.size,mtimeMs:H.mtimeMs})}catch{}}}}return Z}function $G8($,Z,Q){if(!SO1(Q))return null;try{return`blobs/${Y$0($)}/${Y$0(Z)}/${Q}`}catch{return null}}function ZG8($,Z,Q){if(!SO1(Q))return null;try{return`merged/${Y$0($)}/${Y$0(Z)}/${Q}.json`}catch{return null}}async function QG8($,Z){try{let Q=await _O1();if(!Q)return null;if(Z===null)return pY8($),null;try{let X=await Bi6(t7(Q.root,Z),"utf8");return mY8(Q.index,Z),Ii6($),X}catch{return pY8($),null}}catch{return JB(`get_${$}`),null}}function XG8($,Z,Q){return QG8("blobs",$G8($,Z,Q))}function YG8($,Z,Q){return QG8("merged",ZG8($,Z,Q))}async function ki6($){if($.cfg.freeFloorBytes<=0)return!0;try{let Z=await Li6($.root);return Z.bavail*Z.bsize>=$.cfg.freeFloorBytes}catch{return!0}}async function jk0($){try{await Di6($)}catch{}}async function Si6($){try{let Z=$.cfg.index.maxTotalBytes/2;while($.index.totalBytes>Z){let Q=$.index.entries.keys().next();if(Q.done)break;xm($.index,Q.value),await jk0(t7($.root,Q.value)),CO1()}}catch{JB("emergency_evict")}}async function GG8($,Z,Q,X){try{let Y=await _O1();if(!Y)return;if(Q===null){qi6(Z);return}if(!await ki6(Y)){Ef.floorSkips+=1,fw?.floorSkips.add(1);return}let G=Buffer.byteLength(X,"utf8"),J=dY8(Y.index,{path:Q,bytes:G,area:$});if(!J.admitted){Ef.admissionRefusals+=1;return}for(let W of J.evict)await jk0(t7(Y.root,W)),CO1();let K=t7(Y.root,"tmp",`stage-${rY8()}`);try{await wi6(K,X,"utf8");let W=t7(Y.root,Q);await G$0(ji6(W),{recursive:!0}),await Oi6(K,W)}catch(W){if(xm(Y.index,Q),await jk0(K),JB(Z),W?.code==="ENOSPC")await Si6(Y)}}catch{JB(Z)}}function zk0($,Z,Q,X){return GG8("blobs","put_blob",$G8($,Z,Q),X)}function JG8($,Z,Q,X){return GG8("merged","put_merged",ZG8($,Z,Q),X)}async function KG8(){try{let $=await _O1();if(!$)return null;let Z=t7($.root,"tmp",rY8());return await G$0(Z,{recursive:!0}),Z}catch{return JB("make_scratch"),null}}async function WG8($){try{await aY8($,{recursive:!0,force:!0})}catch{JB("remove_scratch")}}function Ci6($){let Z=$.cfg.sweepIntervalMs;if(Z<=0)return;tY8=new AbortController,H$(Math.random()*Z,{signal:tY8.signal}).then(()=>{oY8($);let Q=setInterval(()=>void oY8($),Z);Q.unref?.(),Mi6=Q}).catch(()=>{})}async function oY8($){try{let Z=kO1(await eY8($.root),$.cfg.index),Q=$.cfg.index;for(let[G,J]of Z.entries){let K=Z.totalBytes>Q.maxTotalBytes,W=Z.areaBytes.merged>Q.maxMergedBytes;if(!K&&!W)break;if(!K&&W&&J.area!=="merged")continue;xm(Z,G),await jk0(t7($.root,G)),CO1()}$.index=Z;let X=t7($.root,"tmp"),Y=Date.now();for(let G of await Ek0(X)){let J=t7(X,G);try{let K=await sY8(J);if(Y-K.mtimeMs>Pi6)await aY8(J,{recursive:!0,force:!0})}catch{}}}catch{JB("sweep")}}var zi6=1024,wk0,iY8,Pi6=3600000,Dk0=null,fw=null,Ef,nY8=null,bm=null,Mi6=null,tY8=null;var HG8=L(()=>{J4();A6();wk0=1024*zi6,iY8=1024*wk0;Ef=Ti6()});function FG8(){let $=new Map;return{run(Z,Q){let X=$.get(Z);if(X)return X;let Y=Promise.resolve().then(Q).finally(()=>{$.delete(Z)});return $.set(Z,Y),Y}}}import{readdir as _i6,stat as vi6}from"fs/promises";import{join as NG8}from"path";function xi6($,Z,Q){let X=["-xz","--strip-components=1","-C",Z];return $==="gnu"?[...X,"--wildcards",Q]:[...X,Q]}function fi6(){return UG8??=(async()=>{try{let $=Bun.spawn(["tar","--version"],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),Z=await new Response($.stdout).text();return await $.exited,Z.includes("GNU")?"gnu":"bsd"}catch{return"bsd"}})(),UG8}async function BG8($,Z,Q){let X=Q.replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");if(X===""||X.split("/").includes(".."))throw new J$0(`invalid blocks path prefix: ${Q}`);let Y=await fi6(),G=`*/${X}/*.json`,J=()=>Bun.spawn(["tar",...xi6(Y,Z,G)],{stdin:$,stdout:"ignore",stderr:"pipe"}),K;try{K=J()}catch(N){throw new J$0("failed to spawn tar",{cause:N})}let W=new Response(K.stderr).text().catch(()=>""),H=await K.exited;if(H!==0){let N=(await W).trim().slice(0,500);throw new J$0(`tar exited with code ${H}${N?`: ${N}`:""}`)}let F=await bi6(Z,X);if(F.length===0)throw new J$0(`tar extracted no ${G} members into ${Z}`);return F}async function bi6($,Z){let Q=NG8($,...Z.split("/")),X;try{X=await _i6(Q)}catch{return[]}let Y=[];for(let G of X){if(!G.endsWith(".json"))continue;let J=NG8(Q,G);try{if(!(await vi6(J)).isFile())continue}catch{continue}Y.push({path:`${Z}/${G}`,diskPath:J})}return Y.sort((G,J)=>G.path.localeCompare(J.path))}var J$0,UG8=null;var OG8=L(()=>{J$0=class J$0 extends Error{constructor($,Z){super($,Z);this.name="TarExtractError"}}});import{createHash as yi6}from"crypto";import{readFile as gi6}from"fs/promises";async function ym($,Z){try{return await $.getHeadSha(Z)}catch(X){if(!(X instanceof m4)||X.status!==404)throw X}let Q=await $.getHeadSha(await $.getDefaultBranch());try{return await $.createRef(Z,Q),Q}catch(X){if(X instanceof m4&&X.status===422)return $.getHeadSha(Z);throw X}}function ui6(){let $=Bun.env.FAST_PREVIEW_COLD_TARBALL_MAX_BYTES;if($===void 0||$==="")return DG8;let Z=Number($);return Number.isFinite(Z)&&Z>=0?Math.floor(Z):DG8}function ci6($){wG8??=U$.createCounter("decofile_cold_reads",{description:"Decofile cold snapshot reads by resolution path",unit:"{reads}"}),wG8.add(1,{path:$})}function li6($){EG8??=U$.createCounter("decofile_skipped_blocks",{description:"Decofile blocks dropped from a merge for not being valid JSON",unit:"{blocks}"}),EG8.add($)}async function Pk0($,Z,Q){let X=Array($.length),Y=0,G=Array.from({length:Math.min(Z,$.length)},async()=>{for(;;){let J=Y++;if(J>=$.length)return;X[J]=await Q($[J])}});return await Promise.all(G),X}function Ak0($){return $?`${$}/.deco/blocks`:".deco/blocks"}function vO1($,Z){let Q=`${Ak0(Z)}/`,X=[];for(let Y of $){if(Y.type!=="blob"||!Y.path.startsWith(Q))continue;let G=Y.path.slice(Q.length);if(G.includes("/"))continue;if(!G.toLowerCase().endsWith(".json"))continue;X.push({stem:G.slice(0,-5),sha:Y.sha,path:Y.path,size:Y.size})}return X}function xO1($,Z){return $.filter((Q)=>Q$0(Q.stem)===Z).map((Q)=>Q.path).sort()}function jG8($,Z,Q,X){return zk0($,Z,Q,X)}function di6($,Z){return yi6("sha1").update(`${mi6}:${$}:${Z??""}`).digest("hex")}async function zG8($,Z,Q,X){let Y=X?.createBranchIfMissing?await ym($,Z):await $.getHeadSha(Z);return ii6.run(`${$.owner}/${$.repo}@${Y}:${Q??""}`,()=>pi6($,Y,Q))}async function pi6($,Z,Q){let{owner:X,repo:Y}=$,G=di6(Z,Q),J=await YG8(X,Y,G);if(J!==null)return{sha:Z,decofile:J};let K=await $.getCommitTreeSha(Z),W=await $.getDecofileTree(K,Q),H=vO1(W,Q),F=new Map;if(await Pk0(H,LG8,async(D)=>{let w=await XG8(X,Y,D.sha);if(w!==null)F.set(D.path,w)}),H.length-F.size>hi6){let D=await ni6($,Z,Q,H);if(ci6(D!==null?"tarball":"blobs"),D!==null)for(let[w,E]of D)F.set(w,E)}let U=await Pk0(H,LG8,async(D)=>{let w=F.get(D.path);if(w!==void 0)return{stem:D.stem,content:w};let E=await $.getBlobText(D.sha);return await zk0(X,Y,D.sha,E),{stem:D.stem,content:E}}),{decofile:B,skipped:O}=X$0(U);if(O.length>0)li6(O.length),console.warn("decofile read: dropped blocks that were not valid JSON",{repo:`${X}/${Y}`,sha:Z,packagePath:Q,blocks:O.map((D)=>D.key)});return await JG8(X,Y,G,B),{sha:Z,decofile:B}}async function ni6($,Z,Q,X){let Y=`${$.owner}/${$.repo}`,G=ui6(),J=0;for(let W of X){if(W.size===void 0)return console.warn("decofile cold read: tarball skipped (tree entry missing size; cannot pre-validate)",{repo:Y,sha:Z,path:W.path}),null;J+=W.size}if(J>G)return console.warn("decofile cold read: tarball skipped (blocks over FAST_PREVIEW_COLD_TARBALL_MAX_BYTES)",{repo:Y,sha:Z,aggregateBytes:J,maxBytes:G}),null;let K=await KG8();if(K===null)return null;try{let W=await $.getTarballStream(Z),H=await BG8(W,K,Ak0(Q)),F=new Map(X.map((U)=>[U.path,U.sha])),N=new Map;for(let U of H){let B=F.get(U.path);if(B===void 0)continue;let O=await gi6(U.diskPath,"utf8");await zk0($.owner,$.repo,B,O),N.set(U.path,O)}return N}catch(W){return console.warn("decofile cold read: tarball path failed; falling back to blob fetches",{repo:Y,sha:Z,error:W instanceof Error?W.message:String(W)}),null}finally{await WG8(K)}}var LG8=12,hi6=50,DG8=134217728,wG8=null,EG8=null,mi6="3",ii6;var Tk0=L(()=>{Lk0();A6();HG8();kw();OG8();ii6=FG8()});function oi6($){if($==="added"||$==="copied")return"added";if($==="removed")return"removed";if($==="renamed")return"renamed";return"modified"}function PG8($){let{base:Z,branch:Q,headSha:X,compared:Y}=$,G=Y.files.slice(0,AG8).map((J)=>({path:J.filename,status:oi6(J.status),...J.previousFilename?{previousPath:J.previousFilename}:{}}));return{not_added:[],conflicted:[],created:[],deleted:[],modified:[],renamed:[],files:[],staged:[],ahead:0,behind:0,current:Q,tracking:`origin/${Q}`,detached:!1,base:Z,aheadOfBase:Y.aheadBy,behindBase:Y.behindBy,headSha:X,unpushed:0,changedFiles:G,changedFilesTotal:Y.files.length,changedFilesTruncated:Y.files.length>G.length}}async function ai6($,Z,Q,X){try{return await $.compareDetailed(Z,Q)}catch(Y){if(!(Y instanceof m4)||Y.status!==404)throw Y;return await X,$.compareDetailed(Z,Q)}}async function Rk0($,Z){let Q=await $.getDefaultBranch();if(Q===Z){let J=await ym($,Z);return PG8({base:Q,branch:Z,headSha:J,compared:ri6})}let X=ym($,Z),[Y,G]=await Promise.all([X,ai6($,Q,Z,X)]);return PG8({base:Q,branch:Z,headSha:Y,compared:G})}async function Ik0($,Z,Q){let X=Q??await $.getDefaultBranch(),Y=await $.compareDetailed(X,Z),G=Y.files.slice(0,AG8);if(G.length===0)return{diffs:{},mergeBaseSha:Y.mergeBaseSha};let J=await Pk0(G,ti6,async(K)=>{let W=K.previousFilename??K.filename,[H,F]=await Promise.all([K.status==="added"?null:$.getFileTextAtRef(Y.mergeBaseSha,W),K.status==="removed"?null:$.getBlobText(K.sha)]);return[K.filename,{from:H,to:F}]});return{diffs:Object.fromEntries(J),mergeBaseSha:Y.mergeBaseSha}}async function qk0($,Z,Q){for(let X=1;;X++){let[Y,G]=await Promise.all([$.getHeadSha(Z),$.compareDetailed(Q,Z)]);if(G.behindBy===0&&G.aheadBy<=1)return;let J=await $.getHeadSha(Q);if(G.aheadBy===0)try{await $.updateRef(Z,J);return}catch(N){if(!(N instanceof m4&&N.status===422))throw N;if(X>=fO1)throw N;continue}let K,W=!1,H=null;try{let N=await $.mergeBranch(Z,Q,`chore(decofile): merge ${Q} into ${Z}`);if(N===null)K=await $.getCommitTreeSha(Y);else K=await $.getCommitTreeSha(N),H=N}catch(N){if(!(N instanceof m4&&N.status===409))throw N;K=await Zp6($,G.files,Y,J),W=!0}let F=H??Y;try{let N=await $.createCommit({message:Xp6(Z,Q,W,G.commitMessages),treeSha:K,parentShas:[J]});if(await $.getHeadSha(Z)!==F){if(X<fO1)continue;throw new m4(409,"PATCH",`git/refs/heads/${Z}`,`${Z} kept changing while syncing with ${Q}; try again`)}await $.updateRef(Z,N,{force:!0});return}catch(N){throw await Qp6($,Z,H,Y),N}}}function ei6($,Z){let Q=new Map;for(let X of $){let Y=Z.get(X.filename);Q.set(X.filename,{path:X.filename,mode:Y?.mode??"100644",type:"blob",sha:X.status==="removed"||!Y?null:Y.sha})}for(let X of $)if(X.previousFilename&&X.previousFilename!==X.filename&&!Q.has(X.previousFilename))Q.set(X.previousFilename,{path:X.previousFilename,mode:"100644",type:"blob",sha:null});return[...Q.values()]}function $p6($,Z,Q){let X=[];for(let Y of $){let G=Z.get(Y),J=Q.get(Y);if(G?.sha===J?.sha)continue;if(!G&&!J)continue;X.push({path:Y,mode:G?.mode??"100644",type:"blob",sha:G?.sha??null})}return X}async function TG8($,Z,Q){if(Q.length===0)return;let X=await $.getDefaultBranch();for(let Y=1;;Y++){let G=await $.getHeadSha(Z),{mergeBaseSha:J}=await $.compareDetailed(X,Z),[K,W]=await Promise.all([$.getBlobsAtPaths(await $.getCommitTreeSha(J),Q),$.getBlobsAtPaths(await $.getCommitTreeSha(G),Q)]),H=$p6(Q,K,W);if(H.length===0)return;let F=await $.createTree(await $.getCommitTreeSha(G),H),N=await $.createCommit({message:`chore(decofile): discard changes to ${H.length} file(s)`,treeSha:F,parentShas:[G]});try{await $.updateRef(Z,N);return}catch(U){if(U instanceof m4&&U.status===422&&Y<fO1)continue;throw U}}}async function Zp6($,Z,Q,X){if(Z.length>=si6)throw new m4(409,"POST","merges",`Too many changed files on the branch to auto-merge (${Z.length}); resolve on GitHub`);let Y=await $.getBlobsAtPaths(await $.getCommitTreeSha(Q),Z.map((G)=>G.filename));return $.createTree(await $.getCommitTreeSha(X),ei6(Z,Y))}async function Qp6($,Z,Q,X){if(Q===null)return;try{if(await $.getHeadSha(Z)!==Q)return;await $.updateRef(Z,X,{force:!0})}catch{}}function Xp6($,Z,Q,X){let Y=Q?`chore(decofile): sync ${$} with ${Z} (branch content wins)`:`chore(decofile): sync ${$} with ${Z}`,G=Yp6(X);return G.length>0?`${Y}
4313
4313
 
4314
4314
  ${G.join(`
4315
4315
  `)}`:Y}function Yp6($){let Z=new Set;for(let Q of $)for(let X of Q.split(`